@yefengr/pi-reach 0.0.4 → 0.0.6
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/dist/attachments/reservation.fixture.d.ts +1 -0
- package/dist/attachments/reservation.fixture.js +25 -0
- package/dist/attachments/reservation.fixture.js.map +1 -0
- package/dist/attachments/reservations.d.ts +21 -0
- package/dist/attachments/reservations.js +189 -0
- package/dist/attachments/reservations.js.map +1 -0
- package/dist/attachments/safe-files.d.ts +17 -0
- package/dist/attachments/safe-files.js +108 -0
- package/dist/attachments/safe-files.js.map +1 -0
- package/dist/attachments/storage-path.d.ts +4 -0
- package/dist/attachments/storage-path.js +47 -0
- package/dist/attachments/storage-path.js.map +1 -0
- package/dist/attachments/store.d.ts +55 -0
- package/dist/attachments/store.js +536 -0
- package/dist/attachments/store.js.map +1 -0
- package/dist/attachments/types.d.ts +48 -0
- package/dist/attachments/types.js +20 -0
- package/dist/attachments/types.js.map +1 -0
- package/dist/index.js +30 -24
- package/dist/index.js.map +1 -1
- package/dist/runtime/attachment_binding.d.ts +17 -0
- package/dist/runtime/attachment_binding.js +70 -0
- package/dist/runtime/attachment_binding.js.map +1 -0
- package/dist/runtime/create_owner_binding.d.ts +27 -0
- package/dist/runtime/create_owner_binding.js +22 -0
- package/dist/runtime/create_owner_binding.js.map +1 -0
- package/dist/timeline/attachment_content.d.ts +21 -0
- package/dist/timeline/attachment_content.js +83 -0
- package/dist/timeline/attachment_content.js.map +1 -0
- package/dist/timeline/attachment_delivery.d.ts +65 -0
- package/dist/timeline/attachment_delivery.js +150 -0
- package/dist/timeline/attachment_delivery.js.map +1 -0
- package/dist/timeline/runtime.d.ts +4 -2
- package/dist/timeline/runtime.js +33 -34
- package/dist/timeline/runtime.js.map +1 -1
- package/dist/timeline/user_delivery.d.ts +7 -0
- package/dist/timeline/user_delivery.js +21 -12
- package/dist/timeline/user_delivery.js.map +1 -1
- package/dist/timeline/user_delivery_binding.d.ts +6 -1
- package/dist/timeline/user_delivery_binding.js +17 -1
- package/dist/timeline/user_delivery_binding.js.map +1 -1
- package/dist/timeline/v2_service.d.ts +6 -1
- package/dist/timeline/v2_service.js +16 -8
- package/dist/timeline/v2_service.js.map +1 -1
- package/dist/vendor/protocol/session/attachments.d.ts +78 -0
- package/dist/vendor/protocol/session/attachments.js +150 -0
- package/dist/vendor/protocol/session/frames.d.ts +500 -0
- package/dist/vendor/protocol/session/frames.js +37 -4
- package/dist/vendor/protocol/session/index.d.ts +1 -0
- package/dist/vendor/protocol/session/index.js +1 -0
- package/dist/vendor/protocol/session/schema.d.ts +2 -2
- package/dist/vendor/protocol/session/schema.js +2 -0
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ export declare const userMessageFrameSchema: z.ZodObject<{
|
|
|
28
28
|
data: z.ZodString;
|
|
29
29
|
mime: z.ZodString;
|
|
30
30
|
}, z.core.$strict>>>;
|
|
31
|
+
attachment_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
32
|
streaming_behavior: z.ZodOptional<z.ZodLiteral<"steer">>;
|
|
32
33
|
channel_id: z.ZodString;
|
|
33
34
|
session_id: z.ZodString;
|
|
@@ -167,6 +168,81 @@ export declare const approveToolFrameSchema: z.ZodObject<{
|
|
|
167
168
|
type: z.ZodLiteral<"approve_tool">;
|
|
168
169
|
id: z.ZodString;
|
|
169
170
|
}, z.core.$strict>;
|
|
171
|
+
export declare const attachmentCapabilitiesRequestFrameSchema: z.ZodObject<{
|
|
172
|
+
channel_id: z.ZodString;
|
|
173
|
+
session_id: z.ZodString;
|
|
174
|
+
leaf_id: z.ZodNullable<z.ZodString>;
|
|
175
|
+
protocol_version: z.ZodLiteral<2>;
|
|
176
|
+
type: z.ZodLiteral<"attachment_capabilities_request">;
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
export declare const attachmentBeginFrameSchema: z.ZodObject<{
|
|
180
|
+
upload_id: z.ZodString;
|
|
181
|
+
file_name: z.ZodString;
|
|
182
|
+
mime_type: z.ZodString;
|
|
183
|
+
byte_length: z.ZodNumber;
|
|
184
|
+
sha256: z.ZodString;
|
|
185
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
186
|
+
mime_type: z.ZodLiteral<"image/jpeg">;
|
|
187
|
+
data: z.ZodString;
|
|
188
|
+
byte_length: z.ZodNumber;
|
|
189
|
+
width: z.ZodNumber;
|
|
190
|
+
height: z.ZodNumber;
|
|
191
|
+
}, z.core.$strict>>;
|
|
192
|
+
channel_id: z.ZodString;
|
|
193
|
+
session_id: z.ZodString;
|
|
194
|
+
upload_scope: z.ZodString;
|
|
195
|
+
protocol_version: z.ZodLiteral<2>;
|
|
196
|
+
type: z.ZodLiteral<"attachment_begin">;
|
|
197
|
+
id: z.ZodString;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
export declare const attachmentChunkFrameSchema: z.ZodObject<{
|
|
200
|
+
upload_id: z.ZodString;
|
|
201
|
+
offset: z.ZodNumber;
|
|
202
|
+
data_base64: z.ZodString;
|
|
203
|
+
channel_id: z.ZodString;
|
|
204
|
+
session_id: z.ZodString;
|
|
205
|
+
upload_scope: z.ZodString;
|
|
206
|
+
protocol_version: z.ZodLiteral<2>;
|
|
207
|
+
type: z.ZodLiteral<"attachment_chunk">;
|
|
208
|
+
id: z.ZodString;
|
|
209
|
+
}, z.core.$strict>;
|
|
210
|
+
export declare const attachmentFinishFrameSchema: z.ZodObject<{
|
|
211
|
+
upload_id: z.ZodString;
|
|
212
|
+
channel_id: z.ZodString;
|
|
213
|
+
session_id: z.ZodString;
|
|
214
|
+
upload_scope: z.ZodString;
|
|
215
|
+
protocol_version: z.ZodLiteral<2>;
|
|
216
|
+
type: z.ZodLiteral<"attachment_finish">;
|
|
217
|
+
id: z.ZodString;
|
|
218
|
+
}, z.core.$strict>;
|
|
219
|
+
export declare const attachmentStatusRequestFrameSchema: z.ZodObject<{
|
|
220
|
+
upload_id: z.ZodString;
|
|
221
|
+
channel_id: z.ZodString;
|
|
222
|
+
session_id: z.ZodString;
|
|
223
|
+
upload_scope: z.ZodString;
|
|
224
|
+
protocol_version: z.ZodLiteral<2>;
|
|
225
|
+
type: z.ZodLiteral<"attachment_status_request">;
|
|
226
|
+
id: z.ZodString;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
export declare const attachmentCancelFrameSchema: z.ZodObject<{
|
|
229
|
+
upload_id: z.ZodString;
|
|
230
|
+
channel_id: z.ZodString;
|
|
231
|
+
session_id: z.ZodString;
|
|
232
|
+
upload_scope: z.ZodString;
|
|
233
|
+
protocol_version: z.ZodLiteral<2>;
|
|
234
|
+
type: z.ZodLiteral<"attachment_cancel">;
|
|
235
|
+
id: z.ZodString;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
export declare const attachmentDiscardFrameSchema: z.ZodObject<{
|
|
238
|
+
attachment_id: z.ZodString;
|
|
239
|
+
channel_id: z.ZodString;
|
|
240
|
+
session_id: z.ZodString;
|
|
241
|
+
upload_scope: z.ZodString;
|
|
242
|
+
protocol_version: z.ZodLiteral<2>;
|
|
243
|
+
type: z.ZodLiteral<"attachment_discard">;
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
}, z.core.$strict>;
|
|
170
246
|
export declare const pairOkFrameSchema: z.ZodObject<{
|
|
171
247
|
type: z.ZodLiteral<"pair_ok">;
|
|
172
248
|
in_reply_to: z.ZodString;
|
|
@@ -1515,6 +1591,112 @@ export declare const byeFrameSchema: z.ZodObject<{
|
|
|
1515
1591
|
leaf_id: z.ZodNullable<z.ZodString>;
|
|
1516
1592
|
protocol_version: z.ZodLiteral<2>;
|
|
1517
1593
|
}, z.core.$strict>;
|
|
1594
|
+
export declare const attachmentCapabilitiesFrameSchema: z.ZodObject<{
|
|
1595
|
+
type: z.ZodLiteral<"attachment_capabilities">;
|
|
1596
|
+
max_file_bytes: z.ZodLiteral<number>;
|
|
1597
|
+
max_message_bytes: z.ZodLiteral<number>;
|
|
1598
|
+
max_attachments: z.ZodLiteral<10>;
|
|
1599
|
+
chunk_bytes: z.ZodLiteral<number>;
|
|
1600
|
+
max_in_flight: z.ZodLiteral<2>;
|
|
1601
|
+
in_reply_to: z.ZodString;
|
|
1602
|
+
session_id: z.ZodString;
|
|
1603
|
+
upload_scope: z.ZodString;
|
|
1604
|
+
target_channel_id: z.ZodString;
|
|
1605
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1606
|
+
}, z.core.$strict>;
|
|
1607
|
+
export declare const attachmentStateFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1608
|
+
status: z.ZodLiteral<"receiving">;
|
|
1609
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
1610
|
+
upload_id: z.ZodString;
|
|
1611
|
+
received_bytes: z.ZodNumber;
|
|
1612
|
+
in_reply_to: z.ZodString;
|
|
1613
|
+
session_id: z.ZodString;
|
|
1614
|
+
upload_scope: z.ZodString;
|
|
1615
|
+
target_channel_id: z.ZodString;
|
|
1616
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1617
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1618
|
+
status: z.ZodLiteral<"cancelled">;
|
|
1619
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
1620
|
+
upload_id: z.ZodString;
|
|
1621
|
+
received_bytes: z.ZodNumber;
|
|
1622
|
+
in_reply_to: z.ZodString;
|
|
1623
|
+
session_id: z.ZodString;
|
|
1624
|
+
upload_scope: z.ZodString;
|
|
1625
|
+
target_channel_id: z.ZodString;
|
|
1626
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1627
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1628
|
+
status: z.ZodLiteral<"complete">;
|
|
1629
|
+
attachment: z.ZodObject<{
|
|
1630
|
+
attachment_id: z.ZodString;
|
|
1631
|
+
file_name: z.ZodString;
|
|
1632
|
+
mime_type: z.ZodString;
|
|
1633
|
+
byte_length: z.ZodNumber;
|
|
1634
|
+
sha256: z.ZodString;
|
|
1635
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
1636
|
+
mime_type: z.ZodLiteral<"image/jpeg">;
|
|
1637
|
+
data: z.ZodString;
|
|
1638
|
+
byte_length: z.ZodNumber;
|
|
1639
|
+
width: z.ZodNumber;
|
|
1640
|
+
height: z.ZodNumber;
|
|
1641
|
+
}, z.core.$strict>>;
|
|
1642
|
+
}, z.core.$strict>;
|
|
1643
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
1644
|
+
upload_id: z.ZodString;
|
|
1645
|
+
received_bytes: z.ZodNumber;
|
|
1646
|
+
in_reply_to: z.ZodString;
|
|
1647
|
+
session_id: z.ZodString;
|
|
1648
|
+
upload_scope: z.ZodString;
|
|
1649
|
+
target_channel_id: z.ZodString;
|
|
1650
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1651
|
+
}, z.core.$strict>]>;
|
|
1652
|
+
export declare const attachmentErrorCodeSchema: z.ZodEnum<{
|
|
1653
|
+
cancelled: "cancelled";
|
|
1654
|
+
too_large: "too_large";
|
|
1655
|
+
invalid_scope: "invalid_scope";
|
|
1656
|
+
not_found: "not_found";
|
|
1657
|
+
invalid_upload: "invalid_upload";
|
|
1658
|
+
busy: "busy";
|
|
1659
|
+
no_space: "no_space";
|
|
1660
|
+
io_error: "io_error";
|
|
1661
|
+
integrity_mismatch: "integrity_mismatch";
|
|
1662
|
+
offset_mismatch: "offset_mismatch";
|
|
1663
|
+
}>;
|
|
1664
|
+
export declare const attachmentDiscardedFrameSchema: z.ZodObject<{
|
|
1665
|
+
type: z.ZodLiteral<"attachment_discarded">;
|
|
1666
|
+
attachment_id: z.ZodString;
|
|
1667
|
+
status: z.ZodEnum<{
|
|
1668
|
+
cancelled: "cancelled";
|
|
1669
|
+
retained: "retained";
|
|
1670
|
+
}>;
|
|
1671
|
+
in_reply_to: z.ZodString;
|
|
1672
|
+
session_id: z.ZodString;
|
|
1673
|
+
upload_scope: z.ZodString;
|
|
1674
|
+
target_channel_id: z.ZodString;
|
|
1675
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1676
|
+
}, z.core.$strict>;
|
|
1677
|
+
export declare const attachmentErrorFrameSchema: z.ZodObject<{
|
|
1678
|
+
type: z.ZodLiteral<"attachment_error">;
|
|
1679
|
+
upload_id: z.ZodOptional<z.ZodString>;
|
|
1680
|
+
attachment_id: z.ZodOptional<z.ZodString>;
|
|
1681
|
+
code: z.ZodEnum<{
|
|
1682
|
+
cancelled: "cancelled";
|
|
1683
|
+
too_large: "too_large";
|
|
1684
|
+
invalid_scope: "invalid_scope";
|
|
1685
|
+
not_found: "not_found";
|
|
1686
|
+
invalid_upload: "invalid_upload";
|
|
1687
|
+
busy: "busy";
|
|
1688
|
+
no_space: "no_space";
|
|
1689
|
+
io_error: "io_error";
|
|
1690
|
+
integrity_mismatch: "integrity_mismatch";
|
|
1691
|
+
offset_mismatch: "offset_mismatch";
|
|
1692
|
+
}>;
|
|
1693
|
+
retryable: z.ZodBoolean;
|
|
1694
|
+
in_reply_to: z.ZodString;
|
|
1695
|
+
session_id: z.ZodString;
|
|
1696
|
+
upload_scope: z.ZodString;
|
|
1697
|
+
target_channel_id: z.ZodString;
|
|
1698
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1699
|
+
}, z.core.$strict>;
|
|
1518
1700
|
export declare const clientFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1519
1701
|
type: z.ZodLiteral<"pair_request">;
|
|
1520
1702
|
id: z.ZodString;
|
|
@@ -1540,6 +1722,7 @@ export declare const clientFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1540
1722
|
data: z.ZodString;
|
|
1541
1723
|
mime: z.ZodString;
|
|
1542
1724
|
}, z.core.$strict>>>;
|
|
1725
|
+
attachment_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1543
1726
|
streaming_behavior: z.ZodOptional<z.ZodLiteral<"steer">>;
|
|
1544
1727
|
channel_id: z.ZodString;
|
|
1545
1728
|
session_id: z.ZodString;
|
|
@@ -1665,6 +1848,74 @@ export declare const clientFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1665
1848
|
protocol_version: z.ZodLiteral<2>;
|
|
1666
1849
|
type: z.ZodLiteral<"approve_tool">;
|
|
1667
1850
|
id: z.ZodString;
|
|
1851
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1852
|
+
channel_id: z.ZodString;
|
|
1853
|
+
session_id: z.ZodString;
|
|
1854
|
+
leaf_id: z.ZodNullable<z.ZodString>;
|
|
1855
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1856
|
+
type: z.ZodLiteral<"attachment_capabilities_request">;
|
|
1857
|
+
id: z.ZodString;
|
|
1858
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1859
|
+
upload_id: z.ZodString;
|
|
1860
|
+
file_name: z.ZodString;
|
|
1861
|
+
mime_type: z.ZodString;
|
|
1862
|
+
byte_length: z.ZodNumber;
|
|
1863
|
+
sha256: z.ZodString;
|
|
1864
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
1865
|
+
mime_type: z.ZodLiteral<"image/jpeg">;
|
|
1866
|
+
data: z.ZodString;
|
|
1867
|
+
byte_length: z.ZodNumber;
|
|
1868
|
+
width: z.ZodNumber;
|
|
1869
|
+
height: z.ZodNumber;
|
|
1870
|
+
}, z.core.$strict>>;
|
|
1871
|
+
channel_id: z.ZodString;
|
|
1872
|
+
session_id: z.ZodString;
|
|
1873
|
+
upload_scope: z.ZodString;
|
|
1874
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1875
|
+
type: z.ZodLiteral<"attachment_begin">;
|
|
1876
|
+
id: z.ZodString;
|
|
1877
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1878
|
+
upload_id: z.ZodString;
|
|
1879
|
+
offset: z.ZodNumber;
|
|
1880
|
+
data_base64: z.ZodString;
|
|
1881
|
+
channel_id: z.ZodString;
|
|
1882
|
+
session_id: z.ZodString;
|
|
1883
|
+
upload_scope: z.ZodString;
|
|
1884
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1885
|
+
type: z.ZodLiteral<"attachment_chunk">;
|
|
1886
|
+
id: z.ZodString;
|
|
1887
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1888
|
+
upload_id: z.ZodString;
|
|
1889
|
+
channel_id: z.ZodString;
|
|
1890
|
+
session_id: z.ZodString;
|
|
1891
|
+
upload_scope: z.ZodString;
|
|
1892
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1893
|
+
type: z.ZodLiteral<"attachment_finish">;
|
|
1894
|
+
id: z.ZodString;
|
|
1895
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1896
|
+
upload_id: z.ZodString;
|
|
1897
|
+
channel_id: z.ZodString;
|
|
1898
|
+
session_id: z.ZodString;
|
|
1899
|
+
upload_scope: z.ZodString;
|
|
1900
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1901
|
+
type: z.ZodLiteral<"attachment_status_request">;
|
|
1902
|
+
id: z.ZodString;
|
|
1903
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1904
|
+
upload_id: z.ZodString;
|
|
1905
|
+
channel_id: z.ZodString;
|
|
1906
|
+
session_id: z.ZodString;
|
|
1907
|
+
upload_scope: z.ZodString;
|
|
1908
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1909
|
+
type: z.ZodLiteral<"attachment_cancel">;
|
|
1910
|
+
id: z.ZodString;
|
|
1911
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1912
|
+
attachment_id: z.ZodString;
|
|
1913
|
+
channel_id: z.ZodString;
|
|
1914
|
+
session_id: z.ZodString;
|
|
1915
|
+
upload_scope: z.ZodString;
|
|
1916
|
+
protocol_version: z.ZodLiteral<2>;
|
|
1917
|
+
type: z.ZodLiteral<"attachment_discard">;
|
|
1918
|
+
id: z.ZodString;
|
|
1668
1919
|
}, z.core.$strict>]>;
|
|
1669
1920
|
export declare const serverFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1670
1921
|
type: z.ZodLiteral<"pair_ok">;
|
|
@@ -2995,6 +3246,96 @@ export declare const serverFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2995
3246
|
session_id: z.ZodString;
|
|
2996
3247
|
leaf_id: z.ZodNullable<z.ZodString>;
|
|
2997
3248
|
protocol_version: z.ZodLiteral<2>;
|
|
3249
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3250
|
+
type: z.ZodLiteral<"attachment_capabilities">;
|
|
3251
|
+
max_file_bytes: z.ZodLiteral<number>;
|
|
3252
|
+
max_message_bytes: z.ZodLiteral<number>;
|
|
3253
|
+
max_attachments: z.ZodLiteral<10>;
|
|
3254
|
+
chunk_bytes: z.ZodLiteral<number>;
|
|
3255
|
+
max_in_flight: z.ZodLiteral<2>;
|
|
3256
|
+
in_reply_to: z.ZodString;
|
|
3257
|
+
session_id: z.ZodString;
|
|
3258
|
+
upload_scope: z.ZodString;
|
|
3259
|
+
target_channel_id: z.ZodString;
|
|
3260
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3261
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
|
|
3262
|
+
status: z.ZodLiteral<"receiving">;
|
|
3263
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
3264
|
+
upload_id: z.ZodString;
|
|
3265
|
+
received_bytes: z.ZodNumber;
|
|
3266
|
+
in_reply_to: z.ZodString;
|
|
3267
|
+
session_id: z.ZodString;
|
|
3268
|
+
upload_scope: z.ZodString;
|
|
3269
|
+
target_channel_id: z.ZodString;
|
|
3270
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3271
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3272
|
+
status: z.ZodLiteral<"cancelled">;
|
|
3273
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
3274
|
+
upload_id: z.ZodString;
|
|
3275
|
+
received_bytes: z.ZodNumber;
|
|
3276
|
+
in_reply_to: z.ZodString;
|
|
3277
|
+
session_id: z.ZodString;
|
|
3278
|
+
upload_scope: z.ZodString;
|
|
3279
|
+
target_channel_id: z.ZodString;
|
|
3280
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3281
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3282
|
+
status: z.ZodLiteral<"complete">;
|
|
3283
|
+
attachment: z.ZodObject<{
|
|
3284
|
+
attachment_id: z.ZodString;
|
|
3285
|
+
file_name: z.ZodString;
|
|
3286
|
+
mime_type: z.ZodString;
|
|
3287
|
+
byte_length: z.ZodNumber;
|
|
3288
|
+
sha256: z.ZodString;
|
|
3289
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
3290
|
+
mime_type: z.ZodLiteral<"image/jpeg">;
|
|
3291
|
+
data: z.ZodString;
|
|
3292
|
+
byte_length: z.ZodNumber;
|
|
3293
|
+
width: z.ZodNumber;
|
|
3294
|
+
height: z.ZodNumber;
|
|
3295
|
+
}, z.core.$strict>>;
|
|
3296
|
+
}, z.core.$strict>;
|
|
3297
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
3298
|
+
upload_id: z.ZodString;
|
|
3299
|
+
received_bytes: z.ZodNumber;
|
|
3300
|
+
in_reply_to: z.ZodString;
|
|
3301
|
+
session_id: z.ZodString;
|
|
3302
|
+
upload_scope: z.ZodString;
|
|
3303
|
+
target_channel_id: z.ZodString;
|
|
3304
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3305
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
3306
|
+
type: z.ZodLiteral<"attachment_error">;
|
|
3307
|
+
upload_id: z.ZodOptional<z.ZodString>;
|
|
3308
|
+
attachment_id: z.ZodOptional<z.ZodString>;
|
|
3309
|
+
code: z.ZodEnum<{
|
|
3310
|
+
cancelled: "cancelled";
|
|
3311
|
+
too_large: "too_large";
|
|
3312
|
+
invalid_scope: "invalid_scope";
|
|
3313
|
+
not_found: "not_found";
|
|
3314
|
+
invalid_upload: "invalid_upload";
|
|
3315
|
+
busy: "busy";
|
|
3316
|
+
no_space: "no_space";
|
|
3317
|
+
io_error: "io_error";
|
|
3318
|
+
integrity_mismatch: "integrity_mismatch";
|
|
3319
|
+
offset_mismatch: "offset_mismatch";
|
|
3320
|
+
}>;
|
|
3321
|
+
retryable: z.ZodBoolean;
|
|
3322
|
+
in_reply_to: z.ZodString;
|
|
3323
|
+
session_id: z.ZodString;
|
|
3324
|
+
upload_scope: z.ZodString;
|
|
3325
|
+
target_channel_id: z.ZodString;
|
|
3326
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3327
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3328
|
+
type: z.ZodLiteral<"attachment_discarded">;
|
|
3329
|
+
attachment_id: z.ZodString;
|
|
3330
|
+
status: z.ZodEnum<{
|
|
3331
|
+
cancelled: "cancelled";
|
|
3332
|
+
retained: "retained";
|
|
3333
|
+
}>;
|
|
3334
|
+
in_reply_to: z.ZodString;
|
|
3335
|
+
session_id: z.ZodString;
|
|
3336
|
+
upload_scope: z.ZodString;
|
|
3337
|
+
target_channel_id: z.ZodString;
|
|
3338
|
+
protocol_version: z.ZodLiteral<2>;
|
|
2998
3339
|
}, z.core.$strict>]>;
|
|
2999
3340
|
export declare const ClientFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3000
3341
|
type: z.ZodLiteral<"pair_request">;
|
|
@@ -3021,6 +3362,7 @@ export declare const ClientFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3021
3362
|
data: z.ZodString;
|
|
3022
3363
|
mime: z.ZodString;
|
|
3023
3364
|
}, z.core.$strict>>>;
|
|
3365
|
+
attachment_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3024
3366
|
streaming_behavior: z.ZodOptional<z.ZodLiteral<"steer">>;
|
|
3025
3367
|
channel_id: z.ZodString;
|
|
3026
3368
|
session_id: z.ZodString;
|
|
@@ -3146,6 +3488,74 @@ export declare const ClientFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3146
3488
|
protocol_version: z.ZodLiteral<2>;
|
|
3147
3489
|
type: z.ZodLiteral<"approve_tool">;
|
|
3148
3490
|
id: z.ZodString;
|
|
3491
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3492
|
+
channel_id: z.ZodString;
|
|
3493
|
+
session_id: z.ZodString;
|
|
3494
|
+
leaf_id: z.ZodNullable<z.ZodString>;
|
|
3495
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3496
|
+
type: z.ZodLiteral<"attachment_capabilities_request">;
|
|
3497
|
+
id: z.ZodString;
|
|
3498
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3499
|
+
upload_id: z.ZodString;
|
|
3500
|
+
file_name: z.ZodString;
|
|
3501
|
+
mime_type: z.ZodString;
|
|
3502
|
+
byte_length: z.ZodNumber;
|
|
3503
|
+
sha256: z.ZodString;
|
|
3504
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
3505
|
+
mime_type: z.ZodLiteral<"image/jpeg">;
|
|
3506
|
+
data: z.ZodString;
|
|
3507
|
+
byte_length: z.ZodNumber;
|
|
3508
|
+
width: z.ZodNumber;
|
|
3509
|
+
height: z.ZodNumber;
|
|
3510
|
+
}, z.core.$strict>>;
|
|
3511
|
+
channel_id: z.ZodString;
|
|
3512
|
+
session_id: z.ZodString;
|
|
3513
|
+
upload_scope: z.ZodString;
|
|
3514
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3515
|
+
type: z.ZodLiteral<"attachment_begin">;
|
|
3516
|
+
id: z.ZodString;
|
|
3517
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3518
|
+
upload_id: z.ZodString;
|
|
3519
|
+
offset: z.ZodNumber;
|
|
3520
|
+
data_base64: z.ZodString;
|
|
3521
|
+
channel_id: z.ZodString;
|
|
3522
|
+
session_id: z.ZodString;
|
|
3523
|
+
upload_scope: z.ZodString;
|
|
3524
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3525
|
+
type: z.ZodLiteral<"attachment_chunk">;
|
|
3526
|
+
id: z.ZodString;
|
|
3527
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3528
|
+
upload_id: z.ZodString;
|
|
3529
|
+
channel_id: z.ZodString;
|
|
3530
|
+
session_id: z.ZodString;
|
|
3531
|
+
upload_scope: z.ZodString;
|
|
3532
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3533
|
+
type: z.ZodLiteral<"attachment_finish">;
|
|
3534
|
+
id: z.ZodString;
|
|
3535
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3536
|
+
upload_id: z.ZodString;
|
|
3537
|
+
channel_id: z.ZodString;
|
|
3538
|
+
session_id: z.ZodString;
|
|
3539
|
+
upload_scope: z.ZodString;
|
|
3540
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3541
|
+
type: z.ZodLiteral<"attachment_status_request">;
|
|
3542
|
+
id: z.ZodString;
|
|
3543
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3544
|
+
upload_id: z.ZodString;
|
|
3545
|
+
channel_id: z.ZodString;
|
|
3546
|
+
session_id: z.ZodString;
|
|
3547
|
+
upload_scope: z.ZodString;
|
|
3548
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3549
|
+
type: z.ZodLiteral<"attachment_cancel">;
|
|
3550
|
+
id: z.ZodString;
|
|
3551
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3552
|
+
attachment_id: z.ZodString;
|
|
3553
|
+
channel_id: z.ZodString;
|
|
3554
|
+
session_id: z.ZodString;
|
|
3555
|
+
upload_scope: z.ZodString;
|
|
3556
|
+
protocol_version: z.ZodLiteral<2>;
|
|
3557
|
+
type: z.ZodLiteral<"attachment_discard">;
|
|
3558
|
+
id: z.ZodString;
|
|
3149
3559
|
}, z.core.$strict>]>;
|
|
3150
3560
|
export declare const ServerFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3151
3561
|
type: z.ZodLiteral<"pair_ok">;
|
|
@@ -4476,6 +4886,96 @@ export declare const ServerFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
4476
4886
|
session_id: z.ZodString;
|
|
4477
4887
|
leaf_id: z.ZodNullable<z.ZodString>;
|
|
4478
4888
|
protocol_version: z.ZodLiteral<2>;
|
|
4889
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4890
|
+
type: z.ZodLiteral<"attachment_capabilities">;
|
|
4891
|
+
max_file_bytes: z.ZodLiteral<number>;
|
|
4892
|
+
max_message_bytes: z.ZodLiteral<number>;
|
|
4893
|
+
max_attachments: z.ZodLiteral<10>;
|
|
4894
|
+
chunk_bytes: z.ZodLiteral<number>;
|
|
4895
|
+
max_in_flight: z.ZodLiteral<2>;
|
|
4896
|
+
in_reply_to: z.ZodString;
|
|
4897
|
+
session_id: z.ZodString;
|
|
4898
|
+
upload_scope: z.ZodString;
|
|
4899
|
+
target_channel_id: z.ZodString;
|
|
4900
|
+
protocol_version: z.ZodLiteral<2>;
|
|
4901
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
|
|
4902
|
+
status: z.ZodLiteral<"receiving">;
|
|
4903
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
4904
|
+
upload_id: z.ZodString;
|
|
4905
|
+
received_bytes: z.ZodNumber;
|
|
4906
|
+
in_reply_to: z.ZodString;
|
|
4907
|
+
session_id: z.ZodString;
|
|
4908
|
+
upload_scope: z.ZodString;
|
|
4909
|
+
target_channel_id: z.ZodString;
|
|
4910
|
+
protocol_version: z.ZodLiteral<2>;
|
|
4911
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4912
|
+
status: z.ZodLiteral<"cancelled">;
|
|
4913
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
4914
|
+
upload_id: z.ZodString;
|
|
4915
|
+
received_bytes: z.ZodNumber;
|
|
4916
|
+
in_reply_to: z.ZodString;
|
|
4917
|
+
session_id: z.ZodString;
|
|
4918
|
+
upload_scope: z.ZodString;
|
|
4919
|
+
target_channel_id: z.ZodString;
|
|
4920
|
+
protocol_version: z.ZodLiteral<2>;
|
|
4921
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4922
|
+
status: z.ZodLiteral<"complete">;
|
|
4923
|
+
attachment: z.ZodObject<{
|
|
4924
|
+
attachment_id: z.ZodString;
|
|
4925
|
+
file_name: z.ZodString;
|
|
4926
|
+
mime_type: z.ZodString;
|
|
4927
|
+
byte_length: z.ZodNumber;
|
|
4928
|
+
sha256: z.ZodString;
|
|
4929
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
4930
|
+
mime_type: z.ZodLiteral<"image/jpeg">;
|
|
4931
|
+
data: z.ZodString;
|
|
4932
|
+
byte_length: z.ZodNumber;
|
|
4933
|
+
width: z.ZodNumber;
|
|
4934
|
+
height: z.ZodNumber;
|
|
4935
|
+
}, z.core.$strict>>;
|
|
4936
|
+
}, z.core.$strict>;
|
|
4937
|
+
type: z.ZodLiteral<"attachment_state">;
|
|
4938
|
+
upload_id: z.ZodString;
|
|
4939
|
+
received_bytes: z.ZodNumber;
|
|
4940
|
+
in_reply_to: z.ZodString;
|
|
4941
|
+
session_id: z.ZodString;
|
|
4942
|
+
upload_scope: z.ZodString;
|
|
4943
|
+
target_channel_id: z.ZodString;
|
|
4944
|
+
protocol_version: z.ZodLiteral<2>;
|
|
4945
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
4946
|
+
type: z.ZodLiteral<"attachment_error">;
|
|
4947
|
+
upload_id: z.ZodOptional<z.ZodString>;
|
|
4948
|
+
attachment_id: z.ZodOptional<z.ZodString>;
|
|
4949
|
+
code: z.ZodEnum<{
|
|
4950
|
+
cancelled: "cancelled";
|
|
4951
|
+
too_large: "too_large";
|
|
4952
|
+
invalid_scope: "invalid_scope";
|
|
4953
|
+
not_found: "not_found";
|
|
4954
|
+
invalid_upload: "invalid_upload";
|
|
4955
|
+
busy: "busy";
|
|
4956
|
+
no_space: "no_space";
|
|
4957
|
+
io_error: "io_error";
|
|
4958
|
+
integrity_mismatch: "integrity_mismatch";
|
|
4959
|
+
offset_mismatch: "offset_mismatch";
|
|
4960
|
+
}>;
|
|
4961
|
+
retryable: z.ZodBoolean;
|
|
4962
|
+
in_reply_to: z.ZodString;
|
|
4963
|
+
session_id: z.ZodString;
|
|
4964
|
+
upload_scope: z.ZodString;
|
|
4965
|
+
target_channel_id: z.ZodString;
|
|
4966
|
+
protocol_version: z.ZodLiteral<2>;
|
|
4967
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4968
|
+
type: z.ZodLiteral<"attachment_discarded">;
|
|
4969
|
+
attachment_id: z.ZodString;
|
|
4970
|
+
status: z.ZodEnum<{
|
|
4971
|
+
cancelled: "cancelled";
|
|
4972
|
+
retained: "retained";
|
|
4973
|
+
}>;
|
|
4974
|
+
in_reply_to: z.ZodString;
|
|
4975
|
+
session_id: z.ZodString;
|
|
4976
|
+
upload_scope: z.ZodString;
|
|
4977
|
+
target_channel_id: z.ZodString;
|
|
4978
|
+
protocol_version: z.ZodLiteral<2>;
|
|
4479
4979
|
}, z.core.$strict>]>;
|
|
4480
4980
|
export declare const SessionHistoryChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
4481
4981
|
final_chunk: z.ZodLiteral<false>;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { actionNameSchema, byeReasonSchema, channelIdSchema, harnessSchema, leafIdSchema, headSequenceSchema, idSchema, MAX_ARRAY_ITEMS, pairingCodeSchema, protocolVersionSchema, eventSequenceSchema, sequencedTimelineEventSchema, timelineEventFragmentSchema, timelinePartialSchema, thinkingLevelSchema, queuedMessageItemSchema, timestampSchema, userBlockSchema, wireImageSchema, wireModelSchema, CLIENT_FRAME_TYPES, SERVER_FRAME_TYPES, strictObject, textSchema, } from "./schema.js";
|
|
2
|
+
import { actionNameSchema, byeReasonSchema, channelIdSchema, harnessSchema, leafIdSchema, headSequenceSchema, idSchema, MAX_ARRAY_ITEMS, imageMimeSchema, pairingCodeSchema, protocolVersionSchema, eventSequenceSchema, sequencedTimelineEventSchema, timelineEventFragmentSchema, timelinePartialSchema, thinkingLevelSchema, queuedMessageItemSchema, timestampSchema, userBlockSchema, wireImageSchema, wireModelSchema, CLIENT_FRAME_TYPES, SERVER_FRAME_TYPES, strictObject, textSchema, } from "./schema.js";
|
|
3
|
+
import { ATTACHMENT_CHUNK_BYTES, ATTACHMENT_MAX_COUNT, ATTACHMENT_MAX_FILE_BYTES, ATTACHMENT_MAX_IN_FLIGHT, ATTACHMENT_MAX_MESSAGE_BYTES, attachmentByteLengthSchema, attachmentChunkDataSchema, attachmentDescriptorSchema, attachmentFileNameSchema, attachmentIdsSchema, attachmentPreviewSchema, attachmentSha256Schema, } from "./attachments.js";
|
|
3
4
|
const wireTimelineEventSchema = sequencedTimelineEventSchema;
|
|
4
5
|
const protocol = { protocol_version: protocolVersionSchema };
|
|
5
6
|
const channelRequest = { ...protocol, channel_id: channelIdSchema, session_id: idSchema, leaf_id: leafIdSchema };
|
|
6
7
|
const directResponse = { ...protocol, target_channel_id: channelIdSchema };
|
|
7
8
|
const ownerBroadcast = { ...protocol, session_id: idSchema, leaf_id: leafIdSchema };
|
|
9
|
+
const attachmentUploadRequest = { ...protocol, channel_id: channelIdSchema, session_id: idSchema, upload_scope: idSchema };
|
|
10
|
+
const attachmentUploadResponse = { ...directResponse, in_reply_to: idSchema, session_id: idSchema, upload_scope: idSchema };
|
|
11
|
+
const safeOffsetSchema = z.number().int().nonnegative().finite().max(Number.MAX_SAFE_INTEGER);
|
|
8
12
|
export const pairRequestFrameSchema = strictObject({ ...protocol, type: z.literal("pair_request"), id: idSchema, code: pairingCodeSchema, device_name: textSchema });
|
|
9
13
|
export const sessionHelloFrameSchema = strictObject({ ...protocol, type: z.literal("session_hello"), id: idSchema, channel_id: channelIdSchema });
|
|
10
14
|
export const extensionInfoRequestFrameSchema = strictObject({ ...protocol, type: z.literal("extension_info_request"), id: idSchema, ...channelRequest });
|
|
11
|
-
export const userMessageFrameSchema = strictObject({ ...protocol, type: z.literal("user_message"), id: idSchema, ...channelRequest, client_request_id: idSchema, text: textSchema, images: z.array(wireImageSchema).max(1).optional(), streaming_behavior: z.literal("steer").optional() })
|
|
15
|
+
export const userMessageFrameSchema = strictObject({ ...protocol, type: z.literal("user_message"), id: idSchema, ...channelRequest, client_request_id: idSchema, text: textSchema, images: z.array(wireImageSchema).max(1).optional(), attachment_ids: attachmentIdsSchema.optional(), streaming_behavior: z.literal("steer").optional() }).superRefine((frame, ctx) => {
|
|
16
|
+
if (frame.images !== undefined && frame.attachment_ids !== undefined) {
|
|
17
|
+
ctx.addIssue({ code: "custom", path: ["attachment_ids"], message: "attachment_ids and images are mutually exclusive" });
|
|
18
|
+
}
|
|
19
|
+
});
|
|
12
20
|
export const userMessageObservedFrameSchema = strictObject({ ...protocol, type: z.literal("user_message_observed"), id: idSchema, ...channelRequest, client_request_id: idSchema, message_id: idSchema, status: z.literal("committed") });
|
|
13
21
|
export const sessionSyncFrameSchema = strictObject({ ...protocol, type: z.literal("session_sync"), id: idSchema, ...channelRequest, before: eventSequenceSchema.nullable(), limit: z.number().int().min(1).finite().max(80).default(80) });
|
|
14
22
|
export const pingFrameSchema = strictObject({ ...protocol, type: z.literal("ping"), id: idSchema, ...channelRequest });
|
|
@@ -22,6 +30,13 @@ export const queuedMessageSetFrameSchema = strictObject({ ...protocol, type: z.l
|
|
|
22
30
|
export const queuedMessageClearFrameSchema = strictObject({ ...protocol, type: z.literal("queued_message_clear"), id: idSchema, ...channelRequest, target_id: idSchema.optional() });
|
|
23
31
|
export const queuedMessageSteerFrameSchema = strictObject({ ...protocol, type: z.literal("queued_message_steer"), id: idSchema, ...channelRequest, target_id: idSchema });
|
|
24
32
|
export const approveToolFrameSchema = strictObject({ ...protocol, type: z.literal("approve_tool"), id: idSchema, ...channelRequest, tool_call_id: idSchema, decision: z.enum(["allow", "deny"]) });
|
|
33
|
+
export const attachmentCapabilitiesRequestFrameSchema = strictObject({ ...protocol, type: z.literal("attachment_capabilities_request"), id: idSchema, ...channelRequest });
|
|
34
|
+
export const attachmentBeginFrameSchema = strictObject({ ...protocol, type: z.literal("attachment_begin"), id: idSchema, ...attachmentUploadRequest, upload_id: idSchema, file_name: attachmentFileNameSchema, mime_type: imageMimeSchema, byte_length: attachmentByteLengthSchema, sha256: attachmentSha256Schema, preview: attachmentPreviewSchema.optional() });
|
|
35
|
+
export const attachmentChunkFrameSchema = strictObject({ ...protocol, type: z.literal("attachment_chunk"), id: idSchema, ...attachmentUploadRequest, upload_id: idSchema, offset: safeOffsetSchema, data_base64: attachmentChunkDataSchema });
|
|
36
|
+
export const attachmentFinishFrameSchema = strictObject({ ...protocol, type: z.literal("attachment_finish"), id: idSchema, ...attachmentUploadRequest, upload_id: idSchema });
|
|
37
|
+
export const attachmentStatusRequestFrameSchema = strictObject({ ...protocol, type: z.literal("attachment_status_request"), id: idSchema, ...attachmentUploadRequest, upload_id: idSchema });
|
|
38
|
+
export const attachmentCancelFrameSchema = strictObject({ ...protocol, type: z.literal("attachment_cancel"), id: idSchema, ...attachmentUploadRequest, upload_id: idSchema });
|
|
39
|
+
export const attachmentDiscardFrameSchema = strictObject({ ...protocol, type: z.literal("attachment_discard"), id: idSchema, ...attachmentUploadRequest, attachment_id: idSchema });
|
|
25
40
|
export const pairOkFrameSchema = strictObject({ ...protocol, type: z.literal("pair_ok"), in_reply_to: idSchema, session_name: textSchema, session_started_at: timestampSchema, endpoint_id: idSchema, harness: harnessSchema.optional(), hostname: textSchema.optional() });
|
|
26
41
|
export const pairErrorFrameSchema = strictObject({ ...protocol, type: z.literal("pair_error"), in_reply_to: idSchema, code: z.enum(["token_expired", "token_consumed", "token_unknown", "internal_error"]), message: textSchema.min(1) });
|
|
27
42
|
export const sessionReadyFrameSchema = strictObject({ ...directResponse, type: z.literal("session_ready"), in_reply_to: idSchema, session_id: idSchema, leaf_id: leafIdSchema, head_seq: headSequenceSchema, self_sender_ref: idSchema });
|
|
@@ -74,8 +89,26 @@ export const actionErrorFrameSchema = strictObject({ ...directResponse, type: z.
|
|
|
74
89
|
export const modelsListFrameSchema = strictObject({ ...directResponse, type: z.literal("models_list"), in_reply_to: idSchema, models: z.array(wireModelSchema).max(MAX_ARRAY_ITEMS), current: wireModelSchema.optional() });
|
|
75
90
|
export const queuedMessageStateFrameSchema = strictObject({ ...ownerBroadcast, type: z.literal("queued_message_state"), snapshot_id: idSchema, chunk_index: z.number().int().nonnegative().finite(), final: z.boolean(), items: z.array(queuedMessageItemSchema).max(MAX_ARRAY_ITEMS) });
|
|
76
91
|
export const byeFrameSchema = strictObject({ ...ownerBroadcast, type: z.literal("bye"), reason: byeReasonSchema });
|
|
77
|
-
export const
|
|
78
|
-
|
|
92
|
+
export const attachmentCapabilitiesFrameSchema = strictObject({ ...attachmentUploadResponse, type: z.literal("attachment_capabilities"), max_file_bytes: z.literal(ATTACHMENT_MAX_FILE_BYTES), max_message_bytes: z.literal(ATTACHMENT_MAX_MESSAGE_BYTES), max_attachments: z.literal(ATTACHMENT_MAX_COUNT), chunk_bytes: z.literal(ATTACHMENT_CHUNK_BYTES), max_in_flight: z.literal(ATTACHMENT_MAX_IN_FLIGHT) });
|
|
93
|
+
const attachmentStateBase = { ...attachmentUploadResponse, type: z.literal("attachment_state"), upload_id: idSchema, received_bytes: z.number().int().nonnegative().finite().max(ATTACHMENT_MAX_FILE_BYTES) };
|
|
94
|
+
export const attachmentStateFrameSchema = z.union([
|
|
95
|
+
strictObject({ ...attachmentStateBase, status: z.literal("receiving") }),
|
|
96
|
+
strictObject({ ...attachmentStateBase, status: z.literal("cancelled") }),
|
|
97
|
+
strictObject({ ...attachmentStateBase, status: z.literal("complete"), attachment: attachmentDescriptorSchema }).superRefine((state, ctx) => {
|
|
98
|
+
if (state.received_bytes !== state.attachment.byte_length) {
|
|
99
|
+
ctx.addIssue({ code: "custom", path: ["received_bytes"], message: "received_bytes must equal attachment.byte_length" });
|
|
100
|
+
}
|
|
101
|
+
}),
|
|
102
|
+
]);
|
|
103
|
+
export const attachmentErrorCodeSchema = z.enum(["invalid_scope", "not_found", "invalid_upload", "too_large", "busy", "no_space", "io_error", "integrity_mismatch", "offset_mismatch", "cancelled"]);
|
|
104
|
+
export const attachmentDiscardedFrameSchema = strictObject({ ...attachmentUploadResponse, type: z.literal("attachment_discarded"), attachment_id: idSchema, status: z.enum(["cancelled", "retained"]) });
|
|
105
|
+
export const attachmentErrorFrameSchema = strictObject({ ...attachmentUploadResponse, type: z.literal("attachment_error"), upload_id: idSchema.optional(), attachment_id: idSchema.optional(), code: attachmentErrorCodeSchema, retryable: z.boolean() }).superRefine((frame, ctx) => {
|
|
106
|
+
if (frame.upload_id !== undefined && frame.attachment_id !== undefined) {
|
|
107
|
+
ctx.addIssue({ code: "custom", path: ["attachment_id"], message: "upload_id and attachment_id are mutually exclusive" });
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
export const clientFrameSchema = z.union([pairRequestFrameSchema, sessionHelloFrameSchema, extensionInfoRequestFrameSchema, userMessageFrameSchema, userMessageObservedFrameSchema, sessionSyncFrameSchema, pingFrameSchema, cancelFrameSchema, sessionNewFrameSchema, sessionCompactFrameSchema, modelSetFrameSchema, thinkingSetFrameSchema, listModelsFrameSchema, queuedMessageSetFrameSchema, queuedMessageClearFrameSchema, queuedMessageSteerFrameSchema, approveToolFrameSchema, attachmentCapabilitiesRequestFrameSchema, attachmentBeginFrameSchema, attachmentChunkFrameSchema, attachmentFinishFrameSchema, attachmentStatusRequestFrameSchema, attachmentCancelFrameSchema, attachmentDiscardFrameSchema]);
|
|
111
|
+
export const serverFrameSchema = z.union([pairOkFrameSchema, pairErrorFrameSchema, sessionReadyFrameSchema, extensionInfoFrameSchema, userMessageStartedFrameSchema, userMessageStatusFrameSchema, timelineEventFrameSchema, timelinePartialFrameSchema, timelineEventFragmentFrameSchema, sessionHistoryChunkFrameSchema, protocolErrorFrameSchema, resetFrameSchema, pongFrameSchema, cancelledFrameSchema, actionOkFrameSchema, actionErrorFrameSchema, modelsListFrameSchema, queuedMessageStateFrameSchema, byeFrameSchema, attachmentCapabilitiesFrameSchema, attachmentStateFrameSchema, attachmentErrorFrameSchema, attachmentDiscardedFrameSchema]);
|
|
79
112
|
export const ClientFrameSchema = clientFrameSchema;
|
|
80
113
|
export const ServerFrameSchema = serverFrameSchema;
|
|
81
114
|
export const SessionHistoryChunkSchema = sessionHistoryChunkFrameSchema;
|
|
@@ -852,7 +852,7 @@ export declare const harnessSchema: z.ZodObject<{
|
|
|
852
852
|
name: z.ZodString;
|
|
853
853
|
version: z.ZodString;
|
|
854
854
|
}, z.core.$strict>;
|
|
855
|
-
export declare const CLIENT_FRAME_TYPES: readonly ["pair_request", "session_hello", "user_message", "user_message_observed", "session_sync", "ping", "cancel", "session_new", "session_compact", "model_set", "thinking_set", "list_models", "queued_message_set", "queued_message_clear", "queued_message_steer", "approve_tool", "extension_info_request"];
|
|
856
|
-
export declare const SERVER_FRAME_TYPES: readonly ["pair_ok", "pair_error", "session_ready", "user_message_started", "user_message_status", "timeline_event", "timeline_partial", "timeline_event_fragment", "session_history_chunk", "protocol_error", "reset", "pong", "cancelled", "action_ok", "action_error", "models_list", "queued_message_state", "bye", "extension_info"];
|
|
855
|
+
export declare const CLIENT_FRAME_TYPES: readonly ["pair_request", "session_hello", "user_message", "user_message_observed", "session_sync", "ping", "cancel", "session_new", "session_compact", "model_set", "thinking_set", "list_models", "queued_message_set", "queued_message_clear", "queued_message_steer", "approve_tool", "extension_info_request", "attachment_capabilities_request", "attachment_begin", "attachment_chunk", "attachment_finish", "attachment_status_request", "attachment_cancel", "attachment_discard"];
|
|
856
|
+
export declare const SERVER_FRAME_TYPES: readonly ["pair_ok", "pair_error", "session_ready", "user_message_started", "user_message_status", "timeline_event", "timeline_partial", "timeline_event_fragment", "session_history_chunk", "protocol_error", "reset", "pong", "cancelled", "action_ok", "action_error", "models_list", "queued_message_state", "bye", "extension_info", "attachment_capabilities", "attachment_state", "attachment_error", "attachment_discarded"];
|
|
857
857
|
export type ClientFrameType = (typeof CLIENT_FRAME_TYPES)[number];
|
|
858
858
|
export type ServerFrameType = (typeof SERVER_FRAME_TYPES)[number];
|