Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5b2ce1518 | ||
|
|
a4d6d64c6e | ||
|
|
72e563e5f2 | ||
|
|
393c52c214 | ||
|
|
9e4e221970 | ||
|
|
e8b0126371 | ||
|
|
90d9a2ad1f | ||
|
|
065ef922bd | ||
|
|
7d11533490 | ||
|
|
1031a226f8 | ||
|
|
ddd98876b5 | ||
|
|
dfd41da2fd | ||
|
|
b37279ca21 | ||
|
|
13eeb07f5f | ||
|
|
1e9bac7f6e | ||
|
|
1c290767f2 | ||
|
|
9becb3f40a | ||
|
|
2c351726ae | ||
|
|
9e891d2e97 | ||
|
|
b8d07eb852 | ||
|
|
223c3dc800 | ||
|
|
afb6e89bfd | ||
|
|
9309edf4f4 | ||
|
|
d28ced8fd7 | ||
|
|
076608021c | ||
|
|
fb4f9aa58e | ||
|
|
de21f4dcd7 | ||
|
|
442bc9540e | ||
|
|
f7570712a7 | ||
|
|
2847655a1a | ||
|
|
268016d872 | ||
|
|
ac3f22c274 | ||
|
|
b36888e9cc | ||
|
|
9bb9023009 | ||
|
|
f70cb5de45 | ||
|
|
3d3586800e | ||
|
|
767de271e9 | ||
|
|
9d2c2cae37 | ||
|
|
dcccca3f7b | ||
|
|
4ed89e4ba7 | ||
|
|
99dbe4ff02 | ||
|
|
2fc0b01c18 | ||
|
|
3a86b60680 | ||
|
|
eb7c428a2d | ||
|
|
9fb9467ed1 | ||
|
|
e42036485f | ||
|
|
f9c3aff294 | ||
|
|
3503dbc7d5 | ||
|
|
b5dde6b9d8 | ||
|
|
a6b22ec1c9 | ||
|
|
bb49ebf6e5 | ||
|
|
2f5e626029 | ||
|
|
82c0a45ea0 | ||
|
|
e765051f14 | ||
|
|
f5e4df5cab | ||
|
|
1f47cc6f4e | ||
|
|
074d3af79c | ||
|
|
6593645c80 | ||
|
|
296eb82c31 | ||
|
|
7a377fc5e4 | ||
|
|
90e0c2ab15 | ||
|
|
7a3d4d1f31 | ||
|
|
e354e8697f | ||
|
|
993b578512 | ||
|
|
ed518ef19f | ||
|
|
47117a7d85 | ||
|
|
f623810903 | ||
|
|
e9ffd5752b | ||
|
|
24122b1762 | ||
|
|
081a6dacdb | ||
|
|
9fdb45be1e | ||
|
|
b946f00f1a | ||
|
|
b030f69a83 | ||
|
|
b0e1b3368e | ||
|
|
ce7b24bfb1 | ||
|
|
5c286cab8b | ||
|
|
75ca0d4fa4 | ||
|
|
8282b11fb5 | ||
|
|
45744cc789 | ||
|
|
4b6a0c433c | ||
|
|
304a14de7d | ||
|
|
c585128bbe | ||
|
|
acd92f9b06 | ||
|
|
4088b7ac3c | ||
|
|
8e8904a159 | ||
|
|
16f3490aee | ||
|
|
651084e8c0 | ||
|
|
812bb99f5c | ||
|
|
5bc79807ec | ||
|
|
8fe21d7583 | ||
|
|
412331aa61 | ||
|
|
cd1c3df89c | ||
|
|
3738373aa5 | ||
|
|
9b9006fed5 | ||
|
|
42234b8f7c | ||
|
|
39f65703e7 | ||
|
|
b7f954a904 | ||
|
|
a20815ece6 | ||
|
|
1c43bad705 | ||
|
|
18b6590d2e | ||
|
|
d62ffa7560 | ||
|
|
59e2944fb7 | ||
|
|
17942787aa | ||
|
|
5815ba24e2 | ||
|
|
5de8e9d1ae | ||
|
|
96e1e3db5e | ||
|
|
5dd36bc5ad | ||
|
|
6271b989bc | ||
|
|
57aa6bf16c | ||
|
|
40a7f4b4b1 | ||
|
|
cba0f23a9e | ||
|
|
a7ec0179fb | ||
|
|
c97c6b7836 | ||
|
|
59b0527c38 | ||
|
|
b74c7a79ab | ||
|
|
f772720d8c | ||
|
|
0763a35fbc | ||
|
|
e1c33dcd33 | ||
|
|
0a902790ca | ||
|
|
0837c8b639 | ||
|
|
5a90b6be9c | ||
|
|
42675571c9 | ||
|
|
e9f00f65ca | ||
|
|
04b95e37c5 | ||
|
|
5820e1b6ff | ||
|
|
8c904ffe34 | ||
|
|
9fa9cb4b31 | ||
|
|
24599aaeed | ||
|
|
f403b23e9a | ||
|
|
39c71a0394 | ||
|
|
d249e628ee | ||
|
|
40fcb6bdf8 | ||
|
|
d58ff5de26 | ||
|
|
e28ad18106 | ||
|
|
525411101d | ||
|
|
0f208447ed | ||
|
|
71e0573459 | ||
|
|
c63ea8d25b | ||
|
|
b9e529e0b5 | ||
|
|
0f702fcd62 | ||
|
|
13f2f9bc58 | ||
|
|
91cf202177 | ||
|
|
d21a8d597b | ||
|
|
14022f1d00 | ||
|
|
28c62f3efd | ||
|
|
268bb4bfa3 | ||
|
|
477b4f9d0e | ||
|
|
d5d88270f0 | ||
|
|
373725f96e | ||
|
|
fcb1a50ee4 | ||
|
|
ec3778bbf4 | ||
|
|
8c5b8d3b72 | ||
|
|
010ba70561 | ||
|
|
6ee057e25b | ||
|
|
551aebc604 | ||
|
|
9de85ea16e | ||
|
|
10dde452f9 | ||
|
|
116c8c5e8e | ||
|
|
f8886e874d | ||
|
|
2435a9cd58 | ||
|
|
78d53062d1 | ||
|
|
697d71d57d | ||
|
|
d74b086aaf | ||
|
|
6496aedc92 | ||
|
|
e972fad300 | ||
|
|
1bd4d6d953 | ||
|
|
e9655d43d5 | ||
|
|
f0a7ddaf80 | ||
|
|
ed6c12c709 | ||
|
|
a1b75fe17f | ||
|
|
2e5e75699e | ||
|
|
be308beacc | ||
|
|
2589176c82 | ||
|
|
adfd99bdec | ||
|
|
1683ee7b11 | ||
|
|
e6575c4149 | ||
|
|
ae7283e021 | ||
|
|
640a2cca9f | ||
|
|
12edc3455c | ||
|
|
26f631b638 | ||
|
|
981cf40561 | ||
|
|
689dda59e9 | ||
|
|
0a67f9dd39 | ||
|
|
df6bb188d4 | ||
|
|
03053d9ee0 | ||
|
|
9c4d7a83e2 | ||
|
|
7425a3c4b3 | ||
|
|
344e04b623 | ||
|
|
7b71e234e0 | ||
|
|
77f67d1766 | ||
|
|
1c2ed75937 | ||
|
|
17e6cad479 | ||
|
|
feff86638e | ||
|
|
ad28eaa86f | ||
|
|
d36bbc177d | ||
|
|
aeddb57594 | ||
|
|
f2253269dd | ||
|
|
d08cecf126 | ||
|
|
afad39d125 | ||
|
|
f97916f371 | ||
|
|
86e204439e | ||
|
|
04a931fc79 | ||
|
|
75354bbd96 | ||
|
|
6a10e97a97 | ||
|
|
1542b00db2 | ||
|
|
f79f8bac80 | ||
|
|
92f1a4aa3c | ||
|
|
11f929c397 | ||
|
|
0616338911 | ||
|
|
58427d565d | ||
|
|
9b3dbada17 | ||
|
|
4797f99cf8 | ||
|
|
50f35351a2 | ||
|
|
c7460bde16 | ||
|
|
2c110e8ce2 | ||
|
|
5707a6ee1d | ||
|
|
291411a45e | ||
|
|
87abc22f39 | ||
|
|
441582dbb8 | ||
|
|
1b1ede92ba | ||
|
|
4ec7ae33c5 | ||
|
|
317fcc659b | ||
|
|
ff7e084a33 | ||
|
|
c590beb4e3 | ||
|
|
e9ced44ac6 | ||
|
|
802cd127d1 | ||
|
|
931c56b2d0 | ||
|
|
484662b2d4 | ||
|
|
2cd04f08c1 | ||
|
|
4916dad78e | ||
|
|
d5c97faac5 | ||
|
|
531b12e192 | ||
|
|
b293b083fc | ||
|
|
b297e20f4e | ||
|
|
44be7f3ac3 | ||
|
|
ea5a100a74 | ||
|
|
6841fa17d4 | ||
|
|
5c03804bac | ||
|
|
d6ed393255 | ||
|
|
2d9139767a | ||
|
|
95fcc89074 | ||
|
|
eb59853596 | ||
|
|
a2682de421 | ||
|
|
325c0a3687 | ||
|
|
7c7fcf46c2 | ||
|
|
0c39733cbf | ||
|
|
a76413594e | ||
|
|
1100d5a6f7 | ||
|
|
9abf967700 | ||
|
|
cc83094bc6 | ||
|
|
f5bdc138f6 | ||
|
|
2d8ca48175 | ||
|
|
4ca4a1f99c | ||
|
|
5470801c4a | ||
|
|
2ad2d3e6f5 | ||
|
|
b175d6b2a3 | ||
|
|
c5c12aa738 | ||
|
|
7241400edd | ||
|
|
310fd0b187 | ||
|
|
db94743220 | ||
|
|
07aaf37fd4 | ||
|
|
65a808808f | ||
|
|
cca1aa1588 | ||
|
|
c9d4b773c9 | ||
|
|
e23f3102f4 | ||
|
|
ec89587c37 | ||
|
|
32d89806d7 | ||
|
|
2fd4e06b34 | ||
|
|
3cffdce1c1 | ||
|
|
6d2f4f4cdf | ||
|
|
865d7bd684 | ||
|
|
392d63231c | ||
|
|
7559f5ad70 | ||
|
|
605e8143e0 | ||
|
|
5b056cd337 | ||
|
|
6c350489b1 | ||
|
|
2ae63f4aa2 | ||
|
|
3d0233e3b0 | ||
|
|
64f2c3a465 | ||
|
|
0a12333448 | ||
|
|
9db54c9b19 | ||
|
|
34430e3514 | ||
|
|
99e44f2c23 | ||
|
|
7a0f2d9b30 | ||
|
|
4bf310f7ca | ||
|
|
8b9fbe701d | ||
|
|
0c5be023e4 | ||
|
|
86e87a8789 | ||
|
|
404e78a506 | ||
|
|
73563c7c25 | ||
|
|
326595b148 | ||
|
|
41a8468b08 | ||
|
|
ced2ecb6ba | ||
|
|
2d746b3a7e | ||
|
|
e6ac39de75 | ||
|
|
b76a0a6c91 | ||
|
|
9fdec3c2c8 | ||
|
|
760fe643e8 | ||
|
|
93af851dc5 | ||
|
|
fabb3e0734 | ||
|
|
9ca9a862a5 | ||
|
|
827dc9ff9f | ||
|
|
09b32ac9dd | ||
|
|
253684e280 | ||
|
|
f6d40ce841 | ||
|
|
36fb1bb7e4 | ||
|
|
4a82c1608f | ||
|
|
3efb3da007 | ||
|
|
11606fd9c6 | ||
|
|
a935db07ef | ||
|
|
98860a9549 | ||
|
|
7688742b2a | ||
|
|
b2efe4f83c | ||
|
|
f934b435fa | ||
|
|
3c121585da | ||
|
|
40acfbd2df | ||
|
|
0af61bf6ba | ||
|
|
7b2968f2ff | ||
|
|
a1c7b98f98 | ||
|
|
99ea16a969 | ||
|
|
ebe44d03a5 | ||
|
|
dcd2d50768 | ||
|
|
f11764c517 | ||
|
|
77c81b7468 | ||
|
|
7a5ccd3310 | ||
|
|
e4df6fcf8e | ||
|
|
b2be7f4e4f | ||
|
|
94beb21a43 | ||
|
|
30e05538b7 | ||
|
|
c884947ea8 | ||
|
|
61289a152d | ||
|
|
906550f9af | ||
|
|
c2aaa89b57 | ||
|
|
dde48e9414 | ||
|
|
b1608f41ad | ||
|
|
78d89e3d35 | ||
|
|
1309495218 | ||
|
|
c34a4c69e5 | ||
|
|
2f6cac0cf0 | ||
|
|
5c26df3a4f | ||
|
|
302323a64b | ||
|
|
b981fad920 | ||
|
|
8a2f2a5c2b | ||
|
|
e319735ed1 | ||
|
|
e7790490f1 | ||
|
|
a638978b75 | ||
|
|
4a08686e74 | ||
|
|
b3de2bd926 | ||
|
|
b81ec02984 | ||
|
|
de61c0c42b | ||
|
|
ecb4a1efa4 | ||
|
|
1b0093a483 | ||
|
|
06fc364ee1 | ||
|
|
094859bbc7 | ||
|
|
5e78386cdc | ||
|
|
c378afeff8 | ||
|
|
bf7002209e | ||
|
|
a3aa4bd189 | ||
|
|
5a0006f7ef | ||
|
|
9e2e73c070 | ||
|
|
c530e5d50f | ||
|
|
674720c6cd | ||
|
|
58c9e4b96d | ||
|
|
feb286379c | ||
|
|
cefe641586 | ||
|
|
664451c296 | ||
|
|
fd4ff8ca46 | ||
|
|
1bcfbdf287 | ||
|
|
4e45c1a6ab | ||
|
|
32fe80d164 | ||
|
|
6e93d42023 | ||
|
|
6f50867aa1 | ||
|
|
4fca60469d | ||
|
|
afcd824ae9 | ||
|
|
f84f279738 | ||
|
|
246624ad3c | ||
|
|
410444aead | ||
|
|
7522d3bde3 | ||
|
|
ed26b84177 | ||
|
|
ad4d12cf94 | ||
|
|
f6fd760e4e | ||
|
|
506a5260dc | ||
|
|
d4c90d696d | ||
|
|
be4d26a1b3 | ||
|
|
5c09614319 | ||
|
|
4c846332c5 | ||
|
|
a3a0cbf0f8 | ||
|
|
2c7101092a | ||
|
|
9f068356a4 | ||
|
|
f239c90628 | ||
|
|
991dd05e72 | ||
|
|
96bf54e293 | ||
|
|
5ca9b54d66 | ||
|
|
4ab5fca4ca | ||
|
|
69a4fa8215 | ||
|
|
9e04bad0a5 | ||
|
|
a574d9c936 | ||
|
|
005e13089a | ||
|
|
d9cce6402a | ||
|
|
508872e04b | ||
|
|
aced302b63 | ||
|
|
0b8dfee17b | ||
|
|
6ab246676e | ||
|
|
122c94a24a | ||
|
|
b59c6d6ab1 | ||
|
|
c9995995a4 | ||
|
|
545a9193e2 | ||
|
|
fa0205cba3 | ||
|
|
8a20bd7f54 | ||
|
|
10660f376c | ||
|
|
ae235f7155 | ||
|
|
a356cd0d0f | ||
|
|
58b932ffb8 | ||
|
|
d58af33fba | ||
|
|
a56418f8bc | ||
|
|
596e1590df | ||
|
|
70c9147c7f | ||
|
|
c0054cb56f | ||
|
|
41734dfbbf | ||
|
|
8f42d34db9 | ||
|
|
70857ce299 | ||
|
|
5e0ec38383 | ||
|
|
913d0409f6 | ||
|
|
ac0e720de1 | ||
|
|
5144d32b77 | ||
|
|
128cc21516 | ||
|
|
215ff36362 | ||
|
|
505b4d0bc3 | ||
|
|
343c0a9472 | ||
|
|
82681606d0 | ||
|
|
c91b79b6e2 | ||
|
|
5e55aa387f | ||
|
|
a21095bc9a | ||
|
|
ba03241df3 | ||
|
|
a8059dc2c0 | ||
|
|
be873bca3e | ||
|
|
e8bde958f1 | ||
|
|
95f21c1099 | ||
|
|
8cd92150b1 | ||
|
|
d0ab35931e | ||
|
|
882684a80c | ||
|
|
96efd1cef0 | ||
|
|
c8974ede6d | ||
|
|
0c637e3d5e | ||
|
|
0e2d50a620 | ||
|
|
f3b3c54859 | ||
|
|
02eca40c3b | ||
|
|
c6ee3aee9f | ||
|
|
586e0ecea9 | ||
|
|
dcd18413a2 | ||
|
|
73f296b4cf | ||
|
|
1419bf3989 | ||
|
|
dca85c402c | ||
|
|
56a3ad0f8b | ||
|
|
36f484c25a | ||
|
|
03c6685097 | ||
|
|
23afddfbf9 | ||
|
|
e3a2dfb9d0 | ||
|
|
3dd004c323 | ||
|
|
1af43dbf90 | ||
|
|
16fed12dcc | ||
|
|
29825f2f8a | ||
|
|
efcee4b863 | ||
|
|
26edcab8b4 | ||
|
|
c626892adf | ||
|
|
3c66cdf2fe | ||
|
|
db31c36213 | ||
|
|
cafe3352f1 | ||
|
|
7a39ce34fa | ||
|
|
483702df77 | ||
|
|
206eb6a785 | ||
|
|
de9ec2bc73 | ||
|
|
1a66e517cd | ||
|
|
33e6f35ce9 | ||
|
|
e8896fe02d | ||
|
|
e89b053269 | ||
|
|
d052d481d8 | ||
|
|
fcbb494af7 | ||
|
|
2980a853e5 | ||
|
|
56de1465fa | ||
|
|
b500106fde | ||
|
|
7f2a95fe14 | ||
|
|
4b3825e500 | ||
|
|
d48b42c017 | ||
|
|
fb45896588 | ||
|
|
b52518f85f | ||
|
|
3e99019af8 | ||
|
|
7d4b02689e | ||
|
|
9962f57ad0 | ||
|
|
8b538e2802 | ||
|
|
a6c57e169a | ||
|
|
6f92f0a668 | ||
|
|
35817601ff | ||
|
|
2b154db938 | ||
|
|
b9ff7aa5cd | ||
|
|
b5188e8cea | ||
|
|
992db16586 | ||
|
|
2aad749e24 | ||
|
|
aa267ebb05 | ||
|
|
1a33f25970 | ||
|
|
e8dfc42f44 | ||
|
|
21c823ecdc | ||
|
|
80498f1709 | ||
|
|
e6c5a4a4bb | ||
|
|
732b3abf99 | ||
|
|
ffbf541ff8 | ||
|
|
709f961e1c | ||
|
|
1653383573 | ||
|
|
c7ae6b9471 | ||
|
|
bbcf9ba9db | ||
|
|
3f81f9dcb4 | ||
|
|
b073fea5fb | ||
|
|
834236931e | ||
|
|
872b907372 | ||
|
|
0b8e098c10 | ||
|
|
7c6a0f869d | ||
|
|
3a43047102 | ||
|
|
041acf158a | ||
|
|
f9752d7c08 | ||
|
|
766592b83b | ||
|
|
1c3c412ce4 | ||
|
|
f9e6d1290d | ||
|
|
8ef653fcc0 | ||
|
|
fb8d66b8d3 | ||
|
|
e70b34de62 | ||
|
|
b1584fab8f | ||
|
|
718084065e | ||
|
|
57dd091e05 | ||
|
|
a1f208f1e6 | ||
|
|
581aa7279f | ||
|
|
0b29924648 | ||
|
|
49472da669 | ||
|
|
69a2eac2ff | ||
|
|
5fd632c357 | ||
|
|
bb2164c945 | ||
|
|
8c91aa5570 | ||
|
|
6db8257b1e | ||
|
|
f6e7166e79 | ||
|
|
2da8290040 | ||
|
|
4d6e8e1ca5 | ||
|
|
7e4da5b157 | ||
|
|
9acce6ddaa | ||
|
|
8054a32417 | ||
|
|
ed3958daa8 | ||
|
|
9d5c515680 | ||
|
|
0e9677965c | ||
|
|
cc29ceea80 | ||
|
|
32a17b9109 | ||
|
|
e119e18ed3 | ||
|
|
001902c881 | ||
|
|
c7a029a2bd | ||
|
|
4fac2d203b | ||
|
|
58692df0d2 | ||
|
|
68585d4638 | ||
|
|
23d2a8affc | ||
|
|
501335bc31 | ||
|
|
0cfaf7325e | ||
|
|
9c4095aaaa | ||
|
|
961df8597c | ||
|
|
139ad675b3 | ||
|
|
375afb7c33 | ||
|
|
a2330938d6 | ||
|
|
5aa517863a | ||
|
|
00cdf41899 | ||
|
|
1b98213d6d | ||
|
|
0d67424f69 | ||
|
|
1245ce984b | ||
|
|
1de1b0d6be | ||
|
|
a830cd5b1a | ||
|
|
d47059a9db | ||
|
|
10c1cae6ab | ||
|
|
87854c288b | ||
|
|
b39c629dcc | ||
|
|
b95cc59e79 | ||
|
|
7722cb6d2e | ||
|
|
c9a59a26bb | ||
|
|
e0fe4270aa | ||
|
|
0451b503a3 | ||
|
|
5ec8c9f79d | ||
|
|
0886636760 | ||
|
|
5748a995f7 | ||
|
|
dfe06261c4 | ||
|
|
29a632cb52 | ||
|
|
24c842936b | ||
|
|
8f6b21a12e | ||
|
|
dc530f7a7e | ||
|
|
79b8fd7b00 | ||
|
|
61560bef23 | ||
|
|
667c8c6166 | ||
|
|
8efbb31725 | ||
|
|
b4c74723d1 | ||
|
|
1d975ad431 | ||
|
|
8ab72e0964 | ||
|
|
7ad5d03948 | ||
|
|
6cf03d987c | ||
|
|
9b8184df7e | ||
|
|
aa5a144d04 | ||
|
|
c6d1f92ba9 | ||
|
|
07df7fb73b | ||
|
|
1e75bd223c | ||
|
|
9fae3ee0e9 | ||
|
|
a328f66bfa | ||
|
|
bb8a8444f4 | ||
|
|
3ee2e1011d | ||
|
|
e5542b7a88 | ||
|
|
76208f79de | ||
|
|
9e2324c2e5 | ||
|
|
5a08b9dd64 | ||
|
|
96d610b1f8 | ||
|
|
0c4c027e92 | ||
|
|
fefea0bdf6 | ||
|
|
6954d1b91c | ||
|
|
7e46da9f22 | ||
|
|
ab83a17d2b | ||
|
|
709cd02cf4 | ||
|
|
3e58fd6ab7 | ||
|
|
5a755ada28 | ||
|
|
b211d059d2 | ||
|
|
52681634cd | ||
|
|
35f39435f3 | ||
|
|
e7743632ec | ||
|
|
f20bbdf267 | ||
|
|
89c364a1a3 | ||
|
|
77bf5213df | ||
|
|
c2b9680a5e | ||
|
|
a973e43421 | ||
|
|
c4ff23449b | ||
|
|
320f249a31 | ||
|
|
734ab399eb | ||
|
|
da6706777b | ||
|
|
ce96ad0b61 | ||
|
|
9ef1c0c9a3 | ||
|
|
ad9bc6c1df | ||
|
|
76519303b9 | ||
|
|
448c48cd10 | ||
|
|
470f282819 | ||
|
|
3fbd02c6cf | ||
|
|
da3d8e2ecb | ||
|
|
5cbb6ea728 | ||
|
|
be526df88a | ||
|
|
95419a5e51 | ||
|
|
6b53d13c07 | ||
|
|
c9b0da63a1 | ||
|
|
33ca29c265 | ||
|
|
915083fae4 | ||
|
|
9e6ef16fb3 | ||
|
|
5608446550 | ||
|
|
50ea61f462 | ||
|
|
9709a1f5ae | ||
|
|
e63d5b240f | ||
|
|
877ab76934 | ||
|
|
032c0e5849 | ||
|
|
319ac4590f | ||
|
|
36802d707d | ||
|
|
25d20ab792 | ||
|
|
7307079d40 | ||
|
|
23861cf300 | ||
|
|
b61886b816 | ||
|
|
c0a218ca48 | ||
|
|
d4b6536a50 | ||
|
|
7934639aa1 | ||
|
|
20668e49a9 | ||
|
|
fcc94b3b2f | ||
|
|
42b510e8c8 | ||
|
|
ce841a7ef1 | ||
|
|
54dd17e7b9 | ||
|
|
32942a5f20 | ||
|
|
150b3782b9 | ||
|
|
5bfd0598e7 | ||
|
|
060a8cef00 | ||
|
|
5e3678c0af | ||
|
|
0e4f1485c8 | ||
|
|
b152462b2c | ||
|
|
e219efa22a | ||
|
|
9c070effac | ||
|
|
7a5ea7a5d8 | ||
|
|
c71e71b5ac | ||
|
|
bbf4e6bd3c | ||
|
|
fa1663c131 | ||
|
|
9b046feb1e | ||
|
|
b6d68ee28e | ||
|
|
2bece01a3b | ||
|
|
4f4691676a | ||
|
|
483a1ae371 | ||
|
|
781006f005 | ||
|
|
d8412eca9f | ||
|
|
37e17e9207 | ||
|
|
749a2076d8 | ||
|
|
f039878edd | ||
|
|
632c1417ea | ||
|
|
c00354c0b1 | ||
|
|
a002239fc4 | ||
|
|
70a13c298f | ||
|
|
8a72a2a91d | ||
|
|
842e327583 | ||
|
|
891eb02d49 | ||
|
|
8cea075a1e | ||
|
|
84fc3e96e6 | ||
|
|
2c9121553e | ||
|
|
48bf123d0c | ||
|
|
f8883d0495 | ||
|
|
8cb2b3fcfe | ||
|
|
cc3e1db22a | ||
|
|
daf8e5f53b | ||
|
|
c89798ecb1 | ||
|
|
b253d1f8ca | ||
|
|
a32701ef8d | ||
|
|
f3b773f1f0 | ||
|
|
efbab1b104 | ||
|
|
564474f927 | ||
|
|
47fcd16003 | ||
|
|
24c617d32e | ||
|
|
22e1a4cf92 | ||
|
|
79382b272c | ||
|
|
90e199d6a7 | ||
|
|
9a8a5b3935 | ||
|
|
58a8d653a8 | ||
|
|
eecb53498a | ||
|
|
5cf140b0ee | ||
|
|
85085491da | ||
|
|
6356b3ca6d | ||
|
|
978c810139 | ||
|
|
1a315235b7 | ||
|
|
bcf8b14f38 | ||
|
|
fe69e96942 | ||
|
|
e9d40e4481 | ||
|
|
ed9f561dc3 | ||
|
|
7de054fa49 | ||
|
|
bb9371d3c9 | ||
|
|
bd1c7e1d9a | ||
|
|
453fb4992e | ||
|
|
5cfab38f31 | ||
|
|
ba1a2dbcf7 | ||
|
|
b441875731 | ||
|
|
8e744269a2 | ||
|
|
c90e245038 | ||
|
|
200e43e44c | ||
|
|
6aea858ed8 | ||
|
|
f07b6ac8e6 | ||
|
|
3afbf93d5e | ||
|
|
ec5c3c32cd | ||
|
|
5209967a7e | ||
|
|
867c122082 | ||
|
|
cf8a2f03fc | ||
|
|
582615971e | ||
|
|
d2e6cfe109 | ||
|
|
351736baa1 | ||
|
|
b236dccca3 | ||
|
|
ac05ddc0f9 | ||
|
|
0e73dc1527 | ||
|
|
1a94fcbd29 | ||
|
|
ed40fd3364 | ||
|
|
88f31d2f65 | ||
|
|
c8c0dc6c3c | ||
|
|
e52db0bbc2 | ||
|
|
71d8f74143 | ||
|
|
dfeb673b6d | ||
|
|
4d886b99f5 | ||
|
|
4e791759cf | ||
|
|
9799b42dcd | ||
|
|
a999933297 | ||
|
|
648a6ac372 | ||
|
|
3537d47702 | ||
|
|
9e877f592b | ||
|
|
f719aea047 | ||
|
|
f6136bd4c2 | ||
|
|
385d77d0c2 | ||
|
|
ee2f6bd742 | ||
|
|
e1ba603605 | ||
|
|
5d61b8b14f | ||
|
|
2743e45dbe | ||
|
|
1b409c3946 | ||
|
|
60ed67e5e1 | ||
|
|
bd6a5c85e6 | ||
|
|
9cce509013 | ||
|
|
9f48564d84 | ||
|
|
e8556bcff9 | ||
|
|
a1532d5b2d | ||
|
|
ba4a62eb03 | ||
|
|
09ac18db82 | ||
|
|
376efdd340 | ||
|
|
7a5dd62d2f | ||
|
|
f64c26e708 | ||
|
|
6d8d39a5d1 | ||
|
|
afdfe16931 | ||
|
|
fe86836b43 | ||
|
|
73fa2d66c7 | ||
|
|
51dcb547ed | ||
|
|
228862ac56 | ||
|
|
bc22a71f10 | ||
|
|
c42d6a6a64 | ||
|
|
5242bbbade | ||
|
|
05b47e748f | ||
|
|
973e62373e | ||
|
|
3863901085 | ||
|
|
f864ef189d | ||
|
|
765f4cd00b | ||
|
|
748ea2ae20 | ||
|
|
56a09ad1aa | ||
|
|
be1c8c4656 | ||
|
|
b7fb0b8fed | ||
|
|
5656f294d0 | ||
|
|
dd23bd73d9 | ||
|
|
8dd107429e | ||
|
|
1269b52580 | ||
|
|
fe79c8e9ee | ||
|
|
0a5aaf3e0e | ||
|
|
3d7ef8a833 | ||
|
|
66ebadb448 | ||
|
|
6667992753 | ||
|
|
41ba1ec7a8 | ||
|
|
3db020a683 | ||
|
|
20d3ad5d50 | ||
|
|
54fa15c72e | ||
|
|
370127760a | ||
|
|
dd3babdcad | ||
|
|
7aa717c5c2 | ||
|
|
8beba3e16b | ||
|
|
38c93a2abd | ||
|
|
ef4ce2e1ec | ||
|
|
61e9ba4b19 | ||
|
|
ad6247577e | ||
|
|
f1cd76c17a | ||
|
|
31aa32b83b | ||
|
|
53c367420c | ||
|
|
ace5803581 | ||
|
|
645b037c9e | ||
|
|
dcdb9ac923 | ||
|
|
46347e2bd2 | ||
|
|
7fc53dadc7 | ||
|
|
98c4b7c724 | ||
|
|
60111b2b91 | ||
|
|
1f17e9c429 | ||
|
|
6708fe996a | ||
|
|
72d7fccc52 | ||
|
|
f145a453b5 | ||
|
|
1f4f693dd6 | ||
|
|
6e46a7be38 | ||
|
|
0be98ea9d1 | ||
|
|
2cd92ae6f5 | ||
|
|
85fe41bad0 | ||
|
|
0c26396f79 | ||
|
|
cc37865c2d | ||
|
|
a6b9ece840 | ||
|
|
65ab532342 | ||
|
|
cce74f913c | ||
|
|
170c3a7162 | ||
|
|
1fe3cf53a7 | ||
|
|
07187d3794 | ||
|
|
758df838d9 | ||
|
|
669168d08a | ||
|
|
9bd663be7f | ||
|
|
58d926fcfb | ||
|
|
b5149f5959 | ||
|
|
ea661fb635 | ||
|
|
8bbba3d358 | ||
|
|
c0bdd46ddd | ||
|
|
c743239b5e | ||
|
|
f97888a6fd | ||
|
|
2a6a90a327 | ||
|
|
47019ad79d | ||
|
|
78fabcfde9 | ||
|
|
7690837f38 | ||
|
|
85eb379dd7 | ||
|
|
5a30594009 | ||
|
|
02ca9324c5 | ||
|
|
d3c93752e5 | ||
|
|
4b4abcdd7d | ||
|
|
eb35685aeb | ||
|
|
fa3cccc3f9 | ||
|
|
54e7dd96f7 | ||
|
|
9e3fa3e67f | ||
|
|
38de3417b8 | ||
|
|
4fff00c8c3 | ||
|
|
6b916d3a6f | ||
|
|
21580dc1b0 | ||
|
|
ba9585966c | ||
|
|
293f7b1507 | ||
|
|
4f5eb3be4d | ||
|
|
b6523a15dc | ||
|
|
8a4fed1bf2 | ||
|
|
0068a93cfa | ||
|
|
dd912666f2 | ||
|
|
521238cf8e | ||
|
|
5da67c40eb | ||
|
|
804572c8ff | ||
|
|
ddc4a93c36 | ||
|
|
901579233c | ||
|
|
d27b08bae6 | ||
|
|
485747b892 | ||
|
|
15380f2b5f | ||
|
|
48b1f7c388 | ||
|
|
b26e2d192e | ||
|
|
e6d6450728 | ||
|
|
739205872f | ||
|
|
07210d0c91 | ||
|
|
ee463f6b76 | ||
|
|
800eb3b547 | ||
|
|
854068dc56 | ||
|
|
ccaa58e393 | ||
|
|
6d6991bca1 | ||
|
|
057770ebfc | ||
|
|
052314b65f | ||
|
|
1dca7012b5 | ||
|
|
ea16f6fdd7 | ||
|
|
73bc60ef8a | ||
|
|
86e7bd000c | ||
|
|
1cad53dae4 | ||
|
|
760f15f2f9 | ||
|
|
3cf58f80d1 | ||
|
|
44f3b3cb7c | ||
|
|
dd920846b9 | ||
|
|
b7af14ad3f | ||
|
|
8f6cd244e7 | ||
|
|
95c8463706 | ||
|
|
5a0f5e9f5e | ||
|
|
c643de8ba7 | ||
|
|
9accd1ffb7 | ||
|
|
62cc55ab06 | ||
|
|
36bc85f54d | ||
|
|
3c939e8e69 | ||
|
|
6fc632f9a1 | ||
|
|
ae296e59a4 | ||
|
|
36cdceb4bf | ||
|
|
3bfda73dce | ||
|
|
0133d9582c | ||
|
|
e0df5d5b58 | ||
|
|
3697765f4d | ||
|
|
533dbdfbda | ||
|
|
98eb87f5cd | ||
|
|
1768d31669 | ||
|
|
39390c0b9a | ||
|
|
16b81f7268 | ||
|
|
9442019235 | ||
|
|
cf66f53a55 | ||
|
|
d6ecf15805 | ||
|
|
5b7af7b9f6 | ||
|
|
8324949b54 | ||
|
|
807e3d18de | ||
|
|
198cc58377 | ||
|
|
6e3726ec32 | ||
|
|
169d06f05b | ||
|
|
7e5cd01d26 | ||
|
|
01c3e8266b | ||
|
|
ca356d0edb | ||
|
|
ceceba279f | ||
|
|
e2052b8ae2 | ||
|
|
4ab095fd91 | ||
|
|
74f6ce8600 | ||
|
|
d6437a7e13 | ||
|
|
9fc5ad2083 | ||
|
|
79ac59f04e | ||
|
|
c13e9f89a9 | ||
|
|
d1ecacda43 | ||
|
|
647449069d | ||
|
|
6ce773ff1e | ||
|
|
c5cbe15993 | ||
|
|
2a610f92b9 | ||
|
|
7e201486f1 | ||
|
|
f47dc3c78c | ||
|
|
e9cfe372bf | ||
|
|
82253525f2 | ||
|
|
69e38a25c3 | ||
|
|
59448593d8 | ||
|
|
3047974fdc | ||
|
|
d64f78a949 | ||
|
|
9023d13929 | ||
|
|
5120f7fec7 | ||
|
|
b5bab3eb13 | ||
|
|
8ebd2479cf | ||
|
|
e7c4292d27 | ||
|
|
4d3ad5bdc7 | ||
|
|
3bac67030b | ||
|
|
1bec9288c4 | ||
|
|
57f5b8362a | ||
|
|
ccb0e0cf56 | ||
|
|
1ab3256204 | ||
|
|
377d21211a | ||
|
|
c51f252ff2 | ||
|
|
70a9a043ee | ||
|
|
eef57db955 | ||
|
|
7a68e570eb | ||
|
|
99a906753e | ||
|
|
de5df2690d | ||
|
|
1bd823cd20 | ||
|
|
153a130a09 | ||
|
|
2fc9336528 | ||
|
|
87483c3a95 | ||
|
|
54bc785f36 | ||
|
|
2f4051ed30 | ||
|
|
f0ac593068 | ||
|
|
fdb654de45 | ||
|
|
733c4633bf | ||
|
|
548cd113b2 | ||
|
|
13501e85f6 | ||
|
|
0aefe6d10a | ||
|
|
9ae4d50a98 | ||
|
|
f733cb7e5f | ||
|
|
58261b9ba0 | ||
|
|
25825929ba | ||
|
|
68d778ba50 | ||
|
|
f194c9661c |
No files matched your search
@@ -0,0 +1,143 @@
|
|||||||
|
# Architecture
|
||||||
|
|
||||||
|
T3 Code runs as a **Node.js WebSocket server** that wraps `codex app-server` (JSON-RPC over stdio) and serves a React web app.
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────┐
|
||||||
|
│ Browser (React + Vite) │
|
||||||
|
│ wsTransport (state machine) │
|
||||||
|
│ Typed push decode at boundary │
|
||||||
|
└──────────┬──────────────────────┘
|
||||||
|
│ ws://localhost:3773
|
||||||
|
┌──────────▼──────────────────────┐
|
||||||
|
│ apps/server (Node.js) │
|
||||||
|
│ WebSocket + HTTP static server │
|
||||||
|
│ ServerPushBus (ordered pushes) │
|
||||||
|
│ ServerReadiness (startup gate) │
|
||||||
|
│ OrchestrationEngine │
|
||||||
|
│ ProviderService │
|
||||||
|
│ CheckpointReactor │
|
||||||
|
│ RuntimeReceiptBus │
|
||||||
|
└──────────┬──────────────────────┘
|
||||||
|
│ JSON-RPC over stdio
|
||||||
|
┌──────────▼──────────────────────┐
|
||||||
|
│ codex app-server │
|
||||||
|
└─────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Components
|
||||||
|
|
||||||
|
- **Browser app**: The React app renders session state, owns the client-side WebSocket transport, and treats typed push events as the boundary between server runtime details and UI state.
|
||||||
|
|
||||||
|
- **Server**: `apps/server` is the main coordinator. It serves the web app, accepts WebSocket requests, waits for startup readiness before welcoming clients, and sends all outbound pushes through a single ordered push path.
|
||||||
|
|
||||||
|
- **Provider runtime**: `codex app-server` does the actual provider/session work. The server talks to it over JSON-RPC on stdio and translates those runtime events into the app's orchestration model.
|
||||||
|
|
||||||
|
- **Background workers**: Long-running async flows such as runtime ingestion, command reaction, and checkpoint processing run as queue-backed workers. This keeps work ordered, reduces timing races, and gives tests a deterministic way to wait for the system to go idle.
|
||||||
|
|
||||||
|
- **Runtime signals**: The server emits lightweight typed receipts when important async milestones finish, such as checkpoint capture, diff finalization, or a turn becoming fully quiescent. Tests and orchestration code wait on these signals instead of polling internal state.
|
||||||
|
|
||||||
|
## Event Lifecycle
|
||||||
|
|
||||||
|
### Startup and client connect
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant Browser
|
||||||
|
participant Transport as WsTransport
|
||||||
|
participant Server as wsServer
|
||||||
|
participant Layers as serverLayers
|
||||||
|
participant Ready as ServerReadiness
|
||||||
|
participant Push as ServerPushBus
|
||||||
|
|
||||||
|
Browser->>Transport: Load app and open WebSocket
|
||||||
|
Transport->>Server: Connect
|
||||||
|
Server->>Layers: Start runtime services
|
||||||
|
Server->>Ready: Wait for startup barriers
|
||||||
|
Ready-->>Server: Ready
|
||||||
|
Server->>Push: Publish server.welcome
|
||||||
|
Push-->>Transport: Ordered welcome push
|
||||||
|
Transport-->>Browser: Hydrate initial state
|
||||||
|
```
|
||||||
|
|
||||||
|
1. The browser boots [`WsTransport`][1] and registers typed listeners in [`wsNativeApi`][2].
|
||||||
|
2. The server accepts the connection in [`wsServer`][3] and brings up the runtime graph defined in [`serverLayers`][7].
|
||||||
|
3. [`ServerReadiness`][4] waits until the key startup barriers are complete.
|
||||||
|
4. Once the server is ready, [`wsServer`][3] sends `server.welcome` from the contracts in [`ws.ts`][6] through [`ServerPushBus`][5].
|
||||||
|
5. The browser receives that ordered push through [`WsTransport`][1], and [`wsNativeApi`][2] uses it to seed local client state.
|
||||||
|
|
||||||
|
### User turn flow
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant Browser
|
||||||
|
participant Transport as WsTransport
|
||||||
|
participant Server as wsServer
|
||||||
|
participant Provider as ProviderService
|
||||||
|
participant Codex as codex app-server
|
||||||
|
participant Ingest as ProviderRuntimeIngestion
|
||||||
|
participant Engine as OrchestrationEngine
|
||||||
|
participant Push as ServerPushBus
|
||||||
|
|
||||||
|
Browser->>Transport: Send user action
|
||||||
|
Transport->>Server: Typed WebSocket request
|
||||||
|
Server->>Provider: Route request
|
||||||
|
Provider->>Codex: JSON-RPC over stdio
|
||||||
|
Codex-->>Ingest: Provider runtime events
|
||||||
|
Ingest->>Engine: Normalize into orchestration events
|
||||||
|
Engine-->>Server: Domain events
|
||||||
|
Server->>Push: Publish orchestration.domainEvent
|
||||||
|
Push-->>Browser: Typed push
|
||||||
|
```
|
||||||
|
|
||||||
|
1. A user action in the browser becomes a typed request through [`WsTransport`][1] and the browser API layer in [`nativeApi`][12].
|
||||||
|
2. [`wsServer`][3] decodes that request using the shared WebSocket contracts in [`ws.ts`][6] and routes it to the right service.
|
||||||
|
3. [`ProviderService`][8] starts or resumes a session and talks to `codex app-server` over JSON-RPC on stdio.
|
||||||
|
4. Provider-native events are pulled back into the server by [`ProviderRuntimeIngestion`][9], which converts them into orchestration events.
|
||||||
|
5. [`OrchestrationEngine`][10] persists those events, updates the read model, and exposes them as domain events.
|
||||||
|
6. [`wsServer`][3] pushes those updates to the browser through [`ServerPushBus`][5] on channels defined in [`orchestration.ts`][11].
|
||||||
|
|
||||||
|
### Async completion flow
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant Server as wsServer
|
||||||
|
participant Worker as Queue-backed workers
|
||||||
|
participant Cmd as ProviderCommandReactor
|
||||||
|
participant Checkpoint as CheckpointReactor
|
||||||
|
participant Receipt as RuntimeReceiptBus
|
||||||
|
participant Push as ServerPushBus
|
||||||
|
participant Browser
|
||||||
|
|
||||||
|
Server->>Worker: Enqueue follow-up work
|
||||||
|
Worker->>Cmd: Process provider commands
|
||||||
|
Worker->>Checkpoint: Process checkpoint tasks
|
||||||
|
Checkpoint->>Receipt: Publish completion receipt
|
||||||
|
Cmd-->>Server: Produce orchestration changes
|
||||||
|
Checkpoint-->>Server: Produce orchestration changes
|
||||||
|
Server->>Push: Publish resulting state updates
|
||||||
|
Push-->>Browser: User-visible push
|
||||||
|
```
|
||||||
|
|
||||||
|
1. Some work continues after the initial request returns, especially in [`ProviderRuntimeIngestion`][9], [`ProviderCommandReactor`][13], and [`CheckpointReactor`][14].
|
||||||
|
2. These flows run as queue-backed workers using [`DrainableWorker`][16], which helps keep side effects ordered and test synchronization deterministic.
|
||||||
|
3. When a milestone completes, the server emits a typed receipt on [`RuntimeReceiptBus`][15], such as checkpoint completion or turn quiescence.
|
||||||
|
4. Tests and orchestration code wait on those receipts instead of polling git state, projections, or timers.
|
||||||
|
5. Any user-visible state changes produced by that async work still go back through [`wsServer`][3] and [`ServerPushBus`][5].
|
||||||
|
|
||||||
|
[1]: ../apps/web/src/wsTransport.ts
|
||||||
|
[2]: ../apps/web/src/wsNativeApi.ts
|
||||||
|
[3]: ../apps/server/src/wsServer.ts
|
||||||
|
[4]: ../apps/server/src/wsServer/readiness.ts
|
||||||
|
[5]: ../apps/server/src/wsServer/pushBus.ts
|
||||||
|
[6]: ../packages/contracts/src/ws.ts
|
||||||
|
[7]: ../apps/server/src/serverLayers.ts
|
||||||
|
[8]: ../apps/server/src/provider/Layers/ProviderService.ts
|
||||||
|
[9]: ../apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
|
||||||
|
[10]: ../apps/server/src/orchestration/Layers/OrchestrationEngine.ts
|
||||||
|
[11]: ../packages/contracts/src/orchestration.ts
|
||||||
|
[12]: ../apps/web/src/nativeApi.ts
|
||||||
|
[13]: ../apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
|
||||||
|
[14]: ../apps/server/src/orchestration/Layers/CheckpointReactor.ts
|
||||||
|
[15]: ../apps/server/src/orchestration/Layers/RuntimeReceiptBus.ts
|
||||||
|
[16]: ../packages/shared/src/DrainableWorker.ts
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# CI quality gates
|
||||||
|
|
||||||
|
- `.github/workflows/ci.yml` runs `bun run lint`, `bun run typecheck`, and `bun run test` on pull requests and pushes to `main`.
|
||||||
|
- `.github/workflows/release.yml` builds macOS (`arm64` and `x64`), Linux (`x64`), and Windows (`x64`) desktop artifacts from a single `v*.*.*` tag and publishes one GitHub release.
|
||||||
|
- The release workflow auto-enables signing only when secrets are present: Apple credentials for macOS and Azure Trusted Signing credentials for Windows. Without secrets, it still releases unsigned artifacts.
|
||||||
|
- See `docs/release.md` for full release/signing setup checklist.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Codex prerequisites
|
||||||
|
|
||||||
|
- Install Codex CLI so `codex` is on your PATH.
|
||||||
|
- Authenticate Codex before running T3 Code (for example via API key or ChatGPT auth supported by Codex).
|
||||||
|
- T3 Code starts the server via `codex app-server` per session.
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
# Encyclopedia
|
||||||
|
|
||||||
|
This is a living glossary for T3 Code. It explains what common terms mean in this codebase.
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
- [Project and workspace](#project-and-workspace)
|
||||||
|
- [Thread timeline](#thread-timeline)
|
||||||
|
- [Orchestration](#orchestration)
|
||||||
|
- [Provider runtime](#provider-runtime)
|
||||||
|
- [Checkpointing](#checkpointing)
|
||||||
|
|
||||||
|
## Concepts
|
||||||
|
|
||||||
|
### Project and workspace
|
||||||
|
|
||||||
|
#### Project
|
||||||
|
|
||||||
|
The top-level workspace record in the app. In [the orchestration contracts][1], a project has a `workspaceRoot`, a title, and one or more threads. See [workspace-layout.md][2].
|
||||||
|
|
||||||
|
#### Workspace root
|
||||||
|
|
||||||
|
The root filesystem path for a project. In [the orchestration model][1], it is the base directory for branches and optional worktrees. See [workspace-layout.md][2].
|
||||||
|
|
||||||
|
#### Worktree
|
||||||
|
|
||||||
|
A Git worktree used as an isolated workspace for a thread. If a thread has a `worktreePath` in [the contracts][1], it runs there instead of in the main working tree. Git operations live in [GitCore.ts][3].
|
||||||
|
|
||||||
|
### Thread timeline
|
||||||
|
|
||||||
|
#### Thread
|
||||||
|
|
||||||
|
The main durable unit of conversation and workspace history. In [the orchestration contracts][1], a thread holds messages, activities, checkpoints, and session-related state. See [projector.ts][4].
|
||||||
|
|
||||||
|
#### Turn
|
||||||
|
|
||||||
|
A single user-to-assistant work cycle inside a thread. It starts with user input and ends when follow-up work like checkpointing settles. See [the contracts][1], [ProviderRuntimeIngestion.ts][5], and [CheckpointReactor.ts][6].
|
||||||
|
|
||||||
|
#### Activity
|
||||||
|
|
||||||
|
A user-visible log item attached to a thread. In [the contracts][1], activities cover important non-message events like approvals, tool actions, and failures. They are projected into thread state in [projector.ts][4].
|
||||||
|
|
||||||
|
### Orchestration
|
||||||
|
|
||||||
|
Orchestration is the server-side domain layer that turns runtime activity into stable app state. The main entry point is [OrchestrationEngine.ts][7], with core logic in [decider.ts][8] and [projector.ts][4].
|
||||||
|
|
||||||
|
#### Aggregate
|
||||||
|
|
||||||
|
The domain object a command or event belongs to. In [the contracts][1], that is usually `project` or `thread`. See [decider.ts][8].
|
||||||
|
|
||||||
|
#### Command
|
||||||
|
|
||||||
|
A typed request to change domain state. In [the contracts][1], commands are validated in [commandInvariants.ts][9] and turned into events by [decider.ts][8].
|
||||||
|
Examples include `thread.create`, `thread.turn.start`, and `thread.checkpoint.revert`.
|
||||||
|
|
||||||
|
#### Domain Event
|
||||||
|
|
||||||
|
A persisted fact that something already happened. In [the contracts][1], events are the source of truth, and [projector.ts][4] shows how they are applied.
|
||||||
|
Examples include `thread.created`, `thread.message-sent`, and `thread.turn-diff-completed`.
|
||||||
|
|
||||||
|
#### Decider
|
||||||
|
|
||||||
|
The pure orchestration logic that turns commands plus current state into events. The core implementation is in [decider.ts][8], with preconditions in [commandInvariants.ts][9].
|
||||||
|
|
||||||
|
#### Projection
|
||||||
|
|
||||||
|
A read-optimized view derived from events. See [projector.ts][4], [ProjectionPipeline.ts][11], and [ProjectionSnapshotQuery.ts][10].
|
||||||
|
|
||||||
|
#### Projector
|
||||||
|
|
||||||
|
The logic that applies domain events to the read model or projection tables. See [projector.ts][4] and [ProjectionPipeline.ts][11].
|
||||||
|
|
||||||
|
#### Read model
|
||||||
|
|
||||||
|
The current materialized view of orchestration state. In [the contracts][1], it holds projects, threads, messages, activities, checkpoints, and session state. See [ProjectionSnapshotQuery.ts][10] and [OrchestrationEngine.ts][7].
|
||||||
|
|
||||||
|
#### Reactor
|
||||||
|
|
||||||
|
A side-effecting service that handles follow-up work after events or runtime signals. Examples include [CheckpointReactor.ts][6], [ProviderCommandReactor.ts][12], and [ProviderRuntimeIngestion.ts][5].
|
||||||
|
|
||||||
|
#### Receipt
|
||||||
|
|
||||||
|
A lightweight typed runtime signal emitted when an async milestone completes. See [RuntimeReceiptBus.ts][13].
|
||||||
|
Examples include `checkpoint.baseline.captured`, `checkpoint.diff.finalized`, and `turn.processing.quiesced`, which are emitted by flows such as [CheckpointReactor.ts][6].
|
||||||
|
|
||||||
|
#### Quiesced
|
||||||
|
|
||||||
|
"Quiesced" means a turn has gone quiet and stable. In [the receipt schema][13], it means the follow-up work has settled, including work in [CheckpointReactor.ts][6].
|
||||||
|
|
||||||
|
### Provider runtime
|
||||||
|
|
||||||
|
The live backend agent implementation and its event stream. The main service is [ProviderService.ts][14], the adapter contract is [ProviderAdapter.ts][15], and the overview is in [provider-architecture.md][16].
|
||||||
|
|
||||||
|
#### Provider
|
||||||
|
|
||||||
|
The backend agent runtime that actually performs work. See [ProviderService.ts][14], [ProviderAdapter.ts][15], and [CodexAdapter.ts][17].
|
||||||
|
|
||||||
|
#### Session
|
||||||
|
|
||||||
|
The live provider-backed runtime attached to a thread. Session shape is in [the orchestration contracts][1], and lifecycle is managed in [ProviderService.ts][14].
|
||||||
|
|
||||||
|
#### Runtime mode
|
||||||
|
|
||||||
|
The safety/access mode for a thread or session. In [the contracts][1], the main values are `approval-required` and `full-access`. See [runtime-modes.md][18].
|
||||||
|
|
||||||
|
#### Interaction mode
|
||||||
|
|
||||||
|
The agent interaction style for a thread. In [the contracts][1], the main values are `default` and `plan`. See [runtime-modes.md][18].
|
||||||
|
|
||||||
|
#### Assistant delivery mode
|
||||||
|
|
||||||
|
Controls how assistant text reaches the thread timeline. In [the contracts][1], `streaming` updates incrementally and `buffered` delivers a completed result. See [ProviderService.ts][14].
|
||||||
|
|
||||||
|
#### Snapshot
|
||||||
|
|
||||||
|
A point-in-time view of state. The word is used in multiple layers, including orchestration, provider, and checkpointing. See [ProjectionSnapshotQuery.ts][10], [ProviderAdapter.ts][15], and [CheckpointStore.ts][19].
|
||||||
|
|
||||||
|
### Checkpointing
|
||||||
|
|
||||||
|
Checkpointing captures workspace state over time so the app can diff turns and restore earlier points. The main pieces are [CheckpointStore.ts][19], [CheckpointDiffQuery.ts][20], and [CheckpointReactor.ts][6].
|
||||||
|
|
||||||
|
#### Checkpoint
|
||||||
|
|
||||||
|
A saved snapshot of a thread workspace at a particular turn. In practice it is a hidden Git ref in [CheckpointStore.ts][19] plus a projected summary from [ProjectionCheckpoints.ts][21]. Capture and lifecycle work happen in [CheckpointReactor.ts][6].
|
||||||
|
|
||||||
|
#### Checkpoint ref
|
||||||
|
|
||||||
|
The durable identifier for a filesystem checkpoint, stored as a Git ref. It is typed in [the contracts][1], constructed in [Utils.ts][22], and used by [CheckpointStore.ts][19].
|
||||||
|
|
||||||
|
#### Checkpoint baseline
|
||||||
|
|
||||||
|
The starting checkpoint for diffing a thread timeline. This flow is surfaced through [RuntimeReceiptBus.ts][13], coordinated in [CheckpointReactor.ts][6], and supported by [Utils.ts][22].
|
||||||
|
|
||||||
|
#### Checkpoint diff
|
||||||
|
|
||||||
|
The patch difference between two checkpoints. Query logic lives in [CheckpointDiffQuery.ts][20], diff parsing lives in [Diffs.ts][23], and finalization is coordinated by [CheckpointReactor.ts][6].
|
||||||
|
|
||||||
|
#### Turn diff
|
||||||
|
|
||||||
|
The file patch and changed-file summary for one turn. It is usually computed in [CheckpointDiffQuery.ts][20], represented in [the contracts][1], and recorded into thread state by [projector.ts][4].
|
||||||
|
|
||||||
|
## Practical Shortcuts
|
||||||
|
|
||||||
|
- If you see `requested`, think "intent recorded".
|
||||||
|
- If you see `completed`, think "result applied".
|
||||||
|
- If you see `receipt`, think "async milestone signal".
|
||||||
|
- If you see `checkpoint`, think "workspace snapshot for diff/restore".
|
||||||
|
- If you see `quiesced`, think "all relevant follow-up work has gone idle".
|
||||||
|
|
||||||
|
## Related Docs
|
||||||
|
|
||||||
|
- [architecture.md][24]
|
||||||
|
- [provider-architecture.md][16]
|
||||||
|
- [runtime-modes.md][18]
|
||||||
|
- [workspace-layout.md][2]
|
||||||
|
|
||||||
|
[1]: ../packages/contracts/src/orchestration.ts
|
||||||
|
[2]: ./workspace-layout.md
|
||||||
|
[3]: ../apps/server/src/git/Layers/GitCore.ts
|
||||||
|
[4]: ../apps/server/src/orchestration/projector.ts
|
||||||
|
[5]: ../apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
|
||||||
|
[6]: ../apps/server/src/orchestration/Layers/CheckpointReactor.ts
|
||||||
|
[7]: ../apps/server/src/orchestration/Layers/OrchestrationEngine.ts
|
||||||
|
[8]: ../apps/server/src/orchestration/decider.ts
|
||||||
|
[9]: ../apps/server/src/orchestration/commandInvariants.ts
|
||||||
|
[10]: ../apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
|
||||||
|
[11]: ../apps/server/src/orchestration/Layers/ProjectionPipeline.ts
|
||||||
|
[12]: ../apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
|
||||||
|
[13]: ../apps/server/src/orchestration/Services/RuntimeReceiptBus.ts
|
||||||
|
[14]: ../apps/server/src/provider/Layers/ProviderService.ts
|
||||||
|
[15]: ../apps/server/src/provider/Services/ProviderAdapter.ts
|
||||||
|
[16]: ./provider-architecture.md
|
||||||
|
[17]: ../apps/server/src/provider/Layers/CodexAdapter.ts
|
||||||
|
[18]: ./runtime-modes.md
|
||||||
|
[19]: ../apps/server/src/checkpointing/Services/CheckpointStore.ts
|
||||||
|
[20]: ../apps/server/src/checkpointing/Services/CheckpointDiffQuery.ts
|
||||||
|
[21]: ../apps/server/src/persistence/Services/ProjectionCheckpoints.ts
|
||||||
|
[22]: ../apps/server/src/checkpointing/Utils.ts
|
||||||
|
[23]: ../apps/server/src/checkpointing/Diffs.ts
|
||||||
|
[24]: ./architecture.md
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Provider architecture
|
||||||
|
|
||||||
|
The web app communicates with the server via WebSocket using a simple JSON-RPC-style protocol:
|
||||||
|
|
||||||
|
- **Request/Response**: `{ id, method, params }` → `{ id, result }` or `{ id, error }`
|
||||||
|
- **Push events**: typed envelopes with `channel`, `sequence` (monotonic per connection), and channel-specific `data`
|
||||||
|
|
||||||
|
Push channels: `server.welcome`, `server.configUpdated`, `terminal.event`, `orchestration.domainEvent`. Payloads are schema-validated at the transport boundary (`wsTransport.ts`). Decode failures produce structured `WsDecodeDiagnostic` with `code`, `reason`, and path info.
|
||||||
|
|
||||||
|
Methods mirror the `NativeApi` interface defined in `@t3tools/contracts`:
|
||||||
|
|
||||||
|
- `providers.startSession`, `providers.sendTurn`, `providers.interruptTurn`
|
||||||
|
- `providers.respondToRequest`, `providers.stopSession`
|
||||||
|
- `shell.openInEditor`, `server.getConfig`
|
||||||
|
|
||||||
|
Codex is the only implemented provider. `claudeCode` is reserved in contracts/UI.
|
||||||
|
|
||||||
|
## Client transport
|
||||||
|
|
||||||
|
`wsTransport.ts` manages connection state: `connecting` → `open` → `reconnecting` → `closed` → `disposed`. Outbound requests are queued while disconnected and flushed on reconnect. Inbound pushes are decoded and validated at the boundary, then cached per channel. Subscribers can opt into `replayLatest` to receive the last push on subscribe.
|
||||||
|
|
||||||
|
## Server-side orchestration layers
|
||||||
|
|
||||||
|
Provider runtime events flow through queue-based workers:
|
||||||
|
|
||||||
|
1. **ProviderRuntimeIngestion** — consumes provider runtime streams, emits orchestration commands
|
||||||
|
2. **ProviderCommandReactor** — reacts to orchestration intent events, dispatches provider calls
|
||||||
|
3. **CheckpointReactor** — captures git checkpoints on turn start/complete, publishes runtime receipts
|
||||||
|
|
||||||
|
All three use `DrainableWorker` internally and expose `drain()` for deterministic test synchronization.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# Quick start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Development (with hot reload)
|
||||||
|
bun run dev
|
||||||
|
|
||||||
|
# Desktop development
|
||||||
|
bun run dev:desktop
|
||||||
|
|
||||||
|
# Desktop development on an isolated port set
|
||||||
|
T3CODE_DEV_INSTANCE=feature-xyz bun run dev:desktop
|
||||||
|
|
||||||
|
# Production
|
||||||
|
bun run build
|
||||||
|
bun run start
|
||||||
|
|
||||||
|
# Build a shareable macOS .dmg (arm64 by default)
|
||||||
|
bun run dist:desktop:dmg
|
||||||
|
|
||||||
|
# Or from any project directory after publishing:
|
||||||
|
npx t3
|
||||||
|
```
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Runtime modes
|
||||||
|
|
||||||
|
T3 Code has a global runtime mode switch in the chat toolbar:
|
||||||
|
|
||||||
|
- **Full access** (default): starts sessions with `approvalPolicy: never` and `sandboxMode: danger-full-access`.
|
||||||
|
- **Supervised**: starts sessions with `approvalPolicy: on-request` and `sandboxMode: workspace-write`, then prompts in-app for command/file approvals.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# Scripts
|
||||||
|
|
||||||
|
- `bun run dev` — Starts contracts, server, and web in `turbo watch` mode.
|
||||||
|
- `bun run dev:server` — Starts just the WebSocket server (uses Bun TypeScript execution).
|
||||||
|
- `bun run dev:web` — Starts just the Vite dev server for the web app.
|
||||||
|
- Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state.
|
||||||
|
- Override server CLI-equivalent flags from root dev commands with `--`, for example:
|
||||||
|
`bun run dev -- --state-dir ~/.t3/another-dev-state`
|
||||||
|
- `bun run start` — Runs the production server (serves built web app as static files).
|
||||||
|
- `bun run build` — Builds contracts, web app, and server through Turbo.
|
||||||
|
- `bun run typecheck` — Strict TypeScript checks for all packages.
|
||||||
|
- `bun run test` — Runs workspace tests.
|
||||||
|
- `bun run dist:desktop:artifact -- --platform <mac|linux|win> --target <target> --arch <arch>` — Builds a desktop artifact for a specific platform/target/arch.
|
||||||
|
- `bun run dist:desktop:dmg` — Builds a shareable macOS `.dmg` into `./release`.
|
||||||
|
- `bun run dist:desktop:dmg:x64` — Builds an Intel macOS `.dmg`.
|
||||||
|
- `bun run dist:desktop:linux` — Builds a Linux AppImage into `./release`.
|
||||||
|
- `bun run dist:desktop:win` — Builds a Windows NSIS installer into `./release`.
|
||||||
|
|
||||||
|
## Desktop `.dmg` packaging notes
|
||||||
|
|
||||||
|
- Default build is unsigned/not notarized for local sharing.
|
||||||
|
- The DMG build uses `assets/macos-icon-1024.png` as the production app icon source.
|
||||||
|
- Desktop production windows load the bundled UI from `t3://app/index.html` (not a `127.0.0.1` document URL).
|
||||||
|
- Desktop packaging includes `apps/server/dist` (the `t3` backend) and starts it on loopback with an auth token for WebSocket/API traffic.
|
||||||
|
- Your tester can still open it on macOS by right-clicking the app and choosing **Open** on first launch.
|
||||||
|
- To keep staging files for debugging package contents, run: `bun run dist:desktop:dmg -- --keep-stage`
|
||||||
|
- To allow code-signing/notarization when configured in CI/secrets, add: `--signed`.
|
||||||
|
- Windows `--signed` uses Azure Trusted Signing and expects:
|
||||||
|
`AZURE_TRUSTED_SIGNING_ENDPOINT`, `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`,
|
||||||
|
`AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`, and `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`.
|
||||||
|
- Azure authentication env vars are also required (for example service principal with secret):
|
||||||
|
`AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`.
|
||||||
|
|
||||||
|
## Running multiple dev instances
|
||||||
|
|
||||||
|
Set `T3CODE_DEV_INSTANCE` to any value to deterministically shift all dev ports together.
|
||||||
|
|
||||||
|
- Default ports: server `3773`, web `5733`
|
||||||
|
- Shifted ports: `base + offset` (offset is hashed from `T3CODE_DEV_INSTANCE`)
|
||||||
|
- Example: `T3CODE_DEV_INSTANCE=branch-a bun run dev:desktop`
|
||||||
|
|
||||||
|
If you want full control instead of hashing, set `T3CODE_PORT_OFFSET` to a numeric offset.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Workspace layout
|
||||||
|
|
||||||
|
- `/apps/server`: Node.js WebSocket server. Wraps Codex app-server, serves the built web app, and opens the browser on start.
|
||||||
|
- `/apps/web`: React + Vite UI. Session control, conversation, and provider event rendering. Connects to the server via WebSocket.
|
||||||
|
- `/apps/desktop`: Electron shell. Spawns a desktop-scoped `t3` backend process and loads the shared web app.
|
||||||
|
- `/packages/contracts`: Shared effect/Schema schemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types.
|
||||||
|
- `/packages/shared`: Shared runtime utilities consumed by both server and web. Uses explicit subpath exports (e.g. `@t3tools/shared/git`, `@t3tools/shared/DrainableWorker`) — no barrel index.
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Trust list for this repository.
|
||||||
|
#
|
||||||
|
# External contributors listed here are treated as trusted by the vouch
|
||||||
|
# workflow. Collaborators with write access are automatically trusted and
|
||||||
|
# do not need to be duplicated in this file.
|
||||||
|
#
|
||||||
|
# Syntax:
|
||||||
|
# github:username
|
||||||
|
# -github:username reason for denouncement
|
||||||
|
#
|
||||||
|
# Keep entries sorted alphabetically.
|
||||||
|
github:adityavardhansharma
|
||||||
|
github:binbandit
|
||||||
|
github:chuks-qua
|
||||||
|
github:cursoragent
|
||||||
|
github:gbarros-dev
|
||||||
|
github:github-actions[bot]
|
||||||
|
github:hwanseoc
|
||||||
|
github:jamesx0416
|
||||||
|
github:jasonLaster
|
||||||
|
github:JoeEverest
|
||||||
|
github:nmggithub
|
||||||
|
github:Noojuno
|
||||||
|
github:notkainoa
|
||||||
|
github:PatrickBauer
|
||||||
|
github:realAhmedRoach
|
||||||
|
github:shiroyasha9
|
||||||
|
github:Yash-Singh1
|
||||||
|
github:eggfriedrice24
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<!--
|
||||||
|
⚠️ READ BEFORE OPENING ⚠️
|
||||||
|
|
||||||
|
We are not actively accepting contributions right now.
|
||||||
|
|
||||||
|
You can still open a PR, but please do so knowing there is a high chance
|
||||||
|
we may close it without merging it, or never review it.
|
||||||
|
|
||||||
|
- Small, focused PRs are strongly preferred. Bug fixes are most likely to be merged.
|
||||||
|
- New features will most likely just annoy us.
|
||||||
|
- 1,000+ line PRs with a bunch of new features will probably get you banned from the repo.
|
||||||
|
-->
|
||||||
|
|
||||||
|
## What Changed
|
||||||
|
|
||||||
|
<!-- Describe the change clearly and keep scope tight. -->
|
||||||
|
|
||||||
|
## Why
|
||||||
|
|
||||||
|
<!-- Explain the problem being solved and why this approach is the right one. -->
|
||||||
|
|
||||||
|
## UI Changes
|
||||||
|
|
||||||
|
<!-- If this PR changes UI, include clear before/after screenshots.
|
||||||
|
If the change involves motion or interaction, include a short video.
|
||||||
|
Delete this section if not applicable. -->
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
- [ ] This PR is small and focused
|
||||||
|
- [ ] I explained what changed and why
|
||||||
|
- [ ] I included before/after screenshots for any UI changes
|
||||||
|
- [ ] I included a video for animation/interaction changes
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
quality:
|
||||||
|
name: Format, Lint, Typecheck, Test, Browser Test, Build
|
||||||
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version-file: package.json
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: package.json
|
||||||
|
|
||||||
|
- name: Cache Bun and Turbo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.bun/install/cache
|
||||||
|
.turbo
|
||||||
|
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-
|
||||||
|
|
||||||
|
- name: Cache Playwright browsers
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cache/ms-playwright
|
||||||
|
key: ${{ runner.os }}-playwright-${{ hashFiles('bun.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-playwright-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Format
|
||||||
|
run: bun run fmt:check
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: bun run lint
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: bun run typecheck
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: bun run test
|
||||||
|
|
||||||
|
- name: Install browser test runtime
|
||||||
|
run: |
|
||||||
|
cd apps/web
|
||||||
|
bunx playwright install --with-deps chromium
|
||||||
|
|
||||||
|
- name: Browser test
|
||||||
|
run: bun run --cwd apps/web test:browser
|
||||||
|
|
||||||
|
- name: Build desktop pipeline
|
||||||
|
run: bun run build:desktop
|
||||||
|
|
||||||
|
- name: Verify preload bundle output
|
||||||
|
run: |
|
||||||
|
test -f apps/desktop/dist-electron/preload.js
|
||||||
|
grep -nE "desktopBridge|getWsUrl|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.js
|
||||||
|
|
||||||
|
release_smoke:
|
||||||
|
name: Release Smoke
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version-file: package.json
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: package.json
|
||||||
|
|
||||||
|
- name: Exercise release-only workflow steps
|
||||||
|
run: node scripts/release-smoke.ts
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
name: PR Vouch
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- .github/VOUCHED.td
|
||||||
|
- .github/workflows/pr-vouch.yml
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
collect-targets:
|
||||||
|
name: Collect PR targets
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
outputs:
|
||||||
|
targets: ${{ steps.collect.outputs.targets }}
|
||||||
|
steps:
|
||||||
|
- id: collect
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
if (context.eventName === "pull_request_target") {
|
||||||
|
const pr = context.payload.pull_request;
|
||||||
|
core.setOutput("targets", JSON.stringify([{ number: pr.number, user: pr.user.login }]));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context.eventName === "issue_comment") {
|
||||||
|
const issue = context.payload.issue;
|
||||||
|
const body = context.payload.comment?.body ?? "";
|
||||||
|
if (!issue?.pull_request || !body.includes("/recheck-vouch")) {
|
||||||
|
core.setOutput("targets", "[]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
core.setOutput(
|
||||||
|
"targets",
|
||||||
|
JSON.stringify([{ number: issue.number, user: issue.user.login }]),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pulls = await github.paginate(github.rest.pulls.list, {
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: "open",
|
||||||
|
per_page: 100,
|
||||||
|
});
|
||||||
|
|
||||||
|
const targets = pulls.map((pull) => ({
|
||||||
|
number: pull.number,
|
||||||
|
user: pull.user.login,
|
||||||
|
}));
|
||||||
|
core.setOutput("targets", JSON.stringify(targets));
|
||||||
|
|
||||||
|
label:
|
||||||
|
name: Label PR ${{ matrix.target.number }}
|
||||||
|
needs: collect-targets
|
||||||
|
if: ${{ needs.collect-targets.outputs.targets != '[]' }}
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
concurrency:
|
||||||
|
group: pr-vouch-${{ matrix.target.number }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
target: ${{ fromJson(needs.collect-targets.outputs.targets) }}
|
||||||
|
steps:
|
||||||
|
- id: vouch
|
||||||
|
name: Check PR author trust
|
||||||
|
uses: mitchellh/vouch/action/check-user@v1
|
||||||
|
with:
|
||||||
|
user: ${{ matrix.target.user }}
|
||||||
|
allow-fail: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Sync PR labels
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
env:
|
||||||
|
PR_NUMBER: ${{ matrix.target.number }}
|
||||||
|
VOUCH_STATUS: ${{ steps.vouch.outputs.status }}
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const issueNumber = Number(process.env.PR_NUMBER);
|
||||||
|
const status = process.env.VOUCH_STATUS;
|
||||||
|
const managedLabels = [
|
||||||
|
{
|
||||||
|
name: "vouch:trusted",
|
||||||
|
color: "1f883d",
|
||||||
|
description: "PR author is trusted by repo permissions or the VOUCHED list.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "vouch:unvouched",
|
||||||
|
color: "fbca04",
|
||||||
|
description: "PR author is not yet trusted in the VOUCHED list.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "vouch:denounced",
|
||||||
|
color: "d1242f",
|
||||||
|
description: "PR author is explicitly blocked by the VOUCHED list.",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const managedLabelNames = managedLabels.map((label) => label.name);
|
||||||
|
|
||||||
|
for (const label of managedLabels) {
|
||||||
|
try {
|
||||||
|
const { data: existing } = await github.rest.issues.getLabel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
name: label.name,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
existing.color !== label.color ||
|
||||||
|
(existing.description ?? "") !== label.description
|
||||||
|
) {
|
||||||
|
await github.rest.issues.updateLabel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
name: label.name,
|
||||||
|
color: label.color,
|
||||||
|
description: label.description,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status !== 404) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
await github.rest.issues.createLabel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
name: label.name,
|
||||||
|
color: label.color,
|
||||||
|
description: label.description,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextLabelName =
|
||||||
|
status === "denounced"
|
||||||
|
? "vouch:denounced"
|
||||||
|
: ["bot", "collaborator", "vouched"].includes(status)
|
||||||
|
? "vouch:trusted"
|
||||||
|
: "vouch:unvouched";
|
||||||
|
|
||||||
|
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issueNumber,
|
||||||
|
});
|
||||||
|
|
||||||
|
const preservedLabels = currentLabels
|
||||||
|
.map((label) => label.name)
|
||||||
|
.filter((name) => !managedLabelNames.includes(name));
|
||||||
|
|
||||||
|
await github.rest.issues.setLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issueNumber,
|
||||||
|
labels: [...preservedLabels, nextLabelName],
|
||||||
|
});
|
||||||
|
|
||||||
|
core.info(`PR #${issueNumber}: ${status} -> ${nextLabelName}`);
|
||||||
@@ -0,0 +1,351 @@
|
|||||||
|
name: Release Desktop
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: "Release version (for example 1.2.3 or v1.2.3)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
preflight:
|
||||||
|
name: Preflight
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.release_meta.outputs.version }}
|
||||||
|
tag: ${{ steps.release_meta.outputs.tag }}
|
||||||
|
is_prerelease: ${{ steps.release_meta.outputs.is_prerelease }}
|
||||||
|
make_latest: ${{ steps.release_meta.outputs.make_latest }}
|
||||||
|
ref: ${{ github.sha }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- id: release_meta
|
||||||
|
name: Resolve release version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
|
||||||
|
raw="${{ github.event.inputs.version }}"
|
||||||
|
else
|
||||||
|
raw="${GITHUB_REF_NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
version="${raw#v}"
|
||||||
|
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
|
||||||
|
echo "Invalid release version: $raw" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "tag=v$version" >> "$GITHUB_OUTPUT"
|
||||||
|
if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "make_latest=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "make_latest=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version-file: package.json
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: package.json
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: bun run lint
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: bun run typecheck
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: bun run test
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build ${{ matrix.label }}
|
||||||
|
needs: preflight
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- label: macOS arm64
|
||||||
|
runner: macos-14
|
||||||
|
platform: mac
|
||||||
|
target: dmg
|
||||||
|
arch: arm64
|
||||||
|
- label: macOS x64
|
||||||
|
runner: macos-15-intel
|
||||||
|
platform: mac
|
||||||
|
target: dmg
|
||||||
|
arch: x64
|
||||||
|
- label: Linux x64
|
||||||
|
runner: ubuntu-24.04
|
||||||
|
platform: linux
|
||||||
|
target: AppImage
|
||||||
|
arch: x64
|
||||||
|
- label: Windows x64
|
||||||
|
runner: windows-2022
|
||||||
|
platform: win
|
||||||
|
target: nsis
|
||||||
|
arch: x64
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.preflight.outputs.ref }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version-file: package.json
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: package.json
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Build desktop artifact
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||||
|
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||||
|
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
|
||||||
|
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
|
||||||
|
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
|
||||||
|
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
|
||||||
|
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
||||||
|
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
|
||||||
|
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
|
||||||
|
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
|
||||||
|
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
|
||||||
|
AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
|
||||||
|
run: |
|
||||||
|
args=(
|
||||||
|
--platform "${{ matrix.platform }}"
|
||||||
|
--target "${{ matrix.target }}"
|
||||||
|
--arch "${{ matrix.arch }}"
|
||||||
|
--build-version "${{ needs.preflight.outputs.version }}"
|
||||||
|
--verbose
|
||||||
|
)
|
||||||
|
|
||||||
|
has_all() {
|
||||||
|
for value in "$@"; do
|
||||||
|
if [[ -z "$value" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "${{ matrix.platform }}" == "mac" ]]; then
|
||||||
|
if has_all "$CSC_LINK" "$CSC_KEY_PASSWORD" "$APPLE_API_KEY" "$APPLE_API_KEY_ID" "$APPLE_API_ISSUER"; then
|
||||||
|
key_path="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8"
|
||||||
|
printf '%s' "$APPLE_API_KEY" > "$key_path"
|
||||||
|
export APPLE_API_KEY="$key_path"
|
||||||
|
echo "macOS signing enabled."
|
||||||
|
args+=(--signed)
|
||||||
|
else
|
||||||
|
echo "macOS signing disabled (missing one or more Apple signing secrets)."
|
||||||
|
fi
|
||||||
|
elif [[ "${{ matrix.platform }}" == "win" ]]; then
|
||||||
|
if has_all \
|
||||||
|
"$AZURE_TENANT_ID" \
|
||||||
|
"$AZURE_CLIENT_ID" \
|
||||||
|
"$AZURE_CLIENT_SECRET" \
|
||||||
|
"$AZURE_TRUSTED_SIGNING_ENDPOINT" \
|
||||||
|
"$AZURE_TRUSTED_SIGNING_ACCOUNT_NAME" \
|
||||||
|
"$AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME" \
|
||||||
|
"$AZURE_TRUSTED_SIGNING_PUBLISHER_NAME"; then
|
||||||
|
echo "Windows signing enabled (Azure Trusted Signing)."
|
||||||
|
args+=(--signed)
|
||||||
|
else
|
||||||
|
echo "Windows signing disabled (missing one or more Azure Trusted Signing secrets)."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Signing disabled for ${{ matrix.platform }}."
|
||||||
|
fi
|
||||||
|
|
||||||
|
bun run dist:desktop:artifact -- "${args[@]}"
|
||||||
|
|
||||||
|
- name: Collect release assets
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
mkdir -p release-publish
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
|
for pattern in \
|
||||||
|
"release/*.dmg" \
|
||||||
|
"release/*.zip" \
|
||||||
|
"release/*.AppImage" \
|
||||||
|
"release/*.exe" \
|
||||||
|
"release/*.blockmap" \
|
||||||
|
"release/latest*.yml"; do
|
||||||
|
for file in $pattern; do
|
||||||
|
cp "$file" release-publish/
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then
|
||||||
|
if [[ -f release-publish/latest-mac.yml ]]; then
|
||||||
|
mv release-publish/latest-mac.yml "release-publish/latest-mac-${{ matrix.arch }}.yml"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: desktop-${{ matrix.platform }}-${{ matrix.arch }}
|
||||||
|
path: release-publish/*
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
publish_cli:
|
||||||
|
name: Publish CLI to npm
|
||||||
|
needs: [preflight, build]
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.preflight.outputs.ref }}
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version-file: package.json
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: package.json
|
||||||
|
registry-url: https://registry.npmjs.org
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Build CLI package
|
||||||
|
run: bun run build --filter=@t3tools/web --filter=t3
|
||||||
|
|
||||||
|
- name: Publish CLI package
|
||||||
|
run: node apps/server/scripts/cli.ts publish --tag latest --app-version "${{ needs.preflight.outputs.version }}" --verbose
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Publish GitHub Release
|
||||||
|
needs: [preflight, build, publish_cli]
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.preflight.outputs.ref }}
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: package.json
|
||||||
|
|
||||||
|
- name: Download all desktop artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: desktop-*
|
||||||
|
merge-multiple: true
|
||||||
|
path: release-assets
|
||||||
|
|
||||||
|
- name: Merge macOS updater manifests
|
||||||
|
run: |
|
||||||
|
node scripts/merge-mac-update-manifests.ts \
|
||||||
|
release-assets/latest-mac.yml \
|
||||||
|
release-assets/latest-mac-x64.yml
|
||||||
|
rm -f release-assets/latest-mac-x64.yml
|
||||||
|
|
||||||
|
- name: Publish release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: ${{ needs.preflight.outputs.tag }}
|
||||||
|
target_commitish: ${{ needs.preflight.outputs.ref }}
|
||||||
|
name: T3 Code v${{ needs.preflight.outputs.version }}
|
||||||
|
generate_release_notes: true
|
||||||
|
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
|
||||||
|
make_latest: ${{ needs.preflight.outputs.make_latest }}
|
||||||
|
files: |
|
||||||
|
release-assets/*.dmg
|
||||||
|
release-assets/*.zip
|
||||||
|
release-assets/*.AppImage
|
||||||
|
release-assets/*.exe
|
||||||
|
release-assets/*.blockmap
|
||||||
|
release-assets/latest*.yml
|
||||||
|
fail_on_unmatched_files: true
|
||||||
|
|
||||||
|
finalize:
|
||||||
|
name: Finalize release
|
||||||
|
needs: [preflight, release]
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version-file: package.json
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: package.json
|
||||||
|
|
||||||
|
- id: update_versions
|
||||||
|
name: Update version strings
|
||||||
|
env:
|
||||||
|
RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
|
||||||
|
run: node scripts/update-release-package-versions.ts "$RELEASE_VERSION" --github-output
|
||||||
|
|
||||||
|
- name: Format package.json files
|
||||||
|
if: steps.update_versions.outputs.changed == 'true'
|
||||||
|
run: bunx oxfmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
|
||||||
|
|
||||||
|
- name: Refresh lockfile
|
||||||
|
if: steps.update_versions.outputs.changed == 'true'
|
||||||
|
run: bun install --lockfile-only --ignore-scripts
|
||||||
|
|
||||||
|
- name: Commit and push version bump
|
||||||
|
if: steps.update_versions.outputs.changed == 'true'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
|
||||||
|
run: |
|
||||||
|
if git diff --quiet -- apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json bun.lock; then
|
||||||
|
echo "No version changes to commit."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json bun.lock
|
||||||
|
git commit -m "chore(release): prepare $RELEASE_TAG"
|
||||||
|
git push origin HEAD:main
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
node_modules
|
||||||
|
.bun
|
||||||
|
.turbo
|
||||||
|
.DS_Store
|
||||||
|
*.log
|
||||||
|
*.tsbuildinfo
|
||||||
|
apps/*/dist
|
||||||
|
.astro
|
||||||
|
packages/*/dist
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
build/
|
||||||
|
.logs/
|
||||||
|
release/
|
||||||
|
.t3
|
||||||
|
apps/web/.playwright
|
||||||
|
apps/web/playwright-report
|
||||||
|
apps/web/src/components/__screenshots__
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[tools]
|
||||||
|
node = "24.13.1"
|
||||||
|
bun = "1.3.9"
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||||
|
"ignorePatterns": [
|
||||||
|
".plans",
|
||||||
|
"dist",
|
||||||
|
"dist-electron",
|
||||||
|
"node_modules",
|
||||||
|
"bun.lock",
|
||||||
|
"*.tsbuildinfo",
|
||||||
|
"**/routeTree.gen.ts",
|
||||||
|
"apps/web/public/mockServiceWorker.js"
|
||||||
|
],
|
||||||
|
"sortPackageJson": {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"ignorePatterns": [
|
||||||
|
"dist",
|
||||||
|
"dist-electron",
|
||||||
|
"node_modules",
|
||||||
|
"bun.lock",
|
||||||
|
"*.tsbuildinfo",
|
||||||
|
"**/routeTree.gen.ts"
|
||||||
|
],
|
||||||
|
"plugins": ["eslint", "oxc", "react", "unicorn", "typescript"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "warn",
|
||||||
|
"suspicious": "warn",
|
||||||
|
"perf": "warn"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"react-in-jsx-scope": "off",
|
||||||
|
"eslint/no-shadow": "off",
|
||||||
|
"eslint/no-await-in-loop": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
# Plan: Centralize Model Normalization in Contracts
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Move model alias/default normalization into `packages/contracts` so desktop and renderer use one shared source of truth.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- Removes duplicated logic between:
|
||||||
|
- `apps/desktop/src/codexAppServerManager.ts`
|
||||||
|
- `apps/renderer/src/model-logic.ts`
|
||||||
|
- Prevents behavior drift when model aliases/defaults are updated.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Add shared model utilities to contracts.
|
||||||
|
- Update desktop and renderer to consume shared utilities.
|
||||||
|
- Keep renderer-specific display options in renderer.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Add `packages/contracts/src/model.ts` with:
|
||||||
|
- Canonical model list
|
||||||
|
- Alias map
|
||||||
|
- `normalizeModelSlug`
|
||||||
|
- `resolveModelSlug`
|
||||||
|
- `DEFAULT_MODEL`
|
||||||
|
2. Export model utilities from `packages/contracts/src/index.ts`.
|
||||||
|
3. Update `apps/desktop/src/codexAppServerManager.ts` to replace local alias map/helper.
|
||||||
|
4. Update `apps/renderer/src/model-logic.ts` to wrap or re-export shared functions.
|
||||||
|
5. Update tests:
|
||||||
|
- Move/duplicate normalization tests to contracts.
|
||||||
|
- Keep renderer tests focused on renderer-only behavior.
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Desktop/renderer may currently rely on slightly different fallback behavior.
|
||||||
|
- Import graph must avoid bundling issues for Electron main/preload.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- `bun run test`
|
||||||
|
- `bun run typecheck`
|
||||||
|
- Manual check that model selection and session start still send expected model slug.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- No duplicated alias/default map in desktop and renderer.
|
||||||
|
- Shared model utilities are contract-tested.
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# Plan: Strengthen Typed IPC Boundaries in Main Process
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Replace loose payload casting in IPC handlers with strict schema parsing and typed helper wrappers.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- `apps/desktop/src/main.ts` currently uses casts like `payload as Parameters<...>`.
|
||||||
|
- Casts can hide contract breakages until runtime.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Desktop main process IPC registration.
|
||||||
|
- Optional shared helper for handler registration.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Add IPC helper utility (e.g. `apps/desktop/src/ipcHelpers.ts`) to:
|
||||||
|
- Parse payload(s) with Zod schemas
|
||||||
|
- Standardize typed handler signatures
|
||||||
|
2. Refactor provider IPC handlers in `apps/desktop/src/main.ts` to use:
|
||||||
|
- `providerSessionStartInputSchema.parse`
|
||||||
|
- `providerSendTurnInputSchema.parse`
|
||||||
|
- `providerInterruptTurnInputSchema.parse`
|
||||||
|
- `providerStopSessionInputSchema.parse`
|
||||||
|
3. Apply same pattern to agent/terminal handlers where possible.
|
||||||
|
4. Add tests for handler parsing failure paths (invalid payloads).
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Refactor can subtly change IPC error shape/messages.
|
||||||
|
- Helper abstraction should stay simple and not obscure control flow.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- `bun run test`
|
||||||
|
- `bun run typecheck`
|
||||||
|
- Manual invalid payload check from renderer/devtools to confirm fast failure.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- No provider handler uses `payload as Parameters<...>`.
|
||||||
|
- All IPC entrypoints parse unknown payloads at boundary.
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# Plan: Decompose CodexAppServerManager
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Split `CodexAppServerManager` into smaller modules with clear responsibilities.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- `apps/desktop/src/codexAppServerManager.ts` is large and mixes:
|
||||||
|
- Process lifecycle
|
||||||
|
- JSON-RPC parsing/routing
|
||||||
|
- Session state transitions
|
||||||
|
- Event emission
|
||||||
|
- This increases regression risk and slows changes.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Desktop provider internals only.
|
||||||
|
- Keep external behavior/API stable.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Extract modules:
|
||||||
|
- `codex/processLifecycle.ts`
|
||||||
|
- `codex/jsonrpcRouter.ts`
|
||||||
|
- `codex/sessionState.ts`
|
||||||
|
- `codex/parsing.ts`
|
||||||
|
2. Keep `CodexAppServerManager` as thin orchestrator/facade.
|
||||||
|
3. Move pure helpers (`classifyCodexStderrLine`, route parsing) into unit-testable files.
|
||||||
|
4. Add targeted unit tests for:
|
||||||
|
- Message classification
|
||||||
|
- Request/notification/response routing
|
||||||
|
- Session state transitions
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Reordering event handling can change behavior.
|
||||||
|
- Must preserve pending request timeout/cancellation semantics.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- Existing tests pass.
|
||||||
|
- Add module-level tests for parsing and transition logic.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- Main manager file materially smaller and orchestration-focused.
|
||||||
|
- Core protocol/state logic covered by focused tests.
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# Plan: Split ChatView into Smaller UI/Logic Units
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Refactor `ChatView.tsx` into composable pieces with isolated responsibilities.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- `apps/renderer/src/components/ChatView.tsx` is large and handles:
|
||||||
|
- Session orchestration
|
||||||
|
- Send/interrupt actions
|
||||||
|
- Timeline rendering
|
||||||
|
- Header/status UI
|
||||||
|
- Composer UI
|
||||||
|
- Hard to test and maintain as one component.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Renderer component boundaries and hooks.
|
||||||
|
- Keep visual behavior unchanged.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Create hook: `apps/renderer/src/hooks/useChatSession.ts`
|
||||||
|
- `ensureSession`
|
||||||
|
- `sendTurn`
|
||||||
|
- `interruptTurn`
|
||||||
|
2. Split presentational components:
|
||||||
|
- `components/chat/ThreadHeader.tsx`
|
||||||
|
- `components/chat/MessageTimeline.tsx`
|
||||||
|
- `components/chat/ComposerBar.tsx`
|
||||||
|
3. Keep `ChatView.tsx` as container wiring store + hook + child components.
|
||||||
|
4. Add focused tests for hook behavior (error handling, session reuse).
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Refactor can break subtle UI interactions (auto-scroll, menu close, keyboard send).
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- `bun run test`
|
||||||
|
- Manual smoke: send, stream, interrupt, model switch.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- `ChatView.tsx` significantly reduced and easier to scan.
|
||||||
|
- Session logic isolated from rendering.
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Plan: Move Renderer Persisted-State Validation to Zod
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Use explicit Zod schemas for localStorage state parsing and migration.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- `apps/renderer/src/store.ts` has large manual sanitize functions.
|
||||||
|
- Manual type guards are verbose and easier to get wrong during schema evolution.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Renderer state hydration/persistence path.
|
||||||
|
- No backend/protocol changes.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Add schema module: `apps/renderer/src/persistenceSchema.ts`
|
||||||
|
- Persisted payload versions (`v1`, `v2`)
|
||||||
|
- Thread/message/project schemas
|
||||||
|
2. Replace `sanitizeProjects/sanitizeThreads/sanitizeMessages` with schema parsing + transforms.
|
||||||
|
3. Keep migration logic explicit (legacy model migration and key migration).
|
||||||
|
4. Add tests for:
|
||||||
|
- Invalid payload fallback to initial state
|
||||||
|
- Legacy payload migration
|
||||||
|
- Unknown thread/project references filtered
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Overly strict schemas could drop valid historical data unexpectedly.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- Unit tests for migration/hydration.
|
||||||
|
- Manual reload test with existing localStorage data.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- Store hydration logic is schema-driven.
|
||||||
|
- Migration behavior is tested and documented.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Plan: Add Provider Log Stream Lifecycle Management
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Ensure `ProviderManager` logging stream is initialized, rotated/structured, and closed safely.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- `apps/desktop/src/providerManager.ts` opens a write stream in constructor.
|
||||||
|
- Stream lifecycle is not explicit on shutdown.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Desktop provider logging behavior.
|
||||||
|
- App shutdown integration.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Add explicit `dispose()` on `ProviderManager`:
|
||||||
|
- Remove event listeners
|
||||||
|
- End/close log stream
|
||||||
|
2. Call `providerManager.dispose()` from app shutdown path in `apps/desktop/src/main.ts`.
|
||||||
|
3. Optional: change log format to JSON lines with stable fields.
|
||||||
|
4. Optional: per-session log files under `.logs/providers/`.
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Improper close sequencing may lose final log lines.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- Manual run/quit cycle to ensure no open handle warnings.
|
||||||
|
- Confirm logs flush on quit and file descriptors are not leaked.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- ProviderManager owns complete log stream lifecycle.
|
||||||
|
- Shutdown path explicitly disposes provider resources.
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Plan: Add CI Workflow for Core Quality Gates
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Add GitHub Actions workflow to run lint/typecheck/test (and optionally smoke-test) on pushes and PRs.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- Repository currently has no CI workflow files.
|
||||||
|
- Quality checks are only local/manual.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- `.github/workflows/ci.yml`
|
||||||
|
- Bun + Turbo setup in CI.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Add `ci.yml` with jobs:
|
||||||
|
- Setup Bun and Node environment
|
||||||
|
- Install deps
|
||||||
|
- `bun run lint`
|
||||||
|
- `bun run typecheck`
|
||||||
|
- `bun run test`
|
||||||
|
2. Add separate optional job for `bun run smoke-test` (desktop/Electron).
|
||||||
|
3. Configure caching for Bun/Turbo as appropriate.
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Smoke test may be flaky in headless CI environments.
|
||||||
|
- CI runtime can grow if caching is misconfigured.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- Verify workflow runs on a branch PR.
|
||||||
|
- Ensure failures surface clearly by job name.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- CI blocks regressions in lint/typecheck/test.
|
||||||
|
- Workflow docs added to README.
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# Plan: Add Pre-Commit Formatting/Lint Hooks
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Introduce pre-commit automation so formatting and basic lint checks happen before commits.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- Current lint failures include formatting-only issues.
|
||||||
|
- Shift-left feedback reduces noisy CI failures and cleanup churn.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Root tooling config and package scripts.
|
||||||
|
- No runtime code changes.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Add hook tooling (e.g. Husky + lint-staged or Lefthook).
|
||||||
|
2. Configure staged-file tasks:
|
||||||
|
- `biome format --write`
|
||||||
|
- `biome check`
|
||||||
|
3. Add setup docs in README.
|
||||||
|
4. Keep checks fast to avoid developer friction.
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Slow hooks can frustrate contributors and be bypassed.
|
||||||
|
- Need to ensure compatibility with Bun workspace setup.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- Create sample staged changes and verify hook behavior.
|
||||||
|
- Confirm formatting fixes are applied automatically.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- Pre-commit hook installed and documented.
|
||||||
|
- Formatting-only lint failures drop significantly.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# Plan: Expand Event/State Transition Test Coverage
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Add focused tests for renderer event handling and session evolution logic.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- Core behavior is event-driven and stateful.
|
||||||
|
- Existing renderer tests cover only a subset of timeline/model behavior.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- `apps/renderer/src/session-logic.test.ts`
|
||||||
|
- Optional reducer tests for `apps/renderer/src/store.ts`.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Add tests for `evolveSession`:
|
||||||
|
- `thread/started`
|
||||||
|
- `turn/started`
|
||||||
|
- `turn/completed` success/failure
|
||||||
|
- error/session closed events
|
||||||
|
2. Add tests for `applyEventToMessages`:
|
||||||
|
- start/delta/completed flow
|
||||||
|
- out-of-order event cases
|
||||||
|
- turn completion clearing streaming flags
|
||||||
|
3. Add reducer integration tests for `APPLY_EVENT`.
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- Tests may be brittle if event payload fixtures are too coupled to implementation details.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- `bun run test`
|
||||||
|
- Ensure new tests remain deterministic and fast.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- High-risk event transitions are covered by unit tests.
|
||||||
|
- Regressions in stream assembly/session status are caught quickly.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# Plan: Unify Process and PTY Session Abstractions in ProcessManager
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Refactor `ProcessManager` to use a single runtime-session interface for child-process and PTY modes.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
- `apps/desktop/src/processManager.ts` maintains parallel maps and branch-heavy logic.
|
||||||
|
- New execution backends/providers will multiply complexity.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Desktop process execution internals.
|
||||||
|
- Preserve public `ProcessManager` API.
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
|
||||||
|
1. Introduce internal interface (e.g. `RuntimeSession`):
|
||||||
|
- `write(data)`
|
||||||
|
- `kill()`
|
||||||
|
- lifecycle/output event hooks
|
||||||
|
2. Implement:
|
||||||
|
- `ChildProcessSession`
|
||||||
|
- `PtySession`
|
||||||
|
3. Replace dual maps with one `Map<string, RuntimeSession>`.
|
||||||
|
4. Keep output/exit event contract unchanged.
|
||||||
|
5. Add tests for both implementations.
|
||||||
|
|
||||||
|
## Risks
|
||||||
|
|
||||||
|
- PTY behavior differs by platform; abstraction must not hide required differences.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- Existing `processManager.test.ts` passes.
|
||||||
|
- Add PTY-path tests where feasible.
|
||||||
|
|
||||||
|
## Done Criteria
|
||||||
|
|
||||||
|
- Manager no longer branches per backend in `write/kill/killAll`.
|
||||||
|
- Session backends are independently testable.
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
PR 1: Service contracts + error taxonomy
|
||||||
|
Add ProviderService, CodexService, CheckpointStore as Context.Tag service defs.
|
||||||
|
Add typed Schema.TaggedError hierarchies for all 3 services (cause: Schema.optional(Schema.Defect) on each).
|
||||||
|
No behavior change yet, just interfaces and compile-time wiring points.
|
||||||
|
PR 2: CheckpointStore Effect adapter
|
||||||
|
Wrap current filesystemCheckpointStore behind CheckpointStoreLive (adapter).
|
||||||
|
Map all thrown/Promise errors to tagged errors.
|
||||||
|
Add service tests proving parity for isGitRepository, capture, restore, diff, prune.
|
||||||
|
PR 3: CodexService Effect adapter
|
||||||
|
Wrap current CodexAppServerManager behind CodexServiceLive (adapter).
|
||||||
|
Convert public API to Effect return types with typed errors.
|
||||||
|
Preserve existing EventEmitter internally for now, but expose Effect-friendly subscribe API.
|
||||||
|
PR 4: ProviderService Effect adapter
|
||||||
|
Wrap current ProviderManager behind ProviderServiceLive (adapter).
|
||||||
|
Provider methods become Effect methods with typed errors.
|
||||||
|
Route emitted provider events through an Effect PubSub surface.
|
||||||
|
PR 5: wsServer migration to Effect services
|
||||||
|
Stop instantiating provider/codex classes directly in wsServer.
|
||||||
|
Resolve ProviderService (and related services) from one runtime/layer graph.
|
||||||
|
Keep WS contract behavior identical.
|
||||||
|
PR 6: Native CheckpointStore implementation
|
||||||
|
Refactor checkpoint internals from Promise/throws to native Effect.
|
||||||
|
Replace ad-hoc locking with Effect concurrency primitive (keyed lock/semaphore/queue).
|
||||||
|
Keep adapter tests plus new failure-path tests.
|
||||||
|
PR 7: Codex transport/RPC core as native Effect
|
||||||
|
Split codex into scoped process layer + RPC request/response layer + session registry.
|
||||||
|
Replace timeout/pending maps with Deferred + Effect timeout/finalizer semantics.
|
||||||
|
Keep protocol behavior and ordering guarantees.
|
||||||
|
PR 8: Codex protocol decoding hardening
|
||||||
|
Replace ad-hoc unknown parsing with runtime schema decoding for inbound/outbound protocol shapes.
|
||||||
|
Map decode failures to typed tagged errors (with root cause).
|
||||||
|
Add regression tests for malformed/partial protocol messages.
|
||||||
|
PR 9: Native ProviderService orchestration
|
||||||
|
Rebuild provider logic in Effect using CodexService + CheckpointStore dependencies.
|
||||||
|
Move event fanout, checkpoint capture/revert orchestration, thread-log routing to Effect state/services.
|
||||||
|
Remove throw-based flow entirely from provider path.
|
||||||
|
PR 10: Cleanup + deprecation removal
|
||||||
|
Remove legacy class implementations/adapters once parity is proven.
|
||||||
|
Finalize layer composition and startup graph docs.
|
||||||
|
Add architecture notes for service boundaries and error model.
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# Effect Migration Plan (From Current State)
|
||||||
|
|
||||||
|
Current status summary:
|
||||||
|
|
||||||
|
- Service contracts, typed errors, and most checkpoint/persistence services exist.
|
||||||
|
- `ProviderServiceLive` is already native orchestration (not a thin adapter).
|
||||||
|
- Production server path still uses legacy `ProviderManager`/`FilesystemCheckpointStore`.
|
||||||
|
- Checkpoint flow now avoids snapshot re-sync and is write-time driven.
|
||||||
|
|
||||||
|
## PR 1: Wire Provider/Checkpoint Effect Stack Into `wsServer`
|
||||||
|
|
||||||
|
- Build one runtime layer graph for provider + checkpoint + persistence + orchestration.
|
||||||
|
- Resolve `ProviderService` from runtime in `wsServer`.
|
||||||
|
- Replace `ProviderManager` method calls in WS handlers with `ProviderService` calls.
|
||||||
|
- Forward provider events by subscribing to `ProviderService.subscribeToEvents`.
|
||||||
|
- Keep WS method/push payloads identical.
|
||||||
|
|
||||||
|
## PR 2: Runtime Composition + Startup Ownership
|
||||||
|
|
||||||
|
- Create/centralize `AppLive` composition for server startup.
|
||||||
|
- Ensure outer runtime provides Node/platform services once.
|
||||||
|
- Ensure migrations run at startup via scoped/layer startup path.
|
||||||
|
- Remove ad-hoc service initialization in request-time paths.
|
||||||
|
|
||||||
|
## PR 3: Session Lifecycle Hygiene + Checkpoint Invariants
|
||||||
|
|
||||||
|
- Add explicit checkpoint session cleanup on `stopSession` / `stopAll`.
|
||||||
|
- Remove per-session lock/cwd map leaks.
|
||||||
|
- Keep strict invariant model:
|
||||||
|
- root checkpoint created at session initialization before agent modifications
|
||||||
|
- each completed turn captures filesystem checkpoint and persists metadata
|
||||||
|
- no after-the-fact metadata rebuild/sync
|
||||||
|
- Add tests for lifecycle cleanup and invariant-failure surfaces.
|
||||||
|
|
||||||
|
## PR 4: Provider Event Stream Hardening (Without Extra Service Fragmentation)
|
||||||
|
|
||||||
|
- Keep `ProviderService` as the public event surface.
|
||||||
|
- Internally move callback fanout to Effect concurrency primitives (`Queue`/`PubSub`) for ordering/backpressure control.
|
||||||
|
- Keep API as `subscribeToEvents` unless we explicitly choose stream API later.
|
||||||
|
- Add tests for ordering and subscriber isolation under load.
|
||||||
|
|
||||||
|
## PR 5: Codex Runtime Split (Scoped Effect Core)
|
||||||
|
|
||||||
|
- Extract `CodexAppServerManager` responsibilities into Effect-native layers:
|
||||||
|
- scoped process lifecycle
|
||||||
|
- RPC request/response + pending map via `Deferred`
|
||||||
|
- session registry/state
|
||||||
|
- Keep `CodexAdapter` contract stable while swapping internals.
|
||||||
|
- Preserve protocol behavior and timeout semantics.
|
||||||
|
|
||||||
|
## PR 6: Codex Protocol Decode Hardening
|
||||||
|
|
||||||
|
- Replace ad-hoc unknown parsing with runtime schema decode.
|
||||||
|
- Map decode failures to typed tagged errors with `cause` retained.
|
||||||
|
- Add regression tests for malformed/partial protocol frames.
|
||||||
|
|
||||||
|
## PR 7: Remove Legacy Provider Stack
|
||||||
|
|
||||||
|
- Remove `ProviderManager` + legacy checkpoint integration from runtime path.
|
||||||
|
- Remove `FilesystemCheckpointStore` from active server flow (keep only if explicitly needed for compatibility tooling).
|
||||||
|
- Update tests to assert only Effect service path is used.
|
||||||
|
|
||||||
|
## PR 8: Final Cleanup + Docs
|
||||||
|
|
||||||
|
- Update architecture docs with final layer graph and service boundaries.
|
||||||
|
- Document error model and recovery semantics.
|
||||||
|
- Trim dead compatibility code and stale plan references.
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
# ProviderService Integration Test Plan
|
||||||
|
|
||||||
|
Goal:
|
||||||
|
|
||||||
|
- Validate end-to-end `ProviderService` behavior with real layers:
|
||||||
|
- `ProviderServiceLive`
|
||||||
|
- `CheckpointServiceLive`
|
||||||
|
- `CheckpointStoreLive`
|
||||||
|
- `CheckpointRepositoryLive` (sqlite in-memory)
|
||||||
|
- `ProviderSessionDirectoryLive`
|
||||||
|
- Only fake the adapter event source (deterministic Codex-like stream).
|
||||||
|
- Avoid mocking checkpointing/persistence orchestration logic.
|
||||||
|
|
||||||
|
## Test Harness
|
||||||
|
|
||||||
|
Build a deterministic `TestProviderAdapterLive` in `apps/server/src/provider/Layers/TestProviderAdapter.integration.ts`:
|
||||||
|
|
||||||
|
- Service contract: `ProviderAdapterShape<ProviderAdapterError>`.
|
||||||
|
- Internal state:
|
||||||
|
- session registry (session + cwd + threadId)
|
||||||
|
- thread snapshot store (`threadId`, `turns`)
|
||||||
|
- event subscribers
|
||||||
|
- Behavior:
|
||||||
|
- `startSession`: creates session with threadId.
|
||||||
|
- `sendTurn`: appends a deterministic turn snapshot and emits ordered events:
|
||||||
|
- `turn/started`
|
||||||
|
- `item/started` / `item/completed` (tool + approval variants depending on scenario)
|
||||||
|
- `item/agentMessage/delta` chunks
|
||||||
|
- `turn/completed`
|
||||||
|
- optional "mutator" callback per turn to change workspace files before completion.
|
||||||
|
- `readThread`, `rollbackThread`, `stopSession`, `stopAll`.
|
||||||
|
|
||||||
|
Use real git-backed temporary workspaces in integration tests:
|
||||||
|
|
||||||
|
- initialize repo with baseline commit
|
||||||
|
- run provider turn in workspace
|
||||||
|
- assert checkpoint diffs against real git refs
|
||||||
|
|
||||||
|
## Core Integration Specs
|
||||||
|
|
||||||
|
1. `startSession` initializes checkpoint root exactly once
|
||||||
|
|
||||||
|
- Arrange:
|
||||||
|
- start provider session in git repo.
|
||||||
|
- Assert:
|
||||||
|
- `provider_checkpoints` contains root row (turn 0).
|
||||||
|
- checkpoint ref exists in git.
|
||||||
|
- second `startSession` for new session creates a new independent root.
|
||||||
|
|
||||||
|
2. Turn without filesystem change
|
||||||
|
|
||||||
|
- Arrange:
|
||||||
|
- emit normal turn events, no file mutation.
|
||||||
|
- Assert:
|
||||||
|
- provider subscribers receive:
|
||||||
|
- `turn/started`
|
||||||
|
- `turn/completed`
|
||||||
|
- synthetic `checkpoint/captured`
|
||||||
|
- `listCheckpoints` returns root + turn 1.
|
||||||
|
- `getCheckpointDiff(0 -> 1)` returns empty/no-op diff.
|
||||||
|
|
||||||
|
3. Turn with filesystem change
|
||||||
|
|
||||||
|
- Arrange:
|
||||||
|
- mutate `README.md` during turn.
|
||||||
|
- Assert:
|
||||||
|
- `listCheckpoints` returns root + turn 1.
|
||||||
|
- `getCheckpointDiff(0 -> 1)` contains file path and hunk.
|
||||||
|
- persisted checkpoint metadata includes non-empty `checkpointRef`.
|
||||||
|
|
||||||
|
4. Multi-turn sequencing and checkpoint monotonicity
|
||||||
|
|
||||||
|
- Arrange:
|
||||||
|
- turn 1: no file change
|
||||||
|
- turn 2: file change
|
||||||
|
- turn 3: file change
|
||||||
|
- Assert:
|
||||||
|
- turn counts are monotonic and contiguous in DB (0,1,2,3).
|
||||||
|
- latest checkpoint is marked current.
|
||||||
|
- diffs for adjacent turns map to expected filesystem deltas.
|
||||||
|
|
||||||
|
5. Revert to checkpoint
|
||||||
|
|
||||||
|
- Arrange:
|
||||||
|
- execute 3 turns with at least one file-changing turn.
|
||||||
|
- call `revertToCheckpoint(turnCount=1)`.
|
||||||
|
- Assert:
|
||||||
|
- workspace content matches turn 1 state.
|
||||||
|
- adapter `rollbackThread` called with `numTurns=2`.
|
||||||
|
- DB rows for turns >1 are removed.
|
||||||
|
- later refs are deleted from git.
|
||||||
|
|
||||||
|
6. Capture failure surface
|
||||||
|
|
||||||
|
- Arrange:
|
||||||
|
- adapter emits `turn/completed`, but file mutation leaves invalid repo state or store capture fails.
|
||||||
|
- Assert:
|
||||||
|
- `ProviderService` emits `checkpoint/captureError`.
|
||||||
|
- no partial metadata/ref divergence is left behind.
|
||||||
|
|
||||||
|
## WebSocket Coverage (Thin Integration)
|
||||||
|
|
||||||
|
Add one ws server integration spec:
|
||||||
|
|
||||||
|
- Subscribe to `providers.event`.
|
||||||
|
- Run a deterministic provider turn through ws methods.
|
||||||
|
- Assert push stream includes:
|
||||||
|
- `turn/started`, tool events, `turn/completed`, `checkpoint/captured`.
|
||||||
|
- Assert orchestration projection still updates assistant message and turn diff summary.
|
||||||
|
|
||||||
|
## Proposed PR Split
|
||||||
|
|
||||||
|
PR A:
|
||||||
|
|
||||||
|
- Test adapter harness + shared integration fixtures (repo setup, runtime/layer setup).
|
||||||
|
|
||||||
|
PR B:
|
||||||
|
|
||||||
|
- Core ProviderService integration specs (cases 1-4).
|
||||||
|
|
||||||
|
PR C:
|
||||||
|
|
||||||
|
- Revert + failure-path specs (cases 5-6) + ws thin integration spec.
|
||||||
@@ -0,0 +1,227 @@
|
|||||||
|
# Server-Authoritative Event-Sourcing Cleanup Plan
|
||||||
|
|
||||||
|
Goal:
|
||||||
|
|
||||||
|
- Move to a cleaner service architecture with:
|
||||||
|
- durable, server-authoritative event sourcing
|
||||||
|
- strict command routing/validation
|
||||||
|
- pluggable provider adapters
|
||||||
|
- explicit separation between transport, domain orchestration, provider runtime, and persistence
|
||||||
|
|
||||||
|
## Target Service Graph (ASCII)
|
||||||
|
|
||||||
|
```text
|
||||||
|
+---------------------------+
|
||||||
|
| wsServer |
|
||||||
|
| transport |
|
||||||
|
+---------------------------+
|
||||||
|
| orchestration.dispatchCommand
|
||||||
|
v
|
||||||
|
+-------------------------------------------+
|
||||||
|
| OrchestrationCommandRouter |
|
||||||
|
+-------------------------------------------+
|
||||||
|
|
|
||||||
|
v
|
||||||
|
+-------------------------------------------+
|
||||||
|
| OrchestrationCommandHandlers |
|
||||||
|
+-------------------------------------------+
|
||||||
|
|
|
||||||
|
v
|
||||||
|
+-------------------------------------------+
|
||||||
|
| OrchestrationEventStore |
|
||||||
|
+-------------------------------------------+
|
||||||
|
|
|
||||||
|
v
|
||||||
|
+-------------------------------------------+
|
||||||
|
| OrchestrationProjectionService |
|
||||||
|
+-------------------------------------------+
|
||||||
|
| snapshot/replay
|
||||||
|
+---------------------------> wsServer
|
||||||
|
|
||||||
|
|
||||||
|
wsServer -- providers.* RPC --> +---------------------------+
|
||||||
|
| ProviderService |
|
||||||
|
+---------------------------+
|
||||||
|
| |
|
||||||
|
v v
|
||||||
|
+-------------------+ +-------------------------+
|
||||||
|
| ProviderSession | | ProviderAdapterRegistry |
|
||||||
|
| Registry (durable)| +-------------------------+
|
||||||
|
+-------------------+ |
|
||||||
|
^ v
|
||||||
|
| +-------------------------+
|
||||||
|
| | ProviderAdapter(s) |
|
||||||
|
| +-------------------------+
|
||||||
|
| |
|
||||||
|
| runtime events v
|
||||||
|
| +---------------------------+
|
||||||
|
+----------| ProviderRuntimeIngestion |
|
||||||
|
+---------------------------+
|
||||||
|
| | |
|
||||||
|
v v v
|
||||||
|
Router Session Checkpoint
|
||||||
|
Registry Service
|
||||||
|
|
||||||
|
+-------------------------------------------+
|
||||||
|
| CheckpointService |
|
||||||
|
+-------------------------------------------+
|
||||||
|
| | |
|
||||||
|
v v v
|
||||||
|
+--------------------+ +-------------+ +-------------------+
|
||||||
|
| CheckpointCatalog | | Checkpoint | | ProviderAdapter(s)|
|
||||||
|
| (durable) | | Store (git) | | (read/rollback) |
|
||||||
|
+--------------------+ +-------------+ +-------------------+
|
||||||
|
|
|
||||||
|
v
|
||||||
|
+------+
|
||||||
|
|SQLite|
|
||||||
|
+------+
|
||||||
|
|
||||||
|
OrchestrationEventStore ------> SQLite
|
||||||
|
OrchestrationProjectionService -> SQLite
|
||||||
|
ProviderSessionRegistry ------> SQLite
|
||||||
|
CheckpointCatalog ------> SQLite
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commit Series
|
||||||
|
|
||||||
|
### Commit 1: Split public vs system orchestration command contracts
|
||||||
|
|
||||||
|
- Create separate schemas/types:
|
||||||
|
- `ClientOrchestrationCommandSchema`
|
||||||
|
- `SystemOrchestrationCommandSchema`
|
||||||
|
- `OrchestrationCommandSchema = union(client, system)`
|
||||||
|
- Ensure client transport can only submit client commands.
|
||||||
|
- Keep system commands for server-internal workflows only.
|
||||||
|
- Expected files:
|
||||||
|
- `packages/contracts/src/orchestration.ts`
|
||||||
|
- `apps/server/src/wsServer.ts`
|
||||||
|
- orchestration/service tests
|
||||||
|
- Tests:
|
||||||
|
- reject system-only command via WS dispatch path
|
||||||
|
- preserve internal dispatch functionality for system commands
|
||||||
|
|
||||||
|
### Commit 2: Introduce `OrchestrationCommandRouter` + handler boundary
|
||||||
|
|
||||||
|
- Add dedicated router service to validate, authorize, and route commands.
|
||||||
|
- Move command-to-event mapping out of `orchestration/Layer.ts` into handlers.
|
||||||
|
- Add aggregate-level invariant checks before append (thread exists, project exists, etc.).
|
||||||
|
- Expected files:
|
||||||
|
- `apps/server/src/orchestration/Services/CommandRouter.ts` (new)
|
||||||
|
- `apps/server/src/orchestration/Layers/CommandRouter.ts` (new)
|
||||||
|
- `apps/server/src/orchestration/Layer.ts`
|
||||||
|
- `apps/server/src/orchestration/reducer.ts` (only if needed for event payload changes)
|
||||||
|
- Tests:
|
||||||
|
- router validation and invariant failures
|
||||||
|
- handler happy-path tests per command type
|
||||||
|
|
||||||
|
### Commit 3: Harden event store for idempotency + optimistic append metadata
|
||||||
|
|
||||||
|
- Add DB-level idempotency guard for `command_id` (`UNIQUE` where non-null).
|
||||||
|
- Extend append API to support idempotent replays and deterministic return of prior event on duplicate `commandId`.
|
||||||
|
- Add optional aggregate version metadata for future optimistic concurrency.
|
||||||
|
- Expected files:
|
||||||
|
- `apps/server/src/persistence/Migrations/00x_*.ts` (new migration)
|
||||||
|
- `apps/server/src/persistence/Services/OrchestrationEvents.ts`
|
||||||
|
- `apps/server/src/persistence/Layers/OrchestrationEvents.ts`
|
||||||
|
- Tests:
|
||||||
|
- duplicate command ID append returns same event/sequence (or explicit idempotent behavior)
|
||||||
|
- concurrent append behavior stays ordered and deterministic
|
||||||
|
|
||||||
|
### Commit 4: Extract provider-runtime -> orchestration bridge from `wsServer`
|
||||||
|
|
||||||
|
- Create `ProviderRuntimeIngestionService` that:
|
||||||
|
- subscribes to `ProviderService.streamEvents`
|
||||||
|
- translates runtime events into orchestration commands
|
||||||
|
- dispatches through router/engine
|
||||||
|
- Remove provider-to-orchestration state mutation logic from `wsServer`.
|
||||||
|
- Expected files:
|
||||||
|
- `apps/server/src/orchestration/Services/ProviderRuntimeIngestion.ts` (new)
|
||||||
|
- `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts` (new)
|
||||||
|
- `apps/server/src/wsServer.ts`
|
||||||
|
- Tests:
|
||||||
|
- ingestion service mapping tests (turn started/completed, message delta/completed, runtime error)
|
||||||
|
- ws integration confirms same external push behavior
|
||||||
|
|
||||||
|
### Commit 5: Make session directory durable (`ProviderSessionRegistry`)
|
||||||
|
|
||||||
|
- Replace in-memory-only `ProviderSessionDirectoryLive` with persistence-backed registry.
|
||||||
|
- Keep in-memory cache optional, but source of truth must be persistent.
|
||||||
|
- Add startup reconciliation to prune dead sessions / keep known thread mapping.
|
||||||
|
- Expected files:
|
||||||
|
- `apps/server/src/provider/Services/ProviderSessionDirectory.ts` (or new SessionRegistry service)
|
||||||
|
- `apps/server/src/provider/Layers/ProviderSessionDirectory.ts`
|
||||||
|
- `apps/server/src/persistence/Migrations/00x_*.ts` (new table/indexes)
|
||||||
|
- provider persistence tests
|
||||||
|
- Tests:
|
||||||
|
- survives server restart with correct mapping
|
||||||
|
- stale session cleanup semantics
|
||||||
|
|
||||||
|
### Commit 6: Re-key checkpoint metadata from session to thread identity
|
||||||
|
|
||||||
|
- Change checkpoint catalog primary identity from `provider_session_id` to durable `thread_id`.
|
||||||
|
- Keep `session_id` as nullable metadata only.
|
||||||
|
- Update checkpoint flows (`initialize`, `capture`, `list`, `diff`, `revert`) to use thread identity.
|
||||||
|
- Expected files:
|
||||||
|
- `apps/server/src/persistence/Migrations/00x_*.ts` (checkpoint schema migration)
|
||||||
|
- `apps/server/src/persistence/Services/Checkpoints.ts`
|
||||||
|
- `apps/server/src/persistence/Layers/Checkpoints.ts`
|
||||||
|
- `apps/server/src/checkpointing/Layers/CheckpointService.ts`
|
||||||
|
- Tests:
|
||||||
|
- resume/new session over same thread sees same checkpoint history
|
||||||
|
- revert/diff still work after session churn
|
||||||
|
|
||||||
|
### Commit 7: Add durable projection persistence for orchestration read models
|
||||||
|
|
||||||
|
- Introduce projection tables/snapshots persisted in DB to avoid full replay dependency.
|
||||||
|
- Keep event stream as source of truth; projection rebuild stays deterministic.
|
||||||
|
- `getSnapshot` reads from projection store (memory cache optional).
|
||||||
|
- Expected files:
|
||||||
|
- `apps/server/src/persistence/Migrations/00x_*.ts` (projection tables)
|
||||||
|
- `apps/server/src/orchestration/*` projection service/layer
|
||||||
|
- `apps/server/src/wsServer.ts` (snapshot/replay path wiring)
|
||||||
|
- Tests:
|
||||||
|
- cold boot snapshot load without replaying full history in process
|
||||||
|
- projection rebuild from events yields same result as previous reducer semantics
|
||||||
|
|
||||||
|
### Commit 8: Narrow `ProviderService` responsibilities
|
||||||
|
|
||||||
|
- Keep `ProviderService` focused on provider RPC/session lifecycle + unified runtime stream.
|
||||||
|
- Move checkpoint-capture side effects out of provider event worker into dedicated ingestion/checkpoint pipeline service.
|
||||||
|
- Preserve adapter pluggability and provider-neutral contracts.
|
||||||
|
- Expected files:
|
||||||
|
- `apps/server/src/provider/Layers/ProviderService.ts`
|
||||||
|
- new orchestration/checkpoint runtime coordinator service(s)
|
||||||
|
- Tests:
|
||||||
|
- provider service routing stays intact
|
||||||
|
- checkpoint capture still triggered by turn completion through new coordinator
|
||||||
|
|
||||||
|
### Commit 9: Look over schemas (contracts and events)
|
||||||
|
|
||||||
|
- Scan for unused schemas.
|
||||||
|
- Use effect/Schema everywhere
|
||||||
|
- Analyze which we need
|
||||||
|
- RPC Input/Output (both for routeRequest and command handler)
|
||||||
|
- Event payloads
|
||||||
|
- Persistence entities
|
||||||
|
|
||||||
|
### Commit 10: Remove dead legacy path and finalize docs
|
||||||
|
|
||||||
|
- Remove unused legacy manager/store path from active architecture:
|
||||||
|
- `providerManager.ts`
|
||||||
|
- `filesystemCheckpointStore.ts` (if no longer needed by tests/tools)
|
||||||
|
- Look over effect services for unused methods, errors, etc
|
||||||
|
- Update architecture docs with final service boundaries and boot/runtime graph.
|
||||||
|
- Expected files:
|
||||||
|
- legacy files + references
|
||||||
|
- `AGENTS.md`/docs as needed
|
||||||
|
- `.plans` docs linkage
|
||||||
|
- Tests:
|
||||||
|
- full server integration suite passes on Effect-only path
|
||||||
|
- no regressions in WS protocol behavior
|
||||||
|
|
||||||
|
## Risk Controls
|
||||||
|
|
||||||
|
- Keep WS method names and payload contracts stable throughout.
|
||||||
|
- Gate each commit with targeted integration tests before moving forward.
|
||||||
|
- Avoid broad event-type churn in one step; migrate schemas incrementally with clear compatibility windows.
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Rewrite `createServer` and `index.ts` to be Effect native.
|
||||||
|
|
||||||
|
Maybe use `effect/unstable/Socket` for the web socket server
|
||||||
|
|
||||||
|
- https://github.com/Effect-TS/effect-smol/blob/main/packages/effect/src/unstable/socket/SocketServer.ts
|
||||||
|
- https://github.com/Effect-TS/effect-smol/blob/main/packages/platform-node/test/NodeSocket.test.ts
|
||||||
|
|
||||||
|
- Migrate remaining runtime code to Effect
|
||||||
|
- `gitManager` -> `src/git`
|
||||||
|
- `terminalManager` -> `src/terminal` (Manager + PTY)
|
||||||
|
- ...
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
# PR #89 Review Remediation Plan (Phased)
|
||||||
|
|
||||||
|
## How To Use These Files
|
||||||
|
|
||||||
|
- Working checklist with updateable status per item (single source of truth): `.plans/16c-pr89-remediation-checklist.md`
|
||||||
|
- This file (`16-pr89-review-remediation-phases.md`): phase strategy and grouping.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Source: GitHub review comments on PR #89 (`Add server-side orchestration engine with event sourcing`).
|
||||||
|
- Triage baseline used here:
|
||||||
|
- Total threads: 185
|
||||||
|
- Outdated: 94 (excluded)
|
||||||
|
- Active unresolved: 85
|
||||||
|
- Invalid/false-positive: 3 (excluded)
|
||||||
|
- Duplicate reposts: collapsed
|
||||||
|
- Unique actionable findings after filtering: 58
|
||||||
|
- Post-rewrite validity audit: 5 additional stale items marked invalid, leaving 53 actionable (`34 valid` + `19 partially-valid`)
|
||||||
|
|
||||||
|
## Phase 0: Canonical Triage Lock
|
||||||
|
|
||||||
|
- Create a single tracking checklist for the 53 currently actionable findings.
|
||||||
|
- Map every duplicate thread to its canonical item.
|
||||||
|
- Mark invalid/false-positive items with explicit rationale.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Every open thread is mapped to one canonical fix item or marked invalid.
|
||||||
|
|
||||||
|
## Phase 1: Runtime Survival and Critical Event Wiring
|
||||||
|
|
||||||
|
Related bug groups solved together:
|
||||||
|
|
||||||
|
- Worker loop/fiber fatal error handling in orchestration reactors.
|
||||||
|
- WebSocket message error boundaries and unhandled rejection guards.
|
||||||
|
- Close invalid `providers.event` review findings as documented architecture mismatch (no code change expected).
|
||||||
|
|
||||||
|
Primary files:
|
||||||
|
|
||||||
|
- `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts`
|
||||||
|
- `apps/server/src/orchestration/Layers/CheckpointReactor.ts`
|
||||||
|
- `apps/server/src/wsServer.ts`
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- A single event-processing failure cannot permanently stop ingestion/reactor loops.
|
||||||
|
- WS message handling cannot produce unhandled promise rejections.
|
||||||
|
- Invalid provider-event-channel review findings are closed with architecture rationale.
|
||||||
|
|
||||||
|
## Phase 2: State Consistency and Ordering
|
||||||
|
|
||||||
|
Related bug groups solved together:
|
||||||
|
|
||||||
|
- Fire-and-forget revert completion causing consistency windows.
|
||||||
|
- Non-atomic append/projection paths and retry behavior.
|
||||||
|
- Race-sensitive thread/event association issues.
|
||||||
|
|
||||||
|
Primary files:
|
||||||
|
|
||||||
|
- `apps/server/src/orchestration/Layers/CheckpointReactor.ts`
|
||||||
|
- `apps/server/src/orchestration/Layers/OrchestrationEngine.ts`
|
||||||
|
- `apps/server/src/orchestration/Layers/ProjectionPipeline.ts`
|
||||||
|
- `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts`
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Revert flow is deterministically reflected in read model updates.
|
||||||
|
- Append/project failure mode is explicit and safe under retry.
|
||||||
|
- No cross-thread misassociation under concurrent runtime events.
|
||||||
|
|
||||||
|
## Phase 3: Checkpointing Correctness Bundle
|
||||||
|
|
||||||
|
Related bug groups solved together:
|
||||||
|
|
||||||
|
- Checkpoint input normalization consistency.
|
||||||
|
- Snapshot/projector coverage mismatches.
|
||||||
|
- Checkpoint ref/workspace CWD utility duplication.
|
||||||
|
- Checkpoint diff/error handling behavior gaps.
|
||||||
|
|
||||||
|
Primary files:
|
||||||
|
|
||||||
|
- `apps/server/src/checkpointing/Layers/CheckpointStore.ts`
|
||||||
|
- `apps/server/src/checkpointing/Layers/CheckpointDiffQuery.ts`
|
||||||
|
- `apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts`
|
||||||
|
- `apps/server/src/orchestration/Layers/CheckpointReactor.ts`
|
||||||
|
- `apps/server/src/wsServer.ts`
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Checkpoint capture/restore/revert paths use one normalization policy.
|
||||||
|
- Required projectors are actually represented in snapshot reads.
|
||||||
|
- Shared checkpoint/ref/CWD helpers are centralized.
|
||||||
|
|
||||||
|
## Phase 4: Memory and Lifecycle Hygiene
|
||||||
|
|
||||||
|
Related bug groups solved together:
|
||||||
|
|
||||||
|
- Unbounded in-memory dedup sets/maps.
|
||||||
|
- Missing cleanup/lifecycle protections in long-lived effects/resources.
|
||||||
|
|
||||||
|
Primary files:
|
||||||
|
|
||||||
|
- `apps/server/src/orchestration/Layers/ProviderCommandReactor.ts`
|
||||||
|
- `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts`
|
||||||
|
- `apps/server/src/config.ts`
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Long-running server memory does not grow unbounded from dedup bookkeeping.
|
||||||
|
- Resource cleanup paths are registered for interruption/shutdown.
|
||||||
|
|
||||||
|
## Phase 5: Transport, Parsing, and Platform Edge Cases
|
||||||
|
|
||||||
|
Related bug groups solved together:
|
||||||
|
|
||||||
|
- UTF-8 chunk boundary decode correctness.
|
||||||
|
- Markdown/file-link parsing edge cases.
|
||||||
|
- Shell/OS-specific PATH parsing behavior.
|
||||||
|
- Git rename parsing and small keybinding edge cases.
|
||||||
|
|
||||||
|
Primary files:
|
||||||
|
|
||||||
|
- `apps/server/src/wsServer.ts`
|
||||||
|
- `apps/server/src/git/Layers/CodexTextGeneration.ts`
|
||||||
|
- `apps/web/src/markdown-links.ts`
|
||||||
|
- `apps/server/src/os-jank.ts`
|
||||||
|
- `apps/server/src/git/Layers/GitCore.ts`
|
||||||
|
- `apps/server/src/keybindings.ts`
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Edge-case parsers are robust across valid but non-trivial inputs.
|
||||||
|
- Platform-dependent command behavior has safe fallbacks.
|
||||||
|
|
||||||
|
## Phase 6: Build and Maintainability Cleanup
|
||||||
|
|
||||||
|
Related bug groups solved together:
|
||||||
|
|
||||||
|
- Build script/runtime assumption cleanup.
|
||||||
|
- Redundant error-union declarations and utility/type duplication.
|
||||||
|
- Non-functional cleanup comments/docs markers.
|
||||||
|
|
||||||
|
Primary files:
|
||||||
|
|
||||||
|
- `apps/server/package.json`
|
||||||
|
- `apps/server/src/checkpointing/Errors.ts`
|
||||||
|
- Shared utility locations introduced during earlier phases
|
||||||
|
- `AGENTS.md` (if cleanup is still pending)
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Build path is explicit and environment-safe.
|
||||||
|
- Redundant types/utilities are removed in favor of single sources of truth.
|
||||||
|
|
||||||
|
## Phase 7: Verification and Closeout
|
||||||
|
|
||||||
|
- Add backend tests for all behavioral fixes (integration-focused; external services may be layered/mocked, core business logic not mocked out).
|
||||||
|
- Run lint and backend tests for all touched packages.
|
||||||
|
- Resolve threads with fix references per canonical checklist item.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Lint passes.
|
||||||
|
- Backend tests pass.
|
||||||
|
- All actionable review threads are resolved or explicitly justified.
|
||||||
@@ -0,0 +1,478 @@
|
|||||||
|
# PR #89 Remediation Checklist (Consolidated)
|
||||||
|
|
||||||
|
_Last updated: 2026-02-26_
|
||||||
|
|
||||||
|
This is the working checklist for remediation execution.
|
||||||
|
|
||||||
|
Status values:
|
||||||
|
|
||||||
|
- `TODO`: Not started
|
||||||
|
- `IN_PROGRESS`: Currently being worked
|
||||||
|
- `BLOCKED`: Waiting on decision/dependency
|
||||||
|
- `DONE`: Implemented and verified
|
||||||
|
- `CLOSED_INVALID`: Stale/invalid review finding
|
||||||
|
|
||||||
|
Counts: active `51` (`valid=33`, `partially-valid=18`), closed-invalid `6`
|
||||||
|
|
||||||
|
## Active Checklist
|
||||||
|
|
||||||
|
### Phase 1
|
||||||
|
|
||||||
|
- [x] `C002` A dispatch error in `processEvent` will terminate the `Effect.forever` loop, permanently halting event ingestion. Consider adding error recovery (e.g., `Effect.catchAll` with logging) around `processEvent` so failures don't kill the fiber.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `High`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts:333`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wj4cH, PRRT_kwDORLtfbc5wnWwF, PRRT_kwDORLtfbc5wyTaP, PRRT_kwDORLtfbc5wzliw, PRRT_kwDORLtfbc5w0_g3, PRRT_kwDORLtfbc5w1HGT (+5 duplicate thread(s))
|
||||||
|
- Audit note: Ingestion worker loop can terminate on unhandled processEvent failure.
|
||||||
|
|
||||||
|
- [x] `C003` Consider attaching a no-op error listener before `socket.write` (e.g., `socket.on('error', () => {})`) to prevent an unhandled `EPIPE`/`ECONNRESET` from crashing the process if the client disconnects mid-handshake.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `High`
|
||||||
|
- Area: `WebSocket robustness`
|
||||||
|
- File: `apps/server/src/wsServer.ts:75`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5v-cf4
|
||||||
|
- Audit note: Upgrade reject writes then destroys socket without defensive error listener.
|
||||||
|
|
||||||
|
- [x] `C012` Forked revert dispatch risks read model inconsistency
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/CheckpointReactor.ts:542`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5whszW, PRRT_kwDORLtfbc5wyTaS, PRRT_kwDORLtfbc5wzli0, PRRT_kwDORLtfbc5w0_g4, PRRT_kwDORLtfbc5w1HGX (+4 duplicate thread(s))
|
||||||
|
- Audit note: Revert completion dispatch remains forked; state consistency window remains.
|
||||||
|
|
||||||
|
- [ ] `C019` ProviderRuntimeIngestion processes events for wrong thread on race
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts:178`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wkPaL
|
||||||
|
- Audit note: SessionId-only routing can misassociate events under races/rebinds.
|
||||||
|
|
||||||
|
- [x] `C020` On `message.completed`, the message ID is added to the set and `thread.message.assistant.complete` is dispatched. On `turn.completed`, the same set is iterated and `thread.message.assistant.complete` is dispatched again for each ID—including already-completed ones. Consider removing message IDs from the set after dispatching on `message.completed`, or filtering out already-completed IDs before the `turn.completed` loop.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts:266`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5w1GPr
|
||||||
|
- Audit note: Duplicate complete dispatch exists; downstream impact often idempotent.
|
||||||
|
|
||||||
|
- [x] `C026` Consider adding `.catch(() => {})` after `Effect.runPromise(handleMessage(ws, raw))` to prevent unhandled rejections from crashing the server if `encodeResponse` or setup logic fails.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `WebSocket robustness`
|
||||||
|
- File: `apps/server/src/wsServer.ts:545`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wj4cE
|
||||||
|
- Audit note: runPromise result still not caught; rejection can surface unhandled.
|
||||||
|
|
||||||
|
- [x] `C027` WS message handler can cause unhandled promise rejection
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/wsServer.ts:545`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wyTaW, PRRT_kwDORLtfbc5wzli3 (+1 duplicate thread(s))
|
||||||
|
- Audit note: Same unhandled rejection path remains in WS message handler.
|
||||||
|
|
||||||
|
- [x] `C042` Duplicated `resolveThreadWorkspaceCwd` across three files
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/CheckpointReactor.ts:62`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wzli2
|
||||||
|
- Audit note: Duplication exists but one instance is variant logic, so impact is moderate.
|
||||||
|
|
||||||
|
- [x] `C043` Duplicated workspace CWD resolution logic across reactor modules
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/CheckpointReactor.ts:62`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wnWwM, PRRT_kwDORLtfbc5w1C3-, PRRT_kwDORLtfbc5w1HGZ (+2 duplicate thread(s))
|
||||||
|
- Audit note: Workspace CWD resolution duplication still present across modules.
|
||||||
|
|
||||||
|
- [x] `C044` Checkpoint reactor swallows diff errors silently for `turn.completed`
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/CheckpointReactor.ts:274`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wkPaO
|
||||||
|
- Audit note: Errors are swallowed to empty diff with warning; not fully silent but still lossy.
|
||||||
|
|
||||||
|
- [x] `C045` `truncateDetail` slices to `limit - 1` then appends `"..."` (3 chars), producing strings of length `limit + 2`. Consider slicing to `limit - 3` instead. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts:29`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wzp4R
|
||||||
|
- Audit note: truncateDetail still overshoots limit.
|
||||||
|
|
||||||
|
- [x] `C046` `latestMessageIdByTurnKey` is written to but never read, and `clearAssistantMessageIdsForTurn` doesn't clear its entries—only `clearTurnStateForSession` does. Consider removing this map entirely if unused, or clearing it alongside `turnMessageIdsByTurnKey` in `clearAssistantMessageIdsForTurn`. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Runtime resilience and failure handling`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts:133`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wxvIQ
|
||||||
|
- Audit note: latestMessageIdByTurnKey still unused/unpruned in per-turn clear path.
|
||||||
|
|
||||||
|
- [x] `C053` Consider using `socket.end(response)` instead of `socket.write(response)` + `socket.destroy()` to ensure the HTTP error response is fully flushed before closing the connection.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `WebSocket robustness`
|
||||||
|
- File: `apps/server/src/wsServer.ts:83`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5v-WPD
|
||||||
|
- Audit note: Still uses write+destroy rather than end() for rejection response.
|
||||||
|
|
||||||
|
- [ ] `C054` When array chunks contain a multi-byte UTF-8 character split across boundaries, decoding each chunk separately produces replacement characters. Consider using `Buffer.concat()` on all chunks before calling `.toString("utf8")`. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `WebSocket robustness`
|
||||||
|
- File: `apps/server/src/wsServer.ts:104`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5whtrR
|
||||||
|
- Audit note: Array chunk UTF-8 decode remains vulnerable to split multibyte corruption.
|
||||||
|
|
||||||
|
- [x] `C059` Suggestion: don’t spread `params` into `body`; it can override `_tag` and mishandle non-object values. Keep `_tag` separate and nest `params` under a single key (e.g., `data`), or validate `params` is a plain object.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `WebSocket robustness`
|
||||||
|
- File: `apps/web/src/wsTransport.ts:59`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5whtrN
|
||||||
|
- Audit note: Transport \_tag override risk exists but current callsites are constrained.
|
||||||
|
|
||||||
|
### Phase 2
|
||||||
|
|
||||||
|
- [x] `C001` Non-atomic event appending can corrupt state on retry. If an error occurs mid-loop (lines 96-102) after some events are persisted but before the receipt is written, the command appears to fail. A retry generates new UUIDs via `crypto.randomUUID()` in the decider, appending duplicate events. Consider wrapping the loop in a transaction or using deterministic event IDs derived from `commandId`. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `High`
|
||||||
|
- Area: `Event ordering and state consistency`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/OrchestrationEngine.ts:96`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wzp4T
|
||||||
|
- Audit note: Append/project/receipt are non-atomic; retry can duplicate events.
|
||||||
|
|
||||||
|
- [x] `C013` If `projectionPipeline.projectEvent` fails after `eventStore.append` succeeds, the event is persisted but `readModel` isn't updated, causing desync. Consider updating the in-memory `readModel` immediately after append (before the external projection), so local state stays consistent regardless of downstream failures.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Event ordering and state consistency`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/OrchestrationEngine.ts:99`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5whtrM
|
||||||
|
- Audit note: Persisted event can outpace in-memory projection on mid-flight failure.
|
||||||
|
|
||||||
|
- [x] `C015` The gap-filling fallback logic can retain messages from turns that are about to be deleted, causing foreign key violations. Consider removing the fallback logic entirely, or filtering `fallbackUserMessages` and `fallbackAssistantMessages` to only include messages whose `turnId` is in `retainedTurnIds`. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Event ordering and state consistency`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProjectionPipeline.ts:99`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5whxJO
|
||||||
|
- Audit note: Message fallback retention issue is real, but prior FK-violation claim is overstated.
|
||||||
|
|
||||||
|
- [x] `C016` The in-memory `pendingTurnStartByThreadId` map isn't restored during bootstrap. If the service restarts after processing `thread.turn-start-requested` but before `thread.session-set`, the `userMessageId` and `startedAt` will be lost since bootstrap resumes _after_ the committed sequence. Consider persisting this pending state or processing these two events atomically. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Event ordering and state consistency`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProjectionPipeline.ts:490`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wxvH8
|
||||||
|
- Audit note: Pending turn-start map is in-memory only and not rebuilt on bootstrap.
|
||||||
|
|
||||||
|
### Phase 3
|
||||||
|
|
||||||
|
- [x] `C008` Inconsistent input normalization across CheckpointStore methods
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Checkpointing correctness`
|
||||||
|
- File: `apps/server/src/checkpointing/Layers/CheckpointStore.ts:94`
|
||||||
|
- Threads: PRRT*kwDORLtfbc5widJw, PRRT_kwDORLtfbc5wnWv*, PRRT_kwDORLtfbc5w0_g7, PRRT_kwDORLtfbc5w1C36 (+3 duplicate thread(s))
|
||||||
|
- Audit note: Edge schema strategy is in place across contracts/consumers (trim/normalize via schemas and decode at boundaries); CheckpointStore remains an internal repository boundary.
|
||||||
|
|
||||||
|
- [x] `C017` `REQUIRED_SNAPSHOT_PROJECTORS` includes `pending-approvals` and `thread-turns`, but `getSnapshot` doesn't query their data. If these projectors lag behind, the returned `snapshotSequence` will be lower than what the included data actually reflects, causing clients to replay already-applied events. Consider filtering `REQUIRED_SNAPSHOT_PROJECTORS` to only include projectors whose data is actually fetched in the snapshot. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Checkpointing correctness`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts:71`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wiLhQ
|
||||||
|
- Audit note: Snapshot sequence can under-report due to extra projectors, but replay impact is lower now.
|
||||||
|
|
||||||
|
- [x] `C033` Three error classes defined but never instantiated anywhere
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Checkpointing correctness`
|
||||||
|
- File: `apps/server/src/checkpointing/Errors.ts:51`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wlYgo
|
||||||
|
- Audit note: Original claim overstated; some errors used, others appear unused.
|
||||||
|
|
||||||
|
- [x] `C034` Redundant `CheckpointInvariantError` in `CheckpointServiceError` union type
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Checkpointing correctness`
|
||||||
|
- File: `apps/server/src/checkpointing/Errors.ts:79`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wj5fn
|
||||||
|
- Audit note: CheckpointInvariantError remains redundantly included in service union.
|
||||||
|
|
||||||
|
- [x] `C035` Redundant error type in CheckpointServiceError union definition
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Checkpointing correctness`
|
||||||
|
- File: `apps/server/src/checkpointing/Errors.ts:79`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wlYgs, PRRT_kwDORLtfbc5wxsO6, PRRT_kwDORLtfbc5w1C4B (+2 duplicate thread(s))
|
||||||
|
- Audit note: Same as C034.
|
||||||
|
|
||||||
|
### Phase 4
|
||||||
|
|
||||||
|
- [ ] `C018` Unbounded memory growth in turn start deduplication set
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Memory/resource growth`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:84`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5whszQ, PRRT_kwDORLtfbc5wl2A8, PRRT_kwDORLtfbc5wyTaT, PRRT_kwDORLtfbc5wzliz, PRRT_kwDORLtfbc5w0_g-, PRRT_kwDORLtfbc5w1HGW (+5 duplicate thread(s))
|
||||||
|
- Audit note: handledTurnStartKeys still grows without pruning.
|
||||||
|
|
||||||
|
### Phase 5
|
||||||
|
|
||||||
|
- [ ] `C009` Git's braced rename syntax (e.g., `src/{old => new}/file.ts`) isn't handled correctly. The current slice after `=>` produces invalid paths like `new}/file.ts`. Consider expanding the braces to construct the full destination path. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/server/src/git/Layers/GitCore.ts:41`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5w1CxT
|
||||||
|
- Audit note: Braced rename parsing still breaks paths like src/{old => new}/file.ts.
|
||||||
|
|
||||||
|
- [ ] `C010` `loadCustomKeybindingsConfig` fails when the config file doesn't exist, which is expected for new users. Consider catching `ENOENT` and returning an empty array instead. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/server/src/keybindings.ts:418`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wxvIJ
|
||||||
|
- Audit note: ENOENT for missing keybindings config still not handled as empty/default.
|
||||||
|
|
||||||
|
- [ ] `C022` Fish shell outputs `$PATH` as space-separated, not colon-separated. Consider checking if the shell is fish and using `string join : $PATH` instead, or validating the result contains colons before assigning.
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/server/src/os-jank.ts:10`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wkRZM
|
||||||
|
- Audit note: fish PATH formatting risk still exists in os-jank path recovery.
|
||||||
|
|
||||||
|
- [ ] `C023` Using `-il` flags causes the shell to source profile scripts that may print banners or other text, polluting the captured `PATH`. Consider using `-lc` (login only, non-interactive) to reduce unwanted output.
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/server/src/os-jank.ts:10`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wj4cM
|
||||||
|
- Audit note: -ilc shell invocation can pollute captured PATH output.
|
||||||
|
|
||||||
|
- [x] `C029` `parseFileUrlHref` already decodes the path (line 46), but `safeDecode` is called again here, corrupting filenames containing `%` sequences. Consider skipping the decode when `fileUrlTarget` is non-null.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/web/src/markdown-links.ts:105`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wnVsU
|
||||||
|
- Audit note: file URL decoding still double-decodes in one path.
|
||||||
|
|
||||||
|
- [x] `C030` `EXTERNAL_SCHEME_PATTERN` matches `script.ts:10` as a scheme because `.ts:` looks like `scheme:`. Consider requiring `://` after the colon, or checking that what follows the colon is not just digits. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/web/src/markdown-links.ts:111`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wnVsK
|
||||||
|
- Audit note: Scheme regex still misclassifies script.ts:10 as external scheme.
|
||||||
|
|
||||||
|
- [ ] `C038` Multi-byte UTF-8 characters split across chunks will be corrupted when decoding each chunk separately. Consider accumulating all chunks first, then decoding once, or use `TextDecoder` with `stream: true`. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/server/src/git/Layers/CodexTextGeneration.ts:136`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5w1GPo
|
||||||
|
- Audit note: Chunk-by-chunk UTF-8 decode can still corrupt split multibyte characters.
|
||||||
|
|
||||||
|
- [x] `C039` The `+` key can be parsed (via trailing `+` handling) but cannot be encoded because `shortcut.key.includes("+")` returns true for the literal `+` key. Consider checking `shortcut.key === "+"` separately and encoding it as `"space"` style (e.g., a special token), or adjusting the condition to allow the single `+` character. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/server/src/keybindings.ts:352`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wxvIB
|
||||||
|
- Audit note: Parser/encoder mismatch remains, but encoder path currently low-use.
|
||||||
|
|
||||||
|
- [x] `C040` `upsertKeybindingRule` has a race condition: concurrent calls read the same file state, then the last write overwrites earlier changes. Consider wrapping the read-modify-write sequence with `Effect.Semaphore` to serialize access. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Edge-case parsing/platform behavior`
|
||||||
|
- File: `apps/server/src/keybindings.ts:488`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wxvIA
|
||||||
|
- Audit note: upsertKeybindingRule read-modify-write remains race-prone.
|
||||||
|
|
||||||
|
### Phase 6
|
||||||
|
|
||||||
|
- [ ] `C028` Branch sync dispatches both server and stale local update
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/web/src/components/BranchToolbar.tsx:102`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5v-XCu
|
||||||
|
- Audit note: Optimistic local+server dual update is intentional but can temporarily diverge.
|
||||||
|
|
||||||
|
- [x] `C037` `Effect.callback` should return a cleanup function to close the server(s) on fiber interruption. Without it, the `Net.Server` handles keep the process alive and leak the port if the effect is cancelled. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/server/src/config.ts:41`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wj4cO
|
||||||
|
- Audit note: Callback cleanup missing, but practical exposure is low in one-shot startup path.
|
||||||
|
|
||||||
|
- [ ] `C047` `SqlSchema.findOneOption` can produce both SQL errors and decode errors, but `mapError` wraps all as `PersistenceSqlError`. Consider distinguishing `ParseError` from SQL errors and mapping decode failures to `PersistenceDecodeError` instead. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/server/src/persistence/Layers/OrchestrationCommandReceipts.ts:75`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wiaR-
|
||||||
|
- Audit note: Decode and SQL errors still collapsed into one persistence error kind.
|
||||||
|
|
||||||
|
- [x] `C049` `JSON.stringify(cause)` returns `undefined` for `undefined`, functions, or symbols, violating the `string` return type. Consider coercing the result to a string (e.g., `String(JSON.stringify(cause))`) or adding a fallback.
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/server/src/provider/Layers/ProviderService.ts:59`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wnVsI
|
||||||
|
- Audit note: JSON.stringify(cause) may return undefined despite string expectations.
|
||||||
|
|
||||||
|
- [ ] `C050` The read-modify-write pattern (`getBySessionId` → merge → `upsert`) is susceptible to lost updates under concurrent writes. Consider wrapping in a transaction or adding optimistic concurrency control (e.g., version field) if concurrent session updates are expected. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/server/src/provider/Layers/ProviderSessionDirectory.ts:94`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wiLhY
|
||||||
|
- Audit note: ProviderSessionDirectory upsert remains read-merge-write without concurrency control.
|
||||||
|
|
||||||
|
- [x] `C051` Using `??` for `providerThreadId` and `adapterKey` makes it impossible to clear these fields by passing `null`, since `null ?? existing` evaluates to `existing`. Consider using explicit `undefined` checks (like `resumeCursor` does) if clearing should be supported. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `DONE`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/server/src/provider/Layers/ProviderSessionDirectory.ts:119`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wxvH9
|
||||||
|
- Audit note: Null-clearing issue is real for providerThreadId; adapterKey part overstated.
|
||||||
|
|
||||||
|
- [ ] `C052` Race condition: `processHandle` may be `null` when `data` callback fires, since it's assigned after `Bun.spawn` returns. Consider initializing `BunPtyProcess` first, then passing it to the callback to avoid losing initial output. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/server/src/terminal/Layers/BunPTY.ts:97`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5w1CxE
|
||||||
|
- Audit note: Data callback may race before processHandle assignment.
|
||||||
|
|
||||||
|
- [ ] `C056` When `onOpenChange` is provided without `open`, the internal `_open` state never updates because `setOpenProp` takes precedence. Consider calling `_setOpen` when `openProp === undefined`, regardless of whether `setOpenProp` exists.
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `partially-valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/web/src/components/ui/sidebar.tsx:114`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wxvIq
|
||||||
|
- Audit note: Bug pattern exists, but current callsites mostly avoid triggering it.
|
||||||
|
|
||||||
|
- [ ] `C057` The `resizable` object is recreated on every render, causing `SidebarRail`'s `useEffect` to repeatedly read localStorage and update the DOM. Consider memoizing the object with `useMemo`. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/web/src/routes/_chat.$threadId.tsx:105`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wyWz4
|
||||||
|
- Audit note: Resizable object recreation still retriggers effect/storage reads.
|
||||||
|
|
||||||
|
- [ ] `C058` When `localStorage.getItem()` returns `null`, `Number(null)` evaluates to `0`, which passes `Number.isFinite(0)`. This causes the sidebar to clamp to `minWidth` on first load, overriding the `DIFF_INLINE_DEFAULT_WIDTH` CSS clamp. Consider checking for `null` or empty string before parsing, e.g. guard with `storedWidth === null || storedWidth === ''`. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `apps/web/src/routes/_chat.$threadId.tsx:122`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wnVsX
|
||||||
|
- Audit note: Number(null) -> 0 path still forces min width on initial load.
|
||||||
|
|
||||||
|
- [ ] `C060` `defaultModel` should be `Schema.optional(Schema.NullOr(Schema.String))` to allow clearing the value. Currently there's no way to reset it to `null` since omitting means "no change" in patch semantics. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary>
|
||||||
|
- Status: `TODO`
|
||||||
|
- Verdict: `valid`
|
||||||
|
- Severity: `Low`
|
||||||
|
- Area: `Other`
|
||||||
|
- File: `packages/contracts/src/orchestration.ts:253`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5whxJC
|
||||||
|
- Audit note: Schema still cannot express null clear for defaultModel patch.
|
||||||
|
|
||||||
|
## Closed Invalid Items
|
||||||
|
|
||||||
|
- [x] `C014` Engine error handler catches all errors including non-invariant ones
|
||||||
|
- Status: `CLOSED_INVALID`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- File: `apps/server/src/orchestration/Layers/OrchestrationEngine.ts:144`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wkPaJ
|
||||||
|
- Rationale: Broad catch is intentional for worker liveness; transactional dispatch path prevents the claimed non-invariant idempotency break in current design.
|
||||||
|
|
||||||
|
- [x] `C021` Shared mutable default metadata object causes stale eventId
|
||||||
|
- Status: `CLOSED_INVALID`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- File: `apps/server/src/orchestration/decider.ts:27`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wkPaA
|
||||||
|
- Rationale: Stale-eventId claim no longer applies; eventId is regenerated per event.
|
||||||
|
|
||||||
|
- [x] `C025` Duplicated checkpoint ref computation across two files
|
||||||
|
- Status: `CLOSED_INVALID`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- File: `apps/server/src/wsServer.ts:128`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wvwag
|
||||||
|
- Rationale: No longer duplicated; checkpoint ref helper now centralized.
|
||||||
|
|
||||||
|
- [x] `C031` Revert uses wrong turn count from positional inference
|
||||||
|
- Status: `CLOSED_INVALID`
|
||||||
|
- Severity: `Medium`
|
||||||
|
- File: `apps/web/src/session-logic.ts:127`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5v9SCp
|
||||||
|
- Rationale: Revert now uses explicit checkpointTurnCount first; positional fallback is non-primary.
|
||||||
|
|
||||||
|
- [x] `C036` Duplicate `checkpointRefForThreadTurn` function in two production files
|
||||||
|
- Status: `CLOSED_INVALID`
|
||||||
|
- Severity: `Low`
|
||||||
|
- File: `apps/server/src/checkpointing/Layers/CheckpointStore.ts:284`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wiqFX
|
||||||
|
- Rationale: No longer duplicated; single production source via Refs.ts.
|
||||||
|
|
||||||
|
- [x] `C055` Duplicate `checkpointRefForThreadTurn` function across files
|
||||||
|
- Status: `CLOSED_INVALID`
|
||||||
|
- Severity: `Low`
|
||||||
|
- File: `apps/server/src/wsServer.ts:128`
|
||||||
|
- Threads: PRRT_kwDORLtfbc5wkPaG
|
||||||
|
- Rationale: No longer duplicated; helper is centralized.
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
# Plan: Provider-Neutral Runtime Determinism and Flake Elimination
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
Replace timing-sensitive websocket and orchestration behavior with explicit typed runtime boundaries, ordered push delivery, and server-owned completion receipts. The cutover is broad and single-shot: no compatibility shim, no mixed old/new transport. The design must reduce flakes without baking Codex-specific lifecycle semantics into generic runtime code.
|
||||||
|
|
||||||
|
## Implementation Status
|
||||||
|
|
||||||
|
All 7 sections are implemented. CI passes (format, lint, typecheck, test, browser test, build). One deferred item remains: the shared `WsTestClient` helper from section 7 — tests use direct transport subscription and receipt-based waits instead.
|
||||||
|
|
||||||
|
### New files
|
||||||
|
|
||||||
|
| File | Purpose |
|
||||||
|
|------|---------|
|
||||||
|
| `packages/shared/src/DrainableWorker.ts` | Queue-based Effect worker with deterministic `drain` signal |
|
||||||
|
| `packages/shared/src/schemaJson.ts` | Two-phase JSON→Schema decode helpers (`decodeJsonResult`, `formatSchemaError`) |
|
||||||
|
| `apps/server/src/wsServer/pushBus.ts` | `ServerPushBus` — ordered typed push pipeline with auto-incrementing sequence |
|
||||||
|
| `apps/server/src/wsServer/readiness.ts` | `ServerReadiness` — Deferred-based barriers for startup sequencing |
|
||||||
|
| `apps/server/src/orchestration/Services/RuntimeReceiptBus.ts` | Receipt schema union: checkpoint captured, diff finalized, turn quiesced |
|
||||||
|
| `apps/server/src/orchestration/Layers/RuntimeReceiptBus.ts` | PubSub-backed receipt bus implementation |
|
||||||
|
| `apps/server/src/watchFileWithStatPolling.ts` | Stat-polling file watcher for containers where `fs.watch` is unreliable |
|
||||||
|
| `apps/server/vitest.config.ts` | Server-specific test config (timeout bumps) |
|
||||||
|
| `apps/server/src/wsServer/pushBus.test.ts` | Push bus serialization and welcome-gating tests |
|
||||||
|
| `packages/shared/src/DrainableWorker.test.ts` | Drainable worker enqueue/drain lifecycle tests |
|
||||||
|
|
||||||
|
### Key modifications
|
||||||
|
|
||||||
|
| File | Change |
|
||||||
|
|------|--------|
|
||||||
|
| `packages/contracts/src/ws.ts` | Channel-indexed `WsPushPayloadByChannel` map, `WsPush` union schema, `WsPushSequence` |
|
||||||
|
| `apps/server/src/wsServer.ts` | Integrated `ServerPushBus` and `ServerReadiness`; welcome gated on readiness |
|
||||||
|
| `apps/server/src/keybindings.ts` | Explicit runtime with `start`/`ready`/`snapshot`; dual `fs.watch` + stat-polling watcher |
|
||||||
|
| `apps/web/src/wsTransport.ts` | Connection state machine (`connecting`→`open`→`reconnecting`→`closed`→`disposed`); two-phase decode at boundary; cached latest push by channel |
|
||||||
|
| `apps/web/src/wsNativeApi.ts` | Removed decode logic; delegates to pre-validated transport messages |
|
||||||
|
| `apps/server/src/orchestration/Layers/CheckpointReactor.ts` | Uses `DrainableWorker`; publishes completion receipts |
|
||||||
|
| `apps/server/src/orchestration/Layers/ProviderCommandReactor.ts` | Uses `DrainableWorker` for command processing |
|
||||||
|
| `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts` | Uses `DrainableWorker` for event ingestion |
|
||||||
|
| `apps/server/integration/OrchestrationEngineHarness.integration.ts` | Receipt-based waits replace polling loops |
|
||||||
|
|
||||||
|
## Key Changes
|
||||||
|
### 1. Strengthen the generic boundaries, not the Codex boundary — DONE
|
||||||
|
- `ProviderRuntimeEvent` remains the canonical provider event contract; `ProviderService` remains the only cross-provider facade.
|
||||||
|
- Raw Codex payloads and event ordering stay isolated in `CodexAdapter.ts` and `codexAppServerManager.ts`.
|
||||||
|
- `ProviderKind` was not expanded. The runtime stays provider-neutral by contract.
|
||||||
|
|
||||||
|
### 2. Replace loose websocket envelopes with channel-indexed typed pushes — DONE
|
||||||
|
- `packages/contracts/src/ws.ts` now derives push messages from a `WsPushPayloadByChannel` channel-to-schema map. `WsPush` is a union schema replacing `channel: string` + `data: unknown`.
|
||||||
|
- Every server push carries `sequence: number`, auto-incremented in `ServerPushBus`.
|
||||||
|
- `packages/shared/src/schemaJson.ts` provides structured decode diagnostics via `formatSchemaError`.
|
||||||
|
- `packages/contracts/src/ws.test.ts` covers typed push envelope validation and channel/payload mismatch rejection.
|
||||||
|
|
||||||
|
### 3. Introduce explicit server readiness and a single push pipeline — DONE
|
||||||
|
- `apps/server/src/wsServer/pushBus.ts`: `ServerPushBus` with `publishAll` (broadcast) and `publishClient` (targeted) methods, backed by one ordered path. All pushes flow through it.
|
||||||
|
- `apps/server/src/wsServer/readiness.ts`: `ServerReadiness` with Deferred-based barriers for HTTP listening, push bus, keybindings, terminal subscriptions, and orchestration subscriptions.
|
||||||
|
- `server.welcome` is emitted only after connection-scoped and server-scoped readiness is complete.
|
||||||
|
- `wsServer.ts` no longer publishes directly from ad hoc background streams.
|
||||||
|
|
||||||
|
### 4. Turn background watchers into explicit runtimes — DONE
|
||||||
|
- `apps/server/src/keybindings.ts` refactored as explicit `KeybindingsShape` service with `start`, `ready`, `snapshot` semantics.
|
||||||
|
- Initial config load, cache warmup, and dual watcher attachment (`fs.watch` + `watchFileWithStatPolling`) complete before `ready` resolves.
|
||||||
|
- `watchFileWithStatPolling.ts` is the thin adapter for environments where `fs.watch` is unreliable.
|
||||||
|
|
||||||
|
### 5. Replace polling-based orchestration waiting with receipts — DONE
|
||||||
|
- `RuntimeReceiptBus` service defines three receipt types: `CheckpointBaselineCapturedReceipt`, `CheckpointDiffFinalizedReceipt` (with `status: "ready"|"missing"|"error"`), and `TurnProcessingQuiescedReceipt`.
|
||||||
|
- `CheckpointReactor`, `ProviderCommandReactor`, and `ProviderRuntimeIngestion` use `DrainableWorker` and publish receipts on completion.
|
||||||
|
- Integration harness and checkpoint tests await receipts instead of polling snapshots and git refs.
|
||||||
|
|
||||||
|
### 6. Centralize client transport state and decoding — DONE
|
||||||
|
- `apps/web/src/wsTransport.ts` implements an explicit connection state machine: `connecting`, `open`, `reconnecting`, `closed`, `disposed`.
|
||||||
|
- Two-phase decode (JSON parse → Schema validate) happens at the transport boundary. `wsNativeApi.ts` receives pre-validated messages.
|
||||||
|
- Cached latest welcome/config modeled as explicit `latestPushByChannel` state.
|
||||||
|
|
||||||
|
### 7. Replace ad hoc test helpers with semantic test clients — MOSTLY DONE
|
||||||
|
- `DrainableWorker` replaces timing-sensitive `Effect.sleep` with deterministic `drain()` across reactor tests.
|
||||||
|
- Orchestration harness waits on receipts/barriers instead of `waitForThread`, `waitForGitRef`, and retry loops.
|
||||||
|
- Behavioral assertions moved to deterministic unit-style harnesses; narrow integration tests kept for real filesystem/socket behavior.
|
||||||
|
- **Deferred:** Shared `WsTestClient` helper (connect, awaitSemanticWelcome, awaitTypedPush, trackSequence, matchRpcResponseById). Tests use direct transport subscription instead.
|
||||||
|
|
||||||
|
## Provider-Coupling Guardrails
|
||||||
|
- No generic runtime API may depend on Codex-native event names, thread IDs, or request payload shapes.
|
||||||
|
- No readiness barrier may be defined as "Codex has emitted X." Readiness is owned by the server runtime, not by provider event order.
|
||||||
|
- No websocket channel payload may contain raw provider-native payloads unless the channel is explicitly debug/internal.
|
||||||
|
- Any provider-specific divergence must be exposed through provider capabilities from `ProviderService.getCapabilities()`, not `if provider === "codex"` branches in shared runtime code.
|
||||||
|
- Generic tests must use canonical `ProviderRuntimeEvent` fixtures. Codex-specific ordering and translation tests stay in adapter/app-server suites only.
|
||||||
|
- Keep UI/provider-specific knobs such as Codex-only options scoped to provider UX code. Do not pull them into generic transport or orchestration state.
|
||||||
|
|
||||||
|
## Test Plan
|
||||||
|
- Contracts:
|
||||||
|
- schema tests for typed push envelopes and structured decode diagnostics
|
||||||
|
- ordering tests for `sequence`
|
||||||
|
- Server:
|
||||||
|
- readiness tests proving `server.welcome` cannot precede runtime readiness
|
||||||
|
- push bus tests proving terminal/config/orchestration pushes are serialized and typed
|
||||||
|
- keybindings runtime tests with fake watch source plus one real watcher integration test
|
||||||
|
- Orchestration:
|
||||||
|
- receipt tests proving checkpoint refs and projections are complete before completion signals resolve
|
||||||
|
- replacement of polling-based checkpoint/integration waits with receipt-based waits
|
||||||
|
- Web:
|
||||||
|
- transport tests for invalid JSON, invalid envelope, invalid payload, reconnect queue flushing, cached semantic state
|
||||||
|
- Validation gate:
|
||||||
|
- `bun run lint`
|
||||||
|
- `bun run typecheck`
|
||||||
|
- `mise exec -- bun run test`
|
||||||
|
- repeated full-suite run after cutover to confirm flake removal
|
||||||
|
|
||||||
|
## Assumptions and Defaults
|
||||||
|
- This remains a single-provider product during the cutover, but the runtime contracts must stay provider-neutral.
|
||||||
|
- No backward-compatibility layer is required for old websocket push envelopes.
|
||||||
|
- The goal is deterministic runtime behavior first; reducing retries and sleeps in tests is a consequence, not the primary mechanism.
|
||||||
|
- If a completion signal cannot be expressed provider-neutrally, it does not belong in the shared runtime layer and must stay adapter-local.
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Maintainability Plans
|
||||||
|
|
||||||
|
1. `01-shared-model-normalization.md`
|
||||||
|
2. `02-typed-ipc-boundaries.md`
|
||||||
|
3. `03-split-codex-app-server-manager.md`
|
||||||
|
4. `04-split-chatview-component.md`
|
||||||
|
5. `05-zod-persisted-state-validation.md`
|
||||||
|
6. `06-provider-logstream-lifecycle.md`
|
||||||
|
7. `07-ci-quality-gates.md`
|
||||||
|
8. `08-precommit-format-and-lint.md`
|
||||||
|
9. `09-event-state-test-expansion.md`
|
||||||
|
10. `10-unify-process-session-abstraction.md`
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# Branch/Environment Picker in ChatView Input
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Add a secondary toolbar below the ChatView input area (similar to Codex UI) that lets users select the target branch and environment mode (Local vs New worktree) before sending their first message.
|
||||||
|
|
||||||
|
## UX
|
||||||
|
|
||||||
|
- A toolbar appears **below** the input form (always visible when it's a git repo)
|
||||||
|
- Two controls:
|
||||||
|
1. **Environment mode** (left side): toggles between "Local" and "New worktree" — **locked after first message** (no longer clickable, just shows current mode as label)
|
||||||
|
2. **Branch picker** (right side): dropdown showing local branches — **always changeable**, even after messages are sent
|
||||||
|
- If not a git repo, the toolbar is hidden entirely (thread uses project cwd as-is)
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
### 0. Install `@tanstack/react-query` in `apps/renderer`
|
||||||
|
|
||||||
|
Add dependency + wrap app in `QueryClientProvider`.
|
||||||
|
|
||||||
|
### 1. `apps/renderer/src/store.ts` — MODIFY
|
||||||
|
|
||||||
|
Add a new action to the reducer:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
| { type: "SET_THREAD_BRANCH"; threadId: string; branch: string | null; worktreePath: string | null }
|
||||||
|
```
|
||||||
|
|
||||||
|
Reducer case updates `branch` and `worktreePath` on the thread.
|
||||||
|
|
||||||
|
### 2. `apps/renderer/src/components/ChatView.tsx` — MODIFY
|
||||||
|
|
||||||
|
**Fetch branches** via `useQuery`:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
const branchQuery = useQuery({
|
||||||
|
queryKey: ["git-branches", activeProject?.cwd],
|
||||||
|
queryFn: () => api.git.listBranches({ cwd: activeProject!.cwd }),
|
||||||
|
enabled: !!activeProject,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
**Local state:**
|
||||||
|
|
||||||
|
- `envMode: "local" | "worktree"` — environment mode (local component state)
|
||||||
|
|
||||||
|
**UI:** Below the `<form>`, render a toolbar bar (hidden if `!branchQuery.data?.isRepo`):
|
||||||
|
|
||||||
|
- Left side: env mode button ("Local" / "New worktree") — disabled after first message (locked in)
|
||||||
|
- Right side: branch dropdown from `branchQuery.data.branches`
|
||||||
|
- Both styled like existing model picker (small text, chevron, dropdown menus)
|
||||||
|
|
||||||
|
**Behavior:**
|
||||||
|
|
||||||
|
- Branch picker is always active — changing branch dispatches `SET_THREAD_BRANCH` immediately
|
||||||
|
- Env mode is only clickable when `activeThread.messages.length === 0`. After first message, it becomes a static label showing the locked-in mode
|
||||||
|
- On first send (`onSend`): if `envMode === "worktree"` and a branch is selected, call `api.git.createWorktree` before starting the session, then dispatch `SET_THREAD_BRANCH` with the worktreePath
|
||||||
|
- `ensureSession` already uses `activeThread.worktreePath ?? activeProject.cwd`
|
||||||
|
|
||||||
|
### Files to modify
|
||||||
|
|
||||||
|
1. `apps/renderer/package.json` — add `@tanstack/react-query`
|
||||||
|
2. `apps/renderer/src/main.tsx` (or App entry) — wrap in `QueryClientProvider`
|
||||||
|
3. `apps/renderer/src/store.ts` — add `SET_THREAD_BRANCH` action
|
||||||
|
4. `apps/renderer/src/components/ChatView.tsx` — branch/env picker UI with `useQuery`
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
1. `turbo build` — compiles
|
||||||
|
2. Create a new thread → branch bar appears below input with "Local" + current branch
|
||||||
|
3. Change branch in dropdown → branch updates on thread
|
||||||
|
4. Toggle "New worktree" → send message → worktree created, session uses worktree cwd
|
||||||
|
5. After first message: env mode label locks to "Worktree" (not clickable), branch picker still works
|
||||||
|
6. Non-git project → no branch bar shown
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
# Git Flows Integration Tests
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Real integration tests that run actual git commands against temporary repos. No mocking.
|
||||||
|
|
||||||
|
## Step 1: Extract git functions into `apps/desktop/src/git.ts`
|
||||||
|
|
||||||
|
The git functions (`listGitBranches`, `createGitWorktree`, `removeGitWorktree`, `createGitBranch`, `checkoutGitBranch`, `initGitRepo`) and their helper `runTerminalCommand` are currently private in `main.ts`. Extract them into a new `apps/desktop/src/git.ts` module with named exports.
|
||||||
|
|
||||||
|
`main.ts` will import and re-use them — no behavior change, just moving code.
|
||||||
|
|
||||||
|
**Files modified:**
|
||||||
|
|
||||||
|
- `apps/desktop/src/git.ts` — new file with all git functions exported
|
||||||
|
- `apps/desktop/src/main.ts` — import from `./git` instead of defining inline
|
||||||
|
|
||||||
|
## Step 2: Create `apps/desktop/src/git.test.ts`
|
||||||
|
|
||||||
|
Integration tests using real temp git repos. Each test group creates a fresh temp directory with `git init`, makes commits, creates branches as needed, and cleans up after.
|
||||||
|
|
||||||
|
### Setup/teardown pattern
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||||
|
import { tmpdir } from "node:os";
|
||||||
|
import path from "node:path";
|
||||||
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
import {
|
||||||
|
listGitBranches,
|
||||||
|
createGitBranch,
|
||||||
|
checkoutGitBranch,
|
||||||
|
createGitWorktree,
|
||||||
|
removeGitWorktree,
|
||||||
|
initGitRepo,
|
||||||
|
} from "./git";
|
||||||
|
|
||||||
|
// Helper: run a raw git command in a dir (for test setup, not under test)
|
||||||
|
// Helper: create an initial commit (git needs at least one commit for branches)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Test groups
|
||||||
|
|
||||||
|
**1. initGitRepo**
|
||||||
|
|
||||||
|
- Creates a valid git repo in a temp dir
|
||||||
|
- listGitBranches reports `isRepo: true` after init
|
||||||
|
|
||||||
|
**2. listGitBranches**
|
||||||
|
|
||||||
|
- Returns `isRepo: false` for non-git directory
|
||||||
|
- Returns the current branch with `current: true`
|
||||||
|
- Sorts current branch first
|
||||||
|
- Lists multiple branches after creating them
|
||||||
|
- `isDefault` is false when no remote (no origin/HEAD)
|
||||||
|
|
||||||
|
**3. checkoutGitBranch**
|
||||||
|
|
||||||
|
- Checks out an existing branch (current flag moves)
|
||||||
|
- Throws when branch doesn't exist
|
||||||
|
- Throws when checkout would overwrite uncommitted changes (dirty working tree)
|
||||||
|
|
||||||
|
**4. createGitBranch**
|
||||||
|
|
||||||
|
- Creates a new branch (appears in listGitBranches)
|
||||||
|
- Throws when branch already exists
|
||||||
|
|
||||||
|
**5. createGitWorktree + removeGitWorktree**
|
||||||
|
|
||||||
|
- Creates a worktree directory at the expected path
|
||||||
|
- Worktree has the correct branch checked out
|
||||||
|
- Throws when branch is already checked out in another worktree
|
||||||
|
- removeGitWorktree cleans up the worktree
|
||||||
|
|
||||||
|
**6. Full flow: local branch checkout**
|
||||||
|
|
||||||
|
- init → commit → create branch → checkout → verify current
|
||||||
|
|
||||||
|
**7. Full flow: worktree creation from selected branch**
|
||||||
|
|
||||||
|
- init → commit → create branch → create worktree → verify worktree dir exists and has correct branch
|
||||||
|
|
||||||
|
**8. Full flow: thread switching simulation**
|
||||||
|
|
||||||
|
- init → commit → create branch-a, branch-b → checkout a → checkout b → checkout a → verify current matches
|
||||||
|
|
||||||
|
**9. Full flow: checkout conflict**
|
||||||
|
|
||||||
|
- init → commit → create branch → modify file (unstaged) → checkout other branch → expect error
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run the git integration tests
|
||||||
|
cd apps/desktop && bun run test
|
||||||
|
|
||||||
|
# Or just the git test file
|
||||||
|
npx vitest run apps/desktop/src/git.test.ts
|
||||||
|
```
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
# Git Flows Test Plan
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Add tests for git branch/worktree flows. Two files:
|
||||||
|
|
||||||
|
1. **Extend** `apps/renderer/src/store.test.ts` — reducer tests for `SET_THREAD_BRANCH`
|
||||||
|
2. **Create** `apps/renderer/src/git-flows.test.ts` — flow logic tests
|
||||||
|
|
||||||
|
All tests are pure Vitest unit tests (no React rendering). They test the reducer directly and simulate handler logic via sequential reducer dispatches + mocked API calls.
|
||||||
|
|
||||||
|
## File 1: `apps/renderer/src/store.test.ts` (extend)
|
||||||
|
|
||||||
|
Add `describe("SET_THREAD_BRANCH reducer")` with 6 tests:
|
||||||
|
|
||||||
|
- Sets branch + worktreePath atomically
|
||||||
|
- Clears both to null
|
||||||
|
- Updates branch while preserving worktreePath
|
||||||
|
- Does not affect other threads (multi-thread state)
|
||||||
|
- No-op for nonexistent thread id
|
||||||
|
- Does not mutate messages, error, or session fields
|
||||||
|
|
||||||
|
Uses existing `makeThread`, `makeState` factories.
|
||||||
|
|
||||||
|
## File 2: `apps/renderer/src/git-flows.test.ts` (new)
|
||||||
|
|
||||||
|
### Factories
|
||||||
|
|
||||||
|
- `makeThread()`, `makeState()`, `makeSession()` — same pattern as store.test.ts
|
||||||
|
- `makeBranch()` — creates `GitBranch` objects
|
||||||
|
- `makeMessage()` — creates `ChatMessage` objects
|
||||||
|
- `makeGitApi()` — returns `{ checkout, createWorktree, createBranch, listBranches }` with `vi.fn()` mocks
|
||||||
|
|
||||||
|
### Test groups (~30 tests total)
|
||||||
|
|
||||||
|
**1. Local branch checkout flow** (2 tests)
|
||||||
|
|
||||||
|
- Successful checkout → SET_THREAD_BRANCH updates branch
|
||||||
|
- Checkout failure → SET_ERROR, branch unchanged
|
||||||
|
|
||||||
|
**2. Thread branch conflict on send** (3 tests)
|
||||||
|
|
||||||
|
- Two threads maintain independent branch state after SET_ACTIVE_THREAD
|
||||||
|
- Branch state preserved through multiple thread switches + updates
|
||||||
|
- Checkout failure on thread switch sets error only on target thread
|
||||||
|
|
||||||
|
**3. Worktree creation on send** (5 tests)
|
||||||
|
|
||||||
|
- First message in worktree mode → createWorktree → SET_THREAD_BRANCH with worktreePath
|
||||||
|
- No worktree when messages already exist
|
||||||
|
- No worktree in local envMode
|
||||||
|
- No worktree when worktreePath already set
|
||||||
|
- createWorktree failure → SET_ERROR, send aborted, no messages pushed
|
||||||
|
|
||||||
|
**4. Env mode locking** (4 tests)
|
||||||
|
|
||||||
|
- envLocked=false when no messages
|
||||||
|
- envLocked=true with messages
|
||||||
|
- Transitions false→true after PUSH_USER_MESSAGE
|
||||||
|
- Remains true after SET_ERROR and UPDATE_SESSION
|
||||||
|
|
||||||
|
**5. Auto-fill current branch** (3 tests)
|
||||||
|
|
||||||
|
- Dispatches SET_THREAD_BRANCH when thread has no branch and current branch exists
|
||||||
|
- Does not overwrite existing branch
|
||||||
|
- No-op when no branch is marked current
|
||||||
|
|
||||||
|
**6. Default branch detection** (2 tests)
|
||||||
|
|
||||||
|
- isDefault flag on branch objects
|
||||||
|
- current and isDefault can be on different branches
|
||||||
|
|
||||||
|
**7. Branch creation + checkout** (3 tests)
|
||||||
|
|
||||||
|
- Successful create + checkout updates branch
|
||||||
|
- createBranch failure → error, branch unchanged
|
||||||
|
- checkout failure after successful create → error, branch unchanged
|
||||||
|
|
||||||
|
**8. Session CWD resolution** (3 tests)
|
||||||
|
|
||||||
|
- Uses worktreePath when available
|
||||||
|
- cwdOverride takes precedence over worktreePath
|
||||||
|
- Falls back to project cwd when no worktree
|
||||||
|
|
||||||
|
**9. Error handling patterns** (4 tests)
|
||||||
|
|
||||||
|
- SET_ERROR sets error on correct thread
|
||||||
|
- SET_ERROR with null clears error
|
||||||
|
- Error on one thread doesn't affect others
|
||||||
|
- Error cleared before successful branch operations
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run all renderer tests
|
||||||
|
cd apps/renderer && bun run test
|
||||||
|
|
||||||
|
# Run just the new test file
|
||||||
|
npx vitest run apps/renderer/src/git-flows.test.ts
|
||||||
|
|
||||||
|
# Run just the store tests
|
||||||
|
npx vitest run apps/renderer/src/store.test.ts
|
||||||
|
```
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# Git Integration: Branch Picker + Worktrees
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Add git integration to let users start new threads from a specific branch, optionally creating a git worktree for isolated agent work.
|
||||||
|
|
||||||
|
## UX Flow
|
||||||
|
|
||||||
|
- **Left click** "+ New thread" → immediately creates a thread (current behavior, unchanged)
|
||||||
|
- **Right click** "+ New thread" → opens a context menu with git options:
|
||||||
|
- List of local branches → clicking one creates a thread on that branch (uses project cwd)
|
||||||
|
- Each branch has a "worktree" sub-option → creates a worktree, then creates thread with worktree as cwd
|
||||||
|
- When thread has a worktree, the agent session uses the worktree path as its cwd
|
||||||
|
- If git fails (not a repo), context menu shows "Not a git repository" disabled item
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
### 1. `packages/contracts/src/git.ts` — CREATE
|
||||||
|
|
||||||
|
New Zod schemas and types:
|
||||||
|
|
||||||
|
- `gitListBranchesInputSchema` — `{ cwd: string }`
|
||||||
|
- `gitCreateWorktreeInputSchema` — `{ cwd: string, branch: string, path?: string }`
|
||||||
|
- `gitRemoveWorktreeInputSchema` — `{ cwd: string, path: string }`
|
||||||
|
- `gitBranchSchema` — `{ name: string, current: boolean }`
|
||||||
|
- Result types for each
|
||||||
|
|
||||||
|
### 2. `packages/contracts/src/ipc.ts` — MODIFY
|
||||||
|
|
||||||
|
- Add 3 IPC channels: `git:list-branches`, `git:create-worktree`, `git:remove-worktree`
|
||||||
|
- Add `git` namespace to `NativeApi` with `listBranches`, `createWorktree`, `removeWorktree`
|
||||||
|
|
||||||
|
### 3. `packages/contracts/src/index.ts` — MODIFY
|
||||||
|
|
||||||
|
- Add `export * from "./git"`
|
||||||
|
|
||||||
|
### 4. `apps/desktop/src/main.ts` — MODIFY
|
||||||
|
|
||||||
|
Add 3 IPC handlers + helper functions:
|
||||||
|
|
||||||
|
- `listGitBranches()` — runs `git branch --no-color`, parses output into `{ name, current }[]`
|
||||||
|
- `createGitWorktree()` — runs `git worktree add <path> <branch>`, defaults path to `../{repo}-worktrees/{branch}`
|
||||||
|
- `removeGitWorktree()` — runs `git worktree remove <path>`
|
||||||
|
|
||||||
|
Reuses existing `runTerminalCommand()`.
|
||||||
|
|
||||||
|
### 5. `apps/desktop/src/preload.ts` — MODIFY
|
||||||
|
|
||||||
|
Add `git` namespace with 3 `ipcRenderer.invoke` calls.
|
||||||
|
|
||||||
|
### 6. `apps/renderer/src/types.ts` — MODIFY
|
||||||
|
|
||||||
|
Add to `Thread`:
|
||||||
|
|
||||||
|
```
|
||||||
|
branch: string | null
|
||||||
|
worktreePath: string | null
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7. `apps/renderer/src/persistenceSchema.ts` — MODIFY
|
||||||
|
|
||||||
|
- Add optional `branch`/`worktreePath` to persisted thread schema (`.nullable().optional()` for backwards compat)
|
||||||
|
- Add V3 schema, update union
|
||||||
|
- Update `hydrateThread` to default new fields to `null`
|
||||||
|
- Update `toPersistedState` to serialize new fields
|
||||||
|
|
||||||
|
### 8. `apps/renderer/src/store.ts` — MODIFY
|
||||||
|
|
||||||
|
- Update persisted state key to v3, keep v2 as legacy fallback
|
||||||
|
|
||||||
|
### 9. `apps/renderer/src/components/Sidebar.tsx` — MODIFY (main UI work)
|
||||||
|
|
||||||
|
- Keep existing left-click `handleNewThread` unchanged (immediate thread creation)
|
||||||
|
- Add `onContextMenu` handler to "+ New thread" buttons (both global and per-project)
|
||||||
|
- On right-click: fetch branches via `api.git.listBranches`, show a custom context menu
|
||||||
|
- Context menu items: branch names, each with a nested option to create with worktree
|
||||||
|
- Clicking a branch → creates thread with `branch` set, title = branch name
|
||||||
|
- Clicking "with worktree" → calls `api.git.createWorktree` first, then creates thread with `worktreePath`
|
||||||
|
- Show branch badge on thread list items
|
||||||
|
- If not a git repo, show "Not a git repository" as disabled menu item
|
||||||
|
|
||||||
|
Context menu component: a positioned `<div>` with `position: fixed` anchored to the click position, dismissed on click-outside or Escape. Follows the existing dropdown pattern from ChatView's model picker.
|
||||||
|
|
||||||
|
### 10. `apps/renderer/src/components/ChatView.tsx` — MODIFY
|
||||||
|
|
||||||
|
- Line 157: use `activeThread.worktreePath ?? activeProject.cwd` as session cwd
|
||||||
|
- Show branch/worktree badge in header bar
|
||||||
|
|
||||||
|
## Implementation Order
|
||||||
|
|
||||||
|
1. `packages/contracts/src/git.ts` (new schemas)
|
||||||
|
2. `packages/contracts/src/ipc.ts` + `index.ts` (wire up channels)
|
||||||
|
3. `apps/desktop/src/main.ts` (git command handlers)
|
||||||
|
4. `apps/desktop/src/preload.ts` (bridge methods)
|
||||||
|
5. `apps/renderer/src/types.ts` (Thread type update)
|
||||||
|
6. `apps/renderer/src/persistenceSchema.ts` + `store.ts` (persistence migration)
|
||||||
|
7. `apps/renderer/src/components/Sidebar.tsx` (branch picker UI)
|
||||||
|
8. `apps/renderer/src/components/ChatView.tsx` (worktree cwd + badge)
|
||||||
|
|
||||||
|
## Edge Cases
|
||||||
|
|
||||||
|
- **Not a git repo**: `git branch` fails → context menu shows "Not a git repository" disabled item
|
||||||
|
- **Branch has slashes**: `feature/foo` → worktree dir becomes `feature-foo`
|
||||||
|
- **Worktree exists**: git error surfaces to user via inline error message in context menu
|
||||||
|
- **No persistence breakage**: `.nullable().optional()` fields parse fine with old data
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
1. `turbo build` — confirm contracts/desktop/renderer all compile
|
||||||
|
2. Launch app, add a project pointing to a git repo
|
||||||
|
3. Click "+ New thread" → verify branch list loads
|
||||||
|
4. Select a branch, click Start → thread created with branch in title
|
||||||
|
5. Enable worktree checkbox, pick branch, Start → verify worktree directory created on disk
|
||||||
|
6. Send a message in worktree thread → verify agent runs in worktree cwd
|
||||||
|
7. Add a non-git project → verify graceful error, can still create thread
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
# Spec 1:1 Cutover Plan
|
||||||
|
|
||||||
|
Goal: Align the orchestration model to `SPEC.md` 1:1 and remove legacy persistence/application cruft.
|
||||||
|
|
||||||
|
Execution mode for this plan:
|
||||||
|
|
||||||
|
- Hard cutover only. Existing DB and migration history are disposable.
|
||||||
|
- Intermediate steps are allowed to break runtime, tests, typecheck, and lint.
|
||||||
|
- We optimize for small, reviewable work units, not continuous app operability.
|
||||||
|
- Only the final gate requires everything to run cleanly.
|
||||||
|
|
||||||
|
## 1. Freeze SPEC contract as source of truth
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Create `.plans/spec-contract-matrix.md` with one row per requirement in `SPEC.md` sections `7.1`-`7.4`.
|
||||||
|
- Add exact SQL-level requirements per row: table, column, type, nullability, PK/unique, index, and invariants.
|
||||||
|
- Add app-level requirements per row: writer path, reader path, and owning module.
|
||||||
|
- Mark each row with status labels: `required`, `implemented`, `to-replace`, `delete`.
|
||||||
|
- Identify any ambiguous spec lines and record a concrete interpretation in the matrix.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Complete matrix file with no unclassified rows.
|
||||||
|
- Single source checklist used by all later steps.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- No code changes required yet.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Every requirement in `7.1`-`7.4` has exactly one matrix row.
|
||||||
|
|
||||||
|
## 2. Hard cutover migrations (replace current migration set)
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Delete the current legacy migration files and rewrite migration loader ordering.
|
||||||
|
- Create `001_orchestration_events.ts` with full envelope columns and required event indexes.
|
||||||
|
- Create `002_orchestration_command_receipts.ts` with PK + lookup indexes.
|
||||||
|
- Create `003_checkpoint_diff_blobs.ts` with uniqueness on `(thread_id, from_turn_count, to_turn_count)`.
|
||||||
|
- Create `004_provider_session_runtime.ts` with PK and runtime lookup indexes.
|
||||||
|
- Create `005_projections.ts` with all projection tables:
|
||||||
|
- `projection_projects`
|
||||||
|
- `projection_threads`
|
||||||
|
- `projection_thread_messages`
|
||||||
|
- `projection_thread_activities`
|
||||||
|
- `projection_thread_sessions`
|
||||||
|
- `projection_thread_turns`
|
||||||
|
- `projection_checkpoints`
|
||||||
|
- `projection_pending_approvals`
|
||||||
|
- `projection_state`
|
||||||
|
- Add all required indexes/constraints in `005_projections.ts`.
|
||||||
|
- Ensure old tables (`projects`, `provider_checkpoints`, `provider_sessions`) are not recreated.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- New 5-file migration chain.
|
||||||
|
- Updated migration loader references only new migrations.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Repositories/services can be temporarily broken due to removed old tables.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Fresh DB initializes with only canonical tables plus migration bookkeeping.
|
||||||
|
|
||||||
|
## 3. Align persistence row/request schemas to DB 1:1
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Define row schemas for each canonical table (contracts or persistence layer module).
|
||||||
|
- Define request schemas for every insert/update/query operation touching canonical tables.
|
||||||
|
- Remove or deprecate row/request schemas tied to deleted legacy tables.
|
||||||
|
- Normalize enum and null semantics to match contracts exactly.
|
||||||
|
- Ensure SQL aliases map 1:1 to schema field names (no implicit shape transforms).
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Canonical row/request schemas committed.
|
||||||
|
- Zero references to legacy row schemas in active code paths.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Runtime can still fail while query layers are being rewired.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Every canonical table used in code has a typed row schema and typed request schema.
|
||||||
|
|
||||||
|
## 4. Rewrite event store for full persisted envelope
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Refactor append path to write full envelope fields:
|
||||||
|
- `event_id`, `aggregate_kind`, `stream_id`, `stream_version`, `event_type`, `occurred_at`, `command_id`, `causation_event_id`, `correlation_id`, `actor_kind`, `payload_json`, `metadata_json`
|
||||||
|
- Implement stream version assignment/checking per aggregate stream.
|
||||||
|
- Refactor read/replay path to decode payload and metadata from JSON and return `OrchestrationEvent` consistently.
|
||||||
|
- Remove assumptions from old minimal schema (`aggregate_id`, missing metadata/actor).
|
||||||
|
- Add explicit SQL ordering guarantees for replay (`ORDER BY sequence ASC`).
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Event store append/replay fully aligned with canonical envelope.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Command dispatch flow can be partially broken until receipts/projectors are updated.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Event store no longer depends on legacy event table shape.
|
||||||
|
|
||||||
|
## 5. Add command receipt idempotency
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Introduce persistence access layer for `orchestration_command_receipts`.
|
||||||
|
- In command dispatch flow, check existing receipt by `commandId` before append.
|
||||||
|
- On first execution, persist accepted receipt with `resultSequence`.
|
||||||
|
- On domain rejection, persist rejected receipt with error payload.
|
||||||
|
- On duplicate command, return prior result from receipt without re-appending event.
|
||||||
|
- Ensure receipt write and event append ordering is deterministic.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Dispatch path with idempotency behavior wired through receipts.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Snapshot/read model may still be inconsistent until projectors are fully wired.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Duplicate command IDs no longer create duplicate events.
|
||||||
|
|
||||||
|
## 6. Build DB-backed projection pipeline
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Create projector runner that consumes events and applies table-specific projections.
|
||||||
|
- Implement projector handlers for each projection table.
|
||||||
|
- For each handler, update target row(s) and `projection_state.last_applied_sequence` in the same transaction.
|
||||||
|
- Define projector names used in `projection_state` and make them stable constants.
|
||||||
|
- Add replay bootstrap from event store to bring projections up to latest sequence on startup.
|
||||||
|
- Add safe resume logic from projector `last_applied_sequence`.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Persistent projector pipeline writing all `projection_*` tables.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Web/API layer may still read old in-memory model until step 7.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Events drive projection rows in DB; projection state advances transactionally.
|
||||||
|
|
||||||
|
## 7. Move RPC reads to projections and diff blobs
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Implement snapshot query service reading only projection tables.
|
||||||
|
- Build thread hydration from projection rows: messages, activities, checkpoints, session.
|
||||||
|
- Compute `snapshotSequence` as the minimum required projector sequence from `projection_state`.
|
||||||
|
- Implement `getTurnDiff` query backed by `checkpoint_diff_blobs` only.
|
||||||
|
- Remove or bypass in-memory snapshot construction for RPC responses.
|
||||||
|
- Validate replay handoff contract: snapshot sequence -> replay from `fromSequenceExclusive`.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- `orchestration.getSnapshot` and `orchestration.getTurnDiff` served from DB projections/blob store.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Provider runtime persistence may still be partially legacy until step 8.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- No orchestration read RPC depends on legacy tables or in-memory-only state.
|
||||||
|
|
||||||
|
## 8. Migrate provider runtime persistence to canonical table
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Create repository/service for `provider_session_runtime`.
|
||||||
|
- Update adapter/session manager to persist runtime/resume cursor in new table.
|
||||||
|
- Ensure domain-visible session state still flows through orchestration events to `projection_thread_sessions`.
|
||||||
|
- Remove writes to legacy provider session tables.
|
||||||
|
- Verify restart/resume path reads runtime state from canonical table only.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Provider runtime state entirely backed by `provider_session_runtime`.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Some legacy interfaces may still exist but should be disconnected.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- Runtime restore no longer reads/writes legacy provider session persistence.
|
||||||
|
|
||||||
|
## 9. Remove old cruft aggressively
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Delete legacy repositories/services that map to removed tables.
|
||||||
|
- Remove dead migration imports and obsolete persistence service interfaces.
|
||||||
|
- Remove compatibility code paths that translate legacy row shapes.
|
||||||
|
- Remove unused contracts/types linked to deprecated persistence model.
|
||||||
|
- Update internal docs/comments to reference canonical projection/event model only.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Legacy persistence and translation layers removed from active codebase.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- Temporary compile failures acceptable while deletion/refactor is in progress.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- No production code path references deleted legacy tables/services.
|
||||||
|
|
||||||
|
## 10. Final verification gate (first point where green is required)
|
||||||
|
|
||||||
|
Work units:
|
||||||
|
|
||||||
|
- Add migration tests that assert canonical tables, columns, constraints, and indexes.
|
||||||
|
- Add event store tests for envelope persistence, metadata, actor kind, and replay.
|
||||||
|
- Add receipt idempotency tests for accept/reject/duplicate paths.
|
||||||
|
- Add projector tests for transactional row updates + `projection_state` updates.
|
||||||
|
- Add snapshot tests verifying projection-sourced output and `snapshotSequence` semantics.
|
||||||
|
- Add turn diff tests verifying `checkpoint_diff_blobs` source of truth.
|
||||||
|
- Add provider runtime tests for persist + restart + resume behavior.
|
||||||
|
- Run project lint/typecheck/tests and fix failures.
|
||||||
|
|
||||||
|
Deliverables:
|
||||||
|
|
||||||
|
- Green checks with canonical schema + persistence model in place.
|
||||||
|
|
||||||
|
Breakage allowed:
|
||||||
|
|
||||||
|
- None at end of step.
|
||||||
|
|
||||||
|
Exit criteria:
|
||||||
|
|
||||||
|
- SPEC `7.1`-`7.4` requirements satisfied and validated by tests.
|
||||||
@@ -0,0 +1,433 @@
|
|||||||
|
# SPEC Contract Matrix (Sections 7.1-7.4)
|
||||||
|
|
||||||
|
Status legend:
|
||||||
|
|
||||||
|
- `required`: requirement acknowledged, no current implementation claim yet.
|
||||||
|
- `implemented`: requirement currently satisfied in code + schema.
|
||||||
|
- `to-replace`: partial/misaligned implementation exists and must be replaced.
|
||||||
|
- `delete`: current path actively conflicts with SPEC and should be removed.
|
||||||
|
|
||||||
|
## 7.1 Write-Side Persisted Tables
|
||||||
|
|
||||||
|
### W1
|
||||||
|
|
||||||
|
- Spec ref: `7.1.1 orchestration_events`
|
||||||
|
- Requirement: append-only event store with canonical envelope columns.
|
||||||
|
- SQL contract:
|
||||||
|
- `sequence INTEGER PRIMARY KEY` (global monotonic)
|
||||||
|
- `event_id TEXT UNIQUE NOT NULL`
|
||||||
|
- `aggregate_kind TEXT NOT NULL CHECK IN ('project','thread')`
|
||||||
|
- `stream_id TEXT NOT NULL`
|
||||||
|
- `stream_version INTEGER NOT NULL`
|
||||||
|
- `event_type TEXT NOT NULL`
|
||||||
|
- `occurred_at TEXT NOT NULL`
|
||||||
|
- `command_id TEXT NULL`
|
||||||
|
- `causation_event_id TEXT NULL`
|
||||||
|
- `correlation_id TEXT NULL`
|
||||||
|
- `actor_kind TEXT NOT NULL CHECK IN ('client','server','provider')`
|
||||||
|
- `payload_json TEXT NOT NULL`
|
||||||
|
- `metadata_json TEXT NOT NULL`
|
||||||
|
- Current writer path: `apps/server/src/persistence/Layers/OrchestrationEventStore.ts`
|
||||||
|
- Current reader path: `apps/server/src/persistence/Layers/OrchestrationEventStore.ts`
|
||||||
|
- Owner module: `apps/server/src/persistence` (event store + migrations)
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: current migration/table lacks `stream_id`, `stream_version`, `causation_event_id`, `correlation_id`, `actor_kind`, `metadata_json`.
|
||||||
|
|
||||||
|
### W2
|
||||||
|
|
||||||
|
- Spec ref: `7.1.2 orchestration_command_receipts`
|
||||||
|
- Requirement: command idempotency + ack replay receipts table.
|
||||||
|
- SQL contract:
|
||||||
|
- `command_id TEXT PRIMARY KEY`
|
||||||
|
- `aggregate_kind TEXT NOT NULL CHECK IN ('project','thread')`
|
||||||
|
- `aggregate_id TEXT NOT NULL`
|
||||||
|
- `accepted_at TEXT NOT NULL`
|
||||||
|
- `result_sequence INTEGER NOT NULL`
|
||||||
|
- `status TEXT NOT NULL CHECK IN ('accepted','rejected')`
|
||||||
|
- `error TEXT NULL`
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: `apps/server/src/orchestration` dispatch boundary + `apps/server/src/persistence`
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: missing table and missing idempotency flow.
|
||||||
|
|
||||||
|
### W3
|
||||||
|
|
||||||
|
- Spec ref: `7.1.3 checkpoint_diff_blobs`
|
||||||
|
- Requirement: store large plaintext diffs separate from checkpoint summaries.
|
||||||
|
- SQL contract:
|
||||||
|
- `thread_id TEXT NOT NULL`
|
||||||
|
- `from_turn_count INTEGER NOT NULL`
|
||||||
|
- `to_turn_count INTEGER NOT NULL`
|
||||||
|
- `diff TEXT NOT NULL`
|
||||||
|
- `created_at TEXT NOT NULL`
|
||||||
|
- `UNIQUE(thread_id, from_turn_count, to_turn_count)`
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: `apps/server/src/persistence` + turn diff query service
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: no canonical diff blob table yet.
|
||||||
|
|
||||||
|
### W4
|
||||||
|
|
||||||
|
- Spec ref: `7.1.4 provider_session_runtime`
|
||||||
|
- Requirement: server-internal provider runtime/resume state.
|
||||||
|
- SQL contract:
|
||||||
|
- `provider_session_id TEXT PRIMARY KEY`
|
||||||
|
- `thread_id TEXT NOT NULL`
|
||||||
|
- `provider_name TEXT NOT NULL`
|
||||||
|
- `adapter_key TEXT NOT NULL`
|
||||||
|
- `provider_thread_id TEXT NULL`
|
||||||
|
- `status TEXT NOT NULL CHECK IN ('starting','running','stopped','error')`
|
||||||
|
- `last_seen_at TEXT NOT NULL`
|
||||||
|
- `resume_cursor_json TEXT NULL`
|
||||||
|
- `runtime_payload_json TEXT NULL`
|
||||||
|
- Current writer path: legacy provider session persistence (`apps/server/src/persistence/Layers/ProviderSessions.ts`)
|
||||||
|
- Current reader path: legacy provider session persistence (`apps/server/src/persistence/Layers/ProviderSessions.ts`)
|
||||||
|
- Owner module: provider runtime manager + persistence runtime repository
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: existing `provider_sessions` schema is incompatible and too small.
|
||||||
|
|
||||||
|
## 7.2 Canonical Persisted Event Schema
|
||||||
|
|
||||||
|
### E1
|
||||||
|
|
||||||
|
- Spec ref: `7.2 OrchestrationPersistedEventSchema`
|
||||||
|
- Requirement: full typed persisted event envelope in shared contracts.
|
||||||
|
- SQL contract: envelope fields in W1 must map 1:1 to contracts schema.
|
||||||
|
- Current writer path: contracts defined in `packages/contracts/src/orchestration.ts`
|
||||||
|
- Current reader path: used by persistence decode boundaries (partial)
|
||||||
|
- Owner module: `packages/contracts`
|
||||||
|
- Status: `implemented`
|
||||||
|
- Notes: contract schema exists; DB + store mapping still incomplete.
|
||||||
|
|
||||||
|
### E2
|
||||||
|
|
||||||
|
- Spec ref: `7.2 Rules/payload discriminated by eventType`
|
||||||
|
- Requirement: `payload` validation keyed by `eventType`.
|
||||||
|
- SQL contract: `event_type` drives payload decode schema; invalid combinations rejected.
|
||||||
|
- Current writer path: `packages/contracts/src/orchestration.ts`
|
||||||
|
- Current reader path: `apps/server/src/persistence/Layers/OrchestrationEventStore.ts` decode path
|
||||||
|
- Owner module: contracts + event store
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: decode is present but DB does not persist full envelope columns.
|
||||||
|
|
||||||
|
### E3
|
||||||
|
|
||||||
|
- Spec ref: `7.2 Rules/provider ids scope`
|
||||||
|
- Requirement: provider ids live in metadata/provider payload, not as thread identity replacement.
|
||||||
|
- SQL contract: provider fields persisted inside `metadata_json`; `stream_id` remains project/thread id.
|
||||||
|
- Current writer path: `apps/server/src/orchestration/decider.ts` (metadata mostly empty)
|
||||||
|
- Current reader path: projector/event consumers
|
||||||
|
- Owner module: decider + provider ingestion + event store
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: metadata plumbing is incomplete in persistence path.
|
||||||
|
|
||||||
|
### E4
|
||||||
|
|
||||||
|
- Spec ref: `7.2 Rules/streamVersion concurrency guard`
|
||||||
|
- Requirement: stream version monotonic per aggregate stream; enforced on write.
|
||||||
|
- SQL contract: `stream_version INTEGER NOT NULL` + uniqueness/invariant enforcement per stream.
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: event store append logic + DB constraints
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: no stream version assignment/checking today.
|
||||||
|
|
||||||
|
## 7.3 Required Projected Tables (Read Models)
|
||||||
|
|
||||||
|
### P1
|
||||||
|
|
||||||
|
- Spec ref: `7.3.1 projection_projects`
|
||||||
|
- Requirement: persisted project projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `project_id TEXT PRIMARY KEY`
|
||||||
|
- `title TEXT NOT NULL`
|
||||||
|
- `workspace_root TEXT NOT NULL`
|
||||||
|
- `default_model TEXT NULL`
|
||||||
|
- `created_at TEXT NOT NULL`
|
||||||
|
- `updated_at TEXT NOT NULL`
|
||||||
|
- `deleted_at TEXT NULL`
|
||||||
|
- Current writer path: none (in-memory projector only)
|
||||||
|
- Current reader path: none (snapshot not DB-projected)
|
||||||
|
- Owner module: projector pipeline + snapshot query
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: legacy `projects` table is separate concept and should be removed from orchestration model.
|
||||||
|
|
||||||
|
### P2
|
||||||
|
|
||||||
|
- Spec ref: `7.3.2 projection_threads`
|
||||||
|
- Requirement: persisted thread projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `thread_id TEXT PRIMARY KEY`
|
||||||
|
- `project_id TEXT NOT NULL`
|
||||||
|
- `title TEXT NOT NULL`
|
||||||
|
- `model TEXT NOT NULL`
|
||||||
|
- `branch TEXT NULL`
|
||||||
|
- `worktree_path TEXT NULL`
|
||||||
|
- `latest_turn_id TEXT NULL`
|
||||||
|
- `created_at TEXT NOT NULL`
|
||||||
|
- `updated_at TEXT NOT NULL`
|
||||||
|
- `deleted_at TEXT NULL`
|
||||||
|
- Current writer path: none (in-memory projector only)
|
||||||
|
- Current reader path: none (snapshot not DB-projected)
|
||||||
|
- Owner module: projector pipeline + snapshot query
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: missing table and projector writes.
|
||||||
|
|
||||||
|
### P3
|
||||||
|
|
||||||
|
- Spec ref: `7.3.3 projection_thread_messages`
|
||||||
|
- Requirement: persisted thread message projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `message_id TEXT PRIMARY KEY`
|
||||||
|
- `thread_id TEXT NOT NULL`
|
||||||
|
- `turn_id TEXT NULL`
|
||||||
|
- `role TEXT NOT NULL CHECK IN ('user','assistant','system')`
|
||||||
|
- `text TEXT NOT NULL`
|
||||||
|
- `is_streaming INTEGER/BOOLEAN NOT NULL`
|
||||||
|
- `created_at TEXT NOT NULL`
|
||||||
|
- `updated_at TEXT NOT NULL`
|
||||||
|
- Current writer path: none (in-memory projector only)
|
||||||
|
- Current reader path: none (snapshot not DB-projected)
|
||||||
|
- Owner module: projector pipeline + snapshot query
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: missing table and message projection writes.
|
||||||
|
|
||||||
|
### P4
|
||||||
|
|
||||||
|
- Spec ref: `7.3.4 projection_thread_activities`
|
||||||
|
- Requirement: persisted thread activity projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `activity_id TEXT PRIMARY KEY`
|
||||||
|
- `thread_id TEXT NOT NULL`
|
||||||
|
- `turn_id TEXT NULL`
|
||||||
|
- `tone TEXT NOT NULL CHECK IN ('info','tool','approval','error')`
|
||||||
|
- `kind TEXT NOT NULL`
|
||||||
|
- `summary TEXT NOT NULL`
|
||||||
|
- `payload_json TEXT NOT NULL`
|
||||||
|
- `created_at TEXT NOT NULL`
|
||||||
|
- Current writer path: none (in-memory projector only)
|
||||||
|
- Current reader path: none (snapshot not DB-projected)
|
||||||
|
- Owner module: projector pipeline + snapshot query
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: no canonical activity projection persistence.
|
||||||
|
|
||||||
|
### P5
|
||||||
|
|
||||||
|
- Spec ref: `7.3.5 projection_thread_sessions`
|
||||||
|
- Requirement: persisted thread session projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `thread_id TEXT PRIMARY KEY`
|
||||||
|
- `status TEXT NOT NULL CHECK IN ('idle','starting','running','ready','interrupted','stopped','error')`
|
||||||
|
- `provider_name TEXT NULL`
|
||||||
|
- `provider_session_id TEXT NULL`
|
||||||
|
- `provider_thread_id TEXT NULL`
|
||||||
|
- `active_turn_id TEXT NULL`
|
||||||
|
- `last_error TEXT NULL`
|
||||||
|
- `updated_at TEXT NOT NULL`
|
||||||
|
- Current writer path: none (in-memory projector only)
|
||||||
|
- Current reader path: none (snapshot not DB-projected)
|
||||||
|
- Owner module: projector pipeline + snapshot query
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: current provider session table is not this domain projection.
|
||||||
|
|
||||||
|
### P6
|
||||||
|
|
||||||
|
- Spec ref: `7.3.6 projection_thread_turns`
|
||||||
|
- Requirement: persisted thread turn projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `turn_id TEXT PRIMARY KEY`
|
||||||
|
- `thread_id TEXT NOT NULL`
|
||||||
|
- `turn_count INTEGER NOT NULL`
|
||||||
|
- `status TEXT NOT NULL CHECK IN ('running','completed','interrupted','error')`
|
||||||
|
- `user_message_id TEXT NULL`
|
||||||
|
- `assistant_message_id TEXT NULL`
|
||||||
|
- `started_at TEXT NOT NULL`
|
||||||
|
- `completed_at TEXT NULL`
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: projector pipeline + session/turn query helpers
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: missing table and projection logic.
|
||||||
|
|
||||||
|
### P7
|
||||||
|
|
||||||
|
- Spec ref: `7.3.7 projection_checkpoints`
|
||||||
|
- Requirement: persisted checkpoint summary projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `thread_id TEXT NOT NULL`
|
||||||
|
- `turn_id TEXT NOT NULL`
|
||||||
|
- `checkpoint_turn_count INTEGER NOT NULL`
|
||||||
|
- `checkpoint_ref TEXT NOT NULL`
|
||||||
|
- `status TEXT NOT NULL CHECK IN ('ready','missing','error')`
|
||||||
|
- `files_json TEXT NOT NULL`
|
||||||
|
- `assistant_message_id TEXT NULL`
|
||||||
|
- `completed_at TEXT NOT NULL`
|
||||||
|
- `UNIQUE(thread_id, checkpoint_turn_count)`
|
||||||
|
- Current writer path: legacy `provider_checkpoints` writes in `apps/server/src/persistence/Layers/Checkpoints.ts`
|
||||||
|
- Current reader path: legacy checkpoint repository
|
||||||
|
- Owner module: projector pipeline + checkpoint query layer
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: current table semantics do not match canonical checkpoint projection schema.
|
||||||
|
|
||||||
|
### P8
|
||||||
|
|
||||||
|
- Spec ref: `7.3.8 projection_pending_approvals`
|
||||||
|
- Requirement: persisted pending-approval projection table.
|
||||||
|
- SQL contract:
|
||||||
|
- `request_id TEXT PRIMARY KEY`
|
||||||
|
- `thread_id TEXT NOT NULL`
|
||||||
|
- `turn_id TEXT NULL`
|
||||||
|
- `status TEXT NOT NULL CHECK IN ('pending','resolved')`
|
||||||
|
- `decision TEXT NULL CHECK IN ('accept','acceptForSession','decline','cancel')`
|
||||||
|
- `created_at TEXT NOT NULL`
|
||||||
|
- `resolved_at TEXT NULL`
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: projector pipeline + approval query layer
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: missing table and projection logic.
|
||||||
|
|
||||||
|
### P9
|
||||||
|
|
||||||
|
- Spec ref: `7.3.9 projection_state`
|
||||||
|
- Requirement: projector progress tracking table.
|
||||||
|
- SQL contract:
|
||||||
|
- `projector TEXT PRIMARY KEY`
|
||||||
|
- `last_applied_sequence INTEGER NOT NULL`
|
||||||
|
- `updated_at TEXT NOT NULL`
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: projector runner/checkpointing
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: missing table and projector bookkeeping.
|
||||||
|
|
||||||
|
### P10
|
||||||
|
|
||||||
|
- Spec ref: `7.3 Projection consistency rules`
|
||||||
|
- Requirement: projector row updates and `projection_state` update must be atomic per event.
|
||||||
|
- SQL contract: per-projector transaction boundary covering both projection write and state update.
|
||||||
|
- Current writer path: none (in-memory projector has no SQL transaction)
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: projector runner
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: requires transactional projection executor.
|
||||||
|
|
||||||
|
### P11
|
||||||
|
|
||||||
|
- Spec ref: `7.3 Optional debug field`
|
||||||
|
- Requirement: `lastEventSequence` on projection rows is optional and not required for correctness.
|
||||||
|
- SQL contract: optional; not required in baseline schema.
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: none
|
||||||
|
- Owner module: projector runner
|
||||||
|
- Status: `required`
|
||||||
|
- Notes: interpretation: exclude from first cutover unless debugging requires it.
|
||||||
|
|
||||||
|
## 7.4 Snapshot and RPC Requirements
|
||||||
|
|
||||||
|
### R1
|
||||||
|
|
||||||
|
- Spec ref: `7.4.1`
|
||||||
|
- Requirement: `orchestration.getSnapshot` fully served from projection tables and returns `snapshotSequence`.
|
||||||
|
- SQL contract: snapshot query joins/reads only `projection_*` + `projection_state`.
|
||||||
|
- Current writer path: in-memory model built in `apps/server/src/orchestration/projector.ts`
|
||||||
|
- Current reader path: `apps/server/src/orchestration/Layers/OrchestrationEngine.ts#getReadModel`
|
||||||
|
- Owner module: snapshot query service + ws RPC handler
|
||||||
|
- Status: `delete`
|
||||||
|
- Notes: current in-memory read model path must be removed for SPEC compliance.
|
||||||
|
|
||||||
|
### R2
|
||||||
|
|
||||||
|
- Spec ref: `7.4.2`
|
||||||
|
- Requirement: snapshot `projects[]` source is `projection_projects`.
|
||||||
|
- SQL contract: `projects` collection assembled from `projection_projects` rows.
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: in-memory thread/project arrays
|
||||||
|
- Owner module: snapshot query service
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: no DB project projection reader exists yet.
|
||||||
|
|
||||||
|
### R3
|
||||||
|
|
||||||
|
- Spec ref: `7.4.3`
|
||||||
|
- Requirement: thread snapshot `checkpoints[]` source is `projection_checkpoints` with required fields.
|
||||||
|
- SQL contract: fields `turnId`, `completedAt`, `status`, `files[]`, `checkpointRef`, optional `assistantMessageId`, `checkpointTurnCount`.
|
||||||
|
- Current writer path: legacy checkpoint repo data model
|
||||||
|
- Current reader path: in-memory checkpoints from orchestration events
|
||||||
|
- Owner module: snapshot query service + checkpoint projector
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: canonical projection table and reader not implemented.
|
||||||
|
|
||||||
|
### R4
|
||||||
|
|
||||||
|
- Spec ref: `7.4.4`
|
||||||
|
- Requirement: no `listCheckpoints` orchestration RPC; list in snapshot + full diff via `getTurnDiff` from diff blobs.
|
||||||
|
- SQL contract: `getTurnDiff` reads `checkpoint_diff_blobs` only.
|
||||||
|
- Current writer path: none for diff blobs
|
||||||
|
- Current reader path: `orchestration.getTurnDiff` schema exists, data backing incomplete
|
||||||
|
- Owner module: ws RPC handler + diff query service
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: current checkpoint repository is not canonical source.
|
||||||
|
|
||||||
|
### R5
|
||||||
|
|
||||||
|
- Spec ref: `7.4.5`
|
||||||
|
- Requirement: client acts on `ThreadId`; server resolves provider session via `projection_thread_sessions`.
|
||||||
|
- SQL contract: session lookup by `thread_id` from projection table.
|
||||||
|
- Current writer path: mixed provider/session handling paths
|
||||||
|
- Current reader path: legacy provider session persistence lookups
|
||||||
|
- Owner module: provider dispatch/session resolution
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: remove provider-session-as-routing-key behavior.
|
||||||
|
|
||||||
|
### R6
|
||||||
|
|
||||||
|
- Spec ref: `7.4.6`
|
||||||
|
- Requirement: `snapshotSequence` derived from `projection_state` minimum over dependent projectors.
|
||||||
|
- SQL contract: `MIN(last_applied_sequence)` across required projector keys.
|
||||||
|
- Current writer path: none
|
||||||
|
- Current reader path: currently from in-memory event projection sequence
|
||||||
|
- Owner module: snapshot query service
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: must move from in-memory sequence to DB projection-state semantics.
|
||||||
|
|
||||||
|
### R7
|
||||||
|
|
||||||
|
- Spec ref: `7.4.7`
|
||||||
|
- Requirement: snapshot/replay handoff has no gap (`getSnapshot` -> subscribe from snapshot sequence).
|
||||||
|
- SQL contract: read consistency strategy guaranteeing no missing events between snapshot visibility and replay start.
|
||||||
|
- Current writer path: event stream via `OrchestrationEventStore.readFromSequence`
|
||||||
|
- Current reader path: ws replay flow in `apps/server/src/wsServer.ts`
|
||||||
|
- Owner module: ws RPC + event stream handoff layer
|
||||||
|
- Status: `to-replace`
|
||||||
|
- Notes: interpretation requires explicit consistency boundary (transaction, sequence fence, or equivalent).
|
||||||
|
|
||||||
|
## Ambiguous/Interpretation Decisions (tracked upfront)
|
||||||
|
|
||||||
|
### A1
|
||||||
|
|
||||||
|
- Topic: `orchestration_events.stream_id` vs event runtime `aggregateId` naming.
|
||||||
|
- Decision: persist canonical DB column name `stream_id`; map to runtime `aggregateId` where needed in decider/projector code.
|
||||||
|
|
||||||
|
### A2
|
||||||
|
|
||||||
|
- Topic: JSON column typing in SQLite for `payload`, `metadata`, projection payload/files, runtime cursor/payload.
|
||||||
|
- Decision: store as `TEXT` JSON with strict encode/decode schemas at boundaries.
|
||||||
|
|
||||||
|
### A3
|
||||||
|
|
||||||
|
- Topic: `snapshotSequence` dependency set for min-sequence computation.
|
||||||
|
- Decision: include all projectors used to construct snapshot payload (`projects`, `threads`, `messages`, `activities`, `sessions`, `turns`, `checkpoints`, `pending_approvals`).
|
||||||
|
|
||||||
|
### A4
|
||||||
|
|
||||||
|
- Topic: no-gap handoff mechanism in `7.4.7`.
|
||||||
|
- Decision: implement explicit sequence fence semantics at snapshot time; replay starts from fence `fromSequenceExclusive`.
|
||||||
|
|
||||||
|
## Checklist Completeness Statement
|
||||||
|
|
||||||
|
- Coverage scope: `SPEC.md` sections `7.1`, `7.2`, `7.3`, `7.4`.
|
||||||
|
- Requirement rows present: `W1-W4`, `E1-E4`, `P1-P11`, `R1-R7`.
|
||||||
|
- Unclassified rows: `0`.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.DS_Store
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# effect-http-ws-cli (PoC)
|
||||||
|
|
||||||
|
Minimal PoC using Effect v4 beta with a single unified program:
|
||||||
|
|
||||||
|
- `effect/unstable/cli` as the app entrypoint
|
||||||
|
- `effect/unstable/http` (`HttpServer`, `HttpRouter`, `HttpServerRequest`, `HttpServerResponse`) for server/runtime logic
|
||||||
|
- `@effect/platform-node` to host the server on Node.js
|
||||||
|
- HTTP + WebSocket message routing based on `effect/Schema` validation
|
||||||
|
- static asset serving from local filesystem (`public/` by default)
|
||||||
|
|
||||||
|
The repo now uses a Bun workspace:
|
||||||
|
|
||||||
|
- `server/` contains the Effect HTTP + WebSocket backend
|
||||||
|
- `web/` remains the Vite + React frontend package
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun install
|
||||||
|
bun run web:build
|
||||||
|
bun run start -- --port 8787 --host 127.0.0.1 --assets public --db todo.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
|
Then open `http://127.0.0.1:8787`.
|
||||||
|
|
||||||
|
## Frontend
|
||||||
|
|
||||||
|
React + Vite client lives in `web/` and is built into `public/` so it is served by the static router.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run web:build
|
||||||
|
```
|
||||||
|
|
||||||
|
For local development without building the frontend:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
That starts the backend, starts Vite on `http://127.0.0.1:5173`, and redirects frontend page requests there. In dev, Vite proxies `/api/*`, `/ws`, and `/health` back to the backend server.
|
||||||
|
|
||||||
|
If you want to run the processes separately, start `bun run web:dev` and launch the backend with `FRONTEND_DEV_ORIGIN=http://127.0.0.1:5173`.
|
||||||
|
|
||||||
|
The UI now demonstrates a typed realtime todo workflow:
|
||||||
|
|
||||||
|
- load todo snapshot on page load (`listTodos`)
|
||||||
|
- subscribe to todo updates (`subscribeTodos`)
|
||||||
|
- mutate todos via RPC (`renameTodo`, `completeTodo`, `archiveTodo`)
|
||||||
|
|
||||||
|
### Config Sources
|
||||||
|
|
||||||
|
Config is resolved from both CLI flags and `effect/Config`:
|
||||||
|
|
||||||
|
- CLI flags: `--host`, `--port`, `--assets`, `--db`, `--request-logging`, `--frontend-dev-origin`
|
||||||
|
- Env via `effect/Config`: `HOST`, `PORT`, `ASSETS_DIR`, `DB_FILENAME`, `REQUEST_LOGGING`, `FRONTEND_DEV_ORIGIN`
|
||||||
|
|
||||||
|
Precedence:
|
||||||
|
|
||||||
|
1. CLI flags
|
||||||
|
2. `effect/Config` (environment)
|
||||||
|
3. hard defaults (`127.0.0.1`, `8787`, `public`, `todo.sqlite`)
|
||||||
|
|
||||||
|
### SQL Persistence
|
||||||
|
|
||||||
|
- Uses `effect/unstable/sql` + `SqlSchema` for typed SQL request/result decoding.
|
||||||
|
- Uses `@effect/sql-sqlite-node` as the Node runtime SQL client.
|
||||||
|
- Database schema is managed by `effect/unstable/sql/Migrator` via `server/src/migrations.ts` with statically imported migration files.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
- `GET /health`
|
||||||
|
- `POST /api/dispatch`
|
||||||
|
- `GET /ws` (WebSocket RPC)
|
||||||
|
- `GET *` (static files)
|
||||||
|
|
||||||
|
### Message schema
|
||||||
|
|
||||||
|
Incoming messages are validated with `Schema`:
|
||||||
|
|
||||||
|
- `{ "kind": "echo", "text": string }`
|
||||||
|
- `{ "kind": "sum", "left": number, "right": number }`
|
||||||
|
- `{ "kind": "time" }`
|
||||||
|
|
||||||
|
Both HTTP and WebSocket dispatch use the same schema-driven router.
|
||||||
|
|
||||||
|
## Verify
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run test
|
||||||
|
bun run test:web
|
||||||
|
bun run lint
|
||||||
|
```
|
||||||
@@ -0,0 +1,638 @@
|
|||||||
|
{
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"configVersion": 0,
|
||||||
|
"workspaces": {
|
||||||
|
"": {
|
||||||
|
"name": "effect-http-ws-cli",
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"name": "@effect-http-ws-cli/server",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@effect/platform-node": "catalog:",
|
||||||
|
"@effect/sql-sqlite-node": "catalog:",
|
||||||
|
"effect": "catalog:",
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@effect/vitest": "catalog:",
|
||||||
|
"@types/node": "^24.10.0",
|
||||||
|
"typescript": "catalog:",
|
||||||
|
"vitest": "catalog:",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"web": {
|
||||||
|
"name": "@effect-http-ws-cli/web",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@effect-http-ws-cli/server": "workspace:*",
|
||||||
|
"@effect/atom-react": "catalog:",
|
||||||
|
"@tanstack/react-router": "^1.166.2",
|
||||||
|
"effect": "catalog:",
|
||||||
|
"react": "^19.2.0",
|
||||||
|
"react-dom": "^19.2.0",
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tanstack/router-plugin": "^1.166.2",
|
||||||
|
"@types/react": "^19.2.7",
|
||||||
|
"@types/react-dom": "^19.2.3",
|
||||||
|
"@vitejs/plugin-react": "^5.1.1",
|
||||||
|
"@vitest/browser-playwright": "^4.0.18",
|
||||||
|
"playwright": "^1.58.2",
|
||||||
|
"typescript": "catalog:",
|
||||||
|
"vite": "^7.2.0",
|
||||||
|
"vitest": "catalog:",
|
||||||
|
"vitest-browser-react": "^2.0.5",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"catalog": {
|
||||||
|
"@effect/atom-react": "4.0.0-beta.27",
|
||||||
|
"@effect/platform-node": "4.0.0-beta.27",
|
||||||
|
"@effect/sql-sqlite-node": "4.0.0-beta.27",
|
||||||
|
"@effect/vitest": "4.0.0-beta.27",
|
||||||
|
"effect": "4.0.0-beta.27",
|
||||||
|
"typescript": "6.0.0-beta",
|
||||||
|
"vitest": "^4.0.18",
|
||||||
|
},
|
||||||
|
"packages": {
|
||||||
|
"@babel/code-frame": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
|
||||||
|
|
||||||
|
"@babel/compat-data": ["@babel/[email protected]", "", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="],
|
||||||
|
|
||||||
|
"@babel/core": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-compilation-targets": "^7.28.6", "@babel/helper-module-transforms": "^7.28.6", "@babel/helpers": "^7.28.6", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA=="],
|
||||||
|
|
||||||
|
"@babel/generator": ["@babel/[email protected]", "", { "dependencies": { "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw=="],
|
||||||
|
|
||||||
|
"@babel/helper-compilation-targets": ["@babel/[email protected]", "", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA=="],
|
||||||
|
|
||||||
|
"@babel/helper-globals": ["@babel/[email protected]", "", {}, "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="],
|
||||||
|
|
||||||
|
"@babel/helper-module-imports": ["@babel/[email protected]", "", { "dependencies": { "@babel/traverse": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw=="],
|
||||||
|
|
||||||
|
"@babel/helper-module-transforms": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-module-imports": "^7.28.6", "@babel/helper-validator-identifier": "^7.28.5", "@babel/traverse": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA=="],
|
||||||
|
|
||||||
|
"@babel/helper-plugin-utils": ["@babel/[email protected]", "", {}, "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug=="],
|
||||||
|
|
||||||
|
"@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="],
|
||||||
|
|
||||||
|
"@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="],
|
||||||
|
|
||||||
|
"@babel/helper-validator-option": ["@babel/[email protected]", "", {}, "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="],
|
||||||
|
|
||||||
|
"@babel/helpers": ["@babel/[email protected]", "", { "dependencies": { "@babel/template": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw=="],
|
||||||
|
|
||||||
|
"@babel/parser": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="],
|
||||||
|
|
||||||
|
"@babel/plugin-syntax-jsx": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w=="],
|
||||||
|
|
||||||
|
"@babel/plugin-syntax-typescript": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A=="],
|
||||||
|
|
||||||
|
"@babel/plugin-transform-react-jsx-self": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw=="],
|
||||||
|
|
||||||
|
"@babel/plugin-transform-react-jsx-source": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw=="],
|
||||||
|
|
||||||
|
"@babel/template": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/parser": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ=="],
|
||||||
|
|
||||||
|
"@babel/traverse": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/types": "^7.29.0", "debug": "^4.3.1" } }, "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA=="],
|
||||||
|
|
||||||
|
"@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="],
|
||||||
|
|
||||||
|
"@effect-http-ws-cli/server": ["@effect-http-ws-cli/server@workspace:server"],
|
||||||
|
|
||||||
|
"@effect-http-ws-cli/web": ["@effect-http-ws-cli/web@workspace:web"],
|
||||||
|
|
||||||
|
"@effect/atom-react": ["@effect/[email protected]", "", { "peerDependencies": { "effect": "^4.0.0-beta.27", "react": "^19.2.4", "scheduler": "*" } }, "sha512-miq9lG74I9ypFdDTUIYWQR2OomxDweYM4Fv/h/Md0eXVrk+c/KAkgK0YT5pn3x5plZUHSuSuBEC36185/zpFPA=="],
|
||||||
|
|
||||||
|
"@effect/platform-node": ["@effect/[email protected]", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-beta.27", "mime": "^4.1.0", "undici": "^7.20.0" }, "peerDependencies": { "effect": "^4.0.0-beta.27", "ioredis": "^5.7.0" } }, "sha512-UPZMtFVnDIM5nb6A2pEPo229VnfgMdvl/9sGiQaYRB9qEVHerk0elxcoWOb2szoivBYePYFOsPKIWpR6jCldtQ=="],
|
||||||
|
|
||||||
|
"@effect/platform-node-shared": ["@effect/[email protected]", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.19.0" }, "peerDependencies": { "effect": "^4.0.0-beta.27" } }, "sha512-prRa5MIWGAvq2g6FgVP5RFfPwI+DvcXCaEZetvPMK70wdkTR1+jKQqJ9QDKWNIP+2d4llE/cF21SvcpBJWq0gw=="],
|
||||||
|
|
||||||
|
"@effect/sql-sqlite-node": ["@effect/[email protected]", "", { "dependencies": { "better-sqlite3": "^12.6.2" }, "peerDependencies": { "effect": "^4.0.0-beta.27" } }, "sha512-GhTe2gIob7wuQ7OYHM+FtjPhYhf0oFtImPWwaXdQ14kxCSQVFuHY+ll45p2bxTAInnrnDip+Q+UC6xpNnvI3Cw=="],
|
||||||
|
|
||||||
|
"@effect/vitest": ["@effect/[email protected]", "", { "peerDependencies": { "effect": "^4.0.0-beta.27", "vitest": "^3.0.0 || ^4.0.0" } }, "sha512-l9LIQK2yqOF3h47CmlT2VfYWtfHLd+ZuMzma+w0OjxmPsR6bzYMA33ft4gljJ/lEQnXvGHxiTpnZySALCfv+pA=="],
|
||||||
|
|
||||||
|
"@esbuild/aix-ppc64": ["@esbuild/[email protected]", "", { "os": "aix", "cpu": "ppc64" }, "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg=="],
|
||||||
|
|
||||||
|
"@esbuild/android-arm": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA=="],
|
||||||
|
|
||||||
|
"@esbuild/android-arm64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg=="],
|
||||||
|
|
||||||
|
"@esbuild/android-x64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "x64" }, "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ=="],
|
||||||
|
|
||||||
|
"@esbuild/darwin-arm64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg=="],
|
||||||
|
|
||||||
|
"@esbuild/darwin-x64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg=="],
|
||||||
|
|
||||||
|
"@esbuild/freebsd-arm64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w=="],
|
||||||
|
|
||||||
|
"@esbuild/freebsd-x64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-arm": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-arm64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-ia32": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ia32" }, "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-loong64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-mips64el": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-ppc64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-riscv64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-s390x": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-x64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA=="],
|
||||||
|
|
||||||
|
"@esbuild/netbsd-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA=="],
|
||||||
|
|
||||||
|
"@esbuild/netbsd-x64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "x64" }, "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA=="],
|
||||||
|
|
||||||
|
"@esbuild/openbsd-arm64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw=="],
|
||||||
|
|
||||||
|
"@esbuild/openbsd-x64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ=="],
|
||||||
|
|
||||||
|
"@esbuild/openharmony-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g=="],
|
||||||
|
|
||||||
|
"@esbuild/sunos-x64": ["@esbuild/[email protected]", "", { "os": "sunos", "cpu": "x64" }, "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA=="],
|
||||||
|
|
||||||
|
"@esbuild/win32-arm64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA=="],
|
||||||
|
|
||||||
|
"@esbuild/win32-ia32": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q=="],
|
||||||
|
|
||||||
|
"@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA=="],
|
||||||
|
|
||||||
|
"@ioredis/commands": ["@ioredis/[email protected]", "", {}, "sha512-JH8ZL/ywcJyR9MmJ5BNqZllXNZQqQbnVZOqpPQqE1vHiFgAw4NHbvE0FOduNU8IX9babitBT46571OnPTT0Zcw=="],
|
||||||
|
|
||||||
|
"@jridgewell/gen-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
|
||||||
|
|
||||||
|
"@jridgewell/remapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
|
||||||
|
|
||||||
|
"@jridgewell/resolve-uri": ["@jridgewell/[email protected]", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
|
||||||
|
|
||||||
|
"@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
|
||||||
|
|
||||||
|
"@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
|
||||||
|
|
||||||
|
"@msgpackr-extract/msgpackr-extract-darwin-arm64": ["@msgpackr-extract/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw=="],
|
||||||
|
|
||||||
|
"@msgpackr-extract/msgpackr-extract-darwin-x64": ["@msgpackr-extract/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw=="],
|
||||||
|
|
||||||
|
"@msgpackr-extract/msgpackr-extract-linux-arm": ["@msgpackr-extract/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw=="],
|
||||||
|
|
||||||
|
"@msgpackr-extract/msgpackr-extract-linux-arm64": ["@msgpackr-extract/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg=="],
|
||||||
|
|
||||||
|
"@msgpackr-extract/msgpackr-extract-linux-x64": ["@msgpackr-extract/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg=="],
|
||||||
|
|
||||||
|
"@msgpackr-extract/msgpackr-extract-win32-x64": ["@msgpackr-extract/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ=="],
|
||||||
|
|
||||||
|
"@polka/url": ["@polka/[email protected]", "", {}, "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww=="],
|
||||||
|
|
||||||
|
"@rolldown/pluginutils": ["@rolldown/[email protected]", "", {}, "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-android-arm-eabi": ["@rollup/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-android-arm64": ["@rollup/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-darwin-arm64": ["@rollup/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-darwin-x64": ["@rollup/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-freebsd-arm64": ["@rollup/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-freebsd-x64": ["@rollup/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-arm-gnueabihf": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-arm-musleabihf": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-arm64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-arm64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-loong64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-loong64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-ppc64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-ppc64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-riscv64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-riscv64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-s390x-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-x64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-x64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-openbsd-x64": ["@rollup/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-openharmony-arm64": ["@rollup/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-win32-arm64-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-win32-ia32-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-win32-x64-gnu": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA=="],
|
||||||
|
|
||||||
|
"@rollup/rollup-win32-x64-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA=="],
|
||||||
|
|
||||||
|
"@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],
|
||||||
|
|
||||||
|
"@tanstack/history": ["@tanstack/[email protected]", "", {}, "sha512-Kp/WSt411ZWYvgXy6uiv5RmhHrz9cAml05AQPrtdAp7eUqvIDbMGPnML25OKbzR3RJ1q4wgENxDTvlGPa9+Mww=="],
|
||||||
|
|
||||||
|
"@tanstack/react-router": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/history": "1.161.4", "@tanstack/react-store": "^0.9.1", "@tanstack/router-core": "1.166.2", "isbot": "^5.1.22", "tiny-invariant": "^1.3.3", "tiny-warning": "^1.0.3" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" } }, "sha512-pKhUtrvVLlhjWhsHkJSuIzh1J4LcP+8ErbIqRLORX9Js8dUFMKoT0+8oFpi+P8QRpuhm/7rzjYiWfcyTsqQZtA=="],
|
||||||
|
|
||||||
|
"@tanstack/react-store": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/store": "0.9.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-YzJLnRvy5lIEFTLWBAZmcOjK3+2AepnBv/sr6NZmiqJvq7zTQggyK99Gw8fqYdMdHPQWXjz0epFKJXC+9V2xDA=="],
|
||||||
|
|
||||||
|
"@tanstack/router-core": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/history": "1.161.4", "@tanstack/store": "^0.9.1", "cookie-es": "^2.0.0", "seroval": "^1.4.2", "seroval-plugins": "^1.4.2", "tiny-invariant": "^1.3.3", "tiny-warning": "^1.0.3" } }, "sha512-zn3NhENOAX9ToQiX077UV2OH3aJKOvV2ZMNZZxZ3gDG3i3WqL8NfWfEgetEAfMN37/Mnt90PpotYgf7IyuoKqQ=="],
|
||||||
|
|
||||||
|
"@tanstack/router-generator": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/router-core": "1.166.2", "@tanstack/router-utils": "1.161.4", "@tanstack/virtual-file-routes": "1.161.4", "prettier": "^3.5.0", "recast": "^0.23.11", "source-map": "^0.7.4", "tsx": "^4.19.2", "zod": "^3.24.2" } }, "sha512-wbvdyP1PKKQKk4aVlGeK9S5uDy8zodTr3tEZ2gRKNavJLusXbEWqtoo42JxHFFNB6dtguehFMt8PyZPAtkgWwQ=="],
|
||||||
|
|
||||||
|
"@tanstack/router-plugin": ["@tanstack/[email protected]", "", { "dependencies": { "@babel/core": "^7.28.5", "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1", "@babel/template": "^7.27.2", "@babel/traverse": "^7.28.5", "@babel/types": "^7.28.5", "@tanstack/router-core": "1.166.2", "@tanstack/router-generator": "1.166.2", "@tanstack/router-utils": "1.161.4", "@tanstack/virtual-file-routes": "1.161.4", "chokidar": "^3.6.0", "unplugin": "^2.1.2", "zod": "^3.24.2" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2", "@tanstack/react-router": "^1.166.2", "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0", "vite-plugin-solid": "^2.11.10", "webpack": ">=5.92.0" }, "optionalPeers": ["@rsbuild/core", "@tanstack/react-router", "vite", "vite-plugin-solid", "webpack"] }, "sha512-TnyV/7//Vp5fR49mmNbOWHGz9IJTm1lqVxzPdtpzg7D5PjkW2HFmLFLtWwpJgz2R7AJJWR4Ge5kIPmC+fVZ6eQ=="],
|
||||||
|
|
||||||
|
"@tanstack/router-utils": ["@tanstack/[email protected]", "", { "dependencies": { "@babel/core": "^7.28.5", "@babel/generator": "^7.28.5", "@babel/parser": "^7.28.5", "@babel/types": "^7.28.5", "ansis": "^4.1.0", "babel-dead-code-elimination": "^1.0.12", "diff": "^8.0.2", "pathe": "^2.0.3", "tinyglobby": "^0.2.15" } }, "sha512-r8TpjyIZoqrXXaf2DDyjd44gjGBoyE+/oEaaH68yLI9ySPO1gUWmQENZ1MZnmBnpUGN24NOZxdjDLc8npK0SAw=="],
|
||||||
|
|
||||||
|
"@tanstack/store": ["@tanstack/[email protected]", "", {}, "sha512-+qcNkOy0N1qSGsP7omVCW0SDrXtaDcycPqBDE726yryiA5eTDFpjBReaYjghVJwNf1pcPMyzIwTGlYjCSQR0Fg=="],
|
||||||
|
|
||||||
|
"@tanstack/virtual-file-routes": ["@tanstack/[email protected]", "", {}, "sha512-42WoRePf8v690qG8yGRe/YOh+oHni9vUaUUfoqlS91U2scd3a5rkLtVsc6b7z60w3RogH0I00vdrC5AaeiZ18w=="],
|
||||||
|
|
||||||
|
"@types/babel__core": ["@types/[email protected]", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
|
||||||
|
|
||||||
|
"@types/babel__generator": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="],
|
||||||
|
|
||||||
|
"@types/babel__template": ["@types/[email protected]", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="],
|
||||||
|
|
||||||
|
"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],
|
||||||
|
|
||||||
|
"@types/chai": ["@types/[email protected]", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],
|
||||||
|
|
||||||
|
"@types/deep-eql": ["@types/[email protected]", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="],
|
||||||
|
|
||||||
|
"@types/estree": ["@types/[email protected]", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
|
||||||
|
|
||||||
|
"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-fPxQqz4VTgPI/IQ+lj9r0h+fDR66bzoeMGHp8ASee+32OSGIkeASsoZuJixsQoVef1QJbeubcPBxKk22QVoWdw=="],
|
||||||
|
|
||||||
|
"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="],
|
||||||
|
|
||||||
|
"@types/react-dom": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],
|
||||||
|
|
||||||
|
"@types/ws": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
|
||||||
|
|
||||||
|
"@vitejs/plugin-react": ["@vitejs/[email protected]", "", { "dependencies": { "@babel/core": "^7.29.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-rc.3", "@types/babel__core": "^7.20.5", "react-refresh": "^0.18.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA=="],
|
||||||
|
|
||||||
|
"@vitest/browser": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/mocker": "4.0.18", "@vitest/utils": "4.0.18", "magic-string": "^0.30.21", "pixelmatch": "7.1.0", "pngjs": "^7.0.0", "sirv": "^3.0.2", "tinyrainbow": "^3.0.3", "ws": "^8.18.3" }, "peerDependencies": { "vitest": "4.0.18" } }, "sha512-gVQqh7paBz3gC+ZdcCmNSWJMk70IUjDeVqi+5m5vYpEHsIwRgw3Y545jljtajhkekIpIp5Gg8oK7bctgY0E2Ng=="],
|
||||||
|
|
||||||
|
"@vitest/browser-playwright": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/browser": "4.0.18", "@vitest/mocker": "4.0.18", "tinyrainbow": "^3.0.3" }, "peerDependencies": { "playwright": "*", "vitest": "4.0.18" } }, "sha512-gfajTHVCiwpxRj1qh0Sh/5bbGLG4F/ZH/V9xvFVoFddpITfMta9YGow0W6ZpTTORv2vdJuz9TnrNSmjKvpOf4g=="],
|
||||||
|
|
||||||
|
"@vitest/expect": ["@vitest/[email protected]", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.0.18", "@vitest/utils": "4.0.18", "chai": "^6.2.1", "tinyrainbow": "^3.0.3" } }, "sha512-8sCWUyckXXYvx4opfzVY03EOiYVxyNrHS5QxX3DAIi5dpJAAkyJezHCP77VMX4HKA2LDT/Jpfo8i2r5BE3GnQQ=="],
|
||||||
|
|
||||||
|
"@vitest/mocker": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/spy": "4.0.18", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw"] }, "sha512-HhVd0MDnzzsgevnOWCBj5Otnzobjy5wLBe4EdeeFGv8luMsGcYqDuFRMcttKWZA5vVO8RFjexVovXvAM4JoJDQ=="],
|
||||||
|
|
||||||
|
"@vitest/pretty-format": ["@vitest/[email protected]", "", { "dependencies": { "tinyrainbow": "^3.0.3" } }, "sha512-P24GK3GulZWC5tz87ux0m8OADrQIUVDPIjjj65vBXYG17ZeU3qD7r+MNZ1RNv4l8CGU2vtTRqixrOi9fYk/yKw=="],
|
||||||
|
|
||||||
|
"@vitest/runner": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/utils": "4.0.18", "pathe": "^2.0.3" } }, "sha512-rpk9y12PGa22Jg6g5M3UVVnTS7+zycIGk9ZNGN+m6tZHKQb7jrP7/77WfZy13Y/EUDd52NDsLRQhYKtv7XfPQw=="],
|
||||||
|
|
||||||
|
"@vitest/snapshot": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/pretty-format": "4.0.18", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-PCiV0rcl7jKQjbgYqjtakly6T1uwv/5BQ9SwBLekVg/EaYeQFPiXcgrC2Y7vDMA8dM1SUEAEV82kgSQIlXNMvA=="],
|
||||||
|
|
||||||
|
"@vitest/spy": ["@vitest/[email protected]", "", {}, "sha512-cbQt3PTSD7P2OARdVW3qWER5EGq7PHlvE+QfzSC0lbwO+xnt7+XH06ZzFjFRgzUX//JmpxrCu92VdwvEPlWSNw=="],
|
||||||
|
|
||||||
|
"@vitest/utils": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/pretty-format": "4.0.18", "tinyrainbow": "^3.0.3" } }, "sha512-msMRKLMVLWygpK3u2Hybgi4MNjcYJvwTb0Ru09+fOyCXIgT5raYP041DRRdiJiI3k/2U6SEbAETB3YtBrUkCFA=="],
|
||||||
|
|
||||||
|
"acorn": ["[email protected]", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
|
||||||
|
|
||||||
|
"ansis": ["[email protected]", "", {}, "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig=="],
|
||||||
|
|
||||||
|
"anymatch": ["[email protected]", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="],
|
||||||
|
|
||||||
|
"assertion-error": ["[email protected]", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="],
|
||||||
|
|
||||||
|
"ast-types": ["[email protected]", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg=="],
|
||||||
|
|
||||||
|
"babel-dead-code-elimination": ["[email protected]", "", { "dependencies": { "@babel/core": "^7.23.7", "@babel/parser": "^7.23.6", "@babel/traverse": "^7.23.7", "@babel/types": "^7.23.6" } }, "sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig=="],
|
||||||
|
|
||||||
|
"base64-js": ["[email protected]", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
|
||||||
|
|
||||||
|
"baseline-browser-mapping": ["[email protected]", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA=="],
|
||||||
|
|
||||||
|
"better-sqlite3": ["[email protected]", "", { "dependencies": { "bindings": "^1.5.0", "prebuild-install": "^7.1.1" } }, "sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA=="],
|
||||||
|
|
||||||
|
"binary-extensions": ["[email protected]", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="],
|
||||||
|
|
||||||
|
"bindings": ["[email protected]", "", { "dependencies": { "file-uri-to-path": "1.0.0" } }, "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ=="],
|
||||||
|
|
||||||
|
"bl": ["[email protected]", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="],
|
||||||
|
|
||||||
|
"braces": ["[email protected]", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
|
||||||
|
|
||||||
|
"browserslist": ["[email protected]", "", { "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", "electron-to-chromium": "^1.5.263", "node-releases": "^2.0.27", "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA=="],
|
||||||
|
|
||||||
|
"buffer": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
|
||||||
|
|
||||||
|
"caniuse-lite": ["[email protected]", "", {}, "sha512-sg01JDPzZ9jGshqKSckOQthXnYwOEP50jeVFhaSFbZcOy05TiuuaffDOfcwtCisJ9kNQuLBFibYywv2Bgm9osw=="],
|
||||||
|
|
||||||
|
"chai": ["[email protected]", "", {}, "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg=="],
|
||||||
|
|
||||||
|
"chokidar": ["[email protected]", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="],
|
||||||
|
|
||||||
|
"chownr": ["[email protected]", "", {}, "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="],
|
||||||
|
|
||||||
|
"cluster-key-slot": ["[email protected]", "", {}, "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA=="],
|
||||||
|
|
||||||
|
"convert-source-map": ["[email protected]", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
|
||||||
|
|
||||||
|
"cookie-es": ["[email protected]", "", {}, "sha512-RAj4E421UYRgqokKUmotqAwuplYw15qtdXfY+hGzgCJ/MBjCVZcSoHK/kH9kocfjRjcDME7IiDWR/1WX1TM2Pg=="],
|
||||||
|
|
||||||
|
"csstype": ["[email protected]", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
|
||||||
|
|
||||||
|
"debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||||
|
|
||||||
|
"decompress-response": ["[email protected]", "", { "dependencies": { "mimic-response": "^3.1.0" } }, "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ=="],
|
||||||
|
|
||||||
|
"deep-extend": ["[email protected]", "", {}, "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="],
|
||||||
|
|
||||||
|
"denque": ["[email protected]", "", {}, "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw=="],
|
||||||
|
|
||||||
|
"detect-libc": ["[email protected]", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
|
||||||
|
|
||||||
|
"diff": ["[email protected]", "", {}, "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ=="],
|
||||||
|
|
||||||
|
"effect": ["[email protected]", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "fast-check": "^4.5.3", "find-my-way-ts": "^0.1.6", "ini": "^6.0.0", "kubernetes-types": "^1.30.0", "msgpackr": "^1.11.8", "multipasta": "^0.2.7", "toml": "^3.0.0", "uuid": "^13.0.0", "yaml": "^2.8.2" } }, "sha512-bNQEF3vaVGF8jAJ+HW1A4DaxVNmujgEu89sO+VNW1AvUYtPGMtKPTBU15K9inu1rG+hkxNFFRlVvLAJsdaE2mg=="],
|
||||||
|
|
||||||
|
"electron-to-chromium": ["[email protected]", "", {}, "sha512-5z3uFKBWjiNR44nFcYdkcXjKMbg5KXNdciu7mhTPo9tB7NbqSNP2sSnGR+fqknZSCwKkBN+oxiiajWs4dT6ORg=="],
|
||||||
|
|
||||||
|
"end-of-stream": ["[email protected]", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
|
||||||
|
|
||||||
|
"es-module-lexer": ["[email protected]", "", {}, "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA=="],
|
||||||
|
|
||||||
|
"esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.27.3", "@esbuild/android-arm": "0.27.3", "@esbuild/android-arm64": "0.27.3", "@esbuild/android-x64": "0.27.3", "@esbuild/darwin-arm64": "0.27.3", "@esbuild/darwin-x64": "0.27.3", "@esbuild/freebsd-arm64": "0.27.3", "@esbuild/freebsd-x64": "0.27.3", "@esbuild/linux-arm": "0.27.3", "@esbuild/linux-arm64": "0.27.3", "@esbuild/linux-ia32": "0.27.3", "@esbuild/linux-loong64": "0.27.3", "@esbuild/linux-mips64el": "0.27.3", "@esbuild/linux-ppc64": "0.27.3", "@esbuild/linux-riscv64": "0.27.3", "@esbuild/linux-s390x": "0.27.3", "@esbuild/linux-x64": "0.27.3", "@esbuild/netbsd-arm64": "0.27.3", "@esbuild/netbsd-x64": "0.27.3", "@esbuild/openbsd-arm64": "0.27.3", "@esbuild/openbsd-x64": "0.27.3", "@esbuild/openharmony-arm64": "0.27.3", "@esbuild/sunos-x64": "0.27.3", "@esbuild/win32-arm64": "0.27.3", "@esbuild/win32-ia32": "0.27.3", "@esbuild/win32-x64": "0.27.3" }, "bin": "bin/esbuild" }, "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg=="],
|
||||||
|
|
||||||
|
"escalade": ["[email protected]", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
|
||||||
|
|
||||||
|
"esprima": ["[email protected]", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="],
|
||||||
|
|
||||||
|
"estree-walker": ["[email protected]", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="],
|
||||||
|
|
||||||
|
"expand-template": ["[email protected]", "", {}, "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="],
|
||||||
|
|
||||||
|
"expect-type": ["[email protected]", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="],
|
||||||
|
|
||||||
|
"fast-check": ["[email protected]", "", { "dependencies": { "pure-rand": "^7.0.0" } }, "sha512-IE9csY7lnhxBnA8g/WI5eg/hygA6MGWJMSNfFRrBlXUciADEhS1EDB0SIsMSvzubzIlOBbVITSsypCsW717poA=="],
|
||||||
|
|
||||||
|
"fdir": ["[email protected]", "", { "peerDependencies": { "picomatch": "^3 || ^4" } }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
|
||||||
|
|
||||||
|
"file-uri-to-path": ["[email protected]", "", {}, "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="],
|
||||||
|
|
||||||
|
"fill-range": ["[email protected]", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
|
||||||
|
|
||||||
|
"find-my-way-ts": ["[email protected]", "", {}, "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA=="],
|
||||||
|
|
||||||
|
"fs-constants": ["[email protected]", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="],
|
||||||
|
|
||||||
|
"fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="],
|
||||||
|
|
||||||
|
"gensync": ["[email protected]", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
|
||||||
|
|
||||||
|
"get-tsconfig": ["[email protected]", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw=="],
|
||||||
|
|
||||||
|
"github-from-package": ["[email protected]", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="],
|
||||||
|
|
||||||
|
"glob-parent": ["[email protected]", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
|
||||||
|
|
||||||
|
"ieee754": ["[email protected]", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
|
||||||
|
|
||||||
|
"inherits": ["[email protected]", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
||||||
|
|
||||||
|
"ini": ["[email protected]", "", {}, "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ=="],
|
||||||
|
|
||||||
|
"ioredis": ["[email protected]", "", { "dependencies": { "@ioredis/commands": "1.5.1", "cluster-key-slot": "^1.1.0", "debug": "^4.3.4", "denque": "^2.1.0", "lodash.defaults": "^4.2.0", "lodash.isarguments": "^3.1.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0", "standard-as-callback": "^2.1.0" } }, "sha512-HVBe9OFuqs+Z6n64q09PQvP1/R4Bm+30PAyyD4wIEqssh3v9L21QjCVk4kRLucMBcDokJTcLjsGeVRlq/nH6DA=="],
|
||||||
|
|
||||||
|
"is-binary-path": ["[email protected]", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="],
|
||||||
|
|
||||||
|
"is-extglob": ["[email protected]", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],
|
||||||
|
|
||||||
|
"is-glob": ["[email protected]", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],
|
||||||
|
|
||||||
|
"is-number": ["[email protected]", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],
|
||||||
|
|
||||||
|
"isbot": ["[email protected]", "", {}, "sha512-waFfC72ZNfwLLuJ2iLaoVaqcNo+CAaLR7xCpAn0Y5WfGzkNHv7ZN39Vbi1y+kb+Zs46XHOX3tZNExroFUPX+Kg=="],
|
||||||
|
|
||||||
|
"js-tokens": ["[email protected]", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
|
||||||
|
|
||||||
|
"jsesc": ["[email protected]", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
|
||||||
|
|
||||||
|
"json5": ["[email protected]", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
|
||||||
|
|
||||||
|
"kubernetes-types": ["[email protected]", "", {}, "sha512-Dew1okvhM/SQcIa2rcgujNndZwU8VnSapDgdxlYoB84ZlpAD43U6KLAFqYo17ykSFGHNPrg0qry0bP+GJd9v7Q=="],
|
||||||
|
|
||||||
|
"lodash.defaults": ["[email protected]", "", {}, "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ=="],
|
||||||
|
|
||||||
|
"lodash.isarguments": ["[email protected]", "", {}, "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg=="],
|
||||||
|
|
||||||
|
"lru-cache": ["[email protected]", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],
|
||||||
|
|
||||||
|
"magic-string": ["[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
|
||||||
|
|
||||||
|
"mime": ["[email protected]", "", { "bin": "bin/cli.js" }, "sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw=="],
|
||||||
|
|
||||||
|
"mimic-response": ["[email protected]", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="],
|
||||||
|
|
||||||
|
"minimist": ["[email protected]", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
|
||||||
|
|
||||||
|
"mkdirp-classic": ["[email protected]", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="],
|
||||||
|
|
||||||
|
"mrmime": ["[email protected]", "", {}, "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ=="],
|
||||||
|
|
||||||
|
"ms": ["[email protected]", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||||
|
|
||||||
|
"msgpackr": ["[email protected]", "", { "optionalDependencies": { "msgpackr-extract": "^3.0.2" } }, "sha512-bC4UGzHhVvgDNS7kn9tV8fAucIYUBuGojcaLiz7v+P63Lmtm0Xeji8B/8tYKddALXxJLpwIeBmUN3u64C4YkRA=="],
|
||||||
|
|
||||||
|
"msgpackr-extract": ["[email protected]", "", { "dependencies": { "node-gyp-build-optional-packages": "5.2.2" }, "optionalDependencies": { "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3", "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3", "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3", "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3", "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3", "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3" }, "bin": { "download-msgpackr-prebuilds": "bin/download-prebuilds.js" } }, "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA=="],
|
||||||
|
|
||||||
|
"multipasta": ["[email protected]", "", {}, "sha512-KPA58d68KgGil15oDqXjkUBEBYc00XvbPj5/X+dyzeo/lWm9Nc25pQRlf1D+gv4OpK7NM0J1odrbu9JNNGvynA=="],
|
||||||
|
|
||||||
|
"nanoid": ["[email protected]", "", { "bin": "bin/nanoid.cjs" }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
|
||||||
|
|
||||||
|
"napi-build-utils": ["[email protected]", "", {}, "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA=="],
|
||||||
|
|
||||||
|
"node-abi": ["[email protected]", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ=="],
|
||||||
|
|
||||||
|
"node-gyp-build-optional-packages": ["[email protected]", "", { "dependencies": { "detect-libc": "^2.0.1" }, "bin": { "node-gyp-build-optional-packages": "bin.js", "node-gyp-build-optional-packages-optional": "optional.js", "node-gyp-build-optional-packages-test": "build-test.js" } }, "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw=="],
|
||||||
|
|
||||||
|
"node-releases": ["[email protected]", "", {}, "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA=="],
|
||||||
|
|
||||||
|
"normalize-path": ["[email protected]", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="],
|
||||||
|
|
||||||
|
"obug": ["[email protected]", "", {}, "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ=="],
|
||||||
|
|
||||||
|
"once": ["[email protected]", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],
|
||||||
|
|
||||||
|
"pathe": ["[email protected]", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
||||||
|
|
||||||
|
"picocolors": ["[email protected]", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
||||||
|
|
||||||
|
"picomatch": ["[email protected]", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
|
||||||
|
|
||||||
|
"pixelmatch": ["[email protected]", "", { "dependencies": { "pngjs": "^7.0.0" }, "bin": { "pixelmatch": "bin/pixelmatch" } }, "sha512-1wrVzJ2STrpmONHKBy228LM1b84msXDUoAzVEl0R8Mz4Ce6EPr+IVtxm8+yvrqLYMHswREkjYFaMxnyGnaY3Ng=="],
|
||||||
|
|
||||||
|
"playwright": ["[email protected]", "", { "dependencies": { "playwright-core": "1.58.2" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A=="],
|
||||||
|
|
||||||
|
"playwright-core": ["[email protected]", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg=="],
|
||||||
|
|
||||||
|
"pngjs": ["[email protected]", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="],
|
||||||
|
|
||||||
|
"postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg=="],
|
||||||
|
|
||||||
|
"prebuild-install": ["[email protected]", "", { "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", "napi-build-utils": "^2.0.0", "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^4.0.0", "tar-fs": "^2.0.0", "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" } }, "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug=="],
|
||||||
|
|
||||||
|
"prettier": ["[email protected]", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="],
|
||||||
|
|
||||||
|
"pump": ["[email protected]", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="],
|
||||||
|
|
||||||
|
"pure-rand": ["[email protected]", "", {}, "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ=="],
|
||||||
|
|
||||||
|
"rc": ["[email protected]", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="],
|
||||||
|
|
||||||
|
"react": ["[email protected]", "", {}, "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ=="],
|
||||||
|
|
||||||
|
"react-dom": ["[email protected]", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.4" } }, "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ=="],
|
||||||
|
|
||||||
|
"react-refresh": ["[email protected]", "", {}, "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw=="],
|
||||||
|
|
||||||
|
"readable-stream": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
|
||||||
|
|
||||||
|
"readdirp": ["[email protected]", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="],
|
||||||
|
|
||||||
|
"recast": ["[email protected]", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA=="],
|
||||||
|
|
||||||
|
"redis-errors": ["[email protected]", "", {}, "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w=="],
|
||||||
|
|
||||||
|
"redis-parser": ["[email protected]", "", { "dependencies": { "redis-errors": "^1.0.0" } }, "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A=="],
|
||||||
|
|
||||||
|
"resolve-pkg-maps": ["[email protected]", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="],
|
||||||
|
|
||||||
|
"rollup": ["[email protected]", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.59.0", "@rollup/rollup-android-arm64": "4.59.0", "@rollup/rollup-darwin-arm64": "4.59.0", "@rollup/rollup-darwin-x64": "4.59.0", "@rollup/rollup-freebsd-arm64": "4.59.0", "@rollup/rollup-freebsd-x64": "4.59.0", "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", "@rollup/rollup-linux-arm-musleabihf": "4.59.0", "@rollup/rollup-linux-arm64-gnu": "4.59.0", "@rollup/rollup-linux-arm64-musl": "4.59.0", "@rollup/rollup-linux-loong64-gnu": "4.59.0", "@rollup/rollup-linux-loong64-musl": "4.59.0", "@rollup/rollup-linux-ppc64-gnu": "4.59.0", "@rollup/rollup-linux-ppc64-musl": "4.59.0", "@rollup/rollup-linux-riscv64-gnu": "4.59.0", "@rollup/rollup-linux-riscv64-musl": "4.59.0", "@rollup/rollup-linux-s390x-gnu": "4.59.0", "@rollup/rollup-linux-x64-gnu": "4.59.0", "@rollup/rollup-linux-x64-musl": "4.59.0", "@rollup/rollup-openbsd-x64": "4.59.0", "@rollup/rollup-openharmony-arm64": "4.59.0", "@rollup/rollup-win32-arm64-msvc": "4.59.0", "@rollup/rollup-win32-ia32-msvc": "4.59.0", "@rollup/rollup-win32-x64-gnu": "4.59.0", "@rollup/rollup-win32-x64-msvc": "4.59.0", "fsevents": "~2.3.2" }, "bin": "dist/bin/rollup" }, "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg=="],
|
||||||
|
|
||||||
|
"safe-buffer": ["[email protected]", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
|
||||||
|
|
||||||
|
"scheduler": ["[email protected]", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],
|
||||||
|
|
||||||
|
"semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
|
||||||
|
|
||||||
|
"seroval": ["[email protected]", "", {}, "sha512-OE4cvmJ1uSPrKorFIH9/w/Qwuvi/IMcGbv5RKgcJ/zjA/IohDLU6SVaxFN9FwajbP7nsX0dQqMDes1whk3y+yw=="],
|
||||||
|
|
||||||
|
"seroval-plugins": ["[email protected]", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-EAHqADIQondwRZIdeW2I636zgsODzoBDwb3PT/+7TLDWyw1Dy/Xv7iGUIEXXav7usHDE9HVhOU61irI3EnyyHA=="],
|
||||||
|
|
||||||
|
"siginfo": ["[email protected]", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
|
||||||
|
|
||||||
|
"simple-concat": ["[email protected]", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="],
|
||||||
|
|
||||||
|
"simple-get": ["[email protected]", "", { "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA=="],
|
||||||
|
|
||||||
|
"sirv": ["[email protected]", "", { "dependencies": { "@polka/url": "^1.0.0-next.24", "mrmime": "^2.0.0", "totalist": "^3.0.0" } }, "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g=="],
|
||||||
|
|
||||||
|
"source-map": ["[email protected]", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="],
|
||||||
|
|
||||||
|
"source-map-js": ["[email protected]", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
|
||||||
|
|
||||||
|
"stackback": ["[email protected]", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="],
|
||||||
|
|
||||||
|
"standard-as-callback": ["[email protected]", "", {}, "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A=="],
|
||||||
|
|
||||||
|
"std-env": ["[email protected]", "", {}, "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg=="],
|
||||||
|
|
||||||
|
"string_decoder": ["[email protected]", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
|
||||||
|
|
||||||
|
"strip-json-comments": ["[email protected]", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="],
|
||||||
|
|
||||||
|
"tar-fs": ["[email protected]", "", { "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" } }, "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ=="],
|
||||||
|
|
||||||
|
"tar-stream": ["[email protected]", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="],
|
||||||
|
|
||||||
|
"tiny-invariant": ["[email protected]", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="],
|
||||||
|
|
||||||
|
"tiny-warning": ["[email protected]", "", {}, "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="],
|
||||||
|
|
||||||
|
"tinybench": ["[email protected]", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="],
|
||||||
|
|
||||||
|
"tinyexec": ["[email protected]", "", {}, "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg=="],
|
||||||
|
|
||||||
|
"tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
|
||||||
|
|
||||||
|
"tinyrainbow": ["[email protected]", "", {}, "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q=="],
|
||||||
|
|
||||||
|
"to-regex-range": ["[email protected]", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
|
||||||
|
|
||||||
|
"toml": ["[email protected]", "", {}, "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="],
|
||||||
|
|
||||||
|
"totalist": ["[email protected]", "", {}, "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ=="],
|
||||||
|
|
||||||
|
"tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||||
|
|
||||||
|
"tsx": ["[email protected]", "", { "dependencies": { "esbuild": "~0.27.0", "get-tsconfig": "^4.7.5" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "bin": "dist/cli.mjs" }, "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw=="],
|
||||||
|
|
||||||
|
"tunnel-agent": ["[email protected]", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w=="],
|
||||||
|
|
||||||
|
"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CldZdztDpQRLM1HC6WDQjQkQN5Ub5zRau737a1diGh3lPmb9oRsaWHk1y5iqK0o7+1bNJ0oXfEGRkAogFZBL+Q=="],
|
||||||
|
|
||||||
|
"undici": ["[email protected]", "", {}, "sha512-RqslV2Us5BrllB+JeiZnK4peryVTndy9Dnqq62S3yYRRTj0tFQCwEniUy2167skdGOy3vqRzEvl1Dm4sV2ReDg=="],
|
||||||
|
|
||||||
|
"undici-types": ["[email protected]", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
|
||||||
|
|
||||||
|
"unplugin": ["[email protected]", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "acorn": "^8.15.0", "picomatch": "^4.0.3", "webpack-virtual-modules": "^0.6.2" } }, "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww=="],
|
||||||
|
|
||||||
|
"update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
|
||||||
|
|
||||||
|
"use-sync-external-store": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="],
|
||||||
|
|
||||||
|
"util-deprecate": ["[email protected]", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
||||||
|
|
||||||
|
"uuid": ["[email protected]", "", { "bin": "dist-node/bin/uuid" }, "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w=="],
|
||||||
|
|
||||||
|
"vite": ["[email protected]", "", { "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser"], "bin": "bin/vite.js" }, "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA=="],
|
||||||
|
|
||||||
|
"vitest": ["[email protected]", "", { "dependencies": { "@vitest/expect": "4.0.18", "@vitest/mocker": "4.0.18", "@vitest/pretty-format": "4.0.18", "@vitest/runner": "4.0.18", "@vitest/snapshot": "4.0.18", "@vitest/spy": "4.0.18", "@vitest/utils": "4.0.18", "es-module-lexer": "^1.7.0", "expect-type": "^1.2.2", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^3.10.0", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.0.3", "vite": "^6.0.0 || ^7.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.0.18", "@vitest/browser-preview": "4.0.18", "@vitest/browser-webdriverio": "4.0.18", "@vitest/ui": "4.0.18", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/ui", "happy-dom", "jsdom"], "bin": "vitest.mjs" }, "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ=="],
|
||||||
|
|
||||||
|
"vitest-browser-react": ["[email protected]", "", { "peerDependencies": { "@types/react": "^18.0.0 || ^19.0.0", "@types/react-dom": "^18.0.0 || ^19.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", "vitest": "^4.0.0" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-YODQX8mHTJCyKNVYTWJrLEYrUtw+QfLl78owgvuE7C5ydgmGBq6v5s4jK2w6wdPhIZsN9PpV1rQbmAevWJjO9g=="],
|
||||||
|
|
||||||
|
"webpack-virtual-modules": ["[email protected]", "", {}, "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ=="],
|
||||||
|
|
||||||
|
"why-is-node-running": ["[email protected]", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": "cli.js" }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="],
|
||||||
|
|
||||||
|
"wrappy": ["[email protected]", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
|
||||||
|
|
||||||
|
"ws": ["[email protected]", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg=="],
|
||||||
|
|
||||||
|
"yallist": ["[email protected]", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
|
||||||
|
|
||||||
|
"yaml": ["[email protected]", "", { "bin": "bin.mjs" }, "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A=="],
|
||||||
|
|
||||||
|
"zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
|
||||||
|
|
||||||
|
"@types/ws/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-akNQMv0wW5uyRpD2v2IEyRSZiR+BeGuoB6L310EgGObO44HSMNT8z1xzio28V8qOrgYaopIDNA18YgdXd+qTiw=="],
|
||||||
|
|
||||||
|
"anymatch/picomatch": ["[email protected]", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
|
||||||
|
|
||||||
|
"chokidar/fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||||
|
|
||||||
|
"node-abi/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],
|
||||||
|
|
||||||
|
"rc/ini": ["[email protected]", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],
|
||||||
|
|
||||||
|
"readdirp/picomatch": ["[email protected]", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
|
||||||
|
|
||||||
|
"recast/source-map": ["[email protected]", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
|
||||||
|
|
||||||
|
"rollup/fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||||
|
|
||||||
|
"tsx/fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||||
|
|
||||||
|
"vite/fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||||
|
|
||||||
|
"@types/ws/@types/node/undici-types": ["[email protected]", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "effect-http-ws-cli",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"packageManager": "[email protected]",
|
||||||
|
"workspaces": {
|
||||||
|
"packages": ["server", "web"],
|
||||||
|
"catalog": {
|
||||||
|
"@effect/platform-node": "4.0.0-beta.27",
|
||||||
|
"@effect/sql-sqlite-node": "4.0.0-beta.27",
|
||||||
|
"@effect/atom-react": "4.0.0-beta.27",
|
||||||
|
"@effect/vitest": "4.0.0-beta.27",
|
||||||
|
"effect": "4.0.0-beta.27",
|
||||||
|
"typescript": "6.0.0-beta",
|
||||||
|
"vitest": "^4.0.18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "node scripts/dev.mjs",
|
||||||
|
"start": "node server/src/bin.ts",
|
||||||
|
"web:dev": "bun run --filter @effect-http-ws-cli/web dev",
|
||||||
|
"web:build": "bun run --filter @effect-http-ws-cli/web build",
|
||||||
|
"web:preview": "bun run --filter @effect-http-ws-cli/web preview",
|
||||||
|
"test": "bun run --filter @effect-http-ws-cli/server test",
|
||||||
|
"test:web": "bun run --filter @effect-http-ws-cli/web test",
|
||||||
|
"test:all": "bun run --sequential --workspaces test",
|
||||||
|
"lint": "bun run --sequential --workspaces lint"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
:root{--paper: #f3f0e8;--ink: #13222c;--ink-soft: #345264;--accent: #dc4f18;--accent-soft: #f8bb68;--panel: #fffdf6;--line: #162f3f22;--shadow: 0 16px 40px #0f1e291f}*{box-sizing:border-box}body{margin:0;min-height:100vh;font-family:IBM Plex Sans,Segoe UI,sans-serif;color:var(--ink);background:radial-gradient(circle at 10% 10%,#f7cf9a 0%,transparent 36%),radial-gradient(circle at 92% 88%,#95c7d2 0%,transparent 32%),linear-gradient(165deg,#ece8dc 0%,var(--paper) 48%,#e9dfcf 100%)}.shell{width:min(1100px,100% - 2rem);margin:1.5rem auto;padding:1.5rem;border:1px solid var(--line);border-radius:20px;background:color-mix(in oklab,var(--paper),white 35%);box-shadow:var(--shadow)}.hero{position:relative;overflow:hidden;padding:1.5rem;border-radius:16px;border:1px solid var(--line);background:linear-gradient(140deg,#fff9ed,#f7efe0 65%,#f2e7d4)}.hero:after{content:"";position:absolute;width:220px;height:220px;right:-60px;top:-90px;border-radius:999px;background:linear-gradient(180deg,var(--accent-soft),transparent 70%);pointer-events:none}.eyebrow{margin:0;font-size:.72rem;letter-spacing:.22em;text-transform:uppercase;color:var(--ink-soft)}h1,h2{font-family:Archivo Black,Impact,sans-serif;letter-spacing:.02em;margin:0}h1{margin-top:.35rem;font-size:clamp(1.5rem,4vw,2.35rem)}h2{font-size:1.1rem}.lead{margin:.6rem 0 0;color:var(--ink-soft);max-width:68ch}.panel{border:1px solid var(--line);border-radius:14px;padding:1rem;background:var(--panel);margin-top:1rem}.status-panel{margin-top:0;background:linear-gradient(140deg,#fbf7ee,#f1e8d7)}.status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}.status-item{border:1px solid var(--line);border-radius:10px;padding:.55rem .7rem;display:flex;justify-content:space-between;align-items:baseline;gap:.75rem;background:#fff}.status-label{color:var(--ink-soft);font-size:.82rem}.status-subscription-connected{border-color:#24704755;background:#f1fbf5}.status-subscription-connecting{border-color:#8d6a1b55;background:#fff8eb}.status-subscription-idle{border-color:var(--line)}.status-mutation-busy{border-color:#6b3b2e55;background:#fff3ef}.todo-header{display:flex;justify-content:space-between;align-items:baseline;gap:1rem}.meta{display:flex;gap:.75rem;color:var(--ink-soft);font-size:.86rem}.todo-list{margin:.8rem 0 0;padding:0;list-style:none;display:grid;gap:.6rem}.event-list{margin:.8rem 0 0;padding:0;list-style:none;display:grid;gap:.5rem;max-height:260px;overflow:auto}.event-item{border:1px solid var(--line);border-radius:10px;background:#fff;padding:.55rem .65rem}.event-top{display:flex;justify-content:space-between;gap:.6rem;color:var(--ink-soft);font-size:.8rem}.event-body{margin-top:.2rem;display:flex;justify-content:space-between;gap:.75rem;font-size:.9rem}.event-body small{color:var(--ink-soft);white-space:nowrap}.todo-item{display:flex;gap:.8rem;align-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;padding:.65rem}.todo-main{flex:1}.todo-main input{width:100%;margin:0;border:1px solid var(--line);background:#fff;border-radius:8px;padding:.42rem .55rem;color:var(--ink);font:inherit;font-weight:600}.todo-main small{display:block;margin-top:.3rem;color:var(--ink-soft)}.todo-actions{display:flex;gap:.45rem}button{border:1px solid #0f243233;border-radius:8px;background:linear-gradient(160deg,#fff,#f4efe3);color:var(--ink);padding:.4rem .6rem;font:inherit;font-size:.85rem;font-weight:700;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease}button:hover{transform:translateY(-1px);box-shadow:0 8px 18px #0f20321a}.todo-item.is-completed .todo-main input{text-decoration:line-through;color:var(--ink-soft)}.todo-item.is-archived{opacity:.64}.footer{margin-top:1rem;display:flex;gap:1rem;align-items:center;font-size:.88rem;color:var(--ink-soft)}.error{color:var(--accent);font-weight:700}@media(max-width:880px){.shell{width:min(1100px,100% - 1rem);padding:1rem}.todo-item{flex-direction:column;align-items:stretch}.todo-actions{justify-content:flex-end}.status-grid{grid-template-columns:1fr}}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function s(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(u){if(u.ep)return;u.ep=!0;const o=s(u);fetch(u.href,o)}})();function KR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zm={exports:{}},au={};var O1;function PR(){if(O1)return au;O1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(i,u,o){var d=null;if(o!==void 0&&(d=""+o),u.key!==void 0&&(d=""+u.key),"key"in u){o={};for(var h in u)h!=="key"&&(o[h]=u[h])}else o=u;return u=o.ref,{$$typeof:e,type:i,key:d,ref:u!==void 0?u:null,props:o}}return au.Fragment=n,au.jsx=s,au.jsxs=s,au}var R1;function XR(){return R1||(R1=1,Zm.exports=PR()),Zm.exports}var ee=XR(),Wm={exports:{}},ye={};var A1;function QR(){if(A1)return ye;A1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),v=Symbol.iterator;function _(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,j={};function B(w,G,re){this.props=w,this.context=G,this.refs=j,this.updater=re||x}B.prototype.isReactComponent={},B.prototype.setState=function(w,G){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,G,"setState")},B.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function M(){}M.prototype=B.prototype;function I(w,G,re){this.props=w,this.context=G,this.refs=j,this.updater=re||x}var z=I.prototype=new M;z.constructor=I,T(z,B.prototype),z.isPureReactComponent=!0;var W=Array.isArray;function H(){}var V={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function te(w,G,re){var ae=re.ref;return{$$typeof:e,type:w,key:G,ref:ae!==void 0?ae:null,props:re}}function fe(w,G){return te(w.type,G,w.props)}function oe(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function ie(w){var G={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(re){return G[re]})}var A=/\/+/g;function Q(w,G){return typeof w=="object"&&w!==null&&w.key!=null?ie(""+w.key):G.toString(36)}function Z(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(H,H):(w.status="pending",w.then(function(G){w.status==="pending"&&(w.status="fulfilled",w.value=G)},function(G){w.status==="pending"&&(w.status="rejected",w.reason=G)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function O(w,G,re,ae,he){var xe=typeof w;(xe==="undefined"||xe==="boolean")&&(w=null);var Ne=!1;if(w===null)Ne=!0;else switch(xe){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(w.$$typeof){case e:case n:Ne=!0;break;case y:return Ne=w._init,O(Ne(w._payload),G,re,ae,he)}}if(Ne)return he=he(w),Ne=ae===""?"."+Q(w,0):ae,W(he)?(re="",Ne!=null&&(re=Ne.replace(A,"$&/")+"/"),O(he,G,re,"",function(Ur){return Ur})):he!=null&&(oe(he)&&(he=fe(he,re+(he.key==null||w&&w.key===he.key?"":(""+he.key).replace(A,"$&/")+"/")+Ne)),G.push(he)),1;Ne=0;var pt=ae===""?".":ae+":";if(W(w))for(var Ze=0;Ze<w.length;Ze++)ae=w[Ze],xe=pt+Q(ae,Ze),Ne+=O(ae,G,re,xe,he);else if(Ze=_(w),typeof Ze=="function")for(w=Ze.call(w),Ze=0;!(ae=w.next()).done;)ae=ae.value,xe=pt+Q(ae,Ze++),Ne+=O(ae,G,re,xe,he);else if(xe==="object"){if(typeof w.then=="function")return O(Z(w),G,re,ae,he);throw G=String(w),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function N(w,G,re){if(w==null)return w;var ae=[],he=0;return O(w,ae,"","",function(xe){return G.call(re,xe,he++)}),ae}function ne(w){if(w._status===-1){var G=w._result;G=G(),G.then(function(re){(w._status===0||w._status===-1)&&(w._status=1,w._result=re)},function(re){(w._status===0||w._status==Line truncated
|
||||||
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||||
|
`+ps+t+oc}var fc=!1;function Wa(t,r){if(!t||fc)return"";fc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(F){var q=F}Reflect.construct(t,[],J)}else{try{J.call()}catch(F){q=F}t.call(J.prototype)}}else{try{throw Error()}catch(F){q=F}(J=t())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(F){if(F&&q&&typeof F.stack=="string")return[F.stack,q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=c.DetermineComponentFrameRoot(),g=f[0],b=f[1];if(g&&b){var E=g.split(`
|
||||||
|
`),L=b.split(`
|
||||||
|
`);for(l=c=0;c<E.length&&!E[c].includes("DetermineComponentFrameRoot");)c++;for(;l<L.length&&!L[l].includes("DetermineComponentFrameRoot");)l++;if(c===E.length||l===L.length)for(c=E.length-1,l=L.length-1;1<=c&&0<=l&&E[c]!==L[l];)l--;for(;1<=c&&0<=l;c--,l--)if(E[c]!==L[l]){if(c!==1||l!==1)do if(c--,l--,0>l||E[c]!==L[l]){var K=`
|
||||||
|
`+E[c].replace(" at new "," at ");return t.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",t.displayName)),K}while(1<=c&&0<=l);break}}}finally{fc=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?mr(a):""}function bl(t,r){switch(t.tag){case 26:case 27:case 5:return mr(t.type);case 16:return mr("Lazy");case 13:return t.child!==r&&r!==null?mr("Suspense Fallback"):mr("Suspense");case 19:return mr("SuspenseList");case 0:case 15:return Wa(t.type,!1);case 11:return Wa(t.type.render,!1);case 1:return Wa(t.type,!0);case 31:return mr("Activity");default:return""}}function Nr(t){try{var r="",a=null;do r+=bl(t,a),a=t,t=t.return;while(t);return r}catch(c){return`
|
||||||
|
Error generating stack: `+c.message+`
|
||||||
|
`+c.stack}}var ca=Object.prototype.hasOwnProperty,tr=e.unstable_scheduleCallback,dc=e.unstable_cancelCallback,qd=e.unstable_shouldYield,_l=e.unstable_requestPaint,rn=e.unstable_now,xl=e.unstable_getCurrentPriorityLevel,Fe=e.unstable_ImmediatePriority,_t=e.unstable_UserBlockingPriority,Qt=e.unstable_NormalPriority,El=e.unstable_LowPriority,My=e.unstable_IdlePriority,M2=e.log,C2=e.unstable_setDisableYieldValue,hc=null,bn=null;function gs(t){if(typeof M2=="function"&&C2(t),bn&&typeof bn.setStrictMode=="function")try{bn.setStrictMode(hc,t)}catch{}}var _n=Math.clz32?Math.clz32:z2,k2=Math.log,U2=Math.LN2;function z2(t){return t>>>=0,t===0?32:31-(k2(t)/U2|0)|0}var wl=256,Tl=262144,Ol=4194304;function ua(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Rl(t,r,a){var c=t.pendingLanes;if(c===0)return 0;var l=0,f=t.suspendedLanes,g=t.pingedLanes;t=t.warmLanes;var b=c&134217727;return b!==0?(c=b&~f,c!==0?l=ua(c):(g&=b,g!==0?l=ua(g):a||(a=b&~t,a!==0&&(l=ua(a))))):(b=c&~f,b!==0?l=ua(b):g!==0?l=ua(g):a||(a=c&~t,a!==0&&(l=ua(a)))),l===0?0:r!==0&&r!==l&&(r&f)===0&&(f=l&-l,a=r&-r,f>=a||f===32&&(a&4194048)!==0)?r:l}function mc(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function N2(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Cy(){var t=Ol;return Ol<<=1,(Ol&62914560)===0&&(Ol=4194304),t}function $d(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function pc(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function D2(t,r,a,c,l,f){var g=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var b=t.entanglements,E=t.expirationTimes,L=t.hiddenUpdates;for(a=g&~a;0<a;){var K=31-_n(a),J=1<<K;b[K]=0,E[K]=-1;var q=L[K];if(q!==null)for(L[K]=null,K=0;K<q.length;K++){var F=q[K];F!==null&&(F.lane&=-536870913)}a&=~J}c!==0&&ky(t,c,0),f!==0&&l===0&&t.tag!==0&&(t.suspendedLanes|=f&~(g&~r))}function ky(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var c=31-_n(r);t.entangledLanes|=r,t.entanglements[c]=t.entanglements[c]|1073741824|a&261930}function Uy(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var c=31-_n(a),l=1<<c;l&r|t[c]&r&&(t[c]|=r),a&=~l}}function zy(t,r){var a=r&-r;return a=(a&42)!==0?1:Hd(a),(a&(t.suspendedLanes|r))!==0?0:a}function Hd(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Vd(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ny(){var t=N.p;return t!==0?t:(t=window.event,t===void 0?32:v1(t.type))}function Dy(t,r){var a=N.p;try{return N.p=t,r()}finally{N.p=a}}var ys=Math.random().toString(36).slice(2),It="__reactFiber$"+ys,cn="__reactProps$"+ys,ei="__reactContainer$"+ys,Id="__reactEvents$"+ys,L2="__reactListeners$"+ys,j2="__reactHandles$"+ys,Ly="__reactResources$"+ys,gc="__reactMarker$"+ys;function Yd(t){delete t[It],delete t[cn],delete t[Id],delete t[L2],delete t[j2]}function ti(t){var r=t[It];if(r)return r;for(var a=t.parentNode;a;){if(r=a[ei]||a[It]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=r1(t);t!==null;){if(a=t[It])return a;t=r1(t)}return r}t=a,a=t.parentNode}return null}function ni(t){if(t=t[It]||t[ei]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function yc(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(i(33))}function ri(t){var r=t[Ly];return r||(r=t[Ly]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function zt(t){t[gc]=!0}var jy=new Set,By={};function la(t,r){si(t,r),si(t+"Capture",r)}function si(t,r){for(By[t]=r,t=0;t<r.length;t++)jy.add(r[t])}var B2=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21
Line truncated
|
||||||
|
`).replace(pR,"")}function Kb(t,r){return r=Fb(r),Fb(t)===r}function Ye(t,r,a,c,l,f){switch(a){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||ii(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&ii(t,""+c);break;case"className":Ml(t,"class",c);break;case"tabIndex":Ml(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Ml(t,a,c);break;case"style":Ky(t,c,f);break;case"data":if(r!=="object"){Ml(t,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(a);break}c=kl(""+c),t.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(a==="formAction"?(r!=="input"&&Ye(t,r,"name",l.name,l,null),Ye(t,r,"formEncType",l.formEncType,l,null),Ye(t,r,"formMethod",l.formMethod,l,null),Ye(t,r,"formTarget",l.formTarget,l,null)):(Ye(t,r,"encType",l.encType,l,null),Ye(t,r,"method",l.method,l,null),Ye(t,r,"target",l.target,l,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(a);break}c=kl(""+c),t.setAttribute(a,c);break;case"onClick":c!=null&&(t.onclick=Lr);break;case"onScroll":c!=null&&Re("scroll",t);break;case"onScrollEnd":c!=null&&Re("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(l.children!=null)throw Error(i(60));t.innerHTML=a}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}a=kl(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(a,""+c):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":c===!0?t.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(a,c):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(a,c):t.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(a):t.setAttribute(a,c);break;case"popover":Re("beforetoggle",t),Re("toggle",t),Al(t,"popover",c);break;case"xlinkActuate":Dr(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Dr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Dr(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Dr(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Dr(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Dr(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Dr(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Dr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Dr(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Al(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=I2.get(a)||a,Al(t,a,c))}}function Nm(t,r,a,c,l,f){switch(a){case"style":Ky(t,c,f);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(l.children!=null)throw Error(i(60));t.innerHTML=a}}break;case"children":typeof c=="string"?ii(t,c):(typeof c=="number"||typeof c=="bigint")&&ii(t,""+c);break;case"onScroll":c!=null&&Re("scroll",t);break;case"onScrollEnd":c!=null&&Re("scrollend",t);break;case"onClick":c!=null&&(t.onclick=Lr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||||
|
`+o(y+1));return`[
|
||||||
|
${o(y+1)}${S}
|
||||||
|
${o(y)}]`}if(m instanceof Date)return MA(m);if(!n?.ignoreToString&&Be(m,"toString")&&typeof m.toString=="function"&&m.toString!==Object.prototype.toString&&m.toString!==Array.prototype.toString){const S=CA(m);return m instanceof Error&&m.cause?`${S} (cause: ${p(m.cause,y)})`:S}if(typeof m=="string")return JSON.stringify(m);if(typeof m=="number"||m==null||typeof m=="boolean"||typeof m=="symbol")return String(m);if(typeof m=="bigint")return String(m)+"n";if(typeof m=="object"||typeof m=="function"){if(i.has(m))return j1;if(i.add(m),Zf in m)return Rt(Lx(m));if(Symbol.iterator in m)return`${m.constructor.name}(${p(Array.from(m),y)})`;const S=h(m);if(!u||S.length<=1){const _=`{${S.map(x=>`${ff(x)}:${p(m[x],y)}`).join(",")}}`;return d(m,_)}const v=`{
|
||||||
|
${S.map(_=>`${o(y+1)}${ff(_)}: ${p(m[_],y+1)}`).join(`,
|
||||||
|
`)}
|
||||||
|
${o(y)}}`;return d(m,v)}return String(m)}return p(e,0)}const j1="[Circular]";function ff(e){return typeof e=="string"?JSON.stringify(e):String(e)}function AA(e){return e.map(n=>`[${ff(n)}]`).join("")}function MA(e){try{return e.toISOString()}catch{return"Invalid Date"}}function CA(e){try{const n=e.toString();return typeof n=="string"?n:String(n)}catch{return"[toString threw]"}}function jx(e,n){let s=[];const i=JSON.stringify(e,(u,o)=>typeof o=="object"&&o!==null?s.includes(o)?void 0:s.push(o)&&Wf(o):o,n?.space);return s=void 0,i}const Ws=Symbol.for("nodejs.util.inspect.custom"),Fa=e=>{try{if(Be(e,"toJSON")&&Qf(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Fa)}catch{return"[toJSON threw]"}return Wf(e)},kA=(e,n=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?UA(e,n):String(e)}catch{return String(e)}},UA=(e,n)=>{let s=[];const i=JSON.stringify(e,(u,o)=>typeof o=="object"&&o!==null?s.includes(o)?void 0:s.push(o)&&Wf(o):o,n);return s=void 0,i},B1={toJSON(){return Fa(this)},[Ws](){return this.toJSON()},toString(){return Rt(this.toJSON())}};class ed{called=!1;self;constructor(n){this.self=n}next(n){return this.called?{value:n,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new ed(this.self)}}const Pi="~effect/Effect/internal",Bx={[Pi]:e=>e()},zA={[Pi]:e=>e()},NA=Bx[Pi](()=>new Error().stack)?.includes(Pi)===!0,Wt=NA?Bx[Pi]:zA[Pi],ls="~effect/Effect",ku="~effect/Exit",DA={_A:_e,_E:_e,_R:_e},qx=`${ls}/identifier`,we=`${ls}/args`,Ht=`${ls}/evaluate`,kn=`${ls}/successCont`,_r=`${ls}/failureCont`,ja=`${ls}/ensureCont`,Aa=Symbol.for("effect/Effect/Yield"),Ar={pipe(){return bt(this,arguments)},toJSON(){return{...this}},toString(){return Rt(this.toJSON(),{ignoreToString:!0,space:2})},[Ws](){return this.toJSON()}},td={[Symbol.iterator](){return new ed(this)}},LA={...td,pipe(){return bt(this,arguments)}},jA={[ls]:DA,...Ar,[Symbol.iterator](){return new ed(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[qx],...we in this?{args:this[we]}:void 0}}},Xt=e=>Be(e,ls),$x=e=>Be(e,ku),Xo="~effect/Cause",Qo="~effect/Cause/Reason",nd=e=>Be(e,Xo),BA=e=>Be(e,Qo);class Ka{[Xo];reasons;constructor(n){this[Xo]=Xo,this.reasons=n}pipe(){return bt(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(n=>n.toJSON())}}toString(){return`Cause(${Rt(this.reasons)})`}[Ws](){return this.toJSON()}[nn](n){return nd(n)&&this.reasons.length===n.reasons.length&&this.reasons.every((s,i)=>$t(s,n.reasons[i]))}[tn](){return Dx(this.reasons)}}const q1=new WeakMap;class Hg{[Qo];annotations;_tag;constructor(n,s,i){if(this[Qo]=Qo,this._tag=n,s!==rd&&typeof i=="object"&&i!==null&&s.size>0){const u=q1.get(i);u&&(s=new Map([...u,...s])),q1.set(i,s)}this.annotations=s}annotate(n,s){if(n.mapUnsafe.size===0)return this;const i=new Map(this.annotations);n.mapUnsafe.forEach((o,d)=>{s?.overwrite!==!0&&i.has(d)||i.set(d,o)});const u=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return u.annotations=i,u}pipe(){return bt(this,arguments)}toString(){return Rt(this)}[Ws](){return this.toString()}}const rd=new Map;class Hx extends Hg{error;constructor(n,s=rd){super("Fail",s,n),this.error=n}toString(){return`Fail(${Rt(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[nn](n){return Yg(n)&&$t(this.error,n.error)&&$t(this.annotations,n.annotations)}[tn](){return Xn(Mt(this._tag))(Xn(Je(this.error))(Je(this.annotations)))}}const sd=e=>new Ka(e),qA=new Ka([]),Vg=e=>new Ka([new Hx(e)]);class Ig extends Hg{defect;constructor(n,s=rd){super("Die",s,n),this.defect=n}toString(){return`Die(${Rt(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[nn](n){return HA(n)&&$t(this.defect,n.defect)&&$t(this.annotations,n.annotations)}[tn](){return Xn(Mt(this._tag))(Xn(Je(this.defect))(Je(this.annotations)))}}const $A=e=>new Ka([new Ig(e)]),Hp=P(e=>nd(e[0]),(e,n,s)=>n.mapUnsafe.size===0?e:new Ka(e.reasons.map(i=>i.annotate(n,s)))),Yg=e=>e._tag==="Fail",HA=e=>e._tag==="Die",Gg=e=>e._tag==="Interrupt";function VA(e){return Xi("Effect.evaluate: Not implemented")}const Zu=e=>({...jA,[qx]:e.op,[Ht]:e[Ht]??VA,[kn]:e[kn],[_r]:e[_r],[ja]:e[ja]}),or=e=>{const n=Zu(e);return function(){const s=Object.create(n);return s[we]=e.single===!1?arguments:arguments[0],s}},Vx=e=>{const n={...Zu(e),[ku]:ku,_tag:e.op,get[e.prop](){return this[we]},toString(){return`${e.op}(${Rt(this[we])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[we]}},[nn](s){return $x(s)&&s._tag===this._tag&&$t(this[we],s[we])},[tn](){return Xn(Mt(e.op),Je(this[we]))}};return function(s){const i=Object.create(n);return i[we]=s,i}},et=Vx({op:"Success",prop:"value",[Ht](e){const n=e.getCont(kn);return n?n[kn](this[we],e,this):e.yieldWith(this)}}),ad={key:"effect/Cause/StackTrace"},IA={key:"effect/Cause/InterruptorStackTrace"},Jn=Vx({op:"Failure",prop:"cause",[Ht](e){let n=this[we],s=!1;e.currentStackFrame&&(n=Hp(n,{mapUnsafe:new Map([[ad.key,e.currentStackFrame]])}),s=!0);let i=e.get
Line truncated
|
||||||
|
`);if(s.length>2){const i=s[2].match(/at (.*)/);i&&(n.message=n.message+` (defined at ${i[1]})`)}}if(n.stack){const s=n.stack.split(`
|
||||||
|
`);s.splice(1,3),n.stack=s.join(`
|
||||||
|
`)}return n},Ba=P(2,(e,n)=>{if(e.mapUnsafe.size===0)return n;if(n.mapUnsafe.size===0)return e;const s=new Map(e.mapUnsafe);return n.mapUnsafe.forEach((i,u)=>s.set(u,i)),ir(s)}),lC=(...e)=>{const n=new Map;for(let s=0;s<e.length;s++)e[s].mapUnsafe.forEach((i,u)=>{n.set(u,i)});return ir(n)},ft=Sn,Ji=ft("effect/Scheduler",{defaultValue:()=>new Nu}),oC="setImmediate"in globalThis?e=>{const n=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(n)}:e=>{const n=setTimeout(e,0);return()=>clearTimeout(n)};class fC{buckets=[];scheduleTask(n,s){const i=this.buckets,u=i.length;let o,d=0;for(;d<u&&!(i[d][0]>s);d++)o=i[d];o&&o[0]===s?o[1].push(n):d===u?i.push([s,[n]]):i.splice(d,0,[s,[n]])}drain(){const n=this.buckets;return this.buckets=[],n}}class Nu{tasks=new fC;running=void 0;executionMode;setImmediate;constructor(n="async",s=oC){this.executionMode=n,this.setImmediate=s}scheduleTask(n,s){this.tasks.scheduleTask(n,s),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){const n=this.tasks.drain();for(let s=0;s<n.length;s++){const i=n[s][1];for(let u=0;u<i.length;u++)i[u]()}}shouldYield(n){return n.currentOpCount>=n.maxOpsBeforeYield}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}}const dC=ft("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),hE="effect/Tracer/ParentSpan";class hC extends Sn()(hE){}const mC=e=>e,Fp=ft("effect/Tracer/DisablePropagation",{defaultValue:Ux}),pC=ft("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),gC=ft("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),mE="effect/Tracer",yC=ft(mE,{defaultValue:()=>mC({span:e=>new SC(e)})});class SC{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(n){this.name=n.name,this.parent=n.parent,this.annotations=n.annotations,this.links=n.links,this.startTime=n.startTime,this.kind=n.kind,this.sampled=n.sampled,this.status={_tag:"Started",startTime:n.startTime},this.attributes=new Map,this.traceId=n.parent?.traceId??Y1(32),this.spanId=Y1(16)}end(n,s){this.status={_tag:"Ended",endTime:n,exit:s,startTime:this.status.startTime}}attribute(n,s){this.attributes.set(n,s)}event(n,s,i){this.events.push([n,s,i??{}])}addLinks(n){this.links.push(...n)}}const Y1=(function(){const e="abcdef0123456789",n=e.length;return function(s){let i="";for(let u=0;u<s;u++)i+=e.charAt(Math.floor(Math.random()*n));return i}})(),vC=ft("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),pE=ft("effect/References/CurrentStackFrame",{defaultValue:jg}),bC=ft("effect/References/TracerEnabled",{defaultValue:Pf}),gE=ft("effect/References/TracerTimingEnabled",{defaultValue:Pf}),_C=ft("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),xC=ft("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),Zg=ft("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),EC=ft("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),wC=ft("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),TC=ft("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),OC="effect/observability/Metric/FiberRuntimeMetricsKey",RC=e=>{if(e?.captureStackTrace===!1)return e;if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!="boolean")return e;const n=Error.stackTraceLimit;Error.stackTraceLimit=3;const s=new Error;return Error.stackTraceLimit=n,{...e,captureStackTrace:MC(()=>s.stack)}},AC=e=>n=>{let s;return()=>{if(s!==void 0)return s;const i=n();if(!i)return;const u=i.split(`
|
||||||
|
`);if(u[e]!==void 0)return s=u[e].trim(),s}},MC=AC(3),CC="dev";let yE=class extends Hg{fiberId;constructor(n,s=rd){super("Interrupt",s,"Interrupted"),this.fiberId=n}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[nn](n){return Gg(n)&&this.fiberId===n.fiberId&&this.annotations===n.annotations}[tn](){return Xn(Mt(`${this._tag}:${this.fiberId}`))($p(this.annotations))}};const kC=e=>new yE(e),el=e=>new Ka([new yE(e)]),UC=e=>{const n=e.reasons.find(Yg);return n?fs(n):ur(e)},Pa=e=>{for(let n=0;n<e.reasons.length;n++){const s=e.reasons[n];if(s._tag==="Fail")return fs(s.error)}return ur(e)},zC=e=>e.reasons.some(Gg),Wg=e=>{let n;for(let s=0;s<e.reasons.length;s++){const i=e.reasons[s];i._tag==="Interrupt"&&(n??=new Set,i.fiberId!==void 0&&n.add(i.fiberId))}return n?fs(n):ur(e)},NC=e=>{const n=Wg(e);return ct(n)?DC:n.success},DC=new Set,LC=e=>e.reasons.every(Gg),jC=P(2,(e,n)=>{if(e.reasons.length===0)return n;if(n.reasons.length===0)return e;const s=new Ka(CM(e.reasons,n.reasons));return $t(e,s)?e:s}),BC=e=>{const n={Fail:[],Die:[],Interrupt:[]};for(let s=0;s<e.reasons.length;s++)n[e.reasons[s]._tag].push(e.reasons[s]);return n},SE=e=>{const n=BC(e);return n.Fail.length>0?n.Fail[0].error:n.Die.length>0?n.Die[0].defect:n.Interrupt.length>0?new globalThis.Error("All fibers interrupted without error"):new globalThis.Error("Empty cause")},qC=e=>{const n=[],s=[];if(e.reasons.length===0)return n;const i=Error.stackTraceLimit;Error.stackTraceLimit=1;for(const u of e.reasons){if(u._tag==="Interrupt"){s.push(u);continue}n.push(Kp(u._tag==="Die"?u.defect:u.error,u.annotations))}if(n.length===0){const u=new Error("The fiber was interrupted by:");u.name="InterruptCause",u.stack=IC(u,s);const o=new globalThis.Error("All fibers interrupted without error",{cause:u});o.name="InterruptError",o.stack=`${o.name}: ${o.message}`,n.push(Kp(o,s[0].annotations))}return Error.stackTraceLimit=i,n},Kp=(e,n)=>{const s=typeof e;let i;if(e&&s==="object"){if(i=new globalThis.Error($C(e),{cause:e.cause?Kp(e.cause):void 0}),typeof e.name=="string"&&(i.name=e.name),typeof e.stack=="string")i.stack=VC(e.stack,i,n);else{const u=`${i.name}: ${i.message}`;i.stack=n?vE(u,n):u}for(const u of Object.keys(e))u in i||(i[u]=e[u])}else i=new globalThis.Error(e?s==="string"?e:jx(e):`Unknown error: ${e}`);return i},$C=e=>{if(typeof e.message=="string")return e.message;if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return jx(e)},HC=/\((.*)\)/g,VC=(e,n,s)=>{const i=`${n.name}: ${n.message}`,u=(e.startsWith(i)?e.slice(i.length):e).split(`
|
||||||
|
`),o=[i];for(let d=1;d<u.length&&!/(?:Generator\.next|~effect\/Effect)/.test(u[d]);d++)o.push(u[d]);return s?vE(o.join(`
|
||||||
|
`),s):o.join(`
|
||||||
|
`)},vE=(e,n)=>{const s=n?.get(ad.key);return s&&(e=`${e}
|
||||||
|
${bE(s)}`),e},IC=(e,n)=>{const s=[`${e.name}: ${e.message}`];for(const i of n){const u=i.fiberId!==void 0?`#${i.fiberId}`:"unknown",o=i.annotations.get(IA.key);s.push(` at fiber (${u})`),o&&s.push(bE(o))}return s.join(`
|
||||||
|
`)},bE=e=>{const n=[];let s=e,i=0;for(;s&&i<10;){const u=s.stack();if(u){const o=u.matchAll(HC);let d=!1;for(const[,h]of o)d=!0,n.push(` at ${s.name} (${h})`);d||n.push(` at ${s.name} (${u.replace(/^at /,"")})`)}else n.push(` at ${s.name}`);s=s.parent,i++}return n.join(`
|
||||||
|
`)},e0=e=>qC(e).map(n=>n.cause?`${n.stack} {
|
||||||
|
${_E(n.cause," ")}
|
||||||
|
}`:n.stack).join(`
|
||||||
|
`),_E=(e,n)=>{const s=e.stack.split(`
|
||||||
|
`);let i=`${n}[cause]: ${s[0]}`;for(let u=1,o=s.length;u<o;u++)i+=`
|
||||||
|
${n}${s[u]}`;return e.cause&&(i+=` {
|
||||||
|
${_E(e.cause,`${n} `)}
|
||||||
|
${n}}`),i},Pp=`~effect/Fiber/${CC}`,YC={_A:_e,_E:_e},GC={id:0},xE=()=>globalThis[Su];class EE{constructor(n,s=!0){this[Pp]=YC,this.setServices(n),this.id=++GC.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=s,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0}[Pp];id;interruptible;currentOpCount;currentLoopCount;_stack;_observers;_exit;_currentExit;_children;_interruptedCause;_yielded;services;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;getRef(n){return cC(this.services,n)}addObserver(n){return this._exit?(n(this._exit),cc):(this._observers.push(n),()=>{const s=this._observers.indexOf(n);s>=0&&this._observers.splice(s,1)})}interruptUnsafe(n,s){if(this._exit)return;let i=el(n);this.currentStackFrame&&(i=Hp(i,Qi(ad,this.currentStackFrame))),s&&(i=Hp(i,s)),this._interruptedCause=this._interruptedCause?jC(this._interruptedCause,i):i,this.interruptible&&this.evaluate(en(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(n){if(this.runtimeMetrics?.recordFiberStart(this.services),this._exit)return;if(this._yielded!==void 0){const i=this._yielded;this._yielded=void 0,i()}const s=this.runLoop(n);if(s!==Aa){this._exit=s,this.runtimeMetrics?.recordFiberEnd(this.services,this._exit);for(let i=0;i<this._observers.length;i++)this._observers[i](s);this._observers.length=0}}runLoop(n){const s=globalThis[Su];globalThis[Su]=this;let i=!1,u=n;this.currentOpCount=0;const o=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!i&&this.currentScheduler.shouldYield(this)){i=!0;const d=u;u=qe(n0,()=>d)}if(u=this.currentTracerContext?this.currentTracerContext(u,this):u[Ht](this),o!==this.currentLoopCount)return Aa;if(u===Aa){const d=this._yielded;return ku in d?(this._yielded=void 0,d):Aa}}}catch(d){return Be(u,Ht)?this.runLoop(Xi(d)):Xi(`Fiber.runLoop: Not a valid effect: ${String(u)}`)}finally{globalThis[Su]=s}}getCont(n){for(;;){const s=this._stack.pop();if(!s)return;const i=s[ja]&&s[ja](this);if(i)return i[n]=i,i;if(s[n])return s}}yieldWith(n){return this._yielded=n,Aa}children(){return this._children??=new Set}pipe(){return bt(this,arguments)}setServices(n){this.services=n,this.currentScheduler=this.getRef(Ji),this.currentSpan=n.mapUnsafe.get(hE),this.currentLogLevel=this.getRef(EC),this.minimumLogLevel=this.getRef(wC),this.currentStackFrame=n.mapUnsafe.get(pE.key),this.maxOpsBeforeYield=this.getRef(dC),this.runtimeMetrics=n.mapUnsafe.get(OC);const s=n.mapUnsafe.get(mE);this.currentTracerContext=s?s.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}const cd=e=>{if(!e.currentStackFrame)return;const n=new Map;return n.set(ad.key,e.currentStackFrame),ir(n)},FC=e=>{const n=e;return n._exit?ve(n._exit):an(s=>n._exit?s(ve(n._exit)):lt(e.addObserver(i=>s(ve(i)))))},wE=e=>an(n=>{const s=e[Symbol.iterator](),i=[];let u;function o(){let d=s.next();for(;!d.done;){if(d.value._exit){i.push(d.value._exit),d=s.next();continue}u=d.value.addObserver(h=>{i.push(h),o()});return}n(ve(i))}return o(),lt(()=>u?.())}),KC=e=>{const n=e;return n._exit?n._exit:an(s=>n._exit?s(n._exit):lt(e.addObserver(s)))},PC=e=>an(n=>{const s=Array.from(e);if(s.length===0)return n(ve(Ip()));const i=new Array(s.length),u=Ip();let o=0,d=!1;for(let h=0;h<s.length&&!d;h++)u.push(s[h].addObserver(p=>{if(o++,p._tag==="Failure")return d=!0,u.forEach(m=>m()),n(p);i[h]=p.value,o===s.length&&n(ve(i))}))}),t0=e=>Ve(n=>XC(e,n.id)),XC=P(e=>Be(e[0],Pp),(e,n,s)=>Ve(i=>{let u=cd(i);return u=u&&s?Ba(u,s):u??s,e.interruptUnsafe(n,u),ld(FC(e))})),mf=e=>Ve(n=>{const s=cd(n);for(const i of e)i.interruptUnsafe(n.id,s);return ld(wE(e))}),ve=et,en=Jn,ud=Mr,lt=or({op:"Sync",[Ht](e){const n=this[we](),s=e.getCont(kn);return s?s[kn](n,e):e.yieldWith(et(n))}}),ot=or({op:"Suspend",[Ht](e){return this[we]()}}),QC=or({op:"Yield",[Ht](e){let n=!1;return e.currentScheduler.scheduleTask(()=>{n||e.evaluate(Or)},this[we]??0),e.yieldWith(()=>{n=!0})}}),n0=QC(0),JC=e=>ve(Te(e)),r0=ve(Ct()),s0=e=>Xi(e),TE=e=>ot(()=>ud(Wt(e))),kt=ve(void 0),ZC=e=>OE(function(n,s){Wt(()=>e(s)).then(i=>n(ve(i)),i=>n(s0(i)))},e.length!==0),WC=e=>Ve(n=>e(n.id)),OE=or({op:"Async",single:!1,[Ht](e){const n=Wt(()=>this[we][0].bind(e.currentScheduler));let s=!1,i=!1;const u=this[we][1]?new AbortController:void 0,o=n(d=>{s||(s=!0,i?e.evaluate(d):i=d)},u?.signal);return i!==!1?i:(i=!0,e._yielded=()=>{s=!0},u===void 0&&o===void 0||e._stack.push(e3(()=>(s=!0,u?.abort(),o??Or))),Aa)}}),e3=or({op:"AsyncFinalizer",[ja](e){e.interruptible&&(e.interruptible=!1,e._stack.push(gd))},[_r](e,n){return zC(e)?qe(this[we](),()=>en(e)):en(e)}}),an=e=>OE(e,e.length>=2),t3=an(cc),n3=(...e)=>ot(()=>Du(e.length===1?e[0]():e[1].call(e[0].self))),RE=(e,...n)=>{const s=n.length===0?function(){return ot(()=>Du(e.apply(this,arguments)))}:function(){let i=ot(()=>Du(e.apply(this,arguments)));for(let u=0;u<n
Line truncated
|
||||||
|
`)}const yz=gz();function Sz(e){let n=e.message;if(e.path&&e.path.length>0){const s=AA(e.path);n+=`
|
||||||
|
at ${s}`}return n}function Yu(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return uu(e.ast.annotations);case"InvalidValue":case"Forbidden":return uu(e.annotations);case"MissingKey":return uu(e.annotations,"messageMissingKey");case"UnexpectedKey":return uu(e.ast.annotations,"messageUnexpectedKey");case"Filter":return uu(e.filter.annotations);case"Encoding":return Yu(e.issue)}}function uu(e,n="message"){const s=e?.[n];if(typeof s=="string")return s}function h_(e){return os(e)?"no value provided":Rt(e.value)}class ec extends Kf{run;constructor(n){super(),this.run=n}map(n){return new ec((s,i)=>this.run(s,i).pipe(vw(Pg(n))))}compose(n){return m_(this)?n:m_(n)?this:new ec((s,i)=>this.run(s,i).pipe(Ii(u=>n.run(u,i))))}}const Uw=new ec(Ee);function m_(e){return e.run===Uw.run}function tc(){return Uw}function pn(e){return vz(Pg(e))}function vz(e){return new ec(n=>Ee(e(n)))}function bz(){return pn(globalThis.String)}function zw(){return pn(globalThis.Number)}const og="~effect/SchemaTransformation/Transformation";class gn{[og]=og;_tag="Transformation";decode;encode;constructor(n,s){this.decode=n,this.encode=s}flip(){return new gn(this.encode,this.decode)}compose(n){return new gn(this.decode.compose(n.decode),n.encode.compose(this.encode))}}function _z(e){return Be(e,og)}const Nw=e=>_z(e)?e:new gn(e.decode,e.encode);function Ed(e){return new gn(pn(e.decode),pn(e.encode))}const xz=new gn(tc(),tc());function $0(){return xz}const Dw=new gn(zw(),bz()),Lw=e=>Ed({decode:n=>{const s=new Error(n.message);return typeof n.name=="string"&&n.name!=="Error"&&(s.name=n.name),typeof n.stack=="string"&&(s.stack=n.stack),s},encode:n=>{const s={name:n.name,message:n.message};return e?.includeStack&&typeof n.stack=="string"&&(s.stack=n.stack),s}});function Ja(e){return n=>n._tag===e}const jw=Ja("Declaration"),Ez=Ja("Never"),Of=Ja("Literal"),wz=Ja("UniqueSymbol"),Tz=Ja("Arrays"),Oz=Ja("Objects"),Rz=Ja("Union");let Vt=class{to;transformation;constructor(n,s){this.to=n,this.transformation=s}};const Az={};class nc{isOptional;isMutable;defaultValue;annotations;constructor(n,s,i=void 0,u=void 0){this.isOptional=n,this.isMutable=s,this.defaultValue=i,this.annotations=u}}const p_="~effect/Schema";class vn{[p_]=p_;annotations;checks;encoding;context;constructor(n=void 0,s=void 0,i=void 0,u=void 0){this.annotations=n,this.checks=s,this.encoding=i,this.context=u}toString(){return`<${this._tag}>`}}class ol extends vn{_tag="Declaration";typeParameters;run;constructor(n,s,i,u,o,d){super(i,u,o,d),this.typeParameters=n,this.run=s}getParser(){const n=this.run(this.typeParameters);return(s,i)=>os(s)?b0:vw(n(s.value,this,i),Te)}recur(n){const s=rc(this.typeParameters,n);return s===this.typeParameters?this:new ol(s,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){const n=this.annotations?.expected;return typeof n=="string"?n:"<Declaration>"}}class Mz extends vn{_tag="Null";getParser(){return Od(this,null)}getExpected(){return"null"}}const Bw=new Mz;let Cz=class extends vn{_tag="Undefined";getParser(){return Od(this,void 0)}toCodecJson(){return qt(this,[qw])}getExpected(){return"undefined"}};const qw=new Vt(Bw,new gn(pn(()=>{}),pn(()=>null))),kz=new Cz;let Uz=class extends vn{_tag="Void";getParser(){return Od(this,void 0)}toCodecJson(){return qt(this,[qw])}getExpected(){return"void"}};const zz=new Uz;let Nz=class extends vn{_tag="Never";getParser(){return Za(this,uA)}getExpected(){return"never"}};const Dz=new Nz;let Lz=class extends vn{_tag="Any";getParser(){return Za(this,Nx)}getExpected(){return"any"}};const jz=new Lz;let Bz=class extends vn{_tag="Unknown";getParser(){return Za(this,Nx)}getExpected(){return"unknown"}};const H0=new Bz;let Tu=class extends vn{_tag="Literal";literal;constructor(n,s,i,u,o){if(super(s,i,u,o),typeof n=="number"&&!globalThis.Number.isFinite(n))throw new Error(`A numeric literal must be finite, got ${Rt(n)}`);this.literal=n}getParser(){return Od(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?g_(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:g_(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function g_(e){const n=globalThis.String(e.literal);return qt(e,[new Vt(new Tu(n),new gn(pn(()=>e.literal),pn(()=>n)))])}let qz=class extends vn{_tag="String";getParser(){return Za(this,Xf)}getExpected(){return"string"}};const $w=new qz;let $z=class extends vn{_tag="Number";getParser(){return Za(this,of)}toCodecJson(){return this.checks&&(gu(this.checks,"isFinite")||gu(this.checks,"isInt"))?this:qt(this,[Kz])}toCodecStringTree(){return this.checks&&(gu(this.checks,"isFinite")||gu(this.checks,"isInt"))?qt(this,[sN]):qt(this,[aN])}getExpected(){return"number"}};function gu(e,n){return e.some(s=>{switch(s._tag){case"Filter":return s.annotations?.meta?._tag===n;case"FilterGroup":return gu(s.checks,n)}})}const Hw=new $z;let Hz=class extends vn{_tag="Boolean";getParser(){ret
Line truncated
|
||||||
|
`)[5]??""]})),z6=P(2,(e,n)=>x6(e)?gl(s=>n(s,e),function(s,i){s.set(e,i)},e.refresh??function(s){s(e)}):Xs(s=>n(s,e),e.refresh??function(s){s(e)})),N6=y6,j_="~effect-atom/atom/Atom/ServerValue",D6=P(2,(e,n)=>j_ in e?e[j_](s=>n.get(s)):n.get(e));var bp=Cx();function LT(e){const n=bp.unstable_scheduleCallback(bp.unstable_LowPriority,e);return()=>bp.unstable_cancelCallback(n)}const kd=le.createContext(AT({scheduleTask:LT,defaultIdleTTL:400})),L6=e=>{const n=le.useRef(null);return n.current===null&&(n.current={registry:AT({scheduleTask:e.scheduleTask??LT,initialValues:e.initialValues,timeoutResolution:e.timeoutResolution,defaultIdleTTL:e.defaultIdleTTL})}),le.useEffect(()=>(n.current?.timeout!==void 0&&clearTimeout(n.current.timeout),()=>{n.current.timeout=setTimeout(()=>{n.current?.registry.dispose(),n.current=null},500)}),[n]),le.createElement(kd.Provider,{value:n.current.registry},e?.children)},B_=new WeakMap;function j6(e,n){let s=B_.get(e);s===void 0&&(s=new WeakMap,B_.set(e,s));const i=s.get(n);if(i!==void 0)return i;const u={subscribe(o){return e.subscribe(n,o)},snapshot(){return e.get(n)},getServerSnapshot(){return D6(n,e)}};return s.set(n,u),u}function B6(e,n){const s=j6(e,n);return le.useSyncExternalStore(s.subscribe,s.snapshot,s.getServerSnapshot)}const ta=(e,n)=>{const s=le.useContext(kd);return B6(s,e)};function jT(e,n){le.useEffect(()=>e.mount(n),[n,e])}function q6(e,n,s){return s?.mode==="promise"||s?.mode==="promiseExit"?le.useCallback(i=>{e.set(n,i);const u=G4(u6(e,n,{suspendOnWaiting:!0}));return s.mode==="promise"?u.then($6):u},[e,n,s.mode]):le.useCallback(i=>{e.set(n,typeof i=="function"?i(e.get(n)):i)},[e,n])}const $6=e=>{if(ew(e))return e.value;throw JE(e.cause)},Wr=(e,n)=>{const s=le.useContext(kd);return jT(s,e),q6(s,e,n)},H6=e=>{const n=le.useContext(kd);return jT(n,e),le.useCallback(()=>{n.refresh(e)},[n,e])};var it=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(it||{});function BT({update:e,notify:n,unwatched:s}){return{link:i,unlink:u,propagate:o,checkDirty:d,shallowPropagate:h};function i(m,y,S){const v=y.depsTail;if(v!==void 0&&v.dep===m)return;const _=v!==void 0?v.nextDep:y.deps;if(_!==void 0&&_.dep===m){_.version=S,y.depsTail=_;return}const x=m.subsTail;if(x!==void 0&&x.version===S&&x.sub===y)return;const T=y.depsTail=m.subsTail={version:S,dep:m,sub:y,prevDep:v,nextDep:_,prevSub:x,nextSub:void 0};_!==void 0&&(_.prevDep=T),v!==void 0?v.nextDep=T:y.deps=T,x!==void 0?x.nextSub=T:m.subs=T}function u(m,y=m.sub){const S=m.dep,v=m.prevDep,_=m.nextDep,x=m.nextSub,T=m.prevSub;return _!==void 0?_.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=_:y.deps=_,x!==void 0?x.prevSub=T:S.subsTail=T,T!==void 0?T.nextSub=x:(S.subs=x)===void 0&&s(S),_}function o(m){let y=m.nextSub,S;e:do{const v=m.sub;let _=v.flags;if(_&60?_&12?_&4?!(_&48)&&p(m,v)?(v.flags=_|40,_&=1):_=0:v.flags=_&-9|32:_=0:v.flags=_|32,_&2&&n(v),_&1){const x=v.subs;if(x!==void 0){const T=(m=x).nextSub;T!==void 0&&(S={value:y,prev:S},y=T);continue}}if((m=y)!==void 0){y=m.nextSub;continue}for(;S!==void 0;)if(m=S.value,S=S.prev,m!==void 0){y=m.nextSub;continue e}break}while(!0)}function d(m,y){let S,v=0,_=!1;e:do{const x=m.dep,T=x.flags;if(y.flags&16)_=!0;else if((T&17)===17){if(e(x)){const j=x.subs;j.nextSub!==void 0&&h(j),_=!0}}else if((T&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(S={value:m,prev:S}),m=x.deps,y=x,++v;continue}if(!_){const j=m.nextDep;if(j!==void 0){m=j;continue}}for(;v--;){const j=y.subs,B=j.nextSub!==void 0;if(B?(m=S.value,S=S.prev):m=j,_){if(e(y)){B&&h(j),y=m.sub;continue}_=!1}else y.flags&=-33;y=m.sub;const M=m.nextDep;if(M!==void 0){m=M;continue e}}return _}while(!0)}function h(m){do{const y=m.sub,S=y.flags;(S&48)===32&&(y.flags=S|16,(S&6)===2&&n(y))}while((m=m.nextSub)!==void 0)}function p(m,y){let S=y.depsTail;for(;S!==void 0;){if(S===m)return!0;S=S.prevDep}return!1}}let cy=0,Oa=0,Au=0;const es=[],{link:rB,unlink:qT,propagate:sB,checkDirty:V6,shallowPropagate:aB}=BT({update(e){return e.depsTail!==void 0?F6(e):K6(e)},notify(e){let n=Au,s=n;do if(es[n++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Au=n;s<--n;){const i=es[s];es[s++]=es[n],es[n]=i}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ud(e)):Q6.call(e)}});function I6(){return cy}function Y6(){++cy}function G6(){--cy||X6()}function F6(e){e.depsTail=void 0,e.flags=5;try{const n=e.value;return n!==(e.value=e.getter(n))}finally{e.flags&=-5,Ud(e)}}function K6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function P6(e){const n=e.flags;if(n&16||n&32&&V6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ud(e)}}else e.flags=2}function X6(){try{for(;Oa<Au;){const e=es[Oa];es[Oa++]=void 0,P6(e)}}finally{for(;Oa<Au;){const e=es[Oa];es[Oa++]=void 0,e.flags|=10}Oa=0,Au=0}}function Q6(){this.depsTail=void 0,this.flags=0,Ud(
Line truncated
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>effect-http-ws-cli rpc console</title>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=IBM+Plex+Sans:wght@400;500;700&display=swap" rel="stylesheet" />
|
||||||
|
<script type="module" crossorigin src="/assets/index-CuY7i06l.js"></script>
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/index-Bz7MwgeQ.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import { spawn } from "node:child_process"
|
||||||
|
|
||||||
|
const frontendDevOrigin = process.env.FRONTEND_DEV_ORIGIN ?? "http://127.0.0.1:5173"
|
||||||
|
const frontendDevUrl = new URL(frontendDevOrigin)
|
||||||
|
|
||||||
|
if (frontendDevUrl.protocol !== "http:" && frontendDevUrl.protocol !== "https:") {
|
||||||
|
throw new Error(`FRONTEND_DEV_ORIGIN must use http or https, received ${frontendDevOrigin}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const frontendHost = process.env.FRONTEND_DEV_HOST ?? frontendDevUrl.hostname
|
||||||
|
const frontendPort = process.env.FRONTEND_DEV_PORT ?? (frontendDevUrl.port || "5173")
|
||||||
|
const serverArgs = process.argv.slice(2)
|
||||||
|
|
||||||
|
const readFlagValue = (name) => {
|
||||||
|
const index = serverArgs.findIndex((arg) => arg === name)
|
||||||
|
if (index >= 0) {
|
||||||
|
return serverArgs[index + 1]
|
||||||
|
}
|
||||||
|
|
||||||
|
const prefixed = serverArgs.find((arg) => arg.startsWith(`${name}=`))
|
||||||
|
return prefixed ? prefixed.slice(name.length + 1) : undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
const normalizeBackendHost = (host) => {
|
||||||
|
if (!host || host === "0.0.0.0" || host === "::") {
|
||||||
|
return "127.0.0.1"
|
||||||
|
}
|
||||||
|
return host
|
||||||
|
}
|
||||||
|
|
||||||
|
const backendHost = normalizeBackendHost(process.env.HOST ?? readFlagValue("--host"))
|
||||||
|
const backendPort = process.env.PORT ?? readFlagValue("--port") ?? "8787"
|
||||||
|
const backendOrigin = process.env.VITE_BACKEND_ORIGIN ?? `http://${backendHost}:${backendPort}`
|
||||||
|
|
||||||
|
const children = new Set()
|
||||||
|
let shuttingDown = false
|
||||||
|
|
||||||
|
const stopChildren = (signal = "SIGTERM") => {
|
||||||
|
if (shuttingDown) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
shuttingDown = true
|
||||||
|
for (const child of children) {
|
||||||
|
if (!child.killed) {
|
||||||
|
child.kill(signal)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const spawnChild = (command, args, env = {}) => {
|
||||||
|
const child = spawn(command, args, {
|
||||||
|
stdio: "inherit",
|
||||||
|
env: {
|
||||||
|
...process.env,
|
||||||
|
...env
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
children.add(child)
|
||||||
|
|
||||||
|
child.on("exit", (code, signal) => {
|
||||||
|
stopChildren(signal ?? "SIGTERM")
|
||||||
|
if (signal) {
|
||||||
|
process.kill(process.pid, signal)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
process.exit(code ?? 0)
|
||||||
|
})
|
||||||
|
|
||||||
|
return child
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnChild("bun", [
|
||||||
|
"run",
|
||||||
|
"--filter",
|
||||||
|
"@effect-http-ws-cli/web",
|
||||||
|
"dev",
|
||||||
|
"--",
|
||||||
|
"--host",
|
||||||
|
frontendHost,
|
||||||
|
"--port",
|
||||||
|
frontendPort,
|
||||||
|
"--strictPort"
|
||||||
|
], {
|
||||||
|
VITE_BACKEND_ORIGIN: backendOrigin
|
||||||
|
})
|
||||||
|
|
||||||
|
spawnChild("node", ["server/src/bin.ts", ...serverArgs], {
|
||||||
|
FRONTEND_DEV_ORIGIN: frontendDevOrigin
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const signal of ["SIGINT", "SIGTERM"]) {
|
||||||
|
process.on(signal, () => stopChildren(signal))
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "@effect-http-ws-cli/server",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"exports": {
|
||||||
|
"./client": "./src/client.ts",
|
||||||
|
"./contracts": "./src/contracts.ts"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "node src/bin.ts",
|
||||||
|
"start": "node src/bin.ts",
|
||||||
|
"test": "vitest run",
|
||||||
|
"lint": "tsc --noEmit"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@effect/platform-node": "catalog:",
|
||||||
|
"@effect/sql-sqlite-node": "catalog:",
|
||||||
|
"effect": "catalog:"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@effect/vitest": "catalog:",
|
||||||
|
"@types/node": "^24.10.0",
|
||||||
|
"typescript": "catalog:",
|
||||||
|
"vitest": "catalog:"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as SqlClient from "effect/unstable/sql/SqlClient"
|
||||||
|
|
||||||
|
export default Effect.gen(function*() {
|
||||||
|
const sql = yield* SqlClient.SqlClient
|
||||||
|
|
||||||
|
yield* sql`
|
||||||
|
CREATE TABLE IF NOT EXISTS todos (
|
||||||
|
id TEXT PRIMARY KEY NOT NULL,
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
completed INTEGER NOT NULL,
|
||||||
|
archived INTEGER NOT NULL,
|
||||||
|
revision INTEGER NOT NULL,
|
||||||
|
updated_at TEXT NOT NULL
|
||||||
|
)
|
||||||
|
`
|
||||||
|
|
||||||
|
yield* sql`
|
||||||
|
CREATE TABLE IF NOT EXISTS todo_events (
|
||||||
|
event_offset INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
at TEXT NOT NULL,
|
||||||
|
todo_json TEXT NOT NULL,
|
||||||
|
change_json TEXT NOT NULL,
|
||||||
|
archived INTEGER NOT NULL
|
||||||
|
)
|
||||||
|
`
|
||||||
|
|
||||||
|
yield* sql`
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_todo_events_archived_offset
|
||||||
|
ON todo_events (archived, event_offset)
|
||||||
|
`
|
||||||
|
})
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import * as NodeRuntime from "@effect/platform-node/NodeRuntime"
|
||||||
|
import * as NodeServices from "@effect/platform-node/NodeServices"
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import { cli } from "./cli.ts"
|
||||||
|
import { Command } from "effect/unstable/cli"
|
||||||
|
|
||||||
|
Command.run(cli, { version: "0.1.0" }).pipe(
|
||||||
|
Effect.provide(NodeServices.layer),
|
||||||
|
NodeRuntime.runMain
|
||||||
|
)
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
import * as SqliteNode from "@effect/sql-sqlite-node"
|
||||||
|
import { Command, Flag } from "effect/unstable/cli"
|
||||||
|
import * as Config from "effect/Config"
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as FileSystem from "effect/FileSystem"
|
||||||
|
import * as Option from "effect/Option"
|
||||||
|
import * as Path from "effect/Path"
|
||||||
|
import { fileURLToPath } from "node:url"
|
||||||
|
import { ServerConfig } from "./config.ts"
|
||||||
|
import { runMigrations } from "./migrations.ts"
|
||||||
|
import { runServer } from "./server.ts"
|
||||||
|
import type { ServerConfigData } from "./config.ts"
|
||||||
|
|
||||||
|
const defaultAssetsDir = fileURLToPath(new URL("../../public", import.meta.url))
|
||||||
|
const defaultDbFilename = fileURLToPath(new URL("../../todo.sqlite", import.meta.url))
|
||||||
|
|
||||||
|
const hostFlag = Flag.string("host").pipe(
|
||||||
|
Flag.withDescription("Host interface to bind"),
|
||||||
|
Flag.optional
|
||||||
|
)
|
||||||
|
|
||||||
|
const portFlag = Flag.integer("port").pipe(
|
||||||
|
Flag.withDescription("Port to listen on"),
|
||||||
|
Flag.optional
|
||||||
|
)
|
||||||
|
|
||||||
|
const assetsFlag = Flag.directory("assets").pipe(
|
||||||
|
Flag.withDescription("Directory of static assets"),
|
||||||
|
Flag.optional
|
||||||
|
)
|
||||||
|
|
||||||
|
const dbFlag = Flag.string("db").pipe(
|
||||||
|
Flag.withDescription("SQLite database filename"),
|
||||||
|
Flag.optional
|
||||||
|
)
|
||||||
|
|
||||||
|
const requestLoggingFlag = Flag.boolean("request-logging").pipe(
|
||||||
|
Flag.withDescription("Enable request logging"),
|
||||||
|
Flag.optional
|
||||||
|
)
|
||||||
|
|
||||||
|
const frontendDevOriginFlag = Flag.string("frontend-dev-origin").pipe(
|
||||||
|
Flag.withDescription("Redirect frontend GET requests to a Vite dev server origin"),
|
||||||
|
Flag.optional
|
||||||
|
)
|
||||||
|
|
||||||
|
const EnvServerConfig = Config.unwrap({
|
||||||
|
host: Config.string("HOST").pipe(Config.withDefault("127.0.0.1")),
|
||||||
|
port: Config.port("PORT").pipe(Config.withDefault(8787)),
|
||||||
|
assetsDir: Config.string("ASSETS_DIR").pipe(Config.withDefault(defaultAssetsDir)),
|
||||||
|
dbFilename: Config.string("DB_FILENAME").pipe(Config.withDefault(defaultDbFilename)),
|
||||||
|
requestLogging: Config.boolean("REQUEST_LOGGING").pipe(Config.withDefault(true)),
|
||||||
|
frontendDevOrigin: Config.string("FRONTEND_DEV_ORIGIN").pipe(
|
||||||
|
Config.option,
|
||||||
|
Config.map(Option.getOrUndefined)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export interface CliServerFlags {
|
||||||
|
readonly host: Option.Option<string>
|
||||||
|
readonly port: Option.Option<number>
|
||||||
|
readonly assets: Option.Option<string>
|
||||||
|
readonly db: Option.Option<string>
|
||||||
|
readonly requestLogging: Option.Option<boolean>
|
||||||
|
readonly frontendDevOrigin: Option.Option<string>
|
||||||
|
}
|
||||||
|
|
||||||
|
export const resolveServerConfig = (
|
||||||
|
flags: CliServerFlags
|
||||||
|
): Effect.Effect<ServerConfigData, Config.ConfigError> =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const env = yield* EnvServerConfig
|
||||||
|
return {
|
||||||
|
host: Option.getOrElse(flags.host, () => env.host),
|
||||||
|
port: Option.getOrElse(flags.port, () => env.port),
|
||||||
|
assetsDir: Option.getOrElse(flags.assets, () => env.assetsDir),
|
||||||
|
dbFilename: Option.getOrElse(flags.db, () => env.dbFilename),
|
||||||
|
requestLogging: Option.getOrElse(flags.requestLogging, () => env.requestLogging),
|
||||||
|
frontendDevOrigin: Option.getOrElse(flags.frontendDevOrigin, () => env.frontendDevOrigin)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
export const resetDatabase = (dbFilename: string) =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const fs = yield* FileSystem.FileSystem
|
||||||
|
const path = yield* Path.Path
|
||||||
|
|
||||||
|
if (dbFilename !== ":memory:") {
|
||||||
|
yield* fs.remove(path.resolve(dbFilename), { force: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
const sqliteLayer = SqliteNode.SqliteClient.layer({
|
||||||
|
filename: dbFilename
|
||||||
|
})
|
||||||
|
|
||||||
|
yield* runMigrations.pipe(Effect.provide(sqliteLayer))
|
||||||
|
})
|
||||||
|
|
||||||
|
const commandFlags = {
|
||||||
|
host: hostFlag,
|
||||||
|
port: portFlag,
|
||||||
|
assets: assetsFlag,
|
||||||
|
db: dbFlag,
|
||||||
|
requestLogging: requestLoggingFlag,
|
||||||
|
frontendDevOrigin: frontendDevOriginFlag
|
||||||
|
} as const
|
||||||
|
|
||||||
|
const rootCommand = Command.make("effect-http-ws-cli", commandFlags).pipe(
|
||||||
|
Command.withDescription("Run a unified Effect HTTP + WebSocket server"),
|
||||||
|
Command.withHandler((flags) =>
|
||||||
|
Effect.flatMap(resolveServerConfig(flags), (config) =>
|
||||||
|
runServer.pipe(Effect.provideService(ServerConfig, config)))),
|
||||||
|
)
|
||||||
|
|
||||||
|
const resetCommand = Command.make("reset", commandFlags).pipe(
|
||||||
|
Command.withDescription("Delete the SQLite database file and rerun migrations"),
|
||||||
|
Command.withHandler((flags) =>
|
||||||
|
Effect.flatMap(resolveServerConfig(flags), (config) => resetDatabase(config.dbFilename))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
export const cli = rootCommand.pipe(
|
||||||
|
Command.withSubcommands([resetCommand])
|
||||||
|
)
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import { NodeSocket } from "@effect/platform-node"
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as Layer from "effect/Layer"
|
||||||
|
import * as RpcClient from "effect/unstable/rpc/RpcClient"
|
||||||
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization"
|
||||||
|
import * as Stream from "effect/Stream"
|
||||||
|
import { WsRpcGroup } from "./contracts.ts"
|
||||||
|
|
||||||
|
export const wsRpcProtocolLayer = (wsUrl: string) =>
|
||||||
|
RpcClient.layerProtocolSocket().pipe(
|
||||||
|
Layer.provide(NodeSocket.layerWebSocket(wsUrl)),
|
||||||
|
Layer.provide(RpcSerialization.layerJson)
|
||||||
|
)
|
||||||
|
|
||||||
|
export const makeWsRpcClient = RpcClient.make(WsRpcGroup)
|
||||||
|
type WsRpcClient = typeof makeWsRpcClient extends Effect.Effect<infer Client, any, any> ? Client : never
|
||||||
|
|
||||||
|
export const withWsRpcClient = <A, E, R>(
|
||||||
|
wsUrl: string,
|
||||||
|
f: (client: WsRpcClient) => Effect.Effect<A, E, R>
|
||||||
|
) =>
|
||||||
|
makeWsRpcClient.pipe(
|
||||||
|
Effect.flatMap(f),
|
||||||
|
Effect.provide(wsRpcProtocolLayer(wsUrl))
|
||||||
|
)
|
||||||
|
|
||||||
|
export const runClientExample = (wsUrl: string) =>
|
||||||
|
Effect.scoped(
|
||||||
|
withWsRpcClient(wsUrl, (client) =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const echoed = yield* client.echo({ text: "hello from client" })
|
||||||
|
const summed = yield* client.sum({ left: 20, right: 22 })
|
||||||
|
const time = yield* client.time(undefined)
|
||||||
|
return { echoed, summed, time }
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
export const runSubscriptionExample = (wsUrl: string, modelId: string) =>
|
||||||
|
Effect.scoped(
|
||||||
|
withWsRpcClient(wsUrl, (client) =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const snapshot = yield* client.listTodos({ includeArchived: true })
|
||||||
|
const todo = snapshot.todos[0]
|
||||||
|
if (!todo) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
yield* client.renameTodo({ id: todo.id, title: `${modelId}: first` })
|
||||||
|
yield* client.completeTodo({ id: todo.id, completed: true })
|
||||||
|
|
||||||
|
return yield* client.subscribeTodos({ fromOffset: snapshot.offset, includeArchived: true }).pipe(
|
||||||
|
Stream.take(2),
|
||||||
|
Stream.runCollect
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import * as ServiceMap from "effect/ServiceMap"
|
||||||
|
|
||||||
|
export interface ServerConfigData {
|
||||||
|
readonly host: string
|
||||||
|
readonly port: number
|
||||||
|
readonly assetsDir: string
|
||||||
|
readonly dbFilename: string
|
||||||
|
readonly requestLogging: boolean
|
||||||
|
readonly frontendDevOrigin: string | undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ServerConfig extends ServiceMap.Service<ServerConfig, ServerConfigData>()(
|
||||||
|
"effect-http-ws-cli/ServerConfig"
|
||||||
|
) {}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
import * as Schema from "effect/Schema"
|
||||||
|
import * as Rpc from "effect/unstable/rpc/Rpc"
|
||||||
|
import * as RpcGroup from "effect/unstable/rpc/RpcGroup"
|
||||||
|
|
||||||
|
export const EchoPayload = Schema.Struct({
|
||||||
|
text: Schema.String
|
||||||
|
})
|
||||||
|
|
||||||
|
export const EchoResult = Schema.Struct({
|
||||||
|
text: Schema.String
|
||||||
|
})
|
||||||
|
|
||||||
|
export const SumPayload = Schema.Struct({
|
||||||
|
left: Schema.Number,
|
||||||
|
right: Schema.Number
|
||||||
|
})
|
||||||
|
|
||||||
|
export const SumResult = Schema.Struct({
|
||||||
|
total: Schema.Number
|
||||||
|
})
|
||||||
|
|
||||||
|
export const TimeResult = Schema.Struct({
|
||||||
|
iso: Schema.String
|
||||||
|
})
|
||||||
|
|
||||||
|
export const Todo = Schema.Struct({
|
||||||
|
id: Schema.String,
|
||||||
|
title: Schema.String,
|
||||||
|
completed: Schema.Boolean,
|
||||||
|
archived: Schema.Boolean,
|
||||||
|
revision: Schema.Number,
|
||||||
|
updatedAt: Schema.String
|
||||||
|
})
|
||||||
|
export type Todo = Schema.Schema.Type<typeof Todo>
|
||||||
|
|
||||||
|
export const TodoChange = Schema.Union([
|
||||||
|
Schema.Struct({
|
||||||
|
_tag: Schema.Literal("TodoCreated")
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
_tag: Schema.Literal("TodoRenamed"),
|
||||||
|
title: Schema.String
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
_tag: Schema.Literal("TodoCompleted"),
|
||||||
|
completed: Schema.Boolean
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
_tag: Schema.Literal("TodoArchived"),
|
||||||
|
archived: Schema.Boolean
|
||||||
|
})
|
||||||
|
])
|
||||||
|
export type TodoChange = Schema.Schema.Type<typeof TodoChange>
|
||||||
|
|
||||||
|
export const TodoEvent = Schema.Struct({
|
||||||
|
offset: Schema.Number,
|
||||||
|
at: Schema.String,
|
||||||
|
todo: Todo,
|
||||||
|
change: TodoChange
|
||||||
|
})
|
||||||
|
export type TodoEvent = Schema.Schema.Type<typeof TodoEvent>
|
||||||
|
|
||||||
|
export const TodoSnapshot = Schema.Struct({
|
||||||
|
offset: Schema.Number,
|
||||||
|
todos: Schema.Array(Todo)
|
||||||
|
})
|
||||||
|
export type TodoSnapshot = Schema.Schema.Type<typeof TodoSnapshot>
|
||||||
|
|
||||||
|
export const EchoRpc = Rpc.make("echo", {
|
||||||
|
payload: EchoPayload,
|
||||||
|
success: EchoResult
|
||||||
|
})
|
||||||
|
|
||||||
|
export const SumRpc = Rpc.make("sum", {
|
||||||
|
payload: SumPayload,
|
||||||
|
success: SumResult
|
||||||
|
})
|
||||||
|
|
||||||
|
export const TimeRpc = Rpc.make("time", {
|
||||||
|
success: TimeResult
|
||||||
|
})
|
||||||
|
|
||||||
|
export const ListTodosRpc = Rpc.make("listTodos", {
|
||||||
|
payload: Schema.Struct({
|
||||||
|
includeArchived: Schema.Boolean
|
||||||
|
}),
|
||||||
|
success: TodoSnapshot
|
||||||
|
})
|
||||||
|
|
||||||
|
export const RenameTodoRpc = Rpc.make("renameTodo", {
|
||||||
|
payload: Schema.Struct({
|
||||||
|
id: Schema.String,
|
||||||
|
title: Schema.String
|
||||||
|
}),
|
||||||
|
success: TodoEvent
|
||||||
|
})
|
||||||
|
|
||||||
|
export const CompleteTodoRpc = Rpc.make("completeTodo", {
|
||||||
|
payload: Schema.Struct({
|
||||||
|
id: Schema.String,
|
||||||
|
completed: Schema.Boolean
|
||||||
|
}),
|
||||||
|
success: TodoEvent
|
||||||
|
})
|
||||||
|
|
||||||
|
export const ArchiveTodoRpc = Rpc.make("archiveTodo", {
|
||||||
|
payload: Schema.Struct({
|
||||||
|
id: Schema.String,
|
||||||
|
archived: Schema.Boolean
|
||||||
|
}),
|
||||||
|
success: TodoEvent
|
||||||
|
})
|
||||||
|
|
||||||
|
export const SubscribeTodosRpc = Rpc.make("subscribeTodos", {
|
||||||
|
payload: Schema.Struct({
|
||||||
|
fromOffset: Schema.Number,
|
||||||
|
includeArchived: Schema.Boolean
|
||||||
|
}),
|
||||||
|
success: TodoEvent,
|
||||||
|
stream: true
|
||||||
|
})
|
||||||
|
|
||||||
|
export const WsRpcGroup = RpcGroup.make(
|
||||||
|
EchoRpc,
|
||||||
|
SumRpc,
|
||||||
|
TimeRpc,
|
||||||
|
ListTodosRpc,
|
||||||
|
RenameTodoRpc,
|
||||||
|
CompleteTodoRpc,
|
||||||
|
ArchiveTodoRpc,
|
||||||
|
SubscribeTodosRpc
|
||||||
|
)
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import * as Schema from "effect/Schema"
|
||||||
|
import * as SchemaTransformation from "effect/SchemaTransformation"
|
||||||
|
|
||||||
|
export const ClientMessage = Schema.Union([
|
||||||
|
Schema.Struct({
|
||||||
|
kind: Schema.Literal("echo"),
|
||||||
|
text: Schema.String
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
kind: Schema.Literal("sum"),
|
||||||
|
left: Schema.Number,
|
||||||
|
right: Schema.Number
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
kind: Schema.Literal("time")
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
export type ClientMessage = Schema.Schema.Type<typeof ClientMessage>
|
||||||
|
|
||||||
|
export const ServerMessage = Schema.Union([
|
||||||
|
Schema.Struct({
|
||||||
|
kind: Schema.Literal("echo"),
|
||||||
|
text: Schema.String
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
kind: Schema.Literal("sumResult"),
|
||||||
|
total: Schema.Number
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
kind: Schema.Literal("time"),
|
||||||
|
iso: Schema.String
|
||||||
|
}),
|
||||||
|
Schema.Struct({
|
||||||
|
kind: Schema.Literal("error"),
|
||||||
|
error: Schema.String
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
export type ServerMessage = Schema.Schema.Type<typeof ServerMessage>
|
||||||
|
|
||||||
|
export const decodeClientMessage = Schema.decodeUnknownEffect(ClientMessage)
|
||||||
|
|
||||||
|
const Utf8StringFromUint8Array = Schema.Uint8Array.pipe(
|
||||||
|
Schema.decodeTo(
|
||||||
|
Schema.String,
|
||||||
|
SchemaTransformation.transform({
|
||||||
|
decode: (bytes) => new TextDecoder().decode(bytes),
|
||||||
|
encode: (text) => new TextEncoder().encode(text)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
const ClientMessageFromWire = Schema.Union([
|
||||||
|
Schema.String,
|
||||||
|
Utf8StringFromUint8Array
|
||||||
|
]).pipe(
|
||||||
|
Schema.decodeTo(Schema.fromJsonString(ClientMessage))
|
||||||
|
)
|
||||||
|
|
||||||
|
export const decodeWireClientMessage = Schema.decodeUnknownEffect(ClientMessageFromWire)
|
||||||
|
|
||||||
|
export const routeClientMessage = (message: ClientMessage): ServerMessage => {
|
||||||
|
switch (message.kind) {
|
||||||
|
case "echo":
|
||||||
|
return { kind: "echo", text: message.text }
|
||||||
|
case "sum":
|
||||||
|
return { kind: "sumResult", total: message.left + message.right }
|
||||||
|
case "time":
|
||||||
|
return { kind: "time", iso: new Date().toISOString() }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/**
|
||||||
|
* MigrationsLive - Migration runner with inline loader
|
||||||
|
*
|
||||||
|
* Uses Migrator.make with fromRecord to define migrations inline.
|
||||||
|
* All migrations are statically imported - no dynamic file system loading.
|
||||||
|
*
|
||||||
|
* Migrations run automatically when the MigrationsLive layer is provided,
|
||||||
|
* ensuring the database schema is up-to-date before the application starts.
|
||||||
|
*/
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as Layer from "effect/Layer"
|
||||||
|
import * as ServiceMap from "effect/ServiceMap"
|
||||||
|
import * as Migrator from "effect/unstable/sql/Migrator"
|
||||||
|
import Migration0001 from "./Migrations/001_TodoSchema.ts"
|
||||||
|
|
||||||
|
const loader = Migrator.fromRecord({
|
||||||
|
"1_TodoSchema": Migration0001
|
||||||
|
})
|
||||||
|
|
||||||
|
const run = Migrator.make({})
|
||||||
|
|
||||||
|
export const runMigrations = Effect.gen(function*() {
|
||||||
|
yield* Effect.log("Running migrations...")
|
||||||
|
yield* run({ loader })
|
||||||
|
yield* Effect.log("Migrations ran successfully")
|
||||||
|
})
|
||||||
|
|
||||||
|
export interface MigrationsReadyApi {
|
||||||
|
readonly ready: true
|
||||||
|
}
|
||||||
|
|
||||||
|
export class MigrationsReady extends ServiceMap.Service<MigrationsReady, MigrationsReadyApi>()(
|
||||||
|
"effect-http-ws-cli/MigrationsReady"
|
||||||
|
) {}
|
||||||
|
|
||||||
|
export const MigrationsLive = Layer.effect(
|
||||||
|
MigrationsReady,
|
||||||
|
runMigrations.pipe(
|
||||||
|
Effect.as(MigrationsReady.of({ ready: true }))
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,268 @@
|
|||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as Layer from "effect/Layer"
|
||||||
|
import * as Option from "effect/Option"
|
||||||
|
import * as PubSub from "effect/PubSub"
|
||||||
|
import * as Schema from "effect/Schema"
|
||||||
|
import * as ServiceMap from "effect/ServiceMap"
|
||||||
|
import * as Stream from "effect/Stream"
|
||||||
|
import * as SqlClient from "effect/unstable/sql/SqlClient"
|
||||||
|
import * as SqlSchema from "effect/unstable/sql/SqlSchema"
|
||||||
|
import type { Todo, TodoChange, TodoEvent, TodoSnapshot } from "./contracts.ts"
|
||||||
|
import { Todo as TodoSchema, TodoChange as TodoChangeSchema } from "./contracts.ts"
|
||||||
|
import { MigrationsReady } from "./migrations.ts"
|
||||||
|
|
||||||
|
export interface TodoStoreApi {
|
||||||
|
readonly list: (input: {
|
||||||
|
readonly includeArchived: boolean
|
||||||
|
}) => Effect.Effect<TodoSnapshot, never, SqlClient.SqlClient>
|
||||||
|
readonly rename: (input: {
|
||||||
|
readonly id: string
|
||||||
|
readonly title: string
|
||||||
|
}) => Effect.Effect<TodoEvent, never, SqlClient.SqlClient>
|
||||||
|
readonly complete: (input: {
|
||||||
|
readonly id: string
|
||||||
|
readonly completed: boolean
|
||||||
|
}) => Effect.Effect<TodoEvent, never, SqlClient.SqlClient>
|
||||||
|
readonly archive: (input: {
|
||||||
|
readonly id: string
|
||||||
|
readonly archived: boolean
|
||||||
|
}) => Effect.Effect<TodoEvent, never, SqlClient.SqlClient>
|
||||||
|
readonly subscribe: (input: {
|
||||||
|
readonly fromOffset: number
|
||||||
|
readonly includeArchived: boolean
|
||||||
|
}) => Stream.Stream<TodoEvent, never, SqlClient.SqlClient>
|
||||||
|
}
|
||||||
|
|
||||||
|
export class TodoStore extends ServiceMap.Service<TodoStore, TodoStoreApi>()(
|
||||||
|
"effect-http-ws-cli/TodoStore"
|
||||||
|
) {}
|
||||||
|
|
||||||
|
const TodoRow = Schema.Struct({
|
||||||
|
id: Schema.String,
|
||||||
|
title: Schema.String,
|
||||||
|
completed: Schema.BooleanFromBit,
|
||||||
|
archived: Schema.BooleanFromBit,
|
||||||
|
revision: Schema.Number,
|
||||||
|
updatedAt: Schema.String
|
||||||
|
})
|
||||||
|
|
||||||
|
const TodoEventRow = Schema.Struct({
|
||||||
|
offset: Schema.Number,
|
||||||
|
at: Schema.String,
|
||||||
|
todo: Schema.fromJsonString(TodoSchema),
|
||||||
|
change: Schema.fromJsonString(TodoChangeSchema)
|
||||||
|
})
|
||||||
|
|
||||||
|
const EventInsertRequest = Schema.Struct({
|
||||||
|
at: Schema.String,
|
||||||
|
todo: Schema.fromJsonString(TodoSchema),
|
||||||
|
change: Schema.fromJsonString(TodoChangeSchema),
|
||||||
|
archived: Schema.BooleanFromBit
|
||||||
|
})
|
||||||
|
|
||||||
|
const ListRequest = Schema.Struct({
|
||||||
|
includeArchived: Schema.Boolean
|
||||||
|
})
|
||||||
|
|
||||||
|
const CatchupRequest = Schema.Struct({
|
||||||
|
fromOffset: Schema.Number,
|
||||||
|
includeArchived: Schema.Boolean
|
||||||
|
})
|
||||||
|
|
||||||
|
const OffsetRow = Schema.Struct({
|
||||||
|
offset: Schema.Number
|
||||||
|
})
|
||||||
|
|
||||||
|
const makeQueries = (sql: SqlClient.SqlClient) => {
|
||||||
|
const listTodoRows = SqlSchema.findAll({
|
||||||
|
Request: ListRequest,
|
||||||
|
Result: TodoRow,
|
||||||
|
execute: (request) =>
|
||||||
|
request.includeArchived
|
||||||
|
? sql<Todo>`
|
||||||
|
SELECT id, title, completed, archived, revision, updated_at AS updatedAt
|
||||||
|
FROM todos
|
||||||
|
ORDER BY id
|
||||||
|
`
|
||||||
|
: sql<Todo>`
|
||||||
|
SELECT id, title, completed, archived, revision, updated_at AS updatedAt
|
||||||
|
FROM todos
|
||||||
|
WHERE archived = 0
|
||||||
|
ORDER BY id
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
const findTodoById = SqlSchema.findOneOption({
|
||||||
|
Request: Schema.String,
|
||||||
|
Result: TodoRow,
|
||||||
|
execute: (id) => sql<Todo>`
|
||||||
|
SELECT id, title, completed, archived, revision, updated_at AS updatedAt
|
||||||
|
FROM todos
|
||||||
|
WHERE id = ${id}
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
const upsertTodo = SqlSchema.void({
|
||||||
|
Request: TodoRow,
|
||||||
|
execute: (todo) => sql`
|
||||||
|
INSERT INTO todos (id, title, completed, archived, revision, updated_at)
|
||||||
|
VALUES (${todo.id}, ${todo.title}, ${todo.completed}, ${todo.archived}, ${todo.revision}, ${todo.updatedAt})
|
||||||
|
ON CONFLICT(id) DO UPDATE SET
|
||||||
|
title = excluded.title,
|
||||||
|
completed = excluded.completed,
|
||||||
|
archived = excluded.archived,
|
||||||
|
revision = excluded.revision,
|
||||||
|
updated_at = excluded.updated_at
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
const loadEventsSince = SqlSchema.findAll({
|
||||||
|
Request: CatchupRequest,
|
||||||
|
Result: TodoEventRow,
|
||||||
|
execute: (request) =>
|
||||||
|
request.includeArchived
|
||||||
|
? sql<TodoEvent>`
|
||||||
|
SELECT event_offset AS "offset", at, todo_json AS todo, change_json AS change
|
||||||
|
FROM todo_events
|
||||||
|
WHERE event_offset > ${request.fromOffset}
|
||||||
|
ORDER BY event_offset
|
||||||
|
`
|
||||||
|
: sql<TodoEvent>`
|
||||||
|
SELECT event_offset AS "offset", at, todo_json AS todo, change_json AS change
|
||||||
|
FROM todo_events
|
||||||
|
WHERE event_offset > ${request.fromOffset} AND archived = 0
|
||||||
|
ORDER BY event_offset
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
const insertTodoEvent = SqlSchema.findOne({
|
||||||
|
Request: EventInsertRequest,
|
||||||
|
Result: TodoEventRow,
|
||||||
|
execute: (request) => sql<TodoEvent>`
|
||||||
|
INSERT INTO todo_events (at, todo_json, change_json, archived)
|
||||||
|
VALUES (${request.at}, ${request.todo}, ${request.change}, ${request.archived})
|
||||||
|
RETURNING event_offset AS "offset", at, todo_json AS todo, change_json AS change
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
const currentOffset = SqlSchema.findOne({
|
||||||
|
Request: Schema.Undefined,
|
||||||
|
Result: OffsetRow,
|
||||||
|
execute: () => sql<{ readonly offset: number }>`
|
||||||
|
SELECT COALESCE(MAX(event_offset), 0) AS "offset"
|
||||||
|
FROM todo_events
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
listTodoRows,
|
||||||
|
findTodoById,
|
||||||
|
upsertTodo,
|
||||||
|
loadEventsSince,
|
||||||
|
insertTodoEvent,
|
||||||
|
currentOffset
|
||||||
|
} as const
|
||||||
|
}
|
||||||
|
|
||||||
|
export const layerTodoStore = Layer.effect(
|
||||||
|
TodoStore,
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* MigrationsReady
|
||||||
|
const eventsPubSub = yield* PubSub.unbounded<TodoEvent>()
|
||||||
|
|
||||||
|
const append = (
|
||||||
|
todoId: string,
|
||||||
|
change: TodoChange,
|
||||||
|
update: (todo: Todo) => Todo
|
||||||
|
): Effect.Effect<TodoEvent, never, SqlClient.SqlClient> =>
|
||||||
|
Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => {
|
||||||
|
const queries = makeQueries(sql)
|
||||||
|
return sql.withTransaction(
|
||||||
|
queries.findTodoById(todoId).pipe(
|
||||||
|
Effect.flatMap(
|
||||||
|
Option.match({
|
||||||
|
onNone: () => Effect.die(`Todo not found: ${todoId}`),
|
||||||
|
onSome: (todo) => {
|
||||||
|
const updated = update(todo)
|
||||||
|
return queries.upsertTodo(updated).pipe(
|
||||||
|
Effect.flatMap(() =>
|
||||||
|
queries.insertTodoEvent({
|
||||||
|
at: updated.updatedAt,
|
||||||
|
todo: updated,
|
||||||
|
change,
|
||||||
|
archived: updated.archived
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}).pipe(Effect.tap((event) => PubSub.publish(eventsPubSub, event)), Effect.orDie)
|
||||||
|
|
||||||
|
const visible = (todo: Todo, includeArchived: boolean) => includeArchived || !todo.archived
|
||||||
|
|
||||||
|
const subscribe = (input: {
|
||||||
|
readonly fromOffset: number
|
||||||
|
readonly includeArchived: boolean
|
||||||
|
}): Stream.Stream<TodoEvent, never, SqlClient.SqlClient> => {
|
||||||
|
const catchup = Stream.fromIterableEffect(
|
||||||
|
Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => makeQueries(sql).loadEventsSince(input))
|
||||||
|
).pipe(Stream.orDie)
|
||||||
|
|
||||||
|
const live = Stream.fromPubSub(eventsPubSub).pipe(
|
||||||
|
Stream.filter((event) => visible(event.todo, input.includeArchived))
|
||||||
|
)
|
||||||
|
|
||||||
|
return Stream.concat(catchup, live)
|
||||||
|
}
|
||||||
|
|
||||||
|
return TodoStore.of({
|
||||||
|
list: ({ includeArchived }) =>
|
||||||
|
Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => {
|
||||||
|
const queries = makeQueries(sql)
|
||||||
|
return Effect.all({
|
||||||
|
todos: queries.listTodoRows({ includeArchived }),
|
||||||
|
offset: queries.currentOffset(undefined).pipe(Effect.map(({ offset }) => offset))
|
||||||
|
}).pipe(
|
||||||
|
Effect.map(({ offset, todos }) => ({ offset, todos }))
|
||||||
|
)
|
||||||
|
}).pipe(Effect.orDie),
|
||||||
|
rename: ({ id, title }) =>
|
||||||
|
append(
|
||||||
|
id,
|
||||||
|
{ _tag: "TodoRenamed", title },
|
||||||
|
(todo) => ({
|
||||||
|
...todo,
|
||||||
|
title,
|
||||||
|
revision: todo.revision + 1,
|
||||||
|
updatedAt: new Date().toISOString()
|
||||||
|
})
|
||||||
|
),
|
||||||
|
complete: ({ id, completed }) =>
|
||||||
|
append(
|
||||||
|
id,
|
||||||
|
{ _tag: "TodoCompleted", completed },
|
||||||
|
(todo) => ({
|
||||||
|
...todo,
|
||||||
|
completed,
|
||||||
|
revision: todo.revision + 1,
|
||||||
|
updatedAt: new Date().toISOString()
|
||||||
|
})
|
||||||
|
),
|
||||||
|
archive: ({ id, archived }) =>
|
||||||
|
append(
|
||||||
|
id,
|
||||||
|
{ _tag: "TodoArchived", archived },
|
||||||
|
(todo) => ({
|
||||||
|
...todo,
|
||||||
|
archived,
|
||||||
|
revision: todo.revision + 1,
|
||||||
|
updatedAt: new Date().toISOString()
|
||||||
|
})
|
||||||
|
),
|
||||||
|
subscribe
|
||||||
|
})
|
||||||
|
})
|
||||||
|
)
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
import { NodeHttpServer } from "@effect/platform-node"
|
||||||
|
import * as SqliteNode from "@effect/sql-sqlite-node"
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as FileSystem from "effect/FileSystem"
|
||||||
|
import * as Layer from "effect/Layer"
|
||||||
|
import * as Path from "effect/Path"
|
||||||
|
import * as Http from "node:http"
|
||||||
|
import {
|
||||||
|
HttpRouter,
|
||||||
|
HttpServerRequest,
|
||||||
|
HttpServerResponse
|
||||||
|
} from "effect/unstable/http"
|
||||||
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization"
|
||||||
|
import * as RpcServer from "effect/unstable/rpc/RpcServer"
|
||||||
|
import * as Stream from "effect/Stream"
|
||||||
|
import {
|
||||||
|
ClientMessage,
|
||||||
|
routeClientMessage,
|
||||||
|
ServerMessage
|
||||||
|
} from "./messages.ts"
|
||||||
|
import { ServerConfig } from "./config.ts"
|
||||||
|
import { WsRpcGroup } from "./contracts.ts"
|
||||||
|
import { TodoStore, layerTodoStore } from "./model-store.ts"
|
||||||
|
import { MigrationsLive } from "./migrations.ts"
|
||||||
|
|
||||||
|
const respondMessage = HttpServerResponse.schemaJson(ServerMessage)
|
||||||
|
|
||||||
|
const messageDispatchRoute = HttpRouter.add(
|
||||||
|
"POST",
|
||||||
|
"/api/dispatch",
|
||||||
|
HttpServerRequest.schemaBodyJson(ClientMessage).pipe(
|
||||||
|
Effect.flatMap((message) => respondMessage(routeClientMessage(message))),
|
||||||
|
Effect.catchTag(
|
||||||
|
"SchemaError",
|
||||||
|
() => Effect.succeed(HttpServerResponse.jsonUnsafe({ kind: "error", error: "Invalid message schema" }, { status: 400 }))
|
||||||
|
),
|
||||||
|
Effect.catchTag(
|
||||||
|
"HttpServerError",
|
||||||
|
() => Effect.succeed(HttpServerResponse.jsonUnsafe({ kind: "error", error: "Invalid request body" }, { status: 400 }))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
const websocketRpcRoute = RpcServer.layerHttp({
|
||||||
|
group: WsRpcGroup,
|
||||||
|
path: "/ws",
|
||||||
|
protocol: "websocket"
|
||||||
|
}).pipe(
|
||||||
|
Layer.provide(WsRpcGroup.toLayer({
|
||||||
|
echo: ({ text }) => Effect.succeed({ text }),
|
||||||
|
sum: ({ left, right }) => Effect.succeed({ total: left + right }),
|
||||||
|
time: () => Effect.sync(() => ({ iso: new Date().toISOString() })),
|
||||||
|
listTodos: ({ includeArchived }) =>
|
||||||
|
Effect.flatMap(Effect.service(TodoStore), (store) => store.list({ includeArchived })),
|
||||||
|
renameTodo: ({ id, title }) =>
|
||||||
|
Effect.flatMap(Effect.service(TodoStore), (store) => store.rename({ id, title })),
|
||||||
|
completeTodo: ({ id, completed }) =>
|
||||||
|
Effect.flatMap(Effect.service(TodoStore), (store) => store.complete({ id, completed })),
|
||||||
|
archiveTodo: ({ id, archived }) =>
|
||||||
|
Effect.flatMap(Effect.service(TodoStore), (store) => store.archive({ id, archived })),
|
||||||
|
subscribeTodos: ({ fromOffset, includeArchived }) =>
|
||||||
|
Stream.unwrap(
|
||||||
|
Effect.map(
|
||||||
|
Effect.service(TodoStore),
|
||||||
|
(store) => store.subscribe({ fromOffset, includeArchived })
|
||||||
|
)
|
||||||
|
)
|
||||||
|
})),
|
||||||
|
Layer.provide(layerTodoStore),
|
||||||
|
Layer.provide(RpcSerialization.layerJson)
|
||||||
|
)
|
||||||
|
|
||||||
|
const staticRoute = HttpRouter.add(
|
||||||
|
"GET",
|
||||||
|
"*",
|
||||||
|
(request) =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const fs = yield* FileSystem.FileSystem
|
||||||
|
const path = yield* Path.Path
|
||||||
|
const config = yield* ServerConfig
|
||||||
|
const url = HttpServerRequest.toURL(request)
|
||||||
|
if (!url) {
|
||||||
|
return HttpServerResponse.text("Bad Request", { status: 400 })
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.frontendDevOrigin) {
|
||||||
|
return HttpServerResponse.redirect(
|
||||||
|
new URL(`${url.pathname}${url.search}`, config.frontendDevOrigin),
|
||||||
|
{
|
||||||
|
status: 307,
|
||||||
|
headers: { "cache-control": "no-store" }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const root = path.resolve(config.assetsDir)
|
||||||
|
const decodedPath = decodeURIComponent(url.pathname)
|
||||||
|
const target = decodedPath === "/"
|
||||||
|
? "index.html"
|
||||||
|
: decodedPath.endsWith("/")
|
||||||
|
? `${decodedPath.slice(1)}index.html`
|
||||||
|
: decodedPath.slice(1)
|
||||||
|
|
||||||
|
const normalizedTarget = path.normalize(target)
|
||||||
|
const absoluteTarget = path.resolve(root, normalizedTarget)
|
||||||
|
const relativeToRoot = path.relative(root, absoluteTarget)
|
||||||
|
|
||||||
|
if (relativeToRoot.startsWith("..") || path.isAbsolute(relativeToRoot)) {
|
||||||
|
return HttpServerResponse.text("Forbidden", { status: 403 })
|
||||||
|
}
|
||||||
|
|
||||||
|
const exists = yield* fs.exists(absoluteTarget)
|
||||||
|
if (!exists) {
|
||||||
|
return HttpServerResponse.text("Not Found", { status: 404 })
|
||||||
|
}
|
||||||
|
|
||||||
|
return yield* HttpServerResponse.file(absoluteTarget)
|
||||||
|
}).pipe(Effect.catchCause(() => Effect.succeed(HttpServerResponse.text("Bad Request", { status: 400 }))))
|
||||||
|
)
|
||||||
|
|
||||||
|
export const makeRoutesLayer =
|
||||||
|
Layer.mergeAll(
|
||||||
|
HttpRouter.add(
|
||||||
|
"GET",
|
||||||
|
"/health",
|
||||||
|
HttpServerResponse.json({ ok: true })
|
||||||
|
),
|
||||||
|
messageDispatchRoute,
|
||||||
|
websocketRpcRoute,
|
||||||
|
staticRoute
|
||||||
|
)
|
||||||
|
|
||||||
|
export const makeServerLayer = Layer.unwrap(
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const config = yield* ServerConfig
|
||||||
|
const sqliteLayer = SqliteNode.SqliteClient.layer({
|
||||||
|
filename: config.dbFilename
|
||||||
|
})
|
||||||
|
const persistenceLayer = MigrationsLive.pipe(
|
||||||
|
Layer.provideMerge(sqliteLayer)
|
||||||
|
)
|
||||||
|
|
||||||
|
return HttpRouter.serve(makeRoutesLayer, {
|
||||||
|
disableLogger: !config.requestLogging
|
||||||
|
}).pipe(
|
||||||
|
Layer.provideMerge(persistenceLayer),
|
||||||
|
Layer.provide(NodeHttpServer.layer(Http.createServer, {
|
||||||
|
host: config.host,
|
||||||
|
port: config.port
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
export const runServer = Layer.launch(makeServerLayer)
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
import { describe, expect, it } from "@effect/vitest"
|
||||||
|
import * as ConfigProvider from "effect/ConfigProvider"
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as Option from "effect/Option"
|
||||||
|
import { resolveServerConfig } from "../src/cli.ts"
|
||||||
|
|
||||||
|
describe("cli config resolution", () => {
|
||||||
|
it.effect("falls back to effect/config values when flags are omitted", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const resolved = yield* resolveServerConfig({
|
||||||
|
host: Option.none(),
|
||||||
|
port: Option.none(),
|
||||||
|
assets: Option.none(),
|
||||||
|
db: Option.none(),
|
||||||
|
requestLogging: Option.none(),
|
||||||
|
frontendDevOrigin: Option.none()
|
||||||
|
}).pipe(
|
||||||
|
Effect.provideService(
|
||||||
|
ConfigProvider.ConfigProvider,
|
||||||
|
ConfigProvider.fromEnv({
|
||||||
|
env: {
|
||||||
|
HOST: "0.0.0.0",
|
||||||
|
PORT: "4001",
|
||||||
|
ASSETS_DIR: "public",
|
||||||
|
DB_FILENAME: "dev.sqlite",
|
||||||
|
REQUEST_LOGGING: "false",
|
||||||
|
FRONTEND_DEV_ORIGIN: "http://127.0.0.1:5173"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(resolved).toEqual({
|
||||||
|
host: "0.0.0.0",
|
||||||
|
port: 4001,
|
||||||
|
assetsDir: "public",
|
||||||
|
dbFilename: "dev.sqlite",
|
||||||
|
requestLogging: false,
|
||||||
|
frontendDevOrigin: "http://127.0.0.1:5173"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
it.effect("uses CLI flags when provided", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const resolved = yield* resolveServerConfig({
|
||||||
|
host: Option.some("127.0.0.1"),
|
||||||
|
port: Option.some(8788),
|
||||||
|
assets: Option.some("public"),
|
||||||
|
db: Option.some("override.sqlite"),
|
||||||
|
requestLogging: Option.some(true),
|
||||||
|
frontendDevOrigin: Option.some("http://127.0.0.1:4173")
|
||||||
|
}).pipe(
|
||||||
|
Effect.provideService(
|
||||||
|
ConfigProvider.ConfigProvider,
|
||||||
|
ConfigProvider.fromEnv({
|
||||||
|
env: {
|
||||||
|
HOST: "0.0.0.0",
|
||||||
|
PORT: "4001",
|
||||||
|
ASSETS_DIR: "other",
|
||||||
|
DB_FILENAME: "ignored.sqlite",
|
||||||
|
REQUEST_LOGGING: "false",
|
||||||
|
FRONTEND_DEV_ORIGIN: "http://127.0.0.1:5173"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(resolved).toEqual({
|
||||||
|
host: "127.0.0.1",
|
||||||
|
port: 8788,
|
||||||
|
assetsDir: "public",
|
||||||
|
dbFilename: "override.sqlite",
|
||||||
|
requestLogging: true,
|
||||||
|
frontendDevOrigin: "http://127.0.0.1:4173"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
import * as NodeServices from "@effect/platform-node/NodeServices"
|
||||||
|
import * as SqliteNode from "@effect/sql-sqlite-node"
|
||||||
|
import { describe, expect, it } from "@effect/vitest"
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as Layer from "effect/Layer"
|
||||||
|
import * as SqlClient from "effect/unstable/sql/SqlClient"
|
||||||
|
import * as FileSystem from "node:fs"
|
||||||
|
import * as OS from "node:os"
|
||||||
|
import * as NodePath from "node:path"
|
||||||
|
import { resetDatabase } from "../src/cli.ts"
|
||||||
|
import { MigrationsLive } from "../src/migrations.ts"
|
||||||
|
|
||||||
|
const countRows = (dbFilename: string, tableName: string) =>
|
||||||
|
Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) =>
|
||||||
|
sql<{ readonly count: number }>`SELECT COUNT(*) AS count FROM ${sql(tableName)}`.pipe(
|
||||||
|
Effect.map((rows) => rows[0]?.count ?? 0)
|
||||||
|
)
|
||||||
|
).pipe(
|
||||||
|
Effect.provide(SqliteNode.SqliteClient.layer({ filename: dbFilename }))
|
||||||
|
)
|
||||||
|
|
||||||
|
const insertTodo = (dbFilename: string) =>
|
||||||
|
Effect.scoped(
|
||||||
|
Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => {
|
||||||
|
const now = new Date().toISOString()
|
||||||
|
const id = "todo-reset-test"
|
||||||
|
const title = "before-reset"
|
||||||
|
return sql.withTransaction(
|
||||||
|
sql`
|
||||||
|
INSERT INTO todos (id, title, completed, archived, revision, updated_at)
|
||||||
|
VALUES (${id}, ${title}, 0, 0, 1, ${now})
|
||||||
|
`.pipe(
|
||||||
|
Effect.flatMap(() =>
|
||||||
|
sql`
|
||||||
|
INSERT INTO todo_events (at, todo_json, change_json, archived)
|
||||||
|
VALUES (
|
||||||
|
${now},
|
||||||
|
${JSON.stringify({
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
completed: false,
|
||||||
|
archived: false,
|
||||||
|
revision: 1,
|
||||||
|
updatedAt: now
|
||||||
|
})},
|
||||||
|
${JSON.stringify({ _tag: "TodoCreated" })},
|
||||||
|
0
|
||||||
|
)
|
||||||
|
`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}).pipe(
|
||||||
|
Effect.provide(MigrationsLive.pipe(Layer.provideMerge(SqliteNode.SqliteClient.layer({ filename: dbFilename }))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
describe("reset command", () => {
|
||||||
|
it.effect("deletes the database and reruns migrations without reseeding todos", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const dbFilename = NodePath.join(
|
||||||
|
OS.tmpdir(),
|
||||||
|
`effect-http-ws-cli-reset-${Date.now()}-${Math.random().toString(16).slice(2)}.sqlite`
|
||||||
|
)
|
||||||
|
|
||||||
|
yield* insertTodo(dbFilename)
|
||||||
|
|
||||||
|
const beforeCount = yield* countRows(dbFilename, "todos")
|
||||||
|
expect(beforeCount).toBe(1)
|
||||||
|
|
||||||
|
yield* resetDatabase(dbFilename).pipe(
|
||||||
|
Effect.provide(NodeServices.layer)
|
||||||
|
)
|
||||||
|
|
||||||
|
const todoCount = yield* countRows(dbFilename, "todos")
|
||||||
|
const migrationCount = yield* countRows(dbFilename, "effect_sql_migrations")
|
||||||
|
|
||||||
|
expect(todoCount).toBe(0)
|
||||||
|
expect(migrationCount).toBe(1)
|
||||||
|
|
||||||
|
yield* Effect.sync(() => {
|
||||||
|
try {
|
||||||
|
FileSystem.rmSync(dbFilename, { force: true })
|
||||||
|
} catch {
|
||||||
|
// ignore cleanup failures in tests
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
@@ -0,0 +1,310 @@
|
|||||||
|
import { NodeHttpServer } from "@effect/platform-node"
|
||||||
|
import * as SqliteNode from "@effect/sql-sqlite-node"
|
||||||
|
import { describe, expect, it } from "@effect/vitest"
|
||||||
|
import * as Effect from "effect/Effect"
|
||||||
|
import * as Layer from "effect/Layer"
|
||||||
|
import * as Stream from "effect/Stream"
|
||||||
|
import * as FileSystem from "node:fs"
|
||||||
|
import * as OS from "node:os"
|
||||||
|
import * as NodePath from "node:path"
|
||||||
|
import {
|
||||||
|
HttpBody,
|
||||||
|
HttpClient,
|
||||||
|
HttpClientResponse,
|
||||||
|
HttpServer,
|
||||||
|
HttpRouter
|
||||||
|
} from "effect/unstable/http"
|
||||||
|
import * as SqlClient from "effect/unstable/sql/SqlClient"
|
||||||
|
import { ServerConfig } from "../src/config.ts"
|
||||||
|
import { MigrationsLive } from "../src/migrations.ts"
|
||||||
|
import { ServerMessage } from "../src/messages.ts"
|
||||||
|
import { withWsRpcClient } from "../src/client.ts"
|
||||||
|
import { makeRoutesLayer } from "../src/server.ts"
|
||||||
|
|
||||||
|
const testServerConfig = {
|
||||||
|
host: "127.0.0.1",
|
||||||
|
port: 0,
|
||||||
|
assetsDir: new URL("../../public", import.meta.url).pathname,
|
||||||
|
dbFilename: ":memory:",
|
||||||
|
requestLogging: false,
|
||||||
|
frontendDevOrigin: undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
const AppUnderTest = HttpRouter.serve(
|
||||||
|
makeRoutesLayer,
|
||||||
|
{
|
||||||
|
disableListenLog: true,
|
||||||
|
disableLogger: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const persistenceLayer = (dbFilename: string) => {
|
||||||
|
const sqliteLayer = SqliteNode.SqliteClient.layer({ filename: dbFilename })
|
||||||
|
return MigrationsLive.pipe(Layer.provideMerge(sqliteLayer))
|
||||||
|
}
|
||||||
|
|
||||||
|
const appLayer = (dbFilename: string) =>
|
||||||
|
AppUnderTest.pipe(Layer.provideMerge(persistenceLayer(dbFilename)))
|
||||||
|
|
||||||
|
const insertTodo = (dbFilename: string, id: string, title: string) =>
|
||||||
|
Effect.scoped(
|
||||||
|
Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => {
|
||||||
|
const now = new Date().toISOString()
|
||||||
|
return sql.withTransaction(
|
||||||
|
sql`
|
||||||
|
INSERT INTO todos (id, title, completed, archived, revision, updated_at)
|
||||||
|
VALUES (${id}, ${title}, 0, 0, 1, ${now})
|
||||||
|
`.pipe(
|
||||||
|
Effect.flatMap(() =>
|
||||||
|
sql`
|
||||||
|
INSERT INTO todo_events (at, todo_json, change_json, archived)
|
||||||
|
VALUES (
|
||||||
|
${now},
|
||||||
|
${JSON.stringify({
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
completed: false,
|
||||||
|
archived: false,
|
||||||
|
revision: 1,
|
||||||
|
updatedAt: now
|
||||||
|
})},
|
||||||
|
${JSON.stringify({ _tag: "TodoCreated" })},
|
||||||
|
0
|
||||||
|
)
|
||||||
|
`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}).pipe(
|
||||||
|
Effect.provide(persistenceLayer(dbFilename))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
describe("server", () => {
|
||||||
|
it.effect("routes HTTP messages validated by Schema", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe(
|
||||||
|
Effect.provideService(ServerConfig, testServerConfig)
|
||||||
|
)
|
||||||
|
const client = yield* HttpClient.HttpClient
|
||||||
|
const response = yield* client.post("/api/dispatch", {
|
||||||
|
body: HttpBody.jsonUnsafe({ kind: "sum", left: 20, right: 22 })
|
||||||
|
})
|
||||||
|
|
||||||
|
const parsed = yield* HttpClientResponse.schemaBodyJson(ServerMessage)(response)
|
||||||
|
expect(parsed).toEqual({ kind: "sumResult", total: 42 })
|
||||||
|
}).pipe(Effect.provide(NodeHttpServer.layerTest))
|
||||||
|
)
|
||||||
|
|
||||||
|
it.effect("serves static files from local filesystem", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe(
|
||||||
|
Effect.provideService(ServerConfig, testServerConfig)
|
||||||
|
)
|
||||||
|
const text = yield* HttpClient.get("/").pipe(
|
||||||
|
Effect.flatMap((response) => response.text)
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(text).toContain("effect-http-ws-cli")
|
||||||
|
}).pipe(Effect.provide(NodeHttpServer.layerTest))
|
||||||
|
)
|
||||||
|
|
||||||
|
it.effect("redirects frontend requests to the Vite dev server when enabled", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe(
|
||||||
|
Effect.provideService(ServerConfig, {
|
||||||
|
...testServerConfig,
|
||||||
|
frontendDevOrigin: "http://127.0.0.1:5173"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
const server = yield* HttpServer.HttpServer
|
||||||
|
const address = server.address as HttpServer.TcpAddress
|
||||||
|
const response = yield* Effect.promise(() =>
|
||||||
|
fetch(`http://127.0.0.1:${address.port}/todos?filter=active`, {
|
||||||
|
redirect: "manual"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(response.status).toBe(307)
|
||||||
|
expect(response.headers.get("location")).toBe("http://127.0.0.1:5173/todos?filter=active")
|
||||||
|
}).pipe(Effect.provide(NodeHttpServer.layerTest))
|
||||||
|
)
|
||||||
|
|
||||||
|
it.effect("routes WebSocket RPC messages with shared contracts", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe(
|
||||||
|
Effect.provideService(ServerConfig, testServerConfig)
|
||||||
|
)
|
||||||
|
const server = yield* HttpServer.HttpServer
|
||||||
|
const address = server.address as HttpServer.TcpAddress
|
||||||
|
const wsUrl = `ws://127.0.0.1:${address.port}/ws`
|
||||||
|
|
||||||
|
const response = yield* Effect.scoped(
|
||||||
|
withWsRpcClient(wsUrl, (client) => client.echo({ text: "hello from ws" }))
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(response).toEqual({ text: "hello from ws" })
|
||||||
|
}).pipe(Effect.provide(NodeHttpServer.layerTest))
|
||||||
|
)
|
||||||
|
|
||||||
|
it.effect("routes WebSocket RPC calls for multiple procedures", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe(
|
||||||
|
Effect.provideService(ServerConfig, testServerConfig)
|
||||||
|
)
|
||||||
|
const server = yield* HttpServer.HttpServer
|
||||||
|
const address = server.address as HttpServer.TcpAddress
|
||||||
|
const wsUrl = `ws://127.0.0.1:${address.port}/ws`
|
||||||
|
|
||||||
|
const result = yield* Effect.scoped(
|
||||||
|
withWsRpcClient(wsUrl, (client) =>
|
||||||
|
Effect.all({
|
||||||
|
sum: client.sum({ left: 1, right: 2 }),
|
||||||
|
time: client.time(undefined)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(result.sum).toEqual({ total: 3 })
|
||||||
|
expect(typeof result.time.iso).toBe("string")
|
||||||
|
}).pipe(Effect.provide(NodeHttpServer.layerTest))
|
||||||
|
)
|
||||||
|
|
||||||
|
it.effect("lists todos and streams todo updates from offset", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const dbFilename = NodePath.join(
|
||||||
|
OS.tmpdir(),
|
||||||
|
`effect-http-ws-cli-stream-${Date.now()}-${Math.random().toString(16).slice(2)}.sqlite`
|
||||||
|
)
|
||||||
|
|
||||||
|
yield* insertTodo(dbFilename, "todo-stream-test", "stream-seed")
|
||||||
|
|
||||||
|
const events = yield* Effect.scoped(
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* Layer.build(appLayer(dbFilename)).pipe(
|
||||||
|
Effect.provideService(ServerConfig, {
|
||||||
|
...testServerConfig,
|
||||||
|
dbFilename
|
||||||
|
})
|
||||||
|
)
|
||||||
|
const server = yield* HttpServer.HttpServer
|
||||||
|
const address = server.address as HttpServer.TcpAddress
|
||||||
|
const wsUrl = `ws://127.0.0.1:${address.port}/ws`
|
||||||
|
|
||||||
|
return yield* withWsRpcClient(wsUrl, (client) =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const snapshot = yield* client.listTodos({ includeArchived: true })
|
||||||
|
const firstTodo = snapshot.todos[0]
|
||||||
|
if (!firstTodo) {
|
||||||
|
return yield* Effect.die("Expected a todo fixture")
|
||||||
|
}
|
||||||
|
|
||||||
|
yield* client.renameTodo({ id: firstTodo.id, title: "alpha" })
|
||||||
|
yield* client.completeTodo({ id: firstTodo.id, completed: true })
|
||||||
|
yield* client.archiveTodo({ id: firstTodo.id, archived: true })
|
||||||
|
|
||||||
|
return yield* client.subscribeTodos({
|
||||||
|
fromOffset: snapshot.offset,
|
||||||
|
includeArchived: true
|
||||||
|
}).pipe(
|
||||||
|
Stream.take(3),
|
||||||
|
Stream.runCollect
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
).pipe(
|
||||||
|
Effect.ensuring(
|
||||||
|
Effect.sync(() => {
|
||||||
|
try {
|
||||||
|
FileSystem.rmSync(dbFilename, { force: true })
|
||||||
|
} catch {
|
||||||
|
// ignore cleanup failures in tests
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(events).toHaveLength(3)
|
||||||
|
expect(events[0]?.change).toEqual({ _tag: "TodoRenamed", title: "alpha" })
|
||||||
|
expect(events[1]?.change).toEqual({ _tag: "TodoCompleted", completed: true })
|
||||||
|
expect(events[2]?.change).toEqual({ _tag: "TodoArchived", archived: true })
|
||||||
|
expect(events[0]?.todo.title).toBe("alpha")
|
||||||
|
expect(events[1]?.todo.completed).toBe(true)
|
||||||
|
expect(events[2]?.todo.archived).toBe(true)
|
||||||
|
}).pipe(Effect.provide(NodeHttpServer.layerTest))
|
||||||
|
)
|
||||||
|
|
||||||
|
it.effect("persists todos across server restarts when using a file database", () =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const dbFilename = NodePath.join(
|
||||||
|
OS.tmpdir(),
|
||||||
|
`effect-http-ws-cli-${Date.now()}-${Math.random().toString(16).slice(2)}.sqlite`
|
||||||
|
)
|
||||||
|
|
||||||
|
yield* insertTodo(dbFilename, "todo-persist-test", "persist-seed")
|
||||||
|
|
||||||
|
const withServer = <A, E, R>(f: (wsUrl: string) => Effect.Effect<A, E, R>) =>
|
||||||
|
Effect.scoped(
|
||||||
|
Effect.gen(function*() {
|
||||||
|
yield* Layer.build(appLayer(dbFilename)).pipe(
|
||||||
|
Effect.provideService(ServerConfig, {
|
||||||
|
...testServerConfig,
|
||||||
|
dbFilename
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
const server = yield* HttpServer.HttpServer
|
||||||
|
const address = server.address as HttpServer.TcpAddress
|
||||||
|
const wsUrl = `ws://127.0.0.1:${address.port}/ws`
|
||||||
|
return yield* f(wsUrl)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
const renamedTodoId = yield* withServer((wsUrl) =>
|
||||||
|
Effect.scoped(
|
||||||
|
withWsRpcClient(wsUrl, (client) =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const snapshot = yield* client.listTodos({ includeArchived: true })
|
||||||
|
const firstTodo = snapshot.todos[0]
|
||||||
|
if (!firstTodo) {
|
||||||
|
return yield* Effect.die("Expected a todo fixture")
|
||||||
|
}
|
||||||
|
|
||||||
|
yield* client.renameTodo({ id: firstTodo.id, title: "persisted-title" })
|
||||||
|
return firstTodo.id
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
const persistedTitle = yield* withServer((wsUrl) =>
|
||||||
|
Effect.scoped(
|
||||||
|
withWsRpcClient(wsUrl, (client) =>
|
||||||
|
Effect.gen(function*() {
|
||||||
|
const snapshot = yield* client.listTodos({ includeArchived: true })
|
||||||
|
const persisted = snapshot.todos.find((todo) => todo.id === renamedTodoId)
|
||||||
|
if (!persisted) {
|
||||||
|
return yield* Effect.die("Expected persisted todo")
|
||||||
|
}
|
||||||
|
return persisted.title
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).pipe(
|
||||||
|
Effect.ensuring(
|
||||||
|
Effect.sync(() => {
|
||||||
|
try {
|
||||||
|
FileSystem.rmSync(dbFilename, { force: true })
|
||||||
|
} catch {
|
||||||
|
// ignore cleanup failures in tests
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(persistedTitle).toBe("persisted-title")
|
||||||
|
}).pipe(Effect.provide(NodeHttpServer.layerTest))
|
||||||
|
)
|
||||||
|
})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"include": ["src", "test", "vitest.config.ts"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { defineConfig } from "vitest/config"
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
include: ["test/**/*.test.ts"],
|
||||||
|
environment: "node"
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"rewriteRelativeImportExtensions": true,
|
||||||
|
"erasableSyntaxOnly": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"strict": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"types": ["node", "vitest/globals"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>effect-http-ws-cli rpc console</title>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=IBM+Plex+Sans:wght@400;500;700&display=swap" rel="stylesheet" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"name": "@effect-http-ws-cli/web",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"test": "vitest run",
|
||||||
|
"lint": "tsc --noEmit"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@effect-http-ws-cli/server": "workspace:*",
|
||||||
|
"@effect/atom-react": "catalog:",
|
||||||
|
"@tanstack/react-router": "^1.166.2",
|
||||||
|
"effect": "catalog:",
|
||||||
|
"react": "^19.2.0",
|
||||||
|
"react-dom": "^19.2.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tanstack/router-plugin": "^1.166.2",
|
||||||
|
"@types/react": "^19.2.7",
|
||||||
|
"@types/react-dom": "^19.2.3",
|
||||||
|
"@vitejs/plugin-react": "^5.1.1",
|
||||||
|
"@vitest/browser-playwright": "^4.0.18",
|
||||||
|
"playwright": "^1.58.2",
|
||||||
|
"typescript": "catalog:",
|
||||||
|
"vite": "^7.2.0",
|
||||||
|
"vitest": "catalog:",
|
||||||
|
"vitest-browser-react": "^2.0.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { StrictMode } from "react"
|
||||||
|
import { createRoot } from "react-dom/client"
|
||||||
|
import { RegistryProvider } from "@effect/atom-react"
|
||||||
|
import { createBrowserHistory, RouterProvider } from "@tanstack/react-router"
|
||||||
|
import { getRouter } from "./router"
|
||||||
|
import "./styles.css"
|
||||||
|
|
||||||
|
const history = createBrowserHistory()
|
||||||
|
const router = getRouter(history)
|
||||||
|
|
||||||
|
createRoot(document.getElementById("root")!).render(
|
||||||
|
<StrictMode>
|
||||||
|
<RegistryProvider>
|
||||||
|
<RouterProvider router={router} />
|
||||||
|
</RegistryProvider>
|
||||||
|
</StrictMode>
|
||||||
|
)
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
|
|
||||||
|
// This file was automatically generated by TanStack Router.
|
||||||
|
// You should NOT make any changes in this file as it will be overwritten.
|
||||||
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
||||||
|
|
||||||
|
import { Route as rootRouteImport } from './routes/__root'
|
||||||
|
import { Route as IndexRouteImport } from './routes/index'
|
||||||
|
|
||||||
|
const IndexRoute = IndexRouteImport.update({
|
||||||
|
id: '/',
|
||||||
|
path: '/',
|
||||||
|
getParentRoute: () => rootRouteImport,
|
||||||
|
} as any)
|
||||||
|
|
||||||
|
export interface FileRoutesByFullPath {
|
||||||
|
'/': typeof IndexRoute
|
||||||
|
}
|
||||||
|
export interface FileRoutesByTo {
|
||||||
|
'/': typeof IndexRoute
|
||||||
|
}
|
||||||
|
export interface FileRoutesById {
|
||||||
|
__root__: typeof rootRouteImport
|
||||||
|
'/': typeof IndexRoute
|
||||||
|
}
|
||||||
|
export interface FileRouteTypes {
|
||||||
|
fileRoutesByFullPath: FileRoutesByFullPath
|
||||||
|
fullPaths: '/'
|
||||||
|
fileRoutesByTo: FileRoutesByTo
|
||||||
|
to: '/'
|
||||||
|
id: '__root__' | '/'
|
||||||
|
fileRoutesById: FileRoutesById
|
||||||
|
}
|
||||||
|
export interface RootRouteChildren {
|
||||||
|
IndexRoute: typeof IndexRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module '@tanstack/react-router' {
|
||||||
|
interface FileRoutesByPath {
|
||||||
|
'/': {
|
||||||
|
id: '/'
|
||||||
|
path: '/'
|
||||||
|
fullPath: '/'
|
||||||
|
preLoaderRoute: typeof IndexRouteImport
|
||||||
|
parentRoute: typeof rootRouteImport
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const rootRouteChildren: RootRouteChildren = {
|
||||||
|
IndexRoute: IndexRoute,
|
||||||
|
}
|
||||||
|
export const routeTree = rootRouteImport
|
||||||
|
._addFileChildren(rootRouteChildren)
|
||||||
|
._addFileTypes<FileRouteTypes>()
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { createRouter, type RouterHistory } from "@tanstack/react-router"
|
||||||
|
import { routeTree } from "./routeTree.gen"
|
||||||
|
|
||||||
|
export const getRouter = (history: RouterHistory) =>
|
||||||
|
createRouter({
|
||||||
|
routeTree,
|
||||||
|
history
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
declare module "@tanstack/react-router" {
|
||||||
|
interface Register {
|
||||||
|
router: ReturnType<typeof getRouter>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { Outlet, createRootRoute } from "@tanstack/react-router"
|
||||||
|
|
||||||
|
export const Route = createRootRoute({
|
||||||
|
component: Outlet
|
||||||
|
})
|
||||||
@@ -0,0 +1,460 @@
|
|||||||
|
import { createFileRoute } from "@tanstack/react-router"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import { useEffect, useRef } from "react"
|
||||||
|
import * as Cause from "effect/Cause"
|
||||||
|
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult"
|
||||||
|
import { useAtomRefresh, useAtomSet, useAtomValue } from "@effect/atom-react"
|
||||||
|
import type { Todo, TodoEvent, TodoChange } from "@effect-http-ws-cli/server/contracts"
|
||||||
|
import {
|
||||||
|
archiveTodoMutationAtom,
|
||||||
|
completeTodoMutationAtom,
|
||||||
|
renameTodoMutationAtom,
|
||||||
|
subscribeTodosPullAtom,
|
||||||
|
todosSnapshotAtom
|
||||||
|
} from "../rpc"
|
||||||
|
import {
|
||||||
|
connectionAtom,
|
||||||
|
eventsAtom,
|
||||||
|
mutationBusyAtom,
|
||||||
|
todoProjectionAtom
|
||||||
|
} from "../state"
|
||||||
|
|
||||||
|
const reconnectBaseMs = 1_250
|
||||||
|
const reconnectMaxMs = 20_000
|
||||||
|
const maxReconnectAttempts = 8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/")({
|
||||||
|
component: IndexRoute
|
||||||
|
})
|
||||||
|
|
||||||
|
function IndexRoute() {
|
||||||
|
const setProjection = useAtomSet(todoProjectionAtom)
|
||||||
|
const setEvents = useAtomSet(eventsAtom)
|
||||||
|
const setConnection = useAtomSet(connectionAtom)
|
||||||
|
const setBusy = useAtomSet(mutationBusyAtom)
|
||||||
|
|
||||||
|
const snapshotResult = useAtomValue(todosSnapshotAtom)
|
||||||
|
const subscriptionPullResult = useAtomValue(subscribeTodosPullAtom)
|
||||||
|
const pullSubscription = useAtomSet(subscribeTodosPullAtom)
|
||||||
|
const refreshSubscription = useAtomRefresh(subscribeTodosPullAtom)
|
||||||
|
|
||||||
|
const seenOffsetsRef = useRef<Set<number>>(new Set())
|
||||||
|
const baselineOffsetRef = useRef(0)
|
||||||
|
const hasInitializedRef = useRef(false)
|
||||||
|
const hasStartedSubscriptionRef = useRef(false)
|
||||||
|
const brokenSubscriptionRef = useRef(false)
|
||||||
|
|
||||||
|
const reconnectAttemptsRef = useRef(0)
|
||||||
|
const reconnectTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||||
|
|
||||||
|
const clearReconnectTimer = () => {
|
||||||
|
if (reconnectTimerRef.current !== null) {
|
||||||
|
clearTimeout(reconnectTimerRef.current)
|
||||||
|
reconnectTimerRef.current = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const startSubscriptionPull = () => {
|
||||||
|
clearReconnectTimer()
|
||||||
|
if (!hasStartedSubscriptionRef.current) {
|
||||||
|
hasStartedSubscriptionRef.current = true
|
||||||
|
}
|
||||||
|
setConnection((current) => ({ ...current, subscriptionState: "connecting" }))
|
||||||
|
refreshSubscription()
|
||||||
|
pullSubscription(undefined)
|
||||||
|
}
|
||||||
|
|
||||||
|
const scheduleReconnect = (lastError: string) => {
|
||||||
|
brokenSubscriptionRef.current = true
|
||||||
|
reconnectAttemptsRef.current += 1
|
||||||
|
|
||||||
|
if (reconnectAttemptsRef.current > maxReconnectAttempts) {
|
||||||
|
setConnection((current) => ({
|
||||||
|
...current,
|
||||||
|
lastError,
|
||||||
|
subscriptionState: "idle"
|
||||||
|
}))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const delayMs = Math.min(
|
||||||
|
reconnectBaseMs * 2 ** Math.max(0, reconnectAttemptsRef.current - 1),
|
||||||
|
reconnectMaxMs
|
||||||
|
)
|
||||||
|
|
||||||
|
setConnection((current) => ({
|
||||||
|
...current,
|
||||||
|
lastError,
|
||||||
|
subscriptionState: "connecting"
|
||||||
|
}))
|
||||||
|
|
||||||
|
clearReconnectTimer()
|
||||||
|
reconnectTimerRef.current = setTimeout(() => {
|
||||||
|
reconnectTimerRef.current = null
|
||||||
|
startSubscriptionPull()
|
||||||
|
}, delayMs)
|
||||||
|
}
|
||||||
|
|
||||||
|
const addEvent = (event: TodoEvent): boolean => {
|
||||||
|
if (event.offset <= baselineOffsetRef.current) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (seenOffsetsRef.current.has(event.offset)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
seenOffsetsRef.current.add(event.offset)
|
||||||
|
setEvents((events) => [...events, event])
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
const applyEvent = (event: TodoEvent) => {
|
||||||
|
setProjection((current) => ({
|
||||||
|
...current,
|
||||||
|
lastOffset: Math.max(current.lastOffset, event.offset),
|
||||||
|
todos: sortTodos(
|
||||||
|
current.todos.some((todo) => todo.id === event.todo.id)
|
||||||
|
? current.todos.map((todo) => (todo.id === event.todo.id ? event.todo : todo))
|
||||||
|
: [...current.todos, event.todo]
|
||||||
|
),
|
||||||
|
titleDrafts: {
|
||||||
|
...current.titleDrafts,
|
||||||
|
[event.todo.id]: event.todo.title
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
const applyTodoEvent = (event: TodoEvent) => {
|
||||||
|
const isNew = addEvent(event)
|
||||||
|
if (isNew) {
|
||||||
|
applyEvent(event)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (AsyncResult.isInitial(snapshotResult)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AsyncResult.isFailure(snapshotResult)) {
|
||||||
|
scheduleReconnect(Cause.pretty(snapshotResult.cause))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const snapshot = snapshotResult.value
|
||||||
|
|
||||||
|
setProjection({
|
||||||
|
todos: sortTodos(snapshot.todos),
|
||||||
|
lastOffset: snapshot.offset,
|
||||||
|
titleDrafts: Object.fromEntries(snapshot.todos.map((todo) => [todo.id, todo.title]))
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!hasInitializedRef.current) {
|
||||||
|
hasInitializedRef.current = true
|
||||||
|
baselineOffsetRef.current = snapshot.offset
|
||||||
|
seenOffsetsRef.current = new Set()
|
||||||
|
setEvents([])
|
||||||
|
startSubscriptionPull()
|
||||||
|
}
|
||||||
|
}, [snapshotResult, setEvents, setProjection])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!hasStartedSubscriptionRef.current) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AsyncResult.isInitial(subscriptionPullResult)) {
|
||||||
|
setConnection((current) => ({
|
||||||
|
...current,
|
||||||
|
subscriptionState: subscriptionPullResult.waiting ? "connected" : "connecting"
|
||||||
|
}))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AsyncResult.isFailure(subscriptionPullResult)) {
|
||||||
|
scheduleReconnect(Cause.pretty(subscriptionPullResult.cause))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
reconnectAttemptsRef.current = 0
|
||||||
|
brokenSubscriptionRef.current = false
|
||||||
|
|
||||||
|
setConnection((current) => ({
|
||||||
|
...current,
|
||||||
|
lastError: null,
|
||||||
|
subscriptionState: "connected"
|
||||||
|
}))
|
||||||
|
|
||||||
|
for (const event of subscriptionPullResult.value.items) {
|
||||||
|
applyTodoEvent(event)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!subscriptionPullResult.value.done && !subscriptionPullResult.waiting) {
|
||||||
|
pullSubscription(undefined)
|
||||||
|
}
|
||||||
|
}, [pullSubscription, setConnection, subscriptionPullResult])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const reconnectOnFocus = () => {
|
||||||
|
if (document.visibilityState !== "visible") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!brokenSubscriptionRef.current) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
reconnectAttemptsRef.current = 0
|
||||||
|
startSubscriptionPull()
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("focus", reconnectOnFocus)
|
||||||
|
document.addEventListener("visibilitychange", reconnectOnFocus)
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("focus", reconnectOnFocus)
|
||||||
|
document.removeEventListener("visibilitychange", reconnectOnFocus)
|
||||||
|
}
|
||||||
|
}, [setConnection])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
clearReconnectTimer()
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const runMutation: MutationRunner = (label, run, onSuccess) => {
|
||||||
|
setBusy(label)
|
||||||
|
setConnection((current) => ({ ...current, lastError: null }))
|
||||||
|
|
||||||
|
void run().then(
|
||||||
|
(value) => {
|
||||||
|
onSuccess(value)
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
setConnection((current) => ({ ...current, lastError: Cause.pretty(error) }))
|
||||||
|
}
|
||||||
|
).finally(() => {
|
||||||
|
setBusy(null)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<main className="shell">
|
||||||
|
<Status />
|
||||||
|
|
||||||
|
<section className="hero">
|
||||||
|
<p className="eyebrow">effect-http-ws-cli</p>
|
||||||
|
<h1>Realtime Todo Stream</h1>
|
||||||
|
<p className="lead">
|
||||||
|
Snapshot on load, then live updates over typed WebSocket RPC subscriptions.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<TodoPanel runMutation={runMutation} applyTodoEvent={applyTodoEvent} />
|
||||||
|
<EventList />
|
||||||
|
<Footer />
|
||||||
|
</main>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
type MutationRunner = <A>(
|
||||||
|
label: string,
|
||||||
|
run: () => Promise<A>,
|
||||||
|
onSuccess: (value: A) => void
|
||||||
|
) => void
|
||||||
|
|
||||||
|
const sortTodos = (todos: ReadonlyArray<Todo>): ReadonlyArray<Todo> =>
|
||||||
|
[...todos].sort((a, b) => {
|
||||||
|
if (a.archived !== b.archived) return a.archived ? 1 : -1
|
||||||
|
if (a.completed !== b.completed) return a.completed ? 1 : -1
|
||||||
|
return a.id.localeCompare(b.id)
|
||||||
|
})
|
||||||
|
|
||||||
|
const describeChange = (change: TodoChange): string => {
|
||||||
|
switch (change._tag) {
|
||||||
|
case "TodoCreated":
|
||||||
|
return "created"
|
||||||
|
case "TodoRenamed":
|
||||||
|
return `renamed to "${change.title}"`
|
||||||
|
case "TodoCompleted":
|
||||||
|
return change.completed ? "completed" : "marked incomplete"
|
||||||
|
case "TodoArchived":
|
||||||
|
return change.archived ? "archived" : "unarchived"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const Status = () => {
|
||||||
|
const connection = useAtomValue(connectionAtom)
|
||||||
|
const busy = useAtomValue(mutationBusyAtom)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="panel status-panel">
|
||||||
|
<div className="status-grid">
|
||||||
|
<div className={`status-item status-subscription-${connection.subscriptionState}`}>
|
||||||
|
<span className="status-label">Subscription</span>
|
||||||
|
<strong>{connection.subscriptionState}</strong>
|
||||||
|
</div>
|
||||||
|
<div className={`status-item ${busy ? "status-mutation-busy" : "status-mutation-idle"}`}>
|
||||||
|
<span className="status-label">Mutation</span>
|
||||||
|
<strong>{busy ? busy : "idle"}</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const TodoPanel = (props: {
|
||||||
|
readonly runMutation: MutationRunner
|
||||||
|
readonly applyTodoEvent: (event: TodoEvent) => void
|
||||||
|
}) => {
|
||||||
|
const projection = useAtomValue(todoProjectionAtom)
|
||||||
|
const connection = useAtomValue(connectionAtom)
|
||||||
|
const setProjection = useAtomSet(todoProjectionAtom)
|
||||||
|
const renameTodo = useAtomSet(renameTodoMutationAtom, { mode: "promise" })
|
||||||
|
const completeTodo = useAtomSet(completeTodoMutationAtom, { mode: "promise" })
|
||||||
|
const archiveTodo = useAtomSet(archiveTodoMutationAtom, { mode: "promise" })
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="panel todo-panel">
|
||||||
|
<header className="todo-header">
|
||||||
|
<h2>Todos</h2>
|
||||||
|
<div className="meta">
|
||||||
|
<span>offset #{projection.lastOffset}</span>
|
||||||
|
<span>subscription: {connection.subscriptionState}</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<ul className="todo-list">
|
||||||
|
{projection.todos.map((todo) => (
|
||||||
|
<li
|
||||||
|
key={todo.id}
|
||||||
|
className={`todo-item${todo.completed ? " is-completed" : ""}${todo.archived ? " is-archived" : ""}`}
|
||||||
|
>
|
||||||
|
<div className="todo-main">
|
||||||
|
<input
|
||||||
|
value={projection.titleDrafts[todo.id] ?? todo.title}
|
||||||
|
onChange={(event) => {
|
||||||
|
setProjection((current) => ({
|
||||||
|
...current,
|
||||||
|
titleDrafts: {
|
||||||
|
...current.titleDrafts,
|
||||||
|
[todo.id]: event.target.value
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<small>
|
||||||
|
rev {todo.revision} · {new Date(todo.updatedAt).toLocaleTimeString()}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
<div className="todo-actions">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() =>
|
||||||
|
props.runMutation(
|
||||||
|
`rename:${todo.id}`,
|
||||||
|
() =>
|
||||||
|
renameTodo({
|
||||||
|
payload: {
|
||||||
|
id: todo.id,
|
||||||
|
title: projection.titleDrafts[todo.id] ?? todo.title
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
props.applyTodoEvent
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Rename
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() =>
|
||||||
|
props.runMutation(
|
||||||
|
`complete:${todo.id}`,
|
||||||
|
() =>
|
||||||
|
completeTodo({
|
||||||
|
payload: {
|
||||||
|
id: todo.id,
|
||||||
|
completed: !todo.completed
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
props.applyTodoEvent
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{todo.completed ? "Undo" : "Complete"}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() =>
|
||||||
|
props.runMutation(
|
||||||
|
`archive:${todo.id}`,
|
||||||
|
() =>
|
||||||
|
archiveTodo({
|
||||||
|
payload: {
|
||||||
|
id: todo.id,
|
||||||
|
archived: !todo.archived
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
props.applyTodoEvent
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{todo.archived ? "Unarchive" : "Archive"}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const EventList = () => {
|
||||||
|
const events = useAtomValue(eventsAtom)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="panel event-panel">
|
||||||
|
<header className="todo-header">
|
||||||
|
<h2>Events</h2>
|
||||||
|
<div className="meta">
|
||||||
|
<span>{events.length} total</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<ul className="event-list">
|
||||||
|
{[...events].reverse().map((event) => (
|
||||||
|
<li key={event.offset} className="event-item">
|
||||||
|
<div className="event-top">
|
||||||
|
<strong>#{event.offset}</strong>
|
||||||
|
<span>{new Date(event.at).toLocaleTimeString()}</span>
|
||||||
|
</div>
|
||||||
|
<div className="event-body">
|
||||||
|
<span>{event.todo.title}</span>
|
||||||
|
<small>{describeChange(event.change)}</small>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const Footer = () => {
|
||||||
|
const connection = useAtomValue(connectionAtom)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<footer className="footer">
|
||||||
|
{connection.lastError ? <span className="error">{connection.lastError}</span> : <span>no errors</span>}
|
||||||
|
</footer>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import * as Layer from "effect/Layer"
|
||||||
|
import * as RpcClient from "effect/unstable/rpc/RpcClient"
|
||||||
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization"
|
||||||
|
import * as AtomRpc from "effect/unstable/reactivity/AtomRpc"
|
||||||
|
import * as Socket from "effect/unstable/socket/Socket"
|
||||||
|
import { WsRpcGroup } from "@effect-http-ws-cli/server/contracts"
|
||||||
|
|
||||||
|
const wsUrl = () => {
|
||||||
|
const protocol = window.location.protocol === "https:" ? "wss" : "ws"
|
||||||
|
return `${protocol}://${window.location.host}/ws`
|
||||||
|
}
|
||||||
|
|
||||||
|
const protocolLayer = RpcClient.layerProtocolSocket({
|
||||||
|
retryTransientErrors: true
|
||||||
|
}).pipe(
|
||||||
|
Layer.provide(Socket.layerWebSocket(wsUrl())),
|
||||||
|
Layer.provide(Socket.layerWebSocketConstructorGlobal),
|
||||||
|
Layer.provide(RpcSerialization.layerJson)
|
||||||
|
)
|
||||||
|
|
||||||
|
export class TodoRpcClient extends AtomRpc.Service<TodoRpcClient>()("TodoRpcClient", {
|
||||||
|
group: WsRpcGroup,
|
||||||
|
protocol: protocolLayer
|
||||||
|
}) {}
|
||||||
|
|
||||||
|
export const todosSnapshotAtom = TodoRpcClient.query(
|
||||||
|
"listTodos",
|
||||||
|
{ includeArchived: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
export const subscribeTodosPullAtom = TodoRpcClient.query(
|
||||||
|
"subscribeTodos",
|
||||||
|
{
|
||||||
|
fromOffset: 0,
|
||||||
|
includeArchived: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export const renameTodoMutationAtom = TodoRpcClient.mutation("renameTodo")
|
||||||
|
export const completeTodoMutationAtom = TodoRpcClient.mutation("completeTodo")
|
||||||
|
export const archiveTodoMutationAtom = TodoRpcClient.mutation("archiveTodo")
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import * as Atom from "effect/unstable/reactivity/Atom"
|
||||||
|
import type { Todo, TodoEvent } from "@effect-http-ws-cli/server/contracts"
|
||||||
|
|
||||||
|
export type SubscriptionState = "connecting" | "connected" | "idle"
|
||||||
|
|
||||||
|
export interface TodoProjectionState {
|
||||||
|
readonly todos: ReadonlyArray<Todo>
|
||||||
|
readonly titleDrafts: Readonly<Record<string, string>>
|
||||||
|
readonly lastOffset: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ConnectionState {
|
||||||
|
readonly subscriptionState: SubscriptionState
|
||||||
|
readonly lastError: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export const todoProjectionAtom = Atom.make<TodoProjectionState>({
|
||||||
|
todos: [],
|
||||||
|
titleDrafts: {},
|
||||||
|
lastOffset: 0
|
||||||
|
}).pipe(Atom.withLabel("todo-projection"))
|
||||||
|
|
||||||
|
export const eventsAtom = Atom.make<ReadonlyArray<TodoEvent>>([]).pipe(
|
||||||
|
Atom.withLabel("events")
|
||||||
|
)
|
||||||
|
|
||||||
|
export const connectionAtom = Atom.make<ConnectionState>({
|
||||||
|
subscriptionState: "idle",
|
||||||
|
lastError: null
|
||||||
|
}).pipe(Atom.withLabel("connection"))
|
||||||
|
|
||||||
|
export const mutationBusyAtom = Atom.make<string | null>(null).pipe(
|
||||||
|
Atom.withLabel("mutation-busy")
|
||||||
|
)
|
||||||
@@ -0,0 +1,298 @@
|
|||||||
|
:root {
|
||||||
|
--paper: #f3f0e8;
|
||||||
|
--ink: #13222c;
|
||||||
|
--ink-soft: #345264;
|
||||||
|
--accent: #dc4f18;
|
||||||
|
--accent-soft: #f8bb68;
|
||||||
|
--panel: #fffdf6;
|
||||||
|
--line: #162f3f22;
|
||||||
|
--shadow: 0 16px 40px #0f1e291f;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
|
||||||
|
color: var(--ink);
|
||||||
|
background:
|
||||||
|
radial-gradient(circle at 10% 10%, #f7cf9a 0%, transparent 36%),
|
||||||
|
radial-gradient(circle at 92% 88%, #95c7d2 0%, transparent 32%),
|
||||||
|
linear-gradient(165deg, #ece8dc 0%, var(--paper) 48%, #e9dfcf 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shell {
|
||||||
|
width: min(1100px, 100% - 2rem);
|
||||||
|
margin: 1.5rem auto;
|
||||||
|
padding: 1.5rem;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 20px;
|
||||||
|
background: color-mix(in oklab, var(--paper), white 35%);
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 1.5rem;
|
||||||
|
border-radius: 16px;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
background: linear-gradient(140deg, #fff9ed 0%, #f7efe0 65%, #f2e7d4 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: 220px;
|
||||||
|
height: 220px;
|
||||||
|
right: -60px;
|
||||||
|
top: -90px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: linear-gradient(180deg, var(--accent-soft), transparent 70%);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eyebrow {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.72rem;
|
||||||
|
letter-spacing: 0.22em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2 {
|
||||||
|
font-family: "Archivo Black", Impact, sans-serif;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-top: 0.35rem;
|
||||||
|
font-size: clamp(1.5rem, 4vw, 2.35rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lead {
|
||||||
|
margin: 0.6rem 0 0;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
max-width: 68ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 14px;
|
||||||
|
padding: 1rem;
|
||||||
|
background: var(--panel);
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-panel {
|
||||||
|
margin-top: 0;
|
||||||
|
background: linear-gradient(140deg, #fbf7ee, #f1e8d7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-item {
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 0.55rem 0.7rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 0.75rem;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-label {
|
||||||
|
color: var(--ink-soft);
|
||||||
|
font-size: 0.82rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-subscription-connected {
|
||||||
|
border-color: #24704755;
|
||||||
|
background: #f1fbf5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-subscription-connecting {
|
||||||
|
border-color: #8d6a1b55;
|
||||||
|
background: #fff8eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-subscription-idle {
|
||||||
|
border-color: var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-mutation-busy {
|
||||||
|
border-color: #6b3b2e55;
|
||||||
|
background: #fff3ef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.75rem;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
font-size: 0.86rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-list {
|
||||||
|
margin: 0.8rem 0 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
display: grid;
|
||||||
|
gap: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-list {
|
||||||
|
margin: 0.8rem 0 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
display: grid;
|
||||||
|
gap: 0.5rem;
|
||||||
|
max-height: 260px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-item {
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #fff;
|
||||||
|
padding: 0.55rem 0.65rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 0.6rem;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-body {
|
||||||
|
margin-top: 0.2rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 0.75rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-body small {
|
||||||
|
color: var(--ink-soft);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-item {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.8rem;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #fff;
|
||||||
|
padding: 0.65rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-main {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-main input {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 0.42rem 0.55rem;
|
||||||
|
color: var(--ink);
|
||||||
|
font: inherit;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-main small {
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.3rem;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.45rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
border: 1px solid #0f243233;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: linear-gradient(160deg, #fff, #f4efe3);
|
||||||
|
color: var(--ink);
|
||||||
|
padding: 0.4rem 0.6rem;
|
||||||
|
font: inherit;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: transform 120ms ease, box-shadow 120ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 8px 18px #0f20321a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-item.is-completed .todo-main input {
|
||||||
|
text-decoration: line-through;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-item.is-archived {
|
||||||
|
opacity: 0.64;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 1rem;
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 0.88rem;
|
||||||
|
color: var(--ink-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.error {
|
||||||
|
color: var(--accent);
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 880px) {
|
||||||
|
.shell {
|
||||||
|
width: min(1100px, 100% - 1rem);
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-item {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-actions {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
import { RegistryProvider } from "@effect/atom-react"
|
||||||
|
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult"
|
||||||
|
import * as Atom from "effect/unstable/reactivity/Atom"
|
||||||
|
import { describe, expect, it, vi } from "vitest"
|
||||||
|
import { render } from "vitest-browser-react"
|
||||||
|
import { createMemoryHistory, RouterProvider } from "@tanstack/react-router"
|
||||||
|
import { getRouter } from "../src/router"
|
||||||
|
|
||||||
|
vi.mock("../src/rpc.ts", () => {
|
||||||
|
const initialSnapshot = AsyncResult.success({
|
||||||
|
offset: 42,
|
||||||
|
todos: [
|
||||||
|
{
|
||||||
|
id: "todo-1",
|
||||||
|
title: "Harness Todo",
|
||||||
|
completed: false,
|
||||||
|
archived: false,
|
||||||
|
revision: 1,
|
||||||
|
updatedAt: "2026-03-05T00:00:00.000Z"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
const noopSubscription = AsyncResult.initial<{
|
||||||
|
readonly done: boolean
|
||||||
|
readonly items: ReadonlyArray<unknown>
|
||||||
|
}>(true)
|
||||||
|
|
||||||
|
const mutationResult = AsyncResult.success({
|
||||||
|
offset: 43,
|
||||||
|
at: "2026-03-05T00:00:01.000Z",
|
||||||
|
todo: {
|
||||||
|
id: "todo-1",
|
||||||
|
title: "Harness Todo",
|
||||||
|
completed: false,
|
||||||
|
archived: false,
|
||||||
|
revision: 1,
|
||||||
|
updatedAt: "2026-03-05T00:00:01.000Z"
|
||||||
|
},
|
||||||
|
change: { _tag: "TodoRenamed", title: "Harness Todo" as const }
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
todosSnapshotAtom: Atom.make(initialSnapshot),
|
||||||
|
subscribeTodosPullAtom: Atom.writable(
|
||||||
|
() => noopSubscription,
|
||||||
|
() => {
|
||||||
|
// no-op: smoke test doesn't exercise stream pulling
|
||||||
|
}
|
||||||
|
),
|
||||||
|
renameTodoMutationAtom: Atom.make(mutationResult),
|
||||||
|
completeTodoMutationAtom: Atom.make(mutationResult),
|
||||||
|
archiveTodoMutationAtom: Atom.make(mutationResult)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
describe("web app harness", () => {
|
||||||
|
it("renders App in browser mode", async () => {
|
||||||
|
const history = createMemoryHistory()
|
||||||
|
const router = getRouter(history)
|
||||||
|
const screen = await render(
|
||||||
|
<RegistryProvider>
|
||||||
|
<RouterProvider router={router} />
|
||||||
|
</RegistryProvider>
|
||||||
|
)
|
||||||
|
|
||||||
|
await expect.element(screen.getByRole("heading", { name: "Realtime Todo Stream" })).toBeVisible()
|
||||||
|
await expect.element(screen.getByRole("heading", { name: "Todos" })).toBeVisible()
|
||||||
|
await expect.element(screen.getByRole("textbox")).toHaveValue("Harness Todo")
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "Bundler",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"strict": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"types": ["vite/client"]
|
||||||
|
},
|
||||||
|
"include": ["src", "vite.config.ts", "vitest.config.ts"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { defineConfig } from "vite"
|
||||||
|
import react from "@vitejs/plugin-react"
|
||||||
|
import { TanStackRouterVite } from "@tanstack/router-plugin/vite"
|
||||||
|
|
||||||
|
const backendOrigin = process.env.VITE_BACKEND_ORIGIN ?? "http://127.0.0.1:8787"
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [TanStackRouterVite(), react()],
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
"/api": {
|
||||||
|
target: backendOrigin,
|
||||||
|
changeOrigin: true
|
||||||
|
},
|
||||||
|
"/health": {
|
||||||
|
target: backendOrigin,
|
||||||
|
changeOrigin: true
|
||||||
|
},
|
||||||
|
"/ws": {
|
||||||
|
target: backendOrigin,
|
||||||
|
changeOrigin: true,
|
||||||
|
ws: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
outDir: "../public",
|
||||||
|
emptyOutDir: true
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import { playwright } from "@vitest/browser-playwright"
|
||||||
|
import react from "@vitejs/plugin-react"
|
||||||
|
import { defineConfig } from "vitest/config"
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
optimizeDeps: {
|
||||||
|
include: [
|
||||||
|
"react",
|
||||||
|
"react-dom",
|
||||||
|
"react/jsx-dev-runtime",
|
||||||
|
"@tanstack/react-router",
|
||||||
|
"@effect/atom-react",
|
||||||
|
"vitest-browser-react",
|
||||||
|
"effect/unstable/reactivity/Atom",
|
||||||
|
"effect/unstable/reactivity/AsyncResult"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
test: {
|
||||||
|
include: ["test/**/*.browser.test.tsx"],
|
||||||
|
browser: {
|
||||||
|
enabled: true,
|
||||||
|
provider: playwright(),
|
||||||
|
instances: [
|
||||||
|
{
|
||||||
|
browser: "chromium"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["oxc.oxc-vscode"]
|
||||||
|
}
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "oxc.oxc-vscode",
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.oxc": "always"
|
||||||
|
},
|
||||||
|
"oxc.unusedDisableDirectives": "warn",
|
||||||
|
"typescript.tsdk": "node_modules/typescript/lib"
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# AGENTS.md
|
||||||
|
|
||||||
|
## Task Completion Requirements
|
||||||
|
|
||||||
|
- All of `bun fmt`, `bun lint`, and `bun typecheck` must pass before considering tasks completed.
|
||||||
|
- NEVER run `bun test`. Always use `bun run test` (runs Vitest).
|
||||||
|
|
||||||
|
## Project Snapshot
|
||||||
|
|
||||||
|
T3 Code is a minimal web GUI for using code agents like Codex and Claude Code (coming soon).
|
||||||
|
|
||||||
|
This repository is a VERY EARLY WIP. Proposing sweeping changes that improve long-term maintainability is encouraged.
|
||||||
|
|
||||||
|
## Core Priorities
|
||||||
|
|
||||||
|
1. Performance first.
|
||||||
|
2. Reliability first.
|
||||||
|
3. Keep behavior predictable under load and during failures (session restarts, reconnects, partial streams).
|
||||||
|
|
||||||
|
If a tradeoff is required, choose correctness and robustness over short-term convenience.
|
||||||
|
|
||||||
|
## Maintainability
|
||||||
|
|
||||||
|
Long term maintainability is a core priority. If you add new functionality, first check if there are shared logic that can be extracted to a separate module. Duplicate logic across mulitple files is a code smell and should be avoided. Don't be afraid to change existing code. Don't take shortcuts by just adding local logic to solve a problem.
|
||||||
|
|
||||||
|
## Package Roles
|
||||||
|
|
||||||
|
- `apps/server`: Node.js WebSocket server. Wraps Codex app-server (JSON-RPC over stdio), serves the React web app, and manages provider sessions.
|
||||||
|
- `apps/web`: React/Vite UI. Owns session UX, conversation/event rendering, and client-side state. Connects to the server via WebSocket.
|
||||||
|
- `packages/contracts`: Shared effect/Schema schemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types. Keep this package schema-only — no runtime logic.
|
||||||
|
- `packages/shared`: Shared runtime utilities consumed by both server and web. Uses explicit subpath exports (e.g. `@t3tools/shared/git`) — no barrel index.
|
||||||
|
|
||||||
|
## Codex App Server (Important)
|
||||||
|
|
||||||
|
T3 Code is currently Codex-first. The server starts `codex app-server` (JSON-RPC over stdio) per provider session, then streams structured events to the browser through WebSocket push messages.
|
||||||
|
|
||||||
|
How we use it in this codebase:
|
||||||
|
|
||||||
|
- Session startup/resume and turn lifecycle are brokered in `apps/server/src/codexAppServerManager.ts`.
|
||||||
|
- Provider dispatch and thread event logging are coordinated in `apps/server/src/providerManager.ts`.
|
||||||
|
- WebSocket server routes NativeApi methods in `apps/server/src/wsServer.ts`.
|
||||||
|
- Web app consumes orchestration domain events via WebSocket push on channel `orchestration.domainEvent` (provider runtime activity is projected into orchestration events server-side).
|
||||||
|
|
||||||
|
Docs:
|
||||||
|
|
||||||
|
- Codex App Server docs: https://developers.openai.com/codex/sdk/#app-server
|
||||||
|
|
||||||
|
## Reference Repos
|
||||||
|
|
||||||
|
- Open-source Codex repo: https://github.com/openai/codex
|
||||||
|
- Codex-Monitor (Tauri, feature-complete, strong reference implementation): https://github.com/Dimillian/CodexMonitor
|
||||||
|
|
||||||
|
Use these as implementation references when designing protocol handling, UX flows, and operational safeguards.
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
## Read This First
|
||||||
|
|
||||||
|
We are not actively accepting contributions right now.
|
||||||
|
|
||||||
|
You can still open an issue or PR, but please do so knowing there is a high chance we close it, defer it forever, or never look at it.
|
||||||
|
|
||||||
|
If that sounds annoying, that is because it is. This project is still early and we are trying to keep scope, quality, and direction under control.
|
||||||
|
|
||||||
|
PRs are automatically labeled with a `vouch:*` trust status.
|
||||||
|
|
||||||
|
If you are an external contributor, expect `vouch:unvouched` until we explicitly add you to [.github/VOUCHED.td](.github/VOUCHED.td).
|
||||||
|
|
||||||
|
## What We Are Most Likely To Accept
|
||||||
|
|
||||||
|
Small, focused bug fixes.
|
||||||
|
|
||||||
|
Small reliability fixes.
|
||||||
|
|
||||||
|
Small performance improvements.
|
||||||
|
|
||||||
|
Tightly scoped maintenance work that clearly improves the project without changing its direction.
|
||||||
|
|
||||||
|
## What We Are Least Likely To Accept
|
||||||
|
|
||||||
|
Large PRs.
|
||||||
|
|
||||||
|
Drive-by feature work.
|
||||||
|
|
||||||
|
Opinionated rewrites.
|
||||||
|
|
||||||
|
Anything that expands product scope without us asking for it first.
|
||||||
|
|
||||||
|
If you open a 1,000+ line PR full of new features, we will probably close it quickly and remember that you ignored the clearly written instructions.
|
||||||
|
|
||||||
|
## If You Still Want To Open A PR
|
||||||
|
|
||||||
|
Keep it small.
|
||||||
|
|
||||||
|
Explain exactly what changed.
|
||||||
|
|
||||||
|
Explain exactly why the change should exist.
|
||||||
|
|
||||||
|
Do not mix unrelated fixes together.
|
||||||
|
|
||||||
|
If the PR makes anything resembling a UI change, include clear before/after images.
|
||||||
|
|
||||||
|
If the change depends on motion, timing, transitions, or interaction details, include a short video.
|
||||||
|
|
||||||
|
If we have to guess what changed, we are much less likely to review it.
|
||||||
|
|
||||||
|
## Issues First
|
||||||
|
|
||||||
|
If you are thinking about a non-trivial change, open an issue first.
|
||||||
|
|
||||||
|
That still does not mean we will want the PR, but it gives you a chance to avoid wasting your time.
|
||||||
|
|
||||||
|
## Be Realistic
|
||||||
|
|
||||||
|
Opening a PR does not create an obligation on our side.
|
||||||
|
|
||||||
|
We may close it. We may ignore it. We may ask you to shrink it. We may reimplement the idea ourselves later.
|
||||||
|
|
||||||
|
If you are fine with that, proceed.
|
||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
# Keybindings
|
||||||
|
|
||||||
|
T3 Code reads keybindings from:
|
||||||
|
|
||||||
|
- `~/.t3/keybindings.json`
|
||||||
|
|
||||||
|
The file must be a JSON array of rules:
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{ "key": "mod+g", "command": "terminal.toggle" },
|
||||||
|
{ "key": "mod+shift+g", "command": "terminal.new", "when": "terminalFocus" }
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
See the full schema for more details: [`packages/contracts/src/keybindings.ts`](packages/contracts/src/keybindings.ts)
|
||||||
|
|
||||||
|
## Defaults
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{ "key": "mod+j", "command": "terminal.toggle" },
|
||||||
|
{ "key": "mod+d", "command": "terminal.split", "when": "terminalFocus" },
|
||||||
|
{ "key": "mod+n", "command": "terminal.new", "when": "terminalFocus" },
|
||||||
|
{ "key": "mod+w", "command": "terminal.close", "when": "terminalFocus" },
|
||||||
|
{ "key": "mod+n", "command": "chat.new", "when": "!terminalFocus" },
|
||||||
|
{ "key": "mod+shift+o", "command": "chat.new", "when": "!terminalFocus" },
|
||||||
|
{ "key": "mod+shift+n", "command": "chat.newLocal", "when": "!terminalFocus" },
|
||||||
|
{ "key": "mod+o", "command": "editor.openFavorite" }
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
For most up to date defaults, see [`DEFAULT_KEYBINDINGS` in `apps/server/src/keybindings.ts`](apps/server/src/keybindings.ts)
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Rule Shape
|
||||||
|
|
||||||
|
Each entry supports:
|
||||||
|
|
||||||
|
- `key` (required): shortcut string, like `mod+j`, `ctrl+k`, `cmd+shift+d`
|
||||||
|
- `command` (required): action ID
|
||||||
|
- `when` (optional): boolean expression controlling when the shortcut is active
|
||||||
|
|
||||||
|
Invalid rules are ignored. Invalid config files are ignored. Warnings are logged by the server.
|
||||||
|
|
||||||
|
### Available Commands
|
||||||
|
|
||||||
|
- `terminal.toggle`: open/close terminal drawer
|
||||||
|
- `terminal.split`: split terminal (in focused terminal context by default)
|
||||||
|
- `terminal.new`: create new terminal (in focused terminal context by default)
|
||||||
|
- `terminal.close`: close/kill the focused terminal (in focused terminal context by default)
|
||||||
|
- `chat.new`: create a new chat thread preserving the active thread's branch/worktree state
|
||||||
|
- `chat.newLocal`: create a new local chat thread for the active project (no worktree context)
|
||||||
|
- `editor.openFavorite`: open current project/worktree in the last-used editor
|
||||||
|
- `script.{id}.run`: run a project script by id (for example `script.test.run`)
|
||||||
|
|
||||||
|
### Key Syntax
|
||||||
|
|
||||||
|
Supported modifiers:
|
||||||
|
|
||||||
|
- `mod` (`cmd` on macOS, `ctrl` on non-macOS)
|
||||||
|
- `cmd` / `meta`
|
||||||
|
- `ctrl` / `control`
|
||||||
|
- `shift`
|
||||||
|
- `alt` / `option`
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
- `mod+j`
|
||||||
|
- `mod+shift+d`
|
||||||
|
- `ctrl+l`
|
||||||
|
- `cmd+k`
|
||||||
|
|
||||||
|
### `when` Conditions
|
||||||
|
|
||||||
|
Currently available context keys:
|
||||||
|
|
||||||
|
- `terminalFocus`
|
||||||
|
- `terminalOpen`
|
||||||
|
|
||||||
|
Supported operators:
|
||||||
|
|
||||||
|
- `!` (not)
|
||||||
|
- `&&` (and)
|
||||||
|
- `||` (or)
|
||||||
|
- parentheses: `(` `)`
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
- `"when": "terminalFocus"`
|
||||||
|
- `"when": "terminalOpen && !terminalFocus"`
|
||||||
|
- `"when": "terminalFocus || terminalOpen"`
|
||||||
|
|
||||||
|
Unknown condition keys evaluate to `false`.
|
||||||
|
|
||||||
|
### Precedence
|
||||||
|
|
||||||
|
- Rules are evaluated in array order.
|
||||||
|
- For a key event, the last rule where both `key` matches and `when` evaluates to `true` wins.
|
||||||
|
- That means precedence is across commands, not only within the same command.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 T3 Tools Inc.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# T3 Code
|
||||||
|
|
||||||
|
T3 Code is a minimal web GUI for coding agents. Currently Codex-first, with Claude Code support coming soon.
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> You need to have [Codex CLI](https://github.com/openai/codex) installed and authorized for T3 Code to work.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx t3
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also just install the desktop app. It's cooler.
|
||||||
|
|
||||||
|
Install the [desktop app from the Releases page](https://github.com/pingdotgg/t3code/releases)
|
||||||
|
|
||||||
|
## Some notes
|
||||||
|
|
||||||
|
We are very very early in this project. Expect bugs.
|
||||||
|
|
||||||
|
We are not accepting contributions yet.
|
||||||
|
|
||||||
|
## If you REALLY want to contribute still.... read this first
|
||||||
|
|
||||||
|
Read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening an issue or PR.
|
||||||
|
|
||||||
|
Need support? Join the [Discord](https://discord.gg/jn4EGJjrvv).
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Remote Access Setup
|
||||||
|
|
||||||
|
Use this when you want to open T3 Code from another device (phone, tablet, another laptop).
|
||||||
|
|
||||||
|
## CLI ↔ Env option map
|
||||||
|
|
||||||
|
The T3 Code CLI accepts the following configuration options, available either as CLI flags or environment variables:
|
||||||
|
|
||||||
|
| CLI flag | Env var | Notes |
|
||||||
|
| ----------------------- | --------------------- | ---------------------------------- |
|
||||||
|
| `--mode <web\|desktop>` | `T3CODE_MODE` | Runtime mode. |
|
||||||
|
| `--port <number>` | `T3CODE_PORT` | HTTP/WebSocket port. |
|
||||||
|
| `--host <address>` | `T3CODE_HOST` | Bind interface/address. |
|
||||||
|
| `--state-dir <path>` | `T3CODE_STATE_DIR` | State directory. |
|
||||||
|
| `--dev-url <url>` | `VITE_DEV_SERVER_URL` | Dev web URL redirect/proxy target. |
|
||||||
|
| `--no-browser` | `T3CODE_NO_BROWSER` | Disable auto-open browser. |
|
||||||
|
| `--auth-token <token>` | `T3CODE_AUTH_TOKEN` | WebSocket auth token. |
|
||||||
|
|
||||||
|
> TIP: Use the `--help` flag to see all available options and their descriptions.
|
||||||
|
|
||||||
|
## Security First
|
||||||
|
|
||||||
|
- Always set `--auth-token` before exposing the server outside localhost.
|
||||||
|
- Treat the token like a password.
|
||||||
|
- Prefer binding to trusted interfaces (LAN IP or Tailnet IP) instead of opening all interfaces unless needed.
|
||||||
|
|
||||||
|
## 1) Build + run server for remote access
|
||||||
|
|
||||||
|
Remote access should use the built web app (not local Vite redirect mode).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run build
|
||||||
|
TOKEN="$(openssl rand -hex 24)"
|
||||||
|
bun run --cwd apps/server start -- --host 0.0.0.0 --port 3773 --auth-token "$TOKEN" --no-browser
|
||||||
|
```
|
||||||
|
|
||||||
|
Then open on your phone:
|
||||||
|
|
||||||
|
`http://<your-machine-ip>:3773`
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
`http://192.168.1.42:3773`
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
- `--host 0.0.0.0` listens on all IPv4 interfaces.
|
||||||
|
- `--no-browser` prevents local auto-open, which is usually better for headless/remote sessions.
|
||||||
|
- Ensure your OS firewall allows inbound TCP on the selected port.
|
||||||
|
|
||||||
|
## 2) Tailnet / Tailscale access
|
||||||
|
|
||||||
|
If you use Tailscale, you can bind directly to your Tailnet address.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
TAILNET_IP="$(tailscale ip -4)"
|
||||||
|
TOKEN="$(openssl rand -hex 24)"
|
||||||
|
bun run --cwd apps/server start -- --host "$(tailscale ip -4)" --port 3773 --auth-token "$TOKEN" --no-browser
|
||||||
|
```
|
||||||
|
|
||||||
|
Open from any device in your tailnet:
|
||||||
|
|
||||||
|
`http://<tailnet-ip>:3773`
|
||||||
|
|
||||||
|
You can also bind `--host 0.0.0.0` and connect through the Tailnet IP, but binding directly to the Tailnet IP limits exposure.
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# TODO
|
||||||
|
|
||||||
|
## Small things
|
||||||
|
|
||||||
|
- [ ] Submitting new messages should scroll to bottom
|
||||||
|
- [ ] Only show last 10 threads for a given project
|
||||||
|
- [ ] Thread archiving
|
||||||
|
- [ ] New projects should go on top
|
||||||
|
- [ ] Projects should be sorted by latest thread update
|
||||||
|
|
||||||
|
## Bigger things
|
||||||
|
|
||||||
|
- [ ] Queueing messages
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
dist-electron/
|
||||||
|
.electron-runtime/
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "@t3tools/desktop",
|
||||||
|
"version": "0.0.9",
|
||||||
|
"private": true,
|
||||||
|
"main": "dist-electron/main.js",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "bun run --parallel dev:bundle dev:electron",
|
||||||
|
"dev:bundle": "tsdown --watch",
|
||||||
|
"dev:electron": "bun run scripts/dev-electron.mjs",
|
||||||
|
"build": "tsdown",
|
||||||
|
"start": "bun run scripts/start-electron.mjs",
|
||||||
|
"typecheck": "tsc --noEmit",
|
||||||
|
"test": "vitest run --passWithNoTests",
|
||||||
|
"smoke-test": "node scripts/smoke-test.mjs"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"effect": "catalog:",
|
||||||
|
"electron": "40.6.0",
|
||||||
|
"electron-updater": "^6.6.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@t3tools/contracts": "workspace:*",
|
||||||
|
"@t3tools/shared": "workspace:*",
|
||||||
|
"@types/node": "catalog:",
|
||||||
|
"tsdown": "catalog:",
|
||||||
|
"typescript": "catalog:",
|
||||||
|
"vitest": "catalog:",
|
||||||
|
"wait-on": "^8.0.2"
|
||||||
|
},
|
||||||
|
"productName": "T3 Code (Alpha)"
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 279 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 313 KiB |
@@ -0,0 +1,215 @@
|
|||||||
|
import { spawn, spawnSync } from "node:child_process";
|
||||||
|
import { watch } from "node:fs";
|
||||||
|
import { join } from "node:path";
|
||||||
|
import waitOn from "wait-on";
|
||||||
|
|
||||||
|
import { desktopDir, resolveElectronPath } from "./electron-launcher.mjs";
|
||||||
|
|
||||||
|
const port = Number(process.env.ELECTRON_RENDERER_PORT ?? 5733);
|
||||||
|
const devServerUrl = `http://localhost:${port}`;
|
||||||
|
const requiredFiles = [
|
||||||
|
"dist-electron/main.js",
|
||||||
|
"dist-electron/preload.js",
|
||||||
|
"../server/dist/index.mjs",
|
||||||
|
];
|
||||||
|
const watchedDirectories = [
|
||||||
|
{ directory: "dist-electron", files: new Set(["main.js", "preload.js"]) },
|
||||||
|
{ directory: "../server/dist", files: new Set(["index.mjs"]) },
|
||||||
|
];
|
||||||
|
const forcedShutdownTimeoutMs = 1_500;
|
||||||
|
const restartDebounceMs = 120;
|
||||||
|
const childTreeGracePeriodMs = 1_200;
|
||||||
|
|
||||||
|
await waitOn({
|
||||||
|
resources: [`tcp:${port}`, ...requiredFiles.map((filePath) => `file:${filePath}`)],
|
||||||
|
});
|
||||||
|
|
||||||
|
const childEnv = { ...process.env };
|
||||||
|
delete childEnv.ELECTRON_RUN_AS_NODE;
|
||||||
|
|
||||||
|
let shuttingDown = false;
|
||||||
|
let restartTimer = null;
|
||||||
|
let currentApp = null;
|
||||||
|
let restartQueue = Promise.resolve();
|
||||||
|
const expectedExits = new WeakSet();
|
||||||
|
const watchers = [];
|
||||||
|
|
||||||
|
function killChildTreeByPid(pid, signal) {
|
||||||
|
if (process.platform === "win32" || typeof pid !== "number") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnSync("pkill", [`-${signal}`, "-P", String(pid)], { stdio: "ignore" });
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanupStaleDevApps() {
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnSync("pkill", ["-f", "--", `--t3code-dev-root=${desktopDir}`], { stdio: "ignore" });
|
||||||
|
}
|
||||||
|
|
||||||
|
function startApp() {
|
||||||
|
if (shuttingDown || currentApp !== null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const app = spawn(
|
||||||
|
resolveElectronPath(),
|
||||||
|
[`--t3code-dev-root=${desktopDir}`, "dist-electron/main.js"],
|
||||||
|
{
|
||||||
|
cwd: desktopDir,
|
||||||
|
env: {
|
||||||
|
...childEnv,
|
||||||
|
VITE_DEV_SERVER_URL: devServerUrl,
|
||||||
|
},
|
||||||
|
stdio: "inherit",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
currentApp = app;
|
||||||
|
|
||||||
|
app.once("error", () => {
|
||||||
|
if (currentApp === app) {
|
||||||
|
currentApp = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!shuttingDown) {
|
||||||
|
scheduleRestart();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.once("exit", () => {
|
||||||
|
if (currentApp === app) {
|
||||||
|
currentApp = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!shuttingDown && !expectedExits.has(app)) {
|
||||||
|
scheduleRestart();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function stopApp() {
|
||||||
|
const app = currentApp;
|
||||||
|
if (!app) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentApp = null;
|
||||||
|
expectedExits.add(app);
|
||||||
|
|
||||||
|
await new Promise((resolve) => {
|
||||||
|
let settled = false;
|
||||||
|
|
||||||
|
const finish = () => {
|
||||||
|
if (settled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
settled = true;
|
||||||
|
resolve();
|
||||||
|
};
|
||||||
|
|
||||||
|
app.once("exit", finish);
|
||||||
|
app.kill("SIGTERM");
|
||||||
|
killChildTreeByPid(app.pid, "TERM");
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (settled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
app.kill("SIGKILL");
|
||||||
|
killChildTreeByPid(app.pid, "KILL");
|
||||||
|
finish();
|
||||||
|
}, forcedShutdownTimeoutMs).unref();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function scheduleRestart() {
|
||||||
|
if (shuttingDown) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (restartTimer) {
|
||||||
|
clearTimeout(restartTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
restartTimer = setTimeout(() => {
|
||||||
|
restartTimer = null;
|
||||||
|
restartQueue = restartQueue
|
||||||
|
.catch(() => undefined)
|
||||||
|
.then(async () => {
|
||||||
|
await stopApp();
|
||||||
|
if (!shuttingDown) {
|
||||||
|
startApp();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, restartDebounceMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
function startWatchers() {
|
||||||
|
for (const { directory, files } of watchedDirectories) {
|
||||||
|
const watcher = watch(
|
||||||
|
join(desktopDir, directory),
|
||||||
|
{ persistent: true },
|
||||||
|
(_eventType, filename) => {
|
||||||
|
if (typeof filename !== "string" || !files.has(filename)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduleRestart();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
watchers.push(watcher);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function killChildTree(signal) {
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Kill direct children as a final fallback in case normal shutdown leaves stragglers.
|
||||||
|
spawnSync("pkill", [`-${signal}`, "-P", String(process.pid)], { stdio: "ignore" });
|
||||||
|
}
|
||||||
|
|
||||||
|
async function shutdown(exitCode) {
|
||||||
|
if (shuttingDown) return;
|
||||||
|
shuttingDown = true;
|
||||||
|
|
||||||
|
if (restartTimer) {
|
||||||
|
clearTimeout(restartTimer);
|
||||||
|
restartTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const watcher of watchers) {
|
||||||
|
watcher.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
await stopApp();
|
||||||
|
killChildTree("TERM");
|
||||||
|
await new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, childTreeGracePeriodMs);
|
||||||
|
});
|
||||||
|
killChildTree("KILL");
|
||||||
|
|
||||||
|
process.exit(exitCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
startWatchers();
|
||||||
|
cleanupStaleDevApps();
|
||||||
|
startApp();
|
||||||
|
|
||||||
|
process.once("SIGINT", () => {
|
||||||
|
void shutdown(130);
|
||||||
|
});
|
||||||
|
process.once("SIGTERM", () => {
|
||||||
|
void shutdown(143);
|
||||||
|
});
|
||||||
|
process.once("SIGHUP", () => {
|
||||||
|
void shutdown(129);
|
||||||
|
});
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
// This file mostly exists because we want dev mode to say "T3 Code (Dev)" instead of "electron"
|
||||||
|
|
||||||
|
import { spawnSync } from "node:child_process";
|
||||||
|
import {
|
||||||
|
copyFileSync,
|
||||||
|
cpSync,
|
||||||
|
existsSync,
|
||||||
|
mkdirSync,
|
||||||
|
readFileSync,
|
||||||
|
readdirSync,
|
||||||
|
rmSync,
|
||||||
|
statSync,
|
||||||
|
writeFileSync,
|
||||||
|
} from "node:fs";
|
||||||
|
import { createRequire } from "node:module";
|
||||||
|
import { dirname, join, resolve } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);
|
||||||
|
const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";
|
||||||
|
const APP_BUNDLE_ID = "com.t3tools.t3code";
|
||||||
|
const LAUNCHER_VERSION = 1;
|
||||||
|
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
export const desktopDir = resolve(__dirname, "..");
|
||||||
|
|
||||||
|
function setPlistString(plistPath, key, value) {
|
||||||
|
const replaceResult = spawnSync("plutil", ["-replace", key, "-string", value, plistPath], {
|
||||||
|
encoding: "utf8",
|
||||||
|
});
|
||||||
|
if (replaceResult.status === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const insertResult = spawnSync("plutil", ["-insert", key, "-string", value, plistPath], {
|
||||||
|
encoding: "utf8",
|
||||||
|
});
|
||||||
|
if (insertResult.status === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const details = [replaceResult.stderr, insertResult.stderr].filter(Boolean).join("\n");
|
||||||
|
throw new Error(`Failed to update plist key "${key}" at ${plistPath}: ${details}`.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
function patchMainBundleInfoPlist(appBundlePath, iconPath) {
|
||||||
|
const infoPlistPath = join(appBundlePath, "Contents", "Info.plist");
|
||||||
|
setPlistString(infoPlistPath, "CFBundleDisplayName", APP_DISPLAY_NAME);
|
||||||
|
setPlistString(infoPlistPath, "CFBundleName", APP_DISPLAY_NAME);
|
||||||
|
setPlistString(infoPlistPath, "CFBundleIdentifier", APP_BUNDLE_ID);
|
||||||
|
setPlistString(infoPlistPath, "CFBundleIconFile", "icon.icns");
|
||||||
|
|
||||||
|
const resourcesDir = join(appBundlePath, "Contents", "Resources");
|
||||||
|
copyFileSync(iconPath, join(resourcesDir, "icon.icns"));
|
||||||
|
copyFileSync(iconPath, join(resourcesDir, "electron.icns"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function patchHelperBundleInfoPlists(appBundlePath) {
|
||||||
|
const frameworksDir = join(appBundlePath, "Contents", "Frameworks");
|
||||||
|
if (!existsSync(frameworksDir)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const entry of readdirSync(frameworksDir, { withFileTypes: true })) {
|
||||||
|
if (!entry.isDirectory() || !entry.name.endsWith(".app")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!entry.name.startsWith("Electron Helper")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const helperPlistPath = join(frameworksDir, entry.name, "Contents", "Info.plist");
|
||||||
|
if (!existsSync(helperPlistPath)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const suffix = entry.name.replace("Electron Helper", "").replace(".app", "").trim();
|
||||||
|
const helperName = suffix
|
||||||
|
? `${APP_DISPLAY_NAME} Helper ${suffix}`
|
||||||
|
: `${APP_DISPLAY_NAME} Helper`;
|
||||||
|
const helperIdSuffix = suffix.replace(/[()]/g, "").trim().toLowerCase().replace(/\s+/g, "-");
|
||||||
|
const helperBundleId = helperIdSuffix
|
||||||
|
? `${APP_BUNDLE_ID}.helper.${helperIdSuffix}`
|
||||||
|
: `${APP_BUNDLE_ID}.helper`;
|
||||||
|
|
||||||
|
setPlistString(helperPlistPath, "CFBundleDisplayName", helperName);
|
||||||
|
setPlistString(helperPlistPath, "CFBundleName", helperName);
|
||||||
|
setPlistString(helperPlistPath, "CFBundleIdentifier", helperBundleId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function readJson(path) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(readFileSync(path, "utf8"));
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildMacLauncher(electronBinaryPath) {
|
||||||
|
const sourceAppBundlePath = resolve(electronBinaryPath, "../../..");
|
||||||
|
const runtimeDir = join(desktopDir, ".electron-runtime");
|
||||||
|
const targetAppBundlePath = join(runtimeDir, `${APP_DISPLAY_NAME}.app`);
|
||||||
|
const targetBinaryPath = join(targetAppBundlePath, "Contents", "MacOS", "Electron");
|
||||||
|
const iconPath = join(desktopDir, "resources", "icon.icns");
|
||||||
|
const metadataPath = join(runtimeDir, "metadata.json");
|
||||||
|
|
||||||
|
mkdirSync(runtimeDir, { recursive: true });
|
||||||
|
|
||||||
|
const expectedMetadata = {
|
||||||
|
launcherVersion: LAUNCHER_VERSION,
|
||||||
|
sourceAppBundlePath,
|
||||||
|
sourceAppMtimeMs: statSync(sourceAppBundlePath).mtimeMs,
|
||||||
|
iconMtimeMs: statSync(iconPath).mtimeMs,
|
||||||
|
};
|
||||||
|
|
||||||
|
const currentMetadata = readJson(metadataPath);
|
||||||
|
if (
|
||||||
|
existsSync(targetBinaryPath) &&
|
||||||
|
currentMetadata &&
|
||||||
|
JSON.stringify(currentMetadata) === JSON.stringify(expectedMetadata)
|
||||||
|
) {
|
||||||
|
return targetBinaryPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
rmSync(targetAppBundlePath, { recursive: true, force: true });
|
||||||
|
cpSync(sourceAppBundlePath, targetAppBundlePath, { recursive: true });
|
||||||
|
patchMainBundleInfoPlist(targetAppBundlePath, iconPath);
|
||||||
|
patchHelperBundleInfoPlists(targetAppBundlePath);
|
||||||
|
writeFileSync(metadataPath, `${JSON.stringify(expectedMetadata, null, 2)}\n`);
|
||||||
|
|
||||||
|
return targetBinaryPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function resolveElectronPath() {
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
const electronBinaryPath = require("electron");
|
||||||
|
|
||||||
|
if (process.platform !== "darwin") {
|
||||||
|
return electronBinaryPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
return buildMacLauncher(electronBinaryPath);
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import { spawn } from "node:child_process";
|
||||||
|
import { dirname, resolve } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
const desktopDir = resolve(__dirname, "..");
|
||||||
|
const electronBin = resolve(desktopDir, "node_modules/.bin/electron");
|
||||||
|
const mainJs = resolve(desktopDir, "dist-electron/main.js");
|
||||||
|
|
||||||
|
console.log("\nLaunching Electron smoke test...");
|
||||||
|
|
||||||
|
const child = spawn(electronBin, [mainJs], {
|
||||||
|
stdio: ["pipe", "pipe", "pipe"],
|
||||||
|
env: {
|
||||||
|
...process.env,
|
||||||
|
VITE_DEV_SERVER_URL: "",
|
||||||
|
ELECTRON_ENABLE_LOGGING: "1",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
let output = "";
|
||||||
|
child.stdout.on("data", (chunk) => {
|
||||||
|
output += chunk.toString();
|
||||||
|
});
|
||||||
|
child.stderr.on("data", (chunk) => {
|
||||||
|
output += chunk.toString();
|
||||||
|
});
|
||||||
|
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
|
child.kill();
|
||||||
|
}, 8_000);
|
||||||
|
|
||||||
|
child.on("exit", () => {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
|
||||||
|
const fatalPatterns = [
|
||||||
|
"Cannot find module",
|
||||||
|
"MODULE_NOT_FOUND",
|
||||||
|
"Refused to execute",
|
||||||
|
"Uncaught Error",
|
||||||
|
"Uncaught TypeError",
|
||||||
|
"Uncaught ReferenceError",
|
||||||
|
];
|
||||||
|
const failures = fatalPatterns.filter((pattern) => output.includes(pattern));
|
||||||
|
|
||||||
|
if (failures.length > 0) {
|
||||||
|
console.error("\nDesktop smoke test failed:");
|
||||||
|
for (const failure of failures) {
|
||||||
|
console.error(` - ${failure}`);
|
||||||
|
}
|
||||||
|
console.error("\nFull output:\n" + output);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Desktop smoke test passed.");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
Loaded 100 of 549 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user