Compare commits
2029 Commits
v1.3.9
...
feat/mcp-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cd7f91fff | ||
|
|
ad7a043fb3 | ||
|
|
7db628702d | ||
|
|
866e8e8734 | ||
|
|
80e1784777 | ||
|
|
0d760ffa2e | ||
|
|
88f7e6a854 | ||
|
|
de37e2355d | ||
|
|
f27b04c5b0 | ||
|
|
a02b8f4609 | ||
|
|
7b90dfb46c | ||
|
|
26a9dba01a | ||
|
|
a176814ad1 | ||
|
|
ea51439aac | ||
|
|
162e33f478 | ||
|
|
ee4c310725 | ||
|
|
a000ff2a1a | ||
|
|
2f9576b2ae | ||
|
|
92554dd398 | ||
|
|
9473ddc762 | ||
|
|
5f469a71f3 | ||
|
|
87bac60afc | ||
|
|
704339e835 | ||
|
|
c8ab7180ba | ||
|
|
11757546c3 | ||
|
|
420b9ec2f2 | ||
|
|
1c73271e33 | ||
|
|
acdbe6b9ed | ||
|
|
6c201228d9 | ||
|
|
73b2a375ad | ||
|
|
89bb830b60 | ||
|
|
2399db4944 | ||
|
|
62774b34d3 | ||
|
|
654f19eaa9 | ||
|
|
ce642f17d9 | ||
|
|
d7bcd5a20e | ||
|
|
27903e7d9d | ||
|
|
a8c0d0a684 | ||
|
|
5e33c89fe7 | ||
|
|
44d2cb345f | ||
|
|
49eec68434 | ||
|
|
d5ae3e6edc | ||
|
|
6eedcc29ba | ||
|
|
42849e4586 | ||
|
|
6a8544fb0e | ||
|
|
37f7042f0f | ||
|
|
65d066cbef | ||
|
|
504531d4d5 | ||
|
|
71d35eddf7 | ||
|
|
9f1c8f2c17 | ||
|
|
651e9a529e | ||
|
|
f68f6e9896 | ||
|
|
2dcc68da87 | ||
|
|
1db259cd3e | ||
|
|
d4b3428160 | ||
|
|
cd881ceb34 | ||
|
|
68b37e66e9 | ||
|
|
d6e7ed81ee | ||
|
|
a9843b4128 | ||
|
|
d4c6131fa3 | ||
|
|
d2d5064eed | ||
|
|
8bec7640fa | ||
|
|
fcf53f06ef | ||
|
|
2048f210e7 | ||
|
|
78eacccf6e | ||
|
|
a436ab1d78 | ||
|
|
2aedbf5702 | ||
|
|
b7e7174f3d | ||
|
|
e7e5c0456f | ||
|
|
53e38ed1aa | ||
|
|
f91e7da0a1 | ||
|
|
74db4c4646 | ||
|
|
1e4902b267 | ||
|
|
932b1d529a | ||
|
|
53046460ec | ||
|
|
38ac42af8c | ||
|
|
538291c03f | ||
|
|
142ad9e41e | ||
|
|
7250ce3514 | ||
|
|
02cf012671 | ||
|
|
d11a2cd95c | ||
|
|
65ac3181a8 | ||
|
|
998e54246f | ||
|
|
fcd8f7a26e | ||
|
|
b991afd69a | ||
|
|
d9d8bae2d6 | ||
|
|
422ba52093 | ||
|
|
51630f95fd | ||
|
|
ac1cab60a3 | ||
|
|
23f61b0d62 | ||
|
|
759f8518b2 | ||
|
|
7bd6c92f43 | ||
|
|
ff705d99b3 | ||
|
|
7ec17dc771 | ||
|
|
35883e8601 | ||
|
|
48b7bdb9ba | ||
|
|
d2d5b4370c | ||
|
|
27c31d6e0c | ||
|
|
961ee22327 | ||
|
|
37b3c08baa | ||
|
|
d8c3f601df | ||
|
|
cff9068359 | ||
|
|
cc871b7a72 | ||
|
|
5b98ef5b3d | ||
|
|
3428d15299 | ||
|
|
9ea3f0842c | ||
|
|
90242e2285 | ||
|
|
1616345261 | ||
|
|
0b818477ac | ||
|
|
027d6ea2b2 | ||
|
|
c7d2588f1a | ||
|
|
8712e26c74 | ||
|
|
0c652e0ac4 | ||
|
|
3a3a5e6c8b | ||
|
|
06ab2822be | ||
|
|
1b7596ebe1 | ||
|
|
e95219f2ec | ||
|
|
bb0ec0a3ec | ||
|
|
483b4e090e | ||
|
|
4975c2d9e8 | ||
|
|
965d7d3008 | ||
|
|
5365fddec9 | ||
|
|
128385bfe0 | ||
|
|
cfdeb124b9 | ||
|
|
8deaa6e4f6 | ||
|
|
e401685449 | ||
|
|
e195ad4a8f | ||
|
|
b8a84f62ac | ||
|
|
20f5271682 | ||
|
|
5524571c80 | ||
|
|
cd3031479c | ||
|
|
1df6e8c732 | ||
|
|
ed2e01491e | ||
|
|
228ed474ce | ||
|
|
6829a03437 | ||
|
|
cb922b67ad | ||
|
|
b0213742f4 | ||
|
|
90264f6ec9 | ||
|
|
1ef6de1869 | ||
|
|
e4ad5084cf | ||
|
|
0ef2725dfd | ||
|
|
4bd492f498 | ||
|
|
ef7433c823 | ||
|
|
b6765b48b5 | ||
|
|
7c45e42602 | ||
|
|
57a40f84b9 | ||
|
|
e737f71932 | ||
|
|
9ec6e5f771 | ||
|
|
4647688613 | ||
|
|
bc0f283278 | ||
|
|
aadadf8353 | ||
|
|
d0a0685fc1 | ||
|
|
ba7d5f53e5 | ||
|
|
86dde5dc0f | ||
|
|
a5ceceeca3 | ||
|
|
fcfda90d5a | ||
|
|
2ccfde1ba4 | ||
|
|
ae1c1409e1 | ||
|
|
b46237296e | ||
|
|
8c06d2f706 | ||
|
|
1b705edb06 | ||
|
|
42435e8f76 | ||
|
|
3111979bb4 | ||
|
|
56580e3fac | ||
|
|
7084b8d429 | ||
|
|
8b0e8506c2 | ||
|
|
4d133d59ea | ||
|
|
35b885798b | ||
|
|
ae9e12b276 | ||
|
|
8018ac1a97 | ||
|
|
f429e3fc01 | ||
|
|
6c63146556 | ||
|
|
29242154d0 | ||
|
|
ccc5e830d7 | ||
|
|
adf10f6ea1 | ||
|
|
26a6ff871f | ||
|
|
d1e85f964d | ||
|
|
8d041438fd | ||
|
|
c6dc1810e9 | ||
|
|
dabfb8dc0e | ||
|
|
4aa9c9f225 | ||
|
|
fa394576bb | ||
|
|
5c1ac376e6 | ||
|
|
88e77aa116 | ||
|
|
4e9340f551 | ||
|
|
0648a1f567 | ||
|
|
4b1f7db506 | ||
|
|
0be2177937 | ||
|
|
c52cc5a94f | ||
|
|
947695fdc7 | ||
|
|
75296babe3 | ||
|
|
c9381d672e | ||
|
|
67fa5df611 | ||
|
|
52a980f751 | ||
|
|
3b7ab2aec8 | ||
|
|
122e4a10d0 | ||
|
|
d41e239b89 | ||
|
|
b82b16b5f6 | ||
|
|
ebdd90b235 | ||
|
|
5c8e06ed94 | ||
|
|
f4e4586fbc | ||
|
|
fab1d29c83 | ||
|
|
de9cb2fbdb | ||
|
|
a419aed404 | ||
|
|
cb47e8decd | ||
|
|
3c4bb72a82 | ||
|
|
cab79ef185 | ||
|
|
a87c06aab8 | ||
|
|
c19659daa5 | ||
|
|
bafde1c518 | ||
|
|
45961d2eda | ||
|
|
e1a0dd6810 | ||
|
|
a1d14b9292 | ||
|
|
a7d6065b08 | ||
|
|
5dbd38721f | ||
|
|
39fcc04d78 | ||
|
|
5c7784622e | ||
|
|
b85040f579 | ||
|
|
8bcd229849 | ||
|
|
d12515ccb9 | ||
|
|
499cb52e28 | ||
|
|
05a318225c | ||
|
|
caad0bc005 | ||
|
|
067ecb5e8e | ||
|
|
3088887e57 | ||
|
|
0f8cbeed11 | ||
|
|
2ed99c0cb8 | ||
|
|
0a149e3d9e | ||
|
|
a3a26c69c5 | ||
|
|
2bafc53b25 | ||
|
|
14f14b75b0 | ||
|
|
77351b7691 | ||
|
|
b28fadd02f | ||
|
|
63fa70863c | ||
|
|
09e9b95e08 | ||
|
|
11a76ae90f | ||
|
|
bf2ffb7465 | ||
|
|
287c96ea2e | ||
|
|
adacb8c638 | ||
|
|
7a3d08672a | ||
|
|
1973e4d290 | ||
|
|
7a169c424d | ||
|
|
ec4d106a59 | ||
|
|
69bcb0e13e | ||
|
|
54386bf624 | ||
|
|
fe6e65f263 | ||
|
|
fe0c0fac1e | ||
|
|
f05b884646 | ||
|
|
8e163b8f17 | ||
|
|
caebaf5d46 | ||
|
|
6950b6f1e7 | ||
|
|
0e35224787 | ||
|
|
e5a84a2e84 | ||
|
|
09da7113a0 | ||
|
|
e6e43dbcca | ||
|
|
e02f826707 | ||
|
|
781b01ee17 | ||
|
|
1f1086ed7b | ||
|
|
0a80fc5517 | ||
|
|
6d8edc95d9 | ||
|
|
4a4a1686d3 | ||
|
|
a54b49cc30 | ||
|
|
37218eef4f | ||
|
|
3b34efd33a | ||
|
|
cc650b58d3 | ||
|
|
183b46be9e | ||
|
|
a847b74c32 | ||
|
|
d1b339f71d | ||
|
|
a3c638946e | ||
|
|
a0193451a9 | ||
|
|
ede2b75cd0 | ||
|
|
34ab01e0a1 | ||
|
|
b493172090 | ||
|
|
6bcd941cc6 | ||
|
|
98ebfd12b3 | ||
|
|
305a454ffd | ||
|
|
dfc593f2e1 | ||
|
|
b50203f85d | ||
|
|
e2a0792e2d | ||
|
|
b7d97cca69 | ||
|
|
7cdc80c3e2 | ||
|
|
59b6cbc23c | ||
|
|
21c436d900 | ||
|
|
87f3628b49 | ||
|
|
27b315bcca | ||
|
|
1ec81f9e75 | ||
|
|
087e757f9f | ||
|
|
ce955e3ee9 | ||
|
|
4ddada4de8 | ||
|
|
164386a337 | ||
|
|
d4d2510834 | ||
|
|
46a5ea88f3 | ||
|
|
7ca9dcd2fb | ||
|
|
9c679ede20 | ||
|
|
60c85b651f | ||
|
|
73895b5f4b | ||
|
|
3e2acde9e2 | ||
|
|
a1d8f3eb0f | ||
|
|
0aba7bad31 | ||
|
|
75660766db | ||
|
|
53a6c70eca | ||
|
|
da18ff3d48 | ||
|
|
4a671a9bc2 | ||
|
|
ae1839ac33 | ||
|
|
56dbe6b050 | ||
|
|
f5a41e9c78 | ||
|
|
f65149af19 | ||
|
|
affef443b6 | ||
|
|
e40e1d0b36 | ||
|
|
14638b7470 | ||
|
|
b4a92cecc8 | ||
|
|
49e4667410 | ||
|
|
5d26bf15a3 | ||
|
|
7631d9d730 | ||
|
|
91b4d806cd | ||
|
|
1b8bb568b1 | ||
|
|
18da9a19fd | ||
|
|
7fdae0173c | ||
|
|
c872707791 | ||
|
|
a0cab3341e | ||
|
|
25c5d671dc | ||
|
|
035001f841 | ||
|
|
f533c1a2ca | ||
|
|
e5aa58722c | ||
|
|
8645fe4ab1 | ||
|
|
15f216b050 | ||
|
|
b4df5bbb13 | ||
|
|
a17a198912 | ||
|
|
939782ac4e | ||
|
|
7e369bef00 | ||
|
|
c3adcf663f | ||
|
|
373b2fcd78 | ||
|
|
c9d1e30f8b | ||
|
|
761b57a834 | ||
|
|
632871b2f8 | ||
|
|
52f00f08f2 | ||
|
|
1d5761b1fd | ||
|
|
42dbc6555c | ||
|
|
b237d9d38d | ||
|
|
1e9a811065 | ||
|
|
3c12f9052e | ||
|
|
9425437480 | ||
|
|
2385fba695 | ||
|
|
634c478e18 | ||
|
|
335bf47dbd | ||
|
|
23c4117d6f | ||
|
|
4a5d3b31ab | ||
|
|
17a27f0d55 | ||
|
|
8fbb93b0bf | ||
|
|
e09cd6b6d7 | ||
|
|
26ac9e3c2e | ||
|
|
958edc0017 | ||
|
|
efa54f3435 | ||
|
|
88a2cd6659 | ||
|
|
4e26291a61 | ||
|
|
f25142e597 | ||
|
|
462fc84240 | ||
|
|
c97ad627d1 | ||
|
|
36307abc30 | ||
|
|
8d3dbcb5f8 | ||
|
|
9d9ae7ba4e | ||
|
|
d682045655 | ||
|
|
381397ed31 | ||
|
|
4484f39525 | ||
|
|
82c08128b6 | ||
|
|
8cd40a471e | ||
|
|
bd6428d473 | ||
|
|
87d9c7b410 | ||
|
|
d7960140dc | ||
|
|
d7052b547f | ||
|
|
6aaef9b7be | ||
|
|
b246676257 | ||
|
|
0e4b1820e7 | ||
|
|
1833092998 | ||
|
|
67a6a6a445 | ||
|
|
00717126e5 | ||
|
|
3816076464 | ||
|
|
710592b053 | ||
|
|
828c22310d | ||
|
|
f45b744318 | ||
|
|
f49d3791b6 | ||
|
|
ea62294bd8 | ||
|
|
bfe2e87f59 | ||
|
|
4f8507036a | ||
|
|
6f6944d003 | ||
|
|
4216ffd0da | ||
|
|
a32fad06a0 | ||
|
|
1a49972583 | ||
|
|
a09c52424f | ||
|
|
b869869e26 | ||
|
|
acf2f4758f | ||
|
|
c3b2af5a15 | ||
|
|
01ffd4c4ca | ||
|
|
a5d4a01ad8 | ||
|
|
abf368e558 | ||
|
|
4d266fddb1 | ||
|
|
20dd4794b0 | ||
|
|
7b96900726 | ||
|
|
043a4fb5ca | ||
|
|
82e144be4c | ||
|
|
9b22e1671f | ||
|
|
7999149901 | ||
|
|
c70a5d63aa | ||
|
|
d1067bb6b3 | ||
|
|
b43b4b581e | ||
|
|
55645a75cc | ||
|
|
86a2780e2c | ||
|
|
36f86ff2b9 | ||
|
|
d960a42d6e | ||
|
|
3ae1b3d4cb | ||
|
|
1c045231c8 | ||
|
|
282aa6e81a | ||
|
|
117e390cf1 | ||
|
|
34b05a138b | ||
|
|
6c233fef9f | ||
|
|
1c813aa6c3 | ||
|
|
dd5592ddbb | ||
|
|
6e9d8a1747 | ||
|
|
cee78c6610 | ||
|
|
0b2dfbb88f | ||
|
|
1fd44a68b0 | ||
|
|
0697c79daa | ||
|
|
fcacc50fdc | ||
|
|
009b58c9c3 | ||
|
|
77c64cf868 | ||
|
|
f5acddbfeb | ||
|
|
3d6a82fb00 | ||
|
|
ae35d689ec | ||
|
|
825b5e1be4 | ||
|
|
97e9e42173 | ||
|
|
17df1db120 | ||
|
|
d56521260c | ||
|
|
8efafc6ba9 | ||
|
|
f35987a9a9 | ||
|
|
c7ec55c69a | ||
|
|
c77d7dff78 | ||
|
|
b282e4d729 | ||
|
|
c426876d0d | ||
|
|
027ef17a2e | ||
|
|
f0ac74dccf | ||
|
|
d6468f33c5 | ||
|
|
1515f511a1 | ||
|
|
1c2211aefb | ||
|
|
49f9dff9da | ||
|
|
5d8e706c0b | ||
|
|
a8cd2e2eac | ||
|
|
1e615d69e1 | ||
|
|
92ba1e4fc3 | ||
|
|
7060aab33d | ||
|
|
0cce8220ce | ||
|
|
1722d9f435 | ||
|
|
078fd57eb5 | ||
|
|
4bd6087dc0 | ||
|
|
e45231376c | ||
|
|
01c7e509fd | ||
|
|
5ddf9683b4 | ||
|
|
d91df12dbc | ||
|
|
64e3de9ada | ||
|
|
2cf2f04a70 | ||
|
|
73380d76df | ||
|
|
38076babcf | ||
|
|
00cc410dcc | ||
|
|
7fc676bbc3 | ||
|
|
798126d39c | ||
|
|
874d74cf6e | ||
|
|
d73834e7f6 | ||
|
|
cb3afaceab | ||
|
|
fc0ba5d0d5 | ||
|
|
7ce4fc50ea | ||
|
|
b5ef8a93ca | ||
|
|
8ead4e9c0f | ||
|
|
432d84cda5 | ||
|
|
d3378dcf78 | ||
|
|
f0724af2aa | ||
|
|
f127150ea1 | ||
|
|
b3ef6d4534 | ||
|
|
1ce791d517 | ||
|
|
3d561ad8e3 | ||
|
|
14509d1077 | ||
|
|
a424e3a039 | ||
|
|
eaa5ec5545 | ||
|
|
5850e5da66 | ||
|
|
eb3ff6f570 | ||
|
|
ae9c78e643 | ||
|
|
445528aff7 | ||
|
|
d13c25444c | ||
|
|
5386716ebe | ||
|
|
da3cd62486 | ||
|
|
d8b47e30c4 | ||
|
|
1c19e529ac | ||
|
|
514b60f704 | ||
|
|
df1d4cd62b | ||
|
|
4839b91cef | ||
|
|
5048d6987d | ||
|
|
63be1d8cf2 | ||
|
|
809736dd33 | ||
|
|
369cc37071 | ||
|
|
d0b64dabc2 | ||
|
|
02d2838424 | ||
|
|
4c4039283f | ||
|
|
77df6fd58e | ||
|
|
100801821f | ||
|
|
2201ebbb88 | ||
|
|
9810f01330 | ||
|
|
7b428be93d | ||
|
|
f039aa253d | ||
|
|
a4c2ed5328 | ||
|
|
934cc0dd33 | ||
|
|
da61500e34 | ||
|
|
db2042800b | ||
|
|
08772741e6 | ||
|
|
f5f542911f | ||
|
|
3b5b1986e6 | ||
|
|
3b0995c8ef | ||
|
|
34c95ca787 | ||
|
|
a4c2a1d435 | ||
|
|
e4f0743e2f | ||
|
|
7632efda88 | ||
|
|
ab90eb2aab | ||
|
|
4c5bed0b1f | ||
|
|
302331043a | ||
|
|
09f5e7af8c | ||
|
|
664304241a | ||
|
|
27f98b02a6 | ||
|
|
af6a3c87d6 | ||
|
|
d1819274bb | ||
|
|
8058ed21b3 | ||
|
|
eaf302bb40 | ||
|
|
3405b7e429 | ||
|
|
2fc1df8793 | ||
|
|
ec82eb2881 | ||
|
|
1c978e0684 | ||
|
|
e938e1572c | ||
|
|
9a7681c5c8 | ||
|
|
259f2157f6 | ||
|
|
5a7521e335 | ||
|
|
21ce139df0 | ||
|
|
71536d6ef5 | ||
|
|
ef1a035701 | ||
|
|
2b76c326ee | ||
|
|
64ee5c528b | ||
|
|
136d343c18 | ||
|
|
0b1b9a913f | ||
|
|
cb0833a915 | ||
|
|
984c28d4be | ||
|
|
49add96dc0 | ||
|
|
db58762a13 | ||
|
|
5dac1f5867 | ||
|
|
6e89d0037f | ||
|
|
e1ab17387c | ||
|
|
54de2341bd | ||
|
|
1d0fc26025 | ||
|
|
b131f0c48c | ||
|
|
9e4b792fc3 | ||
|
|
7abd5da57d | ||
|
|
be7399b3c4 | ||
|
|
8d92b515ab | ||
|
|
524098d6d3 | ||
|
|
42fa2d94be | ||
|
|
a65b30f3a1 | ||
|
|
f1991b356b | ||
|
|
352c23180a | ||
|
|
825c376c5c | ||
|
|
231a923c9d | ||
|
|
dbf01652f8 | ||
|
|
842a6cb178 | ||
|
|
d56c526709 | ||
|
|
70a68bef27 | ||
|
|
f9b49ffde6 | ||
|
|
a264fd42e4 | ||
|
|
219844cb74 | ||
|
|
230205d210 | ||
|
|
f9fb0f9125 | ||
|
|
0f777e357d | ||
|
|
5c578c191b | ||
|
|
7a4952f773 | ||
|
|
71a1daddef | ||
|
|
0a82955e91 | ||
|
|
62d2da3815 | ||
|
|
84aab66aa6 | ||
|
|
2d0d599ac8 | ||
|
|
dca6be45b0 | ||
|
|
5a71807cc9 | ||
|
|
0d0ab4dcf5 | ||
|
|
ac3da51890 | ||
|
|
9ea361f7e8 | ||
|
|
cc6160892a | ||
|
|
49eed449c3 | ||
|
|
8ada7ffaf6 | ||
|
|
e7c37231e0 | ||
|
|
ca597b9b9b | ||
|
|
c76df7fb16 | ||
|
|
89d5bd817b | ||
|
|
6c9fc598d4 | ||
|
|
273475881e | ||
|
|
6afaf6244c | ||
|
|
77535b002a | ||
|
|
dec68ee297 | ||
|
|
a8bf55abc2 | ||
|
|
c196a02c95 | ||
|
|
1481149e51 | ||
|
|
d1ff8591a6 | ||
|
|
4f91a321a0 | ||
|
|
219d162e1a | ||
|
|
669f60273c | ||
|
|
7319fc5ef4 | ||
|
|
cc860e48b1 | ||
|
|
a9093b1dea | ||
|
|
697f7d1946 | ||
|
|
ee95fad7e5 | ||
|
|
e4d04f8346 | ||
|
|
c37af25525 | ||
|
|
ea90c6c9cb | ||
|
|
58dbb514e0 | ||
|
|
1a5138c5b1 | ||
|
|
5451e2f34a | ||
|
|
c641b116ba | ||
|
|
d44654f003 | ||
|
|
85b8724c73 | ||
|
|
a8e2df6bed | ||
|
|
2f74becb31 | ||
|
|
b31ac74f96 | ||
|
|
4d1d3e316f | ||
|
|
e5ccf68476 | ||
|
|
e3d2bb2ec6 | ||
|
|
7f9f5514a4 | ||
|
|
d5487ba6ac | ||
|
|
54b4e6a80b | ||
|
|
079d2c3cb3 | ||
|
|
911f9d8bc9 | ||
|
|
95ed17aa69 | ||
|
|
4f64afd8f4 | ||
|
|
f90bda861f | ||
|
|
4f8b5c1250 | ||
|
|
71ed94de31 | ||
|
|
6eccb92817 | ||
|
|
734ddd7489 | ||
|
|
dc16cf2aa7 | ||
|
|
be12898b7b | ||
|
|
3fc92e093b | ||
|
|
b6187ad637 | ||
|
|
ca8ac9911e | ||
|
|
95a1e210b6 | ||
|
|
ea4db1c864 | ||
|
|
f9171f3df8 | ||
|
|
b55f419a95 | ||
|
|
8953961a51 | ||
|
|
9b1e9552d6 | ||
|
|
8836663c35 | ||
|
|
aaba77c360 | ||
|
|
532bad8eb7 | ||
|
|
e5b43c8176 | ||
|
|
5f9c2d7f6a | ||
|
|
568257e7b6 | ||
|
|
df31629c5f | ||
|
|
e6dc8619d9 | ||
|
|
9a71a01b66 | ||
|
|
941a6666e6 | ||
|
|
1bf63865a8 | ||
|
|
ba41d8021f | ||
|
|
1e919a908f | ||
|
|
702612e3f9 | ||
|
|
fa380619ce | ||
|
|
a30b2e2cb2 | ||
|
|
ae0cee9ef4 | ||
|
|
dc9fb381f7 | ||
|
|
943fccf655 | ||
|
|
e0d2d44f35 | ||
|
|
5a6413f356 | ||
|
|
f3ef4c77f5 | ||
|
|
751e391db6 | ||
|
|
3e04c9493f | ||
|
|
6b0a1a42ad | ||
|
|
ee82b23886 | ||
|
|
c9bb3ff6f6 | ||
|
|
993d497aad | ||
|
|
0d2dc2c257 | ||
|
|
c785be82dd | ||
|
|
80afb3a86e | ||
|
|
f5d8974d04 | ||
|
|
a4bb82a02d | ||
|
|
e8c94f3584 | ||
|
|
d123eec476 | ||
|
|
002a443281 | ||
|
|
64f3d08d4e | ||
|
|
9c956a30ea | ||
|
|
276269e583 | ||
|
|
5eaa90a7a2 | ||
|
|
8f36c4e793 | ||
|
|
5f999d3c84 | ||
|
|
d68aafea15 | ||
|
|
e093ae72da | ||
|
|
d17362d8c4 | ||
|
|
5e19e7ac6c | ||
|
|
871565c687 | ||
|
|
6104b7803b | ||
|
|
95a332f38a | ||
|
|
4c4cc52c07 | ||
|
|
4714442d6e | ||
|
|
66115ca306 | ||
|
|
7fec4c0dac | ||
|
|
e3f5033bc4 | ||
|
|
2ec3b20b23 | ||
|
|
d26d02babc | ||
|
|
675671688b | ||
|
|
bcdd48615d | ||
|
|
1f974558f8 | ||
|
|
0f1ad59e58 | ||
|
|
2e31a5bbcb | ||
|
|
d6a320490a | ||
|
|
125353c5a3 | ||
|
|
cf7584bb63 | ||
|
|
e10042a433 | ||
|
|
3eee8faad4 | ||
|
|
42eb61434d | ||
|
|
2962ef79dc | ||
|
|
87bdfbeeeb | ||
|
|
493b0d4a11 | ||
|
|
0c589a6f79 | ||
|
|
9b1aa3cd36 | ||
|
|
de860ac316 | ||
|
|
2495871c48 | ||
|
|
56c1851848 | ||
|
|
86f9e93e97 | ||
|
|
11502edad2 | ||
|
|
f6ffd574bf | ||
|
|
7df1060370 | ||
|
|
ce26828e41 | ||
|
|
2bae30bd11 | ||
|
|
e16db26d18 | ||
|
|
9f81a77943 | ||
|
|
f9c60423a8 | ||
|
|
0a554661ad | ||
|
|
8a67a87461 | ||
|
|
1cd89561ab | ||
|
|
79592e2c27 | ||
|
|
4a72d40394 | ||
|
|
95f6e4dd3b | ||
|
|
778b8718c9 | ||
|
|
b81c3b8f1b | ||
|
|
1d8760742e | ||
|
|
eb00ceb1c7 | ||
|
|
33f8ea5acb | ||
|
|
4b65dfa6ea | ||
|
|
0187f1780e | ||
|
|
4a5f374b7c | ||
|
|
c4e22a23ea | ||
|
|
8b7776b545 | ||
|
|
f3787beade | ||
|
|
3607341413 | ||
|
|
b33b14b4b7 | ||
|
|
d09743d254 | ||
|
|
2361c1b211 | ||
|
|
ff74e9035d | ||
|
|
cb4b26c8a4 | ||
|
|
1640ba2e9e | ||
|
|
ca003943a9 | ||
|
|
71783aea21 | ||
|
|
b5632b0097 | ||
|
|
c506ff6872 | ||
|
|
fd83834fca | ||
|
|
973cab57ab | ||
|
|
d1535e1789 | ||
|
|
60e1f15e42 | ||
|
|
6531d40386 | ||
|
|
c940e0bc92 | ||
|
|
86e3776fff | ||
|
|
469b29c941 | ||
|
|
1b57b272f9 | ||
|
|
c906307a33 | ||
|
|
b914613e80 | ||
|
|
ba99d83d17 | ||
|
|
a58b58cd95 | ||
|
|
96d41ae8f6 | ||
|
|
e3afab765d | ||
|
|
507a653d81 | ||
|
|
b1a39e9b38 | ||
|
|
19846c7e01 | ||
|
|
e3e8783eb8 | ||
|
|
e9db53c973 | ||
|
|
fd0645fbb4 | ||
|
|
2849cbf257 | ||
|
|
b2459d8f48 | ||
|
|
935189f3f7 | ||
|
|
b647017c43 | ||
|
|
3a8a603527 | ||
|
|
b6d10656f9 | ||
|
|
7de31d8cb6 | ||
|
|
cac84a8795 | ||
|
|
a227f6dcb9 | ||
|
|
9ff4acf092 | ||
|
|
128b1fe9bc | ||
|
|
9a92372c3e | ||
|
|
0a36869b3c | ||
|
|
a9a38f88bb | ||
|
|
aca1fcad18 | ||
|
|
24bc878c27 | ||
|
|
b1a9fbc6fd | ||
|
|
8a4c635c97 | ||
|
|
16d5f5c299 | ||
|
|
69a5a0434a | ||
|
|
6d1f3a5729 | ||
|
|
b725400428 | ||
|
|
9f7d2be463 | ||
|
|
fdee510c8c | ||
|
|
76ac1bd8f7 | ||
|
|
362658339a | ||
|
|
925d7e2a25 | ||
|
|
089477eb1e | ||
|
|
f153f77a7e | ||
|
|
a34141c912 | ||
|
|
94374e7de2 | ||
|
|
bdf6748956 | ||
|
|
d6dcb471f9 | ||
|
|
2c0391da81 | ||
|
|
77c2255da4 | ||
|
|
5ce7261678 | ||
|
|
001253b32d | ||
|
|
2480822690 | ||
|
|
16b9f49cc8 | ||
|
|
1295d37ff6 | ||
|
|
7119c8155a | ||
|
|
cef8791c82 | ||
|
|
e417b57123 | ||
|
|
c827aeaab2 | ||
|
|
f271cf737c | ||
|
|
1f9a8276b1 | ||
|
|
06b17128fd | ||
|
|
6fb878d3b6 | ||
|
|
80f49aecd7 | ||
|
|
5ab98c9d05 | ||
|
|
df7fd26907 | ||
|
|
86d8e10dcb | ||
|
|
d258d9474a | ||
|
|
15043ba46c | ||
|
|
f085f6c7bc | ||
|
|
197bae6065 | ||
|
|
22729b3d71 | ||
|
|
33363f0d6a | ||
|
|
22ca77188b | ||
|
|
fd2d4c723c | ||
|
|
79a9dd15a7 | ||
|
|
f599b2c846 | ||
|
|
de8c7dbc93 | ||
|
|
ed22890d67 | ||
|
|
7303c785aa | ||
|
|
9df7ac0ac2 | ||
|
|
a0fa536926 | ||
|
|
ce4cad67a6 | ||
|
|
bf23c5b209 | ||
|
|
57d9b79e77 | ||
|
|
16973fc034 | ||
|
|
2e5ffb8324 | ||
|
|
4dbe5c8055 | ||
|
|
1ee57f1385 | ||
|
|
10d6256ce1 | ||
|
|
03ebc4a794 | ||
|
|
54a92bf2c6 | ||
|
|
9e567ace4e | ||
|
|
a1f5c12a96 | ||
|
|
96d8ac7250 | ||
|
|
fef6dccfd7 | ||
|
|
0b7543a59b | ||
|
|
dfb3322b28 | ||
|
|
ebe2806467 | ||
|
|
e1b6e46b2f | ||
|
|
c5e746b6c6 | ||
|
|
e5327aba78 | ||
|
|
d4e024f42d | ||
|
|
4f620aed8d | ||
|
|
8f5e89d69a | ||
|
|
86635eef49 | ||
|
|
25c94dc2f0 | ||
|
|
c376426cdf | ||
|
|
2f5cd78f7f | ||
|
|
ffbbec879b | ||
|
|
e5416827cb | ||
|
|
279ab8f808 | ||
|
|
144012b980 | ||
|
|
95ff67e99c | ||
|
|
649a2a645c | ||
|
|
46e731dee0 | ||
|
|
626a5ed4f1 | ||
|
|
8240493685 | ||
|
|
f95b9cef77 | ||
|
|
168cc36410 | ||
|
|
2dbe9c1e0e | ||
|
|
e222ba5459 | ||
|
|
69252f6177 | ||
|
|
7407bb335d | ||
|
|
aaa0eb7140 | ||
|
|
6376bbb9a7 | ||
|
|
c01642ef22 | ||
|
|
72f4584b0f | ||
|
|
941f86008b | ||
|
|
fac8e91d3a | ||
|
|
ce14d15ba3 | ||
|
|
92ab338640 | ||
|
|
f273621082 | ||
|
|
ddc5f46e9b | ||
|
|
7a0da13676 | ||
|
|
267b41242d | ||
|
|
5bbc35695a | ||
|
|
eac71f1f43 | ||
|
|
bd4ba47e61 | ||
|
|
cd2d59c6a1 | ||
|
|
5e31c809e1 | ||
|
|
961984df24 | ||
|
|
e956a9ad35 | ||
|
|
f9869ef453 | ||
|
|
7bb3826cdd | ||
|
|
0af5a85f67 | ||
|
|
3d7a64a11d | ||
|
|
548916e6e1 | ||
|
|
ffa2eb57b1 | ||
|
|
fd7d2b7580 | ||
|
|
57702f545d | ||
|
|
1764be8a30 | ||
|
|
e90b9a5a95 | ||
|
|
a398010213 | ||
|
|
c49201f365 | ||
|
|
070614cd3c | ||
|
|
cce88745c2 | ||
|
|
4b02878390 | ||
|
|
2633a1429a | ||
|
|
b2e33f892a | ||
|
|
8925d7d546 | ||
|
|
56cec26858 | ||
|
|
107c01913d | ||
|
|
6d102ccef8 | ||
|
|
fba358c0fc | ||
|
|
17cee98617 | ||
|
|
d6866052c4 | ||
|
|
3be7c2e1a8 | ||
|
|
375f966e9a | ||
|
|
4833f36e0b | ||
|
|
35968f4861 | ||
|
|
e3ca927306 | ||
|
|
c2aff60127 | ||
|
|
ae203b5c7c | ||
|
|
6a4627cddc | ||
|
|
f66cb2651f | ||
|
|
a4cdb5d45f | ||
|
|
3501d377f6 | ||
|
|
b4a3a483e9 | ||
|
|
76c025d53b | ||
|
|
cd1b0e01a0 | ||
|
|
44b2d09e63 | ||
|
|
c7dcbdcb5b | ||
|
|
daaf685c9e | ||
|
|
9c2a88179b | ||
|
|
a2d24a5cda | ||
|
|
4191d878f2 | ||
|
|
1c0e29f029 | ||
|
|
25d3b519d9 | ||
|
|
39b1332e49 | ||
|
|
0da122281e | ||
|
|
4615e97ad5 | ||
|
|
4dabc214f2 | ||
|
|
ea6a1752e7 | ||
|
|
062b3b0a33 | ||
|
|
c5d8ec9c1a | ||
|
|
1af4a2686b | ||
|
|
174b9bdc3d | ||
|
|
84212d0b1d | ||
|
|
6e9b77a97a | ||
|
|
c93b96a03f | ||
|
|
a671f95bee | ||
|
|
0e750c64db | ||
|
|
27eef50b9f | ||
|
|
8297546ed7 | ||
|
|
4e54733d38 | ||
|
|
bd9b34b9a0 | ||
|
|
b1e843973c | ||
|
|
11b130736c | ||
|
|
25531ecd76 | ||
|
|
332ba5d678 | ||
|
|
1da1721ec2 | ||
|
|
f8120c2ebb | ||
|
|
cdca8c0ed7 | ||
|
|
4f2b1e23a9 | ||
|
|
47f49532c6 | ||
|
|
cffaf99b17 | ||
|
|
973ece9eb9 | ||
|
|
a21fc91915 | ||
|
|
80dfcf05a7 | ||
|
|
0368583cfc | ||
|
|
c5554995dd | ||
|
|
70cc1c4a32 | ||
|
|
2ace9ba492 | ||
|
|
cc8915842a | ||
|
|
2e2cfc2409 | ||
|
|
2265ecab21 | ||
|
|
29d4e37f6b | ||
|
|
e0bc3bb2c5 | ||
|
|
6d602d5d48 | ||
|
|
1e7718162d | ||
|
|
e3c52a6174 | ||
|
|
585e49ac65 | ||
|
|
86545f4fff | ||
|
|
b57ec9fe70 | ||
|
|
b96af0fdef | ||
|
|
b0ea7ad71c | ||
|
|
c8c0d22787 | ||
|
|
263166c9d1 | ||
|
|
f3884af4b9 | ||
|
|
9a4200ac1a | ||
|
|
32d5f7477a | ||
|
|
ecf1f816c3 | ||
|
|
f9056b0680 | ||
|
|
afae33d588 | ||
|
|
0b8c6ee536 | ||
|
|
e652c1d783 | ||
|
|
aed9566409 | ||
|
|
33ec5c5c6b | ||
|
|
b53a5aa3af | ||
|
|
635bc084b7 | ||
|
|
f0bd6c97fa | ||
|
|
13a834ceaa | ||
|
|
ded941b7b9 | ||
|
|
535dcf4778 | ||
|
|
4dad2a593b | ||
|
|
8b5a3f734c | ||
|
|
b3643944f3 | ||
|
|
e2e8ded2c0 | ||
|
|
72d0fea3a1 | ||
|
|
62a6a0a8be | ||
|
|
04326eba21 | ||
|
|
a02b4b3955 | ||
|
|
e0dbd2d2db | ||
|
|
4a62bb6ad7 | ||
|
|
748ac600fa | ||
|
|
c2561726e0 | ||
|
|
f2b7b07e51 | ||
|
|
d1e19aad51 | ||
|
|
5d34e49c57 | ||
|
|
bef0180e4c | ||
|
|
31e59ab395 | ||
|
|
37dccd93e9 | ||
|
|
bf30bf28a9 | ||
|
|
1bf380a921 | ||
|
|
a4c61bcd66 | ||
|
|
a172a1052a | ||
|
|
f4ef2ec934 | ||
|
|
4cda5f1787 | ||
|
|
ceef19e55b | ||
|
|
0634baf780 | ||
|
|
d424bb1224 | ||
|
|
f97943006e | ||
|
|
ea8b7f317d | ||
|
|
2dd2bee940 | ||
|
|
d579872078 | ||
|
|
df587fc61f | ||
|
|
7c2a9d141e | ||
|
|
e4e1325b08 | ||
|
|
399118174e | ||
|
|
fecf452592 | ||
|
|
1c7b7a1a55 | ||
|
|
793ccf978e | ||
|
|
ef57e543c6 | ||
|
|
42800a6195 | ||
|
|
be29f163a3 | ||
|
|
207f2e1689 | ||
|
|
4fd00af273 | ||
|
|
1e8143eb8c | ||
|
|
5398953555 | ||
|
|
809a532a6c | ||
|
|
c666361611 | ||
|
|
5771d0c9e8 | ||
|
|
bfd2f9d156 | ||
|
|
30b7028dd8 | ||
|
|
d68529096b | ||
|
|
6f420f88b1 | ||
|
|
08457055b0 | ||
|
|
5713a278cd | ||
|
|
46c247149e | ||
|
|
28e6135f8c | ||
|
|
d0cf3179a2 | ||
|
|
96a4c95a3a | ||
|
|
6b8ba9d273 | ||
|
|
27c9ceab9f | ||
|
|
0b89e9a8f9 | ||
|
|
67b560da08 | ||
|
|
8823dc6a52 | ||
|
|
f005afb71c | ||
|
|
33128195fe | ||
|
|
6c5088f071 | ||
|
|
c97ece946a | ||
|
|
5647d6e6d4 | ||
|
|
73dc3325df | ||
|
|
3b7a99ff52 | ||
|
|
97a63ea5b2 | ||
|
|
da5372637b | ||
|
|
40282cd39d | ||
|
|
339b915437 | ||
|
|
2a5869dd80 | ||
|
|
d84c9e3230 | ||
|
|
4860d03c38 | ||
|
|
b112797a3e | ||
|
|
32c28e32cd | ||
|
|
9129625365 | ||
|
|
ff58efcbf3 | ||
|
|
b38b2f16fc | ||
|
|
201fcf9f45 | ||
|
|
ad0c2a11f3 | ||
|
|
9ad0dc36b7 | ||
|
|
ffb23909fa | ||
|
|
075dfd00ca | ||
|
|
3211e3db26 | ||
|
|
ee5e420419 | ||
|
|
d44fa1775c | ||
|
|
87b74db9fc | ||
|
|
bcb71f68c0 | ||
|
|
18f52f2717 | ||
|
|
80b2fabea0 | ||
|
|
4ce1218d6f | ||
|
|
ea890c41af | ||
|
|
3435dfe5e3 | ||
|
|
6283ffdfe4 | ||
|
|
2cd9418b7a | ||
|
|
c8dbcf7b6d | ||
|
|
8a0570f383 | ||
|
|
3c5fa06d57 | ||
|
|
ddbf710727 | ||
|
|
d05d1309ca | ||
|
|
39d96a63ac | ||
|
|
e94458317a | ||
|
|
12051811fc | ||
|
|
ef208bf9e5 | ||
|
|
f15a613b16 | ||
|
|
4805e07106 | ||
|
|
4d79c96a4b | ||
|
|
9e0aa1f3fa | ||
|
|
281c545a8f | ||
|
|
87e603af31 | ||
|
|
c6cc1baae1 | ||
|
|
a3b8c722a7 | ||
|
|
5569ac82da | ||
|
|
cb2d7c060c | ||
|
|
63b126b530 | ||
|
|
aac4adea1a | ||
|
|
4f0638ac4f | ||
|
|
028884ded6 | ||
|
|
93979e4762 | ||
|
|
ce804ce02b | ||
|
|
c9837eaa71 | ||
|
|
636a430eb9 | ||
|
|
d8d0ab5fc4 | ||
|
|
efda20c143 | ||
|
|
0e1df2460e | ||
|
|
41e8a445ca | ||
|
|
acbb35088c | ||
|
|
e8b3d44400 | ||
|
|
90c1fff54a | ||
|
|
0be7d97c3f | ||
|
|
84604a176b | ||
|
|
5ee9731d28 | ||
|
|
da96459bff | ||
|
|
f9365dfa14 | ||
|
|
a4854a883b | ||
|
|
63198ee3d2 | ||
|
|
fb2dccc7ff | ||
|
|
9e405f0604 | ||
|
|
82923a7c64 | ||
|
|
c52bb47fef | ||
|
|
12119c4faf | ||
|
|
3a4803b675 | ||
|
|
2ced1b2d71 | ||
|
|
63ae211af1 | ||
|
|
43dc1e06e4 | ||
|
|
3010f20d13 | ||
|
|
e2b13ade95 | ||
|
|
488a01d7d7 | ||
|
|
b7394c98a4 | ||
|
|
a789a59ad8 | ||
|
|
158fe58111 | ||
|
|
9b678b0d95 | ||
|
|
f9c1aabe85 | ||
|
|
2711cf5c27 | ||
|
|
9217101032 | ||
|
|
53aa88a659 | ||
|
|
e76a68ee0d | ||
|
|
c76aa03566 | ||
|
|
1efefad3ee | ||
|
|
c214a6e56e | ||
|
|
50a9518de7 | ||
|
|
925cc6bb9b | ||
|
|
0113447481 | ||
|
|
10b7c70a59 | ||
|
|
e634279481 | ||
|
|
0de9e5eb24 | ||
|
|
06a5265580 | ||
|
|
6d0867c27d | ||
|
|
eb4f218c7d | ||
|
|
7ae7f13ad1 | ||
|
|
80409cd94e | ||
|
|
236a6bdcb0 | ||
|
|
52b5c4a360 | ||
|
|
b629cd236d | ||
|
|
0cafaafdf2 | ||
|
|
88f607e350 | ||
|
|
d0b2f18d9a | ||
|
|
47c909dda4 | ||
|
|
bee933dd72 | ||
|
|
73b010af00 | ||
|
|
7436b34a96 | ||
|
|
78173ae24e | ||
|
|
3a2a9d26eb | ||
|
|
0f7091f3a8 | ||
|
|
49db4c3bb8 | ||
|
|
385c6d6aab | ||
|
|
f1b52869a9 | ||
|
|
b716a7446a | ||
|
|
27af64f2bd | ||
|
|
7098489f15 | ||
|
|
89fff8e963 | ||
|
|
2b750b6d29 | ||
|
|
f599bc80a1 | ||
|
|
eea9f7a1f6 | ||
|
|
072b52708f | ||
|
|
4e6ac847e2 | ||
|
|
51835e32c5 | ||
|
|
d5dd5bc88a | ||
|
|
42918cf306 | ||
|
|
18521c93b4 | ||
|
|
57065a1831 | ||
|
|
536aa68389 | ||
|
|
c4182a950f | ||
|
|
5bafb3f1b7 | ||
|
|
eb309563a9 | ||
|
|
392f1e0a24 | ||
|
|
2e87c76b6e | ||
|
|
8ffdb4d1c2 | ||
|
|
46d98c2b22 | ||
|
|
dfceed8751 | ||
|
|
fd01653164 | ||
|
|
4611e2c058 | ||
|
|
65257eb3d5 | ||
|
|
81b6350501 | ||
|
|
b2de157c3c | ||
|
|
6d1e58b130 | ||
|
|
e7ad3e6935 | ||
|
|
07f2a663c1 | ||
|
|
26bd9203e1 | ||
|
|
08c5f82a04 | ||
|
|
640985a5e6 | ||
|
|
b2935d800e | ||
|
|
36a22129a1 | ||
|
|
ff649b9d49 | ||
|
|
84157f7bd8 | ||
|
|
6cc29c5005 | ||
|
|
20438989f8 | ||
|
|
03b996d626 | ||
|
|
5918f800d7 | ||
|
|
8290b909a2 | ||
|
|
42a07f8ebf | ||
|
|
1a4d64595c | ||
|
|
eef20e399c | ||
|
|
949fc722dd | ||
|
|
f87975f49f | ||
|
|
baad783d64 | ||
|
|
e3f061a54d | ||
|
|
d8c5c31e61 | ||
|
|
4c0167cc03 | ||
|
|
0bb3061f8d | ||
|
|
e85ea61063 | ||
|
|
cd68736263 | ||
|
|
16a4ddc8fa | ||
|
|
ce93104e2d | ||
|
|
d302785241 | ||
|
|
2721930294 | ||
|
|
a16585ca51 | ||
|
|
6102f88025 | ||
|
|
6c44f7fe24 | ||
|
|
0453402242 | ||
|
|
d3c348f8f2 | ||
|
|
c262fd75e1 | ||
|
|
38c1181359 | ||
|
|
85347885bd | ||
|
|
06dd581fc3 | ||
|
|
3cb5530866 | ||
|
|
a50c411099 | ||
|
|
49469160b0 | ||
|
|
52c087fd22 | ||
|
|
185045f805 | ||
|
|
14c3b11664 | ||
|
|
1677cb7321 | ||
|
|
f5b6a4be49 | ||
|
|
5f5dfd13c7 | ||
|
|
0649b060ce | ||
|
|
5ed6912e0b | ||
|
|
4075a13c58 | ||
|
|
fcda7ed51e | ||
|
|
5745aea914 | ||
|
|
e5b3d01f2c | ||
|
|
84e78560f4 | ||
|
|
82bdbaa0f4 | ||
|
|
08d6dac4e4 | ||
|
|
2b7dfc0e88 | ||
|
|
71b527b67c | ||
|
|
65b1d8819d | ||
|
|
622d15d5d7 | ||
|
|
75b8a5a6a7 | ||
|
|
c2086fdb15 | ||
|
|
f6f55e0609 | ||
|
|
736f73a726 | ||
|
|
d0649d29fb | ||
|
|
eebed6d399 | ||
|
|
e688b2959c | ||
|
|
27977fc02b | ||
|
|
ea3b8a4d64 | ||
|
|
54fca3d1a3 | ||
|
|
8bf84b26f3 | ||
|
|
8c58060716 | ||
|
|
929f7445ed | ||
|
|
63c3937050 | ||
|
|
2b0c46bfdb | ||
|
|
f13ae2d3c1 | ||
|
|
e7fd97deef | ||
|
|
8967a82107 | ||
|
|
a44a986ace | ||
|
|
47a0dbf87a | ||
|
|
7b58883d33 | ||
|
|
38a731aa8f | ||
|
|
bfc3b0e54e | ||
|
|
37508493fb | ||
|
|
38bb9a77e0 | ||
|
|
5259fc151b | ||
|
|
5204438c0c | ||
|
|
ebe7cce161 | ||
|
|
bfe83c0256 | ||
|
|
3b123863b5 | ||
|
|
411c5bc94e | ||
|
|
4962f692a7 | ||
|
|
71dfec6875 | ||
|
|
0149cfbd21 | ||
|
|
2e77792042 | ||
|
|
2e1f63fe96 | ||
|
|
e8f1b229b2 | ||
|
|
92513024b5 | ||
|
|
d0c375aa0a | ||
|
|
5488c950aa | ||
|
|
7764ffc8bb | ||
|
|
f9c5ca258a | ||
|
|
1a1c7bb604 | ||
|
|
6f73e93e9b | ||
|
|
e141b4771c | ||
|
|
b90a8423f1 | ||
|
|
7c268088d4 | ||
|
|
e68eea5684 | ||
|
|
40f9601379 | ||
|
|
ee32942f71 | ||
|
|
4a4d861592 | ||
|
|
42c66552c8 | ||
|
|
dc6ec2ba78 | ||
|
|
7fb7061ca7 | ||
|
|
e85ea1ff28 | ||
|
|
fe91d4b56a | ||
|
|
9218ac237b | ||
|
|
6560369b98 | ||
|
|
30b080efbd | ||
|
|
f01b7075fb | ||
|
|
ff72c007c0 | ||
|
|
6bdb157af3 | ||
|
|
04afa61d55 | ||
|
|
7549972048 | ||
|
|
720c5d6080 | ||
|
|
e7d38d340f | ||
|
|
d750f1ceed | ||
|
|
7e471bfea4 | ||
|
|
aa254a3772 | ||
|
|
ff0994e1c7 | ||
|
|
3cd1dece52 | ||
|
|
9ac2b70df3 | ||
|
|
2d6c05e962 | ||
|
|
8384bbfc0a | ||
|
|
31ee7a2e9a | ||
|
|
f84509c824 | ||
|
|
f0d86cbaec | ||
|
|
3132150fb8 | ||
|
|
24f7bac3ea | ||
|
|
0930201e5d | ||
|
|
df218ee6c8 | ||
|
|
27c39415c2 | ||
|
|
f155b98a92 | ||
|
|
f0043b4be5 | ||
|
|
a6db53873a | ||
|
|
397965f6e9 | ||
|
|
76de357cbf | ||
|
|
40724ad877 | ||
|
|
be6ecbe0b1 | ||
|
|
72ae105166 | ||
|
|
06baaa1522 | ||
|
|
fa17c70d85 | ||
|
|
c606972f0a | ||
|
|
d4dde58e13 | ||
|
|
71917eb0ec | ||
|
|
1b129636ed | ||
|
|
c2d438fba3 | ||
|
|
ee4553130b | ||
|
|
bf6ccea1e2 | ||
|
|
e0eac6ab7e | ||
|
|
094eb5c17e | ||
|
|
3d3182095d | ||
|
|
706f8e1482 | ||
|
|
ea7e07034a | ||
|
|
1fd92d6a5d | ||
|
|
810ebad9ba | ||
|
|
c6554c8f80 | ||
|
|
19a8d9e9b3 | ||
|
|
a490287b4a | ||
|
|
90b0c91b2f | ||
|
|
1493132974 | ||
|
|
6a4468193b | ||
|
|
4dd99b5240 | ||
|
|
7961ba87ed | ||
|
|
6952bea6e1 | ||
|
|
53600175b9 | ||
|
|
e5956d4039 | ||
|
|
1f9850c04d | ||
|
|
df43cb7a90 | ||
|
|
bea664af0f | ||
|
|
b265c640ca | ||
|
|
a3d6f32202 | ||
|
|
16e65d39be | ||
|
|
186bdb486f | ||
|
|
ea40cc7692 | ||
|
|
16ca373c55 | ||
|
|
38cf3869bc | ||
|
|
60e3431b36 | ||
|
|
84a6c2da59 | ||
|
|
5b9ff3053b | ||
|
|
8340922263 | ||
|
|
a93cab6b43 | ||
|
|
9a81c400ab | ||
|
|
808a22d5c6 | ||
|
|
10e512f32e | ||
|
|
4d75515bd6 | ||
|
|
3d6c84de6d | ||
|
|
3dd393b840 | ||
|
|
8f86c53941 | ||
|
|
a7b78c547a | ||
|
|
bcc1046cdf | ||
|
|
c05c06b7a1 | ||
|
|
446ebae175 | ||
|
|
ba742b7b1f | ||
|
|
7c6db809bb | ||
|
|
855499681f | ||
|
|
92be3c0f56 | ||
|
|
2a72f391b7 | ||
|
|
db642f0837 | ||
|
|
fca93b6c51 | ||
|
|
7e672d86e7 | ||
|
|
e9112cad0f | ||
|
|
ffbd6445df | ||
|
|
dff44f2721 | ||
|
|
3afa81eb5d | ||
|
|
3350c3e2e5 | ||
|
|
f85f46c248 | ||
|
|
05f3b88f30 | ||
|
|
f8c6b5c05f | ||
|
|
97dbfe492e | ||
|
|
186f0ed06f | ||
|
|
daf134f331 | ||
|
|
3f7f78da15 | ||
|
|
1d289621fc | ||
|
|
d7002cda11 | ||
|
|
559fcecf77 | ||
|
|
1d854c232e | ||
|
|
8c6684cbdf | ||
|
|
c7ab71f01f | ||
|
|
9b57351d1e | ||
|
|
f9e88fb6ee | ||
|
|
074ba0ae05 | ||
|
|
4a8a5e8428 | ||
|
|
f7fa665f3a | ||
|
|
e273ddcfb0 | ||
|
|
41d3a1fd55 | ||
|
|
7237ba34db | ||
|
|
fbf89b3f0a | ||
|
|
8f38422e7f | ||
|
|
79a64f0118 | ||
|
|
55648350ed | ||
|
|
2a33a9af64 | ||
|
|
14c5357fa3 | ||
|
|
a343377a43 | ||
|
|
de75992e7b | ||
|
|
fba6c1642d | ||
|
|
4f7ca3ede8 | ||
|
|
8fd59e89de | ||
|
|
da5badc189 | ||
|
|
33da5d31cf | ||
|
|
f506a9d7ac | ||
|
|
915291d780 | ||
|
|
08b9e0788f | ||
|
|
115d2078b9 | ||
|
|
00151f2c67 | ||
|
|
0e670329c8 | ||
|
|
4ac8a38834 | ||
|
|
4111ee4c58 | ||
|
|
05b8afd681 | ||
|
|
2b4ca03376 | ||
|
|
a314a43f0f | ||
|
|
278fd931fb | ||
|
|
1e0f0f47fa | ||
|
|
942faf474b | ||
|
|
9fd2583fd5 | ||
|
|
463ca6185b | ||
|
|
2c5bb5b699 | ||
|
|
40519b48c5 | ||
|
|
7f8ad88c06 | ||
|
|
c5d1f2dd7a | ||
|
|
8ab4682519 | ||
|
|
84b4ae0634 | ||
|
|
8de304accf | ||
|
|
ed9ecd4667 | ||
|
|
4c81efc5b3 | ||
|
|
a4620f8c68 | ||
|
|
bf7e713eec | ||
|
|
c25f1f856a | ||
|
|
60a3cac80d | ||
|
|
a1304054ce | ||
|
|
a567666c79 | ||
|
|
1ebf546b70 | ||
|
|
19e9ba773f | ||
|
|
619aadce41 | ||
|
|
a924da10c2 | ||
|
|
ee4c4b16ec | ||
|
|
f8c221f51a | ||
|
|
2a48babd50 | ||
|
|
e5d94d9a53 | ||
|
|
8cfe6a5848 | ||
|
|
134ea51b0f | ||
|
|
2fad7c0ff6 | ||
|
|
985859f1c3 | ||
|
|
d7f2ebcb6e | ||
|
|
e3057f90ea | ||
|
|
244a42f3be | ||
|
|
8c06a87582 | ||
|
|
637019b0a8 | ||
|
|
e3775b13a6 | ||
|
|
7fae55863e | ||
|
|
52d6c372ed | ||
|
|
3bced85fc3 | ||
|
|
f163ace86c | ||
|
|
25d6a1f02f | ||
|
|
9847db5c83 | ||
|
|
4c353f4eee | ||
|
|
870f794796 | ||
|
|
e35b4d9cd1 | ||
|
|
1afbb30bfc | ||
|
|
2f016efc50 | ||
|
|
cd1ef46577 | ||
|
|
c79ea7d5ad | ||
|
|
01fc98b221 | ||
|
|
6c0b614208 | ||
|
|
0218bf6c89 | ||
|
|
8355ed2fa5 | ||
|
|
c290906bd9 | ||
|
|
cf9175c408 | ||
|
|
575d6fa91b | ||
|
|
fb624cc368 | ||
|
|
7ed6e58f8e | ||
|
|
38497597b9 | ||
|
|
d0ebdf460f | ||
|
|
df47b174ca | ||
|
|
561c563bd7 | ||
|
|
d5e8ffc00f | ||
|
|
9f29194180 | ||
|
|
a7abebc8f4 | ||
|
|
19212e576f | ||
|
|
990ec5cd5c | ||
|
|
4b92a5ef1e | ||
|
|
8d9ac7299a | ||
|
|
6a2e04aaeb | ||
|
|
83f36f5e77 | ||
|
|
f58378daa0 | ||
|
|
ba21a2c5fa | ||
|
|
3eb6d08b34 | ||
|
|
b5f2abc930 | ||
|
|
0c3720123d | ||
|
|
4aa77d5a82 | ||
|
|
f500cc6c9a | ||
|
|
68d0b13a64 | ||
|
|
c37176fe98 | ||
|
|
421b4071d6 | ||
|
|
1e20780c36 | ||
|
|
acbe8c7605 | ||
|
|
ad0b10c517 | ||
|
|
8c657b57f7 | ||
|
|
ac03aab29f | ||
|
|
db4ce9fb7f | ||
|
|
21ba35b6bf | ||
|
|
a9a9d884ce | ||
|
|
1034b94628 | ||
|
|
4c988ede52 | ||
|
|
7b7819217f | ||
|
|
b0053b94a9 | ||
|
|
218dcc2229 | ||
|
|
8f64c5ab6a | ||
|
|
9a4c69579d | ||
|
|
486c5c42f7 | ||
|
|
3f5901766d | ||
|
|
27d22e90d4 | ||
|
|
101d73fc10 | ||
|
|
8de6ae1772 | ||
|
|
ece59cfacf | ||
|
|
780373d5f7 | ||
|
|
dfcebe9767 | ||
|
|
daaf9c2b06 | ||
|
|
83b95f9830 | ||
|
|
cf87a840f7 | ||
|
|
49653435c2 | ||
|
|
14e31018f7 | ||
|
|
2d3f5baf72 | ||
|
|
c7c1cf2552 | ||
|
|
98b12fb800 | ||
|
|
d463d6ea2e | ||
|
|
1fe439bb51 | ||
|
|
3726ceaf48 | ||
|
|
639ddd5628 | ||
|
|
16772c1d37 | ||
|
|
766897e733 | ||
|
|
e8e9a2d86f | ||
|
|
a6b53457b0 | ||
|
|
093d04c386 | ||
|
|
46de46965f | ||
|
|
f5165e12f1 | ||
|
|
0160655dba | ||
|
|
8723bbeaf8 | ||
|
|
4c66b205bb | ||
|
|
6342998c9f | ||
|
|
f555e604a3 | ||
|
|
5811adfb7f | ||
|
|
1db93e8b56 | ||
|
|
3048d0850c | ||
|
|
08a526e511 | ||
|
|
5e0cae06db | ||
|
|
1f09c8a022 | ||
|
|
751879d42e | ||
|
|
5f2d0d4bfc | ||
|
|
3d535d0e68 | ||
|
|
9362304db0 | ||
|
|
17a8f0a724 | ||
|
|
066aad7fed | ||
|
|
5138f5b314 | ||
|
|
839c44eb7a | ||
|
|
0001bc60a9 | ||
|
|
04e6f2c1ad | ||
|
|
a94847faeb | ||
|
|
64b01cce47 | ||
|
|
3df5aeb3c3 | ||
|
|
9fe5fb9a91 | ||
|
|
17951ad157 | ||
|
|
3640d846b9 | ||
|
|
becb6543e0 | ||
|
|
1055903456 | ||
|
|
e2b8133729 | ||
|
|
f2c9bf433e | ||
|
|
31b3ce1049 | ||
|
|
f69ea8648c | ||
|
|
bbe380cc9e | ||
|
|
be15206234 | ||
|
|
aee8fe6196 | ||
|
|
4f2c8bd905 | ||
|
|
a2e2eb3b73 | ||
|
|
32d6c2e1d8 | ||
|
|
b4c8e42d87 | ||
|
|
a8e23966fa | ||
|
|
2350919f36 | ||
|
|
355d2aebb4 | ||
|
|
50d6f1f831 | ||
|
|
d9b8e68c30 | ||
|
|
c660aaba3d | ||
|
|
60b37876b1 | ||
|
|
37aaaee086 | ||
|
|
b91ac0de1d | ||
|
|
8d247add98 | ||
|
|
a813df993c | ||
|
|
1915ba5bfb | ||
|
|
3e142f67ad | ||
|
|
b4b456ae06 | ||
|
|
ed0bb7fd16 | ||
|
|
c9f94a3b15 | ||
|
|
ec36f78ffb | ||
|
|
439ec286b5 | ||
|
|
28b58d8e49 | ||
|
|
26cb37c9be | ||
|
|
115470fce6 | ||
|
|
23e9184323 | ||
|
|
deac7de5aa | ||
|
|
6996cdfbf9 | ||
|
|
8c9822cc71 | ||
|
|
d05ff5ce48 | ||
|
|
ccff6dc2b8 | ||
|
|
5ce4f91829 | ||
|
|
757eed1617 | ||
|
|
333cc7b5a8 | ||
|
|
91a936c151 | ||
|
|
d409ac1b73 | ||
|
|
9e8f14c9d3 | ||
|
|
e05eba2450 | ||
|
|
df2bcec768 | ||
|
|
0bf98cce9e | ||
|
|
45ec069dce | ||
|
|
006f134647 | ||
|
|
804f9235cd | ||
|
|
5d9fc292b7 | ||
|
|
37dac7f6ea | ||
|
|
68c1a3e1cc | ||
|
|
8459e53e39 | ||
|
|
26597816e5 | ||
|
|
b8b1083921 | ||
|
|
f19ba44574 | ||
|
|
050bfe1380 | ||
|
|
1b5cba94d2 | ||
|
|
dbd75912aa | ||
|
|
9b321af3da | ||
|
|
d061cdb3ef | ||
|
|
97fb24e060 | ||
|
|
7a035c5734 | ||
|
|
eb89ca5415 | ||
|
|
eb650aa586 | ||
|
|
ce32fd32b6 | ||
|
|
00e395f252 | ||
|
|
b6b1b43094 | ||
|
|
68ae88dc1b | ||
|
|
acf78e8383 | ||
|
|
bd87b8a002 | ||
|
|
7cf7368ae3 | ||
|
|
9001a96fff | ||
|
|
9ea4d1f99f | ||
|
|
fc62a5bdc2 | ||
|
|
06b543039f | ||
|
|
1c354ffa0a | ||
|
|
163e28d9ba | ||
|
|
fd9ff4a432 | ||
|
|
cab975f88b | ||
|
|
c644e4afa8 | ||
|
|
0a498460d6 | ||
|
|
bd4333ab9a | ||
|
|
9138aecdf0 | ||
|
|
e4e4dcbd1e | ||
|
|
2a0484ede2 | ||
|
|
c9f12c2e49 | ||
|
|
27354d82e2 | ||
|
|
f5e1885ffa | ||
|
|
afc4731b9d | ||
|
|
9411866727 | ||
|
|
c7fd1ac373 | ||
|
|
faf14ff10b | ||
|
|
3b3b3c961e | ||
|
|
06d495c7e1 | ||
|
|
922e142079 | ||
|
|
cdc9347011 | ||
|
|
e264b5b052 | ||
|
|
28696c0dad | ||
|
|
8689c07888 | ||
|
|
aa0b7ed1a8 | ||
|
|
5f4d73b00d | ||
|
|
6ad9044cd1 | ||
|
|
9e9a1ec024 | ||
|
|
a214dca6fa | ||
|
|
b142e5647e | ||
|
|
a33a8da5c1 | ||
|
|
e029159067 | ||
|
|
8582ad2529 | ||
|
|
e7f1127aee | ||
|
|
7e54c465b1 | ||
|
|
5c76d398c5 | ||
|
|
f6a935f14f | ||
|
|
26d018b1b7 | ||
|
|
cd8c5115df | ||
|
|
0020e9f3c9 | ||
|
|
8df4cd7e76 | ||
|
|
ee7e6c0f87 | ||
|
|
e65091f83c | ||
|
|
3ee8186f96 | ||
|
|
49f1b62848 | ||
|
|
90a84bb55a | ||
|
|
d2147aed3b | ||
|
|
4f28086a64 | ||
|
|
d9c20c8815 | ||
|
|
b951d89c6a | ||
|
|
ac7d4cb4fa | ||
|
|
d2ea0592ce | ||
|
|
66ddeb94bf | ||
|
|
e13b136484 | ||
|
|
9c5fa57936 | ||
|
|
7e201522d0 | ||
|
|
df35f25502 | ||
|
|
f9e557763e | ||
|
|
eafd814caf | ||
|
|
b84f7bf596 | ||
|
|
c1d753b7fe | ||
|
|
3350f58422 | ||
|
|
8c617872e0 | ||
|
|
a333c635cb | ||
|
|
a244057b3a | ||
|
|
79d7ffcbad | ||
|
|
2d985c1f91 | ||
|
|
5879ccbeb2 | ||
|
|
7887f4867d | ||
|
|
c38a6cdfbf | ||
|
|
ea7766db44 | ||
|
|
a5012ce49e | ||
|
|
d3da4f4623 | ||
|
|
7f12c2f8b8 | ||
|
|
9ba2dea148 | ||
|
|
653bfa1f17 | ||
|
|
fa00b5b173 | ||
|
|
70fb6393b6 | ||
|
|
5b379666f4 | ||
|
|
3cb34d30a9 | ||
|
|
d47c93b4d8 | ||
|
|
bc5cc4bf02 | ||
|
|
8efa7d25f8 | ||
|
|
59195fec1a | ||
|
|
14e6a80049 | ||
|
|
67ab36e0ea | ||
|
|
dfc32967ed | ||
|
|
aa3c376def | ||
|
|
61c58caf78 | ||
|
|
b402cdf7ff | ||
|
|
d80513d011 | ||
|
|
4bcfbf785f | ||
|
|
b722dab56b | ||
|
|
6165e4a47f | ||
|
|
b829abed2d | ||
|
|
36f56ba9aa | ||
|
|
022b11cf6c | ||
|
|
8d6662cb48 | ||
|
|
a59a45f109 | ||
|
|
6337561f65 | ||
|
|
fbbc94028d | ||
|
|
93d955c4b9 | ||
|
|
1c71e6d474 | ||
|
|
b2d10b7a6b | ||
|
|
1215bcb046 | ||
|
|
9195a0324e | ||
|
|
acbec213e8 | ||
|
|
e2a08e31e8 | ||
|
|
e479ee3dbc | ||
|
|
f6462ef998 | ||
|
|
dcdf49a5ce | ||
|
|
74f72fa5b6 | ||
|
|
36f33fed75 | ||
|
|
eb7c05fd4c | ||
|
|
cb746fd722 | ||
|
|
0449bc359a | ||
|
|
d3e51ffb1c | ||
|
|
77eb70626c | ||
|
|
345c4f096e | ||
|
|
a4aab3fd4e | ||
|
|
ecf770e183 | ||
|
|
d58911ac60 | ||
|
|
bb0a35b920 | ||
|
|
403649f2ea | ||
|
|
958f8387d0 | ||
|
|
9c89676030 | ||
|
|
34ec018840 | ||
|
|
1be103a249 | ||
|
|
f83f8bb789 | ||
|
|
cc2810b117 | ||
|
|
be1dae7ef0 | ||
|
|
446d26d8dc | ||
|
|
7724b49ec4 | ||
|
|
ecbd283779 | ||
|
|
389f750d7b | ||
|
|
23eaae80c8 | ||
|
|
8f8c2f852e | ||
|
|
13f7269e36 | ||
|
|
0cd62a07fb | ||
|
|
20b55693cb | ||
|
|
74cccf2c09 | ||
|
|
54d20aa99b | ||
|
|
2c8086f078 | ||
|
|
ea061a3ba6 | ||
|
|
28a6ba1b5d | ||
|
|
8b793a9ca9 | ||
|
|
fe1cf5d605 | ||
|
|
f0335b5aaa | ||
|
|
6c394ec375 | ||
|
|
9f49ce6dc9 | ||
|
|
0df331cf8a | ||
|
|
a5a04e1df7 | ||
|
|
170d1a3a9c | ||
|
|
ce941b6532 | ||
|
|
c5fc7df258 | ||
|
|
30844b8e21 | ||
|
|
99b00cedb4 | ||
|
|
63242384d6 | ||
|
|
e83d31a232 | ||
|
|
65c7b720de | ||
|
|
77ecfbac9f | ||
|
|
1a090a7c51 | ||
|
|
a88bf104df | ||
|
|
c9caa5f46b | ||
|
|
96ae5df1f1 | ||
|
|
6048f42740 | ||
|
|
5b199aa736 | ||
|
|
a6bb58bb45 | ||
|
|
a78db10798 | ||
|
|
479b3ccfb7 | ||
|
|
f916002a71 | ||
|
|
c5208eeaef | ||
|
|
2e8cbdc4aa | ||
|
|
77b0dfc8d3 | ||
|
|
c5c5681cfd | ||
|
|
808afa053f | ||
|
|
cb75d01fd3 | ||
|
|
3ae7bbf304 | ||
|
|
fc3d536433 | ||
|
|
36abf3f099 | ||
|
|
3d7fd5a30c | ||
|
|
f83d9fc03c | ||
|
|
94e6ba759e | ||
|
|
c8c30f327b | ||
|
|
72fae1af25 | ||
|
|
98f8bacdc8 | ||
|
|
06f6da725d | ||
|
|
d24eabb97c | ||
|
|
eca3f1d71e | ||
|
|
87d178773a | ||
|
|
02cb005668 | ||
|
|
cf1d5c098f | ||
|
|
65273b055c | ||
|
|
f171839830 | ||
|
|
8f9a5642f2 | ||
|
|
e906d5db25 | ||
|
|
80c09a07dc | ||
|
|
af6145600a | ||
|
|
42bda59392 | ||
|
|
e73f6505e9 | ||
|
|
332aa45618 | ||
|
|
253075e332 | ||
|
|
737b8f02b1 | ||
|
|
2a996e2c9a | ||
|
|
c77d627077 | ||
|
|
11daf93094 | ||
|
|
44b07ee35d | ||
|
|
b24de23219 | ||
|
|
431e2aaa13 | ||
|
|
9896c75a2e | ||
|
|
94cec70737 | ||
|
|
2ba4e51e93 | ||
|
|
665a62080b | ||
|
|
a05a7e45cc | ||
|
|
f8e9216270 | ||
|
|
11d72f14dc | ||
|
|
f36735f6db | ||
|
|
1b0b08c4c4 | ||
|
|
13d440b0b6 | ||
|
|
2dc81ab8c8 | ||
|
|
b2b0fe9072 | ||
|
|
da30b52334 | ||
|
|
e854ef8757 | ||
|
|
d90ac44945 | ||
|
|
55852cb0a1 | ||
|
|
c28afebdfd | ||
|
|
07407f751f | ||
|
|
4726673508 | ||
|
|
5dc48580a0 | ||
|
|
676c1cbe83 | ||
|
|
6d61bcd605 | ||
|
|
ee78dbd27e | ||
|
|
d88d78e143 | ||
|
|
458f017517 | ||
|
|
f462b7f94e | ||
|
|
94792c9bb1 | ||
|
|
adef817e86 | ||
|
|
2f312d68a0 | ||
|
|
a7520169e6 | ||
|
|
59e3082642 | ||
|
|
795d12c91e | ||
|
|
8eb0be7562 | ||
|
|
bca4fbe7de | ||
|
|
2b99d6066f | ||
|
|
9357bd6e0f | ||
|
|
c4e0744806 | ||
|
|
1b6cba454d | ||
|
|
77cd958d08 | ||
|
|
d8aac9ecb8 | ||
|
|
2758321821 | ||
|
|
9dfa81f11f | ||
|
|
3693e115a6 | ||
|
|
2f3a3c8c48 | ||
|
|
f6d71868cb | ||
|
|
e5bf6916a6 | ||
|
|
7c119e2747 | ||
|
|
03ef52c6a7 | ||
|
|
e21e0d238e | ||
|
|
631fa3a42a | ||
|
|
ee042e11f1 | ||
|
|
178d164ff9 | ||
|
|
e5ded81d9b | ||
|
|
c8e6872fb8 | ||
|
|
2820f85be4 | ||
|
|
1989f246fd | ||
|
|
3ac414e97b | ||
|
|
bcb93fc2d0 | ||
|
|
9f579334f8 | ||
|
|
6f75b1738d | ||
|
|
72d939721d | ||
|
|
7d6ef1d69a | ||
|
|
e162da55bd | ||
|
|
fc5209723f | ||
|
|
75153ce83c | ||
|
|
fd1cf1331f | ||
|
|
a5738fdae5 | ||
|
|
86b95ee17a | ||
|
|
587e1d9971 | ||
|
|
b8e978f2a1 | ||
|
|
bd8452032e | ||
|
|
0079f4f437 | ||
|
|
0436ea671e | ||
|
|
05c29b2bc1 | ||
|
|
3f97aef93f | ||
|
|
2e3adb0b1b | ||
|
|
507da84b80 | ||
|
|
b30a30efa8 | ||
|
|
c29ff577ed | ||
|
|
f9512d6ef2 | ||
|
|
326163d798 | ||
|
|
7099bee833 | ||
|
|
b1839b722f | ||
|
|
46ae4f9b55 | ||
|
|
a9a0ae87d3 | ||
|
|
d9661602b2 |
@@ -1,9 +1,9 @@
|
|||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|||||||
8
.env.example
Normal file
8
.env.example
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
NODE_OPTIONS=--max-old-space-size=8000
|
||||||
|
API_KEY="sk-xxx"
|
||||||
|
BASE_URL="https://api.siliconflow.cn/v1/"
|
||||||
|
MODEL="Qwen/Qwen3-235B-A22B-Instruct-2507"
|
||||||
|
CSLOGGER_MAIN_LEVEL=info
|
||||||
|
CSLOGGER_RENDERER_LEVEL=info
|
||||||
|
#CSLOGGER_MAIN_SHOW_MODULES=
|
||||||
|
#CSLOGGER_RENDERER_SHOW_MODULES=
|
||||||
2
.git-blame-ignore-revs
Normal file
2
.git-blame-ignore-revs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# ignore #7923 eol change and code formatting
|
||||||
|
4ac8a388347ff35f34de42c3ef4a2f81f03fb3b1
|
||||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,2 +1,3 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
/.yarn/** linguist-vendored
|
/.yarn/** linguist-vendored
|
||||||
/.yarn/releases/* binary
|
/.yarn/releases/* binary
|
||||||
|
|||||||
4
.github/CODEOWNERS
vendored
Normal file
4
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
/src/renderer/src/store/ @0xfullex
|
||||||
|
/src/main/services/ConfigManager.ts @0xfullex
|
||||||
|
/packages/shared/IpcChannel.ts @0xfullex
|
||||||
|
/src/main/ipc.ts @0xfullex
|
||||||
92
.github/ISSUE_TEMPLATE/#0_bug_report.yml
vendored
92
.github/ISSUE_TEMPLATE/#0_bug_report.yml
vendored
@@ -1,92 +0,0 @@
|
|||||||
name: 🐛 错误报告 (中文)
|
|
||||||
description: 创建一个报告以帮助我们改进
|
|
||||||
title: '[错误]: '
|
|
||||||
labels: ['kind/bug']
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
感谢您花时间填写此错误报告!
|
|
||||||
在提交此问题之前,请确保您已经了解了[常见问题](https://docs.cherry-ai.com/question-contact/questions)和[知识科普](https://docs.cherry-ai.com/question-contact/knowledge)
|
|
||||||
|
|
||||||
- type: checkboxes
|
|
||||||
id: checklist
|
|
||||||
attributes:
|
|
||||||
label: 提交前检查
|
|
||||||
description: |
|
|
||||||
在提交 Issue 前请确保您已经完成了以下所有步骤
|
|
||||||
options:
|
|
||||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决。
|
|
||||||
required: true
|
|
||||||
- label: 我的问题不是 [常见问题](https://github.com/CherryHQ/cherry-studio/issues/3881) 中的内容。
|
|
||||||
required: true
|
|
||||||
- label: 我已经查看了 **置顶 Issue** 并搜索了现有的 [开放Issue](https://github.com/CherryHQ/cherry-studio/issues)和[已关闭Issue](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed%20),没有找到类似的问题。
|
|
||||||
required: true
|
|
||||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等。
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: platform
|
|
||||||
attributes:
|
|
||||||
label: 平台
|
|
||||||
description: 您正在使用哪个平台?
|
|
||||||
options:
|
|
||||||
- Windows
|
|
||||||
- macOS
|
|
||||||
- Linux
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: 版本
|
|
||||||
description: 您正在运行的 Cherry Studio 版本是什么?
|
|
||||||
placeholder: 例如 v1.0.0
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: 错误描述
|
|
||||||
description: 描述问题时请尽可能详细。请尽可能提供截图或屏幕录制,以帮助我们更好地理解问题。
|
|
||||||
placeholder: 告诉我们发生了什么...(记得附上截图/录屏,如果适用)
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: reproduction
|
|
||||||
attributes:
|
|
||||||
label: 重现步骤
|
|
||||||
description: 提供详细的重现步骤,以便于我们的开发人员可以准确地重现问题。请尽可能为每个步骤提供截图或屏幕录制。
|
|
||||||
placeholder: |
|
|
||||||
1. 转到 '...'
|
|
||||||
2. 点击 '....'
|
|
||||||
3. 向下滚动到 '....'
|
|
||||||
4. 看到错误
|
|
||||||
|
|
||||||
记得尽可能为每个步骤附上截图/录屏!
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: expected
|
|
||||||
attributes:
|
|
||||||
label: 预期行为
|
|
||||||
description: 清晰简洁地描述您期望发生的事情
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: logs
|
|
||||||
attributes:
|
|
||||||
label: 相关日志输出
|
|
||||||
description: 请复制并粘贴任何相关的日志输出
|
|
||||||
render: shell
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: additional
|
|
||||||
attributes:
|
|
||||||
label: 附加信息
|
|
||||||
description: 任何能让我们对你所遇到的问题有更多了解的东西
|
|
||||||
76
.github/ISSUE_TEMPLATE/#1_feature_request.yml
vendored
76
.github/ISSUE_TEMPLATE/#1_feature_request.yml
vendored
@@ -1,76 +0,0 @@
|
|||||||
name: 💡 功能建议 (中文)
|
|
||||||
description: 为项目提出新的想法
|
|
||||||
title: '[功能]: '
|
|
||||||
labels: ['kind/enhancement']
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
感谢您花时间提出新的功能建议!
|
|
||||||
在提交此问题之前,请确保您已经了解了[项目规划](https://docs.cherry-ai.com/cherrystudio/planning)和[功能介绍](https://docs.cherry-ai.com/cherrystudio/preview)
|
|
||||||
|
|
||||||
- type: checkboxes
|
|
||||||
id: checklist
|
|
||||||
attributes:
|
|
||||||
label: 提交前检查
|
|
||||||
description: |
|
|
||||||
在提交 Issue 前请确保您已经完成了以下所有步骤
|
|
||||||
options:
|
|
||||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决。
|
|
||||||
required: true
|
|
||||||
- label: 我已经查看了置顶 Issue 并搜索了现有的 [开放Issue](https://github.com/CherryHQ/cherry-studio/issues)和[已关闭Issue](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed%20),没有找到类似的建议。
|
|
||||||
required: true
|
|
||||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等。
|
|
||||||
required: true
|
|
||||||
- label: 最新的 Cherry Studio 版本没有实现我所提出的功能。
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: platform
|
|
||||||
attributes:
|
|
||||||
label: 平台
|
|
||||||
description: 您正在使用哪个平台?
|
|
||||||
options:
|
|
||||||
- Windows
|
|
||||||
- macOS
|
|
||||||
- Linux
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: 版本
|
|
||||||
description: 您正在运行的 Cherry Studio 版本是什么?
|
|
||||||
placeholder: 例如 v1.0.0
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: problem
|
|
||||||
attributes:
|
|
||||||
label: 您的功能建议是否与某个问题/issue相关?
|
|
||||||
description: 请简明扼要地描述您遇到的问题
|
|
||||||
placeholder: 我总是感到沮丧,因为...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: solution
|
|
||||||
attributes:
|
|
||||||
label: 请描述您希望实现的解决方案
|
|
||||||
description: 请简明扼要地描述您希望发生的情况
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: alternatives
|
|
||||||
attributes:
|
|
||||||
label: 请描述您考虑过的其他方案
|
|
||||||
description: 请简明扼要地描述您考虑过的任何其他解决方案或功能
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: additional
|
|
||||||
attributes:
|
|
||||||
label: 其他补充信息
|
|
||||||
description: 在此添加任何其他与功能建议相关的上下文或截图
|
|
||||||
77
.github/ISSUE_TEMPLATE/#2_question.yml
vendored
77
.github/ISSUE_TEMPLATE/#2_question.yml
vendored
@@ -1,77 +0,0 @@
|
|||||||
name: ❓ 提问 & 讨论 (中文)
|
|
||||||
description: 寻求帮助、讨论问题、提出疑问等...
|
|
||||||
title: '[讨论]: '
|
|
||||||
labels: ['kind/question']
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
感谢您的提问!请尽可能详细地描述您的问题,这样我们才能更好地帮助您。
|
|
||||||
|
|
||||||
- type: checkboxes
|
|
||||||
id: checklist
|
|
||||||
attributes:
|
|
||||||
label: Issue 检查清单
|
|
||||||
description: |
|
|
||||||
在提交 Issue 前请确保您已经完成了以下所有步骤
|
|
||||||
options:
|
|
||||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决。
|
|
||||||
required: true
|
|
||||||
- label: 我确认自己需要的是提出问题并且讨论问题,而不是 Bug 反馈或需求建议。
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: platform
|
|
||||||
attributes:
|
|
||||||
label: 平台
|
|
||||||
description: 您正在使用哪个平台?
|
|
||||||
options:
|
|
||||||
- Windows
|
|
||||||
- macOS
|
|
||||||
- Linux
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: 版本
|
|
||||||
description: 您正在运行的 Cherry Studio 版本是什么?
|
|
||||||
placeholder: 例如 v1.0.0
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: question
|
|
||||||
attributes:
|
|
||||||
label: 您的问题
|
|
||||||
description: 请详细描述您的问题
|
|
||||||
placeholder: 请尽可能清楚地说明您的问题...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: context
|
|
||||||
attributes:
|
|
||||||
label: 相关背景
|
|
||||||
description: 请提供一些背景信息,帮助我们更好地理解您的问题
|
|
||||||
placeholder: 例如:使用场景、已尝试的解决方案等
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: additional
|
|
||||||
attributes:
|
|
||||||
label: 补充信息
|
|
||||||
description: 任何其他相关的信息、截图或代码示例
|
|
||||||
render: shell
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: priority
|
|
||||||
attributes:
|
|
||||||
label: 优先级
|
|
||||||
description: 这个问题对您来说有多紧急?
|
|
||||||
options:
|
|
||||||
- 低 (有空再看)
|
|
||||||
- 中 (希望尽快得到答复)
|
|
||||||
- 高 (阻碍工作进行)
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
76
.github/ISSUE_TEMPLATE/#3_others.yml
vendored
76
.github/ISSUE_TEMPLATE/#3_others.yml
vendored
@@ -1,76 +0,0 @@
|
|||||||
name: 🤔 其他问题 (中文)
|
|
||||||
description: 提交不属于错误报告或功能需求的问题
|
|
||||||
title: '[其他]: '
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
感谢您花时间提出问题!
|
|
||||||
在提交此问题之前,请确保您已经了解了[常见问题](https://docs.cherry-ai.com/question-contact/questions)和[知识科普](https://docs.cherry-ai.com/question-contact/knowledge)
|
|
||||||
|
|
||||||
- type: checkboxes
|
|
||||||
id: checklist
|
|
||||||
attributes:
|
|
||||||
label: 提交前检查
|
|
||||||
description: |
|
|
||||||
在提交 Issue 前请确保您已经完成了以下所有步骤
|
|
||||||
options:
|
|
||||||
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决。
|
|
||||||
required: true
|
|
||||||
- label: 我已经查看了置顶 Issue 并搜索了现有的 [开放Issue](https://github.com/CherryHQ/cherry-studio/issues)和[已关闭Issue](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed%20),没有找到类似的问题。
|
|
||||||
required: true
|
|
||||||
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是"一个问题"、"求助"等。
|
|
||||||
required: true
|
|
||||||
- label: 我的问题不属于错误报告或功能需求类别。
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: platform
|
|
||||||
attributes:
|
|
||||||
label: 平台
|
|
||||||
description: 您正在使用哪个平台?
|
|
||||||
options:
|
|
||||||
- Windows
|
|
||||||
- macOS
|
|
||||||
- Linux
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: 版本
|
|
||||||
description: 您正在运行的 Cherry Studio 版本是什么?
|
|
||||||
placeholder: 例如 v1.0.0
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: question
|
|
||||||
attributes:
|
|
||||||
label: 问题描述
|
|
||||||
description: 请详细描述您的问题或疑问
|
|
||||||
placeholder: 我想了解有关...的更多信息
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: context
|
|
||||||
attributes:
|
|
||||||
label: 相关背景
|
|
||||||
description: 请提供与您的问题相关的任何背景信息或上下文
|
|
||||||
placeholder: 我尝试实现...时遇到了疑问
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: attempts
|
|
||||||
attributes:
|
|
||||||
label: 您已尝试的方法
|
|
||||||
description: 请描述您为解决问题已经尝试过的方法(如果有)
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: additional
|
|
||||||
attributes:
|
|
||||||
label: 附加信息
|
|
||||||
description: 任何能让我们对您的问题有更多了解的信息,包括截图或相关链接
|
|
||||||
4
.github/ISSUE_TEMPLATE/0_bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/0_bug_report.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: 🐛 Bug Report (English)
|
name: 🐛 Bug Report (English)
|
||||||
description: Create a report to help us improve
|
description: Create a report to help us improve
|
||||||
title: '[Bug]: '
|
title: '[Bug]: '
|
||||||
labels: ['kind/bug']
|
labels: ['BUG']
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
@@ -24,6 +24,8 @@ body:
|
|||||||
required: true
|
required: true
|
||||||
- label: I've filled in short, clear headings so that developers can quickly identify a rough idea of what to expect when flipping through the list of issues. And not "a suggestion", "stuck", etc.
|
- label: I've filled in short, clear headings so that developers can quickly identify a rough idea of what to expect when flipping through the list of issues. And not "a suggestion", "stuck", etc.
|
||||||
required: true
|
required: true
|
||||||
|
- label: I've confirmed that I am using the latest version of Cherry Studio.
|
||||||
|
required: true
|
||||||
|
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
id: platform
|
id: platform
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/1_feature_request.yml
vendored
2
.github/ISSUE_TEMPLATE/1_feature_request.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: 💡 Feature Request (English)
|
name: 💡 Feature Request (English)
|
||||||
description: Suggest an idea for this project
|
description: Suggest an idea for this project
|
||||||
title: '[Feature]: '
|
title: '[Feature]: '
|
||||||
labels: ['kind/enhancement']
|
labels: ['feature']
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/2_question.yml
vendored
2
.github/ISSUE_TEMPLATE/2_question.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: ❓ Questions & Discussion
|
name: ❓ Questions & Discussion
|
||||||
description: Seeking help, discussing issues, asking questions, etc...
|
description: Seeking help, discussing issues, asking questions, etc...
|
||||||
title: '[Discussion]: '
|
title: '[Discussion]: '
|
||||||
labels: ['kind/question']
|
labels: ['discussion', 'help wanted']
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/3_others.yml
vendored
2
.github/ISSUE_TEMPLATE/3_others.yml
vendored
@@ -73,4 +73,4 @@ body:
|
|||||||
id: additional
|
id: additional
|
||||||
attributes:
|
attributes:
|
||||||
label: Additional Information
|
label: Additional Information
|
||||||
description: Any other information that could help us better understand your question, including screenshots or relevant links
|
description: Any other information that could help us better understand your question, including screenshots or relevant links
|
||||||
|
|||||||
17
.github/dependabot.yml
vendored
Normal file
17
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: 'github-actions'
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: 'monthly'
|
||||||
|
open-pull-requests-limit: 3
|
||||||
|
commit-message:
|
||||||
|
prefix: 'ci'
|
||||||
|
include: 'scope'
|
||||||
|
groups:
|
||||||
|
github-actions:
|
||||||
|
patterns:
|
||||||
|
- '*'
|
||||||
|
update-types:
|
||||||
|
- 'minor'
|
||||||
|
- 'patch'
|
||||||
90
.github/issue-checker.yml
vendored
90
.github/issue-checker.yml
vendored
@@ -9,115 +9,115 @@ labels:
|
|||||||
# skips and removes
|
# skips and removes
|
||||||
- name: skip all
|
- name: skip all
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Aa]ll |)[Ll]abels?"
|
regexes: '[Ss]kip (?:[Aa]ll |)[Ll]abels?'
|
||||||
- name: remove all
|
- name: remove all
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Aa]ll |)[Ll]abels?"
|
regexes: '[Rr]emove (?:[Aa]ll |)[Ll]abels?'
|
||||||
|
|
||||||
- name: skip kind/bug
|
- name: skip kind/bug
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/bug(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)kind/bug(?:`|)'
|
||||||
- name: remove kind/bug
|
- name: remove kind/bug
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/bug(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)kind/bug(?:`|)'
|
||||||
|
|
||||||
- name: skip kind/enhancement
|
- name: skip kind/enhancement
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/enhancement(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)kind/enhancement(?:`|)'
|
||||||
- name: remove kind/enhancement
|
- name: remove kind/enhancement
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/enhancement(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)kind/enhancement(?:`|)'
|
||||||
|
|
||||||
- name: skip kind/question
|
- name: skip kind/question
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/question(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)kind/question(?:`|)'
|
||||||
- name: remove kind/question
|
- name: remove kind/question
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/question(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)kind/question(?:`|)'
|
||||||
|
|
||||||
- name: skip area/Connectivity
|
- name: skip area/Connectivity
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)area/Connectivity(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)area/Connectivity(?:`|)'
|
||||||
- name: remove area/Connectivity
|
- name: remove area/Connectivity
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)area/Connectivity(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)area/Connectivity(?:`|)'
|
||||||
|
|
||||||
- name: skip area/UI/UX
|
- name: skip area/UI/UX
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)area/UI/UX(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)area/UI/UX(?:`|)'
|
||||||
- name: remove area/UI/UX
|
- name: remove area/UI/UX
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)area/UI/UX(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)area/UI/UX(?:`|)'
|
||||||
|
|
||||||
- name: skip kind/documentation
|
- name: skip kind/documentation
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/documentation(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)kind/documentation(?:`|)'
|
||||||
- name: remove kind/documentation
|
- name: remove kind/documentation
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/documentation(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)kind/documentation(?:`|)'
|
||||||
|
|
||||||
- name: skip client:linux
|
- name: skip client:linux
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)client:linux(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)client:linux(?:`|)'
|
||||||
- name: remove client:linux
|
- name: remove client:linux
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)client:linux(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)client:linux(?:`|)'
|
||||||
|
|
||||||
- name: skip client:mac
|
- name: skip client:mac
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)client:mac(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)client:mac(?:`|)'
|
||||||
- name: remove client:mac
|
- name: remove client:mac
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)client:mac(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)client:mac(?:`|)'
|
||||||
|
|
||||||
- name: skip client:win
|
- name: skip client:win
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)client:win(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)client:win(?:`|)'
|
||||||
- name: remove client:win
|
- name: remove client:win
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)client:win(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)client:win(?:`|)'
|
||||||
|
|
||||||
- name: skip sig/Assistant
|
- name: skip sig/Assistant
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/Assistant(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)sig/Assistant(?:`|)'
|
||||||
- name: remove sig/Assistant
|
- name: remove sig/Assistant
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/Assistant(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)sig/Assistant(?:`|)'
|
||||||
|
|
||||||
- name: skip sig/Data
|
- name: skip sig/Data
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/Data(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)sig/Data(?:`|)'
|
||||||
- name: remove sig/Data
|
- name: remove sig/Data
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/Data(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)sig/Data(?:`|)'
|
||||||
|
|
||||||
- name: skip sig/MCP
|
- name: skip sig/MCP
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/MCP(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)sig/MCP(?:`|)'
|
||||||
- name: remove sig/MCP
|
- name: remove sig/MCP
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/MCP(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)sig/MCP(?:`|)'
|
||||||
|
|
||||||
- name: skip sig/RAG
|
- name: skip sig/RAG
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/RAG(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)sig/RAG(?:`|)'
|
||||||
- name: remove sig/RAG
|
- name: remove sig/RAG
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/RAG(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)sig/RAG(?:`|)'
|
||||||
|
|
||||||
- name: skip lgtm
|
- name: skip lgtm
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)lgtm(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)lgtm(?:`|)'
|
||||||
- name: remove lgtm
|
- name: remove lgtm
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)lgtm(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)lgtm(?:`|)'
|
||||||
|
|
||||||
- name: skip License
|
- name: skip License
|
||||||
content:
|
content:
|
||||||
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)License(?:`|)"
|
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)License(?:`|)'
|
||||||
- name: remove License
|
- name: remove License
|
||||||
content:
|
content:
|
||||||
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)License(?:`|)"
|
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)License(?:`|)'
|
||||||
|
|
||||||
# `Dev Team`
|
# `Dev Team`
|
||||||
- name: Dev Team
|
- name: Dev Team
|
||||||
@@ -129,7 +129,7 @@ labels:
|
|||||||
# Area labels
|
# Area labels
|
||||||
- name: area/Connectivity
|
- name: area/Connectivity
|
||||||
content: area/Connectivity
|
content: area/Connectivity
|
||||||
regexes: "代理|[Pp]roxy"
|
regexes: '代理|[Pp]roxy'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip area/Connectivity
|
- skip area/Connectivity
|
||||||
@@ -139,7 +139,7 @@ labels:
|
|||||||
|
|
||||||
- name: area/UI/UX
|
- name: area/UI/UX
|
||||||
content: area/UI/UX
|
content: area/UI/UX
|
||||||
regexes: "界面|[Uu][Ii]|重叠|按钮|图标|组件|渲染|菜单|栏目|头像|主题|样式|[Cc][Ss][Ss]"
|
regexes: '界面|[Uu][Ii]|重叠|按钮|图标|组件|渲染|菜单|栏目|头像|主题|样式|[Cc][Ss][Ss]'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip area/UI/UX
|
- skip area/UI/UX
|
||||||
@@ -150,7 +150,7 @@ labels:
|
|||||||
# Kind labels
|
# Kind labels
|
||||||
- name: kind/documentation
|
- name: kind/documentation
|
||||||
content: kind/documentation
|
content: kind/documentation
|
||||||
regexes: "文档|教程|[Dd]oc(s|umentation)|[Rr]eadme"
|
regexes: '文档|教程|[Dd]oc(s|umentation)|[Rr]eadme'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip kind/documentation
|
- skip kind/documentation
|
||||||
@@ -161,7 +161,7 @@ labels:
|
|||||||
# Client labels
|
# Client labels
|
||||||
- name: client:linux
|
- name: client:linux
|
||||||
content: client:linux
|
content: client:linux
|
||||||
regexes: "(?:[Ll]inux|[Uu]buntu|[Dd]ebian)"
|
regexes: '(?:[Ll]inux|[Uu]buntu|[Dd]ebian)'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip client:linux
|
- skip client:linux
|
||||||
@@ -171,7 +171,7 @@ labels:
|
|||||||
|
|
||||||
- name: client:mac
|
- name: client:mac
|
||||||
content: client:mac
|
content: client:mac
|
||||||
regexes: "(?:[Mm]ac|[Mm]acOS|[Oo]SX)"
|
regexes: '(?:[Mm]ac|[Mm]acOS|[Oo]SX)'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip client:mac
|
- skip client:mac
|
||||||
@@ -181,7 +181,7 @@ labels:
|
|||||||
|
|
||||||
- name: client:win
|
- name: client:win
|
||||||
content: client:win
|
content: client:win
|
||||||
regexes: "(?:[Ww]in|[Ww]indows)"
|
regexes: '(?:[Ww]in|[Ww]indows)'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip client:win
|
- skip client:win
|
||||||
@@ -192,7 +192,7 @@ labels:
|
|||||||
# SIG labels
|
# SIG labels
|
||||||
- name: sig/Assistant
|
- name: sig/Assistant
|
||||||
content: sig/Assistant
|
content: sig/Assistant
|
||||||
regexes: "快捷助手|[Aa]ssistant"
|
regexes: '快捷助手|[Aa]ssistant'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip sig/Assistant
|
- skip sig/Assistant
|
||||||
@@ -202,7 +202,7 @@ labels:
|
|||||||
|
|
||||||
- name: sig/Data
|
- name: sig/Data
|
||||||
content: sig/Data
|
content: sig/Data
|
||||||
regexes: "[Ww]ebdav|坚果云|备份|同步|数据|Obsidian|Notion|Joplin|思源"
|
regexes: '[Ww]ebdav|坚果云|备份|同步|数据|Obsidian|Notion|Joplin|思源'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip sig/Data
|
- skip sig/Data
|
||||||
@@ -212,7 +212,7 @@ labels:
|
|||||||
|
|
||||||
- name: sig/MCP
|
- name: sig/MCP
|
||||||
content: sig/MCP
|
content: sig/MCP
|
||||||
regexes: "[Mm][Cc][Pp]"
|
regexes: '[Mm][Cc][Pp]'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip sig/MCP
|
- skip sig/MCP
|
||||||
@@ -222,7 +222,7 @@ labels:
|
|||||||
|
|
||||||
- name: sig/RAG
|
- name: sig/RAG
|
||||||
content: sig/RAG
|
content: sig/RAG
|
||||||
regexes: "知识库|[Rr][Aa][Gg]"
|
regexes: '知识库|[Rr][Aa][Gg]'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip sig/RAG
|
- skip sig/RAG
|
||||||
@@ -233,7 +233,7 @@ labels:
|
|||||||
# Other labels
|
# Other labels
|
||||||
- name: lgtm
|
- name: lgtm
|
||||||
content: lgtm
|
content: lgtm
|
||||||
regexes: "(?:[Ll][Gg][Tt][Mm]|[Ll]ooks [Gg]ood [Tt]o [Mm]e)"
|
regexes: '(?:[Ll][Gg][Tt][Mm]|[Ll]ooks [Gg]ood [Tt]o [Mm]e)'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip lgtm
|
- skip lgtm
|
||||||
@@ -243,7 +243,7 @@ labels:
|
|||||||
|
|
||||||
- name: License
|
- name: License
|
||||||
content: License
|
content: License
|
||||||
regexes: "(?:[Ll]icense|[Cc]opyright|[Mm][Ii][Tt]|[Aa]pache)"
|
regexes: '(?:[Ll]icense|[Cc]opyright|[Mm][Ii][Tt]|[Aa]pache)'
|
||||||
skip-if:
|
skip-if:
|
||||||
- skip all
|
- skip all
|
||||||
- skip License
|
- skip License
|
||||||
|
|||||||
66
.github/workflows/auto-i18n.yml
vendored
Normal file
66
.github/workflows/auto-i18n.yml
vendored
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
name: Auto I18N
|
||||||
|
|
||||||
|
env:
|
||||||
|
API_KEY: ${{ secrets.TRANSLATE_API_KEY }}
|
||||||
|
MODEL: ${{ vars.AUTO_I18N_MODEL || 'deepseek/deepseek-v3.1'}}
|
||||||
|
BASE_URL: ${{ vars.AUTO_I18N_BASE_URL || 'https://api.ppinfra.com/openai'}}
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-i18n:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event.pull_request.head.repo.full_name == 'CherryHQ/cherry-studio'
|
||||||
|
name: Auto I18N
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 🐈⬛ Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
|
||||||
|
- name: 📦 Setting Node.js
|
||||||
|
uses: actions/setup-node@v5
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 📦 Install dependencies in isolated directory
|
||||||
|
run: |
|
||||||
|
# 在临时目录安装依赖
|
||||||
|
mkdir -p /tmp/translation-deps
|
||||||
|
cd /tmp/translation-deps
|
||||||
|
echo '{"dependencies": {"openai": "^5.12.2", "cli-progress": "^3.12.0", "tsx": "^4.20.3", "@biomejs/biome": "2.2.4"}}' > package.json
|
||||||
|
npm install --no-package-lock
|
||||||
|
|
||||||
|
# 设置 NODE_PATH 让项目能找到这些依赖
|
||||||
|
echo "NODE_PATH=/tmp/translation-deps/node_modules" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 🏃♀️ Translate
|
||||||
|
run: npx tsx scripts/auto-translate-i18n.ts
|
||||||
|
|
||||||
|
- name: 🔍 Format
|
||||||
|
run: cd /tmp/translation-deps && npx biome format --config-path /home/runner/work/cherry-studio/cherry-studio/biome.jsonc --write /home/runner/work/cherry-studio/cherry-studio/src/renderer/src/i18n/
|
||||||
|
|
||||||
|
- name: 🔄 Commit changes
|
||||||
|
run: |
|
||||||
|
git config --local user.email "action@github.com"
|
||||||
|
git config --local user.name "GitHub Action"
|
||||||
|
git add .
|
||||||
|
git reset -- package.json yarn.lock # 不提交 package.json 和 yarn.lock 的更改
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "No changes to commit"
|
||||||
|
else
|
||||||
|
git commit -m "fix(i18n): Auto update translations for PR #${{ github.event.pull_request.number }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 🚀 Push changes
|
||||||
|
uses: ad-m/github-push-action@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
branch: ${{ github.event.pull_request.head.ref }}
|
||||||
56
.github/workflows/claude-code-review.yml
vendored
Normal file
56
.github/workflows/claude-code-review.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
name: Claude Code Review
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened]
|
||||||
|
# Optional: Only run on specific file changes
|
||||||
|
# paths:
|
||||||
|
# - "src/**/*.ts"
|
||||||
|
# - "src/**/*.tsx"
|
||||||
|
# - "src/**/*.js"
|
||||||
|
# - "src/**/*.jsx"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
claude-review:
|
||||||
|
# Only trigger code review for PRs from the main repository due to upstream OIDC issues
|
||||||
|
# https://github.com/anthropics/claude-code-action/issues/542
|
||||||
|
if: |
|
||||||
|
(github.event.pull_request.head.repo.full_name == github.repository) &&
|
||||||
|
(github.event.pull_request.draft == false)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
issues: read
|
||||||
|
id-token: write
|
||||||
|
actions: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Run Claude Code Review
|
||||||
|
id: claude-review
|
||||||
|
uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
prompt: |
|
||||||
|
Please review this pull request and provide feedback on:
|
||||||
|
- Code quality and best practices
|
||||||
|
- Potential bugs or issues
|
||||||
|
- Performance considerations
|
||||||
|
- Security concerns
|
||||||
|
- Test coverage
|
||||||
|
|
||||||
|
PR number: ${{ github.event.number }}
|
||||||
|
Repo: ${{ github.repository }}
|
||||||
|
|
||||||
|
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
|
||||||
|
|
||||||
|
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
|
||||||
|
|
||||||
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
|
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
|
||||||
|
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
|
||||||
112
.github/workflows/claude-translator.yml
vendored
Normal file
112
.github/workflows/claude-translator.yml
vendored
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
name: Claude Translator
|
||||||
|
concurrency:
|
||||||
|
group: translator-${{ github.event.comment.id || github.event.issue.number || github.event.review.id }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
issue_comment:
|
||||||
|
types: [created, edited]
|
||||||
|
pull_request_review:
|
||||||
|
types: [submitted, edited]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created, edited]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
translate:
|
||||||
|
if: |
|
||||||
|
(github.event_name == 'issues')
|
||||||
|
|| (github.event_name == 'issue_comment' && github.event.sender.type != 'Bot')
|
||||||
|
|| (
|
||||||
|
(github.event_name == 'pull_request_review' || github.event_name == 'pull_request_review_comment')
|
||||||
|
&& github.event.sender.type != 'Bot'
|
||||||
|
&& github.event.pull_request.head.repo.fork == false
|
||||||
|
)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write # 编辑issues/comments
|
||||||
|
pull-requests: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Run Claude for translation
|
||||||
|
uses: anthropics/claude-code-action@main
|
||||||
|
id: claude
|
||||||
|
with:
|
||||||
|
# Warning: Permissions should have been controlled by workflow permission.
|
||||||
|
# Now `contents: read` is safe for files, but we could make a fine-grained token to control it.
|
||||||
|
# See: https://github.com/anthropics/claude-code-action/blob/main/docs/security.md
|
||||||
|
github_token: ${{ secrets.TOKEN_GITHUB_WRITE }}
|
||||||
|
allowed_non_write_users: "*"
|
||||||
|
anthropic_api_key: ${{ secrets.CLAUDE_TRANSLATOR_APIKEY }}
|
||||||
|
claude_args: "--allowed-tools Bash(gh issue:*),Bash(gh api:repos/*/issues:*),Bash(gh api:repos/*/pulls/*/reviews/*),Bash(gh api:repos/*/pulls/comments/*)"
|
||||||
|
prompt: |
|
||||||
|
你是一个多语言翻译助手。你需要响应 GitHub Webhooks 中的以下四种事件:
|
||||||
|
|
||||||
|
- issues
|
||||||
|
- issue_comment
|
||||||
|
- pull_request_review
|
||||||
|
- pull_request_review_comment
|
||||||
|
|
||||||
|
请完成以下任务:
|
||||||
|
|
||||||
|
1. 获取当前事件的完整信息。
|
||||||
|
|
||||||
|
- 如果当前事件是 issues,就获取该 issues 的信息。
|
||||||
|
- 如果当前事件是 issue_comment,就获取该 comment 的信息。
|
||||||
|
- 如果当前事件是 pull_request_review,就获取该 review 的信息。
|
||||||
|
- 如果当前事件是 pull_request_review_comment,就获取该 comment 的信息。
|
||||||
|
|
||||||
|
2. 智能检测内容。
|
||||||
|
|
||||||
|
- 如果获取到的信息是已经遵循格式要求翻译过的内容,则检查翻译内容和原始内容是否匹配。若不匹配,则重新翻译一次令其匹配,并遵循格式要求;
|
||||||
|
- 如果获取到的信息是未翻译过的内容,检查其内容语言。若不是英文,则翻译成英文;
|
||||||
|
- 如果获取到的信息是部分翻译为英文的内容,则将其翻译为英文;
|
||||||
|
- 如果获取到的信息包含了对已翻译内容的引用,则将引用内容清理为仅含英文的内容。引用的内容不能够包含"This xxx was translated by Claude"和"Original Content`等内容。
|
||||||
|
- 如果获取到的信息包含了其他类型的引用,即对非 Claude 翻译的内容的引用,则直接照原样引用,不进行翻译。
|
||||||
|
- 如果获取到的信息是通过邮件回复的内容,则在翻译时应当将邮件内容的引用放到最后。在原始内容和翻译内容中只需要回复的内容本身,不要包含对邮件内容的引用。
|
||||||
|
- 如果获取到的信息本身不需要任何处理,则跳过任务。
|
||||||
|
|
||||||
|
3. 格式要求:
|
||||||
|
|
||||||
|
- 标题:英文翻译(如果非英文)
|
||||||
|
- 内容格式:
|
||||||
|
> [!NOTE]
|
||||||
|
> This issue/comment/review was translated by Claude.
|
||||||
|
|
||||||
|
[翻译内容]
|
||||||
|
|
||||||
|
---
|
||||||
|
<details>
|
||||||
|
<summary>Original Content</summary>
|
||||||
|
[原始内容]
|
||||||
|
</details>
|
||||||
|
|
||||||
|
4. 使用gh工具更新:
|
||||||
|
|
||||||
|
- 根据环境信息中的Event类型选择正确的命令:
|
||||||
|
- 如果 Event 是 'issues': gh issue edit [ISSUE_NUMBER] --title "[英文标题]" --body "[翻译内容 + 原始内容]"
|
||||||
|
- 如果 Event 是 'issue_comment': gh api -X PATCH /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }} -f body="[翻译内容 + 原始内容]"
|
||||||
|
- 如果 Event 是 'pull_request_review': gh api -X PUT /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews/${{ github.event.review.id }} -f body="[翻译内容]"
|
||||||
|
- 如果 Event 是 'pull_request_review_comment': gh api -X PATCH /repos/${{ github.repository }}/pulls/comments/${{ github.event.comment.id }} -f body="[翻译内容 + 原始内容]"
|
||||||
|
|
||||||
|
环境信息:
|
||||||
|
- Event: ${{ github.event_name }}
|
||||||
|
- Issue Number: ${{ github.event.issue.number }}
|
||||||
|
- Repository: ${{ github.repository }}
|
||||||
|
- (Review) Comment ID: ${{ github.event.comment.id || 'N/A' }}
|
||||||
|
- Pull Request Number: ${{ github.event.pull_request.number || 'N/A' }}
|
||||||
|
- Review ID: ${{ github.event.review.id || 'N/A' }}
|
||||||
|
|
||||||
|
|
||||||
|
使用以下命令获取完整信息:
|
||||||
|
gh issue view ${{ github.event.issue.number }} --json title,body,comments
|
||||||
|
env:
|
||||||
|
ANTHROPIC_BASE_URL: ${{ secrets.CLAUDE_TRANSLATOR_BASEURL }}
|
||||||
60
.github/workflows/claude.yml
vendored
Normal file
60
.github/workflows/claude.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
name: Claude Code
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created]
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
pull_request_review:
|
||||||
|
types: [submitted]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
claude:
|
||||||
|
if: |
|
||||||
|
(github.event_name == 'issue_comment'
|
||||||
|
&& contains(github.event.comment.body, '@claude')
|
||||||
|
&& contains(fromJSON('["COLLABORATOR","MEMBER","OWNER"]'), github.event.comment.author_association))
|
||||||
|
||
|
||||||
|
(github.event_name == 'pull_request_review_comment'
|
||||||
|
&& contains(github.event.comment.body, '@claude')
|
||||||
|
&& contains(fromJSON('["COLLABORATOR","MEMBER","OWNER"]'), github.event.comment.author_association))
|
||||||
|
||
|
||||||
|
(github.event_name == 'pull_request_review'
|
||||||
|
&& contains(github.event.review.body, '@claude')
|
||||||
|
&& contains(fromJSON('["COLLABORATOR","MEMBER","OWNER"]'), github.event.review.author_association))
|
||||||
|
||
|
||||||
|
(github.event_name == 'issues'
|
||||||
|
&& (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))
|
||||||
|
&& contains(fromJSON('["COLLABORATOR","MEMBER","OWNER"]'), github.event.issue.author_association))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
issues: read
|
||||||
|
id-token: write
|
||||||
|
actions: read # Required for Claude to read CI results on PRs
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Run Claude Code
|
||||||
|
id: claude
|
||||||
|
uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
|
||||||
|
# This is an optional setting that allows Claude to read CI results on PRs
|
||||||
|
additional_permissions: |
|
||||||
|
actions: read
|
||||||
|
|
||||||
|
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
||||||
|
# prompt: 'Update the pull request description to include a summary of changes.'
|
||||||
|
|
||||||
|
# Optional: Add claude_args to customize behavior and configuration
|
||||||
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
|
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
|
||||||
|
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
|
||||||
22
.github/workflows/delete-branch.yml
vendored
Normal file
22
.github/workflows/delete-branch.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: Delete merged branch
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- closed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
delete-branch:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository
|
||||||
|
steps:
|
||||||
|
- name: Delete merged branch
|
||||||
|
uses: actions/github-script@v8
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.git.deleteRef({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
ref: `heads/${context.payload.pull_request.head.ref}`,
|
||||||
|
})
|
||||||
27
.github/workflows/dispatch-docs-update.yml
vendored
Normal file
27
.github/workflows/dispatch-docs-update.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Dispatch Docs Update on Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [released]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dispatch-docs-update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Get Release Tag from Event
|
||||||
|
id: get-event-tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# 从当前 Release 事件中获取 tag_name
|
||||||
|
echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Dispatch update-download-version workflow to cherry-studio-docs
|
||||||
|
uses: peter-evans/repository-dispatch@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
|
||||||
|
repository: CherryHQ/cherry-studio-docs
|
||||||
|
event-type: update-download-version
|
||||||
|
client-payload: '{"version": "${{ steps.get-event-tag.outputs.tag }}"}'
|
||||||
6
.github/workflows/issue-checker.yml
vendored
6
.github/workflows/issue-checker.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: "Issue Checker"
|
name: 'Issue Checker'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: MaaAssistantArknights/issue-checker@v1.14
|
- uses: MaaAssistantArknights/issue-checker@v1.14
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
configuration-path: .github/issue-checker.yml
|
configuration-path: .github/issue-checker.yml
|
||||||
not-before: 2022-08-05T00:00:00Z
|
not-before: 2022-08-05T00:00:00Z
|
||||||
include-title: 1
|
include-title: 1
|
||||||
|
|||||||
22
.github/workflows/issue-management.yml
vendored
22
.github/workflows/issue-management.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: "Stale Issue Management"
|
name: 'Stale Issue Management'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * *"
|
- cron: '0 0 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -24,18 +24,18 @@ jobs:
|
|||||||
uses: actions/stale@v9
|
uses: actions/stale@v9
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
only-labels: "needs-more-info"
|
only-labels: 'needs-more-info'
|
||||||
days-before-stale: ${{ env.daysBeforeStale }}
|
days-before-stale: ${{ env.daysBeforeStale }}
|
||||||
days-before-close: 0 # Close immediately after stale
|
days-before-close: 0 # Close immediately after stale
|
||||||
stale-issue-label: "inactive"
|
stale-issue-label: 'inactive'
|
||||||
close-issue-label: "closed:no-response"
|
close-issue-label: 'closed:no-response'
|
||||||
stale-issue-message: |
|
stale-issue-message: |
|
||||||
This issue has been labeled as needing more information and has been inactive for ${{ env.daysBeforeStale }} days.
|
This issue has been labeled as needing more information and has been inactive for ${{ env.daysBeforeStale }} days.
|
||||||
It will be closed now due to lack of additional information.
|
It will be closed now due to lack of additional information.
|
||||||
|
|
||||||
该问题被标记为"需要更多信息"且已经 ${{ env.daysBeforeStale }} 天没有任何活动,将立即关闭。
|
该问题被标记为"需要更多信息"且已经 ${{ env.daysBeforeStale }} 天没有任何活动,将立即关闭。
|
||||||
operations-per-run: 50
|
operations-per-run: 50
|
||||||
exempt-issue-labels: "pending, Dev Team"
|
exempt-issue-labels: 'pending, Dev Team'
|
||||||
days-before-pr-stale: -1
|
days-before-pr-stale: -1
|
||||||
days-before-pr-close: -1
|
days-before-pr-close: -1
|
||||||
|
|
||||||
@@ -45,14 +45,14 @@ jobs:
|
|||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
days-before-stale: ${{ env.daysBeforeStale }}
|
days-before-stale: ${{ env.daysBeforeStale }}
|
||||||
days-before-close: ${{ env.daysBeforeClose }}
|
days-before-close: ${{ env.daysBeforeClose }}
|
||||||
stale-issue-label: "inactive"
|
stale-issue-label: 'inactive'
|
||||||
stale-issue-message: |
|
stale-issue-message: |
|
||||||
This issue has been inactive for a prolonged period and will be closed automatically in ${{ env.daysBeforeClose }} days.
|
This issue has been inactive for a prolonged period and will be closed automatically in ${{ env.daysBeforeClose }} days.
|
||||||
该问题已长时间处于闲置状态,${{ env.daysBeforeClose }} 天后将自动关闭。
|
该问题已长时间处于闲置状态,${{ env.daysBeforeClose }} 天后将自动关闭。
|
||||||
exempt-issue-labels: "pending, Dev Team, kind/enhancement"
|
exempt-issue-labels: 'pending, Dev Team, kind/enhancement'
|
||||||
days-before-pr-stale: -1 # Completely disable stalling for PRs
|
days-before-pr-stale: -1 # Completely disable stalling for PRs
|
||||||
days-before-pr-close: -1 # Completely disable closing for PRs
|
days-before-pr-close: -1 # Completely disable closing for PRs
|
||||||
|
|
||||||
# Temporary to reduce the huge issues number
|
# Temporary to reduce the huge issues number
|
||||||
operations-per-run: 100
|
operations-per-run: 1000
|
||||||
debug-only: false
|
debug-only: false
|
||||||
|
|||||||
33
.github/workflows/nightly-build.yml
vendored
33
.github/workflows/nightly-build.yml
vendored
@@ -51,12 +51,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: develop
|
ref: main
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
@@ -93,37 +93,44 @@ jobs:
|
|||||||
- name: Build Linux
|
- name: Build Linux
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
yarn build:npm linux
|
sudo apt-get install -y rpm
|
||||||
yarn build:linux
|
yarn build:linux
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
|
|
||||||
NODE_OPTIONS: --max-old-space-size=8192
|
NODE_OPTIONS: --max-old-space-size=8192
|
||||||
|
MAIN_VITE_CHERRYAI_CLIENT_SECRET: ${{ secrets.MAIN_VITE_CHERRYAI_CLIENT_SECRET }}
|
||||||
|
MAIN_VITE_MINERU_API_KEY: ${{ secrets.MAIN_VITE_MINERU_API_KEY }}
|
||||||
|
RENDERER_VITE_AIHUBMIX_SECRET: ${{ secrets.RENDERER_VITE_AIHUBMIX_SECRET }}
|
||||||
|
RENDERER_VITE_PPIO_APP_SECRET: ${{ secrets.RENDERER_VITE_PPIO_APP_SECRET }}
|
||||||
|
|
||||||
- name: Build Mac
|
- name: Build Mac
|
||||||
if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
yarn build:npm mac
|
|
||||||
yarn build:mac
|
yarn build:mac
|
||||||
env:
|
env:
|
||||||
CSC_LINK: ${{ secrets.CSC_LINK }}
|
CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||||
APPLE_ID: ${{ vars.APPLE_ID }}
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ vars.APPLE_APP_SPECIFIC_PASSWORD }}
|
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||||||
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NODE_OPTIONS: --max-old-space-size=8192
|
NODE_OPTIONS: --max-old-space-size=8192
|
||||||
|
MAIN_VITE_CHERRYAI_CLIENT_SECRET: ${{ secrets.MAIN_VITE_CHERRYAI_CLIENT_SECRET }}
|
||||||
|
MAIN_VITE_MINERU_API_KEY: ${{ secrets.MAIN_VITE_MINERU_API_KEY }}
|
||||||
|
RENDERER_VITE_AIHUBMIX_SECRET: ${{ secrets.RENDERER_VITE_AIHUBMIX_SECRET }}
|
||||||
|
RENDERER_VITE_PPIO_APP_SECRET: ${{ secrets.RENDERER_VITE_PPIO_APP_SECRET }}
|
||||||
|
|
||||||
- name: Build Windows
|
- name: Build Windows
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
yarn build:npm windows
|
|
||||||
yarn build:win
|
yarn build:win
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
|
|
||||||
NODE_OPTIONS: --max-old-space-size=8192
|
NODE_OPTIONS: --max-old-space-size=8192
|
||||||
|
MAIN_VITE_CHERRYAI_CLIENT_SECRET: ${{ secrets.MAIN_VITE_CHERRYAI_CLIENT_SECRET }}
|
||||||
|
MAIN_VITE_MINERU_API_KEY: ${{ secrets.MAIN_VITE_MINERU_API_KEY }}
|
||||||
|
RENDERER_VITE_AIHUBMIX_SECRET: ${{ secrets.RENDERER_VITE_AIHUBMIX_SECRET }}
|
||||||
|
RENDERER_VITE_PPIO_APP_SECRET: ${{ secrets.RENDERER_VITE_PPIO_APP_SECRET }}
|
||||||
|
|
||||||
- name: Rename artifacts with nightly format
|
- name: Rename artifacts with nightly format
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -219,7 +226,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
path: all-artifacts
|
path: all-artifacts
|
||||||
merge-multiple: false
|
merge-multiple: false
|
||||||
|
|||||||
29
.github/workflows/pr-ci.yml
vendored
29
.github/workflows/pr-ci.yml
vendored
@@ -1,22 +1,30 @@
|
|||||||
name: Pull Request CI
|
name: Pull Request CI
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
|
- v2
|
||||||
|
types: [ready_for_review, synchronize, opened]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
PRCI: true
|
||||||
|
if: github.event.pull_request.draft == false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
@@ -40,8 +48,17 @@ jobs:
|
|||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: yarn install
|
run: yarn install
|
||||||
|
|
||||||
- name: Build Check
|
|
||||||
run: yarn build:check
|
|
||||||
|
|
||||||
- name: Lint Check
|
- name: Lint Check
|
||||||
run: yarn lint
|
run: yarn test:lint
|
||||||
|
|
||||||
|
- name: Format Check
|
||||||
|
run: yarn format:check
|
||||||
|
|
||||||
|
- name: Type Check
|
||||||
|
run: yarn typecheck
|
||||||
|
|
||||||
|
- name: i18n Check
|
||||||
|
run: yarn check:i18n
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: yarn test
|
||||||
|
|||||||
40
.github/workflows/release.yml
vendored
40
.github/workflows/release.yml
vendored
@@ -25,9 +25,9 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: main
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Get release tag
|
- name: Get release tag
|
||||||
id: get-tag
|
id: get-tag
|
||||||
@@ -39,8 +39,15 @@ jobs:
|
|||||||
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Set package.json version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
TAG="${{ steps.get-tag.outputs.tag }}"
|
||||||
|
VERSION="${TAG#v}"
|
||||||
|
npm version "$VERSION" --no-git-tag-version --allow-same-version
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
@@ -72,39 +79,46 @@ jobs:
|
|||||||
- name: Build Linux
|
- name: Build Linux
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
yarn build:npm linux
|
sudo apt-get install -y rpm
|
||||||
yarn build:linux
|
yarn build:linux
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
|
|
||||||
NODE_OPTIONS: --max-old-space-size=8192
|
NODE_OPTIONS: --max-old-space-size=8192
|
||||||
|
MAIN_VITE_CHERRYAI_CLIENT_SECRET: ${{ secrets.MAIN_VITE_CHERRYAI_CLIENT_SECRET }}
|
||||||
|
MAIN_VITE_MINERU_API_KEY: ${{ secrets.MAIN_VITE_MINERU_API_KEY }}
|
||||||
|
RENDERER_VITE_AIHUBMIX_SECRET: ${{ secrets.RENDERER_VITE_AIHUBMIX_SECRET }}
|
||||||
|
RENDERER_VITE_PPIO_APP_SECRET: ${{ secrets.RENDERER_VITE_PPIO_APP_SECRET }}
|
||||||
|
|
||||||
- name: Build Mac
|
- name: Build Mac
|
||||||
if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
sudo -H pip install setuptools
|
sudo -H pip install setuptools
|
||||||
yarn build:npm mac
|
|
||||||
yarn build:mac
|
yarn build:mac
|
||||||
env:
|
env:
|
||||||
CSC_LINK: ${{ secrets.CSC_LINK }}
|
CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||||
APPLE_ID: ${{ vars.APPLE_ID }}
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ vars.APPLE_APP_SPECIFIC_PASSWORD }}
|
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||||||
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NODE_OPTIONS: --max-old-space-size=8192
|
NODE_OPTIONS: --max-old-space-size=8192
|
||||||
|
MAIN_VITE_CHERRYAI_CLIENT_SECRET: ${{ secrets.MAIN_VITE_CHERRYAI_CLIENT_SECRET }}
|
||||||
|
MAIN_VITE_MINERU_API_KEY: ${{ secrets.MAIN_VITE_MINERU_API_KEY }}
|
||||||
|
RENDERER_VITE_AIHUBMIX_SECRET: ${{ secrets.RENDERER_VITE_AIHUBMIX_SECRET }}
|
||||||
|
RENDERER_VITE_PPIO_APP_SECRET: ${{ secrets.RENDERER_VITE_PPIO_APP_SECRET }}
|
||||||
|
|
||||||
- name: Build Windows
|
- name: Build Windows
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
yarn build:npm windows
|
|
||||||
yarn build:win
|
yarn build:win
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
|
|
||||||
NODE_OPTIONS: --max-old-space-size=8192
|
NODE_OPTIONS: --max-old-space-size=8192
|
||||||
|
MAIN_VITE_CHERRYAI_CLIENT_SECRET: ${{ secrets.MAIN_VITE_CHERRYAI_CLIENT_SECRET }}
|
||||||
|
MAIN_VITE_MINERU_API_KEY: ${{ secrets.MAIN_VITE_MINERU_API_KEY }}
|
||||||
|
RENDERER_VITE_AIHUBMIX_SECRET: ${{ secrets.RENDERER_VITE_AIHUBMIX_SECRET }}
|
||||||
|
RENDERER_VITE_PPIO_APP_SECRET: ${{ secrets.RENDERER_VITE_PPIO_APP_SECRET }}
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
@@ -113,5 +127,5 @@ jobs:
|
|||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
makeLatest: false
|
makeLatest: false
|
||||||
tag: ${{ steps.get-tag.outputs.tag }}
|
tag: ${{ steps.get-tag.outputs.tag }}
|
||||||
artifacts: 'dist/*.exe,dist/*.zip,dist/*.dmg,dist/*.AppImage,dist/*.snap,dist/*.deb,dist/*.rpm,dist/*.tar.gz,dist/latest*.yml,dist/*.blockmap'
|
artifacts: 'dist/*.exe,dist/*.zip,dist/*.dmg,dist/*.AppImage,dist/*.snap,dist/*.deb,dist/*.rpm,dist/*.tar.gz,dist/latest*.yml,dist/rc*.yml,dist/beta*.yml,dist/*.blockmap'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
25
.gitignore
vendored
25
.gitignore
vendored
@@ -35,20 +35,41 @@ Thumbs.db
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
out
|
out
|
||||||
|
mcp_server
|
||||||
stats.html
|
stats.html
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
# ENV
|
# ENV
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
# Local
|
# Local
|
||||||
local
|
local
|
||||||
.aider*
|
.aider*
|
||||||
.cursorrules
|
.cursorrules
|
||||||
.cursor/rules
|
.cursor/*
|
||||||
|
.claude/*
|
||||||
|
.gemini/*
|
||||||
|
.qwen/*
|
||||||
|
.trae/*
|
||||||
|
.claude-code-router/*
|
||||||
|
.codebuddy/*
|
||||||
|
.zed/*
|
||||||
|
CLAUDE.local.md
|
||||||
|
|
||||||
# test
|
# vitest
|
||||||
coverage
|
coverage
|
||||||
.vitest-cache
|
.vitest-cache
|
||||||
vitest.config.*.timestamp-*
|
vitest.config.*.timestamp-*
|
||||||
|
|
||||||
|
# TypeScript incremental build
|
||||||
|
.tsbuildinfo
|
||||||
|
|
||||||
|
# playwright
|
||||||
|
playwright-report
|
||||||
|
test-results
|
||||||
|
|
||||||
YOUR_MEMORY_FILE_PATH
|
YOUR_MEMORY_FILE_PATH
|
||||||
|
|
||||||
|
.sessions/
|
||||||
|
|||||||
215
.oxlintrc.json
Normal file
215
.oxlintrc.json
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"categories": {},
|
||||||
|
"env": {
|
||||||
|
"es2022": true
|
||||||
|
},
|
||||||
|
"globals": {},
|
||||||
|
"ignorePatterns": [
|
||||||
|
"node_modules/**",
|
||||||
|
"build/**",
|
||||||
|
"dist/**",
|
||||||
|
"out/**",
|
||||||
|
"local/**",
|
||||||
|
".yarn/**",
|
||||||
|
".gitignore",
|
||||||
|
"scripts/cloudflare-worker.js",
|
||||||
|
"src/main/integration/nutstore/sso/lib/**",
|
||||||
|
"src/main/integration/cherryai/index.js",
|
||||||
|
"src/main/integration/nutstore/sso/lib/**",
|
||||||
|
"src/renderer/src/ui/**",
|
||||||
|
"packages/**/dist",
|
||||||
|
"eslint.config.mjs"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
// set different env
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"files": ["src/main/**", "resources/scripts/**", "scripts/**", "playwright.config.ts", "electron.vite.config.ts"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/renderer/**/*.{ts,tsx}",
|
||||||
|
"packages/aiCore/**",
|
||||||
|
"packages/extension-table-plus/**",
|
||||||
|
"resources/js/**"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
"vitest": true
|
||||||
|
},
|
||||||
|
"files": ["**/__tests__/*.test.{ts,tsx}", "tests/**"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"files": ["src/preload/**"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// We don't use the React plugin here because its behavior differs slightly from that of ESLint's React plugin.
|
||||||
|
"plugins": ["unicorn", "typescript", "oxc", "import"],
|
||||||
|
"rules": {
|
||||||
|
"constructor-super": "error",
|
||||||
|
"for-direction": "error",
|
||||||
|
"getter-return": "error",
|
||||||
|
"no-array-constructor": "off",
|
||||||
|
// "import/no-cycle": "error", // tons of error, bro
|
||||||
|
"no-async-promise-executor": "error",
|
||||||
|
"no-caller": "warn",
|
||||||
|
"no-case-declarations": "error",
|
||||||
|
"no-class-assign": "error",
|
||||||
|
"no-compare-neg-zero": "error",
|
||||||
|
"no-cond-assign": "error",
|
||||||
|
"no-const-assign": "error",
|
||||||
|
"no-constant-binary-expression": "error",
|
||||||
|
"no-constant-condition": "error",
|
||||||
|
"no-control-regex": "error",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-delete-var": "error",
|
||||||
|
"no-dupe-args": "error",
|
||||||
|
"no-dupe-class-members": "error",
|
||||||
|
"no-dupe-else-if": "error",
|
||||||
|
"no-dupe-keys": "error",
|
||||||
|
"no-duplicate-case": "error",
|
||||||
|
"no-empty": "error",
|
||||||
|
"no-empty-character-class": "error",
|
||||||
|
"no-empty-pattern": "error",
|
||||||
|
"no-empty-static-block": "error",
|
||||||
|
"no-eval": "warn",
|
||||||
|
"no-ex-assign": "error",
|
||||||
|
"no-extra-boolean-cast": "error",
|
||||||
|
"no-fallthrough": "warn",
|
||||||
|
"no-func-assign": "error",
|
||||||
|
"no-global-assign": "error",
|
||||||
|
"no-import-assign": "error",
|
||||||
|
"no-invalid-regexp": "error",
|
||||||
|
"no-irregular-whitespace": "error",
|
||||||
|
"no-loss-of-precision": "error",
|
||||||
|
"no-misleading-character-class": "error",
|
||||||
|
"no-new-native-nonconstructor": "error",
|
||||||
|
"no-nonoctal-decimal-escape": "error",
|
||||||
|
"no-obj-calls": "error",
|
||||||
|
"no-octal": "error",
|
||||||
|
"no-prototype-builtins": "error",
|
||||||
|
"no-redeclare": "error",
|
||||||
|
"no-regex-spaces": "error",
|
||||||
|
"no-self-assign": "error",
|
||||||
|
"no-setter-return": "error",
|
||||||
|
"no-shadow-restricted-names": "error",
|
||||||
|
"no-sparse-arrays": "error",
|
||||||
|
"no-this-before-super": "error",
|
||||||
|
"no-unassigned-vars": "warn",
|
||||||
|
"no-undef": "error",
|
||||||
|
"no-unexpected-multiline": "error",
|
||||||
|
"no-unreachable": "error",
|
||||||
|
"no-unsafe-finally": "error",
|
||||||
|
"no-unsafe-negation": "error",
|
||||||
|
"no-unsafe-optional-chaining": "error",
|
||||||
|
"no-unused-expressions": "off", // this rule disallow us to use expression to call function, like `condition && fn()`
|
||||||
|
"no-unused-labels": "error",
|
||||||
|
"no-unused-private-class-members": "error",
|
||||||
|
"no-unused-vars": ["warn", { "caughtErrors": "none" }],
|
||||||
|
"no-useless-backreference": "error",
|
||||||
|
"no-useless-catch": "error",
|
||||||
|
"no-useless-escape": "error",
|
||||||
|
"no-useless-rename": "warn",
|
||||||
|
"no-with": "error",
|
||||||
|
"oxc/bad-array-method-on-arguments": "warn",
|
||||||
|
"oxc/bad-char-at-comparison": "warn",
|
||||||
|
"oxc/bad-comparison-sequence": "warn",
|
||||||
|
"oxc/bad-min-max-func": "warn",
|
||||||
|
"oxc/bad-object-literal-comparison": "warn",
|
||||||
|
"oxc/bad-replace-all-arg": "warn",
|
||||||
|
"oxc/const-comparisons": "warn",
|
||||||
|
"oxc/double-comparisons": "warn",
|
||||||
|
"oxc/erasing-op": "warn",
|
||||||
|
"oxc/missing-throw": "warn",
|
||||||
|
"oxc/number-arg-out-of-range": "warn",
|
||||||
|
"oxc/only-used-in-recursion": "off", // manually off bacause of existing warning. may turn it on in the future
|
||||||
|
"oxc/uninvoked-array-callback": "warn",
|
||||||
|
"require-yield": "error",
|
||||||
|
"typescript/await-thenable": "warn",
|
||||||
|
// "typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/no-array-constructor": "error",
|
||||||
|
// "typescript/consistent-type-imports": "error",
|
||||||
|
"typescript/no-array-delete": "warn",
|
||||||
|
"typescript/no-base-to-string": "warn",
|
||||||
|
"typescript/no-duplicate-enum-values": "error",
|
||||||
|
"typescript/no-duplicate-type-constituents": "warn",
|
||||||
|
"typescript/no-empty-object-type": "off",
|
||||||
|
"typescript/no-explicit-any": "off", // not safe but too many errors
|
||||||
|
"typescript/no-extra-non-null-assertion": "error",
|
||||||
|
"typescript/no-floating-promises": "warn",
|
||||||
|
"typescript/no-for-in-array": "warn",
|
||||||
|
"typescript/no-implied-eval": "warn",
|
||||||
|
"typescript/no-meaningless-void-operator": "warn",
|
||||||
|
"typescript/no-misused-new": "error",
|
||||||
|
"typescript/no-misused-spread": "warn",
|
||||||
|
"typescript/no-namespace": "error",
|
||||||
|
"typescript/no-non-null-asserted-optional-chain": "off", // it's off now. but may turn it on.
|
||||||
|
"typescript/no-redundant-type-constituents": "warn",
|
||||||
|
"typescript/no-require-imports": "off",
|
||||||
|
"typescript/no-this-alias": "error",
|
||||||
|
"typescript/no-unnecessary-parameter-property-assignment": "warn",
|
||||||
|
"typescript/no-unnecessary-type-constraint": "error",
|
||||||
|
"typescript/no-unsafe-declaration-merging": "error",
|
||||||
|
"typescript/no-unsafe-function-type": "error",
|
||||||
|
"typescript/no-unsafe-unary-minus": "warn",
|
||||||
|
"typescript/no-useless-empty-export": "warn",
|
||||||
|
"typescript/no-wrapper-object-types": "error",
|
||||||
|
"typescript/prefer-as-const": "error",
|
||||||
|
"typescript/prefer-namespace-keyword": "error",
|
||||||
|
"typescript/require-array-sort-compare": "warn",
|
||||||
|
"typescript/restrict-template-expressions": "warn",
|
||||||
|
"typescript/triple-slash-reference": "error",
|
||||||
|
"typescript/unbound-method": "warn",
|
||||||
|
"unicorn/no-await-in-promise-methods": "warn",
|
||||||
|
"unicorn/no-empty-file": "off", // manually off bacause of existing warning. may turn it on in the future
|
||||||
|
"unicorn/no-invalid-fetch-options": "warn",
|
||||||
|
"unicorn/no-invalid-remove-event-listener": "warn",
|
||||||
|
"unicorn/no-new-array": "off", // manually off bacause of existing warning. may turn it on in the future
|
||||||
|
"unicorn/no-single-promise-in-promise-methods": "warn",
|
||||||
|
"unicorn/no-thenable": "off", // manually off bacause of existing warning. may turn it on in the future
|
||||||
|
"unicorn/no-unnecessary-await": "warn",
|
||||||
|
"unicorn/no-useless-fallback-in-spread": "warn",
|
||||||
|
"unicorn/no-useless-length-check": "warn",
|
||||||
|
"unicorn/no-useless-spread": "off", // manually off bacause of existing warning. may turn it on in the future
|
||||||
|
"unicorn/prefer-set-size": "warn",
|
||||||
|
"unicorn/prefer-string-starts-ends-with": "warn",
|
||||||
|
"use-isnan": "error",
|
||||||
|
"valid-typeof": "error"
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"jsdoc": {
|
||||||
|
"augmentsExtendsReplacesDocs": false,
|
||||||
|
"exemptDestructuredRootsFromChecks": false,
|
||||||
|
"ignoreInternal": false,
|
||||||
|
"ignorePrivate": false,
|
||||||
|
"ignoreReplacesDocs": true,
|
||||||
|
"implementsReplacesDocs": false,
|
||||||
|
"overrideReplacesDocs": true,
|
||||||
|
"tagNamePreference": {}
|
||||||
|
},
|
||||||
|
"jsx-a11y": {
|
||||||
|
"attributes": {},
|
||||||
|
"components": {},
|
||||||
|
"polymorphicPropName": null
|
||||||
|
},
|
||||||
|
"next": {
|
||||||
|
"rootDir": []
|
||||||
|
},
|
||||||
|
"react": {
|
||||||
|
"formComponents": [],
|
||||||
|
"linkComponents": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
out
|
|
||||||
dist
|
|
||||||
pnpm-lock.yaml
|
|
||||||
LICENSE.md
|
|
||||||
tsconfig.json
|
|
||||||
tsconfig.*.json
|
|
||||||
CHANGELOG*.md
|
|
||||||
agents.json
|
|
||||||
src/renderer/src/integration/nutstore/sso/lib
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"singleQuote": true,
|
|
||||||
"semi": false,
|
|
||||||
"printWidth": 120,
|
|
||||||
"trailingComma": "none",
|
|
||||||
"endOfLine": "lf",
|
|
||||||
"bracketSameLine": true
|
|
||||||
}
|
|
||||||
10
.vscode/extensions.json
vendored
10
.vscode/extensions.json
vendored
@@ -1,3 +1,11 @@
|
|||||||
{
|
{
|
||||||
"recommendations": ["dbaeumer.vscode-eslint"]
|
"recommendations": [
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"editorconfig.editorconfig",
|
||||||
|
"lokalise.i18n-ally",
|
||||||
|
"bradlc.vscode-tailwindcss",
|
||||||
|
"vitest.explorer",
|
||||||
|
"oxc.oxc-vscode",
|
||||||
|
"biomejs.biome"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
48
.vscode/launch.json
vendored
48
.vscode/launch.json
vendored
@@ -1,40 +1,40 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"compounds": [
|
||||||
|
{
|
||||||
|
"configurations": ["Debug Main Process", "Debug Renderer Process"],
|
||||||
|
"name": "Debug All",
|
||||||
|
"presentation": {
|
||||||
|
"order": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Debug Main Process",
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
|
|
||||||
"runtimeVersion": "20",
|
|
||||||
"windows": {
|
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
|
|
||||||
},
|
|
||||||
"runtimeArgs": ["--sourcemap"],
|
|
||||||
"env": {
|
"env": {
|
||||||
"REMOTE_DEBUGGING_PORT": "9222"
|
"REMOTE_DEBUGGING_PORT": "9222"
|
||||||
|
},
|
||||||
|
"envFile": "${workspaceFolder}/.env",
|
||||||
|
"name": "Debug Main Process",
|
||||||
|
"request": "launch",
|
||||||
|
"runtimeArgs": ["--inspect", "--sourcemap"],
|
||||||
|
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
|
||||||
|
"type": "node",
|
||||||
|
"windows": {
|
||||||
|
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Debug Renderer Process",
|
"name": "Debug Renderer Process",
|
||||||
"port": 9222,
|
"port": 9222,
|
||||||
"request": "attach",
|
|
||||||
"type": "chrome",
|
|
||||||
"webRoot": "${workspaceFolder}/src/renderer",
|
|
||||||
"timeout": 60000,
|
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"hidden": true
|
"hidden": true
|
||||||
}
|
},
|
||||||
|
"request": "attach",
|
||||||
|
"timeout": 3000000,
|
||||||
|
"type": "chrome",
|
||||||
|
"webRoot": "${workspaceFolder}/src/renderer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"compounds": [
|
"version": "0.2.0"
|
||||||
{
|
|
||||||
"name": "Debug All",
|
|
||||||
"configurations": ["Debug Main Process", "Debug Renderer Process"],
|
|
||||||
"presentation": {
|
|
||||||
"order": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
70
.vscode/settings.json
vendored
70
.vscode/settings.json
vendored
@@ -1,43 +1,55 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"[css]": {
|
||||||
"editor.codeActionsOnSave": {
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
"source.fixAll.eslint": "explicit"
|
|
||||||
},
|
|
||||||
"search.exclude": {
|
|
||||||
"**/dist/**": true,
|
|
||||||
".yarn/releases/**": true
|
|
||||||
},
|
},
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
},
|
|
||||||
"[typescript]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"[typescriptreact]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
},
|
||||||
"[json]": {
|
"[json]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
},
|
},
|
||||||
"[jsonc]": {
|
"[jsonc]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
},
|
|
||||||
"[css]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
|
||||||
"[scss]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
},
|
},
|
||||||
"[markdown]": {
|
"[markdown]": {
|
||||||
"files.trimTrailingWhitespace": false
|
"files.trimTrailingWhitespace": false
|
||||||
},
|
},
|
||||||
"i18n-ally.localesPaths": ["src/renderer/src/i18n/locales"],
|
"[scss]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
},
|
||||||
|
"[typescriptreact]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
},
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.biome": "explicit",
|
||||||
|
"source.fixAll.eslint": "explicit",
|
||||||
|
"source.fixAll.oxc": "explicit",
|
||||||
|
"source.organizeImports": "never"
|
||||||
|
},
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"files.associations": {
|
||||||
|
"*.css": "tailwindcss"
|
||||||
|
},
|
||||||
|
"files.eol": "\n",
|
||||||
|
// "i18n-ally.displayLanguage": "zh-cn", // 界面显示语言
|
||||||
"i18n-ally.enabledFrameworks": ["react-i18next", "i18next"],
|
"i18n-ally.enabledFrameworks": ["react-i18next", "i18next"],
|
||||||
"i18n-ally.keystyle": "nested", // 翻译路径格式
|
|
||||||
"i18n-ally.sortKeys": true, // 排序
|
|
||||||
"i18n-ally.namespace": true, // 开启命名空间
|
|
||||||
"i18n-ally.enabledParsers": ["ts", "js", "json"], // 解析语言
|
"i18n-ally.enabledParsers": ["ts", "js", "json"], // 解析语言
|
||||||
"i18n-ally.sourceLanguage": "en-us", // 翻译源语言
|
"i18n-ally.fullReloadOnChanged": true,
|
||||||
"i18n-ally.displayLanguage": "zh-cn",
|
"i18n-ally.keystyle": "nested", // 翻译路径格式
|
||||||
"i18n-ally.fullReloadOnChanged": true // 界面显示语言
|
"i18n-ally.localesPaths": ["src/renderer/src/i18n/locales"],
|
||||||
|
// "i18n-ally.namespace": true, // 开启命名空间
|
||||||
|
"i18n-ally.sortKeys": true, // 排序
|
||||||
|
"i18n-ally.sourceLanguage": "zh-cn", // 翻译源语言
|
||||||
|
"i18n-ally.usage.derivedKeyRules": ["{key}_one", "{key}_other"], // 标记单复数形式的键为已翻译
|
||||||
|
"search.exclude": {
|
||||||
|
"**/dist/**": true,
|
||||||
|
".yarn/releases/**": true
|
||||||
|
},
|
||||||
|
"tailwindCSS.classAttributes": [
|
||||||
|
"className",
|
||||||
|
"classNames",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
13
.yarn/patches/@ai-sdk-google-npm-2.0.20-b9102f9d54.patch
vendored
Normal file
13
.yarn/patches/@ai-sdk-google-npm-2.0.20-b9102f9d54.patch
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||||
|
index 69ab1599c76801dc1167551b6fa283dded123466..f0af43bba7ad1196fe05338817e65b4ebda40955 100644
|
||||||
|
--- a/dist/index.mjs
|
||||||
|
+++ b/dist/index.mjs
|
||||||
|
@@ -477,7 +477,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
||||||
|
|
||||||
|
// src/get-model-path.ts
|
||||||
|
function getModelPath(modelId) {
|
||||||
|
- return modelId.includes("/") ? modelId : `models/${modelId}`;
|
||||||
|
+ return modelId?.includes("models/") ? modelId : `models/${modelId}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/google-generative-ai-options.ts
|
||||||
31
.yarn/patches/@anthropic-ai-claude-agent-sdk-npm-0.1.1-d937b73fed.patch
vendored
Normal file
31
.yarn/patches/@anthropic-ai-claude-agent-sdk-npm-0.1.1-d937b73fed.patch
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
diff --git a/sdk.mjs b/sdk.mjs
|
||||||
|
index 461e9a2ba246778261108a682762ffcf26f7224e..44bd667d9f591969d36a105ba5eb8b478c738dd8 100644
|
||||||
|
--- a/sdk.mjs
|
||||||
|
+++ b/sdk.mjs
|
||||||
|
@@ -6215,7 +6215,7 @@ function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// ../src/transport/ProcessTransport.ts
|
||||||
|
-import { spawn } from "child_process";
|
||||||
|
+import { fork } from "child_process";
|
||||||
|
import { createInterface } from "readline";
|
||||||
|
|
||||||
|
// ../src/utils/fsOperations.ts
|
||||||
|
@@ -6473,14 +6473,11 @@ class ProcessTransport {
|
||||||
|
const errorMessage = isNativeBinary(pathToClaudeCodeExecutable) ? `Claude Code native binary not found at ${pathToClaudeCodeExecutable}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.` : `Claude Code executable not found at ${pathToClaudeCodeExecutable}. Is options.pathToClaudeCodeExecutable set?`;
|
||||||
|
throw new ReferenceError(errorMessage);
|
||||||
|
}
|
||||||
|
- const isNative = isNativeBinary(pathToClaudeCodeExecutable);
|
||||||
|
- const spawnCommand = isNative ? pathToClaudeCodeExecutable : executable;
|
||||||
|
- const spawnArgs = isNative ? args : [...executableArgs, pathToClaudeCodeExecutable, ...args];
|
||||||
|
- this.logForDebugging(isNative ? `Spawning Claude Code native binary: ${pathToClaudeCodeExecutable} ${args.join(" ")}` : `Spawning Claude Code process: ${executable} ${[...executableArgs, pathToClaudeCodeExecutable, ...args].join(" ")}`);
|
||||||
|
+ this.logForDebugging(`Forking Claude Code Node.js process: ${pathToClaudeCodeExecutable} ${args.join(" ")}`);
|
||||||
|
const stderrMode = env.DEBUG || stderr ? "pipe" : "ignore";
|
||||||
|
- this.child = spawn(spawnCommand, spawnArgs, {
|
||||||
|
+ this.child = fork(pathToClaudeCodeExecutable, args, {
|
||||||
|
cwd,
|
||||||
|
- stdio: ["pipe", "pipe", stderrMode],
|
||||||
|
+ stdio: stderrMode === "pipe" ? ["pipe", "pipe", "pipe", "ipc"] : ["pipe", "pipe", "ignore", "ipc"],
|
||||||
|
signal: this.abortController.signal,
|
||||||
|
env
|
||||||
|
});
|
||||||
196
.yarn/patches/@anthropic-ai-vertex-sdk-npm-0.11.4-c19cb41edb.patch
vendored
Normal file
196
.yarn/patches/@anthropic-ai-vertex-sdk-npm-0.11.4-c19cb41edb.patch
vendored
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
diff --git a/client.js b/client.js
|
||||||
|
index c2b9cd6e46f9f66f901af259661bc2d2f8b38936..9b6b3af1a6573e1ccaf3a1c5f41b48df198cbbe0 100644
|
||||||
|
--- a/client.js
|
||||||
|
+++ b/client.js
|
||||||
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.AnthropicVertex = exports.BaseAnthropic = void 0;
|
||||||
|
const client_1 = require("@anthropic-ai/sdk/client");
|
||||||
|
const Resources = __importStar(require("@anthropic-ai/sdk/resources/index"));
|
||||||
|
-const google_auth_library_1 = require("google-auth-library");
|
||||||
|
+// const google_auth_library_1 = require("google-auth-library");
|
||||||
|
const env_1 = require("./internal/utils/env.js");
|
||||||
|
const values_1 = require("./internal/utils/values.js");
|
||||||
|
const headers_1 = require("./internal/headers.js");
|
||||||
|
@@ -56,7 +56,7 @@ class AnthropicVertex extends client_1.BaseAnthropic {
|
||||||
|
throw new Error('No region was given. The client should be instantiated with the `region` option or the `CLOUD_ML_REGION` environment variable should be set.');
|
||||||
|
}
|
||||||
|
super({
|
||||||
|
- baseURL: baseURL || `https://${region}-aiplatform.googleapis.com/v1`,
|
||||||
|
+ baseURL: baseURL || (region === 'global' ? 'https://aiplatform.googleapis.com/v1' : `https://${region}-aiplatform.googleapis.com/v1`),
|
||||||
|
...opts,
|
||||||
|
});
|
||||||
|
this.messages = makeMessagesResource(this);
|
||||||
|
@@ -64,22 +64,22 @@ class AnthropicVertex extends client_1.BaseAnthropic {
|
||||||
|
this.region = region;
|
||||||
|
this.projectId = projectId;
|
||||||
|
this.accessToken = opts.accessToken ?? null;
|
||||||
|
- this._auth =
|
||||||
|
- opts.googleAuth ?? new google_auth_library_1.GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' });
|
||||||
|
- this._authClientPromise = this._auth.getClient();
|
||||||
|
+ // this._auth =
|
||||||
|
+ // opts.googleAuth ?? new google_auth_library_1.GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' });
|
||||||
|
+ // this._authClientPromise = this._auth.getClient();
|
||||||
|
}
|
||||||
|
validateHeaders() {
|
||||||
|
// auth validation is handled in prepareOptions since it needs to be async
|
||||||
|
}
|
||||||
|
- async prepareOptions(options) {
|
||||||
|
- const authClient = await this._authClientPromise;
|
||||||
|
- const authHeaders = await authClient.getRequestHeaders();
|
||||||
|
- const projectId = authClient.projectId ?? authHeaders['x-goog-user-project'];
|
||||||
|
- if (!this.projectId && projectId) {
|
||||||
|
- this.projectId = projectId;
|
||||||
|
- }
|
||||||
|
- options.headers = (0, headers_1.buildHeaders)([authHeaders, options.headers]);
|
||||||
|
- }
|
||||||
|
+ // async prepareOptions(options) {
|
||||||
|
+ // const authClient = await this._authClientPromise;
|
||||||
|
+ // const authHeaders = await authClient.getRequestHeaders();
|
||||||
|
+ // const projectId = authClient.projectId ?? authHeaders['x-goog-user-project'];
|
||||||
|
+ // if (!this.projectId && projectId) {
|
||||||
|
+ // this.projectId = projectId;
|
||||||
|
+ // }
|
||||||
|
+ // options.headers = (0, headers_1.buildHeaders)([authHeaders, options.headers]);
|
||||||
|
+ // }
|
||||||
|
buildRequest(options) {
|
||||||
|
if ((0, values_1.isObj)(options.body)) {
|
||||||
|
// create a shallow copy of the request body so that code that mutates it later
|
||||||
|
diff --git a/client.mjs b/client.mjs
|
||||||
|
index 70274cbf38f69f87cbcca9567e77e4a7b938cf90..4dea954b6f4afad565663426b7adfad5de973a7d 100644
|
||||||
|
--- a/client.mjs
|
||||||
|
+++ b/client.mjs
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
import { BaseAnthropic } from '@anthropic-ai/sdk/client';
|
||||||
|
import * as Resources from '@anthropic-ai/sdk/resources/index';
|
||||||
|
-import { GoogleAuth } from 'google-auth-library';
|
||||||
|
+// import { GoogleAuth } from 'google-auth-library';
|
||||||
|
import { readEnv } from "./internal/utils/env.mjs";
|
||||||
|
import { isObj } from "./internal/utils/values.mjs";
|
||||||
|
import { buildHeaders } from "./internal/headers.mjs";
|
||||||
|
@@ -29,7 +29,7 @@ export class AnthropicVertex extends BaseAnthropic {
|
||||||
|
throw new Error('No region was given. The client should be instantiated with the `region` option or the `CLOUD_ML_REGION` environment variable should be set.');
|
||||||
|
}
|
||||||
|
super({
|
||||||
|
- baseURL: baseURL || `https://${region}-aiplatform.googleapis.com/v1`,
|
||||||
|
+ baseURL: baseURL || (region === 'global' ? 'https://aiplatform.googleapis.com/v1' : `https://${region}-aiplatform.googleapis.com/v1`),
|
||||||
|
...opts,
|
||||||
|
});
|
||||||
|
this.messages = makeMessagesResource(this);
|
||||||
|
@@ -37,22 +37,22 @@ export class AnthropicVertex extends BaseAnthropic {
|
||||||
|
this.region = region;
|
||||||
|
this.projectId = projectId;
|
||||||
|
this.accessToken = opts.accessToken ?? null;
|
||||||
|
- this._auth =
|
||||||
|
- opts.googleAuth ?? new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' });
|
||||||
|
- this._authClientPromise = this._auth.getClient();
|
||||||
|
+ // this._auth =
|
||||||
|
+ // opts.googleAuth ?? new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' });
|
||||||
|
+ //this._authClientPromise = this._auth.getClient();
|
||||||
|
}
|
||||||
|
validateHeaders() {
|
||||||
|
// auth validation is handled in prepareOptions since it needs to be async
|
||||||
|
}
|
||||||
|
- async prepareOptions(options) {
|
||||||
|
- const authClient = await this._authClientPromise;
|
||||||
|
- const authHeaders = await authClient.getRequestHeaders();
|
||||||
|
- const projectId = authClient.projectId ?? authHeaders['x-goog-user-project'];
|
||||||
|
- if (!this.projectId && projectId) {
|
||||||
|
- this.projectId = projectId;
|
||||||
|
- }
|
||||||
|
- options.headers = buildHeaders([authHeaders, options.headers]);
|
||||||
|
- }
|
||||||
|
+ // async prepareOptions(options) {
|
||||||
|
+ // const authClient = await this._authClientPromise;
|
||||||
|
+ // const authHeaders = await authClient.getRequestHeaders();
|
||||||
|
+ // const projectId = authClient.projectId ?? authHeaders['x-goog-user-project'];
|
||||||
|
+ // if (!this.projectId && projectId) {
|
||||||
|
+ // this.projectId = projectId;
|
||||||
|
+ // }
|
||||||
|
+ // options.headers = buildHeaders([authHeaders, options.headers]);
|
||||||
|
+ // }
|
||||||
|
buildRequest(options) {
|
||||||
|
if (isObj(options.body)) {
|
||||||
|
// create a shallow copy of the request body so that code that mutates it later
|
||||||
|
diff --git a/src/client.ts b/src/client.ts
|
||||||
|
index a6f9c6be65e4189f4f9601fb560df3f68e7563eb..37b1ad2802e3ca0dae4ca35f9dcb5b22dcf09796 100644
|
||||||
|
--- a/src/client.ts
|
||||||
|
+++ b/src/client.ts
|
||||||
|
@@ -12,22 +12,22 @@ export { BaseAnthropic } from '@anthropic-ai/sdk/client';
|
||||||
|
const DEFAULT_VERSION = 'vertex-2023-10-16';
|
||||||
|
const MODEL_ENDPOINTS = new Set<string>(['/v1/messages', '/v1/messages?beta=true']);
|
||||||
|
|
||||||
|
-export type ClientOptions = Omit<CoreClientOptions, 'apiKey' | 'authToken'> & {
|
||||||
|
- region?: string | null | undefined;
|
||||||
|
- projectId?: string | null | undefined;
|
||||||
|
- accessToken?: string | null | undefined;
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
- * Override the default google auth config using the
|
||||||
|
- * [google-auth-library](https://www.npmjs.com/package/google-auth-library) package.
|
||||||
|
- *
|
||||||
|
- * Note that you'll likely have to set `scopes`, e.g.
|
||||||
|
- * ```ts
|
||||||
|
- * new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' })
|
||||||
|
- * ```
|
||||||
|
- */
|
||||||
|
- googleAuth?: GoogleAuth | null | undefined;
|
||||||
|
-};
|
||||||
|
+// export type ClientOptions = Omit<CoreClientOptions, 'apiKey' | 'authToken'> & {
|
||||||
|
+// region?: string | null | undefined;
|
||||||
|
+// projectId?: string | null | undefined;
|
||||||
|
+// accessToken?: string | null | undefined;
|
||||||
|
+
|
||||||
|
+// /**
|
||||||
|
+// * Override the default google auth config using the
|
||||||
|
+// * [google-auth-library](https://www.npmjs.com/package/google-auth-library) package.
|
||||||
|
+// *
|
||||||
|
+// * Note that you'll likely have to set `scopes`, e.g.
|
||||||
|
+// * ```ts
|
||||||
|
+// * new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' })
|
||||||
|
+// * ```
|
||||||
|
+// */
|
||||||
|
+// googleAuth?: GoogleAuth | null | undefined;
|
||||||
|
+// };
|
||||||
|
|
||||||
|
export class AnthropicVertex extends BaseAnthropic {
|
||||||
|
region: string;
|
||||||
|
@@ -74,9 +74,9 @@ export class AnthropicVertex extends BaseAnthropic {
|
||||||
|
this.projectId = projectId;
|
||||||
|
this.accessToken = opts.accessToken ?? null;
|
||||||
|
|
||||||
|
- this._auth =
|
||||||
|
- opts.googleAuth ?? new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' });
|
||||||
|
- this._authClientPromise = this._auth.getClient();
|
||||||
|
+ // this._auth =
|
||||||
|
+ // opts.googleAuth ?? new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' });
|
||||||
|
+ // this._authClientPromise = this._auth.getClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
messages: MessagesResource = makeMessagesResource(this);
|
||||||
|
@@ -86,17 +86,17 @@ export class AnthropicVertex extends BaseAnthropic {
|
||||||
|
// auth validation is handled in prepareOptions since it needs to be async
|
||||||
|
}
|
||||||
|
|
||||||
|
- protected override async prepareOptions(options: FinalRequestOptions): Promise<void> {
|
||||||
|
- const authClient = await this._authClientPromise;
|
||||||
|
+ // protected override async prepareOptions(options: FinalRequestOptions): Promise<void> {
|
||||||
|
+ // const authClient = await this._authClientPromise;
|
||||||
|
|
||||||
|
- const authHeaders = await authClient.getRequestHeaders();
|
||||||
|
- const projectId = authClient.projectId ?? authHeaders['x-goog-user-project'];
|
||||||
|
- if (!this.projectId && projectId) {
|
||||||
|
- this.projectId = projectId;
|
||||||
|
- }
|
||||||
|
+ // const authHeaders = await authClient.getRequestHeaders();
|
||||||
|
+ // const projectId = authClient.projectId ?? authHeaders['x-goog-user-project'];
|
||||||
|
+ // if (!this.projectId && projectId) {
|
||||||
|
+ // this.projectId = projectId;
|
||||||
|
+ // }
|
||||||
|
|
||||||
|
- options.headers = buildHeaders([authHeaders, options.headers]);
|
||||||
|
- }
|
||||||
|
+ // options.headers = buildHeaders([authHeaders, options.headers]);
|
||||||
|
+ // }
|
||||||
|
|
||||||
|
override buildRequest(options: FinalRequestOptions): {
|
||||||
|
req: FinalizedRequestInit;
|
||||||
6471
.yarn/patches/@google-genai-npm-1.0.1-e26f0f9af7.patch
vendored
Normal file
6471
.yarn/patches/@google-genai-npm-1.0.1-e26f0f9af7.patch
vendored
Normal file
File diff suppressed because one or more lines are too long
71
.yarn/patches/@langchain-core-npm-0.3.44-41d5c3cb0a.patch
vendored
Normal file
71
.yarn/patches/@langchain-core-npm-0.3.44-41d5c3cb0a.patch
vendored
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
diff --git a/dist/utils/tiktoken.cjs b/dist/utils/tiktoken.cjs
|
||||||
|
index 973b0d0e75aeaf8de579419af31b879b32975413..f23c7caa8b9dc8bd404132725346a4786f6b278b 100644
|
||||||
|
--- a/dist/utils/tiktoken.cjs
|
||||||
|
+++ b/dist/utils/tiktoken.cjs
|
||||||
|
@@ -1,25 +1,14 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.encodingForModel = exports.getEncoding = void 0;
|
||||||
|
-const lite_1 = require("js-tiktoken/lite");
|
||||||
|
const async_caller_js_1 = require("./async_caller.cjs");
|
||||||
|
const cache = {};
|
||||||
|
const caller = /* #__PURE__ */ new async_caller_js_1.AsyncCaller({});
|
||||||
|
async function getEncoding(encoding) {
|
||||||
|
- if (!(encoding in cache)) {
|
||||||
|
- cache[encoding] = caller
|
||||||
|
- .fetch(`https://tiktoken.pages.dev/js/${encoding}.json`)
|
||||||
|
- .then((res) => res.json())
|
||||||
|
- .then((data) => new lite_1.Tiktoken(data))
|
||||||
|
- .catch((e) => {
|
||||||
|
- delete cache[encoding];
|
||||||
|
- throw e;
|
||||||
|
- });
|
||||||
|
- }
|
||||||
|
- return await cache[encoding];
|
||||||
|
+ throw new Error("TikToken Not implemented");
|
||||||
|
}
|
||||||
|
exports.getEncoding = getEncoding;
|
||||||
|
async function encodingForModel(model) {
|
||||||
|
- return getEncoding((0, lite_1.getEncodingNameForModel)(model));
|
||||||
|
+ throw new Error("TikToken Not implemented");
|
||||||
|
}
|
||||||
|
exports.encodingForModel = encodingForModel;
|
||||||
|
diff --git a/dist/utils/tiktoken.js b/dist/utils/tiktoken.js
|
||||||
|
index 8e41ee6f00f2f9c7fa2c59fa2b2f4297634b97aa..aa5f314a6349ad0d1c5aea8631a56aad099176e0 100644
|
||||||
|
--- a/dist/utils/tiktoken.js
|
||||||
|
+++ b/dist/utils/tiktoken.js
|
||||||
|
@@ -1,20 +1,9 @@
|
||||||
|
-import { Tiktoken, getEncodingNameForModel, } from "js-tiktoken/lite";
|
||||||
|
import { AsyncCaller } from "./async_caller.js";
|
||||||
|
const cache = {};
|
||||||
|
const caller = /* #__PURE__ */ new AsyncCaller({});
|
||||||
|
export async function getEncoding(encoding) {
|
||||||
|
- if (!(encoding in cache)) {
|
||||||
|
- cache[encoding] = caller
|
||||||
|
- .fetch(`https://tiktoken.pages.dev/js/${encoding}.json`)
|
||||||
|
- .then((res) => res.json())
|
||||||
|
- .then((data) => new Tiktoken(data))
|
||||||
|
- .catch((e) => {
|
||||||
|
- delete cache[encoding];
|
||||||
|
- throw e;
|
||||||
|
- });
|
||||||
|
- }
|
||||||
|
- return await cache[encoding];
|
||||||
|
+ throw new Error("TikToken Not implemented");
|
||||||
|
}
|
||||||
|
export async function encodingForModel(model) {
|
||||||
|
- return getEncoding(getEncodingNameForModel(model));
|
||||||
|
+ throw new Error("TikToken Not implemented");
|
||||||
|
}
|
||||||
|
diff --git a/package.json b/package.json
|
||||||
|
index 36072aecf700fca1bc49832a19be832eca726103..90b8922fba1c3d1b26f78477c891b07816d6238a 100644
|
||||||
|
--- a/package.json
|
||||||
|
+++ b/package.json
|
||||||
|
@@ -37,7 +37,6 @@
|
||||||
|
"ansi-styles": "^5.0.0",
|
||||||
|
"camelcase": "6",
|
||||||
|
"decamelize": "1.2.0",
|
||||||
|
- "js-tiktoken": "^1.0.12",
|
||||||
|
"langsmith": ">=0.2.8 <0.4.0",
|
||||||
|
"mustache": "^4.2.0",
|
||||||
|
"p-queue": "^6.6.2",
|
||||||
30
.yarn/patches/@napi-rs-system-ocr-npm-1.0.2-59e7a78e8b.patch
vendored
Normal file
30
.yarn/patches/@napi-rs-system-ocr-npm-1.0.2-59e7a78e8b.patch
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
diff --git a/index.js b/index.js
|
||||||
|
index dc071739e79876dff88e1be06a9168e294222d13..b9df7525c62bdf777e89e732e1b0c81f84d872f2 100644
|
||||||
|
--- a/index.js
|
||||||
|
+++ b/index.js
|
||||||
|
@@ -380,7 +380,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-if (!nativeBinding) {
|
||||||
|
+if (!nativeBinding && process.platform !== 'linux') {
|
||||||
|
if (loadErrors.length > 0) {
|
||||||
|
throw new Error(
|
||||||
|
`Cannot find native binding. ` +
|
||||||
|
@@ -392,6 +392,13 @@ if (!nativeBinding) {
|
||||||
|
throw new Error(`Failed to load native binding`)
|
||||||
|
}
|
||||||
|
|
||||||
|
-module.exports = nativeBinding
|
||||||
|
-module.exports.OcrAccuracy = nativeBinding.OcrAccuracy
|
||||||
|
-module.exports.recognize = nativeBinding.recognize
|
||||||
|
+if (process.platform === 'linux') {
|
||||||
|
+ module.exports = {OcrAccuracy: {
|
||||||
|
+ Fast: 0,
|
||||||
|
+ Accurate: 1
|
||||||
|
+ }, recognize: () => Promise.resolve({text: '', confidence: 1.0})}
|
||||||
|
+}else{
|
||||||
|
+ module.exports = nativeBinding
|
||||||
|
+ module.exports.OcrAccuracy = nativeBinding.OcrAccuracy
|
||||||
|
+ module.exports.recognize = nativeBinding.recognize
|
||||||
|
+}
|
||||||
48
.yarn/patches/@tiptap-extension-drag-handle-npm-3.2.0-5a9ebff7c9.patch
vendored
Normal file
48
.yarn/patches/@tiptap-extension-drag-handle-npm-3.2.0-5a9ebff7c9.patch
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
diff --git a/dist/index.cjs b/dist/index.cjs
|
||||||
|
index 8e560a4406c5cc616c11bb9fd5455ac0dcf47fa3..c7cd0d65ddc971bff71e89f610de82cfdaa5a8c7 100644
|
||||||
|
--- a/dist/index.cjs
|
||||||
|
+++ b/dist/index.cjs
|
||||||
|
@@ -413,6 +413,19 @@ var DragHandlePlugin = ({
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
+ scroll(view) {
|
||||||
|
+ if (!element || locked) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ if (view.hasFocus()) {
|
||||||
|
+ hideHandle();
|
||||||
|
+ currentNode = null;
|
||||||
|
+ currentNodePos = -1;
|
||||||
|
+ onNodeChange == null ? void 0 : onNodeChange({ editor, node: null, pos: -1 });
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ return false;
|
||||||
|
+ },
|
||||||
|
mouseleave(_view, e) {
|
||||||
|
if (locked) {
|
||||||
|
return false;
|
||||||
|
diff --git a/dist/index.js b/dist/index.js
|
||||||
|
index 39e4c3ef9986cd25544d9d3994cf6a9ada74b145..378d9130abbfdd0e1e4f743b5b537743c9ab07d0 100644
|
||||||
|
--- a/dist/index.js
|
||||||
|
+++ b/dist/index.js
|
||||||
|
@@ -387,6 +387,19 @@ var DragHandlePlugin = ({
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
+ scroll(view) {
|
||||||
|
+ if (!element || locked) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ if (view.hasFocus()) {
|
||||||
|
+ hideHandle();
|
||||||
|
+ currentNode = null;
|
||||||
|
+ currentNodePos = -1;
|
||||||
|
+ onNodeChange == null ? void 0 : onNodeChange({ editor, node: null, pos: -1 });
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ return false;
|
||||||
|
+ },
|
||||||
|
mouseleave(_view, e) {
|
||||||
|
if (locked) {
|
||||||
|
return false;
|
||||||
55
.yarn/patches/antd-npm-5.27.0-aa91c36546.patch
vendored
Normal file
55
.yarn/patches/antd-npm-5.27.0-aa91c36546.patch
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
diff --git a/es/dropdown/dropdown.js b/es/dropdown/dropdown.js
|
||||||
|
index 2e45574398ff68450022a0078e213cc81fe7454e..58ba7789939b7805a89f92b93d222f8fb1168bdf 100644
|
||||||
|
--- a/es/dropdown/dropdown.js
|
||||||
|
+++ b/es/dropdown/dropdown.js
|
||||||
|
@@ -2,7 +2,7 @@
|
||||||
|
|
||||||
|
import * as React from 'react';
|
||||||
|
import LeftOutlined from "@ant-design/icons/es/icons/LeftOutlined";
|
||||||
|
-import RightOutlined from "@ant-design/icons/es/icons/RightOutlined";
|
||||||
|
+import { ChevronRight } from 'lucide-react';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import RcDropdown from 'rc-dropdown';
|
||||||
|
import useEvent from "rc-util/es/hooks/useEvent";
|
||||||
|
@@ -160,8 +160,10 @@ const Dropdown = props => {
|
||||||
|
className: `${prefixCls}-menu-submenu-arrow`
|
||||||
|
}, direction === 'rtl' ? (/*#__PURE__*/React.createElement(LeftOutlined, {
|
||||||
|
className: `${prefixCls}-menu-submenu-arrow-icon`
|
||||||
|
- })) : (/*#__PURE__*/React.createElement(RightOutlined, {
|
||||||
|
- className: `${prefixCls}-menu-submenu-arrow-icon`
|
||||||
|
+ })) : (/*#__PURE__*/React.createElement(ChevronRight, {
|
||||||
|
+ size: 16,
|
||||||
|
+ strokeWidth: 1.8,
|
||||||
|
+ className: `${prefixCls}-menu-submenu-arrow-icon lucide-custom`
|
||||||
|
}))),
|
||||||
|
mode: "vertical",
|
||||||
|
selectable: false,
|
||||||
|
diff --git a/es/select/useIcons.js b/es/select/useIcons.js
|
||||||
|
index 572aaaa0899f429cbf8a7181f2eeada545f76dcb..4e175c8d7713dd6422f8bcdc74ee671a835de6ce 100644
|
||||||
|
--- a/es/select/useIcons.js
|
||||||
|
+++ b/es/select/useIcons.js
|
||||||
|
@@ -4,10 +4,10 @@ import * as React from 'react';
|
||||||
|
import CheckOutlined from "@ant-design/icons/es/icons/CheckOutlined";
|
||||||
|
import CloseCircleFilled from "@ant-design/icons/es/icons/CloseCircleFilled";
|
||||||
|
import CloseOutlined from "@ant-design/icons/es/icons/CloseOutlined";
|
||||||
|
-import DownOutlined from "@ant-design/icons/es/icons/DownOutlined";
|
||||||
|
import LoadingOutlined from "@ant-design/icons/es/icons/LoadingOutlined";
|
||||||
|
import SearchOutlined from "@ant-design/icons/es/icons/SearchOutlined";
|
||||||
|
import { devUseWarning } from '../_util/warning';
|
||||||
|
+import { ChevronDown } from 'lucide-react';
|
||||||
|
export default function useIcons({
|
||||||
|
suffixIcon,
|
||||||
|
clearIcon,
|
||||||
|
@@ -54,8 +54,10 @@ export default function useIcons({
|
||||||
|
className: iconCls
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
- return getSuffixIconNode(/*#__PURE__*/React.createElement(DownOutlined, {
|
||||||
|
- className: iconCls
|
||||||
|
+ return getSuffixIconNode(/*#__PURE__*/React.createElement(ChevronDown, {
|
||||||
|
+ size: 16,
|
||||||
|
+ strokeWidth: 1.8,
|
||||||
|
+ className: `${iconCls} lucide-custom`
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -65,11 +65,44 @@ index e8bd7bb46c8a54b3f55cf3a853ef924195271e01..f956e9f3fe9eb903c78aef3502553b01
|
|||||||
await packager.info.emitArtifactBuildCompleted({
|
await packager.info.emitArtifactBuildCompleted({
|
||||||
file: installerPath,
|
file: installerPath,
|
||||||
updateInfo,
|
updateInfo,
|
||||||
|
diff --git a/out/util/yarn.js b/out/util/yarn.js
|
||||||
|
index 1ee20f8b252a8f28d0c7b103789cf0a9a427aec1..c2878ec54d57da50bf14225e0c70c9c88664eb8a 100644
|
||||||
|
--- a/out/util/yarn.js
|
||||||
|
+++ b/out/util/yarn.js
|
||||||
|
@@ -140,6 +140,7 @@ async function rebuild(config, { appDir, projectDir }, options) {
|
||||||
|
arch,
|
||||||
|
platform,
|
||||||
|
buildFromSource,
|
||||||
|
+ ignoreModules: config.excludeReBuildModules || undefined,
|
||||||
|
projectRootPath: projectDir,
|
||||||
|
mode: config.nativeRebuilder || "sequential",
|
||||||
|
disablePreGypCopy: true,
|
||||||
diff --git a/scheme.json b/scheme.json
|
diff --git a/scheme.json b/scheme.json
|
||||||
index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43ebd0fa8b61 100644
|
index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..0167441bf928a92f59b5dbe70b2317a74dda74c9 100644
|
||||||
--- a/scheme.json
|
--- a/scheme.json
|
||||||
+++ b/scheme.json
|
+++ b/scheme.json
|
||||||
@@ -1975,6 +1975,13 @@
|
@@ -1825,6 +1825,20 @@
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
+ "excludeReBuildModules": {
|
||||||
|
+ "anyOf": [
|
||||||
|
+ {
|
||||||
|
+ "items": {
|
||||||
|
+ "type": "string"
|
||||||
|
+ },
|
||||||
|
+ "type": "array"
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ "type": "null"
|
||||||
|
+ }
|
||||||
|
+ ],
|
||||||
|
+ "description": "The modules to exclude from the rebuild."
|
||||||
|
+ },
|
||||||
|
"executableArgs": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
@@ -1975,6 +1989,13 @@
|
||||||
],
|
],
|
||||||
"description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing."
|
"description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing."
|
||||||
},
|
},
|
||||||
@@ -83,7 +116,7 @@ index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43eb
|
|||||||
"packageCategory": {
|
"packageCategory": {
|
||||||
"description": "backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place",
|
"description": "backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place",
|
||||||
"type": [
|
"type": [
|
||||||
@@ -2327,6 +2334,13 @@
|
@@ -2327,6 +2348,13 @@
|
||||||
"MacConfiguration": {
|
"MacConfiguration": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -97,7 +130,28 @@ index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43eb
|
|||||||
"additionalArguments": {
|
"additionalArguments": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
@@ -2737,7 +2751,7 @@
|
@@ -2527,6 +2555,20 @@
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
+ "excludeReBuildModules": {
|
||||||
|
+ "anyOf": [
|
||||||
|
+ {
|
||||||
|
+ "items": {
|
||||||
|
+ "type": "string"
|
||||||
|
+ },
|
||||||
|
+ "type": "array"
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ "type": "null"
|
||||||
|
+ }
|
||||||
|
+ ],
|
||||||
|
+ "description": "The modules to exclude from the rebuild."
|
||||||
|
+ },
|
||||||
|
"executableName": {
|
||||||
|
"description": "The executable name. Defaults to `productName`.",
|
||||||
|
"type": [
|
||||||
|
@@ -2737,7 +2779,7 @@
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minimumSystemVersion": {
|
"minimumSystemVersion": {
|
||||||
@@ -106,7 +160,7 @@ index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43eb
|
|||||||
"type": [
|
"type": [
|
||||||
"null",
|
"null",
|
||||||
"string"
|
"string"
|
||||||
@@ -2959,6 +2973,13 @@
|
@@ -2959,6 +3001,13 @@
|
||||||
"MasConfiguration": {
|
"MasConfiguration": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -120,7 +174,28 @@ index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43eb
|
|||||||
"additionalArguments": {
|
"additionalArguments": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
@@ -3369,7 +3390,7 @@
|
@@ -3159,6 +3208,20 @@
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
+ "excludeReBuildModules": {
|
||||||
|
+ "anyOf": [
|
||||||
|
+ {
|
||||||
|
+ "items": {
|
||||||
|
+ "type": "string"
|
||||||
|
+ },
|
||||||
|
+ "type": "array"
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ "type": "null"
|
||||||
|
+ }
|
||||||
|
+ ],
|
||||||
|
+ "description": "The modules to exclude from the rebuild."
|
||||||
|
+ },
|
||||||
|
"executableName": {
|
||||||
|
"description": "The executable name. Defaults to `productName`.",
|
||||||
|
"type": [
|
||||||
|
@@ -3369,7 +3432,7 @@
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minimumSystemVersion": {
|
"minimumSystemVersion": {
|
||||||
@@ -129,7 +204,28 @@ index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43eb
|
|||||||
"type": [
|
"type": [
|
||||||
"null",
|
"null",
|
||||||
"string"
|
"string"
|
||||||
@@ -6507,6 +6528,13 @@
|
@@ -6381,6 +6444,20 @@
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
+ "excludeReBuildModules": {
|
||||||
|
+ "anyOf": [
|
||||||
|
+ {
|
||||||
|
+ "items": {
|
||||||
|
+ "type": "string"
|
||||||
|
+ },
|
||||||
|
+ "type": "array"
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ "type": "null"
|
||||||
|
+ }
|
||||||
|
+ ],
|
||||||
|
+ "description": "The modules to exclude from the rebuild."
|
||||||
|
+ },
|
||||||
|
"executableName": {
|
||||||
|
"description": "The executable name. Defaults to `productName`.",
|
||||||
|
"type": [
|
||||||
|
@@ -6507,6 +6584,13 @@
|
||||||
"string"
|
"string"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -143,7 +239,28 @@ index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43eb
|
|||||||
"protocols": {
|
"protocols": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
@@ -7376,6 +7404,13 @@
|
@@ -7153,6 +7237,20 @@
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
+ "excludeReBuildModules": {
|
||||||
|
+ "anyOf": [
|
||||||
|
+ {
|
||||||
|
+ "items": {
|
||||||
|
+ "type": "string"
|
||||||
|
+ },
|
||||||
|
+ "type": "array"
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ "type": "null"
|
||||||
|
+ }
|
||||||
|
+ ],
|
||||||
|
+ "description": "The modules to exclude from the rebuild."
|
||||||
|
+ },
|
||||||
|
"executableName": {
|
||||||
|
"description": "The executable name. Defaults to `productName`.",
|
||||||
|
"type": [
|
||||||
|
@@ -7376,6 +7474,13 @@
|
||||||
],
|
],
|
||||||
"description": "MAS (Mac Application Store) development options (`mas-dev` target)."
|
"description": "MAS (Mac Application Store) development options (`mas-dev` target)."
|
||||||
},
|
},
|
||||||
|
|||||||
12
.yarn/patches/atomically-npm-1.7.0-e742e5293b.patch
vendored
Normal file
12
.yarn/patches/atomically-npm-1.7.0-e742e5293b.patch
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/dist/utils/temp.js b/dist/utils/temp.js
|
||||||
|
index c0844f640f7927ff87edda13f7c853d10ebb8dd0..3ca3d29e0f4ee700c43ebde47002883955b664b3 100644
|
||||||
|
--- a/dist/utils/temp.js
|
||||||
|
+++ b/dist/utils/temp.js
|
||||||
|
@@ -2,6 +2,7 @@
|
||||||
|
/* IMPORT */
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const path = require("path");
|
||||||
|
+const process = require("process");
|
||||||
|
const consts_1 = require("../consts");
|
||||||
|
const fs_1 = require("./fs");
|
||||||
|
/* TEMP */
|
||||||
13
.yarn/patches/file-stream-rotator-npm-0.6.1-eab45fb13d.patch
vendored
Normal file
13
.yarn/patches/file-stream-rotator-npm-0.6.1-eab45fb13d.patch
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/FileStreamRotator.js b/FileStreamRotator.js
|
||||||
|
index 639bb9c8f972ba672bd27d9f8b1739d1030cb44b..a12a6d93b61fe782e981027248fa10876151f65f 100644
|
||||||
|
--- a/FileStreamRotator.js
|
||||||
|
+++ b/FileStreamRotator.js
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
*/
|
||||||
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
|
-var moment = require('moment');
|
||||||
|
+var moment = require('moment').default || require('moment');
|
||||||
|
var crypto = require('crypto');
|
||||||
|
|
||||||
|
var EventEmitter = require('events');
|
||||||
85
.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch
vendored
85
.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch
vendored
@@ -1,85 +0,0 @@
|
|||||||
diff --git a/core.js b/core.js
|
|
||||||
index 862d66101f441fb4f47dfc8cff5e2d39e1f5a11e..6464bebbf696c39d35f0368f061ea4236225c162 100644
|
|
||||||
--- a/core.js
|
|
||||||
+++ b/core.js
|
|
||||||
@@ -159,7 +159,7 @@ class APIClient {
|
|
||||||
Accept: 'application/json',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'User-Agent': this.getUserAgent(),
|
|
||||||
- ...getPlatformHeaders(),
|
|
||||||
+ // ...getPlatformHeaders(),
|
|
||||||
...this.authHeaders(opts),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
diff --git a/core.mjs b/core.mjs
|
|
||||||
index 05dbc6cfde51589a2b100d4e4b5b3c1a33b32b89..789fbb4985eb952a0349b779fa83b1a068af6e7e 100644
|
|
||||||
--- a/core.mjs
|
|
||||||
+++ b/core.mjs
|
|
||||||
@@ -152,7 +152,7 @@ export class APIClient {
|
|
||||||
Accept: 'application/json',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'User-Agent': this.getUserAgent(),
|
|
||||||
- ...getPlatformHeaders(),
|
|
||||||
+ // ...getPlatformHeaders(),
|
|
||||||
...this.authHeaders(opts),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
diff --git a/error.mjs b/error.mjs
|
|
||||||
index 7d19f5578040afa004bc887aab1725e8703d2bac..59ec725b6142299a62798ac4bdedb63ba7d9932c 100644
|
|
||||||
--- a/error.mjs
|
|
||||||
+++ b/error.mjs
|
|
||||||
@@ -36,7 +36,7 @@ export class APIError extends OpenAIError {
|
|
||||||
if (!status || !headers) {
|
|
||||||
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
|
||||||
}
|
|
||||||
- const error = errorResponse?.['error'];
|
|
||||||
+ const error = errorResponse?.['error'] || errorResponse;
|
|
||||||
if (status === 400) {
|
|
||||||
return new BadRequestError(status, error, message, headers);
|
|
||||||
}
|
|
||||||
diff --git a/resources/embeddings.js b/resources/embeddings.js
|
|
||||||
index aae578404cb2d09a39ac33fc416f1c215c45eecd..25c54b05bdae64d5c3b36fbb30dc7c8221b14034 100644
|
|
||||||
--- a/resources/embeddings.js
|
|
||||||
+++ b/resources/embeddings.js
|
|
||||||
@@ -36,6 +36,9 @@ class Embeddings extends resource_1.APIResource {
|
|
||||||
// No encoding_format specified, defaulting to base64 for performance reasons
|
|
||||||
// See https://github.com/openai/openai-node/pull/1312
|
|
||||||
let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : 'base64';
|
|
||||||
+ if (body.model.includes('jina')) {
|
|
||||||
+ encoding_format = undefined;
|
|
||||||
+ }
|
|
||||||
if (hasUserProvidedEncodingFormat) {
|
|
||||||
Core.debug('Request', 'User defined encoding_format:', body.encoding_format);
|
|
||||||
}
|
|
||||||
@@ -47,7 +50,7 @@ class Embeddings extends resource_1.APIResource {
|
|
||||||
...options,
|
|
||||||
});
|
|
||||||
// if the user specified an encoding_format, return the response as-is
|
|
||||||
- if (hasUserProvidedEncodingFormat) {
|
|
||||||
+ if (hasUserProvidedEncodingFormat || body.model.includes('jina')) {
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
// in this stage, we are sure the user did not specify an encoding_format
|
|
||||||
diff --git a/resources/embeddings.mjs b/resources/embeddings.mjs
|
|
||||||
index 0df3c6cc79a520e54acb4c2b5f77c43b774035ff..aa488b8a11b2c413c0a663d9a6059d286d7b5faf 100644
|
|
||||||
--- a/resources/embeddings.mjs
|
|
||||||
+++ b/resources/embeddings.mjs
|
|
||||||
@@ -10,6 +10,9 @@ export class Embeddings extends APIResource {
|
|
||||||
// No encoding_format specified, defaulting to base64 for performance reasons
|
|
||||||
// See https://github.com/openai/openai-node/pull/1312
|
|
||||||
let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : 'base64';
|
|
||||||
+ if (body.model.includes('jina')) {
|
|
||||||
+ encoding_format = undefined;
|
|
||||||
+ }
|
|
||||||
if (hasUserProvidedEncodingFormat) {
|
|
||||||
Core.debug('Request', 'User defined encoding_format:', body.encoding_format);
|
|
||||||
}
|
|
||||||
@@ -21,7 +24,7 @@ export class Embeddings extends APIResource {
|
|
||||||
...options,
|
|
||||||
});
|
|
||||||
// if the user specified an encoding_format, return the response as-is
|
|
||||||
- if (hasUserProvidedEncodingFormat) {
|
|
||||||
+ if (hasUserProvidedEncodingFormat || body.model.includes('jina')) {
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
// in this stage, we are sure the user did not specify an encoding_format
|
|
||||||
BIN
.yarn/patches/openai-npm-5.12.2-30b075401c.patch
vendored
Normal file
BIN
.yarn/patches/openai-npm-5.12.2-30b075401c.patch
vendored
Normal file
Binary file not shown.
348
.yarn/patches/tesseract.js-npm-6.0.1-2562a7e46d.patch
vendored
Normal file
348
.yarn/patches/tesseract.js-npm-6.0.1-2562a7e46d.patch
vendored
Normal file
@@ -0,0 +1,348 @@
|
|||||||
|
diff --git a/src/constants/languages.d.ts b/src/constants/languages.d.ts
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..6a2ba5086187622b8ca8887bcc7406018fba8a89
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/constants/languages.d.ts
|
||||||
|
@@ -0,0 +1,43 @@
|
||||||
|
+/**
|
||||||
|
+ * Languages with existing tesseract traineddata
|
||||||
|
+ * https://tesseract-ocr.github.io/tessdoc/Data-Files#data-files-for-version-400-november-29-2016
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+// Define the language codes as string literals
|
||||||
|
+type LanguageCode =
|
||||||
|
+ | 'afr' | 'amh' | 'ara' | 'asm' | 'aze' | 'aze_cyrl' | 'bel' | 'ben' | 'bod' | 'bos'
|
||||||
|
+ | 'bul' | 'cat' | 'ceb' | 'ces' | 'chi_sim' | 'chi_tra' | 'chr' | 'cym' | 'dan' | 'deu'
|
||||||
|
+ | 'dzo' | 'ell' | 'eng' | 'enm' | 'epo' | 'est' | 'eus' | 'fas' | 'fin' | 'fra'
|
||||||
|
+ | 'frk' | 'frm' | 'gle' | 'glg' | 'grc' | 'guj' | 'hat' | 'heb' | 'hin' | 'hrv'
|
||||||
|
+ | 'hun' | 'iku' | 'ind' | 'isl' | 'ita' | 'ita_old' | 'jav' | 'jpn' | 'kan' | 'kat'
|
||||||
|
+ | 'kat_old' | 'kaz' | 'khm' | 'kir' | 'kor' | 'kur' | 'lao' | 'lat' | 'lav' | 'lit'
|
||||||
|
+ | 'mal' | 'mar' | 'mkd' | 'mlt' | 'msa' | 'mya' | 'nep' | 'nld' | 'nor' | 'ori'
|
||||||
|
+ | 'pan' | 'pol' | 'por' | 'pus' | 'ron' | 'rus' | 'san' | 'sin' | 'slk' | 'slv'
|
||||||
|
+ | 'spa' | 'spa_old' | 'sqi' | 'srp' | 'srp_latn' | 'swa' | 'swe' | 'syr' | 'tam' | 'tel'
|
||||||
|
+ | 'tgk' | 'tgl' | 'tha' | 'tir' | 'tur' | 'uig' | 'ukr' | 'urd' | 'uzb' | 'uzb_cyrl'
|
||||||
|
+ | 'vie' | 'yid';
|
||||||
|
+
|
||||||
|
+// Define the language keys as string literals
|
||||||
|
+type LanguageKey =
|
||||||
|
+ | 'AFR' | 'AMH' | 'ARA' | 'ASM' | 'AZE' | 'AZE_CYRL' | 'BEL' | 'BEN' | 'BOD' | 'BOS'
|
||||||
|
+ | 'BUL' | 'CAT' | 'CEB' | 'CES' | 'CHI_SIM' | 'CHI_TRA' | 'CHR' | 'CYM' | 'DAN' | 'DEU'
|
||||||
|
+ | 'DZO' | 'ELL' | 'ENG' | 'ENM' | 'EPO' | 'EST' | 'EUS' | 'FAS' | 'FIN' | 'FRA'
|
||||||
|
+ | 'FRK' | 'FRM' | 'GLE' | 'GLG' | 'GRC' | 'GUJ' | 'HAT' | 'HEB' | 'HIN' | 'HRV'
|
||||||
|
+ | 'HUN' | 'IKU' | 'IND' | 'ISL' | 'ITA' | 'ITA_OLD' | 'JAV' | 'JPN' | 'KAN' | 'KAT'
|
||||||
|
+ | 'KAT_OLD' | 'KAZ' | 'KHM' | 'KIR' | 'KOR' | 'KUR' | 'LAO' | 'LAT' | 'LAV' | 'LIT'
|
||||||
|
+ | 'MAL' | 'MAR' | 'MKD' | 'MLT' | 'MSA' | 'MYA' | 'NEP' | 'NLD' | 'NOR' | 'ORI'
|
||||||
|
+ | 'PAN' | 'POL' | 'POR' | 'PUS' | 'RON' | 'RUS' | 'SAN' | 'SIN' | 'SLK' | 'SLV'
|
||||||
|
+ | 'SPA' | 'SPA_OLD' | 'SQI' | 'SRP' | 'SRP_LATN' | 'SWA' | 'SWE' | 'SYR' | 'TAM' | 'TEL'
|
||||||
|
+ | 'TGK' | 'TGL' | 'THA' | 'TIR' | 'TUR' | 'UIG' | 'UKR' | 'URD' | 'UZB' | 'UZB_CYRL'
|
||||||
|
+ | 'VIE' | 'YID';
|
||||||
|
+
|
||||||
|
+// Create a mapped type to ensure each key maps to its specific value
|
||||||
|
+type LanguagesMap = {
|
||||||
|
+ [K in LanguageKey]: LanguageCode;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+// Declare the exported constant with the specific type
|
||||||
|
+export const LANGUAGES: LanguagesMap;
|
||||||
|
+
|
||||||
|
+// Export the individual types for use in other modules
|
||||||
|
+export type { LanguageCode, LanguageKey, LanguagesMap };
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/src/index.d.ts b/src/index.d.ts
|
||||||
|
index 1f5a9c8094fe4de7983467f9efb43bdb4de535f2..16dc95cf68663673e37e189b719cb74897b7735f 100644
|
||||||
|
--- a/src/index.d.ts
|
||||||
|
+++ b/src/index.d.ts
|
||||||
|
@@ -1,31 +1,74 @@
|
||||||
|
+// Import the languages types
|
||||||
|
+import { LanguagesMap } from "./constants/languages";
|
||||||
|
+
|
||||||
|
+/// <reference types="node" />
|
||||||
|
+
|
||||||
|
declare namespace Tesseract {
|
||||||
|
- function createScheduler(): Scheduler
|
||||||
|
- function createWorker(langs?: string | string[] | Lang[], oem?: OEM, options?: Partial<WorkerOptions>, config?: string | Partial<InitOptions>): Promise<Worker>
|
||||||
|
- function setLogging(logging: boolean): void
|
||||||
|
- function recognize(image: ImageLike, langs?: string, options?: Partial<WorkerOptions>): Promise<RecognizeResult>
|
||||||
|
- function detect(image: ImageLike, options?: Partial<WorkerOptions>): any
|
||||||
|
+ function createScheduler(): Scheduler;
|
||||||
|
+ function createWorker(
|
||||||
|
+ langs?: LanguageCode | LanguageCode[] | Lang[],
|
||||||
|
+ oem?: OEM,
|
||||||
|
+ options?: Partial<WorkerOptions>,
|
||||||
|
+ config?: string | Partial<InitOptions>
|
||||||
|
+ ): Promise<Worker>;
|
||||||
|
+ function setLogging(logging: boolean): void;
|
||||||
|
+ function recognize(
|
||||||
|
+ image: ImageLike,
|
||||||
|
+ langs?: LanguageCode,
|
||||||
|
+ options?: Partial<WorkerOptions>
|
||||||
|
+ ): Promise<RecognizeResult>;
|
||||||
|
+ function detect(image: ImageLike, options?: Partial<WorkerOptions>): any;
|
||||||
|
+
|
||||||
|
+ // Export languages constant
|
||||||
|
+ const languages: LanguagesMap;
|
||||||
|
+
|
||||||
|
+ type LanguageCode = import("./constants/languages").LanguageCode;
|
||||||
|
+ type LanguageKey = import("./constants/languages").LanguageKey;
|
||||||
|
|
||||||
|
interface Scheduler {
|
||||||
|
- addWorker(worker: Worker): string
|
||||||
|
- addJob(action: 'recognize', ...args: Parameters<Worker['recognize']>): Promise<RecognizeResult>
|
||||||
|
- addJob(action: 'detect', ...args: Parameters<Worker['detect']>): Promise<DetectResult>
|
||||||
|
- terminate(): Promise<any>
|
||||||
|
- getQueueLen(): number
|
||||||
|
- getNumWorkers(): number
|
||||||
|
+ addWorker(worker: Worker): string;
|
||||||
|
+ addJob(
|
||||||
|
+ action: "recognize",
|
||||||
|
+ ...args: Parameters<Worker["recognize"]>
|
||||||
|
+ ): Promise<RecognizeResult>;
|
||||||
|
+ addJob(
|
||||||
|
+ action: "detect",
|
||||||
|
+ ...args: Parameters<Worker["detect"]>
|
||||||
|
+ ): Promise<DetectResult>;
|
||||||
|
+ terminate(): Promise<any>;
|
||||||
|
+ getQueueLen(): number;
|
||||||
|
+ getNumWorkers(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Worker {
|
||||||
|
- load(jobId?: string): Promise<ConfigResult>
|
||||||
|
- writeText(path: string, text: string, jobId?: string): Promise<ConfigResult>
|
||||||
|
- readText(path: string, jobId?: string): Promise<ConfigResult>
|
||||||
|
- removeText(path: string, jobId?: string): Promise<ConfigResult>
|
||||||
|
- FS(method: string, args: any[], jobId?: string): Promise<ConfigResult>
|
||||||
|
- reinitialize(langs?: string | Lang[], oem?: OEM, config?: string | Partial<InitOptions>, jobId?: string): Promise<ConfigResult>
|
||||||
|
- setParameters(params: Partial<WorkerParams>, jobId?: string): Promise<ConfigResult>
|
||||||
|
- getImage(type: imageType): string
|
||||||
|
- recognize(image: ImageLike, options?: Partial<RecognizeOptions>, output?: Partial<OutputFormats>, jobId?: string): Promise<RecognizeResult>
|
||||||
|
- detect(image: ImageLike, jobId?: string): Promise<DetectResult>
|
||||||
|
- terminate(jobId?: string): Promise<ConfigResult>
|
||||||
|
+ load(jobId?: string): Promise<ConfigResult>;
|
||||||
|
+ writeText(
|
||||||
|
+ path: string,
|
||||||
|
+ text: string,
|
||||||
|
+ jobId?: string
|
||||||
|
+ ): Promise<ConfigResult>;
|
||||||
|
+ readText(path: string, jobId?: string): Promise<ConfigResult>;
|
||||||
|
+ removeText(path: string, jobId?: string): Promise<ConfigResult>;
|
||||||
|
+ FS(method: string, args: any[], jobId?: string): Promise<ConfigResult>;
|
||||||
|
+ reinitialize(
|
||||||
|
+ langs?: string | Lang[],
|
||||||
|
+ oem?: OEM,
|
||||||
|
+ config?: string | Partial<InitOptions>,
|
||||||
|
+ jobId?: string
|
||||||
|
+ ): Promise<ConfigResult>;
|
||||||
|
+ setParameters(
|
||||||
|
+ params: Partial<WorkerParams>,
|
||||||
|
+ jobId?: string
|
||||||
|
+ ): Promise<ConfigResult>;
|
||||||
|
+ getImage(type: imageType): string;
|
||||||
|
+ recognize(
|
||||||
|
+ image: ImageLike,
|
||||||
|
+ options?: Partial<RecognizeOptions>,
|
||||||
|
+ output?: Partial<OutputFormats>,
|
||||||
|
+ jobId?: string
|
||||||
|
+ ): Promise<RecognizeResult>;
|
||||||
|
+ detect(image: ImageLike, jobId?: string): Promise<DetectResult>;
|
||||||
|
+ terminate(jobId?: string): Promise<ConfigResult>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Lang {
|
||||||
|
@@ -34,43 +77,43 @@ declare namespace Tesseract {
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InitOptions {
|
||||||
|
- load_system_dawg: string
|
||||||
|
- load_freq_dawg: string
|
||||||
|
- load_unambig_dawg: string
|
||||||
|
- load_punc_dawg: string
|
||||||
|
- load_number_dawg: string
|
||||||
|
- load_bigram_dawg: string
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- type LoggerMessage = {
|
||||||
|
- jobId: string
|
||||||
|
- progress: number
|
||||||
|
- status: string
|
||||||
|
- userJobId: string
|
||||||
|
- workerId: string
|
||||||
|
+ load_system_dawg: string;
|
||||||
|
+ load_freq_dawg: string;
|
||||||
|
+ load_unambig_dawg: string;
|
||||||
|
+ load_punc_dawg: string;
|
||||||
|
+ load_number_dawg: string;
|
||||||
|
+ load_bigram_dawg: string;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ type LoggerMessage = {
|
||||||
|
+ jobId: string;
|
||||||
|
+ progress: number;
|
||||||
|
+ status: string;
|
||||||
|
+ userJobId: string;
|
||||||
|
+ workerId: string;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
interface WorkerOptions {
|
||||||
|
- corePath: string
|
||||||
|
- langPath: string
|
||||||
|
- cachePath: string
|
||||||
|
- dataPath: string
|
||||||
|
- workerPath: string
|
||||||
|
- cacheMethod: string
|
||||||
|
- workerBlobURL: boolean
|
||||||
|
- gzip: boolean
|
||||||
|
- legacyLang: boolean
|
||||||
|
- legacyCore: boolean
|
||||||
|
- logger: (arg: LoggerMessage) => void,
|
||||||
|
- errorHandler: (arg: any) => void
|
||||||
|
+ corePath: string;
|
||||||
|
+ langPath: string;
|
||||||
|
+ cachePath: string;
|
||||||
|
+ dataPath: string;
|
||||||
|
+ workerPath: string;
|
||||||
|
+ cacheMethod: string;
|
||||||
|
+ workerBlobURL: boolean;
|
||||||
|
+ gzip: boolean;
|
||||||
|
+ legacyLang: boolean;
|
||||||
|
+ legacyCore: boolean;
|
||||||
|
+ logger: (arg: LoggerMessage) => void;
|
||||||
|
+ errorHandler: (arg: any) => void;
|
||||||
|
}
|
||||||
|
interface WorkerParams {
|
||||||
|
- tessedit_pageseg_mode: PSM
|
||||||
|
- tessedit_char_whitelist: string
|
||||||
|
- tessedit_char_blacklist: string
|
||||||
|
- preserve_interword_spaces: string
|
||||||
|
- user_defined_dpi: string
|
||||||
|
- [propName: string]: any
|
||||||
|
+ tessedit_pageseg_mode: PSM;
|
||||||
|
+ tessedit_char_whitelist: string;
|
||||||
|
+ tessedit_char_blacklist: string;
|
||||||
|
+ preserve_interword_spaces: string;
|
||||||
|
+ user_defined_dpi: string;
|
||||||
|
+ [propName: string]: any;
|
||||||
|
}
|
||||||
|
interface OutputFormats {
|
||||||
|
text: boolean;
|
||||||
|
@@ -88,36 +131,36 @@ declare namespace Tesseract {
|
||||||
|
debug: boolean;
|
||||||
|
}
|
||||||
|
interface RecognizeOptions {
|
||||||
|
- rectangle: Rectangle
|
||||||
|
- pdfTitle: string
|
||||||
|
- pdfTextOnly: boolean
|
||||||
|
- rotateAuto: boolean
|
||||||
|
- rotateRadians: number
|
||||||
|
+ rectangle: Rectangle;
|
||||||
|
+ pdfTitle: string;
|
||||||
|
+ pdfTextOnly: boolean;
|
||||||
|
+ rotateAuto: boolean;
|
||||||
|
+ rotateRadians: number;
|
||||||
|
}
|
||||||
|
interface ConfigResult {
|
||||||
|
- jobId: string
|
||||||
|
- data: any
|
||||||
|
+ jobId: string;
|
||||||
|
+ data: any;
|
||||||
|
}
|
||||||
|
interface RecognizeResult {
|
||||||
|
- jobId: string
|
||||||
|
- data: Page
|
||||||
|
+ jobId: string;
|
||||||
|
+ data: Page;
|
||||||
|
}
|
||||||
|
interface DetectResult {
|
||||||
|
- jobId: string
|
||||||
|
- data: DetectData
|
||||||
|
+ jobId: string;
|
||||||
|
+ data: DetectData;
|
||||||
|
}
|
||||||
|
interface DetectData {
|
||||||
|
- tesseract_script_id: number | null
|
||||||
|
- script: string | null
|
||||||
|
- script_confidence: number | null
|
||||||
|
- orientation_degrees: number | null
|
||||||
|
- orientation_confidence: number | null
|
||||||
|
+ tesseract_script_id: number | null;
|
||||||
|
+ script: string | null;
|
||||||
|
+ script_confidence: number | null;
|
||||||
|
+ orientation_degrees: number | null;
|
||||||
|
+ orientation_confidence: number | null;
|
||||||
|
}
|
||||||
|
interface Rectangle {
|
||||||
|
- left: number
|
||||||
|
- top: number
|
||||||
|
- width: number
|
||||||
|
- height: number
|
||||||
|
+ left: number;
|
||||||
|
+ top: number;
|
||||||
|
+ width: number;
|
||||||
|
+ height: number;
|
||||||
|
}
|
||||||
|
enum OEM {
|
||||||
|
TESSERACT_ONLY,
|
||||||
|
@@ -126,28 +169,36 @@ declare namespace Tesseract {
|
||||||
|
DEFAULT,
|
||||||
|
}
|
||||||
|
enum PSM {
|
||||||
|
- OSD_ONLY = '0',
|
||||||
|
- AUTO_OSD = '1',
|
||||||
|
- AUTO_ONLY = '2',
|
||||||
|
- AUTO = '3',
|
||||||
|
- SINGLE_COLUMN = '4',
|
||||||
|
- SINGLE_BLOCK_VERT_TEXT = '5',
|
||||||
|
- SINGLE_BLOCK = '6',
|
||||||
|
- SINGLE_LINE = '7',
|
||||||
|
- SINGLE_WORD = '8',
|
||||||
|
- CIRCLE_WORD = '9',
|
||||||
|
- SINGLE_CHAR = '10',
|
||||||
|
- SPARSE_TEXT = '11',
|
||||||
|
- SPARSE_TEXT_OSD = '12',
|
||||||
|
- RAW_LINE = '13'
|
||||||
|
+ OSD_ONLY = "0",
|
||||||
|
+ AUTO_OSD = "1",
|
||||||
|
+ AUTO_ONLY = "2",
|
||||||
|
+ AUTO = "3",
|
||||||
|
+ SINGLE_COLUMN = "4",
|
||||||
|
+ SINGLE_BLOCK_VERT_TEXT = "5",
|
||||||
|
+ SINGLE_BLOCK = "6",
|
||||||
|
+ SINGLE_LINE = "7",
|
||||||
|
+ SINGLE_WORD = "8",
|
||||||
|
+ CIRCLE_WORD = "9",
|
||||||
|
+ SINGLE_CHAR = "10",
|
||||||
|
+ SPARSE_TEXT = "11",
|
||||||
|
+ SPARSE_TEXT_OSD = "12",
|
||||||
|
+ RAW_LINE = "13",
|
||||||
|
}
|
||||||
|
const enum imageType {
|
||||||
|
COLOR = 0,
|
||||||
|
GREY = 1,
|
||||||
|
- BINARY = 2
|
||||||
|
+ BINARY = 2,
|
||||||
|
}
|
||||||
|
- type ImageLike = string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
|
||||||
|
- | CanvasRenderingContext2D | File | Blob | Buffer | OffscreenCanvas;
|
||||||
|
+ type ImageLike =
|
||||||
|
+ | string
|
||||||
|
+ | HTMLImageElement
|
||||||
|
+ | HTMLCanvasElement
|
||||||
|
+ | HTMLVideoElement
|
||||||
|
+ | CanvasRenderingContext2D
|
||||||
|
+ | File
|
||||||
|
+ | Blob
|
||||||
|
+ | (typeof Buffer extends undefined ? never : Buffer)
|
||||||
|
+ | OffscreenCanvas;
|
||||||
|
interface Block {
|
||||||
|
paragraphs: Paragraph[];
|
||||||
|
text: string;
|
||||||
|
@@ -179,7 +230,7 @@ declare namespace Tesseract {
|
||||||
|
text: string;
|
||||||
|
confidence: number;
|
||||||
|
baseline: Baseline;
|
||||||
|
- rowAttributes: RowAttributes
|
||||||
|
+ rowAttributes: RowAttributes;
|
||||||
|
bbox: Bbox;
|
||||||
|
}
|
||||||
|
interface Paragraph {
|
||||||
934
.yarn/releases/yarn-4.6.0.cjs
vendored
934
.yarn/releases/yarn-4.6.0.cjs
vendored
File diff suppressed because one or more lines are too long
948
.yarn/releases/yarn-4.9.1.cjs
vendored
Executable file
948
.yarn/releases/yarn-4.9.1.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -4,4 +4,6 @@ httpTimeout: 300000
|
|||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-4.6.0.cjs
|
yarnPath: .yarn/releases/yarn-4.9.1.cjs
|
||||||
|
npmRegistryServer: https://registry.npmjs.org
|
||||||
|
npmPublishRegistry: https://registry.npmjs.org
|
||||||
|
|||||||
51
CLAUDE.md
Normal file
51
CLAUDE.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# AI Assistant Guide
|
||||||
|
|
||||||
|
This file provides guidance to AI coding assistants when working with code in this repository. Adherence to these guidelines is crucial for maintaining code quality and consistency.
|
||||||
|
|
||||||
|
## Guiding Principles (MUST FOLLOW)
|
||||||
|
|
||||||
|
- **Keep it clear**: Write code that is easy to read, maintain, and explain.
|
||||||
|
- **Match the house style**: Reuse existing patterns, naming, and conventions.
|
||||||
|
- **Search smart**: Prefer `ast-grep` for semantic queries; fall back to `rg`/`grep` when needed.
|
||||||
|
- **Build with HeroUI**: Use HeroUI for every new UI component; never add `antd` or `styled-components`.
|
||||||
|
- **Log centrally**: Route all logging through `loggerService` with the right context—no `console.log`.
|
||||||
|
- **Research via subagent**: Lean on `subagent` for external docs, APIs, news, and references.
|
||||||
|
- **Seek review**: Ask a human developer to review substantial changes before merging.
|
||||||
|
- **Commit in rhythm**: Keep commits small, conventional, and emoji-tagged.
|
||||||
|
|
||||||
|
## Development Commands
|
||||||
|
|
||||||
|
- **Install**: `yarn install` - Install all project dependencies
|
||||||
|
- **Development**: `yarn dev` - Runs Electron app in development mode with hot reload
|
||||||
|
- **Debug**: `yarn debug` - Starts with debugging enabled, use `chrome://inspect` to attach debugger
|
||||||
|
- **Build Check**: `yarn build:check` - **REQUIRED** before commits (lint + test + typecheck)
|
||||||
|
- If having i18n sort issues, run `yarn sync:i18n` first to sync template
|
||||||
|
- If having formatting issues, run `yarn format` first
|
||||||
|
- **Test**: `yarn test` - Run all tests (Vitest) across main and renderer processes
|
||||||
|
- **Single Test**:
|
||||||
|
- `yarn test:main` - Run tests for main process only
|
||||||
|
- `yarn test:renderer` - Run tests for renderer process only
|
||||||
|
- **Lint**: `yarn lint` - Fix linting issues and run TypeScript type checking
|
||||||
|
- **Format**: `yarn format` - Auto-format code using Biome
|
||||||
|
|
||||||
|
## Project Architecture
|
||||||
|
|
||||||
|
### Electron Structure
|
||||||
|
- **Main Process** (`src/main/`): Node.js backend with services (MCP, Knowledge, Storage, etc.)
|
||||||
|
- **Renderer Process** (`src/renderer/`): React UI with Redux state management
|
||||||
|
- **Preload Scripts** (`src/preload/`): Secure IPC bridge
|
||||||
|
|
||||||
|
### Key Components
|
||||||
|
- **AI Core** (`src/renderer/src/aiCore/`): Middleware pipeline for multiple AI providers.
|
||||||
|
- **Services** (`src/main/services/`): MCPService, KnowledgeService, WindowService, etc.
|
||||||
|
- **Build System**: Electron-Vite with experimental rolldown-vite, yarn workspaces.
|
||||||
|
- **State Management**: Redux Toolkit (`src/renderer/src/store/`) for predictable state.
|
||||||
|
- **UI Components**: HeroUI (`@heroui/*`) for all new UI elements.
|
||||||
|
|
||||||
|
### Logging
|
||||||
|
```typescript
|
||||||
|
import { loggerService } from '@logger'
|
||||||
|
const logger = loggerService.withContext('moduleName')
|
||||||
|
// Renderer: loggerService.initWindowSource('windowName') first
|
||||||
|
logger.info('message', CONTEXT)
|
||||||
|
```
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[中文](./docs/CONTRIBUTING.zh.md) | [English](./CONTRIBUTING.md)
|
[中文](docs/CONTRIBUTING.zh.md) | [English](CONTRIBUTING.md)
|
||||||
|
|
||||||
# Cherry Studio Contributor Guide
|
# Cherry Studio Contributor Guide
|
||||||
|
|
||||||
@@ -58,6 +58,10 @@ git commit --signoff -m "Your commit message"
|
|||||||
|
|
||||||
Maintainers are here to help you implement your use case within a reasonable timeframe. They will do their best to review your code and provide constructive feedback promptly. However, if you get stuck during the review process or feel your Pull Request is not receiving the attention it deserves, please contact us via comments in the Issue or through the [Community](README.md#-community).
|
Maintainers are here to help you implement your use case within a reasonable timeframe. They will do their best to review your code and provide constructive feedback promptly. However, if you get stuck during the review process or feel your Pull Request is not receiving the attention it deserves, please contact us via comments in the Issue or through the [Community](README.md#-community).
|
||||||
|
|
||||||
|
### Participating in the Test Plan
|
||||||
|
|
||||||
|
The Test Plan aims to provide users with a more stable application experience and faster iteration speed. For details, please refer to the [Test Plan](docs/testplan-en.md).
|
||||||
|
|
||||||
### Other Suggestions
|
### Other Suggestions
|
||||||
|
|
||||||
- **Contact Developers**: Before submitting a PR, you can contact the developers first to discuss or get help.
|
- **Contact Developers**: Before submitting a PR, you can contact the developers first to discuss or get help.
|
||||||
|
|||||||
45
LICENSE
45
LICENSE
@@ -1,48 +1,3 @@
|
|||||||
**许可协议 (Licensing)**
|
|
||||||
|
|
||||||
本项目采用**区分用户的双重许可 (User-Segmented Dual Licensing)** 模式。
|
|
||||||
|
|
||||||
**核心原则:**
|
|
||||||
|
|
||||||
* **个人用户 和 10人及以下企业/组织:** 默认适用 **GNU Affero 通用公共许可证 v3.0 (AGPLv3)**。
|
|
||||||
* **超过10人的企业/组织:** **必须** 获取 **商业许可证 (Commercial License)**。
|
|
||||||
|
|
||||||
定义:“10人及以下”
|
|
||||||
指在您的组织(包括公司、非营利组织、政府机构、教育机构等任何实体)中,能够访问、使用或以任何方式直接或间接受益于本软件(Cherry Studio)功能的个人总数不超过10人。这包括但不限于开发者、测试人员、运营人员、最终用户、通过集成系统间接使用者等。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**1. 开源许可证 (Open Source License): AGPLv3 - 适用于个人及10人及以下组织**
|
|
||||||
|
|
||||||
* 如果您是个人用户,或者您的组织满足上述“10人及以下”的定义,您可以在 **AGPLv3** 的条款下自由使用、修改和分发 Cherry Studio。AGPLv3 的完整文本可以访问 [https://www.gnu.org/licenses/agpl-3.0.html](https://www.gnu.org/licenses/agpl-3.0.html) 获取。
|
|
||||||
* **核心义务:** AGPLv3 的一个关键要求是,如果您修改了 Cherry Studio 并通过网络提供服务,或者分发了修改后的版本,您必须以 AGPLv3 许可证向接收者提供相应的**完整源代码**。即使您符合“10人及以下”的标准,如果您希望避免此源代码公开义务,您也需要考虑获取商业许可证(见下文)。
|
|
||||||
* 使用前请务必仔细阅读并理解 AGPLv3 的所有条款。
|
|
||||||
|
|
||||||
**2. 商业许可证 (Commercial License) - 适用于超过10人的组织,或希望规避 AGPLv3 义务的用户**
|
|
||||||
|
|
||||||
* **强制要求:** 如果您的组织**不**满足上述“10人及以下”的定义(即有11人或更多人可以访问、使用或受益于本软件),您**必须**联系我们获取并签署一份商业许可证才能使用 Cherry Studio。
|
|
||||||
* **自愿选择:** 即使您的组织满足“10人及以下”的条件,但如果您的使用场景**无法满足 AGPLv3 的条款要求**(特别是关于**源代码公开**的义务),或者您需要 AGPLv3 **未提供**的特定商业条款(如保证、赔偿、无 Copyleft 限制等),您也**必须**联系我们获取并签署一份商业许可证。
|
|
||||||
* **需要商业许可证的常见情况包括(但不限于):**
|
|
||||||
* 您的组织规模超过10人。
|
|
||||||
* (无论组织规模)您希望分发修改过的 Cherry Studio 版本,但**不希望**根据 AGPLv3 公开您修改部分的源代码。
|
|
||||||
* (无论组织规模)您希望基于修改过的 Cherry Studio 提供网络服务(SaaS),但**不希望**根据 AGPLv3 向服务使用者提供修改后的源代码。
|
|
||||||
* (无论组织规模)您的公司政策、客户合同或项目要求不允许使用 AGPLv3 许可的软件,或要求闭源分发及保密。
|
|
||||||
* 商业许可证将为您提供豁免 AGPLv3 义务(如源代码公开)的权利,并可能包含额外的商业保障条款。
|
|
||||||
* **获取商业许可:** 请通过邮箱 **bd@cherry-ai.com** 联系 Cherry Studio 开发团队洽谈商业授权事宜。
|
|
||||||
|
|
||||||
**3. 贡献 (Contributions)**
|
|
||||||
|
|
||||||
* 我们欢迎社区对 Cherry Studio 的贡献。所有向本项目提交的贡献都将被视为在 **AGPLv3** 许可证下提供。
|
|
||||||
* 通过向本项目提交贡献(例如通过 Pull Request),即表示您同意您的代码以 AGPLv3 许可证授权给本项目及所有后续使用者(无论这些使用者最终遵循 AGPLv3 还是商业许可)。
|
|
||||||
* 您也理解并同意,您的贡献可能会被包含在根据商业许可证分发的 Cherry Studio 版本中。
|
|
||||||
|
|
||||||
**4. 其他条款 (Other Terms)**
|
|
||||||
|
|
||||||
* 关于商业许可证的具体条款和条件,以双方签署的正式商业许可协议为准。
|
|
||||||
* 项目维护者保留根据需要更新本许可政策(包括用户规模定义和阈值)的权利。相关更新将通过项目官方渠道(如代码仓库、官方网站)进行通知。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Licensing**
|
**Licensing**
|
||||||
|
|
||||||
This project employs a **User-Segmented Dual Licensing** model.
|
This project employs a **User-Segmented Dual Licensing** model.
|
||||||
|
|||||||
269
README.md
269
README.md
@@ -1,38 +1,88 @@
|
|||||||
|
<div align="right" >
|
||||||
|
<details>
|
||||||
|
<summary >🌐 Language</summary>
|
||||||
|
<div>
|
||||||
|
<div align="right">
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=en">English</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=zh-CN">简体中文</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=zh-TW">繁體中文</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ja">日本語</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ko">한국어</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=hi">हिन्दी</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=th">ไทย</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=fr">Français</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=de">Deutsch</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=es">Español</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=it">Italiano</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ru">Русский</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=pt">Português</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=nl">Nederlands</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=pl">Polski</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ar">العربية</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=fa">فارسی</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=tr">Türkçe</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=vi">Tiếng Việt</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=id">Bahasa Indonesia</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
<a href="https://github.com/CherryHQ/cherry-studio/releases">
|
<a href="https://github.com/CherryHQ/cherry-studio/releases">
|
||||||
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" /><br>
|
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" /><br>
|
||||||
</a>
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
<p align="center">English | <a href="./docs/README.zh.md">中文</a> | <a href="./docs/README.ja.md">日本語</a><br></p>
|
|
||||||
|
<p align="center">English | <a href="./docs/README.zh.md">中文</a> | <a href="https://cherry-ai.com">Official Site</a> | <a href="https://docs.cherry-ai.com/cherry-studio-wen-dang/en-us">Documents</a> | <a href="./docs/dev.md">Development</a> | <a href="https://github.com/CherryHQ/cherry-studio/issues">Feedback</a><br></p>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://trendshift.io/repositories/11772" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
||||||
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry-studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry Studio - AI Chatbots, AI Desktop Client | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
[![][deepwiki-shield]][deepwiki-link]
|
||||||
|
[![][twitter-shield]][twitter-link]
|
||||||
|
[![][discord-shield]][discord-link]
|
||||||
|
[![][telegram-shield]][telegram-link]
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
[![][github-release-shield]][github-release-link]
|
||||||
|
[![][github-nightly-shield]][github-nightly-link]
|
||||||
|
[![][github-contributors-shield]][github-contributors-link]
|
||||||
|
[![][license-shield]][license-link]
|
||||||
|
[![][commercial-shield]][commercial-link]
|
||||||
|
[![][sponsor-shield]][sponsor-link]
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<a href="https://hellogithub.com/repository/1605492e1e2a4df3be07abfa4578dd37" target="_blank" style="text-decoration: none"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=1605492e1e2a4df3be07abfa4578dd37" alt="Featured|HelloGitHub" width="220" height="55" /></a>
|
||||||
|
<a href="https://trendshift.io/repositories/14318" target="_blank" style="text-decoration: none"><img src="https://trendshift.io/api/badge/repositories/14318" alt="CherryHQ%2Fcherry-studio | Trendshift" width="220" height="55" /></a>
|
||||||
|
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry-studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry Studio - AI Chatbots, AI Desktop Client | Product Hunt" width="220" height="55" /></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
# 🍒 Cherry Studio
|
# 🍒 Cherry Studio
|
||||||
|
|
||||||
Cherry Studio is a desktop client that supports for multiple LLM providers, available on Windows, Mac and Linux.
|
Cherry Studio is a desktop client that supports multiple LLM providers, available on Windows, Mac and Linux.
|
||||||
|
|
||||||
👏 Join [Telegram Group](https://t.me/CherryStudioAI)|[Discord](https://discord.gg/wez8HtpxqQ) | [QQ Group(575014769)](https://qm.qq.com/q/lo0D4qVZKi)
|
👏 Join [Telegram Group](https://t.me/CherryStudioAI)|[Discord](https://discord.gg/wez8HtpxqQ) | [QQ Group(575014769)](https://qm.qq.com/q/lo0D4qVZKi)
|
||||||
|
|
||||||
❤️ Like Cherry Studio? Give it a star 🌟 or [Sponsor](docs/sponsor.md) to support the development!
|
❤️ Like Cherry Studio? Give it a star 🌟 or [Sponsor](docs/sponsor.md) to support the development!
|
||||||
|
|
||||||
# 📖 Guide
|
|
||||||
|
|
||||||
<https://docs.cherry-ai.com>
|
|
||||||
|
|
||||||
# 🌠 Screenshot
|
# 🌠 Screenshot
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# 🌟 Key Features
|
# 🌟 Key Features
|
||||||
|
|
||||||
1. **Diverse LLM Provider Support**:
|
1. **Diverse LLM Provider Support**:
|
||||||
|
|
||||||
- ☁️ Major LLM Cloud Services: OpenAI, Gemini, Anthropic, and more
|
- ☁️ Major LLM Cloud Services: OpenAI, Gemini, Anthropic, and more
|
||||||
- 🔗 AI Web Service Integration: Claude, Peplexity, Poe, and others
|
- 🔗 AI Web Service Integration: Claude, Perplexity, Poe, and others
|
||||||
- 💻 Local Model Support with Ollama, LM Studio
|
- 💻 Local Model Support with Ollama, LM Studio
|
||||||
|
|
||||||
2. **AI Assistants & Conversations**:
|
2. **AI Assistants & Conversations**:
|
||||||
@@ -43,7 +93,7 @@ Cherry Studio is a desktop client that supports for multiple LLM providers, avai
|
|||||||
|
|
||||||
3. **Document & Data Processing**:
|
3. **Document & Data Processing**:
|
||||||
|
|
||||||
- 📄 Support for Text, Images, Office, PDF, and more
|
- 📄 Supports Text, Images, Office, PDF, and more
|
||||||
- ☁️ WebDAV File Management and Backup
|
- ☁️ WebDAV File Management and Backup
|
||||||
- 📊 Mermaid Chart Visualization
|
- 📊 Mermaid Chart Visualization
|
||||||
- 💻 Code Syntax Highlighting
|
- 💻 Code Syntax Highlighting
|
||||||
@@ -60,25 +110,47 @@ Cherry Studio is a desktop client that supports for multiple LLM providers, avai
|
|||||||
5. **Enhanced User Experience**:
|
5. **Enhanced User Experience**:
|
||||||
|
|
||||||
- 🖥️ Cross-platform Support for Windows, Mac, and Linux
|
- 🖥️ Cross-platform Support for Windows, Mac, and Linux
|
||||||
- 📦 Ready to Use, No Environment Setup Required
|
- 📦 Ready to Use - No Environment Setup Required
|
||||||
- 🎨 Light/Dark Themes and Transparent Window
|
- 🎨 Light/Dark Themes and Transparent Window
|
||||||
- 📝 Complete Markdown Rendering
|
- 📝 Complete Markdown Rendering
|
||||||
- 🤲 Easy Content Sharing
|
- 🤲 Easy Content Sharing
|
||||||
|
|
||||||
# 📝 TODO
|
# 📝 Roadmap
|
||||||
|
|
||||||
- [x] Quick popup (read clipboard, quick question, explain, translate, summarize)
|
We're actively working on the following features and improvements:
|
||||||
- [x] Comparison of multi-model answers
|
|
||||||
- [x] Support login using SSO provided by service providers
|
1. 🎯 **Core Features**
|
||||||
- [x] All models support networking
|
|
||||||
- [x] Launch of the first official version
|
- Selection Assistant with smart content selection enhancement
|
||||||
- [x] Bug fixes and improvements (In progress...)
|
- Deep Research with advanced research capabilities
|
||||||
- [ ] Plugin functionality (JavaScript)
|
- Memory System with global context awareness
|
||||||
- [ ] Browser extension (highlight text to translate, summarize, add to knowledge base)
|
- Document Preprocessing with improved document handling
|
||||||
- [ ] iOS & Android client
|
- MCP Marketplace for Model Context Protocol ecosystem
|
||||||
- [ ] AI notes
|
|
||||||
- [ ] Voice input and output (AI call)
|
2. 🗂 **Knowledge Management**
|
||||||
- [ ] Data backup supports custom backup content
|
|
||||||
|
- Notes and Collections
|
||||||
|
- Dynamic Canvas visualization
|
||||||
|
- OCR capabilities
|
||||||
|
- TTS (Text-to-Speech) support
|
||||||
|
|
||||||
|
3. 📱 **Platform Support**
|
||||||
|
|
||||||
|
- HarmonyOS Edition (PC)
|
||||||
|
- Android App (Phase 1)
|
||||||
|
- iOS App (Phase 1)
|
||||||
|
- Multi-Window support
|
||||||
|
- Window Pinning functionality
|
||||||
|
|
||||||
|
4. 🔌 **Advanced Features**
|
||||||
|
|
||||||
|
- Plugin System
|
||||||
|
- ASR (Automatic Speech Recognition)
|
||||||
|
- Assistant and Topic Interaction Refactoring
|
||||||
|
|
||||||
|
Track our progress and contribute on our [project board](https://github.com/orgs/CherryHQ/projects/7).
|
||||||
|
|
||||||
|
Want to influence our roadmap? Join our [GitHub Discussions](https://github.com/CherryHQ/cherry-studio/discussions) to share your ideas and feedback!
|
||||||
|
|
||||||
# 🌈 Theme
|
# 🌈 Theme
|
||||||
|
|
||||||
@@ -90,14 +162,6 @@ Cherry Studio is a desktop client that supports for multiple LLM providers, avai
|
|||||||
|
|
||||||
Welcome PR for more themes
|
Welcome PR for more themes
|
||||||
|
|
||||||
# 🖥️ Develop
|
|
||||||
|
|
||||||
Refer to the [development documentation](docs/dev.md)
|
|
||||||
|
|
||||||
Refer to the [Architecture overview documentation](https://deepwiki.com/CherryHQ/cherry-studio)
|
|
||||||
|
|
||||||
Refer to the [Branching Strategy](docs/branching-strategy-en.md) for contribution guidelines
|
|
||||||
|
|
||||||
# 🤝 Contributing
|
# 🤝 Contributing
|
||||||
|
|
||||||
We welcome contributions to Cherry Studio! Here are some ways you can contribute:
|
We welcome contributions to Cherry Studio! Here are some ways you can contribute:
|
||||||
@@ -110,6 +174,8 @@ We welcome contributions to Cherry Studio! Here are some ways you can contribute
|
|||||||
6. **Community Engagement**: Join discussions and help users.
|
6. **Community Engagement**: Join discussions and help users.
|
||||||
7. **Promote Usage**: Spread the word about Cherry Studio.
|
7. **Promote Usage**: Spread the word about Cherry Studio.
|
||||||
|
|
||||||
|
Refer to the [Branching Strategy](docs/branching-strategy-en.md) for contribution guidelines
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
1. **Fork the Repository**: Fork and clone it to your local machine.
|
1. **Fork the Repository**: Fork and clone it to your local machine.
|
||||||
@@ -117,15 +183,87 @@ We welcome contributions to Cherry Studio! Here are some ways you can contribute
|
|||||||
3. **Submit Changes**: Commit and push your changes.
|
3. **Submit Changes**: Commit and push your changes.
|
||||||
4. **Open a Pull Request**: Describe your changes and reasons.
|
4. **Open a Pull Request**: Describe your changes and reasons.
|
||||||
|
|
||||||
For more detailed guidelines, please refer to our [Contributing Guide](./CONTRIBUTING.md).
|
For more detailed guidelines, please refer to our [Contributing Guide](CONTRIBUTING.md).
|
||||||
|
|
||||||
Thank you for your support and contributions!
|
Thank you for your support and contributions!
|
||||||
|
|
||||||
## Related Projects
|
# 🔧 Developer Co-creation Program
|
||||||
|
|
||||||
- [one-api](https://github.com/songquanpeng/one-api):LLM API management and distribution system, supporting mainstream models like OpenAI, Azure, and Anthropic. Features unified API interface, suitable for key management and secondary distribution.
|
We are launching the Cherry Studio Developer Co-creation Program to foster a healthy and positive-feedback loop within the open-source ecosystem. We believe that great software is built collaboratively, and every merged pull request breathes new life into the project.
|
||||||
|
|
||||||
- [ublacklist](https://github.com/iorate/ublacklist):Blocks specific sites from appearing in Google search results
|
We sincerely invite you to join our ranks of contributors and shape the future of Cherry Studio with us.
|
||||||
|
|
||||||
|
## Contributor Rewards Program
|
||||||
|
|
||||||
|
To give back to our core contributors and create a virtuous cycle, we have established the following long-term incentive plan.
|
||||||
|
|
||||||
|
**The inaugural tracking period for this program will be Q3 2025 (July, August, September). Rewards for this cycle will be distributed on October 1st.**
|
||||||
|
|
||||||
|
Within any tracking period (e.g., July 1st to September 30th for the first cycle), any developer who contributes more than **30 meaningful commits** to any of Cherry Studio's open-source projects on GitHub will be eligible for the following benefits:
|
||||||
|
|
||||||
|
- **Cursor Subscription Sponsorship**: Receive a **$70 USD** credit or reimbursement for your [Cursor](https://cursor.sh/) subscription, making AI your most efficient coding partner.
|
||||||
|
- **Unlimited Model Access**: Get **unlimited** API calls for the **DeepSeek** and **Qwen** models.
|
||||||
|
- **Cutting-Edge Tech Access**: Enjoy occasional perks, including API access to models like **Claude**, **Gemini**, and **OpenAI**, keeping you at the forefront of technology.
|
||||||
|
|
||||||
|
## Growing Together & Future Plans
|
||||||
|
|
||||||
|
A vibrant community is the driving force behind any sustainable open-source project. As Cherry Studio grows, so will our rewards program. We are committed to continuously aligning our benefits with the best-in-class tools and resources in the industry. This ensures our core contributors receive meaningful support, creating a positive cycle where developers, the community, and the project grow together.
|
||||||
|
|
||||||
|
**Moving forward, the project will also embrace an increasingly open stance to give back to the entire open-source community.**
|
||||||
|
|
||||||
|
## How to Get Started?
|
||||||
|
|
||||||
|
We look forward to your first Pull Request!
|
||||||
|
|
||||||
|
You can start by exploring our repositories, picking up a `good first issue`, or proposing your own enhancements. Every commit is a testament to the spirit of open source.
|
||||||
|
|
||||||
|
Thank you for your interest and contributions.
|
||||||
|
|
||||||
|
Let's build together.
|
||||||
|
|
||||||
|
# 🏢 Enterprise Edition
|
||||||
|
|
||||||
|
Building on the Community Edition, we are proud to introduce **Cherry Studio Enterprise Edition**—a privately-deployable AI productivity and management platform designed for modern teams and enterprises.
|
||||||
|
|
||||||
|
The Enterprise Edition addresses core challenges in team collaboration by centralizing the management of AI resources, knowledge, and data. It empowers organizations to enhance efficiency, foster innovation, and ensure compliance, all while maintaining 100% control over their data in a secure environment.
|
||||||
|
|
||||||
|
## Core Advantages
|
||||||
|
|
||||||
|
- **Unified Model Management**: Centrally integrate and manage various cloud-based LLMs (e.g., OpenAI, Anthropic, Google Gemini) and locally deployed private models. Employees can use them out-of-the-box without individual configuration.
|
||||||
|
- **Enterprise-Grade Knowledge Base**: Build, manage, and share team-wide knowledge bases. Ensures knowledge retention and consistency, enabling team members to interact with AI based on unified and accurate information.
|
||||||
|
- **Fine-Grained Access Control**: Easily manage employee accounts and assign role-based permissions for different models, knowledge bases, and features through a unified admin backend.
|
||||||
|
- **Fully Private Deployment**: Deploy the entire backend service on your on-premises servers or private cloud, ensuring your data remains 100% private and under your control to meet the strictest security and compliance standards.
|
||||||
|
- **Reliable Backend Services**: Provides stable API services and enterprise-grade data backup and recovery mechanisms to ensure business continuity.
|
||||||
|
|
||||||
|
## ✨ Online Demo
|
||||||
|
|
||||||
|
> 🚧 **Public Beta Notice**
|
||||||
|
>
|
||||||
|
> The Enterprise Edition is currently in its early public beta stage, and we are actively iterating and optimizing its features. We are aware that it may not be perfectly stable yet. If you encounter any issues or have valuable suggestions during your trial, we would be very grateful if you could contact us via email to provide feedback.
|
||||||
|
|
||||||
|
**🔗 [Cherry Studio Enterprise](https://www.cherry-ai.com/enterprise)**
|
||||||
|
|
||||||
|
## Version Comparison
|
||||||
|
|
||||||
|
| Feature | Community Edition | Enterprise Edition |
|
||||||
|
| :---------------- | :----------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| **Open Source** | ✅ Yes | ⭕️ Partially released to customers |
|
||||||
|
| **Cost** | Free for Personal Use / Commercial License | Buyout / Subscription Fee |
|
||||||
|
| **Admin Backend** | — | ● Centralized **Model** Access<br>● **Employee** Management<br>● Shared **Knowledge Base**<br>● **Access** Control<br>● **Data** Backup |
|
||||||
|
| **Server** | — | ✅ Dedicated Private Deployment |
|
||||||
|
|
||||||
|
## Get the Enterprise Edition
|
||||||
|
|
||||||
|
We believe the Enterprise Edition will become your team's AI productivity engine. If you are interested in Cherry Studio Enterprise Edition and would like to learn more, request a quote, or schedule a demo, please feel free to contact us.
|
||||||
|
|
||||||
|
- **For Business Inquiries & Purchasing**:
|
||||||
|
**📧 [bd@cherry-ai.com](mailto:bd@cherry-ai.com)**
|
||||||
|
|
||||||
|
# 🔗 Related Projects
|
||||||
|
|
||||||
|
- [one-api](https://github.com/songquanpeng/one-api): LLM API management and distribution system supporting mainstream models like OpenAI, Azure, and Anthropic. Features a unified API interface, suitable for key management and secondary distribution.
|
||||||
|
|
||||||
|
- [ublacklist](https://github.com/iorate/ublacklist): Blocks specific sites from appearing in Google search results
|
||||||
|
|
||||||
# 🚀 Contributors
|
# 🚀 Contributors
|
||||||
|
|
||||||
@@ -134,22 +272,45 @@ Thank you for your support and contributions!
|
|||||||
</a>
|
</a>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
# 🌐 Community
|
# 📊 GitHub Stats
|
||||||
|
|
||||||
[Telegram](https://t.me/CherryStudioAI) | [Email](mailto:support@cherry-ai.com) | [Twitter](https://x.com/kangfenmao)
|

|
||||||
|
|
||||||
# ☕ Sponsor
|
|
||||||
|
|
||||||
[Buy Me a Coffee](docs/sponsor.md)
|
|
||||||
|
|
||||||
# 📃 License
|
|
||||||
|
|
||||||
[LICENSE](./LICENSE)
|
|
||||||
|
|
||||||
# ✉️ Contact
|
|
||||||
|
|
||||||
<yinsenho@cherry-ai.com>
|
|
||||||
|
|
||||||
# ⭐️ Star History
|
# ⭐️ Star History
|
||||||
|
|
||||||
[](https://star-history.com/#kangfenmao/cherry-studio&Timeline)
|
<a href="https://www.star-history.com/#CherryHQ/cherry-studio&Date">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Links & Images -->
|
||||||
|
|
||||||
|
[deepwiki-shield]: https://img.shields.io/badge/Deepwiki-CherryHQ-0088CC?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNy45MyAzMiI+PHBhdGggZD0iTTE5LjMzIDE0LjEyYy42Ny0uMzkgMS41LS4zOSAyLjE4IDBsMS43NCAxYy4wNi4wMy4xMS4wNi4xOC4wN2guMDRjLjA2LjAzLjEyLjAzLjE4LjAzaC4wMmMuMDYgMCAuMTEgMCAuMTctLjAyaC4wM2MuMDYtLjAyLjEyLS4wNS4xNy0uMDhoLjAybDMuNDgtMi4wMWMuMjUtLjE0LjQtLjQxLjQtLjdWOC40YS44MS44MSAwIDAgMC0uNC0uN2wtMy40OC0yLjAxYS44My44MyAwIDAgMC0uODEgMEwxOS43NyA3LjdoLS4wMWwtLjE1LjEyLS4wMi4wMnMtLjA3LjA5LS4xLjE0VjhhLjQuNCAwIDAgMC0uMDguMTd2LjA0Yy0uMDMuMDYtLjAzLjEyLS4wMy4xOXYyLjAxYzAgLjc4LS40MSAxLjQ5LTEuMDkgMS44OC0uNjcuMzktMS41LjM5LTIuMTggMGwtMS43NC0xYS42LjYgMCAwIDAtLjIxLS4wOGMtLjA2LS4wMS0uMTItLjAyLS4xOC0uMDJoLS4wM2MtLjA2IDAtLjExLjAxLS4xNy4wMmgtLjAzYy0uMDYuMDItLjEyLjA0LS4xNy4wN2gtLjAybC0zLjQ3IDIuMDFjLS4yNS4xNC0uNC40MS0uNC43VjE4YzAgLjI5LjE1LjU1LjQuN2wzLjQ4IDIuMDFoLjAyYy4wNi4wNC4xMS4wNi4xNy4wOGguMDNjLjA1LjAyLjExLjAzLjE3LjAzaC4wMmMuMDYgMCAuMTIgMCAuMTgtLjAyaC4wNGMuMDYtLjAzLjEyLS4wNS4xOC0uMDhsMS43NC0xYy42Ny0uMzkgMS41LS4zOSAyLjE3IDBzMS4wOSAxLjExIDEuMDkgMS44OHYyLjAxYzAgLjA3IDAgLjEzLjAyLjE5di4wNGMuMDMuMDYuMDUuMTIuMDguMTd2LjAycy4wOC4wOS4xMi4xM2wuMDIuMDJzLjA5LjA4LjE1LjExYzAgMCAuMDEgMCAuMDEuMDFsMy40OCAyLjAxYy4yNS4xNC41Ni4xNC44MSAwbDMuNDgtMi4wMWMuMjUtLjE0LjQtLjQxLjQtLjd2LTQuMDFhLjgxLjgxIDAgMCAwLS40LS43bC0zLjQ4LTIuMDFoLS4wMmMtLjA1LS4wNC0uMTEtLjA2LS4xNy0uMDhoLS4wM2EuNS41IDAgMCAwLS4xNy0uMDNoLS4wM2MtLjA2IDAtLjEyIDAtLjE4LjAyLS4wNy4wMi0uMTUuMDUtLjIxLjA4bC0xLjc0IDFjLS42Ny4zOS0xLjUuMzktMi4xNyAwYTIuMTkgMi4xOSAwIDAgMS0xLjA5LTEuODhjMC0uNzguNDItMS40OSAxLjA5LTEuODhaIiBzdHlsZT0iZmlsbDojNWRiZjlkIi8+PHBhdGggZD0ibS40IDEzLjExIDMuNDcgMi4wMWMuMjUuMTQuNTYuMTQuOCAwbDMuNDctMi4wMWguMDFsLjE1LS4xMi4wMi0uMDJzLjA3LS4wOS4xLS4xNGwuMDItLjAyYy4wMy0uMDUuMDUtLjExLjA3LS4xN3YtLjA0Yy4wMy0uMDYuMDMtLjEyLjAzLS4xOVYxMC40YzAtLjc4LjQyLTEuNDkgMS4wOS0xLjg4czEuNS0uMzkgMi4xOCAwbDEuNzQgMWMuMDcuMDQuMTQuMDcuMjEuMDguMDYuMDEuMTIuMDIuMTguMDJoLjAzYy4wNiAwIC4xMS0uMDEuMTctLjAyaC4wM2MuMDYtLjAyLjEyLS4wNC4xNy0uMDdoLjAybDMuNDctMi4wMmMuMjUtLjE0LjQtLjQxLjQtLjd2LTRhLjgxLjgxIDAgMCAwLS40LS43bC0zLjQ2LTJhLjgzLjgzIDAgMCAwLS44MSAwbC0zLjQ4IDIuMDFoLS4wMWwtLjE1LjEyLS4wMi4wMi0uMS4xMy0uMDIuMDJjLS4wMy4wNS0uMDUuMTEtLjA3LjE3di4wNGMtLjAzLjA2LS4wMy4xMi0uMDMuMTl2Mi4wMWMwIC43OC0uNDIgMS40OS0xLjA5IDEuODhzLTEuNS4zOS0yLjE4IDBsLTEuNzQtMWEuNi42IDAgMCAwLS4yMS0uMDhjLS4wNi0uMDEtLjEyLS4wMi0uMTgtLjAyaC0uMDNjLS4wNiAwLS4xMS4wMS0uMTcuMDJoLS4wM2MtLjA2LjAyLS4xMi4wNS0uMTcuMDhoLS4wMkwuNCA3LjcxYy0uMjUuMTQtLjQuNDEtLjQuNjl2NC4wMWMwIC4yOS4xNS41Ni40LjciIHN0eWxlPSJmaWxsOiM0NDY4YzQiLz48cGF0aCBkPSJtMTcuODQgMjQuNDgtMy40OC0yLjAxaC0uMDJjLS4wNS0uMDQtLjExLS4wNi0uMTctLjA4aC0uMDNhLjUuNSAwIDAgMC0uMTctLjAzaC0uMDNjLS4wNiAwLS4xMiAwLS4xOC4wMmgtLjA0Yy0uMDYuMDMtLjEyLjA1LS4xOC4wOGwtMS43NCAxYy0uNjcuMzktMS41LjM5LTIuMTggMGEyLjE5IDIuMTkgMCAwIDEtMS4wOS0xLjg4di0yLjAxYzAtLjA2IDAtLjEzLS4wMi0uMTl2LS4wNGMtLjAzLS4wNi0uMDUtLjExLS4wOC0uMTdsLS4wMi0uMDJzLS4wNi0uMDktLjEtLjEzTDguMjkgMTlzLS4wOS0uMDgtLjE1LS4xMWgtLjAxbC0zLjQ3LTIuMDJhLjgzLjgzIDAgMCAwLS44MSAwTC4zNyAxOC44OGEuODcuODcgMCAwIDAtLjM3LjcxdjQuMDFjMCAuMjkuMTUuNTUuNC43bDMuNDcgMi4wMWguMDJjLjA1LjA0LjExLjA2LjE3LjA4aC4wM2MuMDUuMDIuMTEuMDMuMTYuMDNoLjAzYy4wNiAwIC4xMiAwIC4xOC0uMDJoLjA0Yy4wNi0uMDMuMTItLjA1LjE4LS4wOGwxLjc0LTFjLjY3LS4zOSAxLjUtLjM5IDIuMTcgMHMxLjA5IDEuMTEgMS4wOSAxLjg4djIuMDFjMCAuMDcgMCAuMTMuMDIuMTl2LjA0Yy4wMy4wNi4wNS4xMS4wOC4xN2wuMDIuMDJzLjA2LjA5LjEuMTRsLjAyLjAycy4wOS4wOC4xNS4xMWguMDFsMy40OCAyLjAyYy4yNS4xNC41Ni4xNC44MSAwbDMuNDgtMi4wMWMuMjUtLjE0LjQtLjQxLjQtLjdWMjUuMmEuODEuODEgMCAwIDAtLjQtLjdaIiBzdHlsZT0iZmlsbDojNDI5M2Q5Ii8+PC9zdmc+
|
||||||
|
[deepwiki-link]: https://deepwiki.com/CherryHQ/cherry-studio
|
||||||
|
[twitter-shield]: https://img.shields.io/badge/Twitter-CherryStudioApp-0088CC?logo=x
|
||||||
|
[twitter-link]: https://twitter.com/CherryStudioHQ
|
||||||
|
[discord-shield]: https://img.shields.io/badge/Discord-@CherryStudio-0088CC?logo=discord
|
||||||
|
[discord-link]: https://discord.gg/wez8HtpxqQ
|
||||||
|
[telegram-shield]: https://img.shields.io/badge/Telegram-@CherryStudioAI-0088CC?logo=telegram
|
||||||
|
[telegram-link]: https://t.me/CherryStudioAI
|
||||||
|
|
||||||
|
<!-- Links & Images -->
|
||||||
|
|
||||||
|
[github-release-shield]: https://img.shields.io/github/v/release/CherryHQ/cherry-studio?logo=github
|
||||||
|
[github-release-link]: https://github.com/CherryHQ/cherry-studio/releases
|
||||||
|
[github-nightly-shield]: https://img.shields.io/github/actions/workflow/status/CherryHQ/cherry-studio/nightly-build.yml?label=nightly%20build&logo=github
|
||||||
|
[github-nightly-link]: https://github.com/CherryHQ/cherry-studio/actions/workflows/nightly-build.yml
|
||||||
|
[github-contributors-shield]: https://img.shields.io/github/contributors/CherryHQ/cherry-studio?logo=github
|
||||||
|
[github-contributors-link]: https://github.com/CherryHQ/cherry-studio/graphs/contributors
|
||||||
|
|
||||||
|
<!-- Links & Images -->
|
||||||
|
|
||||||
|
[license-shield]: https://img.shields.io/badge/License-AGPLv3-important.svg?logo=gnu
|
||||||
|
[license-link]: https://www.gnu.org/licenses/agpl-3.0
|
||||||
|
[commercial-shield]: https://img.shields.io/badge/License-Contact-white.svg?logoColor=white&logo=telegram&color=blue
|
||||||
|
[commercial-link]: mailto:license@cherry-ai.com?subject=Commercial%20License%20Inquiry
|
||||||
|
[sponsor-shield]: https://img.shields.io/badge/Sponsor-FF6699.svg?logo=githubsponsors&logoColor=white
|
||||||
|
[sponsor-link]: https://github.com/CherryHQ/cherry-studio/blob/main/docs/sponsor.md
|
||||||
|
|||||||
64
SECURITY.md
Normal file
64
SECURITY.md
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## 📢 Reporting a Vulnerability
|
||||||
|
|
||||||
|
At Cherry Studio, we take security seriously and appreciate your efforts to responsibly disclose vulnerabilities. If you discover a security issue, please report it as soon as possible.
|
||||||
|
|
||||||
|
**Please do not create public issues for security-related reports.**
|
||||||
|
|
||||||
|
- To report a security issue, please use the GitHub Security Advisories tab to "[Open a draft security advisory](https://github.com/CherryHQ/cherry-studio/security/advisories/new)".
|
||||||
|
- Include a detailed description of the issue, steps to reproduce, potential impact, and any possible mitigations.
|
||||||
|
- If applicable, please also attach proof-of-concept code or screenshots.
|
||||||
|
|
||||||
|
We will acknowledge your report within **72 hours** and provide a status update as we investigate.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔒 Supported Versions
|
||||||
|
|
||||||
|
We aim to support the latest released version and one previous minor release.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| --------------- | ---------------- |
|
||||||
|
| Latest (`main`) | ✅ Supported |
|
||||||
|
| Previous minor | ✅ Supported |
|
||||||
|
| Older versions | ❌ Not supported |
|
||||||
|
|
||||||
|
If you are using an unsupported version, we strongly recommend updating to the latest release to receive security fixes.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💡 Security Measures
|
||||||
|
|
||||||
|
Cherry Studio integrates several security best practices, including:
|
||||||
|
|
||||||
|
- Strict dependency updates and regular vulnerability scanning.
|
||||||
|
- TypeScript strict mode and linting to reduce potential injection or runtime issues.
|
||||||
|
- Enforced code formatting and pre-commit hooks.
|
||||||
|
- Internal security reviews before releases.
|
||||||
|
- Dedicated MCP (Model Context Protocol) safeguards for model interactions and data privacy.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛡️ Disclosure Policy
|
||||||
|
|
||||||
|
- We follow a **coordinated disclosure** approach.
|
||||||
|
- We will not publicly disclose vulnerabilities until a fix has been developed and released.
|
||||||
|
- Credit will be given to researchers who responsibly disclose vulnerabilities, if requested.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🤝 Acknowledgements
|
||||||
|
|
||||||
|
We greatly appreciate contributions from the security community and strive to recognize all researchers who help keep Cherry Studio safe.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🌟 Questions?
|
||||||
|
|
||||||
|
For any security-related questions not involving vulnerabilities, please reach out to:
|
||||||
|
**security@cherry-ai.com**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Thank you for helping keep Cherry Studio and its users secure!
|
||||||
97
biome.jsonc
Normal file
97
biome.jsonc
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
|
||||||
|
"assist": {
|
||||||
|
// to sort json
|
||||||
|
"actions": {
|
||||||
|
"source": {
|
||||||
|
"organizeImports": "on",
|
||||||
|
"useSortedKeys": {
|
||||||
|
"level": "on",
|
||||||
|
"options": {
|
||||||
|
"sortOrder": "lexicographic"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enabled": true,
|
||||||
|
"includes": ["**/*.json", "!*.json", "!**/package.json"]
|
||||||
|
},
|
||||||
|
"css": {
|
||||||
|
"formatter": {
|
||||||
|
"quoteStyle": "single"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": { "ignoreUnknown": false },
|
||||||
|
"formatter": {
|
||||||
|
"attributePosition": "auto",
|
||||||
|
"bracketSameLine": false,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"enabled": true,
|
||||||
|
"expand": "auto",
|
||||||
|
"formatWithErrors": true,
|
||||||
|
"includes": [
|
||||||
|
"**",
|
||||||
|
"!out/**",
|
||||||
|
"!**/dist/**",
|
||||||
|
"!build/**",
|
||||||
|
"!.yarn/**",
|
||||||
|
"!.github/**",
|
||||||
|
"!.husky/**",
|
||||||
|
"!.vscode/**",
|
||||||
|
"!*.yaml",
|
||||||
|
"!*.yml",
|
||||||
|
"!*.mjs",
|
||||||
|
"!*.cjs",
|
||||||
|
"!*.md",
|
||||||
|
"!*.json",
|
||||||
|
"!src/main/integration/**",
|
||||||
|
"!**/tailwind.css",
|
||||||
|
"!**/package.json"
|
||||||
|
],
|
||||||
|
"indentStyle": "space",
|
||||||
|
"indentWidth": 2,
|
||||||
|
"lineEnding": "lf",
|
||||||
|
"lineWidth": 120,
|
||||||
|
"useEditorconfig": true
|
||||||
|
},
|
||||||
|
"html": { "formatter": { "selfCloseVoidElements": "always" } },
|
||||||
|
"javascript": {
|
||||||
|
"formatter": {
|
||||||
|
"arrowParentheses": "always",
|
||||||
|
"attributePosition": "auto",
|
||||||
|
// To minimize changes in this PR as much as possible, it's set to true. However, setting it to false would make it more convenient to add attributes at the end.
|
||||||
|
"bracketSameLine": true,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"jsxQuoteStyle": "double",
|
||||||
|
"quoteProperties": "asNeeded",
|
||||||
|
"quoteStyle": "single",
|
||||||
|
"semicolons": "asNeeded",
|
||||||
|
"trailingCommas": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"json": {
|
||||||
|
"parser": {
|
||||||
|
"allowComments": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"includes": ["!**/tailwind.css", "src/renderer/**/*.{tsx,ts}"],
|
||||||
|
// only enable sorted tailwind css rule. used as formatter instead of linter
|
||||||
|
"rules": {
|
||||||
|
"nursery": {
|
||||||
|
// to sort tailwind css classes
|
||||||
|
"useSortedClasses": {
|
||||||
|
"fix": "safe",
|
||||||
|
"level": "warn",
|
||||||
|
"options": {
|
||||||
|
"functions": ["cn"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"recommended": false,
|
||||||
|
"suspicious": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vcs": { "clientKind": "git", "enabled": false, "useIgnoreFile": false }
|
||||||
|
}
|
||||||
@@ -8,5 +8,7 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-library-validation</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -8,16 +8,93 @@
|
|||||||
; https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist
|
; https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist
|
||||||
|
|
||||||
!include LogicLib.nsh
|
!include LogicLib.nsh
|
||||||
|
!include x64.nsh
|
||||||
|
|
||||||
; https://github.com/electron-userland/electron-builder/issues/1122
|
; https://github.com/electron-userland/electron-builder/issues/1122
|
||||||
!ifndef BUILD_UNINSTALLER
|
!ifndef BUILD_UNINSTALLER
|
||||||
Function checkVCRedist
|
Function checkVCRedist
|
||||||
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"
|
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
Function checkArchitectureCompatibility
|
||||||
|
; Initialize variables
|
||||||
|
StrCpy $0 "0" ; Default to incompatible
|
||||||
|
StrCpy $1 "" ; System architecture
|
||||||
|
StrCpy $3 "" ; App architecture
|
||||||
|
|
||||||
|
; Check system architecture using built-in NSIS functions
|
||||||
|
${If} ${RunningX64}
|
||||||
|
; Check if it's ARM64 by looking at processor architecture
|
||||||
|
ReadEnvStr $2 "PROCESSOR_ARCHITECTURE"
|
||||||
|
ReadEnvStr $4 "PROCESSOR_ARCHITEW6432"
|
||||||
|
|
||||||
|
${If} $2 == "ARM64"
|
||||||
|
${OrIf} $4 == "ARM64"
|
||||||
|
StrCpy $1 "arm64"
|
||||||
|
${Else}
|
||||||
|
StrCpy $1 "x64"
|
||||||
|
${EndIf}
|
||||||
|
${Else}
|
||||||
|
StrCpy $1 "x86"
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
; Determine app architecture based on build variables
|
||||||
|
!ifdef APP_ARM64_NAME
|
||||||
|
!ifndef APP_64_NAME
|
||||||
|
StrCpy $3 "arm64" ; App is ARM64 only
|
||||||
|
!endif
|
||||||
|
!endif
|
||||||
|
!ifdef APP_64_NAME
|
||||||
|
!ifndef APP_ARM64_NAME
|
||||||
|
StrCpy $3 "x64" ; App is x64 only
|
||||||
|
!endif
|
||||||
|
!endif
|
||||||
|
!ifdef APP_64_NAME
|
||||||
|
!ifdef APP_ARM64_NAME
|
||||||
|
StrCpy $3 "universal" ; Both architectures available
|
||||||
|
!endif
|
||||||
|
!endif
|
||||||
|
|
||||||
|
; If no architecture variables are defined, assume x64
|
||||||
|
${If} $3 == ""
|
||||||
|
StrCpy $3 "x64"
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
; Compare system and app architectures
|
||||||
|
${If} $3 == "universal"
|
||||||
|
; Universal build, compatible with all architectures
|
||||||
|
StrCpy $0 "1"
|
||||||
|
${ElseIf} $1 == $3
|
||||||
|
; Architectures match
|
||||||
|
StrCpy $0 "1"
|
||||||
|
${Else}
|
||||||
|
; Architectures don't match
|
||||||
|
StrCpy $0 "0"
|
||||||
|
${EndIf}
|
||||||
|
FunctionEnd
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!macro customInit
|
!macro customInit
|
||||||
Push $0
|
Push $0
|
||||||
|
Push $1
|
||||||
|
Push $2
|
||||||
|
Push $3
|
||||||
|
Push $4
|
||||||
|
|
||||||
|
; Check architecture compatibility first
|
||||||
|
Call checkArchitectureCompatibility
|
||||||
|
${If} $0 != "1"
|
||||||
|
MessageBox MB_ICONEXCLAMATION "\
|
||||||
|
Architecture Mismatch$\r$\n$\r$\n\
|
||||||
|
This installer is not compatible with your system architecture.$\r$\n\
|
||||||
|
Your system: $1$\r$\n\
|
||||||
|
App architecture: $3$\r$\n$\r$\n\
|
||||||
|
Please download the correct version from:$\r$\n\
|
||||||
|
https://www.cherry-ai.com/"
|
||||||
|
ExecShell "open" "https://www.cherry-ai.com/"
|
||||||
|
Abort
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
Call checkVCRedist
|
Call checkVCRedist
|
||||||
${If} $0 != "1"
|
${If} $0 != "1"
|
||||||
MessageBox MB_YESNO "\
|
MessageBox MB_YESNO "\
|
||||||
@@ -43,5 +120,9 @@
|
|||||||
Abort
|
Abort
|
||||||
${EndIf}
|
${EndIf}
|
||||||
ContinueInstall:
|
ContinueInstall:
|
||||||
|
Pop $4
|
||||||
|
Pop $3
|
||||||
|
Pop $2
|
||||||
|
Pop $1
|
||||||
Pop $0
|
Pop $0
|
||||||
!macroend
|
!macroend
|
||||||
|
|||||||
21
components.json
Normal file
21
components.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://ui.shadcn.com/schema.json",
|
||||||
|
"aliases": {
|
||||||
|
"components": "@renderer/ui/third-party",
|
||||||
|
"hooks": "@renderer/hooks",
|
||||||
|
"lib": "@renderer/lib",
|
||||||
|
"ui": "@renderer/ui",
|
||||||
|
"utils": "@renderer/utils"
|
||||||
|
},
|
||||||
|
"iconLibrary": "lucide",
|
||||||
|
"rsc": false,
|
||||||
|
"style": "new-york",
|
||||||
|
"tailwind": {
|
||||||
|
"baseColor": "zinc",
|
||||||
|
"config": "",
|
||||||
|
"css": "src/renderer/src/assets/styles/tailwind.css",
|
||||||
|
"cssVariables": true,
|
||||||
|
"prefix": ""
|
||||||
|
},
|
||||||
|
"tsx": true
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Cherry Studio 贡献者指南
|
# Cherry Studio 贡献者指南
|
||||||
|
|
||||||
[**English**](../CONTRIBUTING.md) | [**中文**](./CONTRIBUTING.zh.md)
|
[**English**](../CONTRIBUTING.md) | [**中文**](CONTRIBUTING.zh.md)
|
||||||
|
|
||||||
欢迎来到 Cherry Studio 的贡献者社区!我们致力于将 Cherry Studio 打造成一个长期提供价值的项目,并希望邀请更多的开发者加入我们的行列。无论您是经验丰富的开发者还是刚刚起步的初学者,您的贡献都将帮助我们更好地服务用户,提升软件质量。
|
欢迎来到 Cherry Studio 的贡献者社区!我们致力于将 Cherry Studio 打造成一个长期提供价值的项目,并希望邀请更多的开发者加入我们的行列。无论您是经验丰富的开发者还是刚刚起步的初学者,您的贡献都将帮助我们更好地服务用户,提升软件质量。
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
## 开始之前
|
## 开始之前
|
||||||
|
|
||||||
请确保阅读了[行为准则](CODE_OF_CONDUCT.md)和[LICENSE](LICENSE)。
|
请确保阅读了[行为准则](../CODE_OF_CONDUCT.md)和[LICENSE](../LICENSE)。
|
||||||
|
|
||||||
## 开始贡献
|
## 开始贡献
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
### 测试
|
### 测试
|
||||||
|
|
||||||
未经测试的功能等同于不存在。为确保代码真正有效,应通过单元测试和功能测试覆盖相关流程。因此,在考虑贡献时,也请考虑可测试性。所有测试均可本地运行,无需依赖 CI。请参阅[开发者指南](docs/dev.md#test)中的“Test”部分。
|
未经测试的功能等同于不存在。为确保代码真正有效,应通过单元测试和功能测试覆盖相关流程。因此,在考虑贡献时,也请考虑可测试性。所有测试均可本地运行,无需依赖 CI。请参阅[开发者指南](dev.md#test)中的“Test”部分。
|
||||||
|
|
||||||
### 拉取请求的自动化测试
|
### 拉取请求的自动化测试
|
||||||
|
|
||||||
@@ -60,7 +60,11 @@ git commit --signoff -m "Your commit message"
|
|||||||
|
|
||||||
### 获取代码审查/合并
|
### 获取代码审查/合并
|
||||||
|
|
||||||
维护者在此帮助您在合理时间内实现您的用例。他们会尽力在合理时间内审查您的代码并提供建设性反馈。但如果您在审查过程中受阻,或认为您的 Pull Request 未得到应有的关注,请通过 Issue 中的评论或者[社群](README.md#-community)联系我们
|
维护者在此帮助您在合理时间内实现您的用例。他们会尽力在合理时间内审查您的代码并提供建设性反馈。但如果您在审查过程中受阻,或认为您的 Pull Request 未得到应有的关注,请通过 Issue 中的评论或者[社群](README.zh.md#-community)联系我们
|
||||||
|
|
||||||
|
### 参与测试计划
|
||||||
|
|
||||||
|
测试计划旨在为用户提供更稳定的应用体验和更快的迭代速度,详细情况请参阅[测试计划](testplan-zh.md)。
|
||||||
|
|
||||||
### 其他建议
|
### 其他建议
|
||||||
|
|
||||||
|
|||||||
@@ -1,158 +0,0 @@
|
|||||||
<h1 align="center">
|
|
||||||
<a href="https://github.com/CherryHQ/cherry-studio/releases">
|
|
||||||
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" />
|
|
||||||
</a>
|
|
||||||
</h1>
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://github.com/CherryHQ/cherry-studio">English</a> | <a href="./README.zh.md">中文</a> | 日本語 <br>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
<a href="https://trendshift.io/repositories/11772" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
||||||
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry-studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry Studio - AI Chatbots, AI Desktop Client | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
# 🍒 Cherry Studio
|
|
||||||
|
|
||||||
Cherry Studio は、複数の LLM プロバイダーをサポートするデスクトップクライアントで、Windows、Mac、Linux で利用可能です。
|
|
||||||
|
|
||||||
👏 [Telegram](https://t.me/CherryStudioAI)|[Discord](https://discord.gg/wez8HtpxqQ) | [QQグループ(575014769)](https://qm.qq.com/q/lo0D4qVZKi)
|
|
||||||
|
|
||||||
❤️ Cherry Studio をお気に入りにしましたか?小さな星をつけてください 🌟 または [スポンサー](sponsor.md) をして開発をサポートしてください!
|
|
||||||
|
|
||||||
# 📖 ガイド
|
|
||||||
|
|
||||||
https://docs.cherry-ai.com
|
|
||||||
|
|
||||||
# 🌠 スクリーンショット
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
# 🌟 主な機能
|
|
||||||
|
|
||||||
1. **多様な LLM サービス対応**:
|
|
||||||
|
|
||||||
- ☁️ 主要な LLM クラウドサービス対応:OpenAI、Gemini、Anthropic など
|
|
||||||
- 🔗 AI Web サービス統合:Claude、Peplexity、Poe など
|
|
||||||
- 💻 Ollama、LM Studio によるローカルモデル実行対応
|
|
||||||
|
|
||||||
2. **AI アシスタントと対話**:
|
|
||||||
|
|
||||||
- 📚 300+ の事前設定済み AI アシスタント
|
|
||||||
- 🤖 カスタム AI アシスタントの作成
|
|
||||||
- 💬 複数モデルでの同時対話機能
|
|
||||||
|
|
||||||
3. **文書とデータ処理**:
|
|
||||||
|
|
||||||
- 📄 テキスト、画像、Office、PDF など多様な形式対応
|
|
||||||
- ☁️ WebDAV によるファイル管理とバックアップ
|
|
||||||
- 📊 Mermaid による図表作成
|
|
||||||
- 💻 コードハイライト機能
|
|
||||||
|
|
||||||
4. **実用的なツール統合**:
|
|
||||||
|
|
||||||
- 🔍 グローバル検索機能
|
|
||||||
- 📝 トピック管理システム
|
|
||||||
- 🔤 AI による翻訳機能
|
|
||||||
- 🎯 ドラッグ&ドロップによる整理
|
|
||||||
- 🔌 ミニプログラム対応
|
|
||||||
- ⚙️ MCP(モデルコンテキストプロトコル)サービス
|
|
||||||
|
|
||||||
5. **優れたユーザー体験**:
|
|
||||||
|
|
||||||
- 🖥️ Windows、Mac、Linux のクロスプラットフォーム対応
|
|
||||||
- 📦 環境構築不要ですぐに使用可能
|
|
||||||
- 🎨 ライト/ダークテーマと透明ウィンドウ対応
|
|
||||||
- 📝 完全な Markdown レンダリング
|
|
||||||
- 🤲 簡単な共有機能
|
|
||||||
|
|
||||||
# 📝 TODO
|
|
||||||
|
|
||||||
- [x] クイックポップアップ(クリップボードの読み取り、簡単な質問、説明、翻訳、要約)
|
|
||||||
- [x] 複数モデルの回答の比較
|
|
||||||
- [x] サービスプロバイダーが提供する SSO を使用したログイン対応
|
|
||||||
- [x] すべてのモデルのネットワーク対応
|
|
||||||
- [x] 最初の公式バージョンのリリース
|
|
||||||
- [x] バグ修正と改善(進行中...)
|
|
||||||
- [ ] プラグイン機能(JavaScript)
|
|
||||||
- [ ] ブラウザ拡張機能(テキストをハイライトして翻訳、要約、ナレッジベースに追加)
|
|
||||||
- [ ] iOS & Android クライアント
|
|
||||||
- [ ] AI ノート
|
|
||||||
- [ ] 音声入出力(AI コール)
|
|
||||||
- [ ] データバックアップのカスタマイズ対応
|
|
||||||
|
|
||||||
# 🌈 テーマ
|
|
||||||
|
|
||||||
- テーマギャラリー:https://cherrycss.com
|
|
||||||
- Aero テーマ:https://github.com/hakadao/CherryStudio-Aero
|
|
||||||
- PaperMaterial テーマ:https://github.com/rainoffallingstar/CherryStudio-PaperMaterial
|
|
||||||
- Claude テーマ:https://github.com/bjl101501/CherryStudio-Claudestyle-dynamic
|
|
||||||
- メープルネオンテーマ:https://github.com/BoningtonChen/CherryStudio_themes
|
|
||||||
|
|
||||||
より多くのテーマの PR を歓迎します
|
|
||||||
|
|
||||||
# 🖥️ 開発
|
|
||||||
|
|
||||||
[開発ドキュメント](dev.md)を参照してください
|
|
||||||
|
|
||||||
[アーキテクチャ概要ドキュメント](https://deepwiki.com/CherryHQ/cherry-studio)を参照してください
|
|
||||||
|
|
||||||
[ブランチ戦略](branching-strategy-en.md)を参照して貢献ガイドラインを確認してください
|
|
||||||
|
|
||||||
# 🤝 貢献
|
|
||||||
|
|
||||||
Cherry Studio への貢献を歓迎します!以下の方法で貢献できます:
|
|
||||||
|
|
||||||
1. **コードの貢献**:新機能を開発するか、既存のコードを最適化します
|
|
||||||
2. **バグの修正**:見つけたバグを修正します
|
|
||||||
3. **問題の管理**:GitHub の問題を管理するのを手伝います
|
|
||||||
4. **製品デザイン**:デザインの議論に参加します
|
|
||||||
5. **ドキュメントの作成**:ユーザーマニュアルやガイドを改善します
|
|
||||||
6. **コミュニティの参加**:ディスカッションに参加し、ユーザーを支援します
|
|
||||||
7. **使用の促進**:Cherry Studio を広めます
|
|
||||||
|
|
||||||
## 始め方
|
|
||||||
|
|
||||||
1. **リポジトリをフォーク**:フォークしてローカルマシンにクローンします
|
|
||||||
2. **ブランチを作成**:変更のためのブランチを作成します
|
|
||||||
3. **変更を提出**:変更をコミットしてプッシュします
|
|
||||||
4. **プルリクエストを開く**:変更内容と理由を説明します
|
|
||||||
|
|
||||||
詳細なガイドラインについては、[貢献ガイド](../CONTRIBUTING.md)をご覧ください。
|
|
||||||
|
|
||||||
ご支援と貢献に感謝します!
|
|
||||||
|
|
||||||
## 関連プロジェクト
|
|
||||||
|
|
||||||
- [one-api](https://github.com/songquanpeng/one-api):LLM API の管理・配信システム。OpenAI、Azure、Anthropic などの主要モデルに対応し、統一 API インターフェースを提供。API キー管理と再配布に利用可能。
|
|
||||||
|
|
||||||
- [ublacklist](https://github.com/iorate/ublacklist):Google 検索結果から特定のサイトを非表示にします
|
|
||||||
|
|
||||||
# 🚀 コントリビューター
|
|
||||||
|
|
||||||
<a href="https://github.com/CherryHQ/cherry-studio/graphs/contributors">
|
|
||||||
<img src="https://contrib.rocks/image?repo=CherryHQ/cherry-studio" />
|
|
||||||
</a>
|
|
||||||
<br /><br />
|
|
||||||
|
|
||||||
# 🌐 コミュニティ
|
|
||||||
|
|
||||||
[Telegram](https://t.me/CherryStudioAI) | [Email](mailto:support@cherry-ai.com) | [Twitter](https://x.com/kangfenmao)
|
|
||||||
|
|
||||||
# ☕ スポンサー
|
|
||||||
|
|
||||||
[開発者を支援する](sponsor.md)
|
|
||||||
|
|
||||||
# 📃 ライセンス
|
|
||||||
|
|
||||||
[LICENSE](../LICENSE)
|
|
||||||
|
|
||||||
# ✉️ お問い合わせ
|
|
||||||
|
|
||||||
yinsenho@cherry-ai.com
|
|
||||||
|
|
||||||
# ⭐️ スター履歴
|
|
||||||
|
|
||||||
[](https://star-history.com/#kangfenmao/cherry-studio&Timeline)
|
|
||||||
@@ -1,14 +1,67 @@
|
|||||||
|
<div align="right" >
|
||||||
|
<details>
|
||||||
|
<summary >🌐 Language</summary>
|
||||||
|
<div>
|
||||||
|
<div align="right">
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=en">English</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=zh-CN">简体中文</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=zh-TW">繁體中文</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ja">日本語</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ko">한국어</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=hi">हिन्दी</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=th">ไทย</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=fr">Français</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=de">Deutsch</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=es">Español</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=it">Italiano</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ru">Русский</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=pt">Português</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=nl">Nederlands</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=pl">Polski</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ar">العربية</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=fa">فارسی</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=tr">Türkçe</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=vi">Tiếng Việt</a></p>
|
||||||
|
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=id">Bahasa Indonesia</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
<a href="https://github.com/CherryHQ/cherry-studio/releases">
|
<a href="https://github.com/CherryHQ/cherry-studio/releases">
|
||||||
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" />
|
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" /><br>
|
||||||
</a>
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/CherryHQ/cherry-studio">English</a> | 中文 | <a href="./README.ja.md">日本語</a><br>
|
<a href="https://github.com/CherryHQ/cherry-studio">English</a> | 中文 | <a href="https://cherry-ai.com">官方网站</a> | <a href="https://docs.cherry-ai.com/cherry-studio-wen-dang/zh-cn">文档</a> | <a href="./dev.md">开发</a> | <a href="https://github.com/CherryHQ/cherry-studio/issues">反馈</a><br>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<!-- 题头徽章组合 -->
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://trendshift.io/repositories/11772" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
||||||
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry-studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry Studio - AI Chatbots, AI Desktop Client | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
[![][deepwiki-shield]][deepwiki-link]
|
||||||
|
[![][twitter-shield]][twitter-link]
|
||||||
|
[![][discord-shield]][discord-link]
|
||||||
|
[![][telegram-shield]][telegram-link]
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
[![][github-release-shield]][github-release-link]
|
||||||
|
[![][github-contributors-shield]][github-contributors-link]
|
||||||
|
[![][license-shield]][license-link]
|
||||||
|
[![][commercial-shield]][commercial-link]
|
||||||
|
[![][sponsor-shield]][sponsor-link]
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<a href="https://hellogithub.com/repository/1605492e1e2a4df3be07abfa4578dd37" target="_blank" style="text-decoration: none"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=1605492e1e2a4df3be07abfa4578dd37" alt="Featured|HelloGitHub" width="220" height="55" /></a>
|
||||||
|
<a href="https://trendshift.io/repositories/11772" target="_blank" style="text-decoration: none"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" width="220" height="55" /></a>
|
||||||
|
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry-studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry Studio - AI Chatbots, AI Desktop Client | Product Hunt" width="220" height="55" /></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
# 🍒 Cherry Studio
|
# 🍒 Cherry Studio
|
||||||
@@ -19,30 +72,24 @@ Cherry Studio 是一款支持多个大语言模型(LLM)服务商的桌面客
|
|||||||
|
|
||||||
❤️ 喜欢 Cherry Studio? 点亮小星星 🌟 或 [赞助开发者](sponsor.md)! ❤️
|
❤️ 喜欢 Cherry Studio? 点亮小星星 🌟 或 [赞助开发者](sponsor.md)! ❤️
|
||||||
|
|
||||||
# GitCode✖️Cherry Studio【新源力】贡献挑战赛
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://gitcode.com/CherryHQ/cherry-studio/discussion/2">
|
|
||||||
<img src="https://raw.gitcode.com/user-images/assets/5007375/8d8d7559-1141-4691-b90f-d154558c6896/cherry-studio-gitcode.jpg" width="100%" alt="banner" />
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# 📖 使用教程
|
# 📖 使用教程
|
||||||
|
|
||||||
https://docs.cherry-ai.com
|
https://docs.cherry-ai.com
|
||||||
|
|
||||||
# 🌠 界面
|
# 🌠 界面
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# 🌟 主要特性
|
# 🌟 主要特性
|
||||||
|
|
||||||
1. **多样化 LLM 服务支持**:
|
1. **多样化 LLM 服务支持**:
|
||||||
|
|
||||||
- ☁️ 支持主流 LLM 云服务:OpenAI、Gemini、Anthropic、硅基流动等
|
- ☁️ 支持主流 LLM 云服务:OpenAI、Gemini、Anthropic、硅基流动等
|
||||||
- 🔗 集成流行 AI Web 服务:Claude、Peplexity、Poe、腾讯元宝、知乎直答等
|
- 🔗 集成流行 AI Web 服务:Claude、Perplexity、Poe、腾讯元宝、知乎直答等
|
||||||
- 💻 支持 Ollama、LM Studio 本地模型部署
|
- 💻 支持 Ollama、LM Studio 本地模型部署
|
||||||
|
|
||||||
2. **智能助手与对话**:
|
2. **智能助手与对话**:
|
||||||
@@ -75,20 +122,42 @@ https://docs.cherry-ai.com
|
|||||||
- 📝 完整的 Markdown 渲染
|
- 📝 完整的 Markdown 渲染
|
||||||
- 🤲 便捷的内容分享功能
|
- 🤲 便捷的内容分享功能
|
||||||
|
|
||||||
# 📝 待办事项
|
# 📝 开发计划
|
||||||
|
|
||||||
- [x] 快捷弹窗(读取剪贴板、快速提问、解释、翻译、总结)
|
我们正在积极开发以下功能和改进:
|
||||||
- [x] 多模型回答对比
|
|
||||||
- [x] 支持使用服务供应商提供的 SSO 进行登录
|
1. 🎯 **核心功能**
|
||||||
- [x] 所有模型支持联网
|
|
||||||
- [x] 推出第一个正式版
|
- 选择助手 - 智能内容选择增强
|
||||||
- [x] 错误修复和改进(开发中...)
|
- 深度研究 - 高级研究能力
|
||||||
- [ ] 插件功能(JavaScript)
|
- 全局记忆 - 全局上下文感知
|
||||||
- [ ] 浏览器插件(划词翻译、总结、新增至知识库)
|
- 文档预处理 - 改进文档处理能力
|
||||||
- [ ] iOS & Android 客户端
|
- MCP 市场 - 模型上下文协议生态系统
|
||||||
- [ ] AI 笔记
|
|
||||||
- [ ] 语音输入输出(AI 通话)
|
2. 🗂 **知识管理**
|
||||||
- [ ] 数据备份支持自定义备份内容
|
|
||||||
|
- 笔记与收藏功能
|
||||||
|
- 动态画布可视化
|
||||||
|
- OCR 光学字符识别
|
||||||
|
- TTS 文本转语音支持
|
||||||
|
|
||||||
|
3. 📱 **平台支持**
|
||||||
|
|
||||||
|
- 鸿蒙版本 (PC)
|
||||||
|
- Android 应用(第一期)
|
||||||
|
- iOS 应用(第一期)
|
||||||
|
- 多窗口支持
|
||||||
|
- 窗口置顶功能
|
||||||
|
|
||||||
|
4. 🔌 **高级特性**
|
||||||
|
|
||||||
|
- 插件系统
|
||||||
|
- ASR 语音识别
|
||||||
|
- 助手与话题交互重构
|
||||||
|
|
||||||
|
在我们的[项目面板](https://github.com/orgs/CherryHQ/projects/7)上跟踪进展并参与贡献。
|
||||||
|
|
||||||
|
想要影响开发计划?欢迎加入我们的 [GitHub 讨论区](https://github.com/CherryHQ/cherry-studio/discussions) 分享您的想法和反馈!
|
||||||
|
|
||||||
# 🌈 主题
|
# 🌈 主题
|
||||||
|
|
||||||
@@ -100,14 +169,6 @@ https://docs.cherry-ai.com
|
|||||||
|
|
||||||
欢迎 PR 更多主题
|
欢迎 PR 更多主题
|
||||||
|
|
||||||
# 🖥️ 开发
|
|
||||||
|
|
||||||
参考[开发文档](dev.md)
|
|
||||||
|
|
||||||
参考[架构概览文档](https://deepwiki.com/CherryHQ/cherry-studio)
|
|
||||||
|
|
||||||
参考[分支策略](branching-strategy-zh.md)了解贡献指南
|
|
||||||
|
|
||||||
# 🤝 贡献
|
# 🤝 贡献
|
||||||
|
|
||||||
我们欢迎对 Cherry Studio 的贡献!您可以通过以下方式贡献:
|
我们欢迎对 Cherry Studio 的贡献!您可以通过以下方式贡献:
|
||||||
@@ -120,6 +181,8 @@ https://docs.cherry-ai.com
|
|||||||
6. **社区参与**:加入讨论并帮助用户
|
6. **社区参与**:加入讨论并帮助用户
|
||||||
7. **推广使用**:宣传 Cherry Studio
|
7. **推广使用**:宣传 Cherry Studio
|
||||||
|
|
||||||
|
参考[分支策略](branching-strategy-zh.md)了解贡献指南
|
||||||
|
|
||||||
## 入门
|
## 入门
|
||||||
|
|
||||||
1. **Fork 仓库**:Fork 并克隆到您的本地机器
|
1. **Fork 仓库**:Fork 并克隆到您的本地机器
|
||||||
@@ -127,11 +190,83 @@ https://docs.cherry-ai.com
|
|||||||
3. **提交更改**:提交并推送您的更改
|
3. **提交更改**:提交并推送您的更改
|
||||||
4. **打开 Pull Request**:描述您的更改和原因
|
4. **打开 Pull Request**:描述您的更改和原因
|
||||||
|
|
||||||
有关更详细的指南,请参阅我们的 [贡献指南](./CONTRIBUTING.zh.md)
|
有关更详细的指南,请参阅我们的 [贡献指南](CONTRIBUTING.zh.md)
|
||||||
|
|
||||||
感谢您的支持和贡献!
|
感谢您的支持和贡献!
|
||||||
|
|
||||||
## 相关项目
|
# 🔧 开发者共创计划
|
||||||
|
|
||||||
|
我们正在启动 Cherry Studio 开发者共创计划,旨在为开源生态系统构建一个健康、正向反馈的循环。我们相信,优秀的软件是通过协作构建的,每一个合并的拉取请求都为项目注入新的生命力。
|
||||||
|
|
||||||
|
我们诚挚地邀请您加入我们的贡献者队伍,与我们一起塑造 Cherry Studio 的未来。
|
||||||
|
|
||||||
|
## 贡献者奖励计划
|
||||||
|
|
||||||
|
为了回馈我们的核心贡献者并创造良性循环,我们建立了以下长期激励计划。
|
||||||
|
|
||||||
|
**该计划的首个跟踪周期将是 2025 年第三季度(7月、8月、9月)。此周期的奖励将在 10月1日 发放。**
|
||||||
|
|
||||||
|
在任何跟踪周期内(例如,首个周期的 7月1日 至 9月30日),任何为 Cherry Studio 在 GitHub 上的开源项目贡献超过 **30 个有意义提交** 的开发者都有资格获得以下福利:
|
||||||
|
|
||||||
|
- **Cursor 订阅赞助**:获得 **70 美元** 的 [Cursor](https://cursor.sh/) 订阅积分或报销,让 AI 成为您最高效的编码伙伴。
|
||||||
|
- **无限模型访问**:获得 **DeepSeek** 和 **Qwen** 模型的 **无限次** API 调用。
|
||||||
|
- **前沿技术访问**:享受偶尔的特殊福利,包括 **Claude**、**Gemini** 和 **OpenAI** 等模型的 API 访问权限,让您始终站在技术前沿。
|
||||||
|
|
||||||
|
## 共同成长与未来规划
|
||||||
|
|
||||||
|
活跃的社区是任何可持续开源项目背后的推动力。随着 Cherry Studio 的发展,我们的奖励计划也将随之发展。我们致力于持续将我们的福利与行业内最优秀的工具和资源保持一致。这确保我们的核心贡献者获得有意义的支持,创造一个开发者、社区和项目共同成长的正向循环。
|
||||||
|
|
||||||
|
**展望未来,该项目还将采取越来越开放的态度来回馈整个开源社区。**
|
||||||
|
|
||||||
|
## 如何开始?
|
||||||
|
|
||||||
|
我们期待您的第一个拉取请求!
|
||||||
|
|
||||||
|
您可以从探索我们的仓库开始,选择一个 `good first issue`,或者提出您自己的改进建议。每一个提交都是开源精神的体现。
|
||||||
|
|
||||||
|
感谢您的关注和贡献。
|
||||||
|
|
||||||
|
让我们一起建设。
|
||||||
|
|
||||||
|
# 🏢 企业版
|
||||||
|
|
||||||
|
在社区版的基础上,我们自豪地推出 **Cherry Studio 企业版**——一个为现代团队和企业设计的私有部署 AI 生产力与管理平台。
|
||||||
|
|
||||||
|
企业版通过集中管理 AI 资源、知识和数据,解决了团队协作中的核心挑战。它赋能组织提升效率、促进创新并确保合规,同时在安全环境中保持对数据的 100% 控制。
|
||||||
|
|
||||||
|
## 核心优势
|
||||||
|
|
||||||
|
- **统一模型管理**:集中整合和管理各种基于云的大语言模型(如 OpenAI、Anthropic、Google Gemini)和本地部署的私有模型。员工可以开箱即用,无需单独配置。
|
||||||
|
- **企业级知识库**:构建、管理和分享全团队的知识库。确保知识得到保留且一致,使团队成员能够基于统一准确的信息与 AI 交互。
|
||||||
|
- **细粒度访问控制**:通过统一的管理后台轻松管理员工账户,并为不同模型、知识库和功能分配基于角色的权限。
|
||||||
|
- **完全私有部署**:在您的本地服务器或私有云上部署整个后端服务,确保您的数据 100% 私有且在您的控制之下,满足最严格的安全和合规标准。
|
||||||
|
- **可靠的后端服务**:提供稳定的 API 服务、企业级数据备份和恢复机制,确保业务连续性。
|
||||||
|
|
||||||
|
## ✨ 在线演示
|
||||||
|
|
||||||
|
> 🚧 **公开测试版通知**
|
||||||
|
>
|
||||||
|
> 企业版目前处于早期公开测试阶段,我们正在积极迭代和优化其功能。我们知道它可能还不够完全稳定。如果您在试用过程中遇到任何问题或有宝贵建议,我们非常感谢您能通过邮件联系我们提供反馈。
|
||||||
|
|
||||||
|
**🔗 [Cherry Studio 企业版](https://www.cherry-ai.com/enterprise)**
|
||||||
|
|
||||||
|
## 版本对比
|
||||||
|
|
||||||
|
| 功能 | 社区版 | 企业版 |
|
||||||
|
| :----------- | :---------------------- | :--------------------------------------------------------------------------------------------- |
|
||||||
|
| **开源** | ✅ 是 | ⭕️ 部分开源,对客户开放 |
|
||||||
|
| **成本** | 个人使用免费 / 商业授权 | 买断 / 订阅费用 |
|
||||||
|
| **管理后台** | — | ● 集中化**模型**访问<br>● **员工**管理<br>● 共享**知识库**<br>● **访问**控制<br>● **数据**备份 |
|
||||||
|
| **服务器** | — | ✅ 专用私有部署 |
|
||||||
|
|
||||||
|
## 获取企业版
|
||||||
|
|
||||||
|
我们相信企业版将成为您团队的 AI 生产力引擎。如果您对 Cherry Studio 企业版感兴趣,希望了解更多信息、请求报价或安排演示,请联系我们。
|
||||||
|
|
||||||
|
- **商业咨询与购买**:
|
||||||
|
**📧 [bd@cherry-ai.com](mailto:bd@cherry-ai.com)**
|
||||||
|
|
||||||
|
# 🔗 相关项目
|
||||||
|
|
||||||
- [one-api](https://github.com/songquanpeng/one-api):LLM API 管理及分发系统,支持 OpenAI、Azure、Anthropic 等主流模型,统一 API 接口,可用于密钥管理与二次分发。
|
- [one-api](https://github.com/songquanpeng/one-api):LLM API 管理及分发系统,支持 OpenAI、Azure、Anthropic 等主流模型,统一 API 接口,可用于密钥管理与二次分发。
|
||||||
|
|
||||||
@@ -144,22 +279,43 @@ https://docs.cherry-ai.com
|
|||||||
</a>
|
</a>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
# 🌐 社区
|
# 📊 GitHub 统计
|
||||||
|
|
||||||
[Telegram](https://t.me/CherryStudioAI) | [Email](mailto:support@cherry-ai.com) | [Twitter](https://x.com/kangfenmao)
|

|
||||||
|
|
||||||
# ☕ 赞助
|
|
||||||
|
|
||||||
[赞助开发者](sponsor.md)
|
|
||||||
|
|
||||||
# 📃 许可证
|
|
||||||
|
|
||||||
[LICENSE](../LICENSE)
|
|
||||||
|
|
||||||
# ✉️ 联系我们
|
|
||||||
|
|
||||||
yinsenho@cherry-ai.com
|
|
||||||
|
|
||||||
# ⭐️ Star 记录
|
# ⭐️ Star 记录
|
||||||
|
|
||||||
[](https://star-history.com/#kangfenmao/cherry-studio&Timeline)
|
<a href="https://www.star-history.com/#CherryHQ/cherry-studio&Date">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Links & Images -->
|
||||||
|
|
||||||
|
[deepwiki-shield]: https://img.shields.io/badge/Deepwiki-CherryHQ-0088CC
|
||||||
|
[deepwiki-link]: https://deepwiki.com/CherryHQ/cherry-studio
|
||||||
|
[twitter-shield]: https://img.shields.io/badge/Twitter-CherryStudioApp-0088CC?logo=x
|
||||||
|
[twitter-link]: https://twitter.com/CherryStudioHQ
|
||||||
|
[discord-shield]: https://img.shields.io/badge/Discord-@CherryStudio-0088CC?logo=discord
|
||||||
|
[discord-link]: https://discord.gg/wez8HtpxqQ
|
||||||
|
[telegram-shield]: https://img.shields.io/badge/Telegram-@CherryStudioAI-0088CC?logo=telegram
|
||||||
|
[telegram-link]: https://t.me/CherryStudioAI
|
||||||
|
|
||||||
|
<!-- 项目统计徽章 -->
|
||||||
|
|
||||||
|
[github-release-shield]: https://img.shields.io/github/v/release/CherryHQ/cherry-studio
|
||||||
|
[github-release-link]: https://github.com/CherryHQ/cherry-studio/releases
|
||||||
|
[github-contributors-shield]: https://img.shields.io/github/contributors/CherryHQ/cherry-studio
|
||||||
|
[github-contributors-link]: https://github.com/CherryHQ/cherry-studio/graphs/contributors
|
||||||
|
|
||||||
|
<!-- 许可和赞助徽章 -->
|
||||||
|
|
||||||
|
[license-shield]: https://img.shields.io/badge/License-AGPLv3-important.svg?logo=gnu
|
||||||
|
[license-link]: https://www.gnu.org/licenses/agpl-3.0
|
||||||
|
[commercial-shield]: https://img.shields.io/badge/商用授权-联系-white.svg?logoColor=white&logo=telegram&color=blue
|
||||||
|
[commercial-link]: mailto:license@cherry-ai.com?subject=商业授权咨询
|
||||||
|
[sponsor-shield]: https://img.shields.io/badge/赞助支持-FF6699.svg?logo=githubsponsors&logoColor=white
|
||||||
|
[sponsor-link]: https://github.com/CherryHQ/cherry-studio/blob/main/docs/sponsor.md
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ Cherry Studio implements a structured branching strategy to maintain code qualit
|
|||||||
- Only accepts documentation updates and bug fixes
|
- Only accepts documentation updates and bug fixes
|
||||||
- Thoroughly tested before production deployment
|
- Thoroughly tested before production deployment
|
||||||
|
|
||||||
|
For details about the `testplan` branch used in the Test Plan, please refer to the [Test Plan](testplan-en.md).
|
||||||
|
|
||||||
## Contributing Branches
|
## Contributing Branches
|
||||||
|
|
||||||
When contributing to Cherry Studio, please follow these guidelines:
|
When contributing to Cherry Studio, please follow these guidelines:
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ Cherry Studio 采用结构化的分支策略来维护代码质量并简化开发
|
|||||||
- 只接受文档更新和 bug 修复
|
- 只接受文档更新和 bug 修复
|
||||||
- 经过完整测试后可以发布到生产环境
|
- 经过完整测试后可以发布到生产环境
|
||||||
|
|
||||||
|
关于测试计划所使用的`testplan`分支,请查阅[测试计划](testplan-zh.md)。
|
||||||
|
|
||||||
## 贡献分支
|
## 贡献分支
|
||||||
|
|
||||||
在为 Cherry Studio 贡献代码时,请遵循以下准则:
|
在为 Cherry Studio 贡献代码时,请遵循以下准则:
|
||||||
|
|||||||
18
docs/dev.md
18
docs/dev.md
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
## IDE Setup
|
## IDE Setup
|
||||||
|
|
||||||
[Cursor](https://www.cursor.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
- Editor: [Cursor](https://www.cursor.com/), etc. Any VS Code compatible editor.
|
||||||
|
- Linter: [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
||||||
|
- Formatter: [Biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome)
|
||||||
|
|
||||||
## Project Setup
|
## Project Setup
|
||||||
|
|
||||||
@@ -31,12 +33,26 @@ corepack prepare yarn@4.6.0 --activate
|
|||||||
yarn install
|
yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### ENV
|
||||||
|
|
||||||
|
```bash
|
||||||
|
copy .env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
### Start
|
### Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn dev
|
yarn dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Debug
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn debug
|
||||||
|
```
|
||||||
|
|
||||||
|
Then input chrome://inspect in browser
|
||||||
|
|
||||||
### Test
|
### Test
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
222
docs/features/memory-guide-zh.md
Normal file
222
docs/features/memory-guide-zh.md
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
# Cherry Studio 记忆功能指南
|
||||||
|
|
||||||
|
## 功能介绍
|
||||||
|
|
||||||
|
Cherry Studio 的记忆功能是一个强大的工具,能够帮助 AI 助手记住对话中的重要信息、用户偏好和上下文。通过记忆功能,您的 AI 助手可以:
|
||||||
|
|
||||||
|
- 📝 **记住重要信息**:自动从对话中提取并存储关键事实和信息
|
||||||
|
- 🧠 **个性化响应**:基于存储的记忆提供更加个性化和相关的回答
|
||||||
|
- 🔍 **智能检索**:在需要时自动搜索相关记忆,增强对话的连贯性
|
||||||
|
- 👥 **多用户支持**:为不同用户维护独立的记忆上下文
|
||||||
|
|
||||||
|
记忆功能特别适用于需要长期保持上下文的场景,例如个人助手、客户服务、教育辅导等。
|
||||||
|
|
||||||
|
## 如何启用记忆功能
|
||||||
|
|
||||||
|
### 1. 全局配置(首次设置)
|
||||||
|
|
||||||
|
在使用记忆功能之前,您需要先进行全局配置:
|
||||||
|
|
||||||
|
1. 点击侧边栏的 **记忆** 图标(记忆棒图标)进入记忆管理页面
|
||||||
|
2. 点击右上角的 **更多** 按钮(三个点),选择 **设置**
|
||||||
|
3. 在设置弹窗中配置以下必要项:
|
||||||
|
- **LLM 模型**:选择用于处理记忆的语言模型(推荐使用 GPT-4 或 Claude 等高级模型)
|
||||||
|
- **嵌入模型**:选择用于生成向量嵌入的模型(如 text-embedding-3-small)
|
||||||
|
- **嵌入维度**:输入嵌入模型的维度(通常为 1536)
|
||||||
|
4. 点击 **确定** 保存配置
|
||||||
|
|
||||||
|
> ⚠️ **注意**:嵌入模型和维度一旦设置后无法更改,请谨慎选择。
|
||||||
|
|
||||||
|
### 2. 为助手启用记忆
|
||||||
|
|
||||||
|
完成全局配置后,您可以为特定助手启用记忆功能:
|
||||||
|
|
||||||
|
1. 进入 **助手** 页面
|
||||||
|
2. 选择要启用记忆的助手,点击 **编辑**
|
||||||
|
3. 在助手设置中找到 **记忆** 部分
|
||||||
|
4. 打开记忆功能开关
|
||||||
|
5. 保存助手设置
|
||||||
|
|
||||||
|
启用后,该助手将在对话过程中自动提取和使用记忆。
|
||||||
|
|
||||||
|
## 使用方法
|
||||||
|
|
||||||
|
### 查看记忆
|
||||||
|
|
||||||
|
1. 点击侧边栏的 **记忆** 图标进入记忆管理页面
|
||||||
|
2. 您可以看到所有存储的记忆卡片,包括:
|
||||||
|
- 记忆内容
|
||||||
|
- 创建时间
|
||||||
|
- 所属用户
|
||||||
|
|
||||||
|
### 添加记忆
|
||||||
|
|
||||||
|
手动添加记忆有两种方式:
|
||||||
|
|
||||||
|
**方式一:在记忆管理页面添加**
|
||||||
|
|
||||||
|
1. 点击右上角的 **添加记忆** 按钮
|
||||||
|
2. 在弹窗中输入记忆内容
|
||||||
|
3. 点击 **添加** 保存
|
||||||
|
|
||||||
|
**方式二:在对话中自动提取**
|
||||||
|
|
||||||
|
- 当助手启用记忆功能后,系统会自动从对话中提取重要信息并存储为记忆
|
||||||
|
|
||||||
|
### 编辑记忆
|
||||||
|
|
||||||
|
1. 在记忆卡片上点击 **更多** 按钮(三个点)
|
||||||
|
2. 选择 **编辑**
|
||||||
|
3. 修改记忆内容
|
||||||
|
4. 点击 **保存**
|
||||||
|
|
||||||
|
### 删除记忆
|
||||||
|
|
||||||
|
1. 在记忆卡片上点击 **更多** 按钮
|
||||||
|
2. 选择 **删除**
|
||||||
|
3. 确认删除操作
|
||||||
|
|
||||||
|
## 记忆搜索
|
||||||
|
|
||||||
|
记忆管理页面提供了强大的搜索功能:
|
||||||
|
|
||||||
|
1. 在页面顶部的搜索框中输入关键词
|
||||||
|
2. 系统会实时过滤显示匹配的记忆
|
||||||
|
3. 搜索支持模糊匹配,可以搜索记忆内容的任何部分
|
||||||
|
|
||||||
|
## 用户管理
|
||||||
|
|
||||||
|
记忆功能支持多用户,您可以为不同的用户维护独立的记忆库:
|
||||||
|
|
||||||
|
### 切换用户
|
||||||
|
|
||||||
|
1. 在记忆管理页面,点击右上角的用户选择器
|
||||||
|
2. 选择要切换到的用户
|
||||||
|
3. 页面会自动加载该用户的记忆
|
||||||
|
|
||||||
|
### 添加新用户
|
||||||
|
|
||||||
|
1. 点击用户选择器
|
||||||
|
2. 选择 **添加新用户**
|
||||||
|
3. 输入用户 ID(支持字母、数字、下划线和连字符)
|
||||||
|
4. 点击 **添加**
|
||||||
|
|
||||||
|
### 删除用户
|
||||||
|
|
||||||
|
1. 切换到要删除的用户
|
||||||
|
2. 点击右上角的 **更多** 按钮
|
||||||
|
3. 选择 **删除用户**
|
||||||
|
4. 确认删除(注意:这将删除该用户的所有记忆)
|
||||||
|
|
||||||
|
> 💡 **提示**:默认用户(default-user)无法删除。
|
||||||
|
|
||||||
|
## 设置说明
|
||||||
|
|
||||||
|
### LLM 模型
|
||||||
|
|
||||||
|
- 用于处理记忆提取和更新的语言模型
|
||||||
|
- 建议选择能力较强的模型以获得更好的记忆提取效果
|
||||||
|
- 可随时更改
|
||||||
|
|
||||||
|
### 嵌入模型
|
||||||
|
|
||||||
|
- 用于将文本转换为向量,支持语义搜索
|
||||||
|
- 一旦设置后无法更改(为了保证现有记忆的兼容性)
|
||||||
|
- 推荐使用 OpenAI 的 text-embedding 系列模型
|
||||||
|
|
||||||
|
### 嵌入维度
|
||||||
|
|
||||||
|
- 嵌入向量的维度,需要与选择的嵌入模型匹配
|
||||||
|
- 常见维度:
|
||||||
|
- text-embedding-3-small: 1536
|
||||||
|
- text-embedding-3-large: 3072
|
||||||
|
- text-embedding-ada-002: 1536
|
||||||
|
|
||||||
|
### 自定义提示词(可选)
|
||||||
|
|
||||||
|
- **事实提取提示词**:自定义如何从对话中提取信息
|
||||||
|
- **记忆更新提示词**:自定义如何更新现有记忆
|
||||||
|
|
||||||
|
## 最佳实践
|
||||||
|
|
||||||
|
### 1. 合理组织记忆
|
||||||
|
|
||||||
|
- 保持记忆简洁明了,每条记忆专注于一个具体信息
|
||||||
|
- 使用清晰的语言描述事实,避免模糊表达
|
||||||
|
- 定期审查和清理过时或不准确的记忆
|
||||||
|
|
||||||
|
### 2. 多用户场景
|
||||||
|
|
||||||
|
- 为不同的使用场景创建独立用户(如工作、个人、学习等)
|
||||||
|
- 使用有意义的用户 ID,便于识别和管理
|
||||||
|
- 定期备份重要用户的记忆数据
|
||||||
|
|
||||||
|
### 3. 模型选择建议
|
||||||
|
|
||||||
|
- **LLM 模型**:GPT-4、Claude 3 等高级模型能更准确地提取和理解信息
|
||||||
|
- **嵌入模型**:选择与您的主要使用语言匹配的模型
|
||||||
|
|
||||||
|
### 4. 性能优化
|
||||||
|
|
||||||
|
- 避免存储过多冗余记忆,这可能影响搜索性能
|
||||||
|
- 定期整理和合并相似的记忆
|
||||||
|
- 对于大量记忆的场景,考虑按主题或时间进行分类管理
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
|
||||||
|
### Q: 为什么我无法启用记忆功能?
|
||||||
|
|
||||||
|
A: 请确保您已经完成全局配置,包括选择 LLM 模型和嵌入模型。
|
||||||
|
|
||||||
|
### Q: 记忆会自动同步到所有助手吗?
|
||||||
|
|
||||||
|
A: 不会。每个助手的记忆功能需要单独启用,且记忆是按用户隔离的。
|
||||||
|
|
||||||
|
### Q: 如何导出我的记忆数据?
|
||||||
|
|
||||||
|
A: 目前系统暂不支持直接导出功能,但所有记忆都存储在本地数据库中。
|
||||||
|
|
||||||
|
### Q: 删除的记忆可以恢复吗?
|
||||||
|
|
||||||
|
A: 删除操作是永久的,无法恢复。建议在删除前仔细确认。
|
||||||
|
|
||||||
|
### Q: 记忆功能会影响对话速度吗?
|
||||||
|
|
||||||
|
A: 记忆功能在后台异步处理,不会明显影响对话响应速度。但过多的记忆可能会略微增加搜索时间。
|
||||||
|
|
||||||
|
### Q: 如何清空所有记忆?
|
||||||
|
|
||||||
|
A: 您可以删除当前用户并重新创建,或者手动删除所有记忆条目。
|
||||||
|
|
||||||
|
## 注意事项
|
||||||
|
|
||||||
|
### 隐私保护
|
||||||
|
|
||||||
|
- 所有记忆数据都存储在您的本地设备上,不会上传到云端
|
||||||
|
- 请勿在记忆中存储敏感信息(如密码、私钥等)
|
||||||
|
- 定期审查记忆内容,确保没有意外存储的隐私信息
|
||||||
|
|
||||||
|
### 数据安全
|
||||||
|
|
||||||
|
- 记忆数据存储在本地数据库中
|
||||||
|
- 建议定期备份重要数据
|
||||||
|
- 更换设备时请注意迁移记忆数据
|
||||||
|
|
||||||
|
### 使用限制
|
||||||
|
|
||||||
|
- 单条记忆的长度建议不超过 500 字
|
||||||
|
- 每个用户的记忆数量建议控制在 1000 条以内
|
||||||
|
- 过多的记忆可能影响系统性能
|
||||||
|
|
||||||
|
## 技术细节
|
||||||
|
|
||||||
|
记忆功能使用了先进的 RAG(检索增强生成)技术:
|
||||||
|
|
||||||
|
1. **信息提取**:使用 LLM 从对话中智能提取关键信息
|
||||||
|
2. **向量化存储**:通过嵌入模型将文本转换为向量,支持语义搜索
|
||||||
|
3. **智能检索**:在对话时自动搜索相关记忆,提供给 AI 作为上下文
|
||||||
|
4. **持续学习**:随着对话进行,不断更新和完善记忆库
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
💡 **提示**:记忆功能是 Cherry Studio 的高级特性,合理使用可以大大提升 AI 助手的智能程度和用户体验。如有更多问题,欢迎查阅文档或联系支持团队。
|
||||||
BIN
docs/technical/.assets.how-to-i18n/demo-1.png
Normal file
BIN
docs/technical/.assets.how-to-i18n/demo-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
BIN
docs/technical/.assets.how-to-i18n/demo-2.png
Normal file
BIN
docs/technical/.assets.how-to-i18n/demo-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
docs/technical/.assets.how-to-i18n/demo-3.png
Normal file
BIN
docs/technical/.assets.how-to-i18n/demo-3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
180
docs/technical/CodeBlockView-en.md
Normal file
180
docs/technical/CodeBlockView-en.md
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
# CodeBlockView Component Structure
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
CodeBlockView is the core component in Cherry Studio for displaying and manipulating code blocks. It supports multiple view modes and visual previews for special languages, providing rich interactive tools.
|
||||||
|
|
||||||
|
## Component Structure
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
A[CodeBlockView] --> B[CodeToolbar]
|
||||||
|
A --> C[SourceView]
|
||||||
|
A --> D[SpecialView]
|
||||||
|
A --> E[StatusBar]
|
||||||
|
|
||||||
|
B --> F[CodeToolButton]
|
||||||
|
|
||||||
|
C --> G[CodeEditor / CodeViewer]
|
||||||
|
|
||||||
|
D --> H[MermaidPreview]
|
||||||
|
D --> I[PlantUmlPreview]
|
||||||
|
D --> J[SvgPreview]
|
||||||
|
D --> K[GraphvizPreview]
|
||||||
|
|
||||||
|
F --> L[useCopyTool]
|
||||||
|
F --> M[useDownloadTool]
|
||||||
|
F --> N[useViewSourceTool]
|
||||||
|
F --> O[useSplitViewTool]
|
||||||
|
F --> P[useRunTool]
|
||||||
|
F --> Q[useExpandTool]
|
||||||
|
F --> R[useWrapTool]
|
||||||
|
F --> S[useSaveTool]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Core Concepts
|
||||||
|
|
||||||
|
### View Types
|
||||||
|
|
||||||
|
- **preview**: Preview view, where non-source code is displayed as special views
|
||||||
|
- **edit**: Edit view
|
||||||
|
|
||||||
|
### View Modes
|
||||||
|
|
||||||
|
- **source**: Source code view mode
|
||||||
|
- **special**: Special view mode (Mermaid, PlantUML, SVG)
|
||||||
|
- **split**: Split view mode (source code and special view displayed side by side)
|
||||||
|
|
||||||
|
### Special View Languages
|
||||||
|
|
||||||
|
- mermaid
|
||||||
|
- plantuml
|
||||||
|
- svg
|
||||||
|
- dot
|
||||||
|
- graphviz
|
||||||
|
|
||||||
|
## Component Details
|
||||||
|
|
||||||
|
### CodeBlockView Main Component
|
||||||
|
|
||||||
|
Main responsibilities:
|
||||||
|
|
||||||
|
1. Managing view mode state
|
||||||
|
2. Coordinating the display of source code view and special view
|
||||||
|
3. Managing toolbar tools
|
||||||
|
4. Handling code execution state
|
||||||
|
|
||||||
|
### Subcomponents
|
||||||
|
|
||||||
|
#### CodeToolbar
|
||||||
|
|
||||||
|
- Toolbar displayed at the top-right corner of the code block
|
||||||
|
- Contains core and quick tools
|
||||||
|
- Dynamically displays relevant tools based on context
|
||||||
|
|
||||||
|
#### CodeEditor/CodeViewer Source View
|
||||||
|
|
||||||
|
- Editable code editor or read-only code viewer
|
||||||
|
- Uses either component based on settings
|
||||||
|
- Supports syntax highlighting for multiple programming languages
|
||||||
|
|
||||||
|
#### Special View Components
|
||||||
|
|
||||||
|
- **MermaidPreview**: Mermaid diagram preview
|
||||||
|
- **PlantUmlPreview**: PlantUML diagram preview
|
||||||
|
- **SvgPreview**: SVG image preview
|
||||||
|
- **GraphvizPreview**: Graphviz diagram preview
|
||||||
|
|
||||||
|
All special view components share a common architecture for consistent user experience and functionality. For detailed information about these components and their implementation, see [Image Preview Components Documentation](./ImagePreview-en.md).
|
||||||
|
|
||||||
|
#### StatusBar
|
||||||
|
|
||||||
|
- Displays Python code execution results
|
||||||
|
- Can show both text and image results
|
||||||
|
|
||||||
|
## Tool System
|
||||||
|
|
||||||
|
CodeBlockView uses a hook-based tool system:
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
A[CodeBlockView] --> B[useCopyTool]
|
||||||
|
A --> C[useDownloadTool]
|
||||||
|
A --> D[useViewSourceTool]
|
||||||
|
A --> E[useSplitViewTool]
|
||||||
|
A --> F[useRunTool]
|
||||||
|
A --> G[useExpandTool]
|
||||||
|
A --> H[useWrapTool]
|
||||||
|
A --> I[useSaveTool]
|
||||||
|
|
||||||
|
B --> J[ToolManager]
|
||||||
|
C --> J
|
||||||
|
D --> J
|
||||||
|
E --> J
|
||||||
|
F --> J
|
||||||
|
G --> J
|
||||||
|
H --> J
|
||||||
|
I --> J
|
||||||
|
|
||||||
|
J --> K[CodeToolbar]
|
||||||
|
```
|
||||||
|
|
||||||
|
Each tool hook is responsible for registering specific function tool buttons to the tool manager, which then passes these tools to the CodeToolbar component for rendering.
|
||||||
|
|
||||||
|
### Tool Types
|
||||||
|
|
||||||
|
- **core**: Core tools, always displayed in the toolbar
|
||||||
|
- **quick**: Quick tools, displayed in a dropdown menu when there are more than one
|
||||||
|
|
||||||
|
### Tool List
|
||||||
|
|
||||||
|
1. **Copy**: Copy code or image
|
||||||
|
2. **Download**: Download code or image
|
||||||
|
3. **View Source**: Switch between special view and source code view
|
||||||
|
4. **Split View**: Toggle split view mode
|
||||||
|
5. **Run**: Run Python code
|
||||||
|
6. **Expand/Collapse**: Control code block expansion/collapse
|
||||||
|
7. **Wrap**: Control automatic line wrapping
|
||||||
|
8. **Save**: Save edited code
|
||||||
|
|
||||||
|
## State Management
|
||||||
|
|
||||||
|
CodeBlockView manages the following states through React hooks:
|
||||||
|
|
||||||
|
1. **viewMode**: Current view mode ('source' | 'special' | 'split')
|
||||||
|
2. **isRunning**: Python code execution status
|
||||||
|
3. **executionResult**: Python code execution result
|
||||||
|
4. **tools**: Toolbar tool list
|
||||||
|
5. **expandOverride/unwrapOverride**: User override settings for expand/wrap
|
||||||
|
6. **sourceScrollHeight**: Source code view scroll height
|
||||||
|
|
||||||
|
## Interaction Flow
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant U as User
|
||||||
|
participant CB as CodeBlockView
|
||||||
|
participant CT as CodeToolbar
|
||||||
|
participant SV as SpecialView
|
||||||
|
participant SE as SourceEditor
|
||||||
|
|
||||||
|
U->>CB: View code block
|
||||||
|
CB->>CB: Initialize state
|
||||||
|
CB->>CT: Register tools
|
||||||
|
CB->>SV: Render special view (if applicable)
|
||||||
|
CB->>SE: Render source view
|
||||||
|
U->>CT: Click tool button
|
||||||
|
CT->>CB: Trigger tool callback
|
||||||
|
CB->>CB: Update state
|
||||||
|
CB->>CT: Re-register tools (if needed)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Special Handling
|
||||||
|
|
||||||
|
### HTML Code Blocks
|
||||||
|
|
||||||
|
HTML code blocks are specially handled using the HtmlArtifactsCard component.
|
||||||
|
|
||||||
|
### Python Code Execution
|
||||||
|
|
||||||
|
Supports executing Python code and displaying results using Pyodide to run Python code in the browser.
|
||||||
180
docs/technical/CodeBlockView-zh.md
Normal file
180
docs/technical/CodeBlockView-zh.md
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
# CodeBlockView 组件结构说明
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
CodeBlockView 是 Cherry Studio 中用于显示和操作代码块的核心组件。它支持多种视图模式和特殊语言的可视化预览,提供丰富的交互工具。
|
||||||
|
|
||||||
|
## 组件结构
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
A[CodeBlockView] --> B[CodeToolbar]
|
||||||
|
A --> C[SourceView]
|
||||||
|
A --> D[SpecialView]
|
||||||
|
A --> E[StatusBar]
|
||||||
|
|
||||||
|
B --> F[CodeToolButton]
|
||||||
|
|
||||||
|
C --> G[CodeEditor / CodeViewer]
|
||||||
|
|
||||||
|
D --> H[MermaidPreview]
|
||||||
|
D --> I[PlantUmlPreview]
|
||||||
|
D --> J[SvgPreview]
|
||||||
|
D --> K[GraphvizPreview]
|
||||||
|
|
||||||
|
F --> L[useCopyTool]
|
||||||
|
F --> M[useDownloadTool]
|
||||||
|
F --> N[useViewSourceTool]
|
||||||
|
F --> O[useSplitViewTool]
|
||||||
|
F --> P[useRunTool]
|
||||||
|
F --> Q[useExpandTool]
|
||||||
|
F --> R[useWrapTool]
|
||||||
|
F --> S[useSaveTool]
|
||||||
|
```
|
||||||
|
|
||||||
|
## 核心概念
|
||||||
|
|
||||||
|
### 视图类型
|
||||||
|
|
||||||
|
- **preview**: 预览视图,非源代码的是特殊视图
|
||||||
|
- **edit**: 编辑视图
|
||||||
|
|
||||||
|
### 视图模式
|
||||||
|
|
||||||
|
- **source**: 源代码视图模式
|
||||||
|
- **special**: 特殊视图模式(Mermaid、PlantUML、SVG)
|
||||||
|
- **split**: 分屏模式(源代码和特殊视图并排显示)
|
||||||
|
|
||||||
|
### 特殊视图语言
|
||||||
|
|
||||||
|
- mermaid
|
||||||
|
- plantuml
|
||||||
|
- svg
|
||||||
|
- dot
|
||||||
|
- graphviz
|
||||||
|
|
||||||
|
## 组件详细说明
|
||||||
|
|
||||||
|
### CodeBlockView 主组件
|
||||||
|
|
||||||
|
主要负责:
|
||||||
|
|
||||||
|
1. 管理视图模式状态
|
||||||
|
2. 协调源代码视图和特殊视图的显示
|
||||||
|
3. 管理工具栏工具
|
||||||
|
4. 处理代码执行状态
|
||||||
|
|
||||||
|
### 子组件
|
||||||
|
|
||||||
|
#### CodeToolbar 工具栏
|
||||||
|
|
||||||
|
- 显示在代码块右上角的工具栏
|
||||||
|
- 包含核心(core)和快捷(quick)两类工具
|
||||||
|
- 根据上下文动态显示相关工具
|
||||||
|
|
||||||
|
#### CodeEditor/CodeViewer 源代码视图
|
||||||
|
|
||||||
|
- 可编辑的代码编辑器或只读的代码查看器
|
||||||
|
- 根据设置决定使用哪个组件
|
||||||
|
- 支持多种编程语言高亮
|
||||||
|
|
||||||
|
#### 特殊视图组件
|
||||||
|
|
||||||
|
- **MermaidPreview**: Mermaid 图表预览
|
||||||
|
- **PlantUmlPreview**: PlantUML 图表预览
|
||||||
|
- **SvgPreview**: SVG 图像预览
|
||||||
|
- **GraphvizPreview**: Graphviz 图表预览
|
||||||
|
|
||||||
|
所有特殊视图组件共享通用架构,以确保一致的用户体验和功能。有关这些组件及其实现的详细信息,请参阅 [图像预览组件文档](./ImagePreview-zh.md)。
|
||||||
|
|
||||||
|
#### StatusBar 状态栏
|
||||||
|
|
||||||
|
- 显示 Python 代码执行结果
|
||||||
|
- 可显示文本和图像结果
|
||||||
|
|
||||||
|
## 工具系统
|
||||||
|
|
||||||
|
CodeBlockView 使用基于 hooks 的工具系统:
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
A[CodeBlockView] --> B[useCopyTool]
|
||||||
|
A --> C[useDownloadTool]
|
||||||
|
A --> D[useViewSourceTool]
|
||||||
|
A --> E[useSplitViewTool]
|
||||||
|
A --> F[useRunTool]
|
||||||
|
A --> G[useExpandTool]
|
||||||
|
A --> H[useWrapTool]
|
||||||
|
A --> I[useSaveTool]
|
||||||
|
|
||||||
|
B --> J[ToolManager]
|
||||||
|
C --> J
|
||||||
|
D --> J
|
||||||
|
E --> J
|
||||||
|
F --> J
|
||||||
|
G --> J
|
||||||
|
H --> J
|
||||||
|
I --> J
|
||||||
|
|
||||||
|
J --> K[CodeToolbar]
|
||||||
|
```
|
||||||
|
|
||||||
|
每个工具 hook 负责注册特定功能的工具按钮到工具管理器,工具管理器再将这些工具传递给 CodeToolbar 组件进行渲染。
|
||||||
|
|
||||||
|
### 工具类型
|
||||||
|
|
||||||
|
- **core**: 核心工具,始终显示在工具栏
|
||||||
|
- **quick**: 快捷工具,当数量大于1时通过下拉菜单显示
|
||||||
|
|
||||||
|
### 工具列表
|
||||||
|
|
||||||
|
1. **复制(copy)**: 复制代码或图像
|
||||||
|
2. **下载(download)**: 下载代码或图像
|
||||||
|
3. **查看源码(view-source)**: 在特殊视图和源码视图间切换
|
||||||
|
4. **分屏(split-view)**: 切换分屏模式
|
||||||
|
5. **运行(run)**: 运行 Python 代码
|
||||||
|
6. **展开/折叠(expand)**: 控制代码块的展开/折叠
|
||||||
|
7. **换行(wrap)**: 控制代码的自动换行
|
||||||
|
8. **保存(save)**: 保存编辑的代码
|
||||||
|
|
||||||
|
## 状态管理
|
||||||
|
|
||||||
|
CodeBlockView 通过 React hooks 管理以下状态:
|
||||||
|
|
||||||
|
1. **viewMode**: 当前视图模式 ('source' | 'special' | 'split')
|
||||||
|
2. **isRunning**: Python 代码执行状态
|
||||||
|
3. **executionResult**: Python 代码执行结果
|
||||||
|
4. **tools**: 工具栏工具列表
|
||||||
|
5. **expandOverride/unwrapOverride**: 用户展开/换行的覆盖设置
|
||||||
|
6. **sourceScrollHeight**: 源代码视图滚动高度
|
||||||
|
|
||||||
|
## 交互流程
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant U as User
|
||||||
|
participant CB as CodeBlockView
|
||||||
|
participant CT as CodeToolbar
|
||||||
|
participant SV as SpecialView
|
||||||
|
participant SE as SourceEditor
|
||||||
|
|
||||||
|
U->>CB: 查看代码块
|
||||||
|
CB->>CB: 初始化状态
|
||||||
|
CB->>CT: 注册工具
|
||||||
|
CB->>SV: 渲染特殊视图(如果适用)
|
||||||
|
CB->>SE: 渲染源码视图
|
||||||
|
U->>CT: 点击工具按钮
|
||||||
|
CT->>CB: 触发工具回调
|
||||||
|
CB->>CB: 更新状态
|
||||||
|
CB->>CT: 重新注册工具(如果需要)
|
||||||
|
```
|
||||||
|
|
||||||
|
## 特殊处理
|
||||||
|
|
||||||
|
### HTML 代码块
|
||||||
|
|
||||||
|
HTML 代码块会被特殊处理,使用 HtmlArtifactsCard 组件显示。
|
||||||
|
|
||||||
|
### Python 代码执行
|
||||||
|
|
||||||
|
支持执行 Python 代码并显示结果,使用 Pyodide 在浏览器中运行 Python 代码。
|
||||||
195
docs/technical/ImagePreview-en.md
Normal file
195
docs/technical/ImagePreview-en.md
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
# Image Preview Components
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Image Preview Components are a set of specialized components in Cherry Studio for rendering and displaying various diagram and image formats. They provide a consistent user experience across different preview types with shared functionality for loading states, error handling, and interactive controls.
|
||||||
|
|
||||||
|
## Supported Formats
|
||||||
|
|
||||||
|
- **Mermaid**: Interactive diagrams and flowcharts
|
||||||
|
- **PlantUML**: UML diagrams and system architecture
|
||||||
|
- **SVG**: Scalable vector graphics
|
||||||
|
- **Graphviz/DOT**: Graph visualization and network diagrams
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
A[MermaidPreview] --> D[ImagePreviewLayout]
|
||||||
|
B[PlantUmlPreview] --> D
|
||||||
|
C[SvgPreview] --> D
|
||||||
|
E[GraphvizPreview] --> D
|
||||||
|
|
||||||
|
D --> F[ImageToolbar]
|
||||||
|
D --> G[useDebouncedRender]
|
||||||
|
|
||||||
|
F --> H[Pan Controls]
|
||||||
|
F --> I[Zoom Controls]
|
||||||
|
F --> J[Reset Function]
|
||||||
|
F --> K[Dialog Control]
|
||||||
|
|
||||||
|
G --> L[Debounced Rendering]
|
||||||
|
G --> M[Error Handling]
|
||||||
|
G --> N[Loading State]
|
||||||
|
G --> O[Dependency Management]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Core Components
|
||||||
|
|
||||||
|
### ImagePreviewLayout
|
||||||
|
|
||||||
|
A common layout wrapper that provides the foundation for all image preview components.
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
|
||||||
|
- **Loading State Management**: Shows loading spinner during rendering
|
||||||
|
- **Error Display**: Displays error messages when rendering fails
|
||||||
|
- **Toolbar Integration**: Conditionally renders ImageToolbar when enabled
|
||||||
|
- **Container Management**: Wraps preview content with consistent styling
|
||||||
|
- **Responsive Design**: Adapts to different container sizes
|
||||||
|
|
||||||
|
**Props:**
|
||||||
|
|
||||||
|
- `children`: The preview content to be displayed
|
||||||
|
- `loading`: Boolean indicating if content is being rendered
|
||||||
|
- `error`: Error message to display if rendering fails
|
||||||
|
- `enableToolbar`: Whether to show the interactive toolbar
|
||||||
|
- `imageRef`: Reference to the container element for image manipulation
|
||||||
|
|
||||||
|
### ImageToolbar
|
||||||
|
|
||||||
|
Interactive toolbar component providing image manipulation controls.
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
|
||||||
|
- **Pan Controls**: 4-directional pan buttons (up, down, left, right)
|
||||||
|
- **Zoom Controls**: Zoom in/out functionality with configurable increments
|
||||||
|
- **Reset Function**: Restore original pan and zoom state
|
||||||
|
- **Dialog Control**: Open preview in expanded dialog view
|
||||||
|
- **Accessible Design**: Full keyboard navigation and screen reader support
|
||||||
|
|
||||||
|
**Layout:**
|
||||||
|
|
||||||
|
- 3x3 grid layout positioned at bottom-right of preview
|
||||||
|
- Responsive button sizing
|
||||||
|
- Tooltip support for all controls
|
||||||
|
|
||||||
|
### useDebouncedRender Hook
|
||||||
|
|
||||||
|
A specialized React hook for managing preview rendering with performance optimizations.
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
|
||||||
|
- **Debounced Rendering**: Prevents excessive re-renders during rapid content changes (default 300ms delay)
|
||||||
|
- **Automatic Dependency Management**: Handles dependencies for render and condition functions
|
||||||
|
- **Error Handling**: Catches and manages rendering errors with detailed error messages
|
||||||
|
- **Loading State**: Tracks rendering progress with automatic state updates
|
||||||
|
- **Conditional Rendering**: Supports pre-render condition checks
|
||||||
|
- **Manual Controls**: Provides trigger, cancel, and state management functions
|
||||||
|
|
||||||
|
**API:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const { containerRef, error, isLoading, triggerRender, cancelRender, clearError, setLoading } = useDebouncedRender(
|
||||||
|
value,
|
||||||
|
renderFunction,
|
||||||
|
options
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Options:**
|
||||||
|
|
||||||
|
- `debounceDelay`: Customize debounce timing
|
||||||
|
- `shouldRender`: Function for conditional rendering logic
|
||||||
|
|
||||||
|
## Component Implementations
|
||||||
|
|
||||||
|
### MermaidPreview
|
||||||
|
|
||||||
|
Renders Mermaid diagrams with special handling for visibility detection.
|
||||||
|
|
||||||
|
**Special Features:**
|
||||||
|
|
||||||
|
- Syntax validation before rendering
|
||||||
|
- Visibility detection to handle collapsed containers
|
||||||
|
- SVG coordinate fixing for edge cases
|
||||||
|
- Integration with mermaid.js library
|
||||||
|
|
||||||
|
### PlantUmlPreview
|
||||||
|
|
||||||
|
Renders PlantUML diagrams using the online PlantUML server.
|
||||||
|
|
||||||
|
**Special Features:**
|
||||||
|
|
||||||
|
- Network error handling and retry logic
|
||||||
|
- Diagram encoding using deflate compression
|
||||||
|
- Support for light/dark themes
|
||||||
|
- Server status monitoring
|
||||||
|
|
||||||
|
### SvgPreview
|
||||||
|
|
||||||
|
Renders SVG content using Shadow DOM for isolation.
|
||||||
|
|
||||||
|
**Special Features:**
|
||||||
|
|
||||||
|
- Shadow DOM rendering for style isolation
|
||||||
|
- Direct SVG content injection
|
||||||
|
- Minimal processing overhead
|
||||||
|
- Cross-browser compatibility
|
||||||
|
|
||||||
|
### GraphvizPreview
|
||||||
|
|
||||||
|
Renders Graphviz/DOT diagrams using the viz.js library.
|
||||||
|
|
||||||
|
**Special Features:**
|
||||||
|
|
||||||
|
- Client-side rendering with viz.js
|
||||||
|
- Lazy loading of viz.js library
|
||||||
|
- SVG element generation
|
||||||
|
- Memory-efficient processing
|
||||||
|
|
||||||
|
## Shared Functionality
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
|
||||||
|
All preview components provide consistent error handling:
|
||||||
|
|
||||||
|
- Network errors (connection failures)
|
||||||
|
- Syntax errors (invalid diagram code)
|
||||||
|
- Server errors (external service failures)
|
||||||
|
- Rendering errors (library failures)
|
||||||
|
|
||||||
|
### Loading States
|
||||||
|
|
||||||
|
Standardized loading indicators across all components:
|
||||||
|
|
||||||
|
- Spinner animation during processing
|
||||||
|
- Progress feedback for long operations
|
||||||
|
- Smooth transitions between states
|
||||||
|
|
||||||
|
### Interactive Controls
|
||||||
|
|
||||||
|
Common interaction patterns:
|
||||||
|
|
||||||
|
- Pan and zoom functionality
|
||||||
|
- Reset to original view
|
||||||
|
- Full-screen dialog mode
|
||||||
|
- Keyboard accessibility
|
||||||
|
|
||||||
|
### Performance Optimizations
|
||||||
|
|
||||||
|
- Debounced rendering to prevent excessive updates
|
||||||
|
- Lazy loading of heavy libraries
|
||||||
|
- Memory management for large diagrams
|
||||||
|
- Efficient re-rendering strategies
|
||||||
|
|
||||||
|
## Integration with CodeBlockView
|
||||||
|
|
||||||
|
Image Preview Components integrate seamlessly with CodeBlockView:
|
||||||
|
|
||||||
|
- Automatic format detection based on language tags
|
||||||
|
- Consistent toolbar integration
|
||||||
|
- Shared state management
|
||||||
|
- Responsive layout adaptation
|
||||||
|
|
||||||
|
For more information about the overall CodeBlockView architecture, see [CodeBlockView Documentation](./CodeBlockView-en.md).
|
||||||
195
docs/technical/ImagePreview-zh.md
Normal file
195
docs/technical/ImagePreview-zh.md
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
# 图像预览组件
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
图像预览组件是 Cherry Studio 中用于渲染和显示各种图表和图像格式的专用组件集合。它们为不同预览类型提供一致的用户体验,具有共享的加载状态、错误处理和交互控制功能。
|
||||||
|
|
||||||
|
## 支持格式
|
||||||
|
|
||||||
|
- **Mermaid**: 交互式图表和流程图
|
||||||
|
- **PlantUML**: UML 图表和系统架构
|
||||||
|
- **SVG**: 可缩放矢量图形
|
||||||
|
- **Graphviz/DOT**: 图形可视化和网络图表
|
||||||
|
|
||||||
|
## 架构
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
A[MermaidPreview] --> D[ImagePreviewLayout]
|
||||||
|
B[PlantUmlPreview] --> D
|
||||||
|
C[SvgPreview] --> D
|
||||||
|
E[GraphvizPreview] --> D
|
||||||
|
|
||||||
|
D --> F[ImageToolbar]
|
||||||
|
D --> G[useDebouncedRender]
|
||||||
|
|
||||||
|
F --> H[平移控制]
|
||||||
|
F --> I[缩放控制]
|
||||||
|
F --> J[重置功能]
|
||||||
|
F --> K[对话框控制]
|
||||||
|
|
||||||
|
G --> L[防抖渲染]
|
||||||
|
G --> M[错误处理]
|
||||||
|
G --> N[加载状态]
|
||||||
|
G --> O[依赖管理]
|
||||||
|
```
|
||||||
|
|
||||||
|
## 核心组件
|
||||||
|
|
||||||
|
### ImagePreviewLayout 图像预览布局
|
||||||
|
|
||||||
|
为所有图像预览组件提供基础的通用布局包装器。
|
||||||
|
|
||||||
|
**功能特性:**
|
||||||
|
|
||||||
|
- **加载状态管理**: 在渲染期间显示加载动画
|
||||||
|
- **错误显示**: 渲染失败时显示错误信息
|
||||||
|
- **工具栏集成**: 启用时有条件地渲染 ImageToolbar
|
||||||
|
- **容器管理**: 使用一致的样式包装预览内容
|
||||||
|
- **响应式设计**: 适应不同的容器尺寸
|
||||||
|
|
||||||
|
**属性:**
|
||||||
|
|
||||||
|
- `children`: 要显示的预览内容
|
||||||
|
- `loading`: 指示内容是否正在渲染的布尔值
|
||||||
|
- `error`: 渲染失败时显示的错误信息
|
||||||
|
- `enableToolbar`: 是否显示交互式工具栏
|
||||||
|
- `imageRef`: 用于图像操作的容器元素引用
|
||||||
|
|
||||||
|
### ImageToolbar 图像工具栏
|
||||||
|
|
||||||
|
提供图像操作控制的交互式工具栏组件。
|
||||||
|
|
||||||
|
**功能特性:**
|
||||||
|
|
||||||
|
- **平移控制**: 4方向平移按钮(上、下、左、右)
|
||||||
|
- **缩放控制**: 放大/缩小功能,支持可配置的增量
|
||||||
|
- **重置功能**: 恢复原始平移和缩放状态
|
||||||
|
- **对话框控制**: 在展开对话框中打开预览
|
||||||
|
- **无障碍设计**: 完整的键盘导航和屏幕阅读器支持
|
||||||
|
|
||||||
|
**布局:**
|
||||||
|
|
||||||
|
- 3x3 网格布局,位于预览右下角
|
||||||
|
- 响应式按钮尺寸
|
||||||
|
- 所有控件的工具提示支持
|
||||||
|
|
||||||
|
### useDebouncedRender Hook 防抖渲染钩子
|
||||||
|
|
||||||
|
用于管理预览渲染的专用 React Hook,具有性能优化功能。
|
||||||
|
|
||||||
|
**功能特性:**
|
||||||
|
|
||||||
|
- **防抖渲染**: 防止内容快速变化时的过度重新渲染(默认 300ms 延迟)
|
||||||
|
- **自动依赖管理**: 处理渲染和条件函数的依赖项
|
||||||
|
- **错误处理**: 捕获和管理渲染错误,提供详细的错误信息
|
||||||
|
- **加载状态**: 跟踪渲染进度并自动更新状态
|
||||||
|
- **条件渲染**: 支持预渲染条件检查
|
||||||
|
- **手动控制**: 提供触发、取消和状态管理功能
|
||||||
|
|
||||||
|
**API:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const { containerRef, error, isLoading, triggerRender, cancelRender, clearError, setLoading } = useDebouncedRender(
|
||||||
|
value,
|
||||||
|
renderFunction,
|
||||||
|
options
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
**选项:**
|
||||||
|
|
||||||
|
- `debounceDelay`: 自定义防抖时间
|
||||||
|
- `shouldRender`: 条件渲染逻辑函数
|
||||||
|
|
||||||
|
## 组件实现
|
||||||
|
|
||||||
|
### MermaidPreview Mermaid 预览
|
||||||
|
|
||||||
|
渲染 Mermaid 图表,具有可见性检测的特殊处理。
|
||||||
|
|
||||||
|
**特殊功能:**
|
||||||
|
|
||||||
|
- 渲染前语法验证
|
||||||
|
- 可见性检测以处理折叠的容器
|
||||||
|
- 边缘情况的 SVG 坐标修复
|
||||||
|
- 与 mermaid.js 库集成
|
||||||
|
|
||||||
|
### PlantUmlPreview PlantUML 预览
|
||||||
|
|
||||||
|
使用在线 PlantUML 服务器渲染 PlantUML 图表。
|
||||||
|
|
||||||
|
**特殊功能:**
|
||||||
|
|
||||||
|
- 网络错误处理和重试逻辑
|
||||||
|
- 使用 deflate 压缩的图表编码
|
||||||
|
- 支持明/暗主题
|
||||||
|
- 服务器状态监控
|
||||||
|
|
||||||
|
### SvgPreview SVG 预览
|
||||||
|
|
||||||
|
使用 Shadow DOM 隔离渲染 SVG 内容。
|
||||||
|
|
||||||
|
**特殊功能:**
|
||||||
|
|
||||||
|
- Shadow DOM 渲染实现样式隔离
|
||||||
|
- 直接 SVG 内容注入
|
||||||
|
- 最小化处理开销
|
||||||
|
- 跨浏览器兼容性
|
||||||
|
|
||||||
|
### GraphvizPreview Graphviz 预览
|
||||||
|
|
||||||
|
使用 viz.js 库渲染 Graphviz/DOT 图表。
|
||||||
|
|
||||||
|
**特殊功能:**
|
||||||
|
|
||||||
|
- 使用 viz.js 进行客户端渲染
|
||||||
|
- viz.js 库的懒加载
|
||||||
|
- SVG 元素生成
|
||||||
|
- 内存高效处理
|
||||||
|
|
||||||
|
## 共享功能
|
||||||
|
|
||||||
|
### 错误处理
|
||||||
|
|
||||||
|
所有预览组件提供一致的错误处理:
|
||||||
|
|
||||||
|
- 网络错误(连接失败)
|
||||||
|
- 语法错误(无效的图表代码)
|
||||||
|
- 服务器错误(外部服务失败)
|
||||||
|
- 渲染错误(库失败)
|
||||||
|
|
||||||
|
### 加载状态
|
||||||
|
|
||||||
|
所有组件的标准化加载指示器:
|
||||||
|
|
||||||
|
- 处理期间的动画
|
||||||
|
- 长时间操作的进度反馈
|
||||||
|
- 状态间的平滑过渡
|
||||||
|
|
||||||
|
### 交互控制
|
||||||
|
|
||||||
|
通用交互模式:
|
||||||
|
|
||||||
|
- 平移和缩放功能
|
||||||
|
- 重置到原始视图
|
||||||
|
- 全屏对话框模式
|
||||||
|
- 键盘无障碍访问
|
||||||
|
|
||||||
|
### 性能优化
|
||||||
|
|
||||||
|
- 防抖渲染以防止过度更新
|
||||||
|
- 重型库的懒加载
|
||||||
|
- 大型图表的内存管理
|
||||||
|
- 高效的重新渲染策略
|
||||||
|
|
||||||
|
## 与 CodeBlockView 的集成
|
||||||
|
|
||||||
|
图像预览组件与 CodeBlockView 无缝集成:
|
||||||
|
|
||||||
|
- 基于语言标签的自动格式检测
|
||||||
|
- 一致的工具栏集成
|
||||||
|
- 共享状态管理
|
||||||
|
- 响应式布局适应
|
||||||
|
|
||||||
|
有关整体 CodeBlockView 架构的更多信息,请参阅 [CodeBlockView 文档](./CodeBlockView-zh.md)。
|
||||||
127
docs/technical/code-execution.md
Normal file
127
docs/technical/code-execution.md
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
# 代码执行功能
|
||||||
|
|
||||||
|
本文档说明了代码块的 Python 代码执行功能。该实现利用 [Pyodide][pyodide-link] 在浏览器环境中直接运行 Python 代码,并将其置于 Web Worker 中,以避免阻塞主 UI 线程。
|
||||||
|
|
||||||
|
整个实现分为三个主要部分:UI 层、服务层和 Worker 层。
|
||||||
|
|
||||||
|
## 执行流程图
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant 用户
|
||||||
|
participant CodeBlockView (UI)
|
||||||
|
participant PyodideService (服务)
|
||||||
|
participant PyodideWorker (Worker)
|
||||||
|
|
||||||
|
用户->>CodeBlockView (UI): 点击“运行”按钮
|
||||||
|
CodeBlockView (UI)->>PyodideService (服务): 调用 runScript(code)
|
||||||
|
PyodideService (服务)->>PyodideWorker (Worker): 发送 postMessage({ id, python: code })
|
||||||
|
PyodideWorker (Worker)->>PyodideWorker (Worker): 加载 Pyodide 和相关包
|
||||||
|
PyodideWorker (Worker)->>PyodideWorker (Worker): (按需)注入垫片并合并代码
|
||||||
|
PyodideWorker (Worker)->>PyodideWorker (Worker): 执行合并后的 Python 代码
|
||||||
|
PyodideWorker (Worker)-->>PyodideService (服务): 返回 postMessage({ id, output })
|
||||||
|
PyodideService (服务)-->>CodeBlockView (UI): 返回 { text, image } 对象
|
||||||
|
CodeBlockView (UI)->>用户: 在状态栏中显示文本和/或图像输出
|
||||||
|
```
|
||||||
|
|
||||||
|
## 1. UI 层
|
||||||
|
|
||||||
|
面向用户的代码执行组件是 [CodeBlockView][codeblock-view-link]。
|
||||||
|
|
||||||
|
### 关键机制:
|
||||||
|
|
||||||
|
- **运行按钮**:当代码块语言为 `python` 且 `codeExecution.enabled` 设置为 true 时,`CodeToolbar` 中会条件性地渲染一个“运行”按钮。
|
||||||
|
- **事件处理**:运行按钮的 `onClick` 事件会触发 `handleRunScript` 函数。
|
||||||
|
- **服务调用**:`handleRunScript` 调用 `pyodideService.runScript(code)`,将代码块中的 Python 代码传递给服务。
|
||||||
|
- **状态管理与输出显示**:使用 `executionResult` 来管理所有执行输出,只要有任何结果(文本或图像),[StatusBar][statusbar-link] 组件就会被渲染以统一显示。
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// src/renderer/src/components/CodeBlockView/view.tsx
|
||||||
|
const [executionResult, setExecutionResult] = useState<{ text: string; image?: string } | null>(null)
|
||||||
|
|
||||||
|
const handleRunScript = useCallback(() => {
|
||||||
|
setIsRunning(true)
|
||||||
|
setExecutionResult(null)
|
||||||
|
|
||||||
|
pyodideService
|
||||||
|
.runScript(children, {}, codeExecution.timeoutMinutes * 60000)
|
||||||
|
.then((result) => {
|
||||||
|
setExecutionResult(result)
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Unexpected error:', error)
|
||||||
|
setExecutionResult({
|
||||||
|
text: `Unexpected error: ${error.message || 'Unknown error'}`
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setIsRunning(false)
|
||||||
|
})
|
||||||
|
}, [children, codeExecution.timeoutMinutes]);
|
||||||
|
|
||||||
|
// ... 在 JSX 中
|
||||||
|
{isExecutable && executionResult && (
|
||||||
|
<StatusBar>
|
||||||
|
{executionResult.text}
|
||||||
|
{executionResult.image && (
|
||||||
|
<ImageOutput>
|
||||||
|
<img src={executionResult.image} alt="Matplotlib plot" />
|
||||||
|
</ImageOutput>
|
||||||
|
)}
|
||||||
|
</StatusBar>
|
||||||
|
)}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. 服务层
|
||||||
|
|
||||||
|
服务层充当 UI 组件和运行 Pyodide 的 Web Worker 之间的桥梁。其逻辑封装在位于单例类 [PyodideService][pyodide-service-link]。
|
||||||
|
|
||||||
|
### 主要职责:
|
||||||
|
|
||||||
|
- **Worker 管理**:初始化、管理并与 Pyodide Web Worker 通信。
|
||||||
|
- **请求处理**:使用 `resolvers` Map 管理并发请求,通过唯一 ID 匹配请求和响应。
|
||||||
|
- **为 UI 提供 API**:向 UI 提供 `runScript(script, context, timeout)` 方法。此方法的返回值已修改为 `Promise<{ text: string; image?: string }>`,以支持包括图像在内的多种输出类型。
|
||||||
|
- **输出处理**:从 Worker 接收包含文本、错误和可选图像数据的 `output` 对象。它将文本和错误格式化为对用户友好的单个字符串,然后连同图像数据一起包装成对象返回给 UI 层。
|
||||||
|
- **IPC 端点**:该服务还提供了一个 `python-execution-request` IPC 端点,允许主进程请求执行 Python 代码,展示了其灵活的架构。
|
||||||
|
|
||||||
|
## 3. Worker 层
|
||||||
|
|
||||||
|
核心的 Python 执行发生在 [pyodide.worker.ts][pyodide-worker-link] 中定义的 Web Worker 内部。这确保了计算密集的 Python 代码不会冻结用户界面。
|
||||||
|
|
||||||
|
### Worker 逻辑:
|
||||||
|
|
||||||
|
- **Pyodide 加载**:Worker 从 CDN 加载 Pyodide 引擎,并设置处理器以捕获 Python 的 `stdout` 和 `stderr`。
|
||||||
|
- **动态包安装**:使用 `pyodide.loadPackagesFromImports()` 自动分析并安装代码中导入的依赖包。
|
||||||
|
- **按需执行垫片代码**:Worker 会检查传入的代码中是否包含 "matplotlib" 字符串。如果是,它会先执行一段 Python“垫片”代码确保图像输出到全局命名空间。
|
||||||
|
- **结果序列化**:执行结果通过 `.toJs()` 等方法被递归转换为可序列化的标准 JavaScript 对象。
|
||||||
|
- **返回结构化输出**:执行后,Worker 将一个包含 `id` 和 `output` 对象的-消息发回服务层。`output` 对象是一个结构化对象,包含 `result`、`text`、`error` 以及一个可选的 `image` 字段(用于 Base64 图像数据)。
|
||||||
|
|
||||||
|
### 数据流
|
||||||
|
|
||||||
|
最终的数据流如下:
|
||||||
|
|
||||||
|
1. **UI 层 ([CodeBlockView][codeblock-view-link])**: 用户点击“运行”按钮。
|
||||||
|
2. **服务层 ([PyodideService][pyodide-service-link])**:
|
||||||
|
- 接收到代码执行请求。
|
||||||
|
- 调用 Web Worker ([pyodide.worker.ts][pyodide-worker-link]),传递用户代码。
|
||||||
|
3. **Worker 层 ([pyodide.worker.ts][pyodide-worker-link])**:
|
||||||
|
- 加载 Pyodide 运行时。
|
||||||
|
- 动态安装代码中 `import` 语句声明的依赖包。
|
||||||
|
- **注入 Matplotlib 垫片**: 如果代码中包含 `matplotlib`,则在用户代码前拼接垫片代码,强制使用 `AGG` 后端。
|
||||||
|
- **执行代码并捕获输出**: 在代码执行后,检查 `matplotlib.pyplot` 的所有 figure,如果存在图像,则将其保存到内存中的 `BytesIO` 对象,并编码为 Base64 字符串。
|
||||||
|
- **结构化返回**: 将捕获的文本输出和 Base64 图像数据封装在一个 JSON 对象中 (`{ "text": "...", "image": "data:image/png;base64,..." }`) 返回给主线程。
|
||||||
|
4. **服务层 ([PyodideService][pyodide-service-link])**:
|
||||||
|
- 接收来自 Worker 的结构化数据。
|
||||||
|
- 将数据原样传递给 UI 层。
|
||||||
|
5. **UI 层 ([CodeBlockView][codeblock-view-link])**:
|
||||||
|
- 接收包含文本和图像数据的对象。
|
||||||
|
- 使用一个 `useState` 来管理执行结果 (`executionResult`)。
|
||||||
|
- 在界面上分别渲染文本输出和图像(如果存在)。
|
||||||
|
|
||||||
|
<!-- Link Definitions -->
|
||||||
|
|
||||||
|
[pyodide-link]: https://pyodide.org/
|
||||||
|
[codeblock-view-link]: /src/renderer/src/components/CodeBlockView/view.tsx
|
||||||
|
[pyodide-service-link]: /src/renderer/src/services/PyodideService.ts
|
||||||
|
[pyodide-worker-link]: /src/renderer/src/workers/pyodide.worker.ts
|
||||||
|
[statusbar-link]: /src/renderer/src/components/CodeBlockView/StatusBar.tsx
|
||||||
11
docs/technical/db.settings.md
Normal file
11
docs/technical/db.settings.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# 数据库设置字段
|
||||||
|
|
||||||
|
此文档包含部分字段的数据类型说明。
|
||||||
|
|
||||||
|
## 字段
|
||||||
|
|
||||||
|
| 字段名 | 类型 | 说明 |
|
||||||
|
| ------------------------------ | ------------------------------ | ------------ |
|
||||||
|
| `translate:target:language` | `LanguageCode` | 翻译目标语言 |
|
||||||
|
| `translate:source:language` | `LanguageCode` | 翻译源语言 |
|
||||||
|
| `translate:bidirectional:pair` | `[LanguageCode, LanguageCode]` | 双向翻译对 |
|
||||||
16
docs/technical/db.translate_languages.md
Normal file
16
docs/technical/db.translate_languages.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# `translate_languages` 表技术文档
|
||||||
|
|
||||||
|
## 📄 概述
|
||||||
|
|
||||||
|
`translate_languages` 记录用户自定义的的语言类型(`Language`)。
|
||||||
|
|
||||||
|
### 字段说明
|
||||||
|
|
||||||
|
| 字段名 | 类型 | 是否主键 | 索引 | 说明 |
|
||||||
|
| ---------- | ------ | -------- | ---- | ------------------------------------------------------------------------ |
|
||||||
|
| `id` | string | ✅ 是 | ✅ | 唯一标识符,主键 |
|
||||||
|
| `langCode` | string | ❌ 否 | ✅ | 语言代码(如:`zh-cn`, `en-us`, `ja-jp` 等,均为小写),支持普通索引查询 |
|
||||||
|
| `value` | string | ❌ 否 | ❌ | 语言的名称,用户输入 |
|
||||||
|
| `emoji` | string | ❌ 否 | ❌ | 语言的emoji,用户输入 |
|
||||||
|
|
||||||
|
> `langCode` 虽非主键,但在业务层应当避免重复插入相同语言代码。
|
||||||
177
docs/technical/how-to-i18n-en.md
Normal file
177
docs/technical/how-to-i18n-en.md
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
# How to Do i18n Gracefully
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> This document is machine translated from Chinese. While we strive for accuracy, there may be some imperfections in the translation.
|
||||||
|
|
||||||
|
## Enhance Development Experience with the i18n Ally Plugin
|
||||||
|
|
||||||
|
i18n Ally is a powerful VSCode extension that provides real-time feedback during development, helping developers detect missing or incorrect translations earlier.
|
||||||
|
|
||||||
|
The plugin has already been configured in the project — simply install it to get started.
|
||||||
|
|
||||||
|
### Advantages During Development
|
||||||
|
|
||||||
|
- **Real-time Preview**: Translated texts are displayed directly in the editor.
|
||||||
|
- **Error Detection**: Automatically tracks and highlights missing translations or unused keys.
|
||||||
|
- **Quick Navigation**: Jump to key definitions with Ctrl/Cmd + click.
|
||||||
|
- **Auto-completion**: Provides suggestions when typing i18n keys.
|
||||||
|
|
||||||
|
### Demo
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## i18n Conventions
|
||||||
|
|
||||||
|
### **Avoid Flat Structure at All Costs**
|
||||||
|
|
||||||
|
Never use flat structures like `"add.button.tip": "Add"`. Instead, adopt a clear nested structure:
|
||||||
|
|
||||||
|
```json
|
||||||
|
// Wrong - Flat structure
|
||||||
|
{
|
||||||
|
"add.button.tip": "Add",
|
||||||
|
"delete.button.tip": "Delete"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Correct - Nested structure
|
||||||
|
{
|
||||||
|
"add": {
|
||||||
|
"button": {
|
||||||
|
"tip": "Add"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"button": {
|
||||||
|
"tip": "Delete"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Why Use Nested Structure?
|
||||||
|
|
||||||
|
1. **Natural Grouping**: Related texts are logically grouped by their context through object nesting.
|
||||||
|
2. **Plugin Requirement**: Tools like i18n Ally require either flat or nested format to properly analyze translation files.
|
||||||
|
|
||||||
|
### **Avoid Template Strings in `t()`**
|
||||||
|
|
||||||
|
**We strongly advise against using template strings for dynamic interpolation.** While convenient in general JavaScript development, they cause several issues in i18n scenarios.
|
||||||
|
|
||||||
|
#### 1. **Plugin Cannot Track Dynamic Keys**
|
||||||
|
|
||||||
|
Tools like i18n Ally cannot parse dynamic content within template strings, resulting in:
|
||||||
|
|
||||||
|
- No real-time preview
|
||||||
|
- No detection of missing translations
|
||||||
|
- No navigation to key definitions
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Not recommended - Plugin cannot resolve
|
||||||
|
const message = t(`fruits.${fruit}`)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 2. **No Real-time Rendering in Editor**
|
||||||
|
|
||||||
|
Template strings appear as raw code instead of the final translated text in IDEs, degrading the development experience.
|
||||||
|
|
||||||
|
#### 3. **Harder to Maintain**
|
||||||
|
|
||||||
|
Since the plugin cannot track such usages, developers must manually verify the existence of corresponding keys in language files.
|
||||||
|
|
||||||
|
### Recommended Approach
|
||||||
|
|
||||||
|
To avoid missing keys, all dynamically translated texts should first maintain a `FooKeyMap`, then retrieve the translation text through a function.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// src/renderer/src/i18n/label.ts
|
||||||
|
const themeModeKeyMap = {
|
||||||
|
dark: 'settings.theme.dark',
|
||||||
|
light: 'settings.theme.light',
|
||||||
|
system: 'settings.theme.system'
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export const getThemeModeLabel = (key: string): string => {
|
||||||
|
return themeModeKeyMap[key] ? t(themeModeKeyMap[key]) : key
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
By avoiding template strings, you gain better developer experience, more reliable translation checks, and a more maintainable codebase.
|
||||||
|
|
||||||
|
## Automation Scripts
|
||||||
|
|
||||||
|
The project includes several scripts to automate i18n-related tasks:
|
||||||
|
|
||||||
|
### `check:i18n` - Validate i18n Structure
|
||||||
|
|
||||||
|
This script checks:
|
||||||
|
|
||||||
|
- Whether all language files use nested structure
|
||||||
|
- For missing or unused keys
|
||||||
|
- Whether keys are properly sorted
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn check:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### `sync:i18n` - Synchronize JSON Structure and Sort Order
|
||||||
|
|
||||||
|
This script uses `zh-cn.json` as the source of truth to sync structure across all language files, including:
|
||||||
|
|
||||||
|
1. Adding missing keys, with placeholder `[to be translated]`
|
||||||
|
2. Removing obsolete keys
|
||||||
|
3. Sorting keys automatically
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn sync:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### `auto:i18n` - Automatically Translate Pending Texts
|
||||||
|
|
||||||
|
This script fills in texts marked as `[to be translated]` using machine translation.
|
||||||
|
|
||||||
|
Typically, after adding new texts in `zh-cn.json`, run `sync:i18n`, then `auto:i18n` to complete translations.
|
||||||
|
|
||||||
|
Before using this script, set the required environment variables:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
API_KEY="sk-xxx"
|
||||||
|
BASE_URL="https://dashscope.aliyuncs.com/compatible-mode/v1/"
|
||||||
|
MODEL="qwen-plus-latest"
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, add these variables directly to your `.env` file.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn auto:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### `update:i18n` - Object-level Translation Update
|
||||||
|
|
||||||
|
Updates translations in language files under `src/renderer/src/i18n/translate` at the object level, preserving existing translations and only updating new content.
|
||||||
|
|
||||||
|
**Not recommended** — prefer `auto:i18n` for translation tasks.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn update:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### Workflow
|
||||||
|
|
||||||
|
1. During development, first add the required text in `zh-cn.json`
|
||||||
|
2. Confirm it displays correctly in the Chinese environment
|
||||||
|
3. Run `yarn sync:i18n` to propagate the keys to other language files
|
||||||
|
4. Run `yarn auto:i18n` to perform machine translation
|
||||||
|
5. Grab a coffee and let the magic happen!
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
|
||||||
|
1. **Use Chinese as Source Language**: All development starts in Chinese, then translates to other languages.
|
||||||
|
2. **Run Check Script Before Commit**: Use `yarn check:i18n` to catch i18n issues early.
|
||||||
|
3. **Translate in Small Increments**: Avoid accumulating a large backlog of untranslated content.
|
||||||
|
4. **Keep Keys Semantically Clear**: Keys should clearly express their purpose, e.g., `user.profile.avatar.upload.error`
|
||||||
171
docs/technical/how-to-i18n-zh.md
Normal file
171
docs/technical/how-to-i18n-zh.md
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
# 如何优雅地做好 i18n
|
||||||
|
|
||||||
|
## 使用i18n ally插件提升开发体验
|
||||||
|
|
||||||
|
i18n ally是一个强大的VSCode插件,它能在开发阶段提供实时反馈,帮助开发者更早发现文案缺失和错译问题。
|
||||||
|
|
||||||
|
项目中已经配置好了插件设置,直接安装即可。
|
||||||
|
|
||||||
|
### 开发时优势
|
||||||
|
|
||||||
|
- **实时预览**:翻译文案会直接显示在编辑器中
|
||||||
|
- **错误检测**:自动追踪标记出缺失的翻译或未使用的key
|
||||||
|
- **快速跳转**:可通过key直接跳转到定义处(Ctrl/Cmd + click)
|
||||||
|
- **自动补全**:输入i18n key时提供自动补全建议
|
||||||
|
|
||||||
|
### 效果展示
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## i18n 约定
|
||||||
|
|
||||||
|
### **绝对避免使用flat格式**
|
||||||
|
|
||||||
|
绝对避免使用flat格式,如`"add.button.tip": "添加"`。应采用清晰的嵌套结构:
|
||||||
|
|
||||||
|
```json
|
||||||
|
// 错误示例 - flat结构
|
||||||
|
{
|
||||||
|
"add.button.tip": "添加",
|
||||||
|
"delete.button.tip": "删除"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 正确示例 - 嵌套结构
|
||||||
|
{
|
||||||
|
"add": {
|
||||||
|
"button": {
|
||||||
|
"tip": "添加"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"button": {
|
||||||
|
"tip": "删除"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 为什么要使用嵌套结构
|
||||||
|
|
||||||
|
1. **自然分组**:通过对象结构天然能将相关上下文的文案分到一个组别中
|
||||||
|
2. **插件要求**:i18n ally 插件需要嵌套或flat格式其一的文件才能正常分析
|
||||||
|
|
||||||
|
### **避免在`t()`中使用模板字符串**
|
||||||
|
|
||||||
|
**强烈建议避免使用模板字符串**进行动态插值。虽然模板字符串在JavaScript开发中非常方便,但在国际化场景下会带来一系列问题。
|
||||||
|
|
||||||
|
1. **插件无法跟踪**
|
||||||
|
i18n ally等工具无法解析模板字符串中的动态内容,导致:
|
||||||
|
|
||||||
|
- 无法正确显示实时预览
|
||||||
|
- 无法检测翻译缺失
|
||||||
|
- 无法提供跳转到定义的功能
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// 不推荐 - 插件无法解析
|
||||||
|
const message = t(`fruits.${fruit}`)
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **编辑器无法实时渲染**
|
||||||
|
在IDE中,模板字符串会显示为原始代码而非最终翻译结果,降低了开发体验。
|
||||||
|
|
||||||
|
3. **更难以维护**
|
||||||
|
由于插件无法跟踪这样的文案,编辑器中也无法渲染,开发者必须人工确认语言文件中是否存在相应的文案。
|
||||||
|
|
||||||
|
### 推荐做法
|
||||||
|
|
||||||
|
为了避免键的缺失,所有需要动态翻译的文本都应当先维护一个`FooKeyMap`,再通过函数获取翻译文本。
|
||||||
|
|
||||||
|
例如:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// src/renderer/src/i18n/label.ts
|
||||||
|
const themeModeKeyMap = {
|
||||||
|
dark: 'settings.theme.dark',
|
||||||
|
light: 'settings.theme.light',
|
||||||
|
system: 'settings.theme.system'
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export const getThemeModeLabel = (key: string): string => {
|
||||||
|
return themeModeKeyMap[key] ? t(themeModeKeyMap[key]) : key
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
通过避免模板字符串,可以获得更好的开发体验、更可靠的翻译检查以及更易维护的代码库。
|
||||||
|
|
||||||
|
## 自动化脚本
|
||||||
|
|
||||||
|
项目中有一系列脚本来自动化i18n相关任务:
|
||||||
|
|
||||||
|
### `check:i18n` - 检查i18n结构
|
||||||
|
|
||||||
|
此脚本会检查:
|
||||||
|
|
||||||
|
- 所有语言文件是否为嵌套结构
|
||||||
|
- 是否存在缺失的key
|
||||||
|
- 是否存在多余的key
|
||||||
|
- 是否已经有序
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn check:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### `sync:i18n` - 同步json结构与排序
|
||||||
|
|
||||||
|
此脚本以`zh-cn.json`文件为基准,将结构同步到其他语言文件,包括:
|
||||||
|
|
||||||
|
1. 添加缺失的键。缺少的翻译内容会以`[to be translated]`标记
|
||||||
|
2. 删除多余的键
|
||||||
|
3. 自动排序
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn sync:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### `auto:i18n` - 自动翻译待翻译文本
|
||||||
|
|
||||||
|
次脚本自动将标记为待翻译的文本通过机器翻译填充。
|
||||||
|
|
||||||
|
通常,在`zh-cn.json`中添加所需文案后,执行`sync:i18n`即可自动完成翻译。
|
||||||
|
|
||||||
|
使用该脚本前,需要配置环境变量,例如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
API_KEY="sk-xxx"
|
||||||
|
BASE_URL="https://dashscope.aliyuncs.com/compatible-mode/v1/"
|
||||||
|
MODEL="qwen-plus-latest"
|
||||||
|
```
|
||||||
|
|
||||||
|
你也可以通过直接编辑`.env`文件来添加环境变量。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn auto:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### `update:i18n` - 对象级别翻译更新
|
||||||
|
|
||||||
|
对`src/renderer/src/i18n/translate`中的语言文件进行对象级别的翻译更新,保留已有翻译,只更新新增内容。
|
||||||
|
|
||||||
|
**不建议**使用该脚本,更推荐使用`auto:i18n`进行翻译。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn update:i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
### 工作流
|
||||||
|
|
||||||
|
1. 开发阶段,先在`zh-cn.json`中添加所需文案
|
||||||
|
2. 确认在中文环境下显示无误后,使用`yarn sync:i18n`将文案同步到其他语言文件
|
||||||
|
3. 使用`yarn auto:i18n`进行自动翻译
|
||||||
|
4. 喝杯咖啡,等翻译完成吧!
|
||||||
|
|
||||||
|
## 最佳实践
|
||||||
|
|
||||||
|
1. **以中文为源语言**:所有开发首先使用中文,再翻译为其他语言
|
||||||
|
2. **提交前运行检查脚本**:使用`yarn check:i18n`检查i18n是否有问题
|
||||||
|
3. **小步提交翻译**:避免积累大量未翻译文本
|
||||||
|
4. **保持key语义明确**:key应能清晰表达其用途,如`user.profile.avatar.upload.error`
|
||||||
191
docs/technical/how-to-use-logger-en.md
Normal file
191
docs/technical/how-to-use-logger-en.md
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
# How to use the LoggerService
|
||||||
|
|
||||||
|
This is a developer document on how to use the logger.
|
||||||
|
|
||||||
|
CherryStudio uses a unified logging service to print and record logs. **Unless there is a special reason, do not use `console.xxx` to print logs**.
|
||||||
|
|
||||||
|
The following are detailed instructions.
|
||||||
|
|
||||||
|
## Usage in the `main` process
|
||||||
|
|
||||||
|
### Importing
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { loggerService } from '@logger'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Setting module information (Required by convention)
|
||||||
|
|
||||||
|
After the import statements, set it up as follows:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const logger = loggerService.withContext('moduleName')
|
||||||
|
```
|
||||||
|
|
||||||
|
- `moduleName` is the name of the current file's module. It can be named after the filename, main class name, main function name, etc. The principle is to be clear and understandable.
|
||||||
|
- `moduleName` will be printed in the terminal and will also be present in the file log, making it easier to filter.
|
||||||
|
|
||||||
|
### Setting `CONTEXT` information (Optional)
|
||||||
|
|
||||||
|
In `withContext`, you can also set other `CONTEXT` information:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const logger = loggerService.withContext('moduleName', CONTEXT)
|
||||||
|
```
|
||||||
|
|
||||||
|
- `CONTEXT` is an object of the form `{ key: value, ... }`.
|
||||||
|
- `CONTEXT` information will not be printed in the terminal, but it will be recorded in the file log, making it easier to filter.
|
||||||
|
|
||||||
|
### Logging
|
||||||
|
|
||||||
|
In your code, you can call `logger` at any time to record logs. The supported levels are: `error`, `warn`, `info`, `verbose`, `debug`, and `silly`.
|
||||||
|
For the meaning of each level, please refer to the subsequent sections.
|
||||||
|
|
||||||
|
The following are the supported parameters for logging (using `logger.LEVEL` as an example, where `LEVEL` represents one of the levels mentioned above):
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
logger.LEVEL(message)
|
||||||
|
logger.LEVEL(message, CONTEXT)
|
||||||
|
logger.LEVEL(message, error)
|
||||||
|
logger.LEVEL(message, error, CONTEXT)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Only the four calling methods above are supported**.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `message` | `string` | Required. This is the core field of the log, containing the main content to be recorded. |
|
||||||
|
| `CONTEXT` | `object` | Optional. Additional information to be recorded in the log file. It is recommended to use the `{ key: value, ...}` format. |
|
||||||
|
| `error` | `Error` | Optional. The error stack trace will also be printed.<br />Note that the `error` caught by `catch(error)` is of the `unknown` type. According to TypeScript best practices, you should first use `instanceof` for type checking. If you are certain it is an `Error` type, you can also use a type assertion like `as Error`. |
|
||||||
|
|
||||||
|
#### Recording non-`object` type context information
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const foo = getFoo()
|
||||||
|
logger.debug(`foo ${foo}`)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Log Levels
|
||||||
|
|
||||||
|
- In the development environment, all log levels are printed to the terminal and recorded in the file log.
|
||||||
|
- In the production environment, the default log level is `info`. Logs are only recorded to the file and are not printed to the terminal.
|
||||||
|
|
||||||
|
Changing the log level:
|
||||||
|
|
||||||
|
- You can change the log level with `logger.setLevel('newLevel')`.
|
||||||
|
- `logger.resetLevel()` resets it to the default level.
|
||||||
|
- `logger.getLevel()` gets the current log level.
|
||||||
|
|
||||||
|
**Note:** Changing the log level has a global effect. Please do not change it arbitrarily in your code unless you are very clear about what you are doing.
|
||||||
|
|
||||||
|
## Usage in the `renderer` process
|
||||||
|
|
||||||
|
Usage in the `renderer` process for _importing_, _setting module information_, and _setting context information_ is **exactly the same** as in the `main` process.
|
||||||
|
The following section focuses on the differences.
|
||||||
|
|
||||||
|
### `initWindowSource`
|
||||||
|
|
||||||
|
In the `renderer` process, there are different `window`s. Before starting to use the `logger`, we must set the `window` information:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
loggerService.initWindowSource('windowName')
|
||||||
|
```
|
||||||
|
|
||||||
|
As a rule, we will set this in the `window`'s `entryPoint.tsx`. This ensures that `windowName` is set before it's used.
|
||||||
|
|
||||||
|
- An error will be thrown if `windowName` is not set, and the `logger` will not work.
|
||||||
|
- `windowName` can only be set once; subsequent attempts to set it will have no effect.
|
||||||
|
- `windowName` will not be printed in the `devTool`'s `console`, but it will be recorded in the `main` process terminal and the file log.
|
||||||
|
- `initWindowSource` returns the LoggerService instance, allowing for method chaining.
|
||||||
|
|
||||||
|
### Log Levels
|
||||||
|
|
||||||
|
- In the development environment, all log levels are printed to the `devTool`'s `console` by default.
|
||||||
|
- In the production environment, the default log level is `info`, and logs are printed to the `devTool`'s `console`.
|
||||||
|
- In both development and production environments, `warn` and `error` level logs are, by default, transmitted to the `main` process and recorded in the file log.
|
||||||
|
- In the development environment, the `main` process terminal will also print the logs transmitted from the renderer.
|
||||||
|
|
||||||
|
#### Changing the Log Level
|
||||||
|
|
||||||
|
Same as in the `main` process, you can manage the log level using `setLevel('level')`, `resetLevel()`, and `getLevel()`.
|
||||||
|
Similarly, changing the log level is a global adjustment.
|
||||||
|
|
||||||
|
#### Changing the Level Transmitted to `main`
|
||||||
|
|
||||||
|
Logs from the `renderer` are sent to `main` to be managed and recorded to a file centrally (according to `main`'s file logging level). By default, only `warn` and `error` level logs are transmitted to `main`.
|
||||||
|
|
||||||
|
There are two ways to change the log level for transmission to `main`:
|
||||||
|
|
||||||
|
##### Global Change
|
||||||
|
|
||||||
|
The following methods can be used to set, reset, and get the log level for transmission to `main`, respectively.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
logger.setLogToMainLevel('newLevel')
|
||||||
|
logger.resetLogToMainLevel()
|
||||||
|
logger.getLogToMainLevel()
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** This method has a global effect. Please do not change it arbitrarily in your code unless you are very clear about what you are doing.
|
||||||
|
|
||||||
|
##### Per-log Change
|
||||||
|
|
||||||
|
By adding `{ logToMain: true }` at the end of the log call, you can force a single log entry to be transmitted to `main` (bypassing the global log level restriction), for example:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
logger.info('message', { logToMain: true })
|
||||||
|
```
|
||||||
|
|
||||||
|
## About `worker` Threads
|
||||||
|
|
||||||
|
- Currently, logging is not supported for workers in the `main` process.
|
||||||
|
- Logging is supported for workers started in the `renderer` process, but currently these logs are not sent to `main` for recording.
|
||||||
|
|
||||||
|
### How to Use Logging in `renderer` Workers
|
||||||
|
|
||||||
|
Since worker threads are independent, using LoggerService in them is equivalent to using it in a new `renderer` window. Therefore, you must first call `initWindowSource`.
|
||||||
|
|
||||||
|
If the worker is relatively simple (just one file), you can also use method chaining directly:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const logger = loggerService.initWindowSource('Worker').withContext('LetsWork')
|
||||||
|
```
|
||||||
|
|
||||||
|
## Filtering Logs with Environment Variables
|
||||||
|
|
||||||
|
In a development environment, you can define environment variables to filter displayed logs by level and module. This helps developers focus on their specific logs and improves development efficiency.
|
||||||
|
|
||||||
|
Environment variables can be set in the terminal or defined in the `.env` file in the project's root directory. The available variables are as follows:
|
||||||
|
|
||||||
|
| Variable Name | Description |
|
||||||
|
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `CSLOGGER_MAIN_LEVEL` | Log level for the `main` process. Logs below this level will not be displayed. |
|
||||||
|
| `CSLOGGER_MAIN_SHOW_MODULES` | Filters log modules for the `main` process. Use a comma (`,`) to separate modules. The filter is case-sensitive. Only logs from modules in this list will be displayed. |
|
||||||
|
| `CSLOGGER_RENDERER_LEVEL` | Log level for the `renderer` process. Logs below this level will not be displayed. |
|
||||||
|
| `CSLOGGER_RENDERER_SHOW_MODULES` | Filters log modules for the `renderer` process. Use a comma (`,`) to separate modules. The filter is case-sensitive. Only logs from modules in this list will be displayed. |
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
CSLOGGER_MAIN_LEVEL=verbose
|
||||||
|
CSLOGGER_MAIN_SHOW_MODULES=MCPService,SelectionService
|
||||||
|
```
|
||||||
|
|
||||||
|
Note:
|
||||||
|
|
||||||
|
- Environment variables are only effective in the development environment.
|
||||||
|
- These variables only affect the logs displayed in the terminal or DevTools. They do not affect file logging or the `logToMain` recording logic.
|
||||||
|
|
||||||
|
## Log Level Usage Guidelines
|
||||||
|
|
||||||
|
There are many log levels. The following are the guidelines that should be followed in CherryStudio for when to use each level:
|
||||||
|
(Arranged from highest to lowest log level)
|
||||||
|
|
||||||
|
| Log Level | Core Definition & Use case | Example |
|
||||||
|
| :------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| **`error`** | **Critical error causing the program to crash or core functionality to become unusable.** <br> This is the highest-priority log, usually requiring immediate reporting or user notification. | - Main or renderer process crash. <br> - Failure to read/write critical user data files (e.g., database, configuration files), preventing the application from running. <br> - All unhandled exceptions. |
|
||||||
|
| **`warn`** | **Potential issue or unexpected situation that does not affect the program's core functionality.** <br> The program can recover or use a fallback. | - Configuration file `settings.json` is missing; started with default settings. <br> - Auto-update check failed, but does not affect the use of the current version. <br> - A non-essential plugin failed to load. |
|
||||||
|
| **`info`** | **Records application lifecycle events and key user actions.** <br> This is the default level that should be recorded in a production release to trace the user's main operational path. | - Application start, exit. <br> - User successfully opens/saves a file. <br> - Main window created/closed. <br> - Starting an important task (e.g., "Start video export"). |
|
||||||
|
| **`verbose`** | **More detailed flow information than `info`, used for tracing specific features.** <br> Enabled when diagnosing issues with a specific feature to help understand the internal execution flow. | - Loading `Toolbar` module. <br> - IPC message `open-file-dialog` sent from the renderer process. <br> - Applying filter 'Sepia' to the image. |
|
||||||
|
| **`debug`** | **Detailed diagnostic information used during development and debugging.** <br> **Must not be enabled by default in production releases**, as it may contain sensitive data and impact performance. | - Parameters for function `renderImage`: `{ width: 800, ... }`. <br> - Specific data content received by IPC message `save-file`. <br> - Details of Redux/Vuex state changes in the renderer process. |
|
||||||
|
| **`silly`** | **The most detailed, low-level information, used only for extreme debugging.** <br> Rarely used in regular development; only for solving very difficult problems. | - Real-time mouse coordinates `(x: 150, y: 320)`. <br> - Size of each data chunk when reading a file. <br> - Time taken for each rendered frame. |
|
||||||
194
docs/technical/how-to-use-logger-zh.md
Normal file
194
docs/technical/how-to-use-logger-zh.md
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
# 如何使用日志 LoggerService
|
||||||
|
|
||||||
|
这是关于如何使用日志的开发者文档。
|
||||||
|
|
||||||
|
CherryStudio使用统一的日志服务来打印和记录日志,**若无特殊原因,请勿使用`console.xxx`来打印日志**。
|
||||||
|
|
||||||
|
以下是详细说明。
|
||||||
|
|
||||||
|
## 在`main`进程中使用
|
||||||
|
|
||||||
|
### 引入
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { loggerService } from '@logger'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 设置module信息(规范要求)
|
||||||
|
|
||||||
|
在import头之后,设置:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const logger = loggerService.withContext('moduleName')
|
||||||
|
```
|
||||||
|
|
||||||
|
- `moduleName`是当前文件模块的名称,命名可以以文件名、主类名、主函数名等,原则是清晰明了
|
||||||
|
- `moduleName`会在终端中打印出来,也会在文件日志中体现,方便筛选
|
||||||
|
|
||||||
|
### 设置`CONTEXT`信息(可选)
|
||||||
|
|
||||||
|
在`withContext`中,也可以设置其他`CONTEXT`信息:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const logger = loggerService.withContext('moduleName', CONTEXT)
|
||||||
|
```
|
||||||
|
|
||||||
|
- `CONTEXT`为`{ key: value, ... }`
|
||||||
|
- `CONTEXT`信息不会在终端中打印出来,但是会在文件日志中记录,方便筛选
|
||||||
|
|
||||||
|
### 记录日志
|
||||||
|
|
||||||
|
在代码中,可以随时调用 `logger` 来记录日志,支持的级别有:`error`, `warn`, `info`, `verbose`, `debug`, `silly`。
|
||||||
|
|
||||||
|
各级别的含义,请参考后面的章节。
|
||||||
|
|
||||||
|
以下支持的记录日志的参数(以 `logger.LEVEL` 举例如何使用,`LEVEL`指代为上述级别):
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
logger.LEVEL(message)
|
||||||
|
logger.LEVEL(message, CONTEXT)
|
||||||
|
logger.LEVEL(message, error)
|
||||||
|
logger.LEVEL(message, error, CONTEXT)
|
||||||
|
```
|
||||||
|
|
||||||
|
**只支持上述四种调用方式**。
|
||||||
|
|
||||||
|
| 参数 | 类型 | 说明 |
|
||||||
|
| --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `message` | `string` | 必填项。这是日志的核心字段,记录的重点内容 |
|
||||||
|
| `CONTEXT` | `object` | 可选。其他需要再日志文件中记录的信息,建议为`{ key: value, ...}`格式 |
|
||||||
|
| `error` | `Error` | 可选。同时会打印错误堆栈信息。<br />注意`catch(error)`所捕获的`error`是`unknown`类型,按照`Typescript`最佳实践,请先用`instanceof`进行类型判断,如果确信一定是`Error`类型,也可用断言`as Error`。 |
|
||||||
|
|
||||||
|
#### 记录非`object`类型的上下文信息
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const foo = getFoo()
|
||||||
|
logger.debug(`foo ${foo}`)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 记录级别
|
||||||
|
|
||||||
|
- 开发环境下,所有级别的日志都会打印到终端,并且记录到文件日志中
|
||||||
|
- 生产环境下,默认记录级别为`info`,日志只会记录到文件,不会打印到终端
|
||||||
|
|
||||||
|
更改日志记录级别:
|
||||||
|
|
||||||
|
- 可以通过 `logger.setLevel('newLevel')` 来更改日志记录级别
|
||||||
|
- `logger.resetLevel()` 可以重置为默认级别
|
||||||
|
- `logger.getLevel()` 可以获取当前记录记录级别
|
||||||
|
|
||||||
|
**注意** 更改日志记录级别是全局生效的,请不要在代码中随意更改,除非你非常清楚自己在做什么
|
||||||
|
|
||||||
|
## 在`renderer`进程中使用
|
||||||
|
|
||||||
|
在`renderer`进程中使用,_引入方法_、_设置`module`信息_、*设置`context`信息的方法*和`main`进程中是**完全一样**的。
|
||||||
|
|
||||||
|
下面着重讲一下不同之处。
|
||||||
|
|
||||||
|
### `initWindowSource`
|
||||||
|
|
||||||
|
`renderer`进程中,有不同的`window`,在开始使用`logger`之前,我们必须设置`window`信息:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
loggerService.initWindowSource('windowName')
|
||||||
|
```
|
||||||
|
|
||||||
|
原则上,我们将在`window`的`entryPoint.tsx`中进行设置,这可以保证`windowName`在开始使用前已经设置好了。
|
||||||
|
|
||||||
|
- 未设置`windowName`会报错,`logger`将不起作用
|
||||||
|
- `windowName`只能设置一次,重复设置将不生效
|
||||||
|
- `windowName`不会在`devTool`的`console`中打印出来,但是会在`main`进程的终端和文件日志中记录
|
||||||
|
- `initWindowSource`返回的是LoggerService的实例,因此可以做链式调用
|
||||||
|
|
||||||
|
### 记录级别
|
||||||
|
|
||||||
|
- 开发环境下,默认所有级别的日志都会打印到`devTool`的`console`
|
||||||
|
- 生产环境下,默认记录级别为`info`,日志会打印到`devTool`的`console`
|
||||||
|
- 在开发和生产环境下,默认`warn`和`error`级别的日志,会传输给`main`进程,并记录到文件日志
|
||||||
|
- 开发环境下,`main`进程终端中也会打印传输过来的日志
|
||||||
|
|
||||||
|
#### 更改日志记录级别
|
||||||
|
|
||||||
|
和`main`进程中一样,你可以通过`setLevel('level')`、`resetLevel()`和`getLevel()`来管理日志记录级别。
|
||||||
|
|
||||||
|
同样,该日志记录级别也是全局调整的。
|
||||||
|
|
||||||
|
#### 更改传输到`main`的级别
|
||||||
|
|
||||||
|
将`renderer`的日志发送到`main`,并由`main`统一管理和记录到文件(根据`main`的记录到文件的级别),默认只有`warn`和`error`级别的日志会传输到`main`
|
||||||
|
|
||||||
|
有以下两种方式,可以更改传输到`main`的日志级别:
|
||||||
|
|
||||||
|
##### 全局更改
|
||||||
|
|
||||||
|
以下方法可以分别设置、重置和获取传输到`main`的日志级别
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
logger.setLogToMainLevel('newLevel')
|
||||||
|
logger.resetLogToMainLevel()
|
||||||
|
logger.getLogToMainLevel()
|
||||||
|
```
|
||||||
|
|
||||||
|
**注意** 该方法是全局生效的,请不要在代码中随意更改,除非你非常清楚自己在做什么
|
||||||
|
|
||||||
|
##### 单条更改
|
||||||
|
|
||||||
|
在日志记录的最末尾,加上`{ logToMain: true }`,即可将本条日志传输到`main`(不受全局日志级别限制),例如:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
logger.info('message', { logToMain: true })
|
||||||
|
```
|
||||||
|
|
||||||
|
## 关于`worker`线程
|
||||||
|
|
||||||
|
- 现在不支持`main`进程中的`worker`的日志。
|
||||||
|
- 支持`renderer`中起的`worker`的日志,但是现在该日志不会发送给`main`进行记录。
|
||||||
|
|
||||||
|
### 如何在`renderer`的`worker`中使用日志
|
||||||
|
|
||||||
|
由于`worker`线程是独立的,在其中使用LoggerService,等同于在一个新`renderer`窗口中使用。因此也必须先`initWindowSource`。
|
||||||
|
|
||||||
|
如果`worker`比较简单,只有一个文件,也可以使用链式语法直接使用:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const logger = loggerService.initWindowSource('Worker').withContext('LetsWork')
|
||||||
|
```
|
||||||
|
|
||||||
|
## 使用环境变量来筛选要显示的日志
|
||||||
|
|
||||||
|
在开发环境中,可以通过环境变量的定义,来筛选要显示的日志的级别和module。开发者可以专注于自己的日志,提高开发效率。
|
||||||
|
|
||||||
|
环境变量可以在终端中自行设置,或者在开发根目录的`.env`文件中进行定义,可以定义的变量如下:
|
||||||
|
|
||||||
|
| 变量名 | 含义 |
|
||||||
|
| -------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||||
|
| `CSLOGGER_MAIN_LEVEL` | 用于`main`进程的日志级别,低于该级别的日志将不显示 |
|
||||||
|
| `CSLOGGER_MAIN_SHOW_MODULES` | 用于`main`进程的日志module筛选,用`,`分隔,区分大小写。只有在该列表中的module的日志才会显示 |
|
||||||
|
| `CSLOGGER_RENDERER_LEVEL` | 用于`renderer`进程的日志级别,低于该级别的日志将不显示 |
|
||||||
|
| `CSLOGGER_RENDERER_SHOW_MODULES` | 用于`renderer`进程的日志module筛选,用`,`分隔,区分大小写。只有在该列表中的module的日志才会显示 |
|
||||||
|
|
||||||
|
示例:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
CSLOGGER_MAIN_LEVEL=verbose
|
||||||
|
CSLOGGER_MAIN_SHOW_MODULES=MCPService,SelectionService
|
||||||
|
```
|
||||||
|
|
||||||
|
注意:
|
||||||
|
|
||||||
|
- 环境变量仅在开发环境中生效
|
||||||
|
- 该变量仅会改变在终端或在devTools中显示的日志,不会影响文件日志和`logToMain`的记录逻辑
|
||||||
|
|
||||||
|
## 日志级别的使用规范
|
||||||
|
|
||||||
|
日志有很多级别,什么时候应该用哪个级别,下面是在CherryStudio中应该遵循的规范:
|
||||||
|
(按日志级别从高到低排列)
|
||||||
|
|
||||||
|
| 日志级别 | 核心定义与使用场景 | 示例 |
|
||||||
|
| :------------ | :------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| **`error`** | **严重错误,导致程序崩溃或核心功能无法使用。** <br> 这是最高优的日志,通常需要立即上报或提示用户。 | - 主进程或渲染进程崩溃。 <br> - 无法读写用户关键数据文件(如数据库、配置文件),导致应用无法运行。<br> - 所有未捕获的异常。 |
|
||||||
|
| **`warn`** | **潜在问题或非预期情况,但不影响程序核心功能。** <br> 程序可以从中恢复或使用备用方案。 | - 配置文件 `settings.json` 缺失,已使用默认配置启动。 <br> - 自动更新检查失败,但不影响当前版本使用。<br> - 某个非核心插件加载失败。 |
|
||||||
|
| **`info`** | **记录应用生命周期和关键用户行为。** <br> 这是发布版中默认应记录的级别,用于追踪用户的主要操作路径。 | - 应用启动、退出。<br> - 用户成功打开/保存文件。 <br> - 主窗口创建/关闭。<br> - 开始执行一项重要任务(如“开始导出视频”)。 |
|
||||||
|
| **`verbose`** | **比 `info` 更详细的流程信息,用于追踪特定功能。** <br> 在诊断特定功能问题时开启,帮助理解内部执行流程。 | - 正在加载 `Toolbar` 模块。 <br> - IPC 消息 `open-file-dialog` 已从渲染进程发送。<br> - 正在应用滤镜 'Sepia' 到图像。 |
|
||||||
|
| **`debug`** | **开发和调试时使用的详细诊断信息。** <br> **严禁在发布版中默认开启**,因为它可能包含敏感数据并影响性能。 | - 函数 `renderImage` 的入参: `{ width: 800, ... }`。<br> - IPC 消息 `save-file` 收到的具体数据内容。<br> - 渲染进程中 Redux/Vuex 的 state 变更详情。 |
|
||||||
|
| **`silly`** | **最详尽的底层信息,仅用于极限调试。** <br> 几乎不在常规开发中使用,仅为解决棘手问题。 | - 鼠标移动的实时坐标 `(x: 150, y: 320)`。<br> - 读取文件时每个数据块(chunk)的大小。<br> - 每一次渲染帧的耗时。 |
|
||||||
212
docs/technical/how-to-write-middlewares.md
Normal file
212
docs/technical/how-to-write-middlewares.md
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
# 如何为 AI Provider 编写中间件
|
||||||
|
|
||||||
|
本文档旨在指导开发者如何为我们的 AI Provider 框架创建和集成自定义中间件。中间件提供了一种强大而灵活的方式来增强、修改或观察 Provider 方法的调用过程,例如日志记录、缓存、请求/响应转换、错误处理等。
|
||||||
|
|
||||||
|
## 架构概览
|
||||||
|
|
||||||
|
我们的中间件架构借鉴了 Redux 的三段式设计,并结合了 JavaScript Proxy 来动态地将中间件应用于 Provider 的方法。
|
||||||
|
|
||||||
|
- **Proxy**: 拦截对 Provider 方法的调用,并将调用引导至中间件链。
|
||||||
|
- **中间件链**: 一系列按顺序执行的中间件函数。每个中间件都可以处理请求/响应,然后将控制权传递给链中的下一个中间件,或者在某些情况下提前终止链。
|
||||||
|
- **上下文 (Context)**: 一个在中间件之间传递的对象,携带了关于当前调用的信息(如方法名、原始参数、Provider 实例、以及中间件自定义的数据)。
|
||||||
|
|
||||||
|
## 中间件的类型
|
||||||
|
|
||||||
|
目前主要支持两种类型的中间件,它们共享相似的结构但针对不同的场景:
|
||||||
|
|
||||||
|
1. **`CompletionsMiddleware`**: 专门为 `completions` 方法设计。这是最常用的中间件类型,因为它允许对 AI 模型的核心聊天/文本生成功能进行精细控制。
|
||||||
|
2. **`ProviderMethodMiddleware`**: 通用中间件,可以应用于 Provider 上的任何其他方法(例如,`translate`, `summarize` 等,如果这些方法也通过中间件系统包装)。
|
||||||
|
|
||||||
|
## 编写一个 `CompletionsMiddleware`
|
||||||
|
|
||||||
|
`CompletionsMiddleware` 的基本签名(TypeScript 类型)如下:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { AiProviderMiddlewareCompletionsContext, CompletionsParams, MiddlewareAPI } from './AiProviderMiddlewareTypes' // 假设类型定义文件路径
|
||||||
|
|
||||||
|
export type CompletionsMiddleware = (
|
||||||
|
api: MiddlewareAPI<AiProviderMiddlewareCompletionsContext, [CompletionsParams]>
|
||||||
|
) => (
|
||||||
|
next: (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams) => Promise<any> // next 返回 Promise<any> 代表原始SDK响应或下游中间件的结果
|
||||||
|
) => (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams) => Promise<void> // 最内层函数通常返回 Promise<void>,因为结果通过 onChunk 或 context 副作用传递
|
||||||
|
```
|
||||||
|
|
||||||
|
让我们分解这个三段式结构:
|
||||||
|
|
||||||
|
1. **第一层函数 `(api) => { ... }`**:
|
||||||
|
|
||||||
|
- 接收一个 `api` 对象。
|
||||||
|
- `api` 对象提供了以下方法:
|
||||||
|
- `api.getContext()`: 获取当前调用的上下文对象 (`AiProviderMiddlewareCompletionsContext`)。
|
||||||
|
- `api.getOriginalArgs()`: 获取传递给 `completions` 方法的原始参数数组 (即 `[CompletionsParams]`)。
|
||||||
|
- `api.getProviderId()`: 获取当前 Provider 的 ID。
|
||||||
|
- `api.getProviderInstance()`: 获取原始的 Provider 实例。
|
||||||
|
- 此函数通常用于进行一次性的设置或获取所需的服务/配置。它返回第二层函数。
|
||||||
|
|
||||||
|
2. **第二层函数 `(next) => { ... }`**:
|
||||||
|
|
||||||
|
- 接收一个 `next` 函数。
|
||||||
|
- `next` 函数代表了中间件链中的下一个环节。调用 `next(context, params)` 会将控制权传递给下一个中间件,或者如果当前中间件是链中的最后一个,则会调用核心的 Provider 方法逻辑 (例如,实际的 SDK 调用)。
|
||||||
|
- `next` 函数接收当前的 `context` 和 `params` (这些可能已被上游中间件修改)。
|
||||||
|
- **重要的是**:`next` 的返回类型通常是 `Promise<any>`。对于 `completions` 方法,如果 `next` 调用了实际的 SDK,它将返回原始的 SDK 响应(例如,OpenAI 的流对象或 JSON 对象)。你需要处理这个响应。
|
||||||
|
- 此函数返回第三层(也是最核心的)函数。
|
||||||
|
|
||||||
|
3. **第三层函数 `(context, params) => { ... }`**:
|
||||||
|
- 这是执行中间件主要逻辑的地方。
|
||||||
|
- 它接收当前的 `context` (`AiProviderMiddlewareCompletionsContext`) 和 `params` (`CompletionsParams`)。
|
||||||
|
- 在此函数中,你可以:
|
||||||
|
- **在调用 `next` 之前**:
|
||||||
|
- 读取或修改 `params`。例如,添加默认参数、转换消息格式。
|
||||||
|
- 读取或修改 `context`。例如,设置一个时间戳用于后续计算延迟。
|
||||||
|
- 执行某些检查,如果不满足条件,可以不调用 `next` 而直接返回或抛出错误(例如,参数校验失败)。
|
||||||
|
- **调用 `await next(context, params)`**:
|
||||||
|
- 这是将控制权传递给下游的关键步骤。
|
||||||
|
- `next` 的返回值是原始的 SDK 响应或下游中间件的结果,你需要根据情况处理它(例如,如果是流,则开始消费流)。
|
||||||
|
- **在调用 `next` 之后**:
|
||||||
|
- 处理 `next` 的返回结果。例如,如果 `next` 返回了一个流,你可以在这里开始迭代处理这个流,并通过 `context.onChunk` 发送数据块。
|
||||||
|
- 基于 `context` 的变化或 `next` 的结果执行进一步操作。例如,计算总耗时、记录日志。
|
||||||
|
- 修改最终结果(尽管对于 `completions`,结果通常通过 `onChunk` 副作用发出)。
|
||||||
|
|
||||||
|
### 示例:一个简单的日志中间件
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import {
|
||||||
|
AiProviderMiddlewareCompletionsContext,
|
||||||
|
CompletionsParams,
|
||||||
|
MiddlewareAPI,
|
||||||
|
OnChunkFunction // 假设 OnChunkFunction 类型被导出
|
||||||
|
} from './AiProviderMiddlewareTypes' // 调整路径
|
||||||
|
import { ChunkType } from '@renderer/types' // 调整路径
|
||||||
|
|
||||||
|
export const createSimpleLoggingMiddleware = (): CompletionsMiddleware => {
|
||||||
|
return (api: MiddlewareAPI<AiProviderMiddlewareCompletionsContext, [CompletionsParams]>) => {
|
||||||
|
return (next: (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams) => Promise<any>) => {
|
||||||
|
return async (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams): Promise<void> => {
|
||||||
|
const startTime = Date.now()
|
||||||
|
// 从 context 中获取 onChunk (它最初来自 params.onChunk)
|
||||||
|
const onChunk = context.onChunk
|
||||||
|
|
||||||
|
logger.debug(
|
||||||
|
`[LoggingMiddleware] Request for ${context.methodName} with params:`,
|
||||||
|
params.messages?.[params.messages.length - 1]?.content
|
||||||
|
)
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 调用下一个中间件或核心逻辑
|
||||||
|
// `rawSdkResponse` 是来自下游的原始响应 (例如 OpenAIStream 或 ChatCompletion 对象)
|
||||||
|
const rawSdkResponse = await next(context, params)
|
||||||
|
|
||||||
|
// 此处简单示例不处理 rawSdkResponse,假设下游中间件 (如 StreamingResponseHandler)
|
||||||
|
// 会处理它并通过 onChunk 发送数据。
|
||||||
|
// 如果这个日志中间件在 StreamingResponseHandler 之后,那么流已经被处理。
|
||||||
|
// 如果在之前,那么它需要自己处理 rawSdkResponse 或确保下游会处理。
|
||||||
|
|
||||||
|
const duration = Date.now() - startTime
|
||||||
|
logger.debug(`[LoggingMiddleware] Request for ${context.methodName} completed in ${duration}ms.`)
|
||||||
|
|
||||||
|
// 假设下游已经通过 onChunk 发送了所有数据。
|
||||||
|
// 如果这个中间件是链的末端,并且需要确保 BLOCK_COMPLETE 被发送,
|
||||||
|
// 它可能需要更复杂的逻辑来跟踪何时所有数据都已发送。
|
||||||
|
} catch (error) {
|
||||||
|
const duration = Date.now() - startTime
|
||||||
|
logger.error(`[LoggingMiddleware] Request for ${context.methodName} failed after ${duration}ms:`, error)
|
||||||
|
|
||||||
|
// 如果 onChunk 可用,可以尝试发送一个错误块
|
||||||
|
if (onChunk) {
|
||||||
|
onChunk({
|
||||||
|
type: ChunkType.ERROR,
|
||||||
|
error: { message: (error as Error).message, name: (error as Error).name, stack: (error as Error).stack }
|
||||||
|
})
|
||||||
|
// 考虑是否还需要发送 BLOCK_COMPLETE 来结束流
|
||||||
|
onChunk({ type: ChunkType.BLOCK_COMPLETE, response: {} })
|
||||||
|
}
|
||||||
|
throw error // 重新抛出错误,以便上层或全局错误处理器可以捕获
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `AiProviderMiddlewareCompletionsContext` 的重要性
|
||||||
|
|
||||||
|
`AiProviderMiddlewareCompletionsContext` 是在中间件之间传递状态和数据的核心。它通常包含:
|
||||||
|
|
||||||
|
- `methodName`: 当前调用的方法名 (总是 `'completions'`)。
|
||||||
|
- `originalArgs`: 传递给 `completions` 的原始参数数组。
|
||||||
|
- `providerId`: Provider 的 ID。
|
||||||
|
- `_providerInstance`: Provider 实例。
|
||||||
|
- `onChunk`: 从原始 `CompletionsParams` 传入的回调函数,用于流式发送数据块。**所有中间件都应该通过 `context.onChunk` 来发送数据。**
|
||||||
|
- `messages`, `model`, `assistant`, `mcpTools`: 从原始 `CompletionsParams` 中提取的常用字段,方便访问。
|
||||||
|
- **自定义字段**: 中间件可以向上下文中添加自定义字段,以供后续中间件使用。例如,一个缓存中间件可能会添加 `context.cacheHit = true`。
|
||||||
|
|
||||||
|
**关键**: 当你在中间件中修改 `params` 或 `context` 时,这些修改会向下游中间件传播(如果它们在 `next` 调用之前修改)。
|
||||||
|
|
||||||
|
### 中间件的顺序
|
||||||
|
|
||||||
|
中间件的执行顺序非常重要。它们在 `AiProviderMiddlewareConfig` 的数组中定义的顺序就是它们的执行顺序。
|
||||||
|
|
||||||
|
- 请求首先通过第一个中间件,然后是第二个,依此类推。
|
||||||
|
- 响应(或 `next` 的调用结果)则以相反的顺序"冒泡"回来。
|
||||||
|
|
||||||
|
例如,如果链是 `[AuthMiddleware, CacheMiddleware, LoggingMiddleware]`:
|
||||||
|
|
||||||
|
1. `AuthMiddleware` 先执行其 "调用 `next` 之前" 的逻辑。
|
||||||
|
2. 然后 `CacheMiddleware` 执行其 "调用 `next` 之前" 的逻辑。
|
||||||
|
3. 然后 `LoggingMiddleware` 执行其 "调用 `next` 之前" 的逻辑。
|
||||||
|
4. 核心SDK调用(或链的末端)。
|
||||||
|
5. `LoggingMiddleware` 先接收到结果,执行其 "调用 `next` 之后" 的逻辑。
|
||||||
|
6. 然后 `CacheMiddleware` 接收到结果(可能已被 LoggingMiddleware 修改的上下文),执行其 "调用 `next` 之后" 的逻辑(例如,存储结果)。
|
||||||
|
7. 最后 `AuthMiddleware` 接收到结果,执行其 "调用 `next` 之后" 的逻辑。
|
||||||
|
|
||||||
|
### 注册中间件
|
||||||
|
|
||||||
|
中间件在 `src/renderer/src/providers/middleware/register.ts` (或其他类似的配置文件) 中进行注册。
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// register.ts
|
||||||
|
import { AiProviderMiddlewareConfig } from './AiProviderMiddlewareTypes'
|
||||||
|
import { createSimpleLoggingMiddleware } from './common/SimpleLoggingMiddleware' // 假设你创建了这个文件
|
||||||
|
import { createCompletionsLoggingMiddleware } from './common/CompletionsLoggingMiddleware' // 已有的
|
||||||
|
|
||||||
|
const middlewareConfig: AiProviderMiddlewareConfig = {
|
||||||
|
completions: [
|
||||||
|
createSimpleLoggingMiddleware(), // 你新加的中间件
|
||||||
|
createCompletionsLoggingMiddleware() // 已有的日志中间件
|
||||||
|
// ... 其他 completions 中间件
|
||||||
|
],
|
||||||
|
methods: {
|
||||||
|
// translate: [createGenericLoggingMiddleware()],
|
||||||
|
// ... 其他方法的中间件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default middlewareConfig
|
||||||
|
```
|
||||||
|
|
||||||
|
### 最佳实践
|
||||||
|
|
||||||
|
1. **单一职责**: 每个中间件应专注于一个特定的功能(例如,日志、缓存、转换特定数据)。
|
||||||
|
2. **无副作用 (尽可能)**: 除了通过 `context` 或 `onChunk` 明确的副作用外,尽量避免修改全局状态或产生其他隐蔽的副作用。
|
||||||
|
3. **错误处理**:
|
||||||
|
- 在中间件内部使用 `try...catch` 来处理可能发生的错误。
|
||||||
|
- 决定是自行处理错误(例如,通过 `onChunk` 发送错误块)还是将错误重新抛出给上游。
|
||||||
|
- 如果重新抛出,确保错误对象包含足够的信息。
|
||||||
|
4. **性能考虑**: 中间件会增加请求处理的开销。避免在中间件中执行非常耗时的同步操作。对于IO密集型操作,确保它们是异步的。
|
||||||
|
5. **可配置性**: 使中间件的行为可通过参数或配置进行调整。例如,日志中间件可以接受一个日志级别参数。
|
||||||
|
6. **上下文管理**:
|
||||||
|
- 谨慎地向 `context` 添加数据。避免污染 `context` 或添加过大的对象。
|
||||||
|
- 明确你添加到 `context` 的字段的用途和生命周期。
|
||||||
|
7. **`next` 的调用**:
|
||||||
|
- 除非你有充分的理由提前终止请求(例如,缓存命中、授权失败),否则**总是确保调用 `await next(context, params)`**。否则,下游的中间件和核心逻辑将不会执行。
|
||||||
|
- 理解 `next` 的返回值并正确处理它,特别是当它是一个流时。你需要负责消费这个流或将其传递给另一个能够消费它的组件/中间件。
|
||||||
|
8. **命名清晰**: 给你的中间件和它们创建的函数起描述性的名字。
|
||||||
|
9. **文档和注释**: 对复杂的中间件逻辑添加注释,解释其工作原理和目的。
|
||||||
|
|
||||||
|
### 调试技巧
|
||||||
|
|
||||||
|
- 在中间件的关键点使用 `logger.debug` 或调试器来检查 `params`、`context` 的状态以及 `next` 的返回值。
|
||||||
|
- 暂时简化中间件链,只保留你正在调试的中间件和最简单的核心逻辑,以隔离问题。
|
||||||
|
- 编写单元测试来独立验证每个中间件的行为。
|
||||||
|
|
||||||
|
通过遵循这些指南,你应该能够有效地为我们的系统创建强大且可维护的中间件。如果你有任何疑问或需要进一步的帮助,请咨询团队。
|
||||||
99
docs/testplan-en.md
Normal file
99
docs/testplan-en.md
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
# Test Plan
|
||||||
|
|
||||||
|
To provide users with a more stable application experience and faster iteration speed, Cherry Studio has launched the "Test Plan".
|
||||||
|
|
||||||
|
## User Guide
|
||||||
|
|
||||||
|
The Test Plan is divided into the RC channel and the Beta channel, with the following differences:
|
||||||
|
|
||||||
|
- **RC (Release Candidate)**: The features are stable, with fewer bugs, and it is close to the official release.
|
||||||
|
- **Beta**: Features may change at any time, and there may be more bugs, but users can experience future features earlier.
|
||||||
|
|
||||||
|
Users can enable the "Test Plan" and select the version channel in the software's `Settings` > `About`. Please note that the versions in the "Test Plan" cannot guarantee data consistency, so be sure to back up your data before using them.
|
||||||
|
|
||||||
|
Users are welcome to submit issues or provide feedback through other channels for any bugs encountered during testing. Your feedback is very important to us.
|
||||||
|
|
||||||
|
## Developer Guide
|
||||||
|
|
||||||
|
### Participating in the Test Plan
|
||||||
|
|
||||||
|
Developers should submit `PRs` according to the [Contributor Guide](../CONTRIBUTING.md) (and ensure the target branch is `main`). The repository maintainers will evaluate whether the `PR` should be included in the Test Plan based on factors such as the impact of the feature on the application, its importance, and whether broader testing is needed.
|
||||||
|
|
||||||
|
If the `PR` is added to the Test Plan, the repository maintainers will:
|
||||||
|
|
||||||
|
- Notify the `PR` submitter.
|
||||||
|
- Set the PR to `draft` status (to avoid accidental merging into `main` before testing is complete).
|
||||||
|
- Set the `milestone` to the specific Test Plan version.
|
||||||
|
- Modify the `PR` title.
|
||||||
|
|
||||||
|
During participation in the Test Plan, `PR` submitters should:
|
||||||
|
|
||||||
|
- Keep the `PR` branch synchronized with the latest `main` (i.e., the `PR` branch should always be based on the latest `main` code).
|
||||||
|
- Ensure the `PR` branch is conflict-free.
|
||||||
|
- Actively respond to comments & reviews and fix bugs.
|
||||||
|
- Enable maintainers to modify the `PR` branch to allow for bug fixes at any time.
|
||||||
|
|
||||||
|
Inclusion in the Test Plan does not guarantee the final merging of the `PR`. It may be shelved due to immature features or poor testing feedback.
|
||||||
|
|
||||||
|
### Test Plan Lead
|
||||||
|
|
||||||
|
A maintainer will be assigned as the lead for a specific version (e.g., `1.5.0-rc`). The responsibilities of the Test Plan lead include:
|
||||||
|
|
||||||
|
- Determining whether a `PR` meets the Test Plan requirements and deciding whether it should be included in the current Test Plan.
|
||||||
|
- Modifying the status of `PRs` added to the Test Plan and communicating relevant matters with the `PR` submitter.
|
||||||
|
- Before the Test Plan release, merging the branches of `PRs` added to the Test Plan (using squash merge) into the corresponding version branch of `testplan` and resolving conflicts.
|
||||||
|
- Ensuring the `testplan` branch is synchronized with the latest `main`.
|
||||||
|
- Overseeing the Test Plan release.
|
||||||
|
|
||||||
|
## In-Depth Understanding
|
||||||
|
|
||||||
|
### About `PRs`
|
||||||
|
|
||||||
|
A `PR` is a collection of a specific branch (and commits), comments, reviews, and other information, and it is the **smallest management unit** of the Test Plan.
|
||||||
|
|
||||||
|
Compared to submitting all features to a single branch, the Test Plan manages features through `PRs`, which offers greater flexibility and efficiency:
|
||||||
|
|
||||||
|
- Features can be added or removed between different versions of the Test Plan without cumbersome `revert` operations.
|
||||||
|
- Clear feature boundaries and responsibilities are established. Bug fixes are completed within their respective `PRs`, isolating cross-impact and better tracking progress.
|
||||||
|
- The `PR` submitter is responsible for resolving conflicts with the latest `main`. The Test Plan lead is responsible for resolving conflicts between `PR` branches. However, since features added to the Test Plan are relatively independent (in other words, if a feature has broad implications, it should be independently included in the Test Plan), conflicts are generally few or simple.
|
||||||
|
|
||||||
|
### The `testplan` Branch
|
||||||
|
|
||||||
|
The `testplan` branch is a **temporary** branch used for Test Plan releases.
|
||||||
|
|
||||||
|
Note:
|
||||||
|
|
||||||
|
- **Do not develop based on this branch**. It may change or even be deleted at any time, and there is no guarantee of commit completeness or order.
|
||||||
|
- **Do not submit `commits` or `PRs` to this branch**, as they will not be retained.
|
||||||
|
- The `testplan` branch is always based on the latest `main` branch (not on a released version), with features added on top.
|
||||||
|
|
||||||
|
#### RC Branch
|
||||||
|
|
||||||
|
Branch name: `testplan/rc/x.y.z`
|
||||||
|
|
||||||
|
Used for RC releases, where `x.y.z` is the target version number. Note that whether it is rc.1 or rc.5, as long as the major version number is `x.y.z`, it is completed in this branch.
|
||||||
|
|
||||||
|
Generally, the version number for releases from this branch is named `x.y.z-rc.n`.
|
||||||
|
|
||||||
|
#### Beta Branch
|
||||||
|
|
||||||
|
Branch name: `testplan/beta/x.y.z`
|
||||||
|
|
||||||
|
Used for Beta releases, where `x.y.z` is the target version number. Note that whether it is beta.1 or beta.5, as long as the major version number is `x.y.z`, it is completed in this branch.
|
||||||
|
|
||||||
|
Generally, the version number for releases from this branch is named `x.y.z-beta.n`.
|
||||||
|
|
||||||
|
### Version Rules
|
||||||
|
|
||||||
|
The application version number for the Test Plan is: `x.y.z-CHA.n`, where:
|
||||||
|
|
||||||
|
- `x.y.z` is the conventional version number, referred to here as the **target version number**.
|
||||||
|
- `CHA` is the channel code (Channel), currently divided into `rc` and `beta`.
|
||||||
|
- `n` is the release number, starting from `1`.
|
||||||
|
|
||||||
|
Examples of complete version numbers: `1.5.0-rc.3`, `1.5.1-beta.1`, `1.6.0-beta.6`.
|
||||||
|
|
||||||
|
The **target version number** of the Test Plan points to the official version number where these features are expected to be added. For example:
|
||||||
|
|
||||||
|
- `1.5.0-rc.3` means this is a preview of the `1.5.0` official release (the current latest official release is `1.4.9`, and `1.5.0` has not yet been officially released).
|
||||||
|
- `1.5.1-beta.1` means this is a beta version of the `1.5.1` official release (the current latest official release is `1.5.0`, and `1.5.1` has not yet been officially released).
|
||||||
99
docs/testplan-zh.md
Normal file
99
docs/testplan-zh.md
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
# 测试计划
|
||||||
|
|
||||||
|
为了给用户提供更稳定的应用体验,并提供更快的迭代速度,Cherry Studio推出“测试计划”。
|
||||||
|
|
||||||
|
## 用户指南
|
||||||
|
|
||||||
|
测试计划分为RC版通道和Beta版通道吗,区别在于:
|
||||||
|
|
||||||
|
- **RC版(预览版)**:RC即Release Candidate,功能已经稳定,BUG较少,接近正式版
|
||||||
|
- **Beta版(测试版)**:功能可能随时变化,BUG较多,可以较早体验未来功能
|
||||||
|
|
||||||
|
用户可以在软件的`设置`-`关于`中,开启“测试计划”并选择版本通道。请注意“测试计划”的版本无法保证数据的一致性,请使用前一定要备份数据。
|
||||||
|
|
||||||
|
用户在测试过程中发现的BUG,欢迎提交issue或通过其他渠道反馈。用户的反馈对我们非常重要。
|
||||||
|
|
||||||
|
## 开发者指南
|
||||||
|
|
||||||
|
### 参与测试计划
|
||||||
|
|
||||||
|
开发者按照[贡献者指南](CONTRIBUTING.zh.md)要求正常提交`PR`(并注意提交target为`main`)。仓库维护者会综合考虑(例如该功能对应用的影响程度,功能的重要性,是否需要更广泛的测试等),决定该`PR`是否应加入测试计划。
|
||||||
|
|
||||||
|
若该`PR`加入测试计划,仓库维护者会做如下操作:
|
||||||
|
|
||||||
|
- 通知`PR`提交人
|
||||||
|
- 设置PR为`draft`状态(避免在测试完成前意外并入`main`)
|
||||||
|
- `milestone`设置为具体测试计划版本
|
||||||
|
- 修改`PR`标题
|
||||||
|
|
||||||
|
`PR`提交人在参与测试计划过程中,应做到:
|
||||||
|
|
||||||
|
- 保持`PR`分支与最新`main`同步(即`PR`分支总是应基于最新`main`代码)
|
||||||
|
- 保持`PR`分支为无冲突状态
|
||||||
|
- 积极响应 comments & reviews,修复bug
|
||||||
|
- 开启维护者可以修改`PR`分支的权限,以便维护者能随时修改BUG
|
||||||
|
|
||||||
|
加入测试计划并不保证`PR`的最终合并,也有可能由于功能不成熟或测试反馈不佳而搁置
|
||||||
|
|
||||||
|
### 测试计划负责人
|
||||||
|
|
||||||
|
某个维护者会被指定为某个版本期间(例如`1.5.0-rc`)的测试计划负责人。测试计划负责人的工作为:
|
||||||
|
|
||||||
|
- 判断某个`PR`是否符合测试计划要求,并决定是否应合入当期测试计划
|
||||||
|
- 修改加入测试计划的`PR`状态,并与`PR`提交人沟通相关事宜
|
||||||
|
- 在测试计划发版前,将加入测试计划的`PR`分支逐一合并(采用squash merge)至`testplan`对应版本分支,并解决冲突
|
||||||
|
- 保证`testplan`分支与最新`main`同步
|
||||||
|
- 负责测试计划发版
|
||||||
|
|
||||||
|
## 深入理解
|
||||||
|
|
||||||
|
### 关于`PR`
|
||||||
|
|
||||||
|
`PR`是特定分支(及commits)、comments、reviews等各种信息的集合,也是测试计划的**最小管理单元**。
|
||||||
|
|
||||||
|
相比将所有功能都提交到某个分支,测试计划通过`PR`来管理功能,这可以带来极大的灵活度和效率:
|
||||||
|
|
||||||
|
- 测试计划的各个版本间,可以随意增减功能,而无需繁琐的`revert`操作
|
||||||
|
- 明确了功能边界和负责人,bug修复在各自`PR`中完成,隔离了交叉影响,也能更好观察进度
|
||||||
|
- `PR`提交人负责与最新`main`之间的冲突;测试计划负责人负责各`PR`分支之间的冲突,但因加入测试计划的各功能相对比较独立(话句话说,如果功能牵涉较广,则应独立上测试计划),冲突一般比较少或简单。
|
||||||
|
|
||||||
|
### `testplan`分支
|
||||||
|
|
||||||
|
`testplan`分支是用于测试计划发版所用的**临时**分支。
|
||||||
|
|
||||||
|
注意:
|
||||||
|
|
||||||
|
- **请勿基于该分支开发**。该分支随时会变化甚至删除,且并不保证commit的完整和顺序。
|
||||||
|
- **请勿向该分支提交`commit`及`PR`**,将不会得到保留
|
||||||
|
- `testplan`分支总是基于最新`main`分支(而不是基于已发布版本),在其之上添加功能
|
||||||
|
|
||||||
|
#### RC版分支
|
||||||
|
|
||||||
|
分支名称:`testplan/rc/x.y.z`
|
||||||
|
|
||||||
|
用于RC版的发版,x.y.z为目标版本号,注意无论是rc.1还是rc.5,只要主版本号为x.y.z,都在该分支完成。
|
||||||
|
|
||||||
|
一般而言,该分支发版的版本号命名为`x.y.z-rc.n`
|
||||||
|
|
||||||
|
#### Beta版分支
|
||||||
|
|
||||||
|
分支名称:`testplan/beta/x.y.z`
|
||||||
|
|
||||||
|
用于Beta版的发版,x.y.z为目标版本号,注意无论是beta.1还是beta.5,只要主版本号为x.y.z,都在该分支完成。
|
||||||
|
|
||||||
|
一般而言,该分支发版的版本号命名为`x.y.z-beta.n`
|
||||||
|
|
||||||
|
### 版本规则
|
||||||
|
|
||||||
|
测试计划的应用版本号为:`x.y.z-CHA.n`,其中:
|
||||||
|
|
||||||
|
- `x.y.z`为一般意义上的版本号,在这里称为**目标版本号**
|
||||||
|
- `CHA`为通道号(Channel),现在分为`rc`和`beta`
|
||||||
|
- `n`为发版编号,从`1`计数
|
||||||
|
|
||||||
|
完整的版本号举例:`1.5.0-rc.3`、`1.5.1-beta.1`、`1.6.0-beta.6`
|
||||||
|
|
||||||
|
测试计划的**目标版本号**指向希望添加这些功能的正式版版本号。例如:
|
||||||
|
|
||||||
|
- `1.5.0-rc.3`是指,这是`1.5.0`正式版的预览版(当前最新正式版是`1.4.9`,而`1.5.0`正式版还未发布)
|
||||||
|
- `1.5.1-beta.1`是指,这是`1.5.1`正式版的测试版(当前最新正式版是`1.5.0`,而`1.5.1`正式版还未发布)
|
||||||
@@ -11,40 +11,67 @@ electronLanguages:
|
|||||||
- en # for macOS
|
- en # for macOS
|
||||||
directories:
|
directories:
|
||||||
buildResources: build
|
buildResources: build
|
||||||
|
|
||||||
|
protocols:
|
||||||
|
- name: Cherry Studio
|
||||||
|
schemes:
|
||||||
|
- cherrystudio
|
||||||
files:
|
files:
|
||||||
- '!{.vscode,.yarn,.github}'
|
- "**/*"
|
||||||
- '!electron.vite.config.{js,ts,mjs,cjs}'
|
- "!**/{.vscode,.yarn,.yarn-lock,.github,.cursorrules,.prettierrc}"
|
||||||
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
|
- "!electron.vite.config.{js,ts,mjs,cjs}}"
|
||||||
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
|
- "!**/{.eslintignore,.eslintrc.js,.eslintrc.json,.eslintcache,root.eslint.config.js,eslint.config.js,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,eslint.config.mjs,dev-app-update.yml,CHANGELOG.md,README.md,biome.jsonc}"
|
||||||
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
|
- "!**/{.env,.env.*,.npmrc,pnpm-lock.yaml}"
|
||||||
- '!src'
|
- "!**/{tsconfig.json,tsconfig.tsbuildinfo,tsconfig.node.json,tsconfig.web.json}"
|
||||||
- '!scripts'
|
- "!**/{.editorconfig,.jekyll-metadata}"
|
||||||
- '!local'
|
- "!src"
|
||||||
- '!docs'
|
- "!scripts"
|
||||||
- '!packages'
|
- "!local"
|
||||||
- '!stats.html'
|
- "!docs"
|
||||||
- '!*.md'
|
- "!packages"
|
||||||
- '!**/*.{map,ts,tsx,jsx,less,scss,sass,css.d.ts,d.cts,d.mts,md,markdown,yaml,yml}'
|
- "!.swc"
|
||||||
- '!**/{test,tests,__tests__,coverage}/**'
|
- "!.bin"
|
||||||
- '!**/*.{spec,test}.{js,jsx,ts,tsx}'
|
- "!._*"
|
||||||
- '!**/*.min.*.map'
|
- "!*.log"
|
||||||
- '!**/*.d.ts'
|
- "!stats.html"
|
||||||
- '!**/{.DS_Store,Thumbs.db}'
|
- "!*.md"
|
||||||
- '!**/{LICENSE,LICENSE.txt,LICENSE-MIT.txt,*.LICENSE.txt,NOTICE.txt,README.md,CHANGELOG.md}'
|
- "!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}"
|
||||||
- '!node_modules/rollup-plugin-visualizer'
|
- "!**/*.{map,ts,tsx,jsx,less,scss,sass,css.d.ts,d.cts,d.mts,md,markdown,yaml,yml}"
|
||||||
- '!node_modules/js-tiktoken'
|
- "!**/{test,tests,__tests__,powered-test,coverage}/**"
|
||||||
- '!node_modules/@tavily/core/node_modules/js-tiktoken'
|
- "!**/{example,examples}/**"
|
||||||
- '!node_modules/pdf-parse/lib/pdf.js/{v1.9.426,v1.10.88,v2.0.550}'
|
- "!**/*.{spec,test}.{js,jsx,ts,tsx}"
|
||||||
- '!node_modules/mammoth/{mammoth.browser.js,mammoth.browser.min.js}'
|
- "!**/*.min.*.map"
|
||||||
|
- "!**/*.d.ts"
|
||||||
|
- "!**/dist/es6/**"
|
||||||
|
- "!**/dist/demo/**"
|
||||||
|
- "!**/amd/**"
|
||||||
|
- "!**/{.DS_Store,Thumbs.db,thumbs.db,__pycache__}"
|
||||||
|
- "!**/{LICENSE,license,LICENSE.*,*.LICENSE.txt,NOTICE.txt,README.md,readme.md,CHANGELOG.md}"
|
||||||
|
- "!node_modules/rollup-plugin-visualizer"
|
||||||
|
- "!node_modules/js-tiktoken"
|
||||||
|
- "!node_modules/@tavily/core/node_modules/js-tiktoken"
|
||||||
|
- "!node_modules/pdf-parse/lib/pdf.js/{v1.9.426,v1.10.88,v2.0.550}"
|
||||||
|
- "!node_modules/mammoth/{mammoth.browser.js,mammoth.browser.min.js}"
|
||||||
|
- "!node_modules/selection-hook/prebuilds/**/*" # we rebuild .node, don't use prebuilds
|
||||||
|
- "!node_modules/selection-hook/node_modules" # we don't need what in the node_modules dir
|
||||||
|
- "!node_modules/selection-hook/src" # we don't need source files
|
||||||
|
- "!node_modules/tesseract.js-core/{tesseract-core.js,tesseract-core.wasm,tesseract-core.wasm.js}" # we don't need source files
|
||||||
|
- "!node_modules/tesseract.js-core/{tesseract-core-lstm.js,tesseract-core-lstm.wasm,tesseract-core-lstm.wasm.js}" # we don't need source files
|
||||||
|
- "!node_modules/tesseract.js-core/{tesseract-core-simd-lstm.js,tesseract-core-simd-lstm.wasm,tesseract-core-simd-lstm.wasm.js}" # we don't need source files
|
||||||
|
- "!**/*.{h,iobj,ipdb,tlog,recipe,vcxproj,vcxproj.filters,Makefile,*.Makefile}" # filter .node build files
|
||||||
asarUnpack:
|
asarUnpack:
|
||||||
- resources/**
|
- resources/**
|
||||||
- '**/*.{metal,exp,lib}'
|
- "**/*.{metal,exp,lib}"
|
||||||
|
- "node_modules/@img/sharp-libvips-*/**"
|
||||||
win:
|
win:
|
||||||
executableName: Cherry Studio
|
executableName: Cherry Studio
|
||||||
artifactName: ${productName}-${version}-${arch}-setup.${ext}
|
artifactName: ${productName}-${version}-${arch}-setup.${ext}
|
||||||
target:
|
target:
|
||||||
- target: nsis
|
- target: nsis
|
||||||
- target: portable
|
- target: portable
|
||||||
|
signtoolOptions:
|
||||||
|
sign: scripts/win-sign.js
|
||||||
|
verifyUpdateCodeSignature: false
|
||||||
nsis:
|
nsis:
|
||||||
artifactName: ${productName}-${version}-${arch}-setup.${ext}
|
artifactName: ${productName}-${version}-${arch}-setup.${ext}
|
||||||
shortcutName: ${productName}
|
shortcutName: ${productName}
|
||||||
@@ -61,7 +88,7 @@ mac:
|
|||||||
entitlementsInherit: build/entitlements.mac.plist
|
entitlementsInherit: build/entitlements.mac.plist
|
||||||
notarize: false
|
notarize: false
|
||||||
artifactName: ${productName}-${version}-${arch}.${ext}
|
artifactName: ${productName}-${version}-${arch}.${ext}
|
||||||
minimumSystemVersion: '20.1.0' # 最低支持 macOS 11.0
|
minimumSystemVersion: "20.1.0" # 最低支持 macOS 11.0
|
||||||
extendInfo:
|
extendInfo:
|
||||||
- NSCameraUsageDescription: Application requests access to the device's camera.
|
- NSCameraUsageDescription: Application requests access to the device's camera.
|
||||||
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.
|
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.
|
||||||
@@ -74,6 +101,8 @@ linux:
|
|||||||
artifactName: ${productName}-${version}-${arch}.${ext}
|
artifactName: ${productName}-${version}-${arch}.${ext}
|
||||||
target:
|
target:
|
||||||
- target: AppImage
|
- target: AppImage
|
||||||
|
- target: deb
|
||||||
|
- target: rpm
|
||||||
maintainer: electronjs.org
|
maintainer: electronjs.org
|
||||||
category: Utility
|
category: Utility
|
||||||
desktop:
|
desktop:
|
||||||
@@ -81,25 +110,36 @@ linux:
|
|||||||
StartupWMClass: CherryStudio
|
StartupWMClass: CherryStudio
|
||||||
mimeTypes:
|
mimeTypes:
|
||||||
- x-scheme-handler/cherrystudio
|
- x-scheme-handler/cherrystudio
|
||||||
|
rpm:
|
||||||
|
# Workaround for electron build issue on rpm package:
|
||||||
|
# https://github.com/electron/forge/issues/3594
|
||||||
|
fpm: ["--rpm-rpmbuild-define=_build_id_links none"]
|
||||||
publish:
|
publish:
|
||||||
provider: generic
|
provider: generic
|
||||||
url: https://releases.cherry-ai.com
|
url: https://releases.cherry-ai.com
|
||||||
electronDownload:
|
electronDownload:
|
||||||
mirror: https://npmmirror.com/mirrors/electron/
|
mirror: https://npmmirror.com/mirrors/electron/
|
||||||
|
beforePack: scripts/before-pack.js
|
||||||
afterPack: scripts/after-pack.js
|
afterPack: scripts/after-pack.js
|
||||||
afterSign: scripts/notarize.js
|
afterSign: scripts/notarize.js
|
||||||
artifactBuildCompleted: scripts/artifact-build-completed.js
|
artifactBuildCompleted: scripts/artifact-build-completed.js
|
||||||
releaseInfo:
|
releaseInfo:
|
||||||
releaseNotes: |
|
releaseNotes: |
|
||||||
⚠️ 注意:升级前请备份数据,否则将无法降级
|
What's New in v1.6.3
|
||||||
Electron 版本升级到 35
|
|
||||||
快捷助手支持自定义模型
|
Features:
|
||||||
新增 BurnCloud 模型提供商
|
- Notes: Add spell-check control, automatic table line wrapping, export functionality, and LLM-based renaming
|
||||||
消息编辑功能改进
|
- UI: Expand topic rename clickable area, add middle-click tab closing, remove redundant scrollbars, fix message menubar overflow
|
||||||
新增 aihubmix-ideogram-v3 模型支持
|
- Editor: Add read-only extension support, make TextFilePreview read-only but copyable
|
||||||
通过 JSON 快速添加 MCP 服务器
|
- Models: Update support for DeepSeek v3.2, Claude 4.5, GLM 4.6, Gemini regex, and vision models
|
||||||
新增浮动侧边栏方便小窗口快速切换助手和对话
|
- Code Tools: Add GitHub Copilot CLI integration
|
||||||
优化粘贴逻辑处理
|
|
||||||
新增 OpenAI 设置和提示
|
Bug Fixes:
|
||||||
增加消息快捷搜索功能
|
- Fix migration for missing providers
|
||||||
常规错误修复和功能优化
|
- Fix forked topic retaining old name after rename
|
||||||
|
- Restore first token latency reporting in metrics
|
||||||
|
- Fix UI scrollbar and overflow issues
|
||||||
|
|
||||||
|
Technical Updates:
|
||||||
|
- Upgrade to Electron 37.6.0
|
||||||
|
- Update dependencies across packages
|
||||||
|
|||||||
@@ -1,57 +1,74 @@
|
|||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
|
import { CodeInspectorPlugin } from 'code-inspector-plugin'
|
||||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { visualizer } from 'rollup-plugin-visualizer'
|
import { visualizer } from 'rollup-plugin-visualizer'
|
||||||
|
|
||||||
|
// assert not supported by biome
|
||||||
|
// import pkg from './package.json' assert { type: 'json' }
|
||||||
|
import pkg from './package.json'
|
||||||
|
|
||||||
const visualizerPlugin = (type: 'renderer' | 'main') => {
|
const visualizerPlugin = (type: 'renderer' | 'main') => {
|
||||||
return process.env[`VISUALIZER_${type.toUpperCase()}`] ? [visualizer({ open: true })] : []
|
return process.env[`VISUALIZER_${type.toUpperCase()}`] ? [visualizer({ open: true })] : []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isDev = process.env.NODE_ENV === 'development'
|
||||||
|
const isProd = process.env.NODE_ENV === 'production'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
main: {
|
main: {
|
||||||
plugins: [
|
plugins: [externalizeDepsPlugin(), ...visualizerPlugin('main')],
|
||||||
externalizeDepsPlugin({
|
|
||||||
exclude: [
|
|
||||||
'@cherrystudio/embedjs',
|
|
||||||
'@cherrystudio/embedjs-openai',
|
|
||||||
'@cherrystudio/embedjs-loader-web',
|
|
||||||
'@cherrystudio/embedjs-loader-markdown',
|
|
||||||
'@cherrystudio/embedjs-loader-msoffice',
|
|
||||||
'@cherrystudio/embedjs-loader-xml',
|
|
||||||
'@cherrystudio/embedjs-loader-pdf',
|
|
||||||
'@cherrystudio/embedjs-loader-sitemap',
|
|
||||||
'@cherrystudio/embedjs-libsql',
|
|
||||||
'@cherrystudio/embedjs-loader-image',
|
|
||||||
'p-queue',
|
|
||||||
'webdav'
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
...visualizerPlugin('main')
|
|
||||||
],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@main': resolve('src/main'),
|
'@main': resolve('src/main'),
|
||||||
'@types': resolve('src/renderer/src/types'),
|
'@types': resolve('src/renderer/src/types'),
|
||||||
'@shared': resolve('packages/shared')
|
'@shared': resolve('packages/shared'),
|
||||||
|
'@logger': resolve('src/main/services/LoggerService'),
|
||||||
|
'@mcp-trace/trace-core': resolve('packages/mcp-trace/trace-core'),
|
||||||
|
'@mcp-trace/trace-node': resolve('packages/mcp-trace/trace-node')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ['@libsql/client']
|
external: ['bufferutil', 'utf-8-validate', 'electron', ...Object.keys(pkg.dependencies)],
|
||||||
}
|
output: {
|
||||||
|
manualChunks: undefined, // 彻底禁用代码分割 - 返回 null 强制单文件打包
|
||||||
|
inlineDynamicImports: true // 内联所有动态导入,这是关键配置
|
||||||
|
},
|
||||||
|
onwarn(warning, warn) {
|
||||||
|
if (warning.code === 'COMMONJS_VARIABLE_IN_ESM') return
|
||||||
|
warn(warning)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sourcemap: isDev
|
||||||
|
},
|
||||||
|
esbuild: isProd ? { legalComments: 'none' } : {},
|
||||||
|
optimizeDeps: {
|
||||||
|
noDiscovery: isDev
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
preload: {
|
preload: {
|
||||||
plugins: [externalizeDepsPlugin()],
|
plugins: [
|
||||||
|
react({
|
||||||
|
tsDecorators: true
|
||||||
|
}),
|
||||||
|
externalizeDepsPlugin()
|
||||||
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@shared': resolve('packages/shared')
|
'@shared': resolve('packages/shared'),
|
||||||
|
'@mcp-trace/trace-core': resolve('packages/mcp-trace/trace-core')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
sourcemap: isDev
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
renderer: {
|
renderer: {
|
||||||
plugins: [
|
plugins: [
|
||||||
|
(async () => (await import('@tailwindcss/vite')).default())(),
|
||||||
react({
|
react({
|
||||||
|
tsDecorators: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
[
|
[
|
||||||
'@swc/plugin-styled-components',
|
'@swc/plugin-styled-components',
|
||||||
@@ -64,44 +81,48 @@ export default defineConfig({
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
...(isDev ? [CodeInspectorPlugin({ bundler: 'vite' })] : []), // 只在开发环境下启用 CodeInspectorPlugin
|
||||||
...visualizerPlugin('renderer')
|
...visualizerPlugin('renderer')
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@renderer': resolve('src/renderer/src'),
|
'@renderer': resolve('src/renderer/src'),
|
||||||
'@shared': resolve('packages/shared')
|
'@shared': resolve('packages/shared'),
|
||||||
|
'@types': resolve('src/renderer/src/types'),
|
||||||
|
'@logger': resolve('src/renderer/src/services/LoggerService'),
|
||||||
|
'@mcp-trace/trace-core': resolve('packages/mcp-trace/trace-core'),
|
||||||
|
'@mcp-trace/trace-web': resolve('packages/mcp-trace/trace-web'),
|
||||||
|
'@cherrystudio/ai-core/provider': resolve('packages/aiCore/src/core/providers'),
|
||||||
|
'@cherrystudio/ai-core/built-in/plugins': resolve('packages/aiCore/src/core/plugins/built-in'),
|
||||||
|
'@cherrystudio/ai-core': resolve('packages/aiCore/src'),
|
||||||
|
'@cherrystudio/extension-table-plus': resolve('packages/extension-table-plus/src')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
exclude: ['pyodide']
|
exclude: ['pyodide'],
|
||||||
|
esbuildOptions: {
|
||||||
|
target: 'esnext' // for dev
|
||||||
|
}
|
||||||
},
|
},
|
||||||
worker: {
|
worker: {
|
||||||
format: 'es'
|
format: 'es'
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
target: 'esnext', // for build
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
index: resolve(__dirname, 'src/renderer/index.html'),
|
index: resolve(__dirname, 'src/renderer/index.html'),
|
||||||
miniWindow: resolve(__dirname, 'src/renderer/miniWindow.html')
|
miniWindow: resolve(__dirname, 'src/renderer/miniWindow.html'),
|
||||||
|
selectionToolbar: resolve(__dirname, 'src/renderer/selectionToolbar.html'),
|
||||||
|
selectionAction: resolve(__dirname, 'src/renderer/selectionAction.html'),
|
||||||
|
traceWindow: resolve(__dirname, 'src/renderer/traceWindow.html')
|
||||||
},
|
},
|
||||||
output: {
|
onwarn(warning, warn) {
|
||||||
manualChunks: (id: string) => {
|
if (warning.code === 'COMMONJS_VARIABLE_IN_ESM') return
|
||||||
// 检测所有 worker 文件,提取 worker 名称作为 chunk 名
|
warn(warning)
|
||||||
if (id.includes('.worker') && id.endsWith('?worker')) {
|
|
||||||
const workerName = id.split('/').pop()?.split('.')[0] || 'worker'
|
|
||||||
return `workers/${workerName}`
|
|
||||||
}
|
|
||||||
|
|
||||||
// All node_modules are in the vendor chunk
|
|
||||||
if (id.includes('node_modules')) {
|
|
||||||
return 'vendor'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Other modules use default chunk splitting strategy
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
esbuild: isProd ? { legalComments: 'none' } : {}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import electronConfigPrettier from '@electron-toolkit/eslint-config-prettier'
|
|
||||||
import tseslint from '@electron-toolkit/eslint-config-ts'
|
import tseslint from '@electron-toolkit/eslint-config-ts'
|
||||||
import eslint from '@eslint/js'
|
import eslint from '@eslint/js'
|
||||||
import eslintReact from '@eslint-react/eslint-plugin'
|
import eslintReact from '@eslint-react/eslint-plugin'
|
||||||
import { defineConfig } from 'eslint/config'
|
import { defineConfig } from 'eslint/config'
|
||||||
|
import importZod from 'eslint-plugin-import-zod'
|
||||||
|
import oxlint from 'eslint-plugin-oxlint'
|
||||||
import reactHooks from 'eslint-plugin-react-hooks'
|
import reactHooks from 'eslint-plugin-react-hooks'
|
||||||
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
||||||
import unusedImports from 'eslint-plugin-unused-imports'
|
import unusedImports from 'eslint-plugin-unused-imports'
|
||||||
@@ -10,13 +11,13 @@ import unusedImports from 'eslint-plugin-unused-imports'
|
|||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
eslint.configs.recommended,
|
eslint.configs.recommended,
|
||||||
tseslint.configs.recommended,
|
tseslint.configs.recommended,
|
||||||
electronConfigPrettier,
|
|
||||||
eslintReact.configs['recommended-typescript'],
|
eslintReact.configs['recommended-typescript'],
|
||||||
reactHooks.configs['recommended-latest'],
|
reactHooks.configs['recommended-latest'],
|
||||||
{
|
{
|
||||||
plugins: {
|
plugins: {
|
||||||
'simple-import-sort': simpleImportSort,
|
'simple-import-sort': simpleImportSort,
|
||||||
'unused-imports': unusedImports
|
'unused-imports': unusedImports,
|
||||||
|
'import-zod': importZod
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||||
@@ -26,32 +27,30 @@ export default defineConfig([
|
|||||||
'simple-import-sort/exports': 'error',
|
'simple-import-sort/exports': 'error',
|
||||||
'unused-imports/no-unused-imports': 'error',
|
'unused-imports/no-unused-imports': 'error',
|
||||||
'@eslint-react/no-prop-types': 'error',
|
'@eslint-react/no-prop-types': 'error',
|
||||||
'prettier/prettier': ['error', { endOfLine: 'auto' }]
|
'import-zod/prefer-zod-namespace': 'error'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Configuration for ensuring compatibility with the original ESLint(8.x) rules
|
// Configuration for ensuring compatibility with the original ESLint(8.x) rules
|
||||||
...[
|
{
|
||||||
{
|
rules: {
|
||||||
rules: {
|
'@typescript-eslint/no-require-imports': 'off',
|
||||||
'@typescript-eslint/no-require-imports': 'off',
|
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'none' }],
|
||||||
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'none' }],
|
'@typescript-eslint/no-unused-expressions': 'off',
|
||||||
'@typescript-eslint/no-unused-expressions': 'off',
|
'@typescript-eslint/no-empty-object-type': 'off',
|
||||||
'@typescript-eslint/no-empty-object-type': 'off',
|
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'off',
|
||||||
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'off',
|
'@eslint-react/web-api/no-leaked-event-listener': 'off',
|
||||||
'@eslint-react/web-api/no-leaked-event-listener': 'off',
|
'@eslint-react/web-api/no-leaked-timeout': 'off',
|
||||||
'@eslint-react/web-api/no-leaked-timeout': 'off',
|
'@eslint-react/no-unknown-property': 'off',
|
||||||
'@eslint-react/no-unknown-property': 'off',
|
'@eslint-react/no-nested-component-definitions': 'off',
|
||||||
'@eslint-react/no-nested-component-definitions': 'off',
|
'@eslint-react/dom/no-dangerously-set-innerhtml': 'off',
|
||||||
'@eslint-react/dom/no-dangerously-set-innerhtml': 'off',
|
'@eslint-react/no-array-index-key': 'off',
|
||||||
'@eslint-react/no-array-index-key': 'off',
|
'@eslint-react/no-unstable-default-props': 'off',
|
||||||
'@eslint-react/no-unstable-default-props': 'off',
|
'@eslint-react/no-unstable-context-value': 'off',
|
||||||
'@eslint-react/no-unstable-context-value': 'off',
|
'@eslint-react/hooks-extra/prefer-use-state-lazy-initialization': 'off',
|
||||||
'@eslint-react/hooks-extra/prefer-use-state-lazy-initialization': 'off',
|
'@eslint-react/hooks-extra/no-unnecessary-use-prefix': 'off',
|
||||||
'@eslint-react/hooks-extra/no-unnecessary-use-prefix': 'off',
|
'@eslint-react/no-children-to-array': 'off'
|
||||||
'@eslint-react/no-children-to-array': 'off'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
{
|
{
|
||||||
ignores: [
|
ignores: [
|
||||||
'node_modules/**',
|
'node_modules/**',
|
||||||
@@ -62,7 +61,77 @@ export default defineConfig([
|
|||||||
'.yarn/**',
|
'.yarn/**',
|
||||||
'.gitignore',
|
'.gitignore',
|
||||||
'scripts/cloudflare-worker.js',
|
'scripts/cloudflare-worker.js',
|
||||||
'src/main/integration/nutstore/sso/lib/**'
|
'src/main/integration/nutstore/sso/lib/**',
|
||||||
|
'src/main/integration/cherryai/index.js',
|
||||||
|
'src/main/integration/nutstore/sso/lib/**',
|
||||||
|
'src/renderer/src/ui/**',
|
||||||
|
'packages/**/dist'
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
// turn off oxlint supported rules.
|
||||||
|
...oxlint.configs['flat/eslint'],
|
||||||
|
...oxlint.configs['flat/typescript'],
|
||||||
|
...oxlint.configs['flat/unicorn'],
|
||||||
|
{
|
||||||
|
// LoggerService Custom Rules - only apply to src directory
|
||||||
|
files: ['src/**/*.{ts,tsx,js,jsx}'],
|
||||||
|
ignores: ['src/**/__tests__/**', 'src/**/__mocks__/**', 'src/**/*.test.*', 'src/preload/**'],
|
||||||
|
rules: {
|
||||||
|
'no-restricted-syntax': [
|
||||||
|
process.env.PRCI ? 'error' : 'warn',
|
||||||
|
{
|
||||||
|
selector: 'CallExpression[callee.object.name="console"]',
|
||||||
|
message:
|
||||||
|
'❗CherryStudio uses unified LoggerService: 📖 docs/technical/how-to-use-logger-en.md\n❗CherryStudio 使用统一的日志服务:📖 docs/technical/how-to-use-logger-zh.md\n\n'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx,js,jsx}'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2022,
|
||||||
|
sourceType: 'module'
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
i18n: {
|
||||||
|
rules: {
|
||||||
|
'no-template-in-t': {
|
||||||
|
meta: {
|
||||||
|
type: 'problem',
|
||||||
|
docs: {
|
||||||
|
description: '⚠️不建议在 t() 函数中使用模板字符串,这样会导致渲染结果不可预料',
|
||||||
|
recommended: true
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
noTemplateInT: '⚠️不建议在 t() 函数中使用模板字符串,这样会导致渲染结果不可预料'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
create(context) {
|
||||||
|
return {
|
||||||
|
CallExpression(node) {
|
||||||
|
const { callee, arguments: args } = node
|
||||||
|
const isTFunction =
|
||||||
|
(callee.type === 'Identifier' && callee.name === 't') ||
|
||||||
|
(callee.type === 'MemberExpression' &&
|
||||||
|
callee.property.type === 'Identifier' &&
|
||||||
|
callee.property.name === 't')
|
||||||
|
|
||||||
|
if (isTFunction && args[0]?.type === 'TemplateLiteral') {
|
||||||
|
context.report({
|
||||||
|
node: args[0],
|
||||||
|
messageId: 'noTemplateInT'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'i18n/no-template-in-t': 'warn'
|
||||||
|
}
|
||||||
|
},
|
||||||
])
|
])
|
||||||
|
|||||||
391
package.json
391
package.json
@@ -1,11 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "CherryStudio",
|
"name": "CherryStudio",
|
||||||
"version": "1.3.9",
|
"version": "1.7.0-alpha.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "A powerful AI assistant for producer.",
|
"description": "A powerful AI assistant for producer.",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "support@cherry-ai.com",
|
"author": "support@cherry-ai.com",
|
||||||
"homepage": "https://github.com/CherryHQ/cherry-studio",
|
"homepage": "https://github.com/CherryHQ/cherry-studio",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22.0.0"
|
||||||
|
},
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
"packages": [
|
"packages": [
|
||||||
"local",
|
"local",
|
||||||
@@ -13,50 +16,101 @@
|
|||||||
],
|
],
|
||||||
"installConfig": {
|
"installConfig": {
|
||||||
"hoistingLimits": [
|
"hoistingLimits": [
|
||||||
"packages/database"
|
"packages/database",
|
||||||
|
"packages/mcp-trace/trace-core",
|
||||||
|
"packages/mcp-trace/trace-node",
|
||||||
|
"packages/mcp-trace/trace-web",
|
||||||
|
"packages/extension-table-plus"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron-vite preview",
|
"start": "electron-vite preview",
|
||||||
"dev": "electron-vite dev",
|
"dev": "dotenv electron-vite dev",
|
||||||
|
"debug": "electron-vite -- --inspect --sourcemap --remote-debugging-port=9222",
|
||||||
"build": "npm run typecheck && electron-vite build",
|
"build": "npm run typecheck && electron-vite build",
|
||||||
"build:check": "yarn test && yarn typecheck && yarn check:i18n",
|
"build:check": "yarn lint && yarn test",
|
||||||
"build:unpack": "dotenv npm run build && electron-builder --dir",
|
"build:unpack": "dotenv npm run build && electron-builder --dir",
|
||||||
"build:win": "dotenv npm run build && electron-builder --win --x64 --arm64",
|
"build:win": "dotenv npm run build && electron-builder --win --x64 --arm64",
|
||||||
"build:win:x64": "dotenv npm run build && electron-builder --win --x64",
|
"build:win:x64": "dotenv npm run build && electron-builder --win --x64",
|
||||||
"build:win:arm64": "dotenv npm run build && electron-builder --win --arm64",
|
"build:win:arm64": "dotenv npm run build && electron-builder --win --arm64",
|
||||||
"build:mac": "dotenv electron-vite build && electron-builder --mac --arm64 --x64",
|
"build:mac": "dotenv npm run build && electron-builder --mac --arm64 --x64",
|
||||||
"build:mac:arm64": "dotenv electron-vite build && electron-builder --mac --arm64",
|
"build:mac:arm64": "dotenv npm run build && electron-builder --mac --arm64",
|
||||||
"build:mac:x64": "dotenv electron-vite build && electron-builder --mac --x64",
|
"build:mac:x64": "dotenv npm run build && electron-builder --mac --x64",
|
||||||
"build:linux": "dotenv electron-vite build && electron-builder --linux --x64 --arm64",
|
"build:linux": "dotenv npm run build && electron-builder --linux --x64 --arm64",
|
||||||
"build:linux:arm64": "dotenv electron-vite build && electron-builder --linux --arm64",
|
"build:linux:arm64": "dotenv npm run build && electron-builder --linux --arm64",
|
||||||
"build:linux:x64": "dotenv electron-vite build && electron-builder --linux --x64",
|
"build:linux:x64": "dotenv npm run build && electron-builder --linux --x64",
|
||||||
"build:npm": "node scripts/build-npm.js",
|
|
||||||
"release": "node scripts/version.js",
|
"release": "node scripts/version.js",
|
||||||
"publish": "yarn build:check && yarn release patch push",
|
"publish": "yarn build:check && yarn release patch push",
|
||||||
"pulish:artifacts": "cd packages/artifacts && npm publish && cd -",
|
"pulish:artifacts": "cd packages/artifacts && npm publish && cd -",
|
||||||
"generate:agents": "yarn workspace @cherry-studio/database agents",
|
"agents:generate": "NODE_ENV='development' drizzle-kit generate --config src/main/services/agents/drizzle.config.ts",
|
||||||
|
"agents:push": "NODE_ENV='development' drizzle-kit push --config src/main/services/agents/drizzle.config.ts",
|
||||||
|
"agents:studio": "NODE_ENV='development' drizzle-kit studio --config src/main/services/agents/drizzle.config.ts",
|
||||||
|
"agents:drop": "NODE_ENV='development' drizzle-kit drop --config src/main/services/agents/drizzle.config.ts",
|
||||||
"generate:icons": "electron-icon-builder --input=./build/logo.png --output=build",
|
"generate:icons": "electron-icon-builder --input=./build/logo.png --output=build",
|
||||||
"analyze:renderer": "VISUALIZER_RENDERER=true yarn build",
|
"analyze:renderer": "VISUALIZER_RENDERER=true yarn build",
|
||||||
"analyze:main": "VISUALIZER_MAIN=true yarn build",
|
"analyze:main": "VISUALIZER_MAIN=true yarn build",
|
||||||
"typecheck": "npm run typecheck:node && npm run typecheck:web",
|
"typecheck": "concurrently -n \"node,web\" -c \"cyan,magenta\" \"npm run typecheck:node\" \"npm run typecheck:web\"",
|
||||||
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
|
"typecheck:node": "tsgo --noEmit -p tsconfig.node.json --composite false",
|
||||||
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
|
"typecheck:web": "tsgo --noEmit -p tsconfig.web.json --composite false",
|
||||||
"check:i18n": "node scripts/check-i18n.js",
|
"check:i18n": "dotenv -e .env -- tsx scripts/check-i18n.ts",
|
||||||
"test": "yarn test:renderer",
|
"sync:i18n": "dotenv -e .env -- tsx scripts/sync-i18n.ts",
|
||||||
"test:coverage": "yarn test:renderer:coverage",
|
"update:i18n": "dotenv -e .env -- tsx scripts/update-i18n.ts",
|
||||||
"test:node": "npx -y tsx --test src/**/*.test.ts",
|
"auto:i18n": "dotenv -e .env -- tsx scripts/auto-translate-i18n.ts",
|
||||||
"test:renderer": "vitest run",
|
"update:languages": "tsx scripts/update-languages.ts",
|
||||||
"test:renderer:ui": "vitest --ui",
|
"test": "vitest run --silent",
|
||||||
"test:renderer:coverage": "vitest run --coverage",
|
"test:main": "vitest run --project main",
|
||||||
"test:lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
|
"test:renderer": "vitest run --project renderer",
|
||||||
"format": "prettier --write .",
|
"test:update": "yarn test:renderer --update",
|
||||||
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
|
"test:coverage": "vitest run --coverage --silent",
|
||||||
"postinstall": "electron-builder install-app-deps",
|
"test:ui": "vitest --ui",
|
||||||
"prepare": "husky"
|
"test:watch": "vitest",
|
||||||
|
"test:e2e": "yarn playwright test",
|
||||||
|
"test:lint": "oxlint --deny-warnings && eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --cache",
|
||||||
|
"test:scripts": "vitest scripts",
|
||||||
|
"lint": "oxlint --fix && eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --cache && yarn typecheck && yarn check:i18n && yarn format:check",
|
||||||
|
"format": "biome format --write && biome lint --write",
|
||||||
|
"format:check": "biome format && biome lint",
|
||||||
|
"prepare": "git config blame.ignoreRevsFile .git-blame-ignore-revs && husky",
|
||||||
|
"claude": "dotenv -e .env -- claude",
|
||||||
|
"release:aicore:alpha": "yarn workspace @cherrystudio/ai-core version prerelease --immediate && yarn workspace @cherrystudio/ai-core npm publish --tag alpha --access public",
|
||||||
|
"release:aicore:beta": "yarn workspace @cherrystudio/ai-core version prerelease --immediate && yarn workspace @cherrystudio/ai-core npm publish --tag beta --access public",
|
||||||
|
"release:aicore": "yarn workspace @cherrystudio/ai-core version patch --immediate && yarn workspace @cherrystudio/ai-core npm publish --access public"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@anthropic-ai/claude-agent-sdk": "patch:@anthropic-ai/claude-agent-sdk@npm%3A0.1.1#~/.yarn/patches/@anthropic-ai-claude-agent-sdk-npm-0.1.1-d937b73fed.patch",
|
||||||
|
"@libsql/client": "0.14.0",
|
||||||
|
"@libsql/win32-x64-msvc": "^0.4.7",
|
||||||
|
"@napi-rs/system-ocr": "patch:@napi-rs/system-ocr@npm%3A1.0.2#~/.yarn/patches/@napi-rs-system-ocr-npm-1.0.2-59e7a78e8b.patch",
|
||||||
|
"@strongtz/win32-arm64-msvc": "^0.4.7",
|
||||||
|
"font-list": "^2.0.0",
|
||||||
|
"graceful-fs": "^4.2.11",
|
||||||
|
"jsdom": "26.1.0",
|
||||||
|
"node-stream-zip": "^1.15.0",
|
||||||
|
"officeparser": "^4.2.0",
|
||||||
|
"os-proxy-config": "^1.1.2",
|
||||||
|
"selection-hook": "^1.0.12",
|
||||||
|
"sharp": "^0.34.3",
|
||||||
|
"swagger-jsdoc": "^6.2.8",
|
||||||
|
"tesseract.js": "patch:tesseract.js@npm%3A6.0.1#~/.yarn/patches/tesseract.js-npm-6.0.1-2562a7e46d.patch",
|
||||||
|
"turndown": "7.2.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@agentic/exa": "^7.3.3",
|
||||||
|
"@agentic/searxng": "^7.3.3",
|
||||||
|
"@agentic/tavily": "^7.3.3",
|
||||||
|
"@ai-sdk/amazon-bedrock": "^3.0.35",
|
||||||
|
"@ai-sdk/google-vertex": "^3.0.40",
|
||||||
|
"@ai-sdk/mistral": "^2.0.19",
|
||||||
|
"@ai-sdk/perplexity": "^2.0.13",
|
||||||
|
"@ant-design/v5-patch-for-react-19": "^1.0.3",
|
||||||
|
"@anthropic-ai/sdk": "^0.41.0",
|
||||||
|
"@anthropic-ai/vertex-sdk": "patch:@anthropic-ai/vertex-sdk@npm%3A0.11.4#~/.yarn/patches/@anthropic-ai-vertex-sdk-npm-0.11.4-c19cb41edb.patch",
|
||||||
|
"@aws-sdk/client-bedrock": "^3.840.0",
|
||||||
|
"@aws-sdk/client-bedrock-runtime": "^3.840.0",
|
||||||
|
"@aws-sdk/client-s3": "^3.840.0",
|
||||||
|
"@biomejs/biome": "2.2.4",
|
||||||
|
"@cherrystudio/ai-core": "workspace:^1.0.0-alpha.18",
|
||||||
"@cherrystudio/embedjs": "^0.1.31",
|
"@cherrystudio/embedjs": "^0.1.31",
|
||||||
"@cherrystudio/embedjs-libsql": "^0.1.31",
|
"@cherrystudio/embedjs-libsql": "^0.1.31",
|
||||||
"@cherrystudio/embedjs-loader-csv": "^0.1.31",
|
"@cherrystudio/embedjs-loader-csv": "^0.1.31",
|
||||||
@@ -67,170 +121,279 @@
|
|||||||
"@cherrystudio/embedjs-loader-sitemap": "^0.1.31",
|
"@cherrystudio/embedjs-loader-sitemap": "^0.1.31",
|
||||||
"@cherrystudio/embedjs-loader-web": "^0.1.31",
|
"@cherrystudio/embedjs-loader-web": "^0.1.31",
|
||||||
"@cherrystudio/embedjs-loader-xml": "^0.1.31",
|
"@cherrystudio/embedjs-loader-xml": "^0.1.31",
|
||||||
|
"@cherrystudio/embedjs-ollama": "^0.1.31",
|
||||||
"@cherrystudio/embedjs-openai": "^0.1.31",
|
"@cherrystudio/embedjs-openai": "^0.1.31",
|
||||||
"@electron-toolkit/utils": "^3.0.0",
|
"@cherrystudio/extension-table-plus": "workspace:^",
|
||||||
"@electron/notarize": "^2.5.0",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@langchain/community": "^0.3.36",
|
"@dnd-kit/modifiers": "^9.0.0",
|
||||||
"@strongtz/win32-arm64-msvc": "^0.4.7",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
"@tanstack/react-query": "^5.27.0",
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
"@types/react-infinite-scroll-component": "^5.0.0",
|
|
||||||
"archiver": "^7.0.1",
|
|
||||||
"async-mutex": "^0.5.0",
|
|
||||||
"color": "^5.0.0",
|
|
||||||
"diff": "^7.0.0",
|
|
||||||
"docx": "^9.0.2",
|
|
||||||
"electron-log": "^5.1.5",
|
|
||||||
"electron-store": "^8.2.0",
|
|
||||||
"electron-updater": "6.6.4",
|
|
||||||
"electron-window-state": "^5.0.3",
|
|
||||||
"epub": "patch:epub@npm%3A1.3.0#~/.yarn/patches/epub-npm-1.3.0-8325494ffe.patch",
|
|
||||||
"fast-diff": "^1.3.0",
|
|
||||||
"fast-xml-parser": "^5.2.0",
|
|
||||||
"fetch-socks": "^1.3.2",
|
|
||||||
"fs-extra": "^11.2.0",
|
|
||||||
"got-scraping": "^4.1.1",
|
|
||||||
"jsdom": "^26.0.0",
|
|
||||||
"markdown-it": "^14.1.0",
|
|
||||||
"node-stream-zip": "^1.15.0",
|
|
||||||
"officeparser": "^4.1.1",
|
|
||||||
"os-proxy-config": "^1.1.2",
|
|
||||||
"proxy-agent": "^6.5.0",
|
|
||||||
"pyodide": "^0.27.5",
|
|
||||||
"tar": "^7.4.3",
|
|
||||||
"turndown": "^7.2.0",
|
|
||||||
"turndown-plugin-gfm": "^1.0.2",
|
|
||||||
"webdav": "^5.8.0",
|
|
||||||
"ws": "^8.18.1",
|
|
||||||
"zipread": "^1.3.3"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@agentic/exa": "^7.3.3",
|
|
||||||
"@agentic/searxng": "^7.3.3",
|
|
||||||
"@agentic/tavily": "^7.3.3",
|
|
||||||
"@ant-design/v5-patch-for-react-19": "^1.0.3",
|
|
||||||
"@anthropic-ai/sdk": "^0.41.0",
|
|
||||||
"@electron-toolkit/eslint-config-prettier": "^3.0.0",
|
|
||||||
"@electron-toolkit/eslint-config-ts": "^3.0.0",
|
"@electron-toolkit/eslint-config-ts": "^3.0.0",
|
||||||
"@electron-toolkit/preload": "^3.0.0",
|
"@electron-toolkit/preload": "^3.0.0",
|
||||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||||
|
"@electron-toolkit/utils": "^3.0.0",
|
||||||
|
"@electron/notarize": "^2.5.0",
|
||||||
"@emotion/is-prop-valid": "^1.3.1",
|
"@emotion/is-prop-valid": "^1.3.1",
|
||||||
"@eslint-react/eslint-plugin": "^1.36.1",
|
"@eslint-react/eslint-plugin": "^1.36.1",
|
||||||
"@eslint/js": "^9.22.0",
|
"@eslint/js": "^9.22.0",
|
||||||
"@google/genai": "^0.13.0",
|
"@google/genai": "patch:@google/genai@npm%3A1.0.1#~/.yarn/patches/@google-genai-npm-1.0.1-e26f0f9af7.patch",
|
||||||
"@hello-pangea/dnd": "^16.6.0",
|
"@hello-pangea/dnd": "^18.0.1",
|
||||||
|
"@heroui/react": "^2.8.3",
|
||||||
"@kangfenmao/keyv-storage": "^0.1.0",
|
"@kangfenmao/keyv-storage": "^0.1.0",
|
||||||
"@modelcontextprotocol/sdk": "^1.11.4",
|
"@langchain/community": "^0.3.50",
|
||||||
|
"@mistralai/mistralai": "^1.7.5",
|
||||||
|
"@modelcontextprotocol/sdk": "^1.17.5",
|
||||||
"@mozilla/readability": "^0.6.0",
|
"@mozilla/readability": "^0.6.0",
|
||||||
"@notionhq/client": "^2.2.15",
|
"@notionhq/client": "^2.2.15",
|
||||||
|
"@openrouter/ai-sdk-provider": "^1.1.2",
|
||||||
|
"@opentelemetry/api": "^1.9.0",
|
||||||
|
"@opentelemetry/core": "2.0.0",
|
||||||
|
"@opentelemetry/exporter-trace-otlp-http": "^0.200.0",
|
||||||
|
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
||||||
|
"@opentelemetry/sdk-trace-node": "^2.0.0",
|
||||||
|
"@opentelemetry/sdk-trace-web": "^2.0.0",
|
||||||
|
"@opeoginni/github-copilot-openai-compatible": "0.1.18",
|
||||||
|
"@playwright/test": "^1.52.0",
|
||||||
|
"@radix-ui/react-context-menu": "^2.2.16",
|
||||||
"@reduxjs/toolkit": "^2.2.5",
|
"@reduxjs/toolkit": "^2.2.5",
|
||||||
"@shikijs/markdown-it": "^3.2.2",
|
"@shikijs/markdown-it": "^3.12.0",
|
||||||
"@swc/plugin-styled-components": "^7.1.5",
|
"@swc/plugin-styled-components": "^8.0.4",
|
||||||
|
"@tailwindcss/vite": "^4.1.13",
|
||||||
|
"@tanstack/react-query": "^5.85.5",
|
||||||
|
"@tanstack/react-virtual": "^3.13.12",
|
||||||
|
"@testing-library/dom": "^10.4.0",
|
||||||
|
"@testing-library/jest-dom": "^6.6.3",
|
||||||
|
"@testing-library/react": "^16.3.0",
|
||||||
|
"@testing-library/user-event": "^14.6.1",
|
||||||
|
"@tiptap/extension-collaboration": "^3.2.0",
|
||||||
|
"@tiptap/extension-drag-handle": "patch:@tiptap/extension-drag-handle@npm%3A3.2.0#~/.yarn/patches/@tiptap-extension-drag-handle-npm-3.2.0-5a9ebff7c9.patch",
|
||||||
|
"@tiptap/extension-drag-handle-react": "^3.2.0",
|
||||||
|
"@tiptap/extension-image": "^3.2.0",
|
||||||
|
"@tiptap/extension-list": "^3.2.0",
|
||||||
|
"@tiptap/extension-mathematics": "^3.2.0",
|
||||||
|
"@tiptap/extension-mention": "^3.2.0",
|
||||||
|
"@tiptap/extension-node-range": "^3.2.0",
|
||||||
|
"@tiptap/extension-table-of-contents": "^3.2.0",
|
||||||
|
"@tiptap/extension-typography": "^3.2.0",
|
||||||
|
"@tiptap/extension-underline": "^3.2.0",
|
||||||
|
"@tiptap/pm": "^3.2.0",
|
||||||
|
"@tiptap/react": "^3.2.0",
|
||||||
|
"@tiptap/starter-kit": "^3.2.0",
|
||||||
|
"@tiptap/suggestion": "^3.2.0",
|
||||||
|
"@tiptap/y-tiptap": "^3.0.0",
|
||||||
|
"@truto/turndown-plugin-gfm": "^1.0.2",
|
||||||
"@tryfabric/martian": "^1.2.4",
|
"@tryfabric/martian": "^1.2.4",
|
||||||
|
"@types/cli-progress": "^3",
|
||||||
|
"@types/content-type": "^1.1.9",
|
||||||
|
"@types/cors": "^2.8.19",
|
||||||
"@types/diff": "^7",
|
"@types/diff": "^7",
|
||||||
|
"@types/express": "^5",
|
||||||
"@types/fs-extra": "^11",
|
"@types/fs-extra": "^11",
|
||||||
|
"@types/he": "^1",
|
||||||
|
"@types/html-to-text": "^9",
|
||||||
"@types/lodash": "^4.17.5",
|
"@types/lodash": "^4.17.5",
|
||||||
"@types/markdown-it": "^14",
|
"@types/markdown-it": "^14",
|
||||||
"@types/md5": "^2.3.5",
|
"@types/md5": "^2.3.5",
|
||||||
"@types/node": "^18.19.9",
|
"@types/mime-types": "^3",
|
||||||
|
"@types/node": "^22.17.1",
|
||||||
"@types/pako": "^1.0.2",
|
"@types/pako": "^1.0.2",
|
||||||
"@types/react": "^19.0.12",
|
"@types/react": "^19.0.12",
|
||||||
"@types/react-dom": "^19.0.4",
|
"@types/react-dom": "^19.0.4",
|
||||||
"@types/react-infinite-scroll-component": "^5.0.0",
|
"@types/react-infinite-scroll-component": "^5.0.0",
|
||||||
|
"@types/react-transition-group": "^4.4.12",
|
||||||
"@types/react-window": "^1",
|
"@types/react-window": "^1",
|
||||||
|
"@types/swagger-jsdoc": "^6",
|
||||||
|
"@types/swagger-ui-express": "^4.1.8",
|
||||||
"@types/tinycolor2": "^1",
|
"@types/tinycolor2": "^1",
|
||||||
"@types/ws": "^8",
|
"@types/turndown": "^5.0.5",
|
||||||
"@uiw/codemirror-extensions-langs": "^4.23.12",
|
"@types/uuid": "^10.0.0",
|
||||||
"@uiw/codemirror-themes-all": "^4.23.12",
|
"@types/word-extractor": "^1",
|
||||||
"@uiw/react-codemirror": "^4.23.12",
|
"@typescript/native-preview": "latest",
|
||||||
|
"@uiw/codemirror-extensions-langs": "^4.25.1",
|
||||||
|
"@uiw/codemirror-themes-all": "^4.25.1",
|
||||||
|
"@uiw/react-codemirror": "^4.25.1",
|
||||||
"@vitejs/plugin-react-swc": "^3.9.0",
|
"@vitejs/plugin-react-swc": "^3.9.0",
|
||||||
"@vitest/ui": "^3.1.1",
|
"@vitest/browser": "^3.2.4",
|
||||||
"@vitest/web-worker": "^3.1.3",
|
"@vitest/coverage-v8": "^3.2.4",
|
||||||
|
"@vitest/ui": "^3.2.4",
|
||||||
|
"@vitest/web-worker": "^3.2.4",
|
||||||
|
"@viz-js/lang-dot": "^1.0.5",
|
||||||
|
"@viz-js/viz": "^3.14.0",
|
||||||
"@xyflow/react": "^12.4.4",
|
"@xyflow/react": "^12.4.4",
|
||||||
"antd": "^5.22.5",
|
"ai": "^5.0.68",
|
||||||
|
"antd": "patch:antd@npm%3A5.27.0#~/.yarn/patches/antd-npm-5.27.0-aa91c36546.patch",
|
||||||
|
"archiver": "^7.0.1",
|
||||||
|
"async-mutex": "^0.5.0",
|
||||||
"axios": "^1.7.3",
|
"axios": "^1.7.3",
|
||||||
"browser-image-compression": "^2.0.2",
|
"browser-image-compression": "^2.0.2",
|
||||||
|
"chardet": "^2.1.0",
|
||||||
|
"check-disk-space": "3.4.0",
|
||||||
|
"cheerio": "^1.1.2",
|
||||||
|
"chokidar": "^4.0.3",
|
||||||
|
"cli-progress": "^3.12.0",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
|
"code-inspector-plugin": "^0.20.14",
|
||||||
|
"color": "^5.0.0",
|
||||||
|
"concurrently": "^9.2.1",
|
||||||
|
"country-flag-emoji-polyfill": "0.1.8",
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
"dexie": "^4.0.8",
|
"dexie": "^4.0.8",
|
||||||
"dexie-react-hooks": "^1.1.7",
|
"dexie-react-hooks": "^1.1.7",
|
||||||
|
"diff": "^8.0.2",
|
||||||
|
"docx": "^9.0.2",
|
||||||
|
"dompurify": "^3.2.6",
|
||||||
"dotenv-cli": "^7.4.2",
|
"dotenv-cli": "^7.4.2",
|
||||||
"electron": "35.2.2",
|
"drizzle-kit": "^0.31.4",
|
||||||
|
"drizzle-orm": "^0.44.5",
|
||||||
|
"electron": "37.6.0",
|
||||||
"electron-builder": "26.0.15",
|
"electron-builder": "26.0.15",
|
||||||
"electron-devtools-installer": "^3.2.0",
|
"electron-devtools-installer": "^3.2.0",
|
||||||
"electron-icon-builder": "^2.0.1",
|
"electron-reload": "^2.0.0-alpha.1",
|
||||||
"electron-vite": "^3.1.0",
|
"electron-store": "^8.2.0",
|
||||||
|
"electron-updater": "6.6.4",
|
||||||
|
"electron-vite": "4.0.0",
|
||||||
|
"electron-window-state": "^5.0.3",
|
||||||
"emittery": "^1.0.3",
|
"emittery": "^1.0.3",
|
||||||
"emoji-picker-element": "^1.22.1",
|
"emoji-picker-element": "^1.22.1",
|
||||||
|
"epub": "patch:epub@npm%3A1.3.0#~/.yarn/patches/epub-npm-1.3.0-8325494ffe.patch",
|
||||||
"eslint": "^9.22.0",
|
"eslint": "^9.22.0",
|
||||||
|
"eslint-plugin-import-zod": "^1.2.0",
|
||||||
|
"eslint-plugin-oxlint": "^1.15.0",
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||||
"eslint-plugin-unused-imports": "^4.1.4",
|
"eslint-plugin-unused-imports": "^4.1.4",
|
||||||
|
"express": "^5.1.0",
|
||||||
|
"express-validator": "^7.2.1",
|
||||||
|
"fast-diff": "^1.3.0",
|
||||||
|
"fast-xml-parser": "^5.2.0",
|
||||||
|
"fetch-socks": "1.3.2",
|
||||||
|
"framer-motion": "^12.23.12",
|
||||||
|
"franc-min": "^6.2.0",
|
||||||
|
"fs-extra": "^11.2.0",
|
||||||
|
"google-auth-library": "^9.15.1",
|
||||||
|
"he": "^1.2.0",
|
||||||
|
"html-tags": "^5.1.0",
|
||||||
"html-to-image": "^1.11.13",
|
"html-to-image": "^1.11.13",
|
||||||
|
"html-to-text": "^9.0.5",
|
||||||
|
"htmlparser2": "^10.0.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"i18next": "^23.11.5",
|
"i18next": "^23.11.5",
|
||||||
|
"iconv-lite": "^0.6.3",
|
||||||
|
"isbinaryfile": "5.0.4",
|
||||||
|
"jaison": "^2.0.2",
|
||||||
|
"jest-styled-components": "^7.2.0",
|
||||||
|
"linguist-languages": "^8.1.0",
|
||||||
"lint-staged": "^15.5.0",
|
"lint-staged": "^15.5.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lru-cache": "^11.1.0",
|
"lru-cache": "^11.1.0",
|
||||||
"lucide-react": "^0.487.0",
|
"lucide-react": "^0.525.0",
|
||||||
"mermaid": "^11.6.0",
|
"macos-release": "^3.4.0",
|
||||||
|
"markdown-it": "^14.1.0",
|
||||||
|
"mermaid": "^11.10.1",
|
||||||
"mime": "^4.0.4",
|
"mime": "^4.0.4",
|
||||||
|
"mime-types": "^3.0.1",
|
||||||
"motion": "^12.10.5",
|
"motion": "^12.10.5",
|
||||||
|
"notion-helper": "^1.3.22",
|
||||||
"npx-scope-finder": "^1.2.0",
|
"npx-scope-finder": "^1.2.0",
|
||||||
"openai": "patch:openai@npm%3A4.96.0#~/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch",
|
"openai": "patch:openai@npm%3A5.12.2#~/.yarn/patches/openai-npm-5.12.2-30b075401c.patch",
|
||||||
|
"oxlint": "^1.22.0",
|
||||||
|
"oxlint-tsgolint": "^0.2.0",
|
||||||
"p-queue": "^8.1.0",
|
"p-queue": "^8.1.0",
|
||||||
"prettier": "^3.5.3",
|
"pdf-lib": "^1.17.1",
|
||||||
"rc-virtual-list": "^3.18.6",
|
"pdf-parse": "^1.1.1",
|
||||||
|
"playwright": "^1.52.0",
|
||||||
|
"proxy-agent": "^6.5.0",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
|
"react-error-boundary": "^6.0.0",
|
||||||
"react-hotkeys-hook": "^4.6.1",
|
"react-hotkeys-hook": "^4.6.1",
|
||||||
"react-i18next": "^14.1.2",
|
"react-i18next": "^14.1.2",
|
||||||
"react-infinite-scroll-component": "^6.1.0",
|
"react-infinite-scroll-component": "^6.1.0",
|
||||||
"react-markdown": "^9.0.1",
|
"react-json-view": "^1.21.3",
|
||||||
|
"react-markdown": "^10.1.0",
|
||||||
|
"react-player": "^3.3.1",
|
||||||
"react-redux": "^9.1.2",
|
"react-redux": "^9.1.2",
|
||||||
"react-router": "6",
|
"react-router": "6",
|
||||||
"react-router-dom": "6",
|
"react-router-dom": "6",
|
||||||
"react-spinners": "^0.14.1",
|
"react-spinners": "^0.14.1",
|
||||||
"react-window": "^1.8.11",
|
"react-transition-group": "^4.4.5",
|
||||||
"redux": "^5.0.1",
|
"redux": "^5.0.1",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
|
"reflect-metadata": "0.2.2",
|
||||||
"rehype-katex": "^7.0.1",
|
"rehype-katex": "^7.0.1",
|
||||||
"rehype-mathjax": "^7.0.0",
|
"rehype-mathjax": "^7.1.0",
|
||||||
|
"rehype-parse": "^9.0.1",
|
||||||
"rehype-raw": "^7.0.0",
|
"rehype-raw": "^7.0.0",
|
||||||
"remark-cjk-friendly": "^1.1.0",
|
"rehype-stringify": "^10.0.1",
|
||||||
"remark-gfm": "^4.0.0",
|
"remark-cjk-friendly": "^1.2.0",
|
||||||
|
"remark-gfm": "^4.0.1",
|
||||||
|
"remark-github-blockquote-alert": "^2.0.0",
|
||||||
"remark-math": "^6.0.0",
|
"remark-math": "^6.0.0",
|
||||||
|
"remove-markdown": "^0.6.2",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"sass": "^1.88.0",
|
"shiki": "^3.12.0",
|
||||||
"shiki": "^3.2.2",
|
"strict-url-sanitise": "^0.0.1",
|
||||||
"string-width": "^7.2.0",
|
"string-width": "^7.2.0",
|
||||||
|
"striptags": "^3.2.0",
|
||||||
"styled-components": "^6.1.11",
|
"styled-components": "^6.1.11",
|
||||||
|
"swagger-ui-express": "^5.0.1",
|
||||||
|
"swr": "^2.3.6",
|
||||||
|
"tailwindcss": "^4.1.13",
|
||||||
|
"tar": "^7.4.3",
|
||||||
"tiny-pinyin": "^1.3.2",
|
"tiny-pinyin": "^1.3.2",
|
||||||
"tokenx": "^0.4.1",
|
"tokenx": "^1.1.0",
|
||||||
"typescript": "^5.6.2",
|
"tsx": "^4.20.3",
|
||||||
"uuid": "^10.0.0",
|
"turndown-plugin-gfm": "^1.0.2",
|
||||||
"vite": "6.2.6",
|
"tw-animate-css": "^1.3.8",
|
||||||
"vitest": "^3.1.1"
|
"typescript": "~5.8.2",
|
||||||
|
"undici": "6.21.2",
|
||||||
|
"unified": "^11.0.5",
|
||||||
|
"uuid": "^13.0.0",
|
||||||
|
"vite": "npm:rolldown-vite@latest",
|
||||||
|
"vitest": "^3.2.4",
|
||||||
|
"webdav": "^5.8.0",
|
||||||
|
"winston": "^3.17.0",
|
||||||
|
"winston-daily-rotate-file": "^5.0.0",
|
||||||
|
"word-extractor": "^1.0.4",
|
||||||
|
"y-protocols": "^1.0.6",
|
||||||
|
"yaml": "^2.8.1",
|
||||||
|
"yjs": "^13.6.27",
|
||||||
|
"youtubei.js": "^15.0.1",
|
||||||
|
"zipread": "^1.3.3",
|
||||||
|
"zod": "^4.1.5"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"pdf-parse@npm:1.1.1": "patch:pdf-parse@npm%3A1.1.1#~/.yarn/patches/pdf-parse-npm-1.1.1-04a6109b2a.patch",
|
"@codemirror/language": "6.11.3",
|
||||||
|
"@codemirror/lint": "6.8.5",
|
||||||
|
"@codemirror/view": "6.38.1",
|
||||||
|
"@langchain/core@npm:^0.3.26": "patch:@langchain/core@npm%3A0.3.44#~/.yarn/patches/@langchain-core-npm-0.3.44-41d5c3cb0a.patch",
|
||||||
"@langchain/openai@npm:^0.3.16": "patch:@langchain/openai@npm%3A0.3.16#~/.yarn/patches/@langchain-openai-npm-0.3.16-e525b59526.patch",
|
"@langchain/openai@npm:^0.3.16": "patch:@langchain/openai@npm%3A0.3.16#~/.yarn/patches/@langchain-openai-npm-0.3.16-e525b59526.patch",
|
||||||
"@langchain/openai@npm:>=0.1.0 <0.4.0": "patch:@langchain/openai@npm%3A0.3.16#~/.yarn/patches/@langchain-openai-npm-0.3.16-e525b59526.patch",
|
"@langchain/openai@npm:>=0.1.0 <0.4.0": "patch:@langchain/openai@npm%3A0.3.16#~/.yarn/patches/@langchain-openai-npm-0.3.16-e525b59526.patch",
|
||||||
"node-gyp": "^9.1.0",
|
|
||||||
"libsql@npm:^0.4.4": "patch:libsql@npm%3A0.4.7#~/.yarn/patches/libsql-npm-0.4.7-444e260fb1.patch",
|
|
||||||
"openai@npm:^4.77.0": "patch:openai@npm%3A4.96.0#~/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch",
|
|
||||||
"pkce-challenge@npm:^4.1.0": "patch:pkce-challenge@npm%3A4.1.0#~/.yarn/patches/pkce-challenge-npm-4.1.0-fbc51695a3.patch",
|
|
||||||
"app-builder-lib@npm:26.0.13": "patch:app-builder-lib@npm%3A26.0.13#~/.yarn/patches/app-builder-lib-npm-26.0.13-a064c9e1d0.patch",
|
"app-builder-lib@npm:26.0.13": "patch:app-builder-lib@npm%3A26.0.13#~/.yarn/patches/app-builder-lib-npm-26.0.13-a064c9e1d0.patch",
|
||||||
"shiki": "3.2.2",
|
"app-builder-lib@npm:26.0.15": "patch:app-builder-lib@npm%3A26.0.15#~/.yarn/patches/app-builder-lib-npm-26.0.15-360e5b0476.patch",
|
||||||
"openai@npm:^4.87.3": "patch:openai@npm%3A4.96.0#~/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch",
|
"atomically@npm:^1.7.0": "patch:atomically@npm%3A1.7.0#~/.yarn/patches/atomically-npm-1.7.0-e742e5293b.patch",
|
||||||
"app-builder-lib@npm:26.0.15": "patch:app-builder-lib@npm%3A26.0.15#~/.yarn/patches/app-builder-lib-npm-26.0.15-360e5b0476.patch"
|
"esbuild": "^0.25.0",
|
||||||
|
"file-stream-rotator@npm:^0.6.1": "patch:file-stream-rotator@npm%3A0.6.1#~/.yarn/patches/file-stream-rotator-npm-0.6.1-eab45fb13d.patch",
|
||||||
|
"libsql@npm:^0.4.4": "patch:libsql@npm%3A0.4.7#~/.yarn/patches/libsql-npm-0.4.7-444e260fb1.patch",
|
||||||
|
"node-abi": "4.12.0",
|
||||||
|
"openai@npm:^4.77.0": "patch:openai@npm%3A5.12.2#~/.yarn/patches/openai-npm-5.12.2-30b075401c.patch",
|
||||||
|
"openai@npm:^4.87.3": "patch:openai@npm%3A5.12.2#~/.yarn/patches/openai-npm-5.12.2-30b075401c.patch",
|
||||||
|
"pdf-parse@npm:1.1.1": "patch:pdf-parse@npm%3A1.1.1#~/.yarn/patches/pdf-parse-npm-1.1.1-04a6109b2a.patch",
|
||||||
|
"pkce-challenge@npm:^4.1.0": "patch:pkce-challenge@npm%3A4.1.0#~/.yarn/patches/pkce-challenge-npm-4.1.0-fbc51695a3.patch",
|
||||||
|
"tar-fs": "^2.1.4",
|
||||||
|
"undici": "6.21.2",
|
||||||
|
"vite": "npm:rolldown-vite@latest",
|
||||||
|
"tesseract.js@npm:*": "patch:tesseract.js@npm%3A6.0.1#~/.yarn/patches/tesseract.js-npm-6.0.1-2562a7e46d.patch",
|
||||||
|
"@ai-sdk/google@npm:2.0.20": "patch:@ai-sdk/google@npm%3A2.0.20#~/.yarn/patches/@ai-sdk-google-npm-2.0.20-b9102f9d54.patch"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@4.6.0",
|
"packageManager": "yarn@4.9.1",
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{js,jsx,ts,tsx,cjs,mjs,cts,mts}": [
|
"*.{js,jsx,ts,tsx,cjs,mjs,cts,mts}": [
|
||||||
"prettier --write",
|
"biome format --write --no-errors-on-unmatched",
|
||||||
"eslint --fix"
|
"eslint --fix"
|
||||||
],
|
],
|
||||||
"*.{json,md,yml,yaml,css,scss,html}": [
|
"*.{json,yml,yaml,css,html}": [
|
||||||
"prettier --write"
|
"biome format --write --no-errors-on-unmatched"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
514
packages/aiCore/AI_SDK_ARCHITECTURE.md
Normal file
514
packages/aiCore/AI_SDK_ARCHITECTURE.md
Normal file
@@ -0,0 +1,514 @@
|
|||||||
|
# AI Core 基于 Vercel AI SDK 的技术架构
|
||||||
|
|
||||||
|
## 1. 架构设计理念
|
||||||
|
|
||||||
|
### 1.1 设计目标
|
||||||
|
|
||||||
|
- **简化分层**:`models`(模型层)→ `runtime`(运行时层),清晰的职责分离
|
||||||
|
- **统一接口**:使用 Vercel AI SDK 统一不同 AI Provider 的接口差异
|
||||||
|
- **动态导入**:通过动态导入实现按需加载,减少打包体积
|
||||||
|
- **最小包装**:直接使用 AI SDK 的类型和接口,避免重复定义
|
||||||
|
- **插件系统**:基于钩子的通用插件架构,支持请求全生命周期扩展
|
||||||
|
- **类型安全**:利用 TypeScript 和 AI SDK 的类型系统确保类型安全
|
||||||
|
- **轻量级**:专注核心功能,保持包的轻量和高效
|
||||||
|
- **包级独立**:作为独立包管理,便于复用和维护
|
||||||
|
- **Agent就绪**:为将来集成 OpenAI Agents SDK 预留扩展空间
|
||||||
|
|
||||||
|
### 1.2 核心优势
|
||||||
|
|
||||||
|
- **标准化**:AI SDK 提供统一的模型接口,减少适配工作
|
||||||
|
- **简化设计**:函数式API,避免过度抽象
|
||||||
|
- **更好的开发体验**:完整的 TypeScript 支持和丰富的生态系统
|
||||||
|
- **性能优化**:AI SDK 内置优化和最佳实践
|
||||||
|
- **模块化设计**:独立包结构,支持跨项目复用
|
||||||
|
- **可扩展插件**:通用的流转换和参数处理插件系统
|
||||||
|
- **面向未来**:为 OpenAI Agents SDK 集成做好准备
|
||||||
|
|
||||||
|
## 2. 整体架构图
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
subgraph "用户应用 (如 Cherry Studio)"
|
||||||
|
UI["用户界面"]
|
||||||
|
Components["应用组件"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "packages/aiCore (AI Core 包)"
|
||||||
|
subgraph "Runtime Layer (运行时层)"
|
||||||
|
RuntimeExecutor["RuntimeExecutor (运行时执行器)"]
|
||||||
|
PluginEngine["PluginEngine (插件引擎)"]
|
||||||
|
RuntimeAPI["Runtime API (便捷函数)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Models Layer (模型层)"
|
||||||
|
ModelFactory["createModel() (模型工厂)"]
|
||||||
|
ProviderCreator["ProviderCreator (提供商创建器)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Core Systems (核心系统)"
|
||||||
|
subgraph "Plugins (插件)"
|
||||||
|
PluginManager["PluginManager (插件管理)"]
|
||||||
|
BuiltInPlugins["Built-in Plugins (内置插件)"]
|
||||||
|
StreamTransforms["Stream Transforms (流转换)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Middleware (中间件)"
|
||||||
|
MiddlewareWrapper["wrapModelWithMiddlewares() (中间件包装)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Providers (提供商)"
|
||||||
|
Registry["Provider Registry (注册表)"]
|
||||||
|
Factory["Provider Factory (工厂)"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Vercel AI SDK"
|
||||||
|
AICore["ai (核心库)"]
|
||||||
|
OpenAI["@ai-sdk/openai"]
|
||||||
|
Anthropic["@ai-sdk/anthropic"]
|
||||||
|
Google["@ai-sdk/google"]
|
||||||
|
XAI["@ai-sdk/xai"]
|
||||||
|
Others["其他 19+ Providers"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Future: OpenAI Agents SDK"
|
||||||
|
AgentSDK["@openai/agents (未来集成)"]
|
||||||
|
AgentExtensions["Agent Extensions (预留)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
UI --> RuntimeAPI
|
||||||
|
Components --> RuntimeExecutor
|
||||||
|
RuntimeAPI --> RuntimeExecutor
|
||||||
|
RuntimeExecutor --> PluginEngine
|
||||||
|
RuntimeExecutor --> ModelFactory
|
||||||
|
PluginEngine --> PluginManager
|
||||||
|
ModelFactory --> ProviderCreator
|
||||||
|
ModelFactory --> MiddlewareWrapper
|
||||||
|
ProviderCreator --> Registry
|
||||||
|
Registry --> Factory
|
||||||
|
Factory --> OpenAI
|
||||||
|
Factory --> Anthropic
|
||||||
|
Factory --> Google
|
||||||
|
Factory --> XAI
|
||||||
|
Factory --> Others
|
||||||
|
|
||||||
|
RuntimeExecutor --> AICore
|
||||||
|
AICore --> streamText
|
||||||
|
AICore --> generateText
|
||||||
|
AICore --> streamObject
|
||||||
|
AICore --> generateObject
|
||||||
|
|
||||||
|
PluginManager --> StreamTransforms
|
||||||
|
PluginManager --> BuiltInPlugins
|
||||||
|
|
||||||
|
%% 未来集成路径
|
||||||
|
RuntimeExecutor -.-> AgentSDK
|
||||||
|
AgentSDK -.-> AgentExtensions
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. 包结构设计
|
||||||
|
|
||||||
|
### 3.1 新架构文件结构
|
||||||
|
|
||||||
|
```
|
||||||
|
packages/aiCore/
|
||||||
|
├── src/
|
||||||
|
│ ├── core/ # 核心层 - 内部实现
|
||||||
|
│ │ ├── models/ # 模型层 - 模型创建和配置
|
||||||
|
│ │ │ ├── factory.ts # 模型工厂函数 ✅
|
||||||
|
│ │ │ ├── ModelCreator.ts # 模型创建器 ✅
|
||||||
|
│ │ │ ├── ConfigManager.ts # 配置管理器 ✅
|
||||||
|
│ │ │ ├── types.ts # 模型类型定义 ✅
|
||||||
|
│ │ │ └── index.ts # 模型层导出 ✅
|
||||||
|
│ │ ├── runtime/ # 运行时层 - 执行和用户API
|
||||||
|
│ │ │ ├── executor.ts # 运行时执行器 ✅
|
||||||
|
│ │ │ ├── pluginEngine.ts # 插件引擎 ✅
|
||||||
|
│ │ │ ├── types.ts # 运行时类型定义 ✅
|
||||||
|
│ │ │ └── index.ts # 运行时导出 ✅
|
||||||
|
│ │ ├── middleware/ # 中间件系统
|
||||||
|
│ │ │ ├── wrapper.ts # 模型包装器 ✅
|
||||||
|
│ │ │ ├── manager.ts # 中间件管理器 ✅
|
||||||
|
│ │ │ ├── types.ts # 中间件类型 ✅
|
||||||
|
│ │ │ └── index.ts # 中间件导出 ✅
|
||||||
|
│ │ ├── plugins/ # 插件系统
|
||||||
|
│ │ │ ├── types.ts # 插件类型定义 ✅
|
||||||
|
│ │ │ ├── manager.ts # 插件管理器 ✅
|
||||||
|
│ │ │ ├── built-in/ # 内置插件 ✅
|
||||||
|
│ │ │ │ ├── logging.ts # 日志插件 ✅
|
||||||
|
│ │ │ │ ├── webSearchPlugin/ # 网络搜索插件 ✅
|
||||||
|
│ │ │ │ ├── toolUsePlugin/ # 工具使用插件 ✅
|
||||||
|
│ │ │ │ └── index.ts # 内置插件导出 ✅
|
||||||
|
│ │ │ ├── README.md # 插件文档 ✅
|
||||||
|
│ │ │ └── index.ts # 插件导出 ✅
|
||||||
|
│ │ ├── providers/ # 提供商管理
|
||||||
|
│ │ │ ├── registry.ts # 提供商注册表 ✅
|
||||||
|
│ │ │ ├── factory.ts # 提供商工厂 ✅
|
||||||
|
│ │ │ ├── creator.ts # 提供商创建器 ✅
|
||||||
|
│ │ │ ├── types.ts # 提供商类型 ✅
|
||||||
|
│ │ │ ├── utils.ts # 工具函数 ✅
|
||||||
|
│ │ │ └── index.ts # 提供商导出 ✅
|
||||||
|
│ │ ├── options/ # 配置选项
|
||||||
|
│ │ │ ├── factory.ts # 选项工厂 ✅
|
||||||
|
│ │ │ ├── types.ts # 选项类型 ✅
|
||||||
|
│ │ │ ├── xai.ts # xAI 选项 ✅
|
||||||
|
│ │ │ ├── openrouter.ts # OpenRouter 选项 ✅
|
||||||
|
│ │ │ ├── examples.ts # 示例配置 ✅
|
||||||
|
│ │ │ └── index.ts # 选项导出 ✅
|
||||||
|
│ │ └── index.ts # 核心层导出 ✅
|
||||||
|
│ ├── types.ts # 全局类型定义 ✅
|
||||||
|
│ └── index.ts # 包主入口文件 ✅
|
||||||
|
├── package.json # 包配置文件 ✅
|
||||||
|
├── tsconfig.json # TypeScript 配置 ✅
|
||||||
|
├── README.md # 包说明文档 ✅
|
||||||
|
└── AI_SDK_ARCHITECTURE.md # 本文档 ✅
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. 架构分层详解
|
||||||
|
|
||||||
|
### 4.1 Models Layer (模型层)
|
||||||
|
|
||||||
|
**职责**:统一的模型创建和配置管理
|
||||||
|
|
||||||
|
**核心文件**:
|
||||||
|
|
||||||
|
- `factory.ts`: 模型工厂函数 (`createModel`, `createModels`)
|
||||||
|
- `ProviderCreator.ts`: 底层提供商创建和模型实例化
|
||||||
|
- `types.ts`: 模型配置类型定义
|
||||||
|
|
||||||
|
**设计特点**:
|
||||||
|
|
||||||
|
- 函数式设计,避免不必要的类抽象
|
||||||
|
- 统一的模型配置接口
|
||||||
|
- 自动处理中间件应用
|
||||||
|
- 支持批量模型创建
|
||||||
|
|
||||||
|
**核心API**:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// 模型配置接口
|
||||||
|
export interface ModelConfig {
|
||||||
|
providerId: ProviderId
|
||||||
|
modelId: string
|
||||||
|
options: ProviderSettingsMap[ProviderId]
|
||||||
|
middlewares?: LanguageModelV1Middleware[]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核心模型创建函数
|
||||||
|
export async function createModel(config: ModelConfig): Promise<LanguageModel>
|
||||||
|
export async function createModels(configs: ModelConfig[]): Promise<LanguageModel[]>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.2 Runtime Layer (运行时层)
|
||||||
|
|
||||||
|
**职责**:运行时执行器和用户面向的API接口
|
||||||
|
|
||||||
|
**核心组件**:
|
||||||
|
|
||||||
|
- `executor.ts`: 运行时执行器类
|
||||||
|
- `plugin-engine.ts`: 插件引擎(原PluginEnabledAiClient)
|
||||||
|
- `index.ts`: 便捷函数和工厂方法
|
||||||
|
|
||||||
|
**设计特点**:
|
||||||
|
|
||||||
|
- 提供三种使用方式:类实例、静态工厂、函数式调用
|
||||||
|
- 自动集成模型创建和插件处理
|
||||||
|
- 完整的类型安全支持
|
||||||
|
- 为 OpenAI Agents SDK 预留扩展接口
|
||||||
|
|
||||||
|
**核心API**:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// 运行时执行器
|
||||||
|
export class RuntimeExecutor<T extends ProviderId = ProviderId> {
|
||||||
|
static create<T extends ProviderId>(
|
||||||
|
providerId: T,
|
||||||
|
options: ProviderSettingsMap[T],
|
||||||
|
plugins?: AiPlugin[]
|
||||||
|
): RuntimeExecutor<T>
|
||||||
|
|
||||||
|
async streamText(modelId: string, params: StreamTextParams): Promise<StreamTextResult>
|
||||||
|
async generateText(modelId: string, params: GenerateTextParams): Promise<GenerateTextResult>
|
||||||
|
async streamObject(modelId: string, params: StreamObjectParams): Promise<StreamObjectResult>
|
||||||
|
async generateObject(modelId: string, params: GenerateObjectParams): Promise<GenerateObjectResult>
|
||||||
|
}
|
||||||
|
|
||||||
|
// 便捷函数式API
|
||||||
|
export async function streamText<T extends ProviderId>(
|
||||||
|
providerId: T,
|
||||||
|
options: ProviderSettingsMap[T],
|
||||||
|
modelId: string,
|
||||||
|
params: StreamTextParams,
|
||||||
|
plugins?: AiPlugin[]
|
||||||
|
): Promise<StreamTextResult>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.3 Plugin System (插件系统)
|
||||||
|
|
||||||
|
**职责**:可扩展的插件架构
|
||||||
|
|
||||||
|
**核心组件**:
|
||||||
|
|
||||||
|
- `PluginManager`: 插件生命周期管理
|
||||||
|
- `built-in/`: 内置插件集合
|
||||||
|
- 流转换收集和应用
|
||||||
|
|
||||||
|
**设计特点**:
|
||||||
|
|
||||||
|
- 借鉴 Rollup 的钩子分类设计
|
||||||
|
- 支持流转换 (`experimental_transform`)
|
||||||
|
- 内置常用插件(日志、计数等)
|
||||||
|
- 完整的生命周期钩子
|
||||||
|
|
||||||
|
**插件接口**:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface AiPlugin {
|
||||||
|
name: string
|
||||||
|
enforce?: 'pre' | 'post'
|
||||||
|
|
||||||
|
// 【First】首个钩子 - 只执行第一个返回值的插件
|
||||||
|
resolveModel?: (modelId: string, context: AiRequestContext) => string | null | Promise<string | null>
|
||||||
|
loadTemplate?: (templateName: string, context: AiRequestContext) => any | null | Promise<any | null>
|
||||||
|
|
||||||
|
// 【Sequential】串行钩子 - 链式执行,支持数据转换
|
||||||
|
transformParams?: (params: any, context: AiRequestContext) => any | Promise<any>
|
||||||
|
transformResult?: (result: any, context: AiRequestContext) => any | Promise<any>
|
||||||
|
|
||||||
|
// 【Parallel】并行钩子 - 不依赖顺序,用于副作用
|
||||||
|
onRequestStart?: (context: AiRequestContext) => void | Promise<void>
|
||||||
|
onRequestEnd?: (context: AiRequestContext, result: any) => void | Promise<void>
|
||||||
|
onError?: (error: Error, context: AiRequestContext) => void | Promise<void>
|
||||||
|
|
||||||
|
// 【Stream】流处理
|
||||||
|
transformStream?: () => TransformStream
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.4 Middleware System (中间件系统)
|
||||||
|
|
||||||
|
**职责**:AI SDK原生中间件支持
|
||||||
|
|
||||||
|
**核心组件**:
|
||||||
|
|
||||||
|
- `ModelWrapper.ts`: 模型包装函数
|
||||||
|
|
||||||
|
**设计哲学**:
|
||||||
|
|
||||||
|
- 直接使用AI SDK的 `wrapLanguageModel`
|
||||||
|
- 与插件系统分离,职责明确
|
||||||
|
- 函数式设计,简化使用
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export function wrapModelWithMiddlewares(model: LanguageModel, middlewares: LanguageModelV1Middleware[]): LanguageModel
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.5 Provider System (提供商系统)
|
||||||
|
|
||||||
|
**职责**:AI Provider注册表和动态导入
|
||||||
|
|
||||||
|
**核心组件**:
|
||||||
|
|
||||||
|
- `registry.ts`: 19+ Provider配置和类型
|
||||||
|
- `factory.ts`: Provider配置工厂
|
||||||
|
|
||||||
|
**支持的Providers**:
|
||||||
|
|
||||||
|
- OpenAI, Anthropic, Google, XAI
|
||||||
|
- Azure OpenAI, Amazon Bedrock, Google Vertex
|
||||||
|
- Groq, Together.ai, Fireworks, DeepSeek
|
||||||
|
- 等19+ AI SDK官方支持的providers
|
||||||
|
|
||||||
|
## 5. 使用方式
|
||||||
|
|
||||||
|
### 5.1 函数式调用 (推荐 - 简单场景)
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { streamText, generateText } from '@cherrystudio/ai-core/runtime'
|
||||||
|
|
||||||
|
// 直接函数调用
|
||||||
|
const stream = await streamText(
|
||||||
|
'anthropic',
|
||||||
|
{ apiKey: 'your-api-key' },
|
||||||
|
'claude-3',
|
||||||
|
{ messages: [{ role: 'user', content: 'Hello!' }] },
|
||||||
|
[loggingPlugin]
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5.2 执行器实例 (推荐 - 复杂场景)
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createExecutor } from '@cherrystudio/ai-core/runtime'
|
||||||
|
|
||||||
|
// 创建可复用的执行器
|
||||||
|
const executor = createExecutor('openai', { apiKey: 'your-api-key' }, [plugin1, plugin2])
|
||||||
|
|
||||||
|
// 多次使用
|
||||||
|
const stream = await executor.streamText('gpt-4', {
|
||||||
|
messages: [{ role: 'user', content: 'Hello!' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
const result = await executor.generateText('gpt-4', {
|
||||||
|
messages: [{ role: 'user', content: 'How are you?' }]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5.3 静态工厂方法
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { RuntimeExecutor } from '@cherrystudio/ai-core/runtime'
|
||||||
|
|
||||||
|
// 静态创建
|
||||||
|
const executor = RuntimeExecutor.create('anthropic', { apiKey: 'your-api-key' })
|
||||||
|
await executor.streamText('claude-3', { messages: [...] })
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5.4 直接模型创建 (高级用法)
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createModel } from '@cherrystudio/ai-core/models'
|
||||||
|
import { streamText } from 'ai'
|
||||||
|
|
||||||
|
// 直接创建模型使用
|
||||||
|
const model = await createModel({
|
||||||
|
providerId: 'openai',
|
||||||
|
modelId: 'gpt-4',
|
||||||
|
options: { apiKey: 'your-api-key' },
|
||||||
|
middlewares: [middleware1, middleware2]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 直接使用 AI SDK
|
||||||
|
const result = await streamText({ model, messages: [...] })
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6. 为 OpenAI Agents SDK 预留的设计
|
||||||
|
|
||||||
|
### 6.1 架构兼容性
|
||||||
|
|
||||||
|
当前架构完全兼容 OpenAI Agents SDK 的集成需求:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// 当前的模型创建
|
||||||
|
const model = await createModel({
|
||||||
|
providerId: 'anthropic',
|
||||||
|
modelId: 'claude-3',
|
||||||
|
options: { apiKey: 'xxx' }
|
||||||
|
})
|
||||||
|
|
||||||
|
// 将来可以直接用于 OpenAI Agents SDK
|
||||||
|
import { Agent, run } from '@openai/agents'
|
||||||
|
|
||||||
|
const agent = new Agent({
|
||||||
|
model, // ✅ 直接兼容 LanguageModel 接口
|
||||||
|
name: 'Assistant',
|
||||||
|
instructions: '...',
|
||||||
|
tools: [tool1, tool2]
|
||||||
|
})
|
||||||
|
|
||||||
|
const result = await run(agent, 'user input')
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.2 预留的扩展点
|
||||||
|
|
||||||
|
1. **runtime/agents/** 目录预留
|
||||||
|
2. **AgentExecutor** 类预留
|
||||||
|
3. **Agent工具转换插件** 预留
|
||||||
|
4. **多Agent编排** 预留
|
||||||
|
|
||||||
|
### 6.3 未来架构扩展
|
||||||
|
|
||||||
|
```
|
||||||
|
packages/aiCore/src/core/
|
||||||
|
├── runtime/
|
||||||
|
│ ├── agents/ # 🚀 未来添加
|
||||||
|
│ │ ├── AgentExecutor.ts
|
||||||
|
│ │ ├── WorkflowManager.ts
|
||||||
|
│ │ └── ConversationManager.ts
|
||||||
|
│ ├── executor.ts
|
||||||
|
│ └── index.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
## 7. 架构优势
|
||||||
|
|
||||||
|
### 7.1 简化设计
|
||||||
|
|
||||||
|
- **移除过度抽象**:删除了orchestration层和creation层的复杂包装
|
||||||
|
- **函数式优先**:models层使用函数而非类
|
||||||
|
- **直接明了**:runtime层直接提供用户API
|
||||||
|
|
||||||
|
### 7.2 职责清晰
|
||||||
|
|
||||||
|
- **Models**: 专注模型创建和配置
|
||||||
|
- **Runtime**: 专注执行和用户API
|
||||||
|
- **Plugins**: 专注扩展功能
|
||||||
|
- **Providers**: 专注AI Provider管理
|
||||||
|
|
||||||
|
### 7.3 类型安全
|
||||||
|
|
||||||
|
- 完整的 TypeScript 支持
|
||||||
|
- AI SDK 类型的直接复用
|
||||||
|
- 避免类型重复定义
|
||||||
|
|
||||||
|
### 7.4 灵活使用
|
||||||
|
|
||||||
|
- 三种使用模式满足不同需求
|
||||||
|
- 从简单函数调用到复杂执行器
|
||||||
|
- 支持直接AI SDK使用
|
||||||
|
|
||||||
|
### 7.5 面向未来
|
||||||
|
|
||||||
|
- 为 OpenAI Agents SDK 集成做好准备
|
||||||
|
- 清晰的扩展点和架构边界
|
||||||
|
- 模块化设计便于功能添加
|
||||||
|
|
||||||
|
## 8. 技术决策记录
|
||||||
|
|
||||||
|
### 8.1 为什么选择简化的两层架构?
|
||||||
|
|
||||||
|
- **职责分离**:models专注创建,runtime专注执行
|
||||||
|
- **模块化**:每层都有清晰的边界和职责
|
||||||
|
- **扩展性**:为Agent功能预留了清晰的扩展空间
|
||||||
|
|
||||||
|
### 8.2 为什么选择函数式设计?
|
||||||
|
|
||||||
|
- **简洁性**:避免不必要的类设计
|
||||||
|
- **性能**:减少对象创建开销
|
||||||
|
- **易用性**:函数调用更直观
|
||||||
|
|
||||||
|
### 8.3 为什么分离插件和中间件?
|
||||||
|
|
||||||
|
- **职责明确**: 插件处理应用特定需求
|
||||||
|
- **原生支持**: 中间件使用AI SDK原生功能
|
||||||
|
- **灵活性**: 两套系统可以独立演进
|
||||||
|
|
||||||
|
## 9. 总结
|
||||||
|
|
||||||
|
AI Core架构实现了:
|
||||||
|
|
||||||
|
### 9.1 核心特点
|
||||||
|
|
||||||
|
- ✅ **简化架构**: 2层核心架构,职责清晰
|
||||||
|
- ✅ **函数式设计**: models层完全函数化
|
||||||
|
- ✅ **类型安全**: 统一的类型定义和AI SDK类型复用
|
||||||
|
- ✅ **插件扩展**: 强大的插件系统
|
||||||
|
- ✅ **多种使用方式**: 满足不同复杂度需求
|
||||||
|
- ✅ **Agent就绪**: 为OpenAI Agents SDK集成做好准备
|
||||||
|
|
||||||
|
### 9.2 核心价值
|
||||||
|
|
||||||
|
- **统一接口**: 一套API支持19+ AI providers
|
||||||
|
- **灵活使用**: 函数式、实例式、静态工厂式
|
||||||
|
- **强类型**: 完整的TypeScript支持
|
||||||
|
- **可扩展**: 插件和中间件双重扩展能力
|
||||||
|
- **高性能**: 最小化包装,直接使用AI SDK
|
||||||
|
- **面向未来**: Agent SDK集成架构就绪
|
||||||
|
|
||||||
|
### 9.3 未来发展
|
||||||
|
|
||||||
|
这个架构提供了:
|
||||||
|
|
||||||
|
- **优秀的开发体验**: 简洁的API和清晰的使用模式
|
||||||
|
- **强大的扩展能力**: 为Agent功能预留了完整的架构空间
|
||||||
|
- **良好的维护性**: 职责分离明确,代码易于维护
|
||||||
|
- **广泛的适用性**: 既适合简单调用也适合复杂应用
|
||||||
433
packages/aiCore/README.md
Normal file
433
packages/aiCore/README.md
Normal file
@@ -0,0 +1,433 @@
|
|||||||
|
# @cherrystudio/ai-core
|
||||||
|
|
||||||
|
Cherry Studio AI Core 是一个基于 Vercel AI SDK 的统一 AI Provider 接口包,为 AI 应用提供强大的抽象层和插件化架构。
|
||||||
|
|
||||||
|
## ✨ 核心亮点
|
||||||
|
|
||||||
|
### 🏗️ 优雅的架构设计
|
||||||
|
|
||||||
|
- **简化分层**:`models`(模型层)→ `runtime`(运行时层),清晰的职责分离
|
||||||
|
- **函数式优先**:避免过度抽象,提供简洁直观的 API
|
||||||
|
- **类型安全**:完整的 TypeScript 支持,直接复用 AI SDK 类型系统
|
||||||
|
- **最小包装**:直接使用 AI SDK 的接口,避免重复定义和性能损耗
|
||||||
|
|
||||||
|
### 🔌 强大的插件系统
|
||||||
|
|
||||||
|
- **生命周期钩子**:支持请求全生命周期的扩展点
|
||||||
|
- **流转换支持**:基于 AI SDK 的 `experimental_transform` 实现流处理
|
||||||
|
- **插件分类**:First、Sequential、Parallel 三种钩子类型,满足不同场景
|
||||||
|
- **内置插件**:webSearch、logging、toolUse 等开箱即用的功能
|
||||||
|
|
||||||
|
### 🌐 统一多 Provider 接口
|
||||||
|
|
||||||
|
- **扩展注册**:支持自定义 Provider 注册,无限扩展能力
|
||||||
|
- **配置统一**:统一的配置接口,简化多 Provider 管理
|
||||||
|
|
||||||
|
### 🚀 多种使用方式
|
||||||
|
|
||||||
|
- **函数式调用**:适合简单场景的直接函数调用
|
||||||
|
- **执行器实例**:适合复杂场景的可复用执行器
|
||||||
|
- **静态工厂**:便捷的静态创建方法
|
||||||
|
- **原生兼容**:完全兼容 AI SDK 原生 Provider Registry
|
||||||
|
|
||||||
|
### 🔮 面向未来
|
||||||
|
|
||||||
|
- **Agent 就绪**:为 OpenAI Agents SDK 集成预留架构空间
|
||||||
|
- **模块化设计**:独立包结构,支持跨项目复用
|
||||||
|
- **渐进式迁移**:可以逐步从现有 AI SDK 代码迁移
|
||||||
|
|
||||||
|
## 特性
|
||||||
|
|
||||||
|
- 🚀 统一的 AI Provider 接口
|
||||||
|
- 🔄 动态导入支持
|
||||||
|
- 🛠️ TypeScript 支持
|
||||||
|
- 📦 强大的插件系统
|
||||||
|
- 🌍 内置webSearch(Openai,Google,Anthropic,xAI)
|
||||||
|
- 🎯 多种使用模式(函数式/实例式/静态工厂)
|
||||||
|
- 🔌 可扩展的 Provider 注册系统
|
||||||
|
- 🧩 完整的中间件支持
|
||||||
|
- 📊 插件统计和调试功能
|
||||||
|
|
||||||
|
## 支持的 Providers
|
||||||
|
|
||||||
|
基于 [AI SDK 官方支持的 providers](https://ai-sdk.dev/providers/ai-sdk-providers):
|
||||||
|
|
||||||
|
**核心 Providers(内置支持):**
|
||||||
|
|
||||||
|
- OpenAI
|
||||||
|
- Anthropic
|
||||||
|
- Google Generative AI
|
||||||
|
- OpenAI-Compatible
|
||||||
|
- xAI (Grok)
|
||||||
|
- Azure OpenAI
|
||||||
|
- DeepSeek
|
||||||
|
|
||||||
|
**扩展 Providers(通过注册API支持):**
|
||||||
|
|
||||||
|
- Google Vertex AI
|
||||||
|
- ...
|
||||||
|
- 自定义 Provider
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @cherrystudio/ai-core ai
|
||||||
|
```
|
||||||
|
|
||||||
|
### React Native
|
||||||
|
|
||||||
|
如果你在 React Native 项目中使用此包,需要在 `metro.config.js` 中添加以下配置:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// metro.config.js
|
||||||
|
const { getDefaultConfig } = require('expo/metro-config')
|
||||||
|
|
||||||
|
const config = getDefaultConfig(__dirname)
|
||||||
|
|
||||||
|
// 添加对 @cherrystudio/ai-core 的支持
|
||||||
|
config.resolver.resolverMainFields = ['react-native', 'browser', 'main']
|
||||||
|
config.resolver.platforms = ['ios', 'android', 'native', 'web']
|
||||||
|
|
||||||
|
module.exports = config
|
||||||
|
```
|
||||||
|
|
||||||
|
还需要安装你要使用的 AI SDK provider:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google
|
||||||
|
```
|
||||||
|
|
||||||
|
## 使用示例
|
||||||
|
|
||||||
|
### 基础用法
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { AiCore } from '@cherrystudio/ai-core'
|
||||||
|
|
||||||
|
// 创建 OpenAI executor
|
||||||
|
const executor = AiCore.create('openai', {
|
||||||
|
apiKey: 'your-api-key'
|
||||||
|
})
|
||||||
|
|
||||||
|
// 流式生成
|
||||||
|
const result = await executor.streamText('gpt-4', {
|
||||||
|
messages: [{ role: 'user', content: 'Hello!' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 非流式生成
|
||||||
|
const response = await executor.generateText('gpt-4', {
|
||||||
|
messages: [{ role: 'user', content: 'Hello!' }]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 便捷函数
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createOpenAIExecutor } from '@cherrystudio/ai-core'
|
||||||
|
|
||||||
|
// 快速创建 OpenAI executor
|
||||||
|
const executor = createOpenAIExecutor({
|
||||||
|
apiKey: 'your-api-key'
|
||||||
|
})
|
||||||
|
|
||||||
|
// 使用 executor
|
||||||
|
const result = await executor.streamText('gpt-4', {
|
||||||
|
messages: [{ role: 'user', content: 'Hello!' }]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 多 Provider 支持
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { AiCore } from '@cherrystudio/ai-core'
|
||||||
|
|
||||||
|
// 支持多种 AI providers
|
||||||
|
const openaiExecutor = AiCore.create('openai', { apiKey: 'openai-key' })
|
||||||
|
const anthropicExecutor = AiCore.create('anthropic', { apiKey: 'anthropic-key' })
|
||||||
|
const googleExecutor = AiCore.create('google', { apiKey: 'google-key' })
|
||||||
|
const xaiExecutor = AiCore.create('xai', { apiKey: 'xai-key' })
|
||||||
|
```
|
||||||
|
|
||||||
|
### 扩展 Provider 注册
|
||||||
|
|
||||||
|
对于非内置的 providers,可以通过注册 API 扩展支持:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { registerProvider, AiCore } from '@cherrystudio/ai-core'
|
||||||
|
|
||||||
|
// 方式一:导入并注册第三方 provider
|
||||||
|
import { createGroq } from '@ai-sdk/groq'
|
||||||
|
|
||||||
|
registerProvider({
|
||||||
|
id: 'groq',
|
||||||
|
name: 'Groq',
|
||||||
|
creator: createGroq,
|
||||||
|
supportsImageGeneration: false
|
||||||
|
})
|
||||||
|
|
||||||
|
// 现在可以使用 Groq
|
||||||
|
const groqExecutor = AiCore.create('groq', { apiKey: 'groq-key' })
|
||||||
|
|
||||||
|
// 方式二:动态导入方式注册
|
||||||
|
registerProvider({
|
||||||
|
id: 'mistral',
|
||||||
|
name: 'Mistral AI',
|
||||||
|
import: () => import('@ai-sdk/mistral'),
|
||||||
|
creatorFunctionName: 'createMistral'
|
||||||
|
})
|
||||||
|
|
||||||
|
const mistralExecutor = AiCore.create('mistral', { apiKey: 'mistral-key' })
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔌 插件系统
|
||||||
|
|
||||||
|
AI Core 提供了强大的插件系统,支持请求全生命周期的扩展。
|
||||||
|
|
||||||
|
### 内置插件
|
||||||
|
|
||||||
|
#### webSearchPlugin - 网络搜索插件
|
||||||
|
|
||||||
|
为不同 AI Provider 提供统一的网络搜索能力:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { webSearchPlugin } from '@cherrystudio/ai-core/built-in/plugins'
|
||||||
|
|
||||||
|
const executor = AiCore.create('openai', { apiKey: 'your-key' }, [
|
||||||
|
webSearchPlugin({
|
||||||
|
openai: {
|
||||||
|
/* OpenAI 搜索配置 */
|
||||||
|
},
|
||||||
|
anthropic: { maxUses: 5 },
|
||||||
|
google: {
|
||||||
|
/* Google 搜索配置 */
|
||||||
|
},
|
||||||
|
xai: {
|
||||||
|
mode: 'on',
|
||||||
|
returnCitations: true,
|
||||||
|
maxSearchResults: 5,
|
||||||
|
sources: [{ type: 'web' }, { type: 'x' }, { type: 'news' }]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
```
|
||||||
|
|
||||||
|
#### loggingPlugin - 日志插件
|
||||||
|
|
||||||
|
提供详细的请求日志记录:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createLoggingPlugin } from '@cherrystudio/ai-core/built-in/plugins'
|
||||||
|
|
||||||
|
const executor = AiCore.create('openai', { apiKey: 'your-key' }, [
|
||||||
|
createLoggingPlugin({
|
||||||
|
logLevel: 'info',
|
||||||
|
includeParams: true,
|
||||||
|
includeResult: false
|
||||||
|
})
|
||||||
|
])
|
||||||
|
```
|
||||||
|
|
||||||
|
#### promptToolUsePlugin - 提示工具使用插件
|
||||||
|
|
||||||
|
为不支持原生 Function Call 的模型提供 prompt 方式的工具调用:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createPromptToolUsePlugin } from '@cherrystudio/ai-core/built-in/plugins'
|
||||||
|
|
||||||
|
// 对于不支持 function call 的模型
|
||||||
|
const executor = AiCore.create(
|
||||||
|
'providerId',
|
||||||
|
{
|
||||||
|
apiKey: 'your-key',
|
||||||
|
baseURL: 'https://your-model-endpoint'
|
||||||
|
},
|
||||||
|
[
|
||||||
|
createPromptToolUsePlugin({
|
||||||
|
enabled: true,
|
||||||
|
// 可选:自定义系统提示符构建
|
||||||
|
buildSystemPrompt: (userPrompt, tools) => {
|
||||||
|
return `${userPrompt}\n\nAvailable tools: ${Object.keys(tools).join(', ')}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 自定义插件
|
||||||
|
|
||||||
|
创建自定义插件非常简单:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { definePlugin } from '@cherrystudio/ai-core'
|
||||||
|
|
||||||
|
const customPlugin = definePlugin({
|
||||||
|
name: 'custom-plugin',
|
||||||
|
enforce: 'pre', // 'pre' | 'post' | undefined
|
||||||
|
|
||||||
|
// 在请求开始时记录日志
|
||||||
|
onRequestStart: async (context) => {
|
||||||
|
console.log(`Starting request for model: ${context.modelId}`)
|
||||||
|
},
|
||||||
|
|
||||||
|
// 转换请求参数
|
||||||
|
transformParams: async (params, context) => {
|
||||||
|
// 添加自定义系统消息
|
||||||
|
if (params.messages) {
|
||||||
|
params.messages.unshift({
|
||||||
|
role: 'system',
|
||||||
|
content: 'You are a helpful assistant.'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return params
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理响应结果
|
||||||
|
transformResult: async (result, context) => {
|
||||||
|
// 添加元数据
|
||||||
|
if (result.text) {
|
||||||
|
result.metadata = {
|
||||||
|
processedAt: new Date().toISOString(),
|
||||||
|
modelId: context.modelId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 使用自定义插件
|
||||||
|
const executor = AiCore.create('openai', { apiKey: 'your-key' }, [customPlugin])
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用 AI SDK 原生 Provider 注册表
|
||||||
|
|
||||||
|
> https://ai-sdk.dev/docs/reference/ai-sdk-core/provider-registry
|
||||||
|
|
||||||
|
除了使用内建的 provider 管理,你还可以使用 AI SDK 原生的 `createProviderRegistry` 来构建自己的 provider 注册表。
|
||||||
|
|
||||||
|
#### 基本用法示例
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createClient } from '@cherrystudio/ai-core'
|
||||||
|
import { createProviderRegistry } from 'ai'
|
||||||
|
import { createOpenAI } from '@ai-sdk/openai'
|
||||||
|
import { anthropic } from '@ai-sdk/anthropic'
|
||||||
|
|
||||||
|
// 1. 创建 AI SDK 原生注册表
|
||||||
|
export const registry = createProviderRegistry({
|
||||||
|
// register provider with prefix and default setup:
|
||||||
|
anthropic,
|
||||||
|
|
||||||
|
// register provider with prefix and custom setup:
|
||||||
|
openai: createOpenAI({
|
||||||
|
apiKey: process.env.OPENAI_API_KEY
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 2. 创建client,'openai'可以传空或者传providerId(内建的provider)
|
||||||
|
const client = PluginEnabledAiClient.create('openai', {
|
||||||
|
apiKey: process.env.OPENAI_API_KEY
|
||||||
|
})
|
||||||
|
|
||||||
|
// 3. 方式1:使用内建逻辑(传统方式)
|
||||||
|
const result1 = await client.streamText('gpt-4', {
|
||||||
|
messages: [{ role: 'user', content: 'Hello with built-in logic!' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 4. 方式2:使用自定义注册表(灵活方式)
|
||||||
|
const result2 = await client.streamText({
|
||||||
|
model: registry.languageModel('openai:gpt-4'),
|
||||||
|
messages: [{ role: 'user', content: 'Hello with custom registry!' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 5. 支持的重载方法
|
||||||
|
await client.generateObject({
|
||||||
|
model: registry.languageModel('openai:gpt-4'),
|
||||||
|
schema: z.object({ name: z.string() }),
|
||||||
|
messages: [{ role: 'user', content: 'Generate a user' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
await client.streamObject({
|
||||||
|
model: registry.languageModel('anthropic:claude-3-opus-20240229'),
|
||||||
|
schema: z.object({ items: z.array(z.string()) }),
|
||||||
|
messages: [{ role: 'user', content: 'Generate a list' }]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 与插件系统配合使用
|
||||||
|
|
||||||
|
更强大的是,你还可以将自定义注册表与 Cherry Studio 的插件系统结合使用:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { PluginEnabledAiClient } from '@cherrystudio/ai-core'
|
||||||
|
import { createProviderRegistry } from 'ai'
|
||||||
|
import { createOpenAI } from '@ai-sdk/openai'
|
||||||
|
import { anthropic } from '@ai-sdk/anthropic'
|
||||||
|
|
||||||
|
// 1. 创建带插件的客户端
|
||||||
|
const client = PluginEnabledAiClient.create(
|
||||||
|
'openai',
|
||||||
|
{
|
||||||
|
apiKey: process.env.OPENAI_API_KEY
|
||||||
|
},
|
||||||
|
[LoggingPlugin, RetryPlugin]
|
||||||
|
)
|
||||||
|
|
||||||
|
// 2. 创建自定义注册表
|
||||||
|
const registry = createProviderRegistry({
|
||||||
|
openai: createOpenAI({ apiKey: process.env.OPENAI_API_KEY }),
|
||||||
|
anthropic: anthropic({ apiKey: process.env.ANTHROPIC_API_KEY })
|
||||||
|
})
|
||||||
|
|
||||||
|
// 3. 方式1:使用内建逻辑 + 完整插件系统
|
||||||
|
await client.streamText('gpt-4', {
|
||||||
|
messages: [{ role: 'user', content: 'Hello with plugins!' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 4. 方式2:使用自定义注册表 + 有限插件支持
|
||||||
|
await client.streamText({
|
||||||
|
model: registry.languageModel('anthropic:claude-3-opus-20240229'),
|
||||||
|
messages: [{ role: 'user', content: 'Hello from Claude!' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 5. 支持的方法
|
||||||
|
await client.generateObject({
|
||||||
|
model: registry.languageModel('openai:gpt-4'),
|
||||||
|
schema: z.object({ name: z.string() }),
|
||||||
|
messages: [{ role: 'user', content: 'Generate a user' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
await client.streamObject({
|
||||||
|
model: registry.languageModel('openai:gpt-4'),
|
||||||
|
schema: z.object({ items: z.array(z.string()) }),
|
||||||
|
messages: [{ role: 'user', content: 'Generate a list' }]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 混合使用的优势
|
||||||
|
|
||||||
|
- **灵活性**:可以根据需要选择使用内建逻辑或自定义注册表
|
||||||
|
- **兼容性**:完全兼容 AI SDK 的 `createProviderRegistry` API
|
||||||
|
- **渐进式**:可以逐步迁移现有代码,无需一次性重构
|
||||||
|
- **插件支持**:自定义注册表仍可享受插件系统的部分功能
|
||||||
|
- **最佳实践**:结合两种方式的优点,既有动态加载的性能优势,又有统一注册表的便利性
|
||||||
|
|
||||||
|
## 📚 相关资源
|
||||||
|
|
||||||
|
- [Vercel AI SDK 文档](https://ai-sdk.dev/)
|
||||||
|
- [Cherry Studio 项目](https://github.com/CherryHQ/cherry-studio)
|
||||||
|
- [AI SDK Providers](https://ai-sdk.dev/providers/ai-sdk-providers)
|
||||||
|
|
||||||
|
## 未来版本
|
||||||
|
|
||||||
|
- 🔮 多 Agent 编排
|
||||||
|
- 🔮 可视化插件配置
|
||||||
|
- 🔮 实时监控和分析
|
||||||
|
- 🔮 云端插件同步
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
|
MIT License - 详见 [LICENSE](https://github.com/CherryHQ/cherry-studio/blob/main/LICENSE) 文件
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Cherry Studio AI Core** - 让 AI 开发更简单、更强大、更灵活 🚀
|
||||||
84
packages/aiCore/package.json
Normal file
84
packages/aiCore/package.json
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
"name": "@cherrystudio/ai-core",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"description": "Cherry Studio AI Core - Unified AI Provider Interface Based on Vercel AI SDK",
|
||||||
|
"main": "dist/index.js",
|
||||||
|
"module": "dist/index.mjs",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"react-native": "dist/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsdown",
|
||||||
|
"dev": "tsc -w",
|
||||||
|
"clean": "rm -rf dist",
|
||||||
|
"test": "vitest run",
|
||||||
|
"test:watch": "vitest"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"ai",
|
||||||
|
"sdk",
|
||||||
|
"openai",
|
||||||
|
"anthropic",
|
||||||
|
"google",
|
||||||
|
"cherry-studio",
|
||||||
|
"vercel-ai-sdk"
|
||||||
|
],
|
||||||
|
"author": "Cherry Studio",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/CherryHQ/cherry-studio.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/CherryHQ/cherry-studio/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/CherryHQ/cherry-studio#readme",
|
||||||
|
"peerDependencies": {
|
||||||
|
"ai": "^5.0.26"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@ai-sdk/anthropic": "^2.0.27",
|
||||||
|
"@ai-sdk/azure": "^2.0.49",
|
||||||
|
"@ai-sdk/deepseek": "^1.0.23",
|
||||||
|
"@ai-sdk/openai": "^2.0.48",
|
||||||
|
"@ai-sdk/openai-compatible": "^1.0.22",
|
||||||
|
"@ai-sdk/provider": "^2.0.0",
|
||||||
|
"@ai-sdk/provider-utils": "^3.0.12",
|
||||||
|
"@ai-sdk/xai": "^2.0.26",
|
||||||
|
"zod": "^4.1.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"tsdown": "^0.12.9",
|
||||||
|
"typescript": "^5.0.0",
|
||||||
|
"vitest": "^3.2.4"
|
||||||
|
},
|
||||||
|
"sideEffects": false,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18.0.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
|
"react-native": "./dist/index.js",
|
||||||
|
"import": "./dist/index.mjs",
|
||||||
|
"require": "./dist/index.js",
|
||||||
|
"default": "./dist/index.js"
|
||||||
|
},
|
||||||
|
"./built-in/plugins": {
|
||||||
|
"types": "./dist/built-in/plugins/index.d.ts",
|
||||||
|
"react-native": "./dist/built-in/plugins/index.js",
|
||||||
|
"import": "./dist/built-in/plugins/index.mjs",
|
||||||
|
"require": "./dist/built-in/plugins/index.js",
|
||||||
|
"default": "./dist/built-in/plugins/index.js"
|
||||||
|
},
|
||||||
|
"./provider": {
|
||||||
|
"types": "./dist/provider/index.d.ts",
|
||||||
|
"react-native": "./dist/provider/index.js",
|
||||||
|
"import": "./dist/provider/index.mjs",
|
||||||
|
"require": "./dist/provider/index.js",
|
||||||
|
"default": "./dist/provider/index.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
packages/aiCore/setupVitest.ts
Normal file
2
packages/aiCore/setupVitest.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// 模拟 Vite SSR helper,避免 Node 环境找不到时报错
|
||||||
|
;(globalThis as any).__vite_ssr_exportName__ = (name: string, value: any) => value
|
||||||
3
packages/aiCore/src/core/README.MD
Normal file
3
packages/aiCore/src/core/README.MD
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# @cherryStudio-aiCore
|
||||||
|
|
||||||
|
Core
|
||||||
17
packages/aiCore/src/core/index.ts
Normal file
17
packages/aiCore/src/core/index.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Core 模块导出
|
||||||
|
* 内部核心功能,供其他模块使用,不直接面向最终调用者
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 中间件系统
|
||||||
|
export type { NamedMiddleware } from './middleware'
|
||||||
|
export { createMiddlewares, wrapModelWithMiddlewares } from './middleware'
|
||||||
|
|
||||||
|
// 创建管理
|
||||||
|
export { globalModelResolver, ModelResolver } from './models'
|
||||||
|
export type { ModelConfig as ModelConfigType } from './models/types'
|
||||||
|
|
||||||
|
// 执行管理
|
||||||
|
export type { ToolUseRequestContext } from './plugins/built-in/toolUsePlugin/type'
|
||||||
|
export { createExecutor, createOpenAICompatibleExecutor } from './runtime'
|
||||||
|
export type { RuntimeConfig } from './runtime/types'
|
||||||
8
packages/aiCore/src/core/middleware/index.ts
Normal file
8
packages/aiCore/src/core/middleware/index.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* Middleware 模块导出
|
||||||
|
* 提供通用的中间件管理能力
|
||||||
|
*/
|
||||||
|
|
||||||
|
export { createMiddlewares } from './manager'
|
||||||
|
export type { NamedMiddleware } from './types'
|
||||||
|
export { wrapModelWithMiddlewares } from './wrapper'
|
||||||
16
packages/aiCore/src/core/middleware/manager.ts
Normal file
16
packages/aiCore/src/core/middleware/manager.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* 中间件管理器
|
||||||
|
* 专注于 AI SDK 中间件的管理,与插件系统分离
|
||||||
|
*/
|
||||||
|
import { LanguageModelV2Middleware } from '@ai-sdk/provider'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建中间件列表
|
||||||
|
* 合并用户提供的中间件
|
||||||
|
*/
|
||||||
|
export function createMiddlewares(userMiddlewares: LanguageModelV2Middleware[] = []): LanguageModelV2Middleware[] {
|
||||||
|
// 未来可以在这里添加默认的中间件
|
||||||
|
const defaultMiddlewares: LanguageModelV2Middleware[] = []
|
||||||
|
|
||||||
|
return [...defaultMiddlewares, ...userMiddlewares]
|
||||||
|
}
|
||||||
12
packages/aiCore/src/core/middleware/types.ts
Normal file
12
packages/aiCore/src/core/middleware/types.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* 中间件系统类型定义
|
||||||
|
*/
|
||||||
|
import { LanguageModelV2Middleware } from '@ai-sdk/provider'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 具名中间件接口
|
||||||
|
*/
|
||||||
|
export interface NamedMiddleware {
|
||||||
|
name: string
|
||||||
|
middleware: LanguageModelV2Middleware
|
||||||
|
}
|
||||||
23
packages/aiCore/src/core/middleware/wrapper.ts
Normal file
23
packages/aiCore/src/core/middleware/wrapper.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* 模型包装工具函数
|
||||||
|
* 用于将中间件应用到LanguageModel上
|
||||||
|
*/
|
||||||
|
import { LanguageModelV2, LanguageModelV2Middleware } from '@ai-sdk/provider'
|
||||||
|
import { wrapLanguageModel } from 'ai'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用中间件包装模型
|
||||||
|
*/
|
||||||
|
export function wrapModelWithMiddlewares(
|
||||||
|
model: LanguageModelV2,
|
||||||
|
middlewares: LanguageModelV2Middleware[]
|
||||||
|
): LanguageModelV2 {
|
||||||
|
if (middlewares.length === 0) {
|
||||||
|
return model
|
||||||
|
}
|
||||||
|
|
||||||
|
return wrapLanguageModel({
|
||||||
|
model,
|
||||||
|
middleware: middlewares
|
||||||
|
})
|
||||||
|
}
|
||||||
124
packages/aiCore/src/core/models/ModelResolver.ts
Normal file
124
packages/aiCore/src/core/models/ModelResolver.ts
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
/**
|
||||||
|
* 模型解析器 - models模块的核心
|
||||||
|
* 负责将modelId解析为AI SDK的LanguageModel实例
|
||||||
|
* 支持传统格式和命名空间格式
|
||||||
|
* 集成了来自 ModelCreator 的特殊处理逻辑
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { EmbeddingModelV2, ImageModelV2, LanguageModelV2, LanguageModelV2Middleware } from '@ai-sdk/provider'
|
||||||
|
|
||||||
|
import { wrapModelWithMiddlewares } from '../middleware/wrapper'
|
||||||
|
import { DEFAULT_SEPARATOR, globalRegistryManagement } from '../providers/RegistryManagement'
|
||||||
|
|
||||||
|
export class ModelResolver {
|
||||||
|
/**
|
||||||
|
* 核心方法:解析任意格式的modelId为语言模型
|
||||||
|
*
|
||||||
|
* @param modelId 模型ID,支持 'gpt-4' 和 'anthropic>claude-3' 两种格式
|
||||||
|
* @param fallbackProviderId 当modelId为传统格式时使用的providerId
|
||||||
|
* @param providerOptions provider配置选项(用于OpenAI模式选择等)
|
||||||
|
* @param middlewares 中间件数组,会应用到最终模型上
|
||||||
|
*/
|
||||||
|
async resolveLanguageModel(
|
||||||
|
modelId: string,
|
||||||
|
fallbackProviderId: string,
|
||||||
|
providerOptions?: any,
|
||||||
|
middlewares?: LanguageModelV2Middleware[]
|
||||||
|
): Promise<LanguageModelV2> {
|
||||||
|
let finalProviderId = fallbackProviderId
|
||||||
|
let model: LanguageModelV2
|
||||||
|
// 🎯 处理 OpenAI 模式选择逻辑 (从 ModelCreator 迁移)
|
||||||
|
if ((fallbackProviderId === 'openai' || fallbackProviderId === 'azure') && providerOptions?.mode === 'chat') {
|
||||||
|
finalProviderId = `${fallbackProviderId}-chat`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否是命名空间格式
|
||||||
|
if (modelId.includes(DEFAULT_SEPARATOR)) {
|
||||||
|
model = this.resolveNamespacedModel(modelId)
|
||||||
|
} else {
|
||||||
|
// 传统格式:使用处理后的 providerId + modelId
|
||||||
|
model = this.resolveTraditionalModel(finalProviderId, modelId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🎯 应用中间件(如果有)
|
||||||
|
if (middlewares && middlewares.length > 0) {
|
||||||
|
model = wrapModelWithMiddlewares(model, middlewares)
|
||||||
|
}
|
||||||
|
|
||||||
|
return model
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析文本嵌入模型
|
||||||
|
*/
|
||||||
|
async resolveTextEmbeddingModel(modelId: string, fallbackProviderId: string): Promise<EmbeddingModelV2<string>> {
|
||||||
|
if (modelId.includes(DEFAULT_SEPARATOR)) {
|
||||||
|
return this.resolveNamespacedEmbeddingModel(modelId)
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.resolveTraditionalEmbeddingModel(fallbackProviderId, modelId)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析图像模型
|
||||||
|
*/
|
||||||
|
async resolveImageModel(modelId: string, fallbackProviderId: string): Promise<ImageModelV2> {
|
||||||
|
if (modelId.includes(DEFAULT_SEPARATOR)) {
|
||||||
|
return this.resolveNamespacedImageModel(modelId)
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.resolveTraditionalImageModel(fallbackProviderId, modelId)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析命名空间格式的语言模型
|
||||||
|
* aihubmix:anthropic:claude-3 -> globalRegistryManagement.languageModel('aihubmix:anthropic:claude-3')
|
||||||
|
*/
|
||||||
|
private resolveNamespacedModel(modelId: string): LanguageModelV2 {
|
||||||
|
return globalRegistryManagement.languageModel(modelId as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析传统格式的语言模型
|
||||||
|
* providerId: 'openai', modelId: 'gpt-4' -> globalRegistryManagement.languageModel('openai:gpt-4')
|
||||||
|
*/
|
||||||
|
private resolveTraditionalModel(providerId: string, modelId: string): LanguageModelV2 {
|
||||||
|
const fullModelId = `${providerId}${DEFAULT_SEPARATOR}${modelId}`
|
||||||
|
return globalRegistryManagement.languageModel(fullModelId as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析命名空间格式的嵌入模型
|
||||||
|
*/
|
||||||
|
private resolveNamespacedEmbeddingModel(modelId: string): EmbeddingModelV2<string> {
|
||||||
|
return globalRegistryManagement.textEmbeddingModel(modelId as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析传统格式的嵌入模型
|
||||||
|
*/
|
||||||
|
private resolveTraditionalEmbeddingModel(providerId: string, modelId: string): EmbeddingModelV2<string> {
|
||||||
|
const fullModelId = `${providerId}${DEFAULT_SEPARATOR}${modelId}`
|
||||||
|
return globalRegistryManagement.textEmbeddingModel(fullModelId as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析命名空间格式的图像模型
|
||||||
|
*/
|
||||||
|
private resolveNamespacedImageModel(modelId: string): ImageModelV2 {
|
||||||
|
return globalRegistryManagement.imageModel(modelId as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析传统格式的图像模型
|
||||||
|
*/
|
||||||
|
private resolveTraditionalImageModel(providerId: string, modelId: string): ImageModelV2 {
|
||||||
|
const fullModelId = `${providerId}${DEFAULT_SEPARATOR}${modelId}`
|
||||||
|
return globalRegistryManagement.imageModel(fullModelId as any)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局模型解析器实例
|
||||||
|
*/
|
||||||
|
export const globalModelResolver = new ModelResolver()
|
||||||
9
packages/aiCore/src/core/models/index.ts
Normal file
9
packages/aiCore/src/core/models/index.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Models 模块统一导出 - 简化版
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 核心模型解析器
|
||||||
|
export { globalModelResolver, ModelResolver } from './ModelResolver'
|
||||||
|
|
||||||
|
// 保留的类型定义(可能被其他地方使用)
|
||||||
|
export type { ModelConfig as ModelConfigType } from './types'
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user