@teammy/server 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1206 -765
- package/dist/web/assets/Assistant-CkKCs2G4.js +1 -0
- package/dist/web/assets/Computers-B9wEqpMc.js +4 -0
- package/dist/web/assets/Computers-DBnXVk7q.css +1 -0
- package/dist/web/assets/Conversation-DK5-Q1RB.js +1 -0
- package/dist/web/assets/{Conversation-CNmGkVy7.css → Conversation-Dc460fhC.css} +1 -1
- package/dist/web/assets/Dashboard-B2HGjI4a.js +1 -0
- package/dist/web/assets/Dashboard-wDiUg0LB.css +1 -0
- package/dist/web/assets/Files-Du-7z96D.js +1 -0
- package/dist/web/assets/{Help-DwUoT8ZM.js → Help-G99-LK4-.js} +33 -10
- package/dist/web/assets/HtmlPreview-Bi3u6-l3.js +1 -0
- package/dist/web/assets/{Markdown-DorC2YjE.js → Markdown-BgEXVy4-.js} +4 -4
- package/dist/web/assets/MessageComposer-6eJAo_e7.js +1 -0
- package/dist/web/assets/MessageComposer-CJGxkvML.css +1 -0
- package/dist/web/assets/PillControl-BRPhbHQm.js +1 -0
- package/dist/web/assets/PillControl-CqVA7kIQ.css +1 -0
- package/dist/web/assets/ResourceLibrary-DJ9cxDoc.js +6 -0
- package/dist/web/assets/WorkspaceTree-DUFGMLRi.js +1 -0
- package/dist/web/assets/{file-links-DnngiTbC.js → file-links-Dl1S0Tt0.js} +1 -1
- package/dist/web/assets/index-C4EXuXVY.css +1 -0
- package/dist/web/assets/index-xjf37um4.js +66 -0
- package/dist/web/assets/teammy-logo-dark-GROHRRMa.svg +6 -0
- package/dist/web/assets/teammy-logo-light-B6BoNVcp.svg +6 -0
- package/dist/web/assets/teammy-y-standard-dark-C4LRaRpE.svg +6 -0
- package/dist/web/assets/teammy-y-standard-light-Bl5D78Uj.svg +6 -0
- package/dist/web/downloads/teammy-skill.zip +0 -0
- package/dist/web/index.html +9 -3
- package/package.json +1 -1
- package/dist/web/assets/Assistant-CYSa4zNi.js +0 -1
- package/dist/web/assets/Computers-4L48XuFg.js +0 -4
- package/dist/web/assets/Computers-_ugR447I.css +0 -1
- package/dist/web/assets/Conversation-BBWm5w-C.js +0 -1
- package/dist/web/assets/Dashboard-Bdh00JcC.css +0 -1
- package/dist/web/assets/Dashboard-Ck2NsAbX.js +0 -1
- package/dist/web/assets/Files-CjNjoKS3.js +0 -1
- package/dist/web/assets/HtmlPreview-B6aQIaMB.js +0 -1
- package/dist/web/assets/MessageComposer-DQBDG5yF.js +0 -1
- package/dist/web/assets/MessageComposer-DavJdQPa.css +0 -1
- package/dist/web/assets/ResourceLibrary-104NuVRn.js +0 -6
- package/dist/web/assets/WorkspaceTree-B4FMRlCw.js +0 -1
- package/dist/web/assets/index-6PvvMCD7.css +0 -1
- package/dist/web/assets/index-DiR0ePCJ.js +0 -66
- package/dist/web/assets/teammy-calm-DVuoOK0F.png +0 -0
- package/dist/web/assets/teammy-favicon-BiDvlPj2.png +0 -0
- package/dist/web/assets/teammy-mark-CxBtF1-X.png +0 -0
- package/dist/web/assets/teammy-wave-CVTgecuC.png +0 -0
- package/dist/web/assets/teammy-wordmark-ZFwxG0yl.png +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="384" viewBox="0 0 1280 384" role="img" aria-labelledby="title desc">
|
|
3
|
+
<title id="title">teammy-logo-dark</title>
|
|
4
|
+
<desc id="desc">teammy v02 complete logo. Five outlined letters t-e-a-m-m and the same standard y mascot. Transparent background. For dark backgrounds: white letters and eyes.</desc>
|
|
5
|
+
<g transform="translate(32 12)"><path id="logo-t" fill="#FFFFFF" fill-rule="evenodd" d="M 104.498 282.138 C 95.453 279.547 89.527 276.334 83.295 270.643 C 73.46 261.663 67.964 250.552 64.334 232.312 C 62.909 225.149 62.573 217.979 62.54 194 C 62.518 177.775 62.864 157.476 63.308 148.892 L 64.117 133.284 L 55.263 132.779 C 37.258 131.753 27.044 123.146 27.044 109 C 27.044 102.091 29.522 96.505 34.542 92.097 C 40.337 87.009 46.202 84.865 57.604 83.667 L 67.838 82.591 L 68.478 75.545 C 71.035 47.396 76.975 34.684 90.509 28.4 C 104.175 22.054 121.592 25.703 128.009 36.255 C 132.332 43.363 132.632 52.17 129.356 75.792 L 128.76 80.084 L 148.63 79.792 L 168.5 79.5 L 174 82.6 C 181.381 86.759 184.507 92.145 184.392 100.5 C 184.288 107.988 181.311 114.583 175.776 119.583 C 168.217 126.413 161.061 128.293 137.864 129.545 L 125.227 130.227 L 124.657 134.864 C 123.123 147.325 121.804 180.94 122.264 195.815 C 122.872 215.466 124.269 221.273 129.489 225.857 C 135.802 231.399 141.242 231.05 154 224.286 C 159.331 221.459 161.278 220.923 164.826 221.306 C 173.848 222.277 179.313 232.564 177.252 244.693 C 174.163 262.861 159.783 277.178 139.356 282.423 C 130.963 284.577 112.486 284.426 104.498 282.138 Z"/><path id="logo-e" fill="#FFFFFF" fill-rule="evenodd" d="M 244.694 279.476 C 226.484 276.03 210.829 266.382 199.685 251.738 C 185.139 232.622 178 210.644 178 184.979 C 178 136.615 208.39 93.479 251.712 80.35 C 259.255 78.064 262.412 77.674 274 77.595 C 285.536 77.517 288.587 77.845 294.975 79.849 C 305.62 83.189 310.976 86.158 317.869 92.539 C 334.119 107.584 336.434 131.305 323.762 152.931 C 318.874 161.272 303.052 176.521 292.642 182.924 C 278.018 191.919 260.705 198.085 241.702 201.066 L 233.905 202.29 L 234.561 205.395 C 237.617 219.851 247.825 228.353 261.956 228.21 C 271.468 228.114 279.874 225.054 294.501 216.364 C 309.544 207.425 314.846 205.464 319.666 207.055 C 324.202 208.552 327.639 213.027 329.026 219.238 C 333.107 237.526 316.773 260.924 291.5 272.99 C 276.82 280 259.87 282.348 244.694 279.476 Z M 246.183 159.529 C 261.003 154.469 274.691 144.275 279.428 134.77 C 282.72 128.163 282.717 124.626 279.414 121.323 C 277.101 119.01 276.273 118.795 271.552 119.283 C 255.421 120.947 237.033 140.344 233.574 159.343 L 232.874 163.186 L 236.187 162.499 C 238.009 162.12 242.507 160.784 246.183 159.529 Z"/><path id="logo-a" fill="#FFFFFF" fill-rule="evenodd" d="M 376 275.679 C 358.088 271.652 345.283 257.137 338.791 233.5 C 336.853 226.446 336.588 222.959 336.547 204 C 336.506 185.057 336.775 181.27 338.816 172.156 C 347.997 131.158 370.888 96.686 398.029 82.986 C 409.05 77.422 417.32 75.558 430.5 75.665 C 458.184 75.89 478.654 87.015 484.901 105.228 C 487.709 113.418 488.024 117.313 488.979 155.626 C 490.078 199.702 491.437 209.478 499.248 229.5 C 501.801 236.046 502.373 238.954 502.392 245.5 C 502.42 255.022 500.317 260.531 494.066 267.312 C 488.238 273.636 481.434 276.372 473.038 275.769 C 465.03 275.194 459.773 272.647 454.268 266.674 C 448.77 260.71 445.278 253.578 442.526 242.69 L 440.259 233.722 L 436.515 240.111 C 428.822 253.242 418.346 264.24 407.608 270.463 C 399.008 275.446 385.14 277.734 376 275.679 Z M 404.278 209.039 C 415.322 202.035 428.486 177.884 434.406 153.765 C 440.776 127.815 437.902 117.41 425.839 122.748 C 411.352 129.159 393.672 152.288 387.045 173.5 C 383.952 183.4 383.189 197.587 385.433 203.464 C 388.832 212.363 395.79 214.422 404.278 209.039 Z"/><path id="logo-m-1" fill="#FFFFFF" fill-rule="evenodd" d="M 702.897 277.095 C 694.185 275.324 687.007 268.661 683.404 259 C 681.349 253.491 681.096 237.506 682.4 195.5 C 683.214 169.264 683.134 165.928 681.564 160.5 C 679.23 152.432 676.853 150 671.303 150 C 667.616 150 666.292 150.612 662.591 154.023 C 653.531 162.374 651.271 172.294 649.952 209.5 C 649.405 224.9 648.527 240.722 647.999 244.661 C 645.431 263.815 636.544 274.03 622.5 273.972 C 613.176 273.934 604.616 266.49 600.732 255.042 C 598.57 248.669 598.52 247.514 598.8 210.405 C 599.094 171.48 598.474 161.753 595.307 155.624 C 591.794 148.825 586.182 148.034 580.145 153.488 C 570.839 161.895 568.359 174.236 567.077 218.5 C 566.139 250.884 565.491 256.288 561.654 263.703 C 553.585 279.3 531.98 281.173 521.322 267.2 C 514.944 258.838 514.839 257.903 513.823 200 C 513.316 171.125 513.071 137.375 513.279 125 C 513.698 99.982 514.43 96.215 520.492 87.861 C 528.972 76.175 546.589 74.558 556.594 84.547 C 561.273 89.22 563.802 95.53 564.688 104.75 C 565.019 108.188 565.562 110.999 565.895 110.998 C 566.228 110.996 567.734 108.634 569.243 105.748 C 575.129 94.486 585.59 84.637 596 80.558 C 602.02 78.198 613.021 78.115 619.72 80.378 C 625.751 82.415 633.998 89.359 638.144 95.891 C 639.677 98.307 641.893 103.173 643.068 106.705 C 644.244 110.238 645.34 112.987 645.503 112.814 C 645.667 112.641 648.096 109.061 650.901 104.857 C 657.398 95.122 666.112 87.055 674.704 82.824 C 681.053 79.697 682.076 79.5 691.976 79.5 C 701.494 79.5 703.048 79.769 708.239 82.318 C 719.857 88.023 728.189 100.045 731.484 115.856 C 733.559 125.811 734.819 149.48 735.916 199.126 C 736.505 225.74 736.487 243.592 735.868 248.626 C 734.266 261.632 728.869 270.969 720.756 274.766 C 715.749 277.11 707.963 278.125 702.897 277.095 Z"/><path id="logo-m-2" fill="#FFFFFF" fill-rule="evenodd" d="M 940.897 277.095 C 932.185 275.324 925.007 268.661 921.404 259 C 919.349 253.491 919.096 237.506 920.4 195.5 C 921.214 169.264 921.134 165.928 919.564 160.5 C 917.23 152.432 914.853 150 909.303 150 C 905.616 150 904.292 150.612 900.591 154.023 C 891.531 162.374 889.271 172.294 887.952 209.5 C 887.405 224.9 886.527 240.722 885.999 244.661 C 883.431 263.815 874.544 274.03 860.5 273.972 C 851.176 273.934 842.616 266.49 838.732 255.042 C 836.57 248.669 836.52 247.514 836.8 210.405 C 837.094 171.48 836.474 161.753 833.307 155.624 C 829.794 148.825 824.182 148.034 818.145 153.488 C 808.839 161.895 806.359 174.236 805.077 218.5 C 804.139 250.884 803.491 256.288 799.654 263.703 C 791.585 279.3 769.98 281.173 759.322 267.2 C 752.944 258.838 752.839 257.903 751.823 200 C 751.316 171.125 751.071 137.375 751.279 125 C 751.698 99.982 752.43 96.215 758.492 87.861 C 766.972 76.175 784.589 74.558 794.594 84.547 C 799.273 89.22 801.802 95.53 802.688 104.75 C 803.019 108.188 803.562 110.999 803.895 110.998 C 804.228 110.996 805.734 108.634 807.243 105.748 C 813.129 94.486 823.59 84.637 834 80.558 C 840.02 78.198 851.021 78.115 857.72 80.378 C 863.751 82.415 871.998 89.359 876.144 95.891 C 877.677 98.307 879.893 103.173 881.068 106.705 C 882.244 110.238 883.34 112.987 883.503 112.814 C 883.667 112.641 886.096 109.061 888.901 104.857 C 895.398 95.122 904.112 87.055 912.704 82.824 C 919.053 79.697 920.076 79.5 929.976 79.5 C 939.494 79.5 941.048 79.769 946.239 82.318 C 957.857 88.023 966.189 100.045 969.484 115.856 C 971.559 125.811 972.819 149.48 973.916 199.126 C 974.505 225.74 974.487 243.592 973.868 248.626 C 972.266 261.632 966.869 270.969 958.756 274.766 C 953.749 277.11 945.963 278.125 940.897 277.095 Z"/><g transform="translate(967 33)"><g id="logo-y-pose"><path id="logo-y-body" fill="#FD523A" fill-rule="evenodd" d="M 49.317 300.497 C 28.532 295.979 18.688 282.992 23.472 266.402 C 26.05 257.459 33.188 245.557 64.462 198.05 C 73.677 184.052 81.395 172.127 81.613 171.55 C 81.831 170.972 78.97 168.935 75.255 167.022 C 65.861 162.185 50.569 146.814 41.34 132.932 C 29.015 114.392 10.878 75.899 3.443 52.5 C 1.197 45.434 0.575 41.566 0.546 34.5 C 0.514 26.44 0.839 24.805 3.66 18.841 C 7.579 10.555 13.474 4.715 20.613 2.044 C 29.833 -1.406 39.061 -0.444 46.837 4.779 C 54.765 10.103 57.482 15.595 66.49 44.5 C 83.08 97.73 96.468 117.452 112.993 113.002 C 118.444 111.534 127.482 103.119 133.012 94.364 C 142.105 79.966 149.119 64.195 159.042 35.835 C 167.649 11.235 170.163 7.091 179.22 2.578 C 183.328 0.531 185.863 -0 191.537 0 C 203.952 0 214.157 6.698 219.622 18.435 C 222.964 25.612 222.934 37.364 219.549 47.449 C 216.06 57.842 204.241 83.895 194.889 101.805 C 181.005 128.395 171.321 144.622 133.006 205.5 C 113.066 237.182 105 250.137 105 250.478 C 105 250.627 111.412 250.979 119.25 251.262 C 135.581 251.85 142.206 253.486 147.663 258.277 C 156.782 266.284 156.024 279.688 145.965 288.298 C 138.721 294.498 128.637 297.41 103.721 300.494 C 88.557 302.372 57.948 302.373 49.317 300.497 Z"/><g fill="#FFFFFF" transform="translate(0 0)"><path id="logo-y-eye-1" d="M 107 45.5 C 107 54.613 102.075 62 96 62 C 89.925 62 85 54.613 85 45.5 C 85 36.387 89.925 29 96 29 C 102.075 29 107 36.387 107 45.5 Z"/><path id="logo-y-eye-2" d="M 139 45.5 C 139 54.613 134.075 62 128 62 C 121.925 62 117 54.613 117 45.5 C 117 36.387 121.925 29 128 29 C 134.075 29 139 36.387 139 45.5 Z"/></g></g></g></g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="384" viewBox="0 0 1280 384" role="img" aria-labelledby="title desc">
|
|
3
|
+
<title id="title">teammy-logo-light</title>
|
|
4
|
+
<desc id="desc">teammy v02 complete logo. Five outlined letters t-e-a-m-m and the same standard y mascot. Transparent background. For light backgrounds: black letters and eyes.</desc>
|
|
5
|
+
<g transform="translate(32 12)"><path id="logo-t" fill="#161615" fill-rule="evenodd" d="M 104.498 282.138 C 95.453 279.547 89.527 276.334 83.295 270.643 C 73.46 261.663 67.964 250.552 64.334 232.312 C 62.909 225.149 62.573 217.979 62.54 194 C 62.518 177.775 62.864 157.476 63.308 148.892 L 64.117 133.284 L 55.263 132.779 C 37.258 131.753 27.044 123.146 27.044 109 C 27.044 102.091 29.522 96.505 34.542 92.097 C 40.337 87.009 46.202 84.865 57.604 83.667 L 67.838 82.591 L 68.478 75.545 C 71.035 47.396 76.975 34.684 90.509 28.4 C 104.175 22.054 121.592 25.703 128.009 36.255 C 132.332 43.363 132.632 52.17 129.356 75.792 L 128.76 80.084 L 148.63 79.792 L 168.5 79.5 L 174 82.6 C 181.381 86.759 184.507 92.145 184.392 100.5 C 184.288 107.988 181.311 114.583 175.776 119.583 C 168.217 126.413 161.061 128.293 137.864 129.545 L 125.227 130.227 L 124.657 134.864 C 123.123 147.325 121.804 180.94 122.264 195.815 C 122.872 215.466 124.269 221.273 129.489 225.857 C 135.802 231.399 141.242 231.05 154 224.286 C 159.331 221.459 161.278 220.923 164.826 221.306 C 173.848 222.277 179.313 232.564 177.252 244.693 C 174.163 262.861 159.783 277.178 139.356 282.423 C 130.963 284.577 112.486 284.426 104.498 282.138 Z"/><path id="logo-e" fill="#161615" fill-rule="evenodd" d="M 244.694 279.476 C 226.484 276.03 210.829 266.382 199.685 251.738 C 185.139 232.622 178 210.644 178 184.979 C 178 136.615 208.39 93.479 251.712 80.35 C 259.255 78.064 262.412 77.674 274 77.595 C 285.536 77.517 288.587 77.845 294.975 79.849 C 305.62 83.189 310.976 86.158 317.869 92.539 C 334.119 107.584 336.434 131.305 323.762 152.931 C 318.874 161.272 303.052 176.521 292.642 182.924 C 278.018 191.919 260.705 198.085 241.702 201.066 L 233.905 202.29 L 234.561 205.395 C 237.617 219.851 247.825 228.353 261.956 228.21 C 271.468 228.114 279.874 225.054 294.501 216.364 C 309.544 207.425 314.846 205.464 319.666 207.055 C 324.202 208.552 327.639 213.027 329.026 219.238 C 333.107 237.526 316.773 260.924 291.5 272.99 C 276.82 280 259.87 282.348 244.694 279.476 Z M 246.183 159.529 C 261.003 154.469 274.691 144.275 279.428 134.77 C 282.72 128.163 282.717 124.626 279.414 121.323 C 277.101 119.01 276.273 118.795 271.552 119.283 C 255.421 120.947 237.033 140.344 233.574 159.343 L 232.874 163.186 L 236.187 162.499 C 238.009 162.12 242.507 160.784 246.183 159.529 Z"/><path id="logo-a" fill="#161615" fill-rule="evenodd" d="M 376 275.679 C 358.088 271.652 345.283 257.137 338.791 233.5 C 336.853 226.446 336.588 222.959 336.547 204 C 336.506 185.057 336.775 181.27 338.816 172.156 C 347.997 131.158 370.888 96.686 398.029 82.986 C 409.05 77.422 417.32 75.558 430.5 75.665 C 458.184 75.89 478.654 87.015 484.901 105.228 C 487.709 113.418 488.024 117.313 488.979 155.626 C 490.078 199.702 491.437 209.478 499.248 229.5 C 501.801 236.046 502.373 238.954 502.392 245.5 C 502.42 255.022 500.317 260.531 494.066 267.312 C 488.238 273.636 481.434 276.372 473.038 275.769 C 465.03 275.194 459.773 272.647 454.268 266.674 C 448.77 260.71 445.278 253.578 442.526 242.69 L 440.259 233.722 L 436.515 240.111 C 428.822 253.242 418.346 264.24 407.608 270.463 C 399.008 275.446 385.14 277.734 376 275.679 Z M 404.278 209.039 C 415.322 202.035 428.486 177.884 434.406 153.765 C 440.776 127.815 437.902 117.41 425.839 122.748 C 411.352 129.159 393.672 152.288 387.045 173.5 C 383.952 183.4 383.189 197.587 385.433 203.464 C 388.832 212.363 395.79 214.422 404.278 209.039 Z"/><path id="logo-m-1" fill="#161615" fill-rule="evenodd" d="M 702.897 277.095 C 694.185 275.324 687.007 268.661 683.404 259 C 681.349 253.491 681.096 237.506 682.4 195.5 C 683.214 169.264 683.134 165.928 681.564 160.5 C 679.23 152.432 676.853 150 671.303 150 C 667.616 150 666.292 150.612 662.591 154.023 C 653.531 162.374 651.271 172.294 649.952 209.5 C 649.405 224.9 648.527 240.722 647.999 244.661 C 645.431 263.815 636.544 274.03 622.5 273.972 C 613.176 273.934 604.616 266.49 600.732 255.042 C 598.57 248.669 598.52 247.514 598.8 210.405 C 599.094 171.48 598.474 161.753 595.307 155.624 C 591.794 148.825 586.182 148.034 580.145 153.488 C 570.839 161.895 568.359 174.236 567.077 218.5 C 566.139 250.884 565.491 256.288 561.654 263.703 C 553.585 279.3 531.98 281.173 521.322 267.2 C 514.944 258.838 514.839 257.903 513.823 200 C 513.316 171.125 513.071 137.375 513.279 125 C 513.698 99.982 514.43 96.215 520.492 87.861 C 528.972 76.175 546.589 74.558 556.594 84.547 C 561.273 89.22 563.802 95.53 564.688 104.75 C 565.019 108.188 565.562 110.999 565.895 110.998 C 566.228 110.996 567.734 108.634 569.243 105.748 C 575.129 94.486 585.59 84.637 596 80.558 C 602.02 78.198 613.021 78.115 619.72 80.378 C 625.751 82.415 633.998 89.359 638.144 95.891 C 639.677 98.307 641.893 103.173 643.068 106.705 C 644.244 110.238 645.34 112.987 645.503 112.814 C 645.667 112.641 648.096 109.061 650.901 104.857 C 657.398 95.122 666.112 87.055 674.704 82.824 C 681.053 79.697 682.076 79.5 691.976 79.5 C 701.494 79.5 703.048 79.769 708.239 82.318 C 719.857 88.023 728.189 100.045 731.484 115.856 C 733.559 125.811 734.819 149.48 735.916 199.126 C 736.505 225.74 736.487 243.592 735.868 248.626 C 734.266 261.632 728.869 270.969 720.756 274.766 C 715.749 277.11 707.963 278.125 702.897 277.095 Z"/><path id="logo-m-2" fill="#161615" fill-rule="evenodd" d="M 940.897 277.095 C 932.185 275.324 925.007 268.661 921.404 259 C 919.349 253.491 919.096 237.506 920.4 195.5 C 921.214 169.264 921.134 165.928 919.564 160.5 C 917.23 152.432 914.853 150 909.303 150 C 905.616 150 904.292 150.612 900.591 154.023 C 891.531 162.374 889.271 172.294 887.952 209.5 C 887.405 224.9 886.527 240.722 885.999 244.661 C 883.431 263.815 874.544 274.03 860.5 273.972 C 851.176 273.934 842.616 266.49 838.732 255.042 C 836.57 248.669 836.52 247.514 836.8 210.405 C 837.094 171.48 836.474 161.753 833.307 155.624 C 829.794 148.825 824.182 148.034 818.145 153.488 C 808.839 161.895 806.359 174.236 805.077 218.5 C 804.139 250.884 803.491 256.288 799.654 263.703 C 791.585 279.3 769.98 281.173 759.322 267.2 C 752.944 258.838 752.839 257.903 751.823 200 C 751.316 171.125 751.071 137.375 751.279 125 C 751.698 99.982 752.43 96.215 758.492 87.861 C 766.972 76.175 784.589 74.558 794.594 84.547 C 799.273 89.22 801.802 95.53 802.688 104.75 C 803.019 108.188 803.562 110.999 803.895 110.998 C 804.228 110.996 805.734 108.634 807.243 105.748 C 813.129 94.486 823.59 84.637 834 80.558 C 840.02 78.198 851.021 78.115 857.72 80.378 C 863.751 82.415 871.998 89.359 876.144 95.891 C 877.677 98.307 879.893 103.173 881.068 106.705 C 882.244 110.238 883.34 112.987 883.503 112.814 C 883.667 112.641 886.096 109.061 888.901 104.857 C 895.398 95.122 904.112 87.055 912.704 82.824 C 919.053 79.697 920.076 79.5 929.976 79.5 C 939.494 79.5 941.048 79.769 946.239 82.318 C 957.857 88.023 966.189 100.045 969.484 115.856 C 971.559 125.811 972.819 149.48 973.916 199.126 C 974.505 225.74 974.487 243.592 973.868 248.626 C 972.266 261.632 966.869 270.969 958.756 274.766 C 953.749 277.11 945.963 278.125 940.897 277.095 Z"/><g transform="translate(967 33)"><g id="logo-y-pose"><path id="logo-y-body" fill="#FD523A" fill-rule="evenodd" d="M 49.317 300.497 C 28.532 295.979 18.688 282.992 23.472 266.402 C 26.05 257.459 33.188 245.557 64.462 198.05 C 73.677 184.052 81.395 172.127 81.613 171.55 C 81.831 170.972 78.97 168.935 75.255 167.022 C 65.861 162.185 50.569 146.814 41.34 132.932 C 29.015 114.392 10.878 75.899 3.443 52.5 C 1.197 45.434 0.575 41.566 0.546 34.5 C 0.514 26.44 0.839 24.805 3.66 18.841 C 7.579 10.555 13.474 4.715 20.613 2.044 C 29.833 -1.406 39.061 -0.444 46.837 4.779 C 54.765 10.103 57.482 15.595 66.49 44.5 C 83.08 97.73 96.468 117.452 112.993 113.002 C 118.444 111.534 127.482 103.119 133.012 94.364 C 142.105 79.966 149.119 64.195 159.042 35.835 C 167.649 11.235 170.163 7.091 179.22 2.578 C 183.328 0.531 185.863 -0 191.537 0 C 203.952 0 214.157 6.698 219.622 18.435 C 222.964 25.612 222.934 37.364 219.549 47.449 C 216.06 57.842 204.241 83.895 194.889 101.805 C 181.005 128.395 171.321 144.622 133.006 205.5 C 113.066 237.182 105 250.137 105 250.478 C 105 250.627 111.412 250.979 119.25 251.262 C 135.581 251.85 142.206 253.486 147.663 258.277 C 156.782 266.284 156.024 279.688 145.965 288.298 C 138.721 294.498 128.637 297.41 103.721 300.494 C 88.557 302.372 57.948 302.373 49.317 300.497 Z"/><g fill="#161615" transform="translate(0 0)"><path id="logo-y-eye-1" d="M 107 45.5 C 107 54.613 102.075 62 96 62 C 89.925 62 85 54.613 85 45.5 C 85 36.387 89.925 29 96 29 C 102.075 29 107 36.387 107 45.5 Z"/><path id="logo-y-eye-2" d="M 139 45.5 C 139 54.613 134.075 62 128 62 C 121.925 62 117 54.613 117 45.5 C 117 36.387 121.925 29 128 29 C 134.075 29 139 36.387 139 45.5 Z"/></g></g></g></g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" role="img" aria-labelledby="title desc">
|
|
3
|
+
<title id="title">teammy-y-standard-dark</title>
|
|
4
|
+
<desc id="desc">teammy v02 y mascot, standard pose, transparent background; for dark backgrounds.</desc>
|
|
5
|
+
<g transform="translate(112 60) scale(1.3)"><g id="y-pose"><path id="y-body" fill="#FD523A" fill-rule="evenodd" d="M 49.317 300.497 C 28.532 295.979 18.688 282.992 23.472 266.402 C 26.05 257.459 33.188 245.557 64.462 198.05 C 73.677 184.052 81.395 172.127 81.613 171.55 C 81.831 170.972 78.97 168.935 75.255 167.022 C 65.861 162.185 50.569 146.814 41.34 132.932 C 29.015 114.392 10.878 75.899 3.443 52.5 C 1.197 45.434 0.575 41.566 0.546 34.5 C 0.514 26.44 0.839 24.805 3.66 18.841 C 7.579 10.555 13.474 4.715 20.613 2.044 C 29.833 -1.406 39.061 -0.444 46.837 4.779 C 54.765 10.103 57.482 15.595 66.49 44.5 C 83.08 97.73 96.468 117.452 112.993 113.002 C 118.444 111.534 127.482 103.119 133.012 94.364 C 142.105 79.966 149.119 64.195 159.042 35.835 C 167.649 11.235 170.163 7.091 179.22 2.578 C 183.328 0.531 185.863 -0 191.537 0 C 203.952 0 214.157 6.698 219.622 18.435 C 222.964 25.612 222.934 37.364 219.549 47.449 C 216.06 57.842 204.241 83.895 194.889 101.805 C 181.005 128.395 171.321 144.622 133.006 205.5 C 113.066 237.182 105 250.137 105 250.478 C 105 250.627 111.412 250.979 119.25 251.262 C 135.581 251.85 142.206 253.486 147.663 258.277 C 156.782 266.284 156.024 279.688 145.965 288.298 C 138.721 294.498 128.637 297.41 103.721 300.494 C 88.557 302.372 57.948 302.373 49.317 300.497 Z"/><g fill="#FFFFFF" transform="translate(0 0)"><path id="y-eye-1" d="M 107 45.5 C 107 54.613 102.075 62 96 62 C 89.925 62 85 54.613 85 45.5 C 85 36.387 89.925 29 96 29 C 102.075 29 107 36.387 107 45.5 Z"/><path id="y-eye-2" d="M 139 45.5 C 139 54.613 134.075 62 128 62 C 121.925 62 117 54.613 117 45.5 C 117 36.387 121.925 29 128 29 C 134.075 29 139 36.387 139 45.5 Z"/></g></g></g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" role="img" aria-labelledby="title desc">
|
|
3
|
+
<title id="title">teammy-y-standard-light</title>
|
|
4
|
+
<desc id="desc">teammy v02 y mascot, standard pose, transparent background; for light backgrounds.</desc>
|
|
5
|
+
<g transform="translate(112 60) scale(1.3)"><g id="y-pose"><path id="y-body" fill="#FD523A" fill-rule="evenodd" d="M 49.317 300.497 C 28.532 295.979 18.688 282.992 23.472 266.402 C 26.05 257.459 33.188 245.557 64.462 198.05 C 73.677 184.052 81.395 172.127 81.613 171.55 C 81.831 170.972 78.97 168.935 75.255 167.022 C 65.861 162.185 50.569 146.814 41.34 132.932 C 29.015 114.392 10.878 75.899 3.443 52.5 C 1.197 45.434 0.575 41.566 0.546 34.5 C 0.514 26.44 0.839 24.805 3.66 18.841 C 7.579 10.555 13.474 4.715 20.613 2.044 C 29.833 -1.406 39.061 -0.444 46.837 4.779 C 54.765 10.103 57.482 15.595 66.49 44.5 C 83.08 97.73 96.468 117.452 112.993 113.002 C 118.444 111.534 127.482 103.119 133.012 94.364 C 142.105 79.966 149.119 64.195 159.042 35.835 C 167.649 11.235 170.163 7.091 179.22 2.578 C 183.328 0.531 185.863 -0 191.537 0 C 203.952 0 214.157 6.698 219.622 18.435 C 222.964 25.612 222.934 37.364 219.549 47.449 C 216.06 57.842 204.241 83.895 194.889 101.805 C 181.005 128.395 171.321 144.622 133.006 205.5 C 113.066 237.182 105 250.137 105 250.478 C 105 250.627 111.412 250.979 119.25 251.262 C 135.581 251.85 142.206 253.486 147.663 258.277 C 156.782 266.284 156.024 279.688 145.965 288.298 C 138.721 294.498 128.637 297.41 103.721 300.494 C 88.557 302.372 57.948 302.373 49.317 300.497 Z"/><g fill="#161615" transform="translate(0 0)"><path id="y-eye-1" d="M 107 45.5 C 107 54.613 102.075 62 96 62 C 89.925 62 85 54.613 85 45.5 C 85 36.387 89.925 29 96 29 C 102.075 29 107 36.387 107 45.5 Z"/><path id="y-eye-2" d="M 139 45.5 C 139 54.613 134.075 62 128 62 C 121.925 62 117 54.613 117 45.5 C 117 36.387 121.925 29 128 29 C 134.075 29 139 36.387 139 45.5 Z"/></g></g></g>
|
|
6
|
+
</svg>
|
|
Binary file
|
package/dist/web/index.html
CHANGED
|
@@ -5,9 +5,15 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="theme-color" content="#161615" />
|
|
7
7
|
<title>Teammy 工作台</title>
|
|
8
|
-
<link rel="icon" type="image/
|
|
9
|
-
<
|
|
10
|
-
|
|
8
|
+
<link rel="icon" type="image/svg+xml" href="./assets/teammy-y-standard-light-Bl5D78Uj.svg" />
|
|
9
|
+
<link
|
|
10
|
+
rel="icon"
|
|
11
|
+
type="image/svg+xml"
|
|
12
|
+
href="./assets/teammy-y-standard-dark-C4LRaRpE.svg"
|
|
13
|
+
media="(prefers-color-scheme: dark)"
|
|
14
|
+
/>
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-xjf37um4.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="./assets/index-C4EXuXVY.css">
|
|
11
17
|
</head>
|
|
12
18
|
<body>
|
|
13
19
|
<div id="root" data-teammy-ui-version="11"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Et as t,G as n,H as r,Q as i,Tt as a,U as o,V as s,W as c,X as l,Z as u,_t as d,a as ee,c as f,et as te,gt as ne,ht as p,i as m,mt as h,nt as g,o as re,r as ie,rt as _,s as ae,v,vt as y,x as oe,xt as se,yt as b}from"./index-DiR0ePCJ.js";import{t as ce}from"./Markdown-DorC2YjE.js";import{a as le,i as ue,n as de,r as fe,t as pe}from"./Conversation-BBWm5w-C.js";import{t as me}from"./MessageComposer-DQBDG5yF.js";var x=a(),S=e(),he=y({topics:h(y({id:b(),title:b(),summary:b(),author:b(),replies:d(),unread:p(),createdAt:b(),updatedAt:b(),delivery:y({available:p(),connected:p(),state:b(),error:b().nullable()})}))}),ge=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),C=e=>e.replace(/[#*_`>]/g,``).replace(/\s+/g,` `).trim();function w({me:e,mode:a=`messages`}){let{projectId:d,request:h}=oe(),w=i(),ve=u(d,e,`${a}-selection`),T=u(d,e,`${a}-drafts`),ye=(0,x.useCallback)(e=>h(`agents/outbox`,ae,{signal:e}),[h]),E=l(ye,3e3,u(d,e,`outbox`)),be=(0,x.useCallback)(async e=>a===`messages`?h(`agents/chats`,ie,{signal:e}):{chats:(await h(`channels/topics`,he,{signal:e})).topics.map(e=>({...e,kind:`matter`,state:null}))},[h,a]),D=l(be,3e3,u(d,e,a,`chats`)),[O,xe]=(0,x.useState)(()=>{let e=new URLSearchParams(location.search),t=e.get(`chat`);return t?`chat:${t}`:e.get(`message`)??w?.get(ve)??``}),k=O.startsWith(`chat:`)?O.slice(5):``,A=!O||!!k,[j,M]=(0,x.useState)(()=>w?.get(u(d,e,`chat`,k))),N=j?.id===k?j:w?.get(u(d,e,`chat`,k)),P=D.data?.chats.find(e=>e.id===k),F=P&&`delivery`in P?P.delivery:void 0,[Se,I]=(0,x.useState)(),[L,R]=(0,x.useState)(()=>w?.get(T)??{}),Ce=L[O]??``,we=e=>R(t=>({...t,[O]:e})),[z,B]=(0,x.useState)(!1),[V,Te]=(0,x.useState)(!1),[Ee,De]=(0,x.useState)(!1),[Oe,H]=(0,x.useState)(!1),[U,ke]=(0,x.useState)(``),[Ae,je]=(0,x.useState)(``),Me=(0,x.useRef)(_()),[Ne,W]=(0,x.useState)(``),[Pe,G]=(0,x.useState)(``),K=(0,x.useRef)(new Map),Fe=(0,x.useRef)(null),q=(0,x.useRef)(!0),J=(0,x.useRef)(O);J.current=O,(0,x.useEffect)(()=>{j&&w?.set(u(d,e,`chat`,j.id),j)},[w,d,e,j]),(0,x.useEffect)(()=>{w?.set(T,L)},[w,T,L]);function Y(e){J.current=e,xe(e),w?.set(ve,e);let t=new URL(location.href);e.startsWith(`chat:`)?t.searchParams.set(`chat`,e.slice(5)):t.searchParams.delete(`chat`),e&&!e.startsWith(`chat:`)&&e!==`debug`?t.searchParams.set(`message`,e):t.searchParams.delete(`message`),history.replaceState(history.state,``,t)}(0,x.useEffect)(()=>{!O&&D.data?.chats.length&&Y(`chat:${D.data.chats[0].id}`)},[O,D.data]);let X=(E.data?.messages??[]).filter(e=>a===`messages`&&e.box===`debug`).reverse(),Z=E.data?.messages.find(e=>e.id===(O===`debug`?Se:O));(0,x.useEffect)(()=>{O!==`debug`&&Z?.conversationId&&Y(`chat:${Z.conversationId}`)},[O,Z?.conversationId]);let Q=X.filter(e=>!e.readAt).map(e=>e.id).join(`,`);(0,x.useEffect)(()=>{Z&&!Z.readAt&&O!==`debug`&&h(`agents/outbox/${Z.id}/read`,f,{method:`POST`}).then(()=>{window.dispatchEvent(new Event(`teammy:outbox`)),E.reload()}).catch(e=>W(g(e)))},[Z?.id,Z?.readAt,O,h,E.reload]),(0,x.useEffect)(()=>{O===`debug`&&Q&&Promise.all(Q.split(`,`).map(e=>h(`agents/outbox/${e}/read`,f,{method:`POST`}))).then(()=>{window.dispatchEvent(new Event(`teammy:outbox`)),E.reload()}).catch(e=>W(g(e)))},[O,Q,h,E.reload]),(0,x.useEffect)(()=>{if(G(``),!k)return;let n=!0,r=-1,i=!1,o=new AbortController,s=e=>{!n||e.id!==k||e.cursor<r||(r=e.cursor,i=!0,e.redirect?Y(`chat:${e.redirect}`):e.entry===`channel`&&a!==`channels`?location.replace(t(`/projects/${d}/channels?chat=${e.id}`)):(M(e),G(``)))};h(`agents/chats/${k}`,m,{signal:o.signal}).then(s).catch(t=>{n&&!o.signal.aborted&&(t instanceof te&&[401,403,404].includes(t.status)&&(w?.delete(u(d,e,`chat`,k)),M(e=>e?.id===k?void 0:e)),i||G(g(t)))});let c=e=>{let t=Number(e.lastEventId);return!n||!Number.isSafeInteger(t)||t<=r?!1:(r=t,!0)},l=new EventSource(t(`/api/v1/projects/${encodeURIComponent(d)}/agents/chats/${encodeURIComponent(k)}/events`));l.addEventListener(`snapshot`,e=>{if(n)try{s(m.parse(JSON.parse(e.data)))}catch(e){G(g(e))}}),l.onerror=()=>{n&&G(`对话连接中断,正在重新连接…`)},l.addEventListener(`context`,e=>{if(!c(e))return;let t=m.pick({kind:!0,title:!0,status:!0,visibility:!0,participants:!0,pending:!0,hold:!0,redirect:!0}).parse(JSON.parse(e.data));t.redirect?Y(`chat:${t.redirect}`):M(e=>e?.id===k?{...e,...t,cursor:r}:e)}),l.addEventListener(`message`,e=>{if(!c(e))return;let t=ee.parse(JSON.parse(e.data));M(n=>n?.id===k?{...n,readCursor:Math.max(n.readCursor,t.seq),cursor:Math.max(n.cursor,Number(e.lastEventId)||0),messages:[...n.messages.filter(e=>e.id!==t.id),t].sort((e,t)=>e.seq-t.seq)}:n)}),l.addEventListener(`message_removed`,e=>{if(!c(e))return;let{id:t}=y({id:b()}).parse(JSON.parse(e.data));M(e=>e?.id===k?{...e,cursor:r,messages:e.messages.filter(e=>e.id!==t)}:e)}),l.addEventListener(`run`,e=>{if(!c(e))return;let t=re.parse(JSON.parse(e.data));M(n=>n?.id===k?{...n,cursor:Math.max(n.cursor,Number(e.lastEventId)||0),runs:n.runs.some(e=>e.id===t.id)?n.runs:[...n.runs,t]}:n)});for(let e of[`delta`,`reset`,`state`])l.addEventListener(e,t=>{if(!c(t))return;let n=JSON.parse(t.data);M(r=>r?.id===k?{...r,cursor:Math.max(r.cursor,Number(t.lastEventId)||0),messages:r.messages.map(t=>t.runId!==n.id||t.role!==`assistant`?t:{...t,body:e===`delta`?t.body+(n.text??``):e===`reset`?``:n.answer??t.body,state:n.state??t.state}),runs:r.runs.map(t=>t.id===n.id?{...t,answer:e===`delta`?t.answer+(n.text??``):e===`reset`?``:n.answer??t.answer,state:n.state??t.state,error:n.error===void 0?t.error:n.error}:t)}:r)});return()=>{n=!1,o.abort(),l.close()}},[d,k,e,h,w]),(0,x.useEffect)(()=>{if(!N||N.id!==k)return;let e=()=>{document.visibilityState===`visible`&&h(`agents/chats/${k}/read`,y({ok:p()}),{method:`POST`,body:{cursor:N.readCursor}}).then(()=>{D.reload(),window.dispatchEvent(new Event(`teammy:outbox`))}).catch(e=>W(g(e)))},t=setTimeout(e,300);return document.addEventListener(`visibilitychange`,e),()=>{clearTimeout(t),document.removeEventListener(`visibilitychange`,e)}},[k,N?.readCursor,N?.kind,h]),(0,x.useEffect)(()=>{q.current&&Fe.current?.scrollIntoView({block:`end`})},[O,j?.messages,Z?.recipients,X.length]);function Ie(){window.dispatchEvent(new Event(`teammy:outbox`)),E.reload()}async function $(e){if(q.current=!0,Y(e),W(``),I(void 0),e.startsWith(`chat:`)||e===`debug`)return;let t=E.data?.messages.find(t=>t.id===e)?.conversationId;if(t)Y(`chat:${t}`);else try{await h(`agents/outbox/${e}/read`,f,{method:`POST`}),Ie()}catch(e){W(g(e))}}async function Le(){if(!V){Te(!0),W(``);try{let e=await h(`agents/chats`,m,{method:`POST`});M(e),await $(`chat:${e.id}`),D.reload()}catch(e){W(g(e))}finally{Te(!1)}}}async function Re(e){e.preventDefault();let t=Ce.trim();if(!t||z||V)return;B(!0),W(``);let n=K.current.get(O);n&&n.text===t||(n={text:t,id:_()},K.current.set(O,n));try{if(A){let e=n.target??k;if(!e){let r=await h(`agents/chats`,m,{method:`POST`});e=r.id,n.target=e,K.current.set(`chat:${e}`,n),R(n=>({...n,[`chat:${e}`]:t})),J.current===O&&(M(r),Y(`chat:${e}`))}let r=await h(`agents/chats/${e}`,re.extend({conversationId:b().optional()}),{method:`POST`,body:{text:t,requestId:n.id}});r.conversationId&&r.conversationId!==e&&(J.current===O||J.current===`chat:${e}`)&&Y(`chat:${r.conversationId}`),M(t=>t?.id===e?{...t,runs:t.runs.some(e=>e.id===r.id)?t.runs:[...t.runs,r]}:t),D.reload()}else{let e=await h(`agents/outbox/${Z.id}/reply`,y({conversationId:b()}),{method:`POST`,body:{body:t,requestId:n.id}});Ie(),J.current===O&&Y(`chat:${e.conversationId}`),D.reload(),I(void 0)}K.current.delete(O),n.target&&K.current.delete(`chat:${n.target}`),R(e=>({...e,[O]:``,...n.target?{[`chat:${n.target}`]:``}:{}}))}catch(e){W(g(e))}finally{B(!1)}}let ze=a===`channels`?ue:pe,Be=A&&!N?.closed&&(a!==`channels`||!!k)||!!Z&&!Z.archivedAt,Ve=A&&!N&&(!!k||!D.data);return(0,S.jsxs)(fe,{className:a===`channels`?`channel-layout`:``,testId:`assistant-page`,label:A?`Tim对话`:`消息内容`,navigation:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`header`,{className:`assistant-list-heading`,children:[(0,S.jsx)(`h1`,{children:a===`channels`?`频道`:`对话`}),(0,S.jsxs)(`div`,{className:`assistant-list-actions`,children:[(0,S.jsx)(r,{className:`assistant-new-chat`,icon:`clear`,label:`清除未读`,disabled:Ee,onClick:()=>{De(!0),W(``),h(`communication/read`,y({ok:ne(!0)}),{method:`POST`,body:{scope:a}}).then(async()=>{window.dispatchEvent(new Event(`teammy:outbox`)),await Promise.all([D.reload(),E.reload()])}).catch(e=>W(g(e))).finally(()=>De(!1))}}),(0,S.jsx)(r,{className:`assistant-new-chat`,icon:`plus`,label:a===`channels`?`发表话题`:`新建对话`,disabled:V,onClick:()=>a===`channels`?H(!0):void Le(),"data-testid":`assistant-launcher`})]})]}),(0,S.jsxs)(`div`,{className:`assistant-message-scroll`,children:[D.loading&&!D.data&&(0,S.jsx)(`p`,{className:`assistant-list-status`,role:`status`,children:`加载中…`}),D.data?.chats.map(e=>(0,S.jsxs)(`button`,{type:`button`,"data-testid":`assistant-chat-${e.id}`,className:`assistant-message-item assistant-chat-item ${k===e.id?`selected`:``}`,"aria-pressed":k===e.id,onClick:()=>void $(`chat:${e.id}`),children:[(0,S.jsx)(`span`,{className:`assistant-message-dot ${e.unread||a!==`channels`&&(e.state===`running`||e.state===`queued`)?`unread`:``}`}),(0,S.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,S.jsx)(v,{selected:k===e.id,children:(0,S.jsx)(`strong`,{children:e.title})}),a===`channels`&&`summary`in e&&(0,S.jsx)(`span`,{className:`topic-preview`,children:C(String(e.summary)).slice(0,140)}),(0,S.jsxs)(`time`,{dateTime:e.updatedAt,children:[new Date(e.updatedAt).toLocaleDateString([],{month:`numeric`,day:`numeric`}),` `,ge(e.updatedAt)]})]})]},e.id)),!!X.length&&(0,S.jsxs)(`button`,{type:`button`,"data-testid":`debug-outbox`,className:`assistant-message-item ${O===`debug`?`selected`:``}`,onClick:()=>void $(`debug`),children:[(0,S.jsx)(`span`,{className:`assistant-message-dot ${Q?`unread`:``}`}),(0,S.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,S.jsx)(v,{selected:O===`debug`,children:(0,S.jsx)(`strong`,{children:`运行提醒`})}),(0,S.jsx)(`span`,{children:C(X.at(-1).body)})]})]}),E.data?.messages.filter(e=>a===`messages`&&e.box!==`debug`&&!e.conversationId).sort((e,t)=>Number(!!e.archivedAt)-Number(!!t.archivedAt)).map(e=>(0,S.jsxs)(`button`,{type:`button`,"data-testid":`outbox-${e.id}`,className:`assistant-message-item ${e.archivedAt?`archived`:``} ${O===e.id?`selected`:``}`,onClick:()=>void $(e.id),children:[(0,S.jsx)(`span`,{className:`assistant-message-dot ${e.readAt?``:`unread`}`}),(0,S.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,S.jsx)(v,{selected:O===e.id,children:(0,S.jsx)(`strong`,{children:C(e.body)})}),(0,S.jsxs)(`time`,{dateTime:e.createdAt,children:[new Date(e.createdAt).toLocaleDateString([],{month:`numeric`,day:`numeric`}),` `,ge(e.createdAt)]})]})]},e.id))]}),(0,S.jsx)(n,{error:!0,children:E.error||D.error})]}),children:[Oe&&(0,S.jsxs)(c,{id:`new-topic`,title:`发表话题`,onClose:()=>H(!1),children:[(0,S.jsx)(me,{inset:!0,plain:!0,value:Ae,onChange:je,label:`正文`,placeholder:`开始一个话题…`,sendLabel:`发表话题`,sendDisabled:z||!U.trim(),heading:(0,S.jsx)(`input`,{className:`topic-title`,"aria-label":`标题`,placeholder:`标题`,required:!0,value:U,onChange:e=>ke(e.target.value)}),onSubmit:e=>{e.preventDefault(),B(!0),W(``),h(`channels/topics`,m,{method:`POST`,body:{id:Me.current,title:U,body:Ae}}).then(e=>{M(e),Y(`chat:${e.id}`),H(!1),ke(``),je(``),Me.current=_(),D.reload()}).catch(e=>W(g(e))).finally(()=>B(!1))}}),(0,S.jsx)(n,{error:!0,children:Ne})]}),(0,S.jsx)(de,{title:(0,S.jsx)(`h2`,{children:A?P?.title??N?.title??(k?`无标题`:`Tim`):O===`debug`?`运行提醒`:`项目消息`}),actions:(0,S.jsxs)(S.Fragment,{children:[a!==`channels`&&N?.kind===`matter`&&(0,S.jsxs)(`span`,{className:`assistant-participants`,title:N.participants?.join(`、`),children:[N.visibility===`project`?`项目共享 · `:``,N.participants?.join(`、`)]}),a===`channels`&&F?.available&&(F.state===`web`||F.state===`cancelled`||!F.connected)&&(0,S.jsx)(r,{icon:`send`,label:`发布到企业微信频道`,disabled:z,onClick:()=>{B(!0),h(`channels/topics/${k}/publish`,se(),{method:`POST`}).then(()=>D.reload()).catch(e=>W(g(e))).finally(()=>B(!1))}})]})}),a===`channels`&&(0,S.jsx)(n,{error:!0,children:F?.error}),a!==`channels`&&N?.kind===`matter`&&(N.hold||N.pending||N.status===`completed`)&&(0,S.jsx)(`div`,{className:`assistant-matter-state`,role:`status`,children:N.hold?`${N.hold.scope===`all`?`已暂停`:`暂缓修改`} · ${N.hold.reason}`:N.pending?`待确认 · ${N.pending.members.join(`、`)}:${N.pending.question}`:`已完成`}),(0,S.jsxs)(le,{"data-testid":`assistant-transcript`,onScroll:e=>{let t=e.currentTarget;q.current=t.scrollHeight-t.scrollTop-t.clientHeight<100},children:[A?Ve?(0,S.jsxs)(`div`,{className:`assistant-empty`,"data-testid":`assistant-loading`,children:[(0,S.jsx)(o,{}),(0,S.jsx)(`p`,{role:`status`,children:Pe||D.error?`暂时无法加载对话`:`加载中…`})]}):N?.messages.length?N.messages.filter(e=>e.body||[`queued`,`running`,`failed`].includes(e.state)).map(t=>(0,S.jsx)(`div`,{className:`assistant-turn`,children:(0,S.jsxs)(ze,{mine:t.role===`user`&&t.author===e,author:`${t.role===`assistant`?`Tim`:t.author}${t.source===`wecom`?` · 企业微信`:``}`,time:t.createdAt,children:[t.body&&(0,S.jsx)(`div`,{className:`markdown`,children:(0,S.jsx)(ce,{children:t.body})}),t.role===`assistant`&&[`queued`,`running`].includes(t.state)&&(0,S.jsxs)(`span`,{className:`assistant-typing`,"aria-label":`正在回答`,children:[(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{})]}),t.state===`failed`&&(0,S.jsx)(n,{error:!0,children:N.runs.find(e=>e.id===t.runId)?.error||`本次回答未完成。`})]})},t.id)):(0,S.jsxs)(`div`,{className:`assistant-empty`,children:[(0,S.jsx)(o,{}),(0,S.jsx)(`p`,{children:`有什么项目问题想聊聊?`})]}):!E.data&&E.loading?(0,S.jsx)(`div`,{className:`assistant-empty`,children:(0,S.jsx)(`p`,{role:`status`,children:`加载中…`})}):O===`debug`?X.map(e=>(0,S.jsx)(_e,{item:e,onReply:e.archivedAt?void 0:()=>{I(e.id),we(``),W(``)}},e.id)):Z&&(0,S.jsx)(_e,{item:Z}),(0,S.jsx)(`div`,{ref:Fe})]}),(0,S.jsx)(n,{error:!0,children:Ne||(A?Pe:``)}),Be?(0,S.jsx)(me,{value:Ce,onChange:we,onSubmit:e=>void Re(e),disabled:V,sendDisabled:z||Ve,label:A?`向Tim提问`:`回复消息`}):O!==`debug`&&Z&&(0,S.jsxs)(`div`,{className:`assistant-archived`,children:[(0,S.jsx)(s,{name:`archive`}),`已归档`]})]})}function _e({item:e,onReply:t}){return(0,S.jsx)(`div`,{"data-testid":`outbox-thread-${e.id}`,children:(0,S.jsxs)(pe,{author:e.box===`debug`?`运行提醒`:`Tim`,time:e.createdAt,children:[(0,S.jsx)(`div`,{className:`markdown`,children:(0,S.jsx)(ce,{children:e.body})}),t&&(0,S.jsx)(`button`,{type:`button`,className:`assistant-debug-reply`,onClick:t,children:`回复`})]})})}export{w as Assistant};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{$ as e,A as t,C as n,D as r,E as i,Et as a,G as o,H as s,L as c,M as l,O as u,P as d,S as f,T as p,Tt as m,V as h,W as g,X as _,_ as v,b as y,g as b,ht as x,j as S,k as C,mt as w,nt as T,p as E,pt as D,rt as O,vt as k,w as A,x as j,xt as ee,yt as M,z as N}from"./index-DiR0ePCJ.js";import{t as P}from"./Markdown-DorC2YjE.js";import{a as te,n as F,o as I,r as ne,t as re}from"./Conversation-BBWm5w-C.js";import{n as ie,t as ae}from"./MessageComposer-DQBDG5yF.js";import{r as oe}from"./WorkspaceTree-B4FMRlCw.js";var L=m(),R=k({cwd:M(),repository:M().nullable(),capturedAt:M(),truncated:x(),files:w(k({path:M(),section:D([`staged`,`working`,`untracked`]),patch:M().max(5e4),binary:x(),truncated:x()})).max(100)}),z=e(),B=k({command:C,diff:R.nullable()});function se({session:e,request:t,onClose:n}){let[r,i]=(0,L.useState)(O),[a,s]=(0,L.useState)(),[c,l]=(0,L.useState)(``);(0,L.useEffect)(()=>{let n=new AbortController,i;s(void 0),l(``);let a=async()=>{try{let o=await t(`web/local-agent-sessions/${e}/diff/${r}`,B,{signal:n.signal});if(n.signal.aborted)return;s(o),[`queued`,`running`].includes(o.command.state)&&(i=setTimeout(()=>void a(),1e3))}catch(e){n.signal.aborted||l(T(e))}};return t(`web/local-agent-sessions/${e}/commands`,C,{method:`POST`,signal:n.signal,body:{id:r,kind:`diff`}}).then(a).catch(e=>{n.signal.aborted||l(T(e))}),()=>{n.abort(),clearTimeout(i)}},[e,t,r]);let u=a?.diff,d=!c&&(!a||[`queued`,`running`].includes(a.command.state));return(0,z.jsx)(g,{id:`workspace-diff`,title:`工作目录改动`,onClose:n,children:(0,z.jsxs)(`div`,{className:`workspace-diff`,children:[(0,z.jsx)(`p`,{className:`muted`,children:`包含此目录内所有未提交改动,也可能包含其他会话或工具的修改。`}),(0,z.jsxs)(`div`,{className:`workspace-diff-toolbar`,children:[(0,z.jsx)(`span`,{className:`muted`,children:u?`读取于 ${new Date(u.capturedAt).toLocaleTimeString()}`:d?`正在从开发机读取…`:``}),(0,z.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>i(O()),children:`刷新`})]}),(0,z.jsx)(o,{error:!0,children:c||a?.command.error}),u&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`code`,{className:`workspace-diff-path`,children:u.cwd}),u.repository?u.files.length?null:(0,z.jsx)(`p`,{children:`当前目录没有未提交改动。`}):(0,z.jsx)(`p`,{children:`此目录不在 Git 仓库中。`}),u.truncated&&(0,z.jsx)(o,{children:`部分内容较大或无法预览,已限制显示范围。完整内容请在开发机查看。`}),u.files.map((e,t)=>(0,z.jsxs)(`details`,{open:t===0,children:[(0,z.jsxs)(`summary`,{children:[(0,z.jsx)(`span`,{children:e.path}),(0,z.jsx)(`small`,{children:{staged:`已暂存`,working:`未暂存`,untracked:`未跟踪`}[e.section]})]}),e.binary?(0,z.jsx)(`p`,{className:`muted`,children:`二进制文件`}):e.patch?(0,z.jsx)(`pre`,{"aria-label":`${e.path} 差异`,children:(0,z.jsx)(`code`,{children:e.patch.split(`
|
|
2
|
-
`).map((e,t)=>(0,z.jsxs)(`span`,{className:e.startsWith(`+`)?`diff-added`:e.startsWith(`-`)?`diff-removed`:e.startsWith(`@@`)?`diff-hunk`:``,children:[e,e?null:`\xA0`]},t))})}):(0,z.jsx)(`p`,{className:`muted`,children:`无可预览的文本差异。`}),e.truncated&&(0,z.jsx)(`small`,{className:`muted`,children:`此文件内容已截断或未展开。`})]},`${e.section}:${e.path}`))]})]})})}var ce=(e,t,n)=>a(`/api/v1/projects/${encodeURIComponent(e)}/local-agent/sessions/${encodeURIComponent(t)}/images/${encodeURIComponent(n)}`);function le({images:e,url:t,remove:n,disabled:r=!1}){return e.length?(0,z.jsx)(`div`,{className:`session-images`,children:e.map(e=>(0,z.jsxs)(`div`,{className:`session-image`,children:[(0,z.jsx)(`a`,{href:t(e.id),target:`_blank`,rel:`noreferrer`,title:e.name,children:(0,z.jsx)(`img`,{src:t(e.id),alt:e.name,loading:`lazy`})}),n&&(0,z.jsx)(`button`,{type:`button`,"aria-label":`移除图片 ${e.name}`,disabled:r,onClick:()=>n(e.id),children:(0,z.jsx)(h,{name:`close`,size:`small`})})]},e.id))}):null}function ue(e,t,n){let[r,i]=(0,L.useState)([]),[a,s]=(0,L.useState)(!1),[c,l]=(0,L.useState)(``),u=`${t}:${e}`,f=(0,L.useRef)(u),p=(0,L.useRef)(!1),m=(0,L.useRef)(null);f.current=u,(0,L.useEffect)(()=>{i([]),l(``)},[u]);async function g(t){if(!p.current&&e){if(t.length+r.length>4)l(`每条消息最多添加 4 张图片。`);else{p.current=!0,s(!0),l(``);try{for(let r of Array.from(t)){if(![`image/png`,`image/jpeg`,`image/webp`].includes(r.type)||r.size>5242880||!r.size)throw Error(`请选择不超过 5 MB 的 PNG、JPEG 或 WebP 图片。`);let t=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(String(n.result).split(`,`,2)[1]),n.onerror=()=>t(Error(`图片读取失败。`)),n.readAsDataURL(r)}),a=await n(`web/local-agent-sessions/${e}/images`,d,{method:`POST`,body:{id:O(),name:r.name.slice(0,200),data:t}});if(f.current!==u)return;i(e=>[...e,a])}}catch(e){f.current===u&&l(T(e))}finally{p.current=!1,s(!1)}}}}let _=n=>ce(t,e,n);return{images:r,busy:a,add:g,clear:()=>{f.current===u&&i([])},picker:e=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`input`,{ref:m,type:`file`,className:`session-image-file`,accept:`image/png,image/jpeg,image/webp`,multiple:!0,"aria-label":`选择图片`,disabled:e||a,onChange:e=>{e.target.files&&g(e.target.files),e.target.value=``}}),(0,z.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`添加图片`,title:`添加图片,也可粘贴或拖入`,disabled:e||a,onClick:()=>m.current?.click(),children:(0,z.jsx)(h,{name:`attachment`,size:`small`})})]}),preview:e=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(le,{images:r,url:_,disabled:e||a,remove:e=>i(t=>t.filter(t=>t.id!==e))}),a&&(0,z.jsx)(`small`,{className:`muted`,children:`正在上传图片…`}),(0,z.jsx)(o,{error:!0,children:c})]})}}function de({message:e,session:t,request:n,refresh:r}){let[i,a]=(0,L.useState)(!1),[s,c]=(0,L.useState)(e.body),[l,u]=(0,L.useState)(!1),[d,f]=(0,L.useState)(``),p=(0,L.useRef)(void 0),m=e.queue;if(!m)return null;let h={offered:`待本地接收`,received:`待本地接收`,queued:`排队中`,dispatching:`正在发送`,running:`执行中`,cancelled:`已撤回`,uncertain:`需要核对`};async function g(i){let o=JSON.stringify({inputId:e.id.replace(/^input:/,``),expectedRevision:m.revision,...i===`queue-edit`?{body:s}:{}}),c=`${i}:${o}`;p.current?.fingerprint!==c&&(p.current={fingerprint:c,id:O()}),u(!0),f(``);try{await n(`web/local-agent-sessions/${t}/commands`,C,{method:`POST`,body:{id:p.current.id,kind:i,argument:o}}),a(!1),p.current=void 0,r()}catch(e){f(T(e))}finally{u(!1)}}return(0,z.jsxs)(`div`,{className:`queued-message`,children:[h[m.state]&&(0,z.jsx)(`small`,{className:`muted`,children:h[m.state]}),i?(0,z.jsxs)(`div`,{className:`queued-message-editor`,children:[(0,z.jsx)(`textarea`,{"aria-label":`编辑待发送消息`,value:s,onChange:e=>c(e.target.value),disabled:l||!m.editable,autoFocus:!0}),(0,z.jsxs)(`div`,{className:`queued-message-actions`,children:[(0,z.jsx)(`button`,{type:`button`,disabled:l||!m.editable||!s.trim(),onClick:()=>void g(`queue-edit`),children:`保存修改`}),(0,z.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>a(!1),children:`取消编辑`})]})]}):m.editable&&(0,z.jsxs)(`div`,{className:`queued-message-actions`,children:[(0,z.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>{c(e.body),a(!0)},children:`编辑`}),(0,z.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>void g(`queue-cancel`),children:`撤回`})]}),(0,z.jsx)(o,{error:!0,children:d})]})}function V(e){if(e<1e3)return`不到 1 秒`;let t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60);return[r?`${r} 小时`:``,n%60?`${n%60} 分`:``,t%60?`${t%60} 秒`:``].filter(Boolean).join(` `)}function fe({children:e}){return(0,z.jsx)(`div`,{className:`computer-divider`,children:(0,z.jsx)(`span`,{children:e})})}function pe({message:e}){let t=e.state===`succeeded`?`已工作`:e.state===`interrupted`?`已停止`:e.state===`failed`?`执行失败`:`需要核对`;return(0,z.jsxs)(fe,{children:[t,e.activity?.durationMs===void 0?``:` · ${V(e.activity.durationMs)}`]})}var me={offered:`待本地接收`,pending:`待投递`,human_routed:`未送达本地`,failed:`失败`,uncertain:`需要核对`};function he({messages:e,renderQuestion:t,imageUrl:n,renderQueue:r}){let i=new Map(e.filter(e=>e.activity?.kind===`turn`).map(e=>[e.activity.turnId,e])),a=new Map,o=new Set(e.flatMap(e=>{let t=e.question?.planSource;return t?[JSON.stringify([t.turnId,t.itemId])]:[]})),s=new Set(e.flatMap(e=>{let t=e.activity;return t?.kind===`commentary`&&o.has(JSON.stringify([t.turnId,t.itemId]))?[JSON.stringify([t.turnId,e.body])]:[]}));for(let t of e)t.activity?.kind===`answer`&&!a.has(t.activity.turnId)&&a.set(t.activity.turnId,t.id);return(0,z.jsx)(`div`,{className:`computer-messages`,children:e.map(e=>{let c=e.activity;if(c?.kind===`commentary`&&(o.has(JSON.stringify([c.turnId,c.itemId]))||s.has(JSON.stringify([c.turnId,e.body]))))return null;if(e.role===`system`)return(0,z.jsx)(fe,{children:e.body},e.id);if(c?.kind===`turn`)return a.has(c.turnId)?null:(0,z.jsx)(pe,{message:e},e.id);if(e.role===`user`)return(0,z.jsxs)(re,{mine:!0,author:`你`,time:e.createdAt,children:[n&&e.images?.length?(0,z.jsx)(le,{images:e.images,url:n}):null,(0,z.jsx)(`div`,{className:`markdown`,children:(0,z.jsx)(P,{children:e.body})}),e.queue&&r?r(e):me[e.state]&&(0,z.jsx)(I,{label:me[e.state],state:e.state})]},e.id);if(c?.kind===`tool`)return(0,z.jsxs)(`details`,{className:`computer-tool`,children:[(0,z.jsxs)(`summary`,{title:c.label,children:[(0,z.jsx)(h,{name:`chevron`,size:`small`}),(0,z.jsx)(`span`,{className:`computer-tool-label`,children:c.label??`工具调用`}),(0,z.jsxs)(`span`,{className:`computer-tool-status`,children:[e.state===`running`?`进行中`:e.state===`failed`?`失败`:e.state===`interrupted`?`已停止`:e.state===`uncertain`?`需核对`:``,c.durationMs!==void 0&&(0,z.jsx)(`span`,{children:V(c.durationMs)})]})]}),(0,z.jsx)(`pre`,{children:e.body})]},e.id);let l=c?.kind===`answer`&&a.get(c.turnId)===e.id?i.get(c.turnId):void 0;return(0,z.jsxs)(L.Fragment,{children:[l&&(0,z.jsx)(pe,{message:l}),(0,z.jsx)(`article`,{className:`computer-agent-message ${c?.kind===`commentary`?`computer-commentary`:``} ${e.question?`question-bubble`:``}`,children:e.question?t(e.question):(0,z.jsx)(`div`,{className:`markdown`,children:(0,z.jsx)(P,{children:e.body})})})]},e.id)})})}var H={codex:{name:`Codex`,logo:`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmetadata%3eMIT%20License%20Copyright%20(c)%202023%20LobeHub%20Permission%20is%20hereby%20granted,%20free%20of%20charge,%20to%20any%20person%20obtaining%20a%20copy%20of%20this%20software%20and%20associated%20documentation%20files%20(the%20'Software'),%20to%20deal%20in%20the%20Software%20without%20restriction,%20including%20without%20limitation%20the%20rights%20to%20use,%20copy,%20modify,%20merge,%20publish,%20distribute,%20sublicense,%20and/or%20sell%20copies%20of%20the%20Software,%20and%20to%20permit%20persons%20to%20whom%20the%20Software%20is%20furnished%20to%20do%20so,%20subject%20to%20the%20following%20conditions:%20The%20above%20copyright%20notice%20and%20this%20permission%20notice%20shall%20be%20included%20in%20all%20copies%20or%20substantial%20portions%20of%20the%20Software.%20THE%20SOFTWARE%20IS%20PROVIDED%20'AS%20IS',%20WITHOUT%20WARRANTY%20OF%20ANY%20KIND,%20EXPRESS%20OR%20IMPLIED,%20INCLUDING%20BUT%20NOT%20LIMITED%20TO%20THE%20WARRANTIES%20OF%20MERCHANTABILITY,%20FITNESS%20FOR%20A%20PARTICULAR%20PURPOSE%20AND%20NONINFRINGEMENT.%20IN%20NO%20EVENT%20SHALL%20THE%20AUTHORS%20OR%20COPYRIGHT%20HOLDERS%20BE%20LIABLE%20FOR%20ANY%20CLAIM,%20DAMAGES%20OR%20OTHER%20LIABILITY,%20WHETHER%20IN%20AN%20ACTION%20OF%20CONTRACT,%20TORT%20OR%20OTHERWISE,%20ARISING%20FROM,%20OUT%20OF%20OR%20IN%20CONNECTION%20WITH%20THE%20SOFTWARE%20OR%20THE%20USE%20OR%20OTHER%20DEALINGS%20IN%20THE%20SOFTWARE.%20Source:%20https://raw.githubusercontent.com/lobehub/lobe-icons/ea434b96e75813517b377825e01c0df61dee8836/packages/static-svg/icons/openai.svg%20Teammy:%20added%20license%20metadata;%20geometry%20unchanged.%3c/metadata%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M9.205%208.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357%201.356-.523%202.117-.523%202.854%200%204.662%202.212%204.662%204.566%200%20.167%200%20.357-.024.547l-4.71-2.759a.797.797%200%2000-.856%200l-5.97%203.473zm10.609%208.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473%201.95-1.118a.433.433%200%2001.476%200l4.543%202.617c1.309.76%202.189%202.378%202.189%203.948%200%201.808-1.07%203.473-2.76%204.163zM7.802%2012.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545%201.95-4.472%204.591-4.472%201%200%201.927.333%202.712.928L8.23%205.067c-.285.166-.428.404-.428.737v6.898zM12%2015.128l-2.795-1.57v-3.33L12%208.658l2.795%201.57v3.33L12%2015.128zm1.796%207.23c-1%200-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974%201.142c.167.095.238.238.238.428v5.233c0%202.545-1.974%204.472-4.614%204.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482%204.482%200%20014.21%206.327v5.423c0%20.333.143.571.428.738l5.947%203.449-1.95%201.118a.432.432%200%2001-.476%200zm-.262%203.9c-2.688%200-4.662-2.021-4.662-4.519%200-.19.024-.38.047-.57l4.686%202.71c.286.167.571.167.856%200l5.97-3.448v2.26c0%20.19-.07.333-.237.428l-4.543%202.616c-.619.357-1.356.523-2.117.523zm5.899%202.83a5.947%205.947%200%20005.827-4.756C22.287%2018.339%2024%2015.84%2024%2013.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498%200-3.401-2.759-5.947-5.946-5.947-.642%200-1.26.095-1.88.31A5.962%205.962%200%200010.205%200a5.947%205.947%200%2000-5.827%204.757C1.713%205.447%200%207.945%200%2010.49c0%201.666.713%203.283%201.998%204.448-.119.5-.19%201-.19%201.499%200%203.401%202.759%205.946%205.946%205.946.642%200%201.26-.095%201.88-.309a5.96%205.96%200%20004.162%201.713z'%3e%3c/path%3e%3c/svg%3e`},claude:{name:`Claude Code`,logo:`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmetadata%3eMIT%20License%20Copyright%20(c)%202023%20LobeHub%20Permission%20is%20hereby%20granted,%20free%20of%20charge,%20to%20any%20person%20obtaining%20a%20copy%20of%20this%20software%20and%20associated%20documentation%20files%20(the%20'Software'),%20to%20deal%20in%20the%20Software%20without%20restriction,%20including%20without%20limitation%20the%20rights%20to%20use,%20copy,%20modify,%20merge,%20publish,%20distribute,%20sublicense,%20and/or%20sell%20copies%20of%20the%20Software,%20and%20to%20permit%20persons%20to%20whom%20the%20Software%20is%20furnished%20to%20do%20so,%20subject%20to%20the%20following%20conditions:%20The%20above%20copyright%20notice%20and%20this%20permission%20notice%20shall%20be%20included%20in%20all%20copies%20or%20substantial%20portions%20of%20the%20Software.%20THE%20SOFTWARE%20IS%20PROVIDED%20'AS%20IS',%20WITHOUT%20WARRANTY%20OF%20ANY%20KIND,%20EXPRESS%20OR%20IMPLIED,%20INCLUDING%20BUT%20NOT%20LIMITED%20TO%20THE%20WARRANTIES%20OF%20MERCHANTABILITY,%20FITNESS%20FOR%20A%20PARTICULAR%20PURPOSE%20AND%20NONINFRINGEMENT.%20IN%20NO%20EVENT%20SHALL%20THE%20AUTHORS%20OR%20COPYRIGHT%20HOLDERS%20BE%20LIABLE%20FOR%20ANY%20CLAIM,%20DAMAGES%20OR%20OTHER%20LIABILITY,%20WHETHER%20IN%20AN%20ACTION%20OF%20CONTRACT,%20TORT%20OR%20OTHERWISE,%20ARISING%20FROM,%20OUT%20OF%20OR%20IN%20CONNECTION%20WITH%20THE%20SOFTWARE%20OR%20THE%20USE%20OR%20OTHER%20DEALINGS%20IN%20THE%20SOFTWARE.%20Source:%20https://raw.githubusercontent.com/lobehub/lobe-icons/ea434b96e75813517b377825e01c0df61dee8836/packages/static-svg/icons/claude.svg%20Teammy:%20added%20license%20metadata;%20geometry%20unchanged.%3c/metadata%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='M4.709%2015.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0%2011.784l.055-.352.48-.321.686.06%201.52.103%202.278.158%201.652.097%202.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686%201.908%201.476%202.491%201.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97%202.97%200%2001-.104-.729L6.283.134%206.696%200l.996.134.42.364.62%201.414%201.002%202.229%201.555%203.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286%201.851-.559%202.903-.364%201.942h.212l.243-.242.985-1.306%201.652-2.064.73-.82.85-.904.547-.431h1.033l.76%201.129-.34%201.166-1.064%201.347-.881%201.142-1.264%201.7-.79%201.36.073.11.188-.02%202.856-.606%201.543-.28%201.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061%201.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093%201.068%202.006%201.81%202.509%202.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649%202.345%203.521.122%201.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674%207.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434%201.967-2.18%202.945-1.726%201.845-.414.164-.717-.37.067-.662.401-.589%202.388-3.036%201.44-1.882.93-1.086-.006-.158h-.055L4.132%2018.56l-1.13.146-.487-.456.061-.746.231-.243%201.908-1.312-.006.006z'%3e%3c/path%3e%3c/svg%3e`},cursor:{name:`Cursor`,logo:`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmetadata%3eMIT%20License%20Copyright%20(c)%202023%20LobeHub%20Permission%20is%20hereby%20granted,%20free%20of%20charge,%20to%20any%20person%20obtaining%20a%20copy%20of%20this%20software%20and%20associated%20documentation%20files%20(the%20'Software'),%20to%20deal%20in%20the%20Software%20without%20restriction,%20including%20without%20limitation%20the%20rights%20to%20use,%20copy,%20modify,%20merge,%20publish,%20distribute,%20sublicense,%20and/or%20sell%20copies%20of%20the%20Software,%20and%20to%20permit%20persons%20to%20whom%20the%20Software%20is%20furnished%20to%20do%20so,%20subject%20to%20the%20following%20conditions:%20The%20above%20copyright%20notice%20and%20this%20permission%20notice%20shall%20be%20included%20in%20all%20copies%20or%20substantial%20portions%20of%20the%20Software.%20THE%20SOFTWARE%20IS%20PROVIDED%20'AS%20IS',%20WITHOUT%20WARRANTY%20OF%20ANY%20KIND,%20EXPRESS%20OR%20IMPLIED,%20INCLUDING%20BUT%20NOT%20LIMITED%20TO%20THE%20WARRANTIES%20OF%20MERCHANTABILITY,%20FITNESS%20FOR%20A%20PARTICULAR%20PURPOSE%20AND%20NONINFRINGEMENT.%20IN%20NO%20EVENT%20SHALL%20THE%20AUTHORS%20OR%20COPYRIGHT%20HOLDERS%20BE%20LIABLE%20FOR%20ANY%20CLAIM,%20DAMAGES%20OR%20OTHER%20LIABILITY,%20WHETHER%20IN%20AN%20ACTION%20OF%20CONTRACT,%20TORT%20OR%20OTHERWISE,%20ARISING%20FROM,%20OUT%20OF%20OR%20IN%20CONNECTION%20WITH%20THE%20SOFTWARE%20OR%20THE%20USE%20OR%20OTHER%20DEALINGS%20IN%20THE%20SOFTWARE.%20Source:%20https://raw.githubusercontent.com/lobehub/lobe-icons/ea434b96e75813517b377825e01c0df61dee8836/packages/static-svg/icons/claude.svg%20Teammy:%20added%20license%20metadata;%20geometry%20unchanged.%3c/metadata%3e%3ctitle%3eCursor%3c/title%3e%3cpath%20d='M22.106%205.68L12.5.135a.998.998%200%2000-.998%200L1.893%205.68a.84.84%200%2000-.419.726v11.186c0%20.3.16.577.42.727l9.607%205.547a.999.999%200%2000.998%200l9.608-5.547a.84.84%200%2000.42-.727V6.407a.84.84%200%2000-.42-.726zm-.603%201.176L12.228%2022.92c-.063.108-.228.064-.228-.061V12.34a.59.59%200%2000-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264%200%20.428.286.296.514z'%3e%3c/path%3e%3c/svg%3e`},pi:{name:`Pi`,logo:`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='currentColor'%20d='M3%205h18v3h-3v9c0%201%20.5%201.5%201.5%201.5H21V21h-2c-3%200-4-1.5-4-4V8H9v6c0%204-1.5%206.5-5%207l-1-2.5C5.5%2018%206%2016.5%206%2014V8H3z'/%3e%3c/svg%3e`},opencode:{name:`OpenCode`,logo:`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='96%2064%20288%20384'%20fill='%23393936'%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20opacity='.4'/%3e%3cpath%20fill-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'/%3e%3c/svg%3e`}};function ge({provider:e}){let{name:t,logo:n}=H[e];return(0,z.jsx)(`img`,{className:`agent-logo`,src:n,alt:t,title:t,"data-provider":e,width:24,height:24})}function _e({disabled:e,onSend:t,initialValue:n=``,placeholder:r}){let[i,a]=(0,L.useState)(n),[o,s]=(0,L.useState)(!!n),c=`其他回答`,l=(0,L.useRef)(null),u=(0,L.useCallback)(e=>{if(!l.current)return;let t=document.createElement(`canvas`).getContext(`2d`);if(!t)return;t.font=getComputedStyle(e).font;let n=Math.max(...(i||`${c}…`).split(`
|
|
3
|
-
`).map(e=>t.measureText(e).width));l.current.style.setProperty(`--reply-width`,`${Math.ceil(n+(o?52:26))}px`)},[i,o,c]),d=ie(i,u);return(0,z.jsxs)(`form`,{ref:l,className:`inline-reply${o?` active`:``}`,onFocus:()=>s(!0),onBlur:e=>{!i&&!e.currentTarget.contains(e.relatedTarget)&&s(!1)},onSubmit:n=>{n.preventDefault(),!e&&i.trim()&&t(i.trim()).then(e=>{e&&a(``)})},children:[(0,z.jsx)(`textarea`,{ref:d,rows:1,"aria-label":`自定义回答`,placeholder:r??`${c}…`,value:i,disabled:e,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&!t.nativeEvent.isComposing&&(t.preventDefault(),!e&&i.trim()&&t.currentTarget.form?.requestSubmit())}}),o&&(0,z.jsx)(`button`,{className:`inline-reply-send`,type:`submit`,disabled:e||!i.trim(),"aria-label":`发送${c}`,title:`发送${c}`,children:(0,z.jsx)(h,{name:`send`,size:`small`})})]})}function ve({question:e,session:t,request:n,refresh:r}){let[i,a]=(0,L.useState)({}),[s,c]=(0,L.useState)({}),[l,u]=(0,L.useState)(``),[d,f]=(0,L.useState)(!1),[p,m]=(0,L.useState)(!1),[g,_]=(0,L.useState)(``),v=(0,L.useRef)(null),y=(0,L.useRef)(!1),b=(0,L.useRef)(void 0);(0,L.useEffect)(()=>{if(e.state!==`pending`||y.current||!v.current)return;let r=!1,i=()=>{if(!r||document.visibilityState!==`visible`||!v.current)return;let i=v.current.getBoundingClientRect();i.bottom>0&&i.top<innerHeight&&n(`web/local-agent-sessions/${t}/questions/${e.id}/presented`,k({ok:x()}),{method:`POST`}).then(()=>{y.current=!0}).catch(e=>u(T(e)))},a=new IntersectionObserver(e=>{r=e.some(e=>e.isIntersecting),i()});return a.observe(v.current),document.addEventListener(`visibilitychange`,i),()=>{a.disconnect(),document.removeEventListener(`visibilitychange`,i)}},[e.id,e.state,t,n]);async function S(i){let a=JSON.stringify(i);b.current?.fingerprint!==a&&(b.current={fingerprint:a,value:{...i,id:O()}}),f(!0),u(``);try{return await n(`web/local-agent-sessions/${t}/questions/${e.id}/answers`,ee(),{method:`POST`,body:b.current.value}),b.current=void 0,r(),!0}catch(e){return u(T(e)),!1}finally{f(!1)}}let C=e.response,w=e.state===`answered`,E=[`expired`,`cancelled`].includes(e.state),D=[`human_routed`,`failed`,`handled`].includes(e.submissionState??``)&&!w,A=e.state===`pending`&&(!C||D),j=e.kind===`plan`,M=e.actions?.find(e=>e.id===C?.actionId),N=E?`已过期`:e.state===`uncertain`||e.submissionState===`uncertain`?`需核对`:w?j?M?.label??`已处理`:e.approval?C?.decision===!0?`已允许`:C?.decision===!1?`已拒绝`:`已处理`:M?M.label:C?``:`已回答`:D?`请重新提交`:C?`正在提交`:``,te=E||C?.decision===!1||D?`close`:w?`check`:`clock`,F=e.questions.length>1||e.questions.some(e=>e.multiSelect),I=(t=i)=>S({body:e.questions.length===1?t[e.questions[0].id]||(s[e.questions[0].id]??[]).join(`、`):JSON.stringify(t),...e.kind||e.questions.some(e=>e.multiSelect)?{answers:t}:{},...e.questions.some(e=>e.multiSelect)?{selections:s}:{}});return(0,z.jsxs)(`div`,{className:`native-question ${j?`native-plan`:``}`,ref:v,children:[j?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`native-plan-heading`,children:[(0,z.jsx)(h,{name:`file`,size:`small`}),(0,z.jsx)(`span`,{children:`实施计划`})]}),A?(0,z.jsx)(`div`,{className:`native-plan-content markdown`,children:(0,z.jsx)(P,{children:e.plan??``})}):(0,z.jsxs)(`details`,{className:`native-plan-history markdown`,children:[(0,z.jsx)(`summary`,{children:`查看计划`}),(0,z.jsx)(P,{children:e.plan??``})]}),A&&(0,z.jsxs)(z.Fragment,{children:[!p&&(0,z.jsx)(`div`,{className:`question-actions native-plan-actions ${e.actions&&e.actions.length>3?`native-plan-actions-expanded`:``}`,children:e.actions?.map(e=>(0,z.jsx)(`button`,{type:`button`,disabled:d,title:e.description,className:e.id===`implement`?`primary`:``,onClick:()=>e.id===`revise`?m(!0):void S({body:e.label,actionId:e.id}),children:e.label},e.id))}),!p&&e.actions?.find(e=>e.id===`implement`)?.description&&(0,z.jsxs)(`small`,{className:`native-plan-note muted`,children:[`开始实施:`,e.actions.find(e=>e.id===`implement`).description]}),p&&(0,z.jsxs)(`form`,{className:`native-plan-feedback`,onSubmit:e=>{e.preventDefault(),S({body:g,actionId:`revise`})},children:[(0,z.jsxs)(`label`,{children:[`修改意见`,(0,z.jsx)(`textarea`,{autoFocus:!0,value:g,onChange:e=>_(e.target.value),placeholder:`说明希望调整的部分,Agent 将修改后再次请求确认`})]}),(0,z.jsxs)(`div`,{className:`question-actions native-plan-feedback-actions`,children:[(0,z.jsx)(`button`,{className:`primary`,disabled:d||!g.trim(),children:`提交修改意见`}),(0,z.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>m(!1),children:`返回计划`})]})]})]}),!A&&C?.actionId===`revise`&&C.answers.feedback&&(0,z.jsx)(`div`,{className:`question-response`,children:C.answers.feedback})]}):(0,z.jsxs)(z.Fragment,{children:[e.questions.map(t=>(0,z.jsxs)(`div`,{className:`native-question-part`,children:[(0,z.jsx)(`p`,{className:e.approval?`native-approval-detail`:``,children:t.text}),A&&(0,z.jsx)(`div`,{className:`question-options ${e.approval?`native-approval-options`:Object.values(t.descriptions??{}).some(Boolean)?`question-options-described`:``}`,children:(e.approval?[`允许`,`拒绝`]:t.options).map(n=>(0,z.jsxs)(`button`,{type:`button`,disabled:d,"aria-pressed":t.multiSelect?s[t.id]?.includes(n)??!1:i[t.id]===n,onClick:()=>{if(t.multiSelect){c(e=>({...e,[t.id]:e[t.id]?.includes(n)?e[t.id].filter(e=>e!==n):[...e[t.id]??[],n]}));return}let r={...i,[t.id]:n};a(r),e.approval?S({body:n,decision:n===`允许`}):F||I(r)},children:[(0,z.jsxs)(`span`,{className:`question-option-label`,children:[t.multiSelect&&(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`question-check`,children:s[t.id]?.includes(n)&&(0,z.jsx)(h,{name:`check`,size:`small`})}),n]}),t.descriptions?.[n]&&(0,z.jsx)(`small`,{children:t.descriptions[n]})]},n))}),!e.approval&&t.freeText&&A&&(0,z.jsx)(_e,{initialValue:t.initialValue,placeholder:t.placeholder,disabled:d,onSend:async e=>{let n={...i,[t.id]:e};return a(n),F?!0:I(n)}}),A&&F&&i[t.id]&&!t.options.includes(i[t.id])&&(0,z.jsx)(`small`,{children:i[t.id]}),!A&&!e.approval&&(C?.answers[t.id]||C?.selections?.[t.id]?.length)&&(0,z.jsxs)(`div`,{className:`question-response`,children:[(0,z.jsx)(h,{name:w?`check`:`clock`,size:`small`}),(0,z.jsx)(`span`,{children:[...C.selections?.[t.id]??[],C.answers[t.id]].filter(Boolean).join(`、`)})]})]},t.id)),A&&!e.approval&&e.actions?.length&&(0,z.jsx)(`div`,{className:`question-actions`,children:e.actions.map(e=>(0,z.jsx)(`button`,{disabled:d,onClick:()=>void S({body:e.label,actionId:e.id}),children:e.label},e.id))}),A&&!e.approval&&F&&(0,z.jsx)(`div`,{className:`question-actions`,children:(0,z.jsx)(`button`,{disabled:d||e.questions.some(e=>!i[e.id]?.trim()&&!s[e.id]?.length),onClick:()=>void I(),children:`回答`})}),A&&e.approval&&e.autoApprove!==!1&&(0,z.jsx)(`small`,{className:`muted`,children:`60 秒后自动允许`})]}),N&&(0,z.jsxs)(`small`,{className:`question-result`,children:[(0,z.jsx)(h,{name:te,size:`small`}),N]}),(0,z.jsx)(o,{error:!0,children:l})]})}var U={minimal:`极低`,low:`低`,medium:`中`,high:`高`,xhigh:`极高`,max:`最高`,ultra:`极致`,none:`无`,off:`关闭`};function W({id:e,label:t,current:n,options:r,disabled:i,onSelect:a}){let o=r.find(e=>e.value===n);return(0,z.jsx)(b,{id:`${e}-menu`,triggerId:e,placement:`top`,className:`composer-menu composer-choice`,label:`选择${t}`,disabled:i,routeKey:n,trigger:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{title:`${t}:${o?.label??n}`,children:o?.shortLabel??o?.label??n}),(0,z.jsx)(h,{name:`chevronDown`,size:`small`})]}),children:e=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`composer-menu-heading`,children:t}),r.map(t=>(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-label":t.label,onClick:()=>{e(),a(t.value)},children:[(0,z.jsxs)(`span`,{className:`composer-option-copy`,children:[(0,z.jsx)(`span`,{children:t.label}),t.description&&(0,z.jsx)(`small`,{children:t.description})]}),t.value===n&&(0,z.jsx)(h,{name:`check`,size:`small`})]},t.value))]})})}function ye({session:e,models:t,busy:n,available:r,online:i,commands:a,controls:o,draft:s,onInsert:c,onConfig:l}){let[u,d]=(0,L.useState)(!1);(0,L.useEffect)(()=>{/^[/$]([^\s]*)$/.exec(s)?d(!0):d(!1)},[s]);let f=e.config.model??e.effectiveConfig?.model,p=t.find(e=>e.id===f||e.resolvedModel===f)??(e.config.model?void 0:t.find(e=>e.isDefault)),m=n||!r,g=e.provider===`claude`,_=e.provider===`cursor`,v=e.provider===`pi`,y=o??S(e.provider),x=p?.effortLabel??`思考强度`,C=e=>p?.effortLabel?e:U[e]??e,w=e.appliedRevision===e.revision?e.effectiveConfig?.mode:void 0,T=t.find(e=>e.isDefault)?.id??(e.config.model?null:e.effectiveConfig?.model),E=t.find(e=>e.id===T)?.name??T,D=e=>g?e.replace(/^Claude\s+/,``):e,O=[{value:``,label:E?`默认 · ${E}`:t.length?`默认模型`:`模型未获取`,shortLabel:E?D(E):t.length?`默认模型`:`模型`},...t.map(e=>({value:e.id,label:e.name,shortLabel:D(e.name)}))];e.config.model&&!t.some(t=>t.id===e.config.model)&&O.push({value:e.config.model,label:e.config.model,shortLabel:D(e.config.model)});let k=p?.id===e.effectiveConfig?.model?e.effectiveConfig?.effort:p?.defaultEffort,A=[{value:``,label:k?`默认 · ${C(k)}`:`默认${x}`,shortLabel:k?C(k):p?.effortLabel??`强度`},...(p?.efforts??[]).map(e=>({value:e,label:C(e)}))];return e.config.effort&&!A.some(t=>t.value===e.config.effort)&&A.push({value:e.config.effort,label:C(e.config.effort)}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(b,{id:`session-commands`,triggerId:`session-command-trigger`,label:`命令与 Skills`,placement:`top`,className:`composer-menu composer-commands`,routeKey:e.id,trigger:(0,z.jsx)(h,{name:`command`,size:`small`}),open:u,onOpenChange:d,focusFirst:!1,disabled:m||!i,children:e=>(0,z.jsxs)(z.Fragment,{children:[[...a].sort((e,t)=>e.name.localeCompare(t.name,`en`)).map(t=>(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,title:[t.description,t.path].filter(Boolean).join(`
|
|
4
|
-
`),onClick:()=>{e(),c(t)},children:(0,z.jsxs)(`span`,{className:`composer-command-row`,children:[(0,z.jsxs)(`span`,{className:`composer-command-name`,children:[t.prefix??(t.kind===`skill`?`$`:`/`),t.name]}),(0,z.jsx)(`small`,{children:t.description})]})},`${t.kind}:${t.path??t.name}`)),!a.length&&(0,z.jsx)(`div`,{className:`composer-menu-heading`,children:`尚未获取命令`})]})}),(0,z.jsx)(W,{id:`session-model`,label:`模型`,current:e.config.model??``,options:O,disabled:m,onSelect:n=>{let r=t.find(e=>e.id===n);l({...e.config,model:n||null,..._?{options:{}}:{},effort:e.config.effort&&r?.efforts.includes(e.config.effort)?e.config.effort:null})}}),(!_&&!v&&e.provider!==`opencode`||(p?.efforts.length??0)>0||!!e.config.effort)&&(0,z.jsx)(W,{id:`session-effort`,label:x,current:e.config.effort??``,options:A,disabled:m,onSelect:t=>l({...e.config,effort:t||null})}),p?.options?.map(t=>(0,z.jsx)(W,{id:`session-option-${t.id}`,label:t.name,current:e.config.options?.[t.id]??``,options:[{value:``,label:`默认 · ${t.choices.find(e=>e.value===t.defaultValue)?.label??t.defaultValue}`},...t.choices],disabled:m,onSelect:n=>{let r={...e.config.options};n?r[t.id]=n:delete r[t.id],l({...e.config,options:r})}},t.id)),y.map(t=>(0,z.jsx)(W,{id:t.key===`mode`&&!g?`session-mode`:`session-permission`,label:t.label,current:t.key===`mode`?w??e.config.mode??t.defaultValue:e.config.permission,options:t.choices,disabled:m,onSelect:n=>l(t.key===`mode`?{...e.config,mode:n||void 0}:{...e.config,permission:n})},t.key))]})}var be=k({taskRoot:M().nullable().default(null),online:x(),computer:k({id:M(),name:M(),platform:M()}).nullable(),capabilities:w(M()),models:w(r),providers:w(u).default([]),catalogs:w(i).default([]),directories:w(f),sessions:w(p)}),xe=k({ok:x()}),Se={idle:`空闲`,working:`工作中`,waiting:`等待回答`,queued:`等待执行`,uncertain:`需要核对`,human:`人工处理`,offered:`待本地接收`,accepted:`本地已接手`,human_routed:`未送达本地`,pending:`待投递`,sent:`已发送`,succeeded:`已完成`,running:`进行中`,failed:`失败`};function Ce(){let{request:e}=j(),t=(0,L.useCallback)(t=>e(`web/local-agent-settings`,n,{signal:t}),[e]),r=_(t,3e4);return r.error?(0,z.jsx)(o,{error:!0,children:r.error}):r.data?r.data.accessible?(0,z.jsx)(G,{}):(0,z.jsx)(N,{title:`本项目暂未向你开放本地 Agent 功能`}):null}function G(){let e=j(),[t,n]=(0,L.useState)(()=>new Set),[r,i]=(0,L.useState)(()=>({project:e.projectId,directory:new URLSearchParams(location.search).get(`directory`)??``,session:new URLSearchParams(location.search).get(`session`)??``})),[u,d]=(0,L.useState)(``),[f,m]=(0,L.useState)(!1),[x,S]=(0,L.useState)(!1),[C,w]=(0,L.useState)(!1),[D,k]=(0,L.useState)(!1),[M,N]=(0,L.useState)(``),[P,re]=(0,L.useState)(``),[ie,R]=(0,L.useState)(!1),[B,le]=(0,L.useState)(`codex`),[V,fe]=(0,L.useState)(``),[pe,me]=(0,L.useState)(``),H=(0,L.useRef)(null),_e=(0,L.useRef)(!0),U=(0,L.useRef)(void 0),W=(0,L.useRef)(O()),Ce=(0,L.useCallback)(async t=>[{...await e.request(`web/local-agent-computer`,be,{signal:t}),project:e.projectId}],[e]),G=_(Ce,3e3),K=G.data?.find(e=>e.project===r.project),q=K?.directories.find(e=>e.id===r.directory);y(r.project);let J=(0,L.useCallback)((e,t,n)=>y(r.project).request(e,t,n),[r.project]),Y=ue(r.session,r.project,J),Ee=(0,L.useCallback)(e=>r.session?J(`web/local-agent-sessions/${r.session}`,A,{signal:e}):Promise.resolve(null),[J,r.session]),X=_(Ee,15e3),[De,Oe]=(0,L.useState)(),Z=De?.session.id===r.session&&(!X.data||De.cursor>=X.data.cursor)?De:X.data;(0,L.useEffect)(()=>{if(!r.session)return;let e=new EventSource(a(`/api/v1/projects/${encodeURIComponent(r.project)}/web/local-agent-sessions/${encodeURIComponent(r.session)}/events`)),t=!0;return e.addEventListener(`snapshot`,e=>{try{let n=A.parse(JSON.parse(e.data));t&&Oe(e=>e?.session.id===n.session.id&&e.cursor>n.cursor?e:n)}catch(e){d(T(e))}}),()=>{t=!1,e.close()}},[r.project,r.session]),(0,L.useEffect)(()=>{_e.current=!0},[r.project,r.session]),(0,L.useEffect)(()=>{_e.current&&H.current&&(H.current.scrollTop=H.current.scrollHeight)},[Z?.cursor,Z?.messages.length]);let Q=Z?.session,$=K?.capabilities.includes(`local-sessions-v1`),ke=(t,n,r=``)=>{i({project:t,directory:n,session:r}),w(!1),R(!1),me(``),N(``),d(``);let a=new URL(location.href);a.searchParams.set(`directory`,n),r?a.searchParams.set(`session`,r):a.searchParams.delete(`session`),t===e.projectId&&history.replaceState(null,``,a)};(0,L.useEffect)(()=>{if(!r.directory&&G.data?.[0]?.directories[0]){let e=G.data[0],t=e.directories[0],n=e.sessions.find(e=>e.id===r.session);ke(e.project,n?.directory??t.id,n?.id??t.defaultSession)}},[G.data]),(0,L.useEffect)(()=>{if(!Q)return;let e=()=>{document.visibilityState===`visible`&&J(`web/local-agent-sessions/${Q.id}/read`,xe,{method:`POST`}).catch(e=>d(T(e)))};return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[Q?.id,Z?.messages.at(-1)?.seq,J]);async function Ae(e){m(!0),d(``);try{await e(),await Promise.all([X.reload(),G.reload()])}catch(e){d(T(e))}finally{m(!1)}}let[je,Me]=(0,L.useState)(null);(0,L.useEffect)(()=>Me(null),[Q?.id]);let Ne=K?.catalogs.find(e=>e.provider===(Q?.provider??`codex`)&&(Q?.cwd?e.cwd===Q.cwd:e.directory===(Q?.executionDirectory??Q?.directory))),Pe=Ne?.commands??[],Fe=Ne?.models??K?.providers.find(e=>e.id===Q?.provider)?.models??(Q?.provider===`codex`?K?.models??[]:[]),Ie=!!(Fe.find(e=>e.id===(Q?.config.model??Q?.effectiveConfig?.model))??(Q?.config.model?void 0:Fe.find(e=>e.isDefault)))?.images&&!!K?.capabilities.includes(`local-agent-images-v1`),Le=new Map;for(let e of G.data??[]){let t=e.computer?.id??`unknown:${e.project}`;Le.set(t,[...Le.get(t)??[],e])}return(0,z.jsxs)(ne,{className:`computers-layout`,testId:`computers-page`,label:`本地会话`,tree:!0,navigation:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(E,{title:`电脑`,icon:`computers`,children:(0,z.jsx)(b,{id:`computer-create-menu`,triggerId:`computer-create`,label:`新建`,trigger:(0,z.jsx)(h,{name:`plus`}),className:`computer-create-menu`,routeKey:r.directory,children:e=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:!q||!$,onClick:()=>{e(),R(!0),le(q?.provider??`codex`),fe(``),S(!1),w(!1),d(``)},children:`新建会话`}),(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{e(),S(!0),R(!1),w(!1)},children:`接入目录`})]})})}),(0,z.jsx)(`div`,{className:`assistant-message-scroll computer-tree`,role:`tree`,"aria-label":`电脑与会话`,onKeyDown:oe,children:[...Le.entries()].map(([e,i])=>(0,z.jsxs)(`div`,{role:`none`,children:[(0,z.jsxs)(`div`,{className:`computer-device`,children:[(0,z.jsx)(`span`,{className:`computer-connection ${i.some(e=>e.online)?`online`:``}`,role:`img`,"aria-label":i.some(e=>e.online)?`在线`:`离线`,title:i.some(e=>e.online)?`在线`:`离线`,children:(0,z.jsx)(h,{name:`device`,size:`small`})}),(0,z.jsx)(`span`,{title:i[0].computer?.name,children:i[0].computer?.name??`已连接客户端`})]}),i.map(e=>(0,z.jsx)(`div`,{role:`none`,children:e.directories.map(i=>{let a=`${e.project}/${i.id}`,o=!t.has(a);return(0,z.jsxs)(`div`,{role:`none`,children:[(0,z.jsxs)(v,{className:`tree-item tree-folder`,role:`treeitem`,"aria-level":1,"aria-expanded":o,style:{"--tree-level":1},leading:(0,z.jsx)(`span`,{className:`tree-chevron ${o?`expanded`:``}`,children:(0,z.jsx)(h,{name:`chevron`,size:`small`})}),onClick:()=>n(e=>{let t=new Set(e);return o?t.add(a):t.delete(a),t}),children:[(0,z.jsx)(h,{name:`files`}),(0,z.jsx)(`span`,{className:`tree-name`,title:i.name,children:i.name})]}),o&&(0,z.jsx)(`div`,{role:`group`,children:e.sessions.filter(e=>e.directory===i.id).map(t=>(0,z.jsxs)(v,{className:`tree-item`,role:`treeitem`,"aria-level":2,"aria-selected":r.session===t.id&&r.project===e.project,style:{"--tree-level":2},leading:(0,z.jsx)(`span`,{className:`tree-chevron`,children:(0,z.jsx)(`span`,{className:`assistant-message-dot ${t.unread?`unread`:``}`})}),title:`${t.title} · ${l[t.provider]}`,onClick:()=>ke(e.project,i.id,t.id),children:[(0,z.jsx)(ge,{provider:t.provider}),(0,z.jsx)(`span`,{className:`tree-name`,children:t.title}),t.archived?(0,z.jsx)(`span`,{title:`已归档`,role:`img`,"aria-label":`已归档`,children:(0,z.jsx)(h,{name:`archive`,size:`small`})}):t.state!==`idle`&&(0,z.jsx)(I,{state:t.state,label:Se[t.state]??t.state})]},t.id))})]},i.id)})},e.project))]},e))}),(0,z.jsx)(o,{error:!0,children:G.error})]}),children:[x&&(0,z.jsx)(g,{id:`computer-attach`,title:`接入目录`,onClose:()=>S(!1),children:(0,z.jsxs)(`div`,{className:`stack computer-panel`,children:[(0,z.jsx)(c,{id:`computer-connect`,label:`在目标电脑连接项目`,value:`teammy connect`}),(0,z.jsx)(c,{id:`computer-register`,label:`在该电脑登记执行目录`,value:`teammy agent register --cwd .`}),(0,z.jsx)(`p`,{className:`muted`,children:`完成登记后自动显示。会话可直接在网页使用,也可连接专用群。`})]})}),q?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(F,{title:Q?(0,z.jsx)(Te,{title:Q.title,busy:f,onSave:e=>Ae(()=>J(`web/local-agent-sessions/${Q.id}/settings`,p,{method:`PUT`,body:{expectedRevision:Q.revision,title:e,config:Q.config}}))},Q.id):(0,z.jsx)(`h2`,{children:q.name}),actions:(0,z.jsxs)(z.Fragment,{children:[K?.capabilities.includes(`local-agent-diff-v1`)&&(0,z.jsx)(s,{icon:`files`,label:`查看工作目录改动`,disabled:!Q||!K.online,onClick:()=>k(!0)}),(0,z.jsx)(s,{icon:`settings`,label:`会话与目录设置`,disabled:!Q,onClick:()=>w(!0)})]})}),D&&Q&&(0,z.jsx)(se,{session:Q.id,request:J,onClose:()=>k(!1)},Q.id),!$&&(0,z.jsx)(o,{children:`升级客户端后可使用多个会话和网页对话。`}),ie&&(0,z.jsx)(g,{id:`computer-new-session`,title:`新建会话`,onClose:()=>R(!1),children:(0,z.jsxs)(`form`,{className:`computer-panel stack`,onSubmit:e=>{e.preventDefault(),Ae(async()=>{let e=await J(`web/local-agents/${q.id}/sessions`,p,{method:`POST`,body:{id:W.current,title:P,provider:B,...B!==`codex`&&V.trim()?{resumeSession:V.trim()}:{}}});W.current=O(),R(!1),re(``),ke(r.project,q.id,e.id)})},children:[(0,z.jsxs)(`label`,{children:[`会话名称`,(0,z.jsx)(`input`,{autoFocus:!0,required:!0,placeholder:`会话名称`,value:P,onChange:e=>re(e.target.value)})]}),(0,z.jsxs)(`label`,{children:[`Agent`,(0,z.jsxs)(`select`,{"aria-label":`Agent`,value:B,onChange:e=>le(e.target.value),children:[(0,z.jsx)(`option`,{value:`codex`,children:`Codex`}),(0,z.jsx)(`option`,{value:`claude`,disabled:!K?.capabilities.includes(`local-agent-providers-v1`),children:`Claude Code`}),(0,z.jsx)(`option`,{value:`cursor`,disabled:!K?.providers.some(e=>e.id===`cursor`),children:`Cursor`}),(0,z.jsx)(`option`,{value:`opencode`,disabled:!K?.providers.some(e=>e.id===`opencode`),children:`OpenCode`}),(0,z.jsx)(`option`,{value:`pi`,disabled:!K?.providers.some(e=>e.id===`pi`),children:`Pi`})]})]}),B!==`codex`&&(0,z.jsxs)(z.Fragment,{children:[K?.providers.find(e=>e.id===B)?.error&&(0,z.jsx)(o,{children:K.providers.find(e=>e.id===B).error}),(0,z.jsxs)(`details`,{children:[(0,z.jsxs)(`summary`,{children:[`继续已有 `,B===`claude`?`Claude`:l[B],` `,`会话`]}),(0,z.jsxs)(`label`,{children:[`原生会话 ID(可选)`,(0,z.jsx)(`input`,{value:V,onChange:e=>fe(e.target.value),placeholder:`留空创建新会话`})]}),(0,z.jsx)(`small`,{className:`muted`,children:`仅继续此目录中已停止的会话,请先退出原终端会话。`})]})]}),(0,z.jsx)(o,{error:!0,children:u}),(0,z.jsx)(`button`,{disabled:f||!P.trim(),children:`创建`})]})}),C&&Q&&K&&(0,z.jsx)(g,{id:`computer-settings`,title:`会话与目录设置`,onClose:()=>w(!1),children:(0,z.jsx)(we,{session:Q,directory:q,entry:K,request:J,busy:f,save:Ae,code:pe,setCode:me},`${Q.id}:${Q.revision}`)}),(0,z.jsxs)(te,{ref:H,onScroll:e=>{let t=e.currentTarget;_e.current=t.scrollHeight-t.scrollTop-t.clientHeight<96},"aria-label":`本地会话记录`,children:[(0,z.jsx)(he,{messages:Z?.messages??[],imageUrl:e=>ce(r.project,Q.id,e),renderQueue:e=>(0,z.jsx)(de,{message:e,session:Q.id,request:J,refresh:X.reload}),renderQuestion:e=>(0,z.jsx)(ve,{question:e,session:Q.id,request:J,refresh:X.reload})}),!Z?.messages.length&&(0,z.jsx)(`div`,{className:`assistant-empty`,children:`在当前目录开始一段对话。`})]}),Z?.commands.filter(e=>e.state!==`succeeded`&&e.kind!==`diff`).slice(-3).map(e=>(0,z.jsxs)(`p`,{className:`computer-control-status`,role:`status`,children:[e.kind,` · `,Se[e.state]??e.state,e.error?`:${e.error}`:``]},e.id)),(0,z.jsx)(o,{error:!0,children:u||X.error||Q?.error}),Q&&(0,z.jsx)(ae,{value:M,onChange:N,label:`向本地 Agent 发送消息`,sendLabel:K?.capabilities.includes(`local-agent-queue-v1`)&&[`working`,`waiting`].includes(Q.state)?`加入队列`:`发送`,placeholder:Q.archived?`会话已归档`:`输入消息…`,disabled:Q.archived||!$,sendDisabled:f||Y.busy||Y.images.length>0&&!Ie,attachments:(0,z.jsxs)(z.Fragment,{children:[Y.preview(f),Y.images.length>0&&!Ie&&(0,z.jsx)(o,{children:`当前模型不支持图片,请切换模型或移除图片。`})]}),hasAttachments:Y.images.length>0,onFiles:Ie&&!f?e=>void Y.add(e):void 0,actions:(0,z.jsxs)(z.Fragment,{children:[Ie&&Y.picker(f||!$),(0,z.jsx)(ye,{session:Q,models:Fe,busy:f,available:!!$,online:!!K?.online,commands:Pe,controls:Ne?.controls,draft:M,onInsert:e=>{Me(e.kind===`skill`?e:null),N(`${e.prefix??(e.kind===`skill`?`$`:`/`)}${e.name} `),requestAnimationFrame(()=>document.querySelector(`.message-composer textarea`)?.focus())},onConfig:e=>{w(!1),Ae(()=>J(`web/local-agent-sessions/${Q.id}/settings`,p,{method:`PUT`,body:{expectedRevision:Q.revision,title:Q.title,config:e}}))}})]}),onSubmit:e=>{e.preventDefault();let t=M.trim();if(!t&&!Y.images.length)return;let n=Y.images.map(e=>e.id),r=je?.path&&t.startsWith(`$${je.name}`)?[{name:je.name,path:je.path}]:void 0,i=JSON.stringify({session:Q.id,body:t,skills:r,images:n});U.current?.fingerprint!==i&&(U.current={fingerprint:i,id:O()});let a=U.current;Ae(async()=>{await J(`web/local-agent-sessions/${Q.id}/messages`,ee(),{method:`POST`,body:{id:a.id,body:t,...n.length?{images:n}:{},...r?{skills:r}:{}}}),N(e=>e.trim()===t?``:e),Me(null),Y.clear(),U.current===a&&(U.current=void 0)})}})]}):(0,z.jsxs)(`div`,{className:`assistant-empty`,children:[`尚未登记本地执行目录。`,(0,z.jsx)(`button`,{onClick:()=>S(!0),children:`接入目录`})]})]})}function K({value:e,onChange:t,models:n,provider:r=`codex`,controls:i}){let a=n.find(t=>t.id===e.model);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`label`,{children:[`模型`,(0,z.jsxs)(`select`,{value:e.model??``,onChange:n=>t({...e,model:n.target.value||null,effort:null,...r===`cursor`?{options:{}}:{}}),children:[(0,z.jsx)(`option`,{value:``,children:`本机默认`}),n.map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,z.jsxs)(`label`,{children:[a?.effortLabel??`思考强度`,(0,z.jsxs)(`select`,{value:e.effort??``,onChange:n=>t({...e,effort:n.target.value||null}),children:[(0,z.jsx)(`option`,{value:``,children:`模型默认`}),a?.efforts.map(e=>(0,z.jsx)(`option`,{children:e},e))]})]}),(i??S(r)).map(n=>(0,z.jsxs)(`label`,{children:[n.label,(0,z.jsx)(`select`,{value:e[n.key]??n.defaultValue,onChange:r=>t(n.key===`mode`?{...e,mode:r.target.value||void 0}:{...e,permission:r.target.value}),children:n.choices.map(e=>(0,z.jsx)(`option`,{value:e.value,children:e.label},e.value))})]},n.key)),r===`pi`&&(0,z.jsx)(`small`,{className:`muted`,children:`遵循 Pi 原生工具和扩展权限;扩展问答仍需确认。`}),a?.options?.map(n=>(0,z.jsxs)(`label`,{children:[n.name,(0,z.jsxs)(`select`,{value:e.options?.[n.id]??``,onChange:r=>{let i={...e.options};r.target.value?i[n.id]=r.target.value:delete i[n.id],t({...e,options:i})},children:[(0,z.jsx)(`option`,{value:``,children:`模型默认`}),n.choices.map(e=>(0,z.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]},n.id))]})}function we({session:e,directory:r,entry:i,request:o,busy:s,save:l,code:u,setCode:d}){let{projectId:f}=j(),[m,h]=(0,L.useState)(r.defaults??t.parse({})),[g,_]=(0,L.useState)(r.defaultSession??e.id),[v,y]=(0,L.useState)(r.name),[b,x]=(0,L.useState)(r.responsibilities),[S,C]=(0,L.useState)(r.enabled),[w,T]=(0,L.useState)(e.executionDirectory),[E,D]=(0,L.useState)();return(0,L.useEffect)(()=>{o(`web/local-agent-settings`,n).then(D).catch(()=>{})},[o]),(0,z.jsxs)(`div`,{className:`computer-panel stack`,children:[(0,z.jsxs)(`details`,{open:!0,children:[(0,z.jsx)(`summary`,{children:`执行位置与连接`}),(0,z.jsx)(`div`,{className:`config-fields`,children:(0,z.jsxs)(`label`,{children:[`执行位置`,(0,z.jsxs)(`select`,{value:w??``,onChange:e=>T(e.target.value||null),children:[(0,z.jsx)(`option`,{value:``,children:`原登记目录`}),i.directories.filter(e=>e.id!==r.id).map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})}),e.cwd&&(0,z.jsxs)(`p`,{className:`computer-paths`,children:[`当前执行路径:`,(0,z.jsx)(`code`,{children:e.cwd})]}),(0,z.jsx)(`button`,{disabled:s,onClick:()=>void l(()=>o(`web/local-agent-sessions/${e.id}/settings`,p,{method:`PUT`,body:{expectedRevision:e.revision,title:e.title,config:e.config,executionDirectory:w}})),children:`保存执行位置`}),(0,z.jsx)(`button`,{disabled:s||e.bound,onClick:()=>void l(async()=>{d((await o(`web/local-agent-bindings/codes`,k({code:M()}),{method:`POST`,body:{directory:r.id,session:e.id,expectedRevision:e.bindingRevision}})).code)}),children:e.bound?`已连接专用群`:`连接专用群`}),u&&(0,z.jsx)(c,{id:`session-binding`,label:`在目标群发送`,value:`/bind ${u}`})]}),(0,z.jsxs)(`details`,{children:[(0,z.jsx)(`summary`,{children:`目录设置与工作转交`}),(0,z.jsxs)(`div`,{className:`config-fields`,children:[(0,z.jsxs)(`label`,{children:[`目录名称`,(0,z.jsx)(`input`,{value:v,onChange:e=>y(e.target.value)})]}),(0,z.jsxs)(`label`,{children:[`职责`,(0,z.jsx)(`textarea`,{value:b,onChange:e=>x(e.target.value)})]}),(0,z.jsxs)(`label`,{children:[`默认会话`,(0,z.jsx)(`select`,{value:g,onChange:e=>_(e.target.value),children:i.sessions.filter(e=>e.directory===r.id&&!e.archived).map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.title},e.id))})]}),(0,z.jsx)(K,{value:m,onChange:h,provider:r.provider,controls:i.catalogs.find(e=>e.directory===r.id&&e.provider===r.provider)?.controls,models:i.providers.find(e=>e.id===r.provider)?.models??i.models})]}),(0,z.jsx)(`p`,{className:`muted`,children:`用于新会话与新派工。`}),(0,z.jsxs)(`label`,{className:`check-label`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:S,disabled:s,onChange:e=>C(e.target.checked)}),`允许 Tim 转交工作`]}),(0,z.jsx)(`button`,{disabled:s,onClick:()=>void l(()=>o(`web/local-agents/${r.id}/settings`,ee(),{method:`PUT`,body:{defaultSession:g,defaults:m,name:v,responsibilities:b,enabled:S,expectedRevision:r.revision}})),children:`保存目录默认设置`}),(0,z.jsx)(`p`,{children:r.available?`可接收 Tim 转交的工作`:r.reason}),E&&!E.enabled&&(0,z.jsxs)(`p`,{className:`muted`,children:[`项目尚未允许转交,请在`,(0,z.jsx)(`a`,{href:a(`/projects/${f}/settings?tab=connect`),children:`项目设置`}),`中开启。`]}),(0,z.jsx)(c,{id:`directory-intake`,label:r.enabled?`暂停 Tim 向此目录转交`:`允许 Tim 向此目录转交`,value:`teammy agent ${r.enabled?`disable`:`enable`} --id ${r.id}`})]})]})}function Te({title:e,busy:t,onSave:n}){let[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(e);return r?(0,z.jsx)(`form`,{className:`session-title-form`,onSubmit:t=>{t.preventDefault(),a.trim()&&a.trim()!==e&&n(a.trim()),i(!1)},children:(0,z.jsx)(`input`,{autoFocus:!0,"aria-label":`会话标题`,value:a,disabled:t,onChange:e=>o(e.target.value),onBlur:()=>i(!1),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),i(!1))}})}):(0,z.jsx)(`h2`,{children:(0,z.jsx)(`button`,{type:`button`,className:`session-rename`,title:`重命名会话`,"aria-label":`重命名会话:${e}`,onClick:()=>{o(e),i(!0)},children:e})})}export{Ce as Computers};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#workspace-diff{width:min(900px,100vw - 32px);max-width:calc(100vw - 32px)}.workspace-diff{grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;display:grid}.workspace-diff p{margin:0}.workspace-diff-toolbar,.workspace-diff summary{justify-content:space-between;align-items:center;gap:16px;display:flex}.workspace-diff summary{cursor:pointer;padding:10px 0;font-size:13px}.workspace-diff summary span,.workspace-diff-path{overflow-wrap:anywhere}.workspace-diff summary small{white-space:nowrap;color:var(--color-muted)}.workspace-diff pre{background:var(--color-surface);border:1px solid var(--color-line);border-radius:6px;max-height:50vh;margin:0;padding:10px;font-size:12px;line-height:1.6;overflow:auto}.workspace-diff pre span{min-width:100%;display:block}.diff-added{color:#247944;background:#2a91531f}.diff-removed{color:#ac3434;background:#be3a3a1a}.diff-hunk{color:#566e9a}.session-images{flex-wrap:wrap;gap:8px;padding:6px 0;display:flex}.session-image{position:relative}.session-image img{object-fit:cover;border:1px solid var(--color-line);border-radius:8px;width:112px;height:88px;display:block}.session-image button{background:var(--color-surface);border-radius:50%;width:24px;height:24px;padding:3px;position:absolute;top:4px;right:4px}.session-image-file{display:none}.queued-message{flex-wrap:wrap;align-items:center;gap:8px;margin-top:5px;display:flex}.queued-message-actions{gap:8px;display:flex}.queued-message-actions button{min-height:26px;padding:2px 8px;font-size:12px}.queued-message-editor{gap:8px;width:100%;display:grid}.queued-message-editor textarea{resize:vertical;width:100%;min-height:80px}.computer-messages{width:100%;max-width:820px;margin:0 auto}.computer-agent-message{overflow-wrap:anywhere;min-width:0;margin:24px 0}.computer-agent-message .markdown{font-size:var(--text-base);line-height:1.8}.computer-agent-message .markdown>:first-child{margin-top:0}.computer-agent-message .markdown>:last-child{margin-bottom:0}.computer-agent-message .markdown :is(h1,h2){font-size:18px}.computer-agent-message .markdown :is(h3,h4,h5,h6){font-size:var(--text-base)}.computer-agent-message .markdown pre{max-width:100%;overflow-x:auto}.computer-commentary{margin:20px 0}.computer-divider{color:var(--color-muted);font-size:var(--text-xs);text-align:center;align-items:center;gap:14px;margin:28px 0;line-height:1.6;display:flex}.computer-divider:before,.computer-divider:after{content:"";border-top:1px solid var(--color-line);flex:1;min-width:16px}.computer-divider>span{overflow-wrap:anywhere;max-width:80%}.computer-tool{min-width:0;color:var(--color-muted);font-size:var(--text-sm);margin:10px 0}.computer-tool>summary{cursor:pointer;align-items:center;gap:8px;min-height:32px;padding:6px 0;list-style:none;display:flex}.computer-tool>summary::-webkit-details-marker{display:none}.computer-tool>summary>.icon{flex-shrink:0;width:12px;height:12px}.computer-tool[open]>summary>.icon{transform:rotate(90deg)}.computer-tool-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.computer-tool-status{font-size:var(--text-xs);flex-shrink:0;gap:6px;display:flex}.computer-tool pre{border-left:1px solid var(--color-line);background:var(--color-soft);border-radius:0 var(--radius-sm) var(--radius-sm) 0;white-space:pre-wrap;overflow-wrap:anywhere;max-height:320px;font-size:var(--text-xs);margin:4px 0 14px 20px;padding:12px 16px;line-height:1.65;overflow:auto}.agent-logo{object-fit:contain;flex-shrink:0;width:24px;height:24px;padding:1px;display:block}.inline-reply{width:clamp(180px, var(--reply-width,180px), 600px);border:1px solid var(--color-line);border-radius:var(--radius-sm);background:0 0;align-items:flex-end;gap:4px;max-width:100%;padding:3px 6px;display:flex}.inline-reply:focus-within{border-color:var(--color-muted)}.inline-reply textarea{width:100%;min-width:0;min-height:28px;max-height:180px;font-size:var(--text-sm);resize:none;box-shadow:none;background:0 0;border:0;padding:3px 2px;line-height:22px}.inline-reply textarea:focus{box-shadow:none;outline:none}.inline-reply-send{background:0 0;border:0;flex:0 0 26px;place-items:center;width:26px;height:28px;min-height:28px;padding:3px;display:grid}.native-question{grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;display:grid}.native-question>*{min-width:0}.native-question-part{grid-template-columns:minmax(0,1fr);justify-items:start;gap:8px;min-width:0;display:grid}.native-question-part>p{color:var(--color-text);font-size:var(--text-base);margin:0}.question-options,.question-actions{flex-wrap:wrap;align-items:stretch;gap:8px;max-width:100%;display:flex}.question-options button,.question-actions>button{min-height:var(--control-height);margin:0;line-height:20px}.question-options button{text-align:left;min-width:0;max-width:100%;font-size:var(--text-sm);flex-direction:column;flex-shrink:1;justify-content:center;align-items:flex-start;gap:4px;padding:10px 12px;font-weight:500;display:flex}.question-options button[aria-pressed=true]{border-color:var(--brand-orange);background:var(--color-accent-soft);color:var(--color-link)}.question-options button small{color:var(--color-muted);font-size:var(--text-xs);white-space:normal;font-weight:400;line-height:1.6}.question-options-described{grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));width:100%;display:grid}.question-options-described button{justify-content:flex-start}.question-option-label{align-items:center;gap:8px;display:flex}.question-check{border:1px solid;border-radius:3px;flex:0 0 14px;justify-content:center;align-items:center;width:14px;height:14px;display:inline-flex}.question-check .icon{width:12px;height:12px}.question-response,.question-result{align-items:baseline;gap:6px;display:flex}.question-response span{white-space:pre-wrap;overflow-wrap:anywhere}.question-result{color:var(--color-muted);font-size:var(--text-xs)}.question-response .icon,.question-result .icon{width:12px;height:12px;color:var(--color-muted);flex-shrink:0}.native-approval-detail{white-space:pre-wrap;overflow-wrap:anywhere;max-height:320px;overflow:auto}.native-approval-options{grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,216px);display:grid}.native-approval-options button{text-align:center;align-items:center}.native-plan{border:1px solid var(--color-line);border-radius:12px;gap:16px;padding:18px 20px}.native-plan-heading{color:var(--color-muted);font-size:var(--text-sm);align-items:center;gap:8px;display:flex}.native-plan-content{overscroll-behavior:contain;scrollbar-width:thin;min-height:0;max-height:min(480px,50dvh);overflow:auto}.native-plan .markdown :is(h1,h2){font-size:var(--text-lg);margin:18px 0 10px}.native-plan .markdown>:first-child{margin-top:0}.native-plan-history summary{cursor:pointer;color:var(--color-muted)}.native-plan-history[open] summary{margin-bottom:16px}.native-plan-actions{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:1fr;width:min(100%,360px);display:grid}.native-plan-actions-expanded{grid-template-columns:repeat(2,minmax(0,1fr))}.native-plan-actions>button{min-width:0;padding:10px 8px}.native-plan-note{font-size:var(--text-xs);margin-top:-8px;line-height:1.6}.native-plan-feedback{gap:10px;display:grid}.native-plan-feedback label{font-size:var(--text-sm);gap:6px;display:grid}.native-plan-feedback textarea{width:100%;min-height:96px;font-size:var(--text-base)}.native-plan-feedback-actions{grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,280px);display:grid}.native-plan-feedback-actions>button{min-width:0;padding:10px 8px}@media (width<=600px){.native-plan{padding:12px}.native-plan-content{max-height:240px}}.composer-menu .dropdown-trigger{height:30px;min-height:30px;font-size:var(--text-xs);color:var(--color-muted);background:var(--color-soft);border-radius:18px;align-items:center;gap:4px;max-width:min(190px,100%);padding:5px 9px;display:flex}.composer-menu .dropdown-trigger>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.composer-menu .dropdown-trigger:hover,.composer-menu .dropdown-trigger[aria-expanded=true]{color:var(--color-text);background:var(--color-hover)}.composer-commands .dropdown-trigger{background:var(--color-soft);border-radius:50%;justify-content:center;width:30px;padding:6px}.composer-menu .dropdown-menu{--dropdown-max-height:45dvh;width:300px;max-width:calc(100vw - var(--sidebar-width) - 32px);max-height:45dvh;top:auto;bottom:calc(100% + 12px)}.composer-menu .dropdown-menu [role=menuitem]{font-size:var(--text-sm);justify-content:space-between;gap:12px;padding:10px}.composer-option-copy{text-align:left;flex-direction:column;gap:3px;min-width:0;display:flex}.composer-option-copy small,.composer-menu-heading small{font-size:var(--text-xs);color:var(--color-muted);font-weight:400}.composer-menu code{color:var(--color-muted);background:0 0;font-size:11px}.composer-menu-heading{font-size:var(--text-sm);justify-content:space-between;gap:12px;padding:8px 10px;display:flex}@media (width<=600px){.composer-menu .dropdown-menu{width:calc(100vw - var(--sidebar-width) - 16px);max-width:none}.composer-menu .dropdown-trigger{max-width:min(140px,100%)}}.composer-choice{flex:0 auto;min-width:0}.composer-commands{flex-shrink:0}.composer-commands .icon{width:17px;height:17px}.composer-commands .dropdown-menu{width:640px}.composer-commands .dropdown-menu [role=menuitem]{padding:8px 10px}.composer-command-row{align-items:center;gap:20px;width:100%;min-width:0;display:flex}.composer-command-name{flex:0 190px;min-width:0}.composer-command-row small{min-width:0;color:var(--color-muted);font-weight:400;font-size:var(--text-xs);flex:1}.composer-command-row>*{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}@media (width<=600px){.composer-commands .dropdown-menu{width:calc(100vw - var(--sidebar-width) - 16px)}.composer-command-name{flex-basis:42%}.composer-command-row{gap:10px}}.composer-option-copy small{text-overflow:ellipsis;white-space:nowrap;max-width:260px;overflow:hidden}@media (width<=600px){.computers-layout .message-composer-actions{flex-wrap:wrap;row-gap:8px}.computers-layout .message-composer-footer{align-items:flex-end}}.computer-panel{border-bottom:1px solid var(--color-line);max-height:55vh;padding:16px 24px;overflow:auto}.config-fields{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;padding:12px 0;display:grid}.config-fields label{flex-direction:column;gap:6px;display:flex}.computer-control-status{margin:0;padding:4px 24px;font-size:12px}@media (width<=760px){.computer-panel{padding:12px}}.computer-tree{padding:4px}.computer-device{font-size:var(--text-sm);align-items:center;gap:8px;margin:0 0 14px;font-weight:600;display:flex}.computer-device>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.computer-connection{flex-shrink:0;display:inline-flex}.computer-connection.online .icon rect{fill:var(--brand-orange);fill-opacity:.85}.computer-paths{color:var(--color-muted);font-size:var(--text-xs);overflow-wrap:anywhere;margin:8px 0;display:block}.computer-tree .tree-name{flex:1}.computer-panel{flex-shrink:0}.computers-layout dialog .computer-panel{border:0;max-height:70dvh;padding:0}.computer-create-menu .dropdown-trigger{place-items:center;width:32px;height:32px;padding:4px;display:grid}.computer-create-menu .dropdown-menu{width:180px;left:auto;right:0}.session-rename{font:inherit;font-weight:inherit;text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;border-radius:0;max-width:100%;padding:0;overflow:hidden}.session-rename:hover{color:var(--color-muted);background:0 0}.session-title-form{flex:1;min-width:0;margin-right:16px}.session-title-form input{width:100%}.computers-layout .message-composer{align-self:center;width:calc(100% - 56px);max-width:844px}@media (width<=900px){.computers-layout .message-composer{width:calc(100% - 32px)}}@media (width<=600px){.computers-layout .message-composer{width:calc(100% - 16px)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,h as t}from"./index-DiR0ePCJ.js";var n=e();function r({navigation:e,children:r,className:i=``,tree:a=!1,label:o,testId:s}){return(0,n.jsx)(t,{className:`assistant-layout conversation-layout ${i}`,"data-testid":s,navigation:(0,n.jsx)(`aside`,{className:`assistant-list ${a?`file-tree-pane`:``}`,"aria-label":`${o}列表`,children:e}),children:(0,n.jsx)(`section`,{className:`assistant-thread`,"aria-label":o,children:r})})}function i({mine:e=!1,author:t,time:r,children:i,className:a=``,ref:o,...s}){return(0,n.jsx)(`div`,{...s,ref:o,className:`assistant-bubble-row ${e?`mine`:``} ${a}`,children:(0,n.jsxs)(`div`,{className:`assistant-bubble`,children:[(0,n.jsxs)(`div`,{className:`assistant-bubble-meta`,children:[(0,n.jsx)(`span`,{children:t}),r&&(0,n.jsx)(`time`,{dateTime:r,children:new Date(r).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]}),i]})})}function a({label:e,state:t=`idle`}){return(0,n.jsx)(`span`,{className:`conversation-status state-${t}`,role:`img`,"aria-label":e,title:e})}function o({author:e,time:t,children:r}){return(0,n.jsxs)(`article`,{className:`conversation-post assistant-bubble`,children:[(0,n.jsxs)(`header`,{className:`assistant-bubble-meta`,children:[(0,n.jsx)(`strong`,{children:e}),t&&(0,n.jsx)(`time`,{dateTime:t,children:new Date(t).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}),r]})}function s({title:e,actions:t}){return(0,n.jsxs)(`header`,{className:`assistant-thread-heading`,children:[(0,n.jsx)(`div`,{className:`conversation-title`,children:e}),t]})}function c({ref:e,...t}){return(0,n.jsx)(`div`,{role:`log`,"aria-live":`polite`,...t,ref:e,className:`assistant-transcript`})}export{c as a,o as i,s as n,a as o,r,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.task-board{min-width:0}.task-board .page-header{flex-wrap:wrap;align-items:flex-start;margin-bottom:24px}.task-board .page-header>div{min-width:0}.task-board .page-header h1,.task-board .page-header p{overflow-wrap:anywhere}.task-board-toolbar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:24px;display:flex}.task-board-lanes{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));align-items:start;gap:24px;margin-bottom:32px;display:grid}.task-lane{min-width:0}.task-lane h2{font-size:var(--text-base);border-bottom:1px solid var(--color-line);align-items:center;gap:10px;padding:0 0 16px;font-weight:600;display:flex}.task-lane .count{margin-left:auto}.task-lane-content{flex-direction:column;gap:12px;padding-top:16px;display:flex}.lane-dot{border:1.5px solid var(--color-muted);border-radius:50%;width:8px;height:8px}.task-lane[data-stage=in_progress] .lane-dot{border-color:var(--brand-orange);background:var(--brand-orange)}.task-lane[data-stage=in_review] .lane-dot{border-color:var(--brand-black);background:var(--brand-black)}.task-lane[data-stage=completed] .lane-dot{border-color:var(--color-muted);background:var(--color-muted)}.task-lane-empty{font-size:var(--text-xs);color:var(--color-muted);padding:44px 0}.task-card{border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface);overflow-wrap:anywhere;min-width:0;position:relative}.task-card>.task-card-heading{border-radius:inherit;padding:16px;list-style:none;position:static}.task-age{white-space:nowrap;color:var(--color-muted);font-size:var(--text-xs);flex-shrink:0;align-items:center;gap:4px;margin-left:auto;font-weight:400;display:inline-flex}.task-age .icon{width:13px;height:13px}.task-age.stale{color:var(--brand-orange)}.task-lane-expand{min-height:32px;color:var(--color-muted);font-size:var(--text-xs);background:0 0;border:0;justify-content:center;align-items:center;gap:6px;display:flex}.task-card-heading::-webkit-details-marker{display:none}.task-card-heading:hover{background:var(--color-soft)}.task-card[open]>.task-card-heading h3{padding-right:32px}.task-card-meta{align-items:center;gap:8px;margin-top:8px;display:flex}.task-card-meta>small{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.task-confirmation{border-radius:var(--radius-sm);background:var(--color-accent-soft);color:var(--brand-orange);font-size:calc(var(--text-xs) - 1px);flex-shrink:0;align-items:center;gap:3px;padding:0 4px;font-weight:400;line-height:18px;display:inline-flex}.task-confirmation .icon{width:12px;height:12px}.task-card-confirm{flex-direction:column;align-items:flex-end;gap:8px;margin-top:16px;display:flex}.task-card-confirm button{min-height:32px;font-size:var(--text-xs);padding:4px 12px}.task-status-field legend{font-size:var(--text-sm);margin-bottom:8px;font-weight:600}.task-status-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;display:grid}.task-status-choice{cursor:pointer;position:relative}.task-status-choice input{opacity:0;width:100%;height:100%;min-height:0;cursor:inherit;position:absolute;inset:0}.task-status-choice span{border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface);min-height:36px;font-size:var(--text-sm);justify-content:center;align-items:center;font-weight:550;display:flex}.task-status-choice:hover span{background:var(--color-soft)}.task-status-choice input:checked+span{border-color:var(--brand-black);background:var(--brand-black);color:var(--color-on-dark)}.task-status-choice input:focus-visible+span{outline:2px solid var(--brand-orange);outline-offset:3px}.task-status-choice input:disabled+span{opacity:.45;cursor:default}.task-card-heading h3{font-size:var(--text-base);font-weight:650;line-height:1.55}.task-card-edit{opacity:0;pointer-events:none;position:absolute;top:10px;right:8px}.task-card[open]:hover>.task-card-edit{opacity:1;pointer-events:auto}.task-card[open]:has(:focus-visible)>.task-card-edit{opacity:1;pointer-events:auto}.task-progress{font-size:var(--text-sm);white-space:pre-wrap;line-height:1.85}.task-card small{color:var(--color-muted);font-size:var(--text-xs)}.task-card-details{padding:0 16px 16px}.task-card-details h4{font-size:var(--text-xs);margin:16px 0 4px;font-weight:600}.task-card-details p{font-size:var(--text-sm);margin:0}.task-card-sources{flex-direction:column;align-items:flex-start;gap:8px;margin:16px 0;display:flex}.task-card-sources a{text-align:left;overflow-wrap:anywhere;max-width:100%;font-size:var(--text-xs);min-height:28px;color:var(--color-muted);justify-content:flex-start;gap:8px;padding:4px 0;text-decoration:none;display:inline-flex}.task-card-sources a:hover{color:var(--color-link);text-decoration:underline}.task-mention{border-radius:var(--radius-sm);background:var(--color-accent-soft);color:inherit;padding:0 2px}button.pill-control,.pill-menu .dropdown-trigger{background:var(--color-soft);min-height:30px;color:var(--color-muted);font-size:var(--text-xs);white-space:nowrap;border:1px solid #0000;border-radius:999px;justify-content:center;align-items:center;gap:6px;padding:5px 11px;font-weight:500;line-height:18px;display:inline-flex}button.pill-control:hover,button.pill-control[aria-pressed=true],.pill-menu .dropdown-trigger:hover,.pill-menu .dropdown-trigger[aria-expanded=true]{background:var(--color-hover);color:var(--color-text)}button.pill-control[aria-pressed=true]{border-color:var(--color-line)}.pill-control>.icon,.pill-menu .dropdown-trigger>.icon{flex-shrink:0;width:14px;height:14px}.pill-menu .dropdown-menu{border-radius:var(--radius-md);width:168px;padding:5px;top:calc(100% + 6px)}.pill-menu .dropdown-menu [role=menuitem]{min-height:32px;font-size:var(--text-xs);gap:8px;padding:8px;font-weight:500}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,Et as n,F as r,G as i,H as a,I as o,J as s,K as c,R as l,Tt as u,V as d,W as f,X as p,Y as m,Z as h,g,nt as _,x as v}from"./index-DiR0ePCJ.js";import{t as y}from"./project-links-Dy6-B89_.js";import"./file-links-DnngiTbC.js";var b=u(),x=e();function S({className:e=``,...t}){return(0,x.jsx)(`button`,{type:`button`,...t,className:`pill-control ${e}`})}function C({className:e=``,...t}){return(0,x.jsx)(g,{...t,className:`pill-menu ${e}`})}var w=[{value:`time`,label:`按时间`,icon:`clock`},{value:`owner`,label:`按用户`,icon:`members`}],T=[{status:`planned`,label:`计划`},{status:`in_progress`,label:`进行中`},{status:`in_review`,label:`待验收`},{status:`completed`,label:`已完成`},{status:null,label:`未明确`}];function E({members:e,project:t,userName:a,memberId:o}){let{request:s,projectId:u}=v(),f=`teammy-board-mine:${o}:${u}`,[m,g]=(0,b.useState)(()=>{try{return localStorage.getItem(f)===`true`}catch{return!1}}),_=`teammy-board-order:${o}:${u}`,[y,E]=(0,b.useState)(()=>{try{return localStorage.getItem(_)===`owner`?`owner`:`time`}catch{return`time`}}),O=w.find(e=>e.value===y),k=(0,b.useCallback)(e=>s(`tasks`,r,{signal:e}),[s]),j=p(k,3e3,h(u,`tasks`)),[M,N]=(0,b.useState)(),[P,F]=(0,b.useState)(!1),[I,L]=(0,b.useState)(Date.now);(0,b.useEffect)(()=>{let e=setInterval(()=>L(Date.now()),6e4);return()=>clearInterval(e)},[]);let R=j.data,z=R?.tasks.filter(e=>!m||e.owner===o)??[],B=new Set(e.map(e=>e.id));return(0,x.jsxs)(`div`,{className:`task-board`,children:[(0,x.jsx)(c,{title:t?.projectName.trim()?`${t.projectName.trim()}|工作看板`:`工作看板`,description:t?.description.trim()||``,children:(0,x.jsx)(`a`,{className:`account-home`,"data-testid":`home-link`,href:n(`/projects`),onClick:e=>{e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),history.pushState(null,``,n(`/projects`)),window.dispatchEvent(new PopStateEvent(`popstate`)))},"aria-label":`项目主页`,"data-tooltip":`项目主页`,children:(0,x.jsx)(`strong`,{children:a})})}),(0,x.jsxs)(`div`,{className:`task-board-toolbar`,role:`group`,"aria-label":`看板筛选与排序`,children:[(0,x.jsxs)(S,{"aria-pressed":m,"data-testid":`task-board-mine`,onClick:()=>{let e=!m;g(e),F(!1);try{localStorage.setItem(f,String(e))}catch{}},children:[(0,x.jsx)(d,{name:m?`enable`:`account`,size:`small`}),`只看我的`]}),(0,x.jsx)(C,{id:`task-board-sort-menu`,triggerId:`task-board-sort`,label:`任务排序:${O.label}`,routeKey:y,trigger:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(d,{name:O.icon,size:`small`}),(0,x.jsx)(`span`,{children:O.label}),(0,x.jsx)(d,{name:`chevronDown`,size:`small`})]}),children:e=>w.map(t=>(0,x.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-label":t.label,onClick:()=>{e(),E(t.value),F(!1);try{localStorage.setItem(_,t.value)}catch{}},children:[(0,x.jsx)(d,{name:t.icon,size:`small`}),(0,x.jsx)(`span`,{children:t.label}),y===t.value&&(0,x.jsx)(d,{name:`check`,size:`small`})]},t.value))})]}),(0,x.jsx)(i,{error:!0,children:j.error}),(0,x.jsx)(`section`,{className:`task-board-lanes`,"aria-label":`任务进度`,"data-testid":`progress-board`,children:T.filter(e=>e.status!==null||z.some(e=>e.status===null)).map(e=>{let t=z.filter(t=>t.status===e.status);t.sort((t,n)=>(y===`owner`?t.owner.localeCompare(n.owner,`en`,{numeric:!0}):0)||(e.status===`completed`?n.statusSince.localeCompare(t.statusSince):t.statusSince.localeCompare(n.statusSince))||t.id.localeCompare(n.id));let n=e.status===`completed`&&!P?t.slice(0,5):t;return(0,x.jsxs)(`section`,{className:`task-lane`,"aria-label":e.label,"data-stage":e.status??`unknown`,children:[(0,x.jsxs)(`h2`,{children:[(0,x.jsx)(`span`,{className:`lane-dot`}),e.label,(0,x.jsx)(l,{children:R?t.length:`—`})]}),(0,x.jsxs)(`div`,{className:`task-lane-content`,children:[t.length?n.map(e=>(0,x.jsx)(D,{task:e,memberIds:B,now:I,onEdit:()=>N(e),onSaved:()=>void j.reload()},e.id)):(0,x.jsx)(`p`,{className:`task-lane-empty`,children:j.error&&!R?`读取失败`:R?`暂无任务`:`读取中…`}),e.status===`completed`&&t.length>5&&(0,x.jsxs)(`button`,{type:`button`,className:`task-lane-expand`,"aria-expanded":P,onClick:()=>F(!P),children:[(0,x.jsx)(d,{name:P?`chevronUp`:`chevronDown`,size:`small`}),P?`收起`:`展开其余 ${t.length-5} 项`]})]})]},e.label)})}),M&&(0,x.jsx)(A,{task:M,onClose:()=>N(void 0),onSaved:()=>{N(void 0),j.reload()}},M.id)]})}function D({task:e,memberIds:t,onEdit:r,onSaved:c,now:l}){let{projectId:u,request:f}=v(),p=m(),[h,g]=(0,b.useState)(!1),[S,C]=(0,b.useState)(``);async function w(){if(!h){g(!0),C(``);try{await f(`tasks/${e.id}/correction`,o,{method:`PATCH`,signal:p,body:{needsConfirmation:!1,expectedRevision:e.revision}}),p.aborted||c()}catch(e){p.aborted||C(_(e))}finally{g(!1)}}}return(0,x.jsxs)(`details`,{className:`task-card`,"data-testid":`task-card`,"data-task-id":e.id,"data-owner":e.owner,"data-status":e.status??`unknown`,children:[(0,x.jsxs)(`summary`,{className:`task-card-heading`,"data-testid":`task-toggle`,children:[(0,x.jsx)(`h3`,{children:e.title}),(0,x.jsxs)(`span`,{className:`task-card-meta`,children:[(0,x.jsx)(`small`,{title:e.owner,children:e.owner}),e.needsConfirmation&&(0,x.jsxs)(`span`,{className:`task-confirmation`,"data-testid":`task-confirmation`,children:[(0,x.jsx)(d,{name:`attention`,size:`small`}),`需要确认`]}),e.status!==`completed`&&(0,x.jsx)(O,{since:e.statusSince,now:l})]})]}),(0,x.jsx)(a,{icon:`edit`,className:`task-card-edit`,label:`纠正任务:${e.title}`,"data-testid":`task-correct`,disabled:h,onClick:r}),(0,x.jsxs)(`div`,{className:`task-card-details`,children:[(0,x.jsx)(`h4`,{children:`目标`}),(0,x.jsx)(`p`,{children:e.goal?(0,x.jsx)(k,{value:e.goal,memberIds:t}):`目标未明确`}),(0,x.jsx)(`h4`,{children:`当前进展`}),(0,x.jsx)(`p`,{className:`task-progress`,children:(0,x.jsx)(k,{value:e.progress,memberIds:t})}),(0,x.jsx)(`div`,{className:`task-card-sources`,children:e.sources.map(t=>(0,x.jsxs)(`a`,{"data-testid":`task-source`,href:n(t.kind===`material`?`/projects/${u}/materials?id=${t.materialId}&revision=${t.revision}`:y(u,e.owner,t.path)),children:[(0,x.jsx)(d,{name:`file`,size:`small`}),(0,x.jsx)(`span`,{children:t.path})]},t.path))}),e.syncedAt&&(0,x.jsxs)(`small`,{children:[`资料同步于 `,(0,x.jsx)(s,{value:e.syncedAt})]}),e.needsConfirmation&&(0,x.jsxs)(`div`,{className:`task-card-confirm`,children:[(0,x.jsx)(i,{error:!0,children:S}),(0,x.jsx)(`button`,{className:`primary`,"data-testid":`task-confirm-save`,disabled:h,onClick:()=>void w(),children:h?`正在保存…`:`保存`})]})]})]})}function O({since:e,now:t}){let n=Math.max(0,t-Date.parse(e)),r=Math.floor(n/6e4),i=r<1?`刚刚`:r<60?`${r} 分钟`:r<1440?`${Math.floor(r/60)} 小时`:`${Math.floor(r/1440)} 天`;return(0,x.jsxs)(`span`,{className:`task-age${n>6048e5?` stale`:``}`,"data-testid":`task-age`,title:`进入当前状态:${new Date(e).toLocaleString(`zh-CN`)}`,"aria-label":`当前状态停留 ${i}`,children:[(0,x.jsx)(d,{name:`clock`,size:`small`}),i]})}function k({value:e,memberIds:t}){return e.split(/(@[a-z][a-z0-9_-]*)/gi).map((e,n)=>e.startsWith(`@`)&&t.has(e.slice(1))?(0,x.jsx)(`mark`,{className:`task-mention`,children:e},n):e)}function A({task:e,onClose:n,onSaved:r}){let{request:a}=v(),s=m(),[c,l]=(0,b.useState)(e.title),[u,d]=(0,b.useState)(e.status??``),[p,h]=(0,b.useState)(e.goal??``),[g,y]=(0,b.useState)(e.progress),[S,C]=(0,b.useState)(!1),[w,E]=(0,b.useState)(``),D={...c===e.title?{}:{title:c},...u===(e.status??``)?{}:{status:u||null},...p===(e.goal??``)?{}:{goal:p||null},...g===e.progress?{}:{progress:g},...e.needsConfirmation?{needsConfirmation:!1}:{}};async function O(){if(!S&&Object.keys(D).length){C(!0),E(``);try{await a(`tasks/${e.id}/correction`,o,{method:`PATCH`,signal:s,body:{...D,expectedRevision:e.revision}}),s.aborted||r()}catch(e){s.aborted||E(_(e))}finally{C(!1)}}}return(0,x.jsx)(f,{id:`task-correction`,title:`纠正任务`,onClose:n,children:(0,x.jsxs)(`form`,{className:`stack`,"aria-busy":S,onSubmit:e=>{e.preventDefault(),O()},children:[(0,x.jsx)(t,{id:`task-title`,label:`标题`,children:(0,x.jsx)(`input`,{value:c,required:!0,onChange:e=>l(e.target.value)})}),(0,x.jsxs)(`fieldset`,{className:`task-status-field`,disabled:S,children:[(0,x.jsx)(`legend`,{children:`状态`}),(0,x.jsx)(`div`,{className:`task-status-options`,"data-testid":`task-status`,children:T.filter(e=>e.status!==null).map(e=>(0,x.jsxs)(`label`,{className:`task-status-choice`,children:[(0,x.jsx)(`input`,{type:`radio`,name:`task-status`,value:e.status,checked:u===e.status,onChange:()=>d(e.status)}),(0,x.jsx)(`span`,{children:e.label})]},e.status))}),(0,x.jsx)(`small`,{children:`待验收:任务成果已提交,等待验收或最终确认。`})]}),(0,x.jsx)(t,{id:`task-goal`,label:`目标`,children:(0,x.jsx)(`textarea`,{value:p,onChange:e=>h(e.target.value)})}),(0,x.jsx)(t,{id:`task-progress`,label:`当前进展`,children:(0,x.jsx)(`textarea`,{value:g,onChange:e=>y(e.target.value)})}),(0,x.jsx)(i,{error:!0,children:w}),(0,x.jsx)(`div`,{className:`row wrap`,children:(0,x.jsx)(`button`,{type:`submit`,className:`primary`,disabled:S||!Object.keys(D).length,"data-testid":`task-correction-save`,children:`保存`})})]})})}function j({members:e,config:t,userName:n,memberId:r}){return(0,x.jsx)(E,{members:e,project:t,userName:n,memberId:r})}export{j as Dashboard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Et as t,G as n,H as r,Tt as i,V as a,X as o,Z as s,ct as c,d as l,et as u,f as d,l as f,m as p,ot as m,p as h,q as g,u as _,x as v,z as y}from"./index-DiR0ePCJ.js";import{t as b}from"./Markdown-DorC2YjE.js";import{n as x,t as S}from"./WorkspaceTree-B4FMRlCw.js";import{t as C}from"./project-links-Dy6-B89_.js";import{t as w}from"./file-links-DnngiTbC.js";import{t as T}from"./HtmlPreview-B6aQIaMB.js";var E=i(),D=e();function O(e,t){let n=t.split(`/`).slice(0,-1);return n.map((t,r)=>x(e,n.slice(0,r+1).join(`/`))).concat(x(e,``))}function k({members:e,onRefresh:i}){let{api:a,projectId:s}=v(),[g,b]=(0,E.useState)(()=>{let t=new URLSearchParams(location.search),n=t.get(`owner`),r=c.safeParse(t.get(`path`));return n&&(d(n)||e.some(e=>e.id===n))&&r.success&&!l(r.data)?{owner:n,path:r.data}:void 0}),[T,k]=(0,E.useState)(()=>new Set(g?O(g.owner,g.path):[])),[j,M]=(0,E.useState)(()=>g?{...g,kind:`file`}:void 0),[N,P]=(0,E.useState)(0),[F,I]=(0,E.useState)(()=>{let e=new URLSearchParams(location.search);return!g&&(e.has(`owner`)||e.has(`path`))?`文件链接不完整或目标已不可用。`:``}),L=(0,E.useCallback)(async e=>{if(g)try{return{owner:g.owner,...await a.file(g.owner,g.path,void 0,e)}}catch(e){throw e instanceof u&&e.code===`FILE_NOT_FOUND`?Error(`找不到这个文件,可能已被删除或移动。`):e}},[g?.owner,g?.path,N]),R=o(L),z=R.data?.owner===g?.owner&&R.data?.file.path===g?.path?R.data:void 0;function B(e,t){let n=t.split(`/`).filter(Boolean);k(t=>{let r=new Set(t);for(let t=0;t<=n.length;t++)r.add(x(e,n.slice(0,t).join(`/`)));return r})}function V(e,n){I(``),B(e,n.split(`/`).slice(0,-1).join(`/`)),b({owner:e,path:n}),M({owner:e,path:n,kind:`file`}),history.replaceState(null,``,t(C(s,e,n)))}function H(n){if(!g)return!1;let r=w(d(g.owner)?g.path:`${g.owner}/${g.path}`,n);if(!r)return!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(`//`)&&(I(`该链接超出工作区,请在原仓库查看。`),!0);if(l(r.path))return I(`配置文件不在文件浏览中显示。`),!0;if(_(r.path))return location.assign(t(`/projects/${s}/memory`)),!0;let[i,...a]=r.path.split(`/`),o=e.some(e=>e.id===i),c=o?i:f,u=o?a.join(`/`):r.path;return I(``),r.directory?(B(c,u),M({owner:c,path:u,kind:`directory`})):c===g.owner&&u===g.path?r.anchor&&[...document.querySelectorAll(`.markdown h1,.markdown h2,.markdown h3,.markdown h4`)].find(e=>e.textContent?.trim().toLowerCase().replace(/\s+/g,`-`)===r.anchor.toLowerCase())?.scrollIntoView({block:`center`}):V(c,u),!0}return(0,D.jsx)(p,{"data-testid":`file-browser`,label:`文件资源管理器`,navigation:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(h,{title:`工作区`,icon:`files`,children:(0,D.jsx)(r,{icon:`refresh`,label:`刷新文件`,"data-testid":`files-refresh`,onClick:()=>{I(``),P(e=>e+1),i()}})}),(0,D.jsx)(S,{members:e,expanded:T,selected:j,revealed:!R.loading&&!R.error&&z?{owner:z.owner,path:z.file.path,file:z.file}:void 0,onSelect:V,onToggle:(e,t)=>{M({owner:e,path:t,kind:`directory`}),k(n=>{let r=new Set(n),i=x(e,t);return r.has(i)?r.delete(i):r.add(i),r})}},N)]}),children:(0,D.jsx)(`section`,{className:`file-detail`,"data-testid":`file-preview`,"data-owner-id":g?.owner,"data-file-path":g?.path,"aria-label":m.filePreview,children:g?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n,{error:!0,children:F||!R.loading&&R.error}),R.error&&(0,D.jsx)(`button`,{className:`file-entry-retry`,"data-testid":`files-retry`,onClick:()=>void R.reload(),children:m.retry}),R.loading?(0,D.jsx)(`p`,{className:`preview-body`,role:`status`,children:m.loading}):!R.error&&z&&(0,D.jsx)(A,{owner:z.owner,file:z.file,onLink:H},`${z.owner}:${z.file.path}:${z.file.sha256}`)]}):F?(0,D.jsx)(n,{error:!0,children:F}):(0,D.jsx)(y,{mascot:!0,title:`查看工作区文件`,description:m.pickFile})})})}function A({owner:e,file:t,onLink:i}){let{readTextBlob:c,blobUrl:l,projectId:u}=v(),[f,p]=(0,E.useState)(!1),h=t.size>524288,_=/\.(md|markdown)$/i.test(t.path),y=/\.html?$/i.test(t.path),x=(0,E.useCallback)(e=>h?Promise.resolve(void 0):c(t,e),[t.sha256,t.size,h]),S=o(x,!1,s(u,`file-body`,t.sha256));return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`header`,{className:`file-detail-header`,children:[(0,D.jsxs)(`span`,{className:`file-detail-path`,title:`${d(e)?`teamcontext`:e}/${t.path}`,children:[(0,D.jsxs)(`span`,{children:[d(e)?`teamcontext`:e,` / `]}),t.path]}),(0,D.jsxs)(g,{label:`文件操作`,children:[(_||y)&&(0,D.jsx)(r,{icon:f?`preview`:`code`,label:f?`切换为预览`:`切换为原文`,"data-testid":`file-toggle-raw`,"aria-pressed":f,onClick:()=>p(!f)}),(0,D.jsx)(`a`,{className:`icon-button`,"data-testid":`file-download`,"aria-label":m.download,title:m.download,href:l(t.sha256),download:t.path.split(`/`).at(-1),children:(0,D.jsx)(a,{name:`download`})})]})]}),h?(0,D.jsx)(`div`,{className:`empty`,children:(0,D.jsx)(`p`,{children:m.previewLarge})}):S.error?(0,D.jsxs)(`div`,{className:`preview-body`,children:[(0,D.jsx)(n,{error:!0,children:S.error}),(0,D.jsx)(`button`,{"data-testid":`file-preview-retry`,onClick:()=>void S.reload(),children:m.retry})]}):S.loading?(0,D.jsx)(`p`,{className:`preview-body`,role:`status`,children:m.loading}):(0,D.jsx)(`div`,{className:`preview-body${y&&!f?` preview-body-html`:``}`,children:y&&!f?(0,D.jsx)(T,{url:l(t.sha256),name:t.path.split(`/`).at(-1)}):_&&!f?(0,D.jsx)(`article`,{className:`markdown`,"data-testid":`file-content`,"data-format":`markdown`,children:(0,D.jsx)(b,{onLink:i,children:S.data??``})}):(0,D.jsx)(`pre`,{className:`raw`,"data-testid":`file-content`,"data-format":`text`,children:S.data})})]})}export{k as Files};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e}from"./index-DiR0ePCJ.js";var t=e();function n({url:e,name:n}){return(0,t.jsx)(`iframe`,{className:`html-preview`,title:`${n} 预览`,src:`${e}${e.includes(`?`)?`&`:`?`}view=html`,sandbox:``,referrerPolicy:`no-referrer`})}export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Tt as t,V as n}from"./index-DiR0ePCJ.js";var r=t(),i=e();function a({value:e,onChange:t,onSubmit:r,label:a,placeholder:s=`输入消息…`,disabled:c=!1,sendDisabled:l=!1,sendLabel:u=`发送`,actions:d,heading:f,inset:p=!1,plain:m=!1,attachments:h,hasAttachments:g=!1,onFiles:_}){let v=o(e),y=!c&&!l&&(!!e.trim()||g);return(0,i.jsxs)(`form`,{className:`message-composer${p?` message-composer-inset`:``}${m?` message-composer-plain`:``}`,onDragOver:e=>{_&&!c&&e.dataTransfer.types.includes(`Files`)&&e.preventDefault()},onDrop:e=>{_&&!c&&e.dataTransfer.files.length&&(e.preventDefault(),_(e.dataTransfer.files))},onSubmit:e=>{e.preventDefault(),y&&r(e)},children:[f&&(0,i.jsx)(`div`,{className:`message-composer-heading`,children:f}),h,(0,i.jsx)(`textarea`,{ref:v,value:e,onChange:e=>t(e.target.value),"aria-label":a,placeholder:s,disabled:c,onPaste:e=>{_&&!c&&e.clipboardData.files.length&&(e.preventDefault(),_(e.clipboardData.files))},rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),y&&e.currentTarget.form?.requestSubmit())}}),(0,i.jsxs)(`div`,{className:`message-composer-footer`,children:[d&&(0,i.jsx)(`div`,{className:`message-composer-actions`,children:d}),(0,i.jsx)(`button`,{type:`submit`,className:`primary message-send`,"aria-label":u,title:u,disabled:!y,children:(0,i.jsx)(n,{name:`send`,size:`small`})})]})]})}function o(e,t){let n=(0,r.useRef)(null);return(0,r.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let r=()=>{t?.(e),e.style.height=`0px`,e.style.height=`${e.scrollHeight}px`};r();let i=e.clientWidth,a=new ResizeObserver(()=>{i!==e.clientWidth&&(i=e.clientWidth,r())});return a.observe(e),()=>a.disconnect()},[e,t]),n}export{o as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.message-composer{background:var(--color-surface);border:1px solid var(--color-line);border-radius:var(--radius-lg);flex-direction:column;flex:none;align-items:stretch;gap:12px;min-width:0;margin:0 28px 28px;padding:12px;display:flex}.message-composer:focus-within{border-color:var(--color-muted)}.message-composer textarea{width:100%;min-width:0;box-shadow:none;resize:none;background:0 0;border:0;min-height:40px;max-height:min(220px,28dvh);padding:8px;line-height:24px;overflow-y:auto}.message-composer textarea:focus{box-shadow:none;outline:none}.message-composer-footer,.message-composer-actions{align-items:center;gap:8px;display:flex}.message-composer-footer{justify-content:flex-end}.message-composer-actions{flex-wrap:nowrap;gap:6px;min-width:0;margin-right:auto}.message-composer-actions .icon-button{width:32px;height:32px;min-height:32px;color:var(--color-muted);padding:7px}.message-composer-actions .icon-button:hover,.message-composer-actions .icon-button[aria-pressed=true]{color:var(--color-text);background:var(--color-soft)}.message-send{border-radius:50%;flex:0 0 32px;place-items:center;width:32px;height:32px;min-height:32px;padding:0;display:grid}.message-composer-heading input{width:100%}@media (width<=900px){.message-composer{margin:0 16px 16px}}@media (width<=600px){.message-composer{gap:4px;margin:0 8px 12px;padding:6px}}.message-composer-inset{margin:0}.message-composer-plain{background:0 0;border:0;border-radius:0;gap:16px;padding:0}.message-composer-plain .topic-title{border:0;border-bottom:1px solid var(--color-line);box-shadow:none;font-size:var(--text-lg);background:0 0;border-radius:0;padding:8px 0;font-weight:600}.message-composer-plain textarea{min-height:120px;padding:0}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,Ct as n,Dt as r,Et as i,G as a,H as o,J as s,K as c,St as l,Tt as u,V as d,W as f,X as p,Y as m,Z as h,_ as g,_t as _,at as v,bt as y,dt as b,et as x,ft as S,gt as C,ht as w,lt as T,m as E,mt as D,nt as O,ot as k,p as A,pt as j,rt as M,st as N,ut as P,vt as F,wt as I,x as L,yt as R,z as ee}from"./index-DiR0ePCJ.js";import{n as z,r as B,t as V}from"./Markdown-DorC2YjE.js";import{t as H}from"./Conversation-BBWm5w-C.js";import{i as te,r as U}from"./WorkspaceTree-B4FMRlCw.js";import{n as W}from"./project-links-Dy6-B89_.js";import{t as G}from"./HtmlPreview-B6aQIaMB.js";function K(e){return I(S,e)}var q=u(),ne=R().regex(/^R\d{6,}$/),J=F({name:R().min(1),sha256:T,size:_().int().nonnegative()}),Y=l().refine(e=>/^https?:\/\//i.test(e),`Use an HTTP or HTTPS URL.`);F({operationId:n(),title:R().trim().default(``),text:R().optional(),url:Y.optional(),originals:D(J).default([])}).strict().refine(e=>!!e.text?.trim()||!!e.url||e.originals.length>0,`Provide text, a link or a file.`),F({expectedRevision:P,title:R().trim().min(1).optional(),url:Y.nullable().optional(),content:R().optional(),summary:R().optional(),sourceVersion:R().optional(),contentDate:R().optional(),originals:D(J).optional()}).strict();var X=F({id:ne,projectId:R(),title:R(),submittedBy:R(),createdAt:R(),revision:P,source:F({kind:j([`web`,`chat`,`group`]),url:R().nullable(),groupId:R().optional(),messageId:R().optional(),sourceVersion:R().optional(),contentDate:R().optional()}),originals:D(J),content:R().nullable(),summary:R().nullable(),state:j([`waiting`,`running`,`ready`,`failed`]),error:R().nullable(),url:R()}),re=F({materials:D(X),nextCursor:_().nullable()});F({query:R().trim().min(1),scope:j([`all`,`workspace`,`materials`]).default(`all`),materialId:ne.optional(),originalHash:T.optional(),after:R().default(``),limit:K().int().min(1).max(200).default(30)}).strict();var ie=F({items:D(F({key:R(),kind:j([`workspace`,`materials`]),title:R(),snippet:R(),url:R(),path:R()})),nextCursor:R().nullable()}),Z=e();function ae(e){let t=(e.content??``).trimStart().split(`
|
|
2
|
-
`);return t[0]?.replace(/^#\s+/,``).trim()===e.title.trim()&&t[0].startsWith(`# `)&&t.shift(),t.join(`
|
|
3
|
-
`).trimStart()}function oe(){let e=new URLSearchParams(location.search),t=e.get(`id`);return t?{id:t,...e.get(`original`)?{original:e.get(`original`)}:{},...e.get(`revision`)?{revision:e.get(`revision`)}:{}}:void 0}function se({active:e,onActivate:t,children:n}){let{request:s,projectId:c}=L(),[l,u]=(0,q.useState)(oe),[f,m]=(0,q.useState)(l),[_,v]=(0,q.useState)(()=>new Set(l?[l.id]:[])),[y,b]=(0,q.useState)(!1),[x,S]=(0,q.useState)(``),[C,w]=(0,q.useState)(``),[T,E]=(0,q.useState)(``),[D,k]=(0,q.useState)([]),[A,j]=(0,q.useState)(),[M,N]=(0,q.useState)(!1),[P,F]=(0,q.useState)(``),I=(0,q.useRef)(null),R=(0,q.useCallback)(e=>s(`materials`,re,{signal:e}),[s]),z=p(R,5e3,h(c,`materials`)),B=(0,q.useCallback)(e=>l?s(`materials/${encodeURIComponent(l.id)}${l.revision?`?revision=${encodeURIComponent(l.revision)}`:``}`,X,{signal:e}):Promise.resolve(null),[s,l?.id,l?.revision]),H=p(B,5e3),U=H.data?.id===l?.id?H.data:null,W=[...new Map([...D,...z.data?.materials??[],...U?[U]:[]].map(e=>[e.id,e])).values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)),G=A===void 0?z.data?.nextCursor:A;function K(e,n=``){t(),u(e),m(e),w(``),E(n),b(!1),v(t=>new Set([...t,e.id])),history.replaceState(null,``,i(`/projects/${c}/materials?${new URLSearchParams({...e})}`))}(0,q.useEffect)(()=>{let e=()=>{if(!r().endsWith(`/materials`))return;let e=oe();u(e),m(e),w(``),S(``),E(``),b(!1),e&&v(t=>new Set([...t,e.id]))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);async function ne(){if(G&&!M){N(!0),F(``);try{let e=await s(`materials?before=${G}`,re);k(t=>[...t,...e.materials]),j(e.nextCursor)}catch(e){F(O(e))}finally{N(!1)}}}let J=W.find(e=>e.id===f?.id),Y=J?.originals.find(e=>e.sha256===f?.original)?.name??J?.title??`当前资料`;function ie(){m(void 0),E(``),I.current?.focus()}let se=(0,Z.jsx)(o,{icon:`plus`,label:`新增资料`,onClick:()=>{t(),b(!0),F(``)}});return n({tree:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(a,{error:!0,children:z.error||P}),z.data?W.length===0?(0,Z.jsx)(`p`,{className:`tree-status`,children:`暂无资料`}):(0,Z.jsx)(Z.Fragment,{children:W.map(t=>(0,Z.jsxs)(`div`,{role:`none`,children:[(0,Z.jsxs)(g,{role:`treeitem`,"aria-level":1,"aria-expanded":_.has(t.id),"aria-selected":e&&!y&&l?.id===t.id&&!l.original,className:`tree-item tree-folder`,style:{"--tree-level":1},"data-testid":`material-folder`,title:t.title,onClick:()=>{let e=_.has(t.id);K({id:t.id}),e&&v(e=>{let n=new Set(e);return n.delete(t.id),n})},leading:(0,Z.jsx)(`span`,{className:`tree-chevron ${_.has(t.id)?`expanded`:``}`,children:(0,Z.jsx)(d,{name:`chevron`,size:`small`})}),children:[(0,Z.jsx)(d,{name:`files`}),(0,Z.jsx)(`span`,{className:`tree-name`,children:t.title})]}),_.has(t.id)&&(0,Z.jsx)(`div`,{role:`group`,children:[...t.originals].sort((e,t)=>te(e.name,t.name)).map((n,r)=>(0,Z.jsxs)(g,{role:`treeitem`,"aria-level":2,"aria-selected":e&&!y&&l?.id===t.id&&l.original===n.sha256,className:`tree-item`,style:{"--tree-level":2},"data-testid":`material-original`,title:n.name,onClick:()=>K({id:t.id,original:n.sha256,...t.id===l?.id&&l.revision?{revision:l.revision}:{}}),leading:(0,Z.jsx)(`span`,{className:`tree-chevron`}),children:[(0,Z.jsx)(d,{name:`file`}),(0,Z.jsx)(`span`,{className:`tree-name`,children:n.name})]},`${n.sha256}:${r}`))})]},t.id))}):(0,Z.jsx)(`p`,{className:`tree-status`,children:`加载中…`}),G&&(0,Z.jsx)(`button`,{className:`tree-action`,disabled:M,onClick:()=>void ne(),children:M?`加载中…`:`加载更多`})]}),reader:(0,Z.jsxs)(`section`,{className:`session-reader`,"aria-label":`资料内容与搜索`,children:[(0,Z.jsx)(`div`,{className:`session-reader-content`,children:y?(0,Z.jsx)(fe,{onCancel:()=>b(!1),onSaved:e=>{K({id:e}),z.reload()}}):C?(0,Z.jsx)(ce,{query:C,scope:f,onSelect:e=>K(e,C)},`${C}/${f?.id}/${f?.original}`):l?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(a,{error:!0,children:H.error}),U?l.original?(0,Z.jsx)(le,{material:U,hash:l.original,highlight:T},`${U.id}:${l.original}`):(0,Z.jsxs)(`article`,{className:`material-body`,children:[(0,Z.jsx)(`h1`,{children:U.title}),l.revision&&(0,Z.jsx)(`button`,{className:`material-link`,onClick:()=>K({id:l.id}),children:`查看最新内容`}),!l.revision&&(U.state===`waiting`||U.state===`running`)?(0,Z.jsx)(`p`,{className:`muted`,role:`status`,children:`正在整理…`}):null,(0,Z.jsx)(a,{error:!0,children:U.error??``}),!l.revision&&U.state===`failed`&&(0,Z.jsx)(`button`,{onClick:()=>void s(`materials/${l.id}/retry`,X,{method:`POST`}).then(()=>H.reload()).catch(e=>F(O(e))),children:`重试整理`}),U.content?(0,Z.jsx)(`div`,{className:`markdown`,children:(0,Z.jsx)(V,{highlight:T,children:ae(U)})}):(0,Z.jsx)(`p`,{className:`muted`,children:`正文尚未整理,可以先查看左侧原件。`})]}):(0,Z.jsx)(`p`,{role:`status`,children:`加载中…`})]}):(0,Z.jsx)(ee,{mascot:!0,title:`选择资料开始阅读`,description:`也可以在下方搜索资料内容。`})}),!y&&(0,Z.jsxs)(`form`,{className:`session-search-dock`,"data-testid":`material-search-form`,onSubmit:e=>{e.preventDefault(),w(x.trim()),E(``)},children:[f&&(0,Z.jsxs)(`button`,{type:`button`,className:`search-scope-chip`,title:`清除搜索范围`,"aria-label":`清除范围:${Y}`,onClick:ie,children:[(0,Z.jsxs)(`span`,{className:`scope-label`,children:[`搜索:`,Y]}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]}),(0,Z.jsxs)(`div`,{className:`session-search-input-row`,children:[(0,Z.jsx)(`input`,{ref:I,"aria-label":`搜索资料`,placeholder:`搜索资料内容`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Backspace`&&!x&&f&&(e.preventDefault(),ie())}}),(C||x||T)&&(0,Z.jsx)(o,{icon:`close`,label:`清空搜索`,onClick:()=>{S(``),w(``),E(``),I.current?.focus()}}),(0,Z.jsx)(o,{icon:`search`,type:`submit`,label:`搜索`,disabled:!x.trim()})]})]})]}),actions:se,href:`/projects/${c}/materials${l&&!y?`?${new URLSearchParams({...l})}`:``}`})}function ce({query:e,scope:t,onSelect:n}){let{request:r}=L(),[i,o]=(0,q.useState)(``),s=(0,q.useCallback)(n=>r(`resources/search?${new URLSearchParams({query:e,scope:`materials`,after:i,...t?{materialId:t.id}:{},...t?.original?{originalHash:t.original}:{}})}`,ie,{signal:n}),[r,e,t?.id,t?.original,i]),c=p(s);return(0,Z.jsxs)(`section`,{className:`session-results stack`,"aria-label":`搜索结果`,children:[(0,Z.jsx)(a,{error:!0,children:c.error}),c.loading?(0,Z.jsx)(`p`,{role:`status`,children:`正在搜索…`}):c.data?.items.length===0?(0,Z.jsx)(`p`,{className:`empty`,children:`没有找到匹配的资料`}):c.data?.items.map(t=>(0,Z.jsxs)(`button`,{className:`session-item`,"data-testid":`material-match`,onClick:()=>{let e=new URL(t.url,location.origin).searchParams;n({id:e.get(`id`),...e.get(`original`)?{original:e.get(`original`)}:{},...e.get(`revision`)?{revision:e.get(`revision`)}:{}})},children:[(0,Z.jsx)(`strong`,{children:t.title.replace(/^R\d+ · /,``)}),(0,Z.jsx)(`span`,{className:`session-excerpt`,children:(0,Z.jsx)(z,{value:B(t.snippet,e),query:e})})]},t.key)),c.data?.nextCursor&&(0,Z.jsx)(`button`,{disabled:c.loading,onClick:()=>o(c.data.nextCursor),children:`下一页`})]})}function le({material:e,hash:t,highlight:n}){let{projectId:r}=L(),s=e.originals.find(e=>e.sha256===t),c=i(`/api/v1/projects/${r}/materials/${e.id}/originals/${t}?revision=${e.revision}`),[l,u]=(0,q.useState)(!1),f=(0,q.useCallback)(async e=>{let t=await fetch(c,{signal:e});if(!t.ok)throw Error(`原件暂时无法读取。`);let n=await t.arrayBuffer();try{let e=new TextDecoder(`utf8`,{fatal:!0}).decode(n);return e.includes(`\0`)?null:e}catch{return null}},[c]),m=p(f,!1,h(r,`material-original`,t));if(!s)return(0,Z.jsx)(a,{error:!0,children:`找不到此原件。`});let g=/\.(md|markdown)$/i.test(s.name),_=/\.html?$/i.test(s.name);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`header`,{className:`file-detail-header`,children:[(0,Z.jsx)(`span`,{className:`file-detail-path`,children:s.name}),(0,Z.jsxs)(`div`,{className:`toolbar-actions`,children:[(g||_)&&(0,Z.jsx)(o,{icon:l?`preview`:`code`,label:l?`切换为预览`:`切换为原文`,"aria-pressed":l,onClick:()=>u(!l)}),(0,Z.jsx)(`a`,{className:`icon-button`,"aria-label":`下载原件`,title:`下载原件`,href:c,download:s.name,children:(0,Z.jsx)(d,{name:`download`})})]})]}),(0,Z.jsx)(a,{error:!0,children:m.error}),m.loading?(0,Z.jsx)(`p`,{role:`status`,children:`加载中…`}):m.data===null?(0,Z.jsx)(`p`,{className:`muted`,children:`此格式请下载后查看。`}):m.data!==void 0&&(0,Z.jsx)(`div`,{className:`preview-body${_&&!l?` preview-body-html`:``}`,"data-testid":`material-original-content`,children:_&&!l?(0,Z.jsx)(G,{url:c,name:s.name}):g&&!l?(0,Z.jsx)(`article`,{className:`markdown`,children:(0,Z.jsx)(V,{highlight:n,children:m.data})}):(0,Z.jsx)(`pre`,{className:`raw`,children:(0,Z.jsx)(z,{value:m.data,query:n})})})]})}function ue(e){if(e.kind===`text`){try{if([`http:`,`https:`].includes(new URL(e.text.trim()).protocol))return`link`}catch{}return`text`}let{name:t,type:n}=e.file;return n.startsWith(`image/`)||/\.(png|jpe?g|gif|webp|svg|heic|avif)$/i.test(t)?`imageFile`:/\.(csv|tsv|xlsx?|ods)$/i.test(t)?`spreadsheetFile`:/\.(json|ya?ml|xml|html?|css|[cm]?[jt]sx?|py|go|rs|sh|sql)$/i.test(t)?`codeFile`:n.startsWith(`text/`)||/\.(pdf|docx?|odt|rtf|md|txt)$/i.test(t)?`file`:`attachment`}function Q(e){try{return new URL(e.trim()).hostname}catch{return e.trim().split(`
|
|
4
|
-
`)[0]?.slice(0,80)||`文本`}}function de(e){try{return new URL(e.trim()).href}catch{return e.trim().split(`
|
|
5
|
-
`).slice(1).join(`
|
|
6
|
-
`)}}function fe({onSaved:e,onCancel:n}){let{request:r,projectId:s}=L(),[c,l]=(0,q.useState)([]),[u,p]=(0,q.useState)(),[m,h]=(0,q.useState)(!1),[g,_]=(0,q.useState)(``),v=(0,q.useRef)(null),y=(0,q.useRef)(M()),b=(0,q.useRef)(new Map);function x(e){l(e),y.current=M(),_(``)}async function S(){h(!0),_(``);try{let t=[];for(let[e,n]of c.entries()){let r=b.current.get(n.id);if(!r){let t=n.kind===`file`?n.file.name:`${Q(n.text)}.txt`,a=await fetch(i(`/api/v1/projects/${s}/materials/uploads`),{method:`POST`,headers:{"content-type":`application/octet-stream`,"x-teammy-web":`1`},body:n.kind===`file`?n.file:new Blob([n.text],{type:`text/plain`})}),o=await a.json();if(!a.ok)throw Error(o.error?.message??`第 ${e+1} 项上传失败。`);r={name:t,sha256:o.sha256,size:o.size},b.current.set(n.id,r)}t.push(r)}let n=c.length===1&&c[0]?.kind===`text`?c[0].text.trim():``,a;try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)&&(a=e.href)}catch{}e((await r(`materials`,X,{method:`POST`,body:{operationId:y.current,originals:t,...a?{url:a}:{}}})).id)}catch(e){_(O(e))}finally{h(!1)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`form`,{className:`material-form`,onSubmit:e=>{e.preventDefault(),S()},children:[(0,Z.jsx)(`h1`,{children:`新增资料`}),(0,Z.jsx)(`p`,{className:`muted`,children:`上传附件到项目,以便于Tim进行理解`}),(0,Z.jsx)(a,{error:!0,children:g}),(0,Z.jsxs)(`fieldset`,{disabled:m,children:[(0,Z.jsxs)(`div`,{className:`attachment-grid`,children:[c.map(e=>(0,Z.jsxs)(`article`,{className:`attachment-card`,"data-testid":`attachment-card`,children:[e.kind===`text`?(0,Z.jsxs)(`button`,{type:`button`,className:`attachment-content`,"aria-label":`编辑:${Q(e.text)}`,onClick:()=>p({id:e.id,text:e.text}),children:[(0,Z.jsx)(d,{name:ue(e)}),(0,Z.jsx)(`span`,{className:`attachment-name`,children:Q(e.text)}),de(e.text)&&(0,Z.jsx)(`span`,{className:`attachment-excerpt`,children:de(e.text)})]}):(0,Z.jsxs)(`div`,{className:`attachment-content`,children:[(0,Z.jsx)(d,{name:ue(e)}),(0,Z.jsx)(`span`,{className:`attachment-name`,children:e.file.name})]}),(0,Z.jsx)(o,{className:`attachment-remove`,icon:`close`,label:`移除:${e.kind===`file`?e.file.name:Q(e.text)}`,onClick:()=>{b.current.delete(e.id),x(c.filter(t=>t.id!==e.id))}})]},e.id)),(0,Z.jsxs)(`button`,{type:`button`,className:`attachment-add`,onClick:()=>p({text:``}),children:[(0,Z.jsx)(d,{name:`addText`}),(0,Z.jsx)(`span`,{children:`添加文本/链接`})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`attachment-add`,onClick:()=>v.current?.click(),children:[(0,Z.jsx)(d,{name:`addFile`}),(0,Z.jsx)(`span`,{children:`添加文件`})]})]}),(0,Z.jsx)(`input`,{ref:v,type:`file`,multiple:!0,hidden:!0,"aria-label":`原始文件`,onChange:e=>{x([...c,...[...e.target.files??[]].map(e=>({id:M(),kind:`file`,file:e}))]),e.target.value=``}}),(0,Z.jsxs)(`div`,{className:`actions attachment-actions`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:n,children:`取消`}),(0,Z.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!c.length,children:m?`上传中…`:`提交资料`})]})]})]}),u&&(0,Z.jsx)(f,{id:`material-text-editor`,title:`添加文本/链接`,onClose:()=>p(void 0),children:(0,Z.jsxs)(`form`,{className:`stack`,onSubmit:e=>{if(e.preventDefault(),!u.text.trim())return;let t={id:u.id??M(),kind:`text`,text:u.text};b.current.delete(t.id),x(u.id?c.map(e=>e.id===u.id?t:e):[...c,t]),p(void 0)},children:[(0,Z.jsx)(t,{id:`material-attachment-text`,label:`文本或链接`,children:(0,Z.jsx)(`textarea`,{autoFocus:!0,rows:8,value:u.text,onChange:e=>p({...u,text:e.target.value}),placeholder:`粘贴文本或网页链接`})}),(0,Z.jsx)(`div`,{className:`actions`,children:(0,Z.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!u.text.trim(),children:u.id?`保存`:`添加`})})]})})]})}var pe=j([`overview`,`handoff`]),me=F({title:R().trim().min(1),summary:R().trim().min(1)}),he=F({markdown:R().trim().min(1)}),ge=me.extend({sourceRevision:P,sourceHash:T,generatedAt:R(),stale:w()}),_e=F({kind:pe,status:j([`absent`,`queued`,`running`,`succeeded`,`failed`]),available:w(),currentRevision:P,sourceRevision:P.nullable(),stale:w(),result:y([me,he]).nullable(),generatedAt:R().nullable(),error:R().nullable()}),ve=j([`claude-code`,`codex`,`cursor`,`pi`,`dsh`]),ye=F({formatVersion:C(1),adapterVersion:C(1),agent:ve,nativeId:R().min(1).max(512),cwd:R().min(1).max(4096),messages:D(F({id:R().min(1).max(1024),role:j([`user`,`assistant`]),text:R().min(1),source:R().min(1).max(1024)}).strict())}).strict().refine(e=>new Set(e.messages.map(e=>e.id)).size===e.messages.length,`Duplicate message IDs.`);F({operationId:n(),sessionKey:T,parentRevision:P,blob:N}).strict(),F({revision:P,hash:T.nullable(),cleared:w()});var be=F({owner:b,sessionKey:T,agent:ve,nativeId:R(),cwd:R(),title:R(),revision:P,updatedAt:R(),messageCount:_().int().nonnegative(),blob:N,overview:ge.optional()}),xe=F({sessions:D(be),nextCursor:P.nullable()}),Se=F({totalSessions:_().int().nonnegative(),totalMessages:_().int().nonnegative(),memberCount:_().int().nonnegative(),updatedAt:R().nullable()});F({owner:b.optional(),sessionKey:T.optional()}).strict().refine(e=>!e.sessionKey||!!e.owner,`A session scope requires an owner.`);var Ce=F({matches:D(F({owner:b,sessionKey:T,revision:P,messageId:R(),source:j([`message`,`handoff`]).default(`message`),role:j([`user`,`assistant`]),snippet:R(),title:R()})),nextCursor:P.nullable()}),we=F({owner:b,key:T,revision:P.refine(e=>e>0).optional(),messageId:R().min(1).optional(),source:j([`message`,`handoff`]).optional()});function Te(e){let t=new URLSearchParams(e);if(![`owner`,`sessionKey`,`revision`,`messageId`].some(e=>t.has(e)))return{};let n=we.safeParse({owner:t.get(`owner`),key:t.get(`sessionKey`),...t.has(`revision`)?{revision:Number(t.get(`revision`))}:{},...t.has(`messageId`)?{messageId:t.get(`messageId`)}:{},...t.has(`source`)?{source:t.get(`source`)}:{}});return n.success?{target:n.data}:{error:`对话链接不完整或已损坏。`}}function Ee({members:e,refresh:t,selected:n,onOwner:r,onSession:i,level:a=1}){let[o,s]=(0,q.useState)(()=>new Set(n?.key?[n.owner]:[])),[c,l]=(0,q.useState)(e[0]?.id??``);return(0,Z.jsx)(`div`,{role:a===1?`tree`:`group`,"aria-label":`成员对话`,"data-testid":`session-tree`,onKeyDown:a===1?U:void 0,children:[...e].sort((e,t)=>te(e.id,t.id)).map(e=>(0,Z.jsxs)(`div`,{role:`none`,children:[(0,Z.jsxs)(g,{type:`button`,role:`treeitem`,"aria-level":a,"aria-expanded":o.has(e.id),"aria-selected":n?.owner===e.id&&!n.key,className:`tree-item tree-folder`,style:{"--tree-level":a},tabIndex:c===e.id?0:-1,"data-testid":`session-owner`,"data-owner-id":e.id,onFocus:()=>l(e.id),onClick:()=>{s(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),r(e.id)},leading:(0,Z.jsx)(`span`,{className:`tree-chevron ${o.has(e.id)?`expanded`:``}`,children:(0,Z.jsx)(d,{name:`chevron`,size:`small`})}),children:[(0,Z.jsx)(d,{name:`files`}),(0,Z.jsx)(`span`,{className:`tree-name`,title:e.id,children:e.id})]}),o.has(e.id)&&(0,Z.jsx)(De,{level:a+1,owner:e.id,selected:n,onSession:i,focused:c,onFocus:l},`${e.id}/${t}`)]},e.id))})}function De({level:e,owner:t,selected:n,onSession:r,focused:i,onFocus:o}){let{request:s,projectId:c}=L(),l=(0,q.useCallback)(e=>s(`sessions?${new URLSearchParams({owner:t,limit:`50`,order:`updated`})}`,xe,{signal:e}),[t,s]),u=p(l,15e3,h(c,`session-tree`,t)),[f,m]=(0,q.useState)(),[_,y]=(0,q.useState)(!1),[b,x]=(0,q.useState)(``),S=(0,q.useRef)(null);(0,q.useEffect)(()=>()=>S.current?.abort(),[]);let C=f?f.nextCursor:u.data?.nextCursor;return(0,Z.jsxs)(`div`,{role:`group`,"aria-busy":u.loading||_,children:[(0,Z.jsx)(a,{error:!0,children:u.error||b}),u.error&&(0,Z.jsx)(`button`,{onClick:()=>void u.reload(),children:`重试`}),u.loading&&!u.data&&(0,Z.jsx)(`span`,{className:`tree-status`,role:`status`,children:`正在加载…`}),[...new Map([...f?.sessions??[],...u.data?.sessions??[]].map(e=>[e.sessionKey,e])).values()].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)||e.sessionKey.localeCompare(t.sessionKey)).map(a=>(0,Z.jsxs)(g,{type:`button`,role:`treeitem`,"aria-level":e,"aria-selected":n?.owner===t&&n.key===a.sessionKey,className:`tree-item`,style:{"--tree-level":e},tabIndex:i===`${t}/${a.sessionKey}`?0:-1,"data-testid":`session-row`,"data-owner-id":t,"data-session-key":a.sessionKey,title:v(a.title||a.nativeId),onFocus:()=>o(`${t}/${a.sessionKey}`),onClick:()=>r({owner:t,key:a.sessionKey,title:a.title||a.nativeId}),leading:(0,Z.jsx)(`span`,{className:`tree-chevron`}),children:[(0,Z.jsx)(d,{name:`sessions`}),(0,Z.jsx)(`span`,{className:`tree-name`,children:v(a.title||a.nativeId)})]},a.sessionKey)),C!=null&&(0,Z.jsx)(`button`,{className:`tree-action`,"data-testid":`session-tree-more`,disabled:_,onClick:async()=>{y(!0),x(``);let e=new AbortController;S.current=e;try{let n=await s(`sessions?${new URLSearchParams({owner:t,after:String(C),limit:`50`,order:`updated`})}`,xe,{signal:e.signal});m(e=>({sessions:[...e?.sessions??[],...n.sessions],nextCursor:n.nextCursor}))}catch(t){e.signal.aborted||x(O(t))}finally{e.signal.aborted||y(!1)}},children:`加载更多`})]})}function Oe({info:e,targeted:t=!1,highlight:n=``}){let[r,i]=(0,q.useState)(t),a=(0,q.useRef)(null);return(0,q.useEffect)(()=>{t&&a.current?.scrollIntoView({block:`center`})},[t]),(0,Z.jsxs)(`details`,{ref:a,open:r,className:`session-handoff`,onToggle:e=>i(e.currentTarget.open),children:[(0,Z.jsx)(`summary`,{children:`交接说明`}),r&&(0,Z.jsx)(ke,{info:e,revision:t?e.revision:void 0,highlight:n})]})}function ke({info:e,revision:t,highlight:n}){let{request:r}=L(),i=`sessions/${encodeURIComponent(e.owner)}/${e.sessionKey}`,o=(0,q.useCallback)(e=>r(`${i}/analysis/handoff${t===void 0?``:`?revision=${t}`}`,_e,{signal:e}),[r,i,t]),c=p(o,5e3),l=m(),[u,d]=(0,q.useState)(!1),[f,h]=(0,q.useState)(``),g=c.data,_=u||g?.status===`queued`||g?.status===`running`,v=g?.result&&`markdown`in g.result?g.result.markdown:void 0;return(0,Z.jsxs)(`div`,{className:`stack`,"data-testid":`session-handoff`,children:[(0,Z.jsx)(a,{error:!0,children:f||c.error}),c.loading&&!g&&(0,Z.jsx)(`small`,{role:`status`,children:`正在加载…`}),g&&(0,Z.jsxs)(`div`,{className:`inline-actions`,children:[g.status===`failed`&&t===void 0&&(0,Z.jsx)(`button`,{"data-testid":`session-handoff-generate`,disabled:_||!g.available,onClick:async()=>{d(!0),h(``);try{await r(`${i}/handoff`,_e,{method:`POST`,signal:l}),await c.reload()}catch(e){l.aborted||h(O(e))}finally{l.aborted||d(!1)}},children:_?`正在整理…`:`重试`}),!g.available&&(0,Z.jsx)(`small`,{children:`请先配置项目模型接入点`}),g.status===`failed`&&(0,Z.jsx)(`small`,{children:`整理未完成,可重试`}),g.available&&g.status!==`failed`&&(!v||g.stale||_)&&(0,Z.jsx)(`small`,{role:`status`,children:g.status===`running`||u?`正在整理…`:v?`对话已有新内容,等待自动更新…`:`等待自动整理…`}),g.currentRevision!==e.revision&&(0,Z.jsx)(`small`,{children:`交接说明使用最新对话;当前阅读的是历史原文`})]}),v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`small`,{children:[`基于版本 `,g.sourceRevision,` · `,(0,Z.jsx)(s,{value:g.generatedAt})]}),(0,Z.jsx)(`div`,{className:`markdown`,"data-testid":`session-handoff-body`,children:(0,Z.jsx)(V,{highlight:n,children:v})})]})]})}function Ae({members:e,active:t,onActivate:n,children:s}){let{request:c,projectId:l,api:u}=L(),d=(0,q.useCallback)(async e=>{let[t,n]=await Promise.all([c(`sessions/stats`,Se,{signal:e}),u.members(e)]);return{...t,members:n.members}},[c,u]),f=p(d,!0,h(l,`session-stats`)),[m,g]=(0,q.useState)(``),[_,y]=(0,q.useState)(``),[b,x]=(0,q.useState)(0),[S]=(0,q.useState)(()=>Te(location.search)),[C,w]=(0,q.useState)(S.target),[T,E]=(0,q.useState)(S.target),[D,O]=(0,q.useState)(S.error??``),[j,M]=(0,q.useState)(``),N=(0,q.useRef)(null),P=C?.key?C.title?`搜索对话:${v(C.title)}`:`搜索当前对话`:C?`搜索:${C.owner} 的对话内容`:``,F=()=>{w(void 0),M(``),I(),N.current?.focus()};function I(){if(!T?.messageId)return;let{messageId:e,...t}=T;E(t),history.replaceState(null,``,i(W(l,t.owner,t.key,t)))}let R=(0,q.useCallback)(e=>{w(t=>t?.owner===e.owner&&t.key===e.sessionKey&&t.title!==e.title?{...t,title:e.title}:t)},[]);(0,q.useEffect)(()=>{let e=()=>{if(!r().endsWith(`/sessions`))return;let e=Te(location.search);E(e.target),w(e.target),O(e.error??``),y(``),g(``),M(``)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let z=(e,t=``)=>{n(),E(e),w(e),y(``),M(t),O(``),history.replaceState(null,``,i(W(l,e.owner,e.key,e)))},B=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(a,{error:!0,children:f.error}),(0,Z.jsx)(Ee,{members:(f.data?.members??e).filter(e=>e.hasSessions),refresh:b,selected:t?C:void 0,level:2,onOwner:e=>{n(),w({owner:e}),E(void 0),y(``),M(``),O(``),history.replaceState(null,``,i(`/projects/${encodeURIComponent(l)}/sessions`))},onSession:z})]}),V=(0,Z.jsxs)(`section`,{className:`session-reader`,"aria-label":`对话内容与搜索`,children:[(0,Z.jsx)(A,{title:k.sessions,icon:`sessions`,count:(0,Z.jsx)(`span`,{"data-testid":`session-total`,children:f.data?.totalSessions??`—`}),children:(0,Z.jsx)(o,{icon:`refresh`,label:`刷新${k.sessions}`,"data-testid":`sessions-refresh`,disabled:f.loading,onClick:()=>{f.reload(),x(e=>e+1)}})}),(0,Z.jsx)(`div`,{className:`session-reader-content`,children:D?(0,Z.jsx)(a,{error:!0,children:D}):_?(0,Z.jsx)(je,{query:_,refresh:b,scope:{...C?{owner:C.owner}:{},...C?.key?{sessionKey:C.key}:{}},onSelect:e=>z(e,_)},`${_}/${C?.owner??``}/${C?.key??``}`):T?(0,Z.jsx)(Me,{selection:T,highlight:j,onLoaded:R,onLatest:()=>z({owner:T.owner,key:T.key})},`${T.owner}/${T.key}/${T.revision}/${T.source}/${b}`):(0,Z.jsx)(ee,{mascot:!0,title:`选择对话开始阅读`,description:`也可以在下方搜索会话库内容。`})}),(0,Z.jsxs)(`form`,{className:`session-search-dock`,"data-testid":`session-search-form`,onSubmit:e=>{e.preventDefault(),y(m.trim()),M(``),O(``),x(e=>e+1)},children:[C&&(0,Z.jsxs)(`button`,{type:`button`,className:`search-scope-chip`,"data-testid":`session-search-scope`,title:`清除搜索范围`,"aria-label":`清除范围:${P}`,onClick:F,children:[(0,Z.jsx)(`span`,{className:`scope-label`,children:P}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]}),(0,Z.jsxs)(`div`,{className:`session-search-input-row`,children:[(0,Z.jsx)(`input`,{ref:N,"aria-label":`搜索对话`,"data-testid":`session-query`,value:m,maxLength:500,placeholder:`搜索会话库内容`,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Backspace`&&!m&&C&&(e.preventDefault(),F())}}),(_||m||j)&&(0,Z.jsx)(o,{icon:`close`,label:`清空搜索`,"data-testid":`session-search-clear`,onClick:()=>{g(``),y(``),M(``),I(),N.current?.focus()}}),(0,Z.jsx)(o,{icon:`search`,type:`submit`,label:`搜索`,"data-testid":`session-search`,disabled:!m.trim()})]})]})]});return s({hasSelection:!!C,tree:B,reader:V,href:T?W(l,T.owner,T.key,T):`/projects/${l}/sessions`})}function je({query:e,refresh:t,scope:n,onSelect:r}){let{request:i}=L(),[o,s]=(0,q.useState)(0),c=(0,q.useCallback)(t=>i(`sessions/search?${new URLSearchParams({q:e,after:String(o),limit:`30`,order:`updated`,...n.owner?{owner:n.owner}:{},...n.sessionKey?{sessionKey:n.sessionKey}:{}})}`,Ce,{signal:t}),[i,e,o,t,n.owner,n.sessionKey]),l=p(c);return(0,Z.jsxs)(`section`,{className:`session-results stack`,"aria-label":`搜索结果`,"aria-busy":l.loading,children:[(0,Z.jsx)(a,{error:!0,children:l.error}),l.error&&(0,Z.jsx)(`button`,{onClick:()=>void l.reload(),children:`重试`}),l.loading&&(0,Z.jsx)(`p`,{role:`status`,children:`正在搜索…`}),!l.loading&&l.data?.matches.map(t=>(0,Z.jsxs)(`button`,{className:`session-item`,"data-testid":`session-match`,"data-message-id":t.messageId,onClick:()=>r({owner:t.owner,key:t.sessionKey,revision:t.revision,messageId:t.messageId||void 0,source:t.source,title:t.title}),children:[(0,Z.jsx)(`strong`,{children:v(t.title)}),(0,Z.jsxs)(`small`,{children:[t.owner,` ·`,` `,t.source===`handoff`?`交接说明`:t.role===`user`?`用户`:`助手`]}),(0,Z.jsx)(`span`,{className:`session-excerpt`,children:(0,Z.jsx)(z,{value:B(t.snippet,e),query:e})})]},`${t.owner}:${t.sessionKey}:${t.revision}:${t.source}:${t.messageId}`)),!l.loading&&l.data?.matches.length===0&&(0,Z.jsx)(`p`,{className:`empty`,children:`没有找到匹配的对话`}),l.data?.nextCursor!=null&&(0,Z.jsx)(`button`,{"data-testid":`sessions-next`,disabled:l.loading,onClick:()=>s(l.data.nextCursor),children:`下一页`}),o>0&&(0,Z.jsx)(`button`,{disabled:l.loading,onClick:()=>s(0),children:`返回第一页`})]})}function Me({selection:e,highlight:t,onLoaded:n,onLatest:r}){let{request:i}=L(),o=(0,q.useCallback)(async t=>{try{return await i(`sessions/${encodeURIComponent(e.owner)}/${e.key}${e.revision===void 0?``:`?revision=${e.revision}`}`,be,{signal:t})}catch(e){throw e instanceof x&&e.code===`SESSION_NOT_FOUND`?Error(`找不到这条对话或引用的版本,原链接可能已失效。`):e}},[i,e.owner,e.key,e.revision]),s=p(o,5e3);return(0,q.useEffect)(()=>{s.data&&n(s.data)},[s.data,n]),(0,Z.jsxs)(`section`,{className:`session-conversation stack`,"data-testid":`session-detail`,children:[(0,Z.jsx)(a,{error:!0,children:s.error}),s.error&&(0,Z.jsx)(`button`,{onClick:()=>void s.reload(),children:`重试`}),s.loading&&!s.data&&(0,Z.jsx)(`p`,{role:`status`,children:`正在读取对话…`}),s.data&&(0,Z.jsx)(Ne,{info:s.data,messageId:e.messageId,handoff:e.source===`handoff`,highlight:t,pinned:e.revision!==void 0,onLatest:r},s.data.blob.sha256)]})}function Ne({info:e,messageId:t,handoff:n,highlight:r,pinned:o,onLatest:c}){let{readTextBlob:l,projectId:u}=L(),d=(0,q.useCallback)(async t=>ye.parse(JSON.parse(await l(e.blob,t))),[e.blob.sha256,e.blob.size]),f=p(d),m=(0,q.useRef)(null);return(0,q.useEffect)(()=>{f.data&&t&&m.current?.scrollIntoView({block:`center`})},[f.data,t]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`header`,{className:`conversation-header`,children:[(0,Z.jsx)(`h2`,{className:`session-title`,children:v(e.title||e.nativeId)}),(0,Z.jsxs)(`p`,{children:[e.owner,` · `,e.agent,` · `,e.messageCount,` 条消息`]}),(0,Z.jsxs)(`small`,{children:[(0,Z.jsx)(s,{value:e.updatedAt}),o&&(0,Z.jsxs)(Z.Fragment,{children:[` `,`· 引用版本 `,e.revision,` ·`,` `,(0,Z.jsx)(`a`,{href:i(W(u,e.owner,e.sessionKey)),onClick:e=>{e.preventDefault(),c()},children:`查看最新`})]})]}),e.overview&&(0,Z.jsx)(`p`,{"data-testid":`session-summary`,children:e.overview.summary}),e.overview?.stale&&(0,Z.jsx)(`small`,{children:`摘要待更新`})]}),(0,Z.jsx)(Oe,{info:e,targeted:n,highlight:n?r:``}),(0,Z.jsx)(a,{error:!0,children:f.error}),f.error&&(0,Z.jsx)(`button`,{onClick:()=>void f.reload(),children:`重新读取`}),f.loading&&(0,Z.jsx)(`p`,{role:`status`,children:`正在读取对话…`}),f.data&&(0,Z.jsxs)(Z.Fragment,{children:[t&&!f.data.messages.some(e=>e.id===t)&&(0,Z.jsx)(a,{children:`该版本中找不到引用的消息,已打开对话原文。`}),(0,Z.jsx)(`div`,{className:`session-messages`,children:f.data.messages.map(e=>(0,Z.jsx)(H,{mine:e.role===`user`,author:e.role===`user`?`用户`:`助手`,className:`session-message ${e.role} ${e.id===t?`matched`:``}`,"data-testid":`session-message`,"data-message-id":e.id,ref:e.id===t?m:void 0,children:(0,Z.jsx)(`div`,{className:`markdown`,children:(0,Z.jsx)(V,{highlight:r,children:e.text})})},e.id))})]})]})}var $=R().trim().min(1),Pe=F({id:n(),text:$,state:j([`draft`,`kept`]),revision:_().int().positive(),createdAt:R(),updatedAt:R()}),Fe=F({cards:D(Pe)});F({id:n(),text:$}).strict(),F({expectedRevision:_().int().positive(),text:$.optional(),action:j([`keep`,`discard`,`delete`]).optional()}).strict().refine(e=>e.text!==void 0||e.action!==void 0,`没有需要保存的修改。`),F({text:$}).strict();function Ie(){let{request:e,projectId:t}=L(),n=(0,q.useCallback)(t=>e(`memory`,Fe,{signal:t}),[e]),r=p(n,5e3,h(t,`memory`)),[i,s]=(0,q.useState)(null),[l,u]=(0,q.useState)({}),d=(0,q.useRef)(null),f=[...r.data?.cards??[]];for(let e of Object.values(l))f.some(t=>t.id===e.id)||f.push(e);if(r.data&&!d.current&&(d.current=[...f].sort((e,t)=>Number(t.state===`kept`)-Number(e.state===`kept`)).map(e=>e.id)),d.current){let e=new Map(d.current.map((e,t)=>[e,t]));for(let t of f)e.has(t.id)||(e.set(t.id,d.current.length),d.current.push(t.id));f.sort((t,n)=>e.get(t.id)-e.get(n.id))}return(0,Z.jsxs)(`section`,{className:`memory-page`,children:[(0,Z.jsx)(c,{title:`记忆`,children:(0,Z.jsx)(o,{icon:`plus`,label:`新增记忆`,disabled:!!i,onClick:()=>s(M())})}),(0,Z.jsx)(a,{error:!0,children:r.error}),!r.data&&r.loading&&(0,Z.jsx)(`p`,{role:`status`,children:`加载中…`}),(0,Z.jsxs)(`div`,{className:`memory-cards`,children:[i&&(0,Z.jsx)(Le,{id:i,onDone:()=>s(null),reload:r.reload},i),f.map(e=>(0,Z.jsx)(Le,{id:e.id,card:e,reload:r.reload,onEditing:t=>u(n=>{let r={...n};return t?r[e.id]=e:delete r[e.id],r})},e.id))]}),r.data&&f.length===0&&!i&&(0,Z.jsx)(`p`,{className:`memory-empty`,children:`暂无记忆`})]})}function Le({id:e,card:t,reload:n,onDone:r,onEditing:i}){let{request:s}=L(),[c,l]=(0,q.useState)(!t),[u,f]=(0,q.useState)(t?.text??``),[p,m]=(0,q.useState)(t?.revision),[h,g]=(0,q.useState)(!1),[_,v]=(0,q.useState)(``),y=(0,q.useRef)(!1),b=(0,q.useRef)(!1);function x(){b.current=!1,i?.(!0),f(t?.text??``),m(t?.revision),v(``),l(!0)}function S(){b.current=!0,l(!1),v(``),i?.(!1),r?.()}async function C(a){if(!y.current){if(!a&&t&&u===t.text)l(!1),i?.(!1);else if((!a||a===`keep`)&&!$.safeParse(c?u:t?.text).success)v(`请填写记忆内容。`);else{y.current=!0,g(!0),v(``);try{t?await s(`memory/${e}`,F({saved:w()}),{method:`PATCH`,body:{expectedRevision:c?p:t.revision,...a?{action:a}:{},...c&&a!==`discard`&&a!==`delete`?{text:u}:{}}}):await s(`memory`,Pe,{method:`POST`,body:{id:e,text:u}}),l(!1),await n(),i?.(!1),r?.()}catch(e){v(O(e)),await n()}finally{y.current=!1,g(!1)}}}}return(0,Z.jsxs)(`article`,{className:`memory-card`,"data-testid":`memory-card`,"data-memory-id":e,children:[(0,Z.jsx)(`span`,{className:`memory-status ${t?.state===`kept`?`is-kept`:``}`,role:`img`,"aria-label":t?.state===`kept`?`已保留`:`待确认`,children:(0,Z.jsx)(d,{name:t?.state===`kept`?`check`:`question`})}),(0,Z.jsxs)(`div`,{className:`memory-content`,children:[c?(0,Z.jsx)(`textarea`,{autoFocus:!0,"aria-label":`记忆内容`,value:u,rows:2,disabled:h,onChange:e=>f(e.target.value),onBlur:e=>{b.current?b.current=!1:e.relatedTarget instanceof Element&&e.relatedTarget.closest(`.memory-actions`)||_||C()},onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),S()),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C()))}}):(0,Z.jsx)(`button`,{type:`button`,className:`memory-text`,"aria-label":`编辑记忆:${t?.text??``}`,onClick:x,children:t?.text}),(0,Z.jsx)(a,{error:!0,children:_})]}),(0,Z.jsxs)(`div`,{className:`memory-actions`,onMouseDown:e=>{c&&e.preventDefault()},children:[(!t||t.state===`draft`)&&(0,Z.jsx)(o,{icon:`check`,label:t?`保留记忆`:`保存记忆`,disabled:h,onClick:()=>void C(t?`keep`:void 0)}),c&&t?.state===`kept`&&(0,Z.jsx)(o,{icon:`check`,label:`保存记忆`,disabled:h,onClick:()=>void C()}),(0,Z.jsx)(o,{icon:`close`,label:t?t.state===`draft`?`舍弃记忆`:`删除记忆`:`取消新增`,disabled:h,onClick:()=>{t?C(t.state===`draft`?`discard`:`delete`):S()}})]})]})}function Re({section:e,members:t,navigate:n}){let{projectId:r}=L(),[i,a]=(0,q.useState)(e===`sessions`);(0,q.useEffect)(()=>{e===`sessions`&&a(!0)},[e]);let o=t=>{e!==t&&n(`/projects/${r}/${t}`)};return(0,Z.jsx)(se,{active:e===`materials`,onActivate:()=>o(`materials`),children:r=>(0,Z.jsx)(Ae,{members:t,active:e===`sessions`,onActivate:()=>o(`sessions`),children:t=>(0,Z.jsx)(E,{reading:!0,className:`resource-library`,"data-testid":`materials-page`,label:`资料目录`,navigation:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(A,{title:`资料`,icon:`materials`,children:r.actions}),(0,Z.jsxs)(`div`,{role:`tree`,"aria-label":`项目资料`,onKeyDown:U,style:{"--tree-level":1},children:[(0,Z.jsxs)(g,{role:`treeitem`,"aria-level":1,"aria-selected":e===`memory`,className:`tree-item tree-folder`,"data-testid":`library-memory`,leading:(0,Z.jsx)(`span`,{className:`tree-chevron`}),onClick:()=>o(`memory`),children:[(0,Z.jsx)(d,{name:`files`}),(0,Z.jsx)(`span`,{className:`tree-name`,children:`记忆`})]}),(0,Z.jsxs)(g,{role:`treeitem`,"aria-level":1,"aria-expanded":i,"aria-selected":e===`sessions`&&!t.hasSelection,className:`tree-item tree-folder`,"data-testid":`library-sessions`,leading:(0,Z.jsx)(`span`,{className:`tree-chevron ${i?`expanded`:``}`,children:(0,Z.jsx)(d,{name:`chevron`,size:`small`})}),onClick:()=>{a(!i),e!==`sessions`&&n(t.href)},children:[(0,Z.jsx)(d,{name:`files`}),(0,Z.jsx)(`span`,{className:`tree-name`,children:`会话库`})]}),(0,Z.jsx)(`div`,{hidden:!i,children:t.tree}),r.tree]})]}),children:e===`materials`?r.reader:e===`sessions`?t.reader:(0,Z.jsx)(`section`,{className:`session-reader`,"aria-label":`项目记忆`,children:(0,Z.jsx)(Ie,{})})})})})}export{Re as ResourceLibrary};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,G as t,Tt as n,V as r,X as i,Z as a,_ as o,d as s,f as c,l,nt as u,u as d,x as f}from"./index-DiR0ePCJ.js";var p=n(),m=new Intl.Collator(`zh-CN`,{numeric:!0,sensitivity:`base`});function h(e,t){return m.compare(e,t)||(e<t?-1:+(e>t))}var g=e();function _(e){let t=e.target.closest(`[role="treeitem"]`);if(!t)return;let n=[...e.currentTarget.querySelectorAll(`[role="treeitem"]`)].filter(e=>!e.closest(`[hidden]`)),r=n.indexOf(t),i=Number(t.getAttribute(`aria-level`)),a;switch(e.key){case`ArrowDown`:a=n[r+1];break;case`ArrowUp`:a=n[r-1];break;case`Home`:a=n[0];break;case`End`:a=n.at(-1);break;case`ArrowRight`:t.getAttribute(`aria-expanded`)===`false`?t.click():Number(n[r+1]?.getAttribute(`aria-level`))>i&&(a=n[r+1]);break;case`ArrowLeft`:t.getAttribute(`aria-expanded`)===`true`?t.click():a=n.slice(0,r).reverse().find(e=>Number(e.getAttribute(`aria-level`))<i);break;default:return}e.preventDefault(),a?.focus()}var v=(e,t)=>`${e}/${t}`,y=e=>({"--tree-level":e});function b({members:e,...t}){let[n,r]=(0,p.useState)(()=>`folder:${v(e.find(e=>e.hasFiles)?.id??`_project`,``)}`);return(0,g.jsx)(`div`,{role:`tree`,"aria-label":`工作区文件`,"data-testid":`workspace-tree`,onKeyDown:_,children:(0,g.jsx)(S,{owner:l,path:``,level:1,members:e.filter(e=>e.hasFiles),context:{...t,focused:n,onFocus:r}})})}function x({owner:e,path:t,level:n,context:i}){let a=i.expanded.has(v(e,t)),s=`folder:${v(e,t)}`;return(0,g.jsxs)(`div`,{role:`none`,children:[(0,g.jsxs)(o,{type:`button`,role:`treeitem`,className:`tree-item tree-folder`,style:y(n),"aria-label":t||e,"aria-level":n,"aria-expanded":a,"aria-selected":i.selected?.kind===`directory`&&i.selected.owner===e&&i.selected.path===t,tabIndex:i.focused===s?0:-1,"data-testid":`directory-row`,"data-owner-id":e,"data-directory-path":t,onFocus:()=>i.onFocus(s),onClick:()=>i.onToggle(e,t),leading:(0,g.jsx)(`span`,{className:`tree-chevron ${a?`expanded`:``}`,children:(0,g.jsx)(r,{name:`chevron`,size:`small`})}),children:[(0,g.jsx)(r,{name:`files`}),(0,g.jsx)(`span`,{className:`tree-name`,children:t.split(`/`).at(-1)||e})]}),a&&(0,g.jsx)(S,{owner:e,path:t,level:n+1,context:i})]})}function S({owner:e,path:n,level:l,context:m,members:_=[]}){let{api:b,projectId:S}=f(),C=(0,p.useCallback)(t=>b.tree(e,n,void 0,``,t),[e,n]),w=i(C,!1,a(S,`file-tree`,e,n)),[T,E]=(0,p.useState)(),[D,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(``),j=(0,p.useRef)(null);(0,p.useEffect)(()=>()=>j.current?.abort(),[]);let M=T?.revision===w.data?.revision?T:void 0,N=M?M.nextCursor:w.data?.nextCursor;async function P(){if(!N||!w.data||D)return;O(!0),A(``);let t=new AbortController;j.current=t;try{let r=await b.tree(e,n,w.data.revision,N,t.signal);t.signal.aborted||E({...r,entries:[...M?.entries??[],...r.entries]})}catch(e){t.signal.aborted||A(u(e))}finally{t.signal.aborted||O(!1)}}let F=[...(w.data?.entries??[]).filter(e=>!s(e.path)),...(M?.entries??[]).filter(e=>!s(e.path))],I=m.revealed;if(I?.owner===e&&!s(I.path)&&(!n||I.path.startsWith(n+`/`))){let e=n?I.path.slice(n.length+1):I.path,t=e.indexOf(`/`),r=t<0?I.path:[n,e.slice(0,t)].filter(Boolean).join(`/`);F.some(e=>e.path===r)||F.push(t<0?{...I.file,kind:`file`}:{kind:`directory`,path:r})}let L=[...F.filter(t=>e!==`_project`||!d(t.path)).map(t=>({...t,owner:e})),..._.map(e=>({kind:`directory`,path:``,owner:e.id}))].sort((e,t)=>e.kind===t.kind?h(e.path.split(`/`).at(-1)||e.owner,t.path.split(`/`).at(-1)||t.owner):e.kind===`directory`?-1:1);return(0,g.jsxs)(`div`,{role:`group`,"aria-label":v(c(e)?`teamcontext`:e,n),"aria-busy":w.loading||D,children:[w.loading&&(0,g.jsx)(`p`,{className:`tree-status`,role:`status`,children:`正在加载…`}),(0,g.jsx)(t,{error:!0,children:w.error||k}),w.error&&(0,g.jsx)(`button`,{className:`tree-action`,onClick:()=>void w.reload(),children:`重试`}),L.map(t=>t.kind===`directory`?(0,g.jsx)(x,{owner:t.owner,path:t.path,level:l,context:m},v(t.owner,t.path)):(0,g.jsxs)(o,{type:`button`,role:`treeitem`,className:`tree-item`,style:y(l),"aria-label":t.path,"aria-level":l,"aria-selected":m.selected?.kind===`file`&&m.selected.owner===e&&m.selected.path===t.path,tabIndex:m.focused===`file:${v(e,t.path)}`?0:-1,"data-testid":`file-row`,"data-owner-id":e,"data-file-path":t.path,onFocus:()=>m.onFocus(`file:${v(e,t.path)}`),onClick:()=>m.onSelect(e,t.path),leading:(0,g.jsx)(`span`,{className:`tree-chevron`}),children:[(0,g.jsx)(r,{name:`file`}),(0,g.jsx)(`span`,{className:`tree-name`,children:t.path.split(`/`).at(-1)})]},t.path)),N&&(0,g.jsx)(`button`,{className:`tree-action`,"data-testid":`files-load-more`,disabled:D,onClick:()=>void P(),children:D?`正在加载…`:`加载更多`})]})}export{h as i,v as n,_ as r,b as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.local-agent-members{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px 16px;display:grid}.local-agent-members .check-label{overflow-wrap:anywhere}[data-testid=nav-assistant]{position:relative}.navigation-unread{background:var(--brand-orange);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-4px}.project-activity{white-space:nowrap;min-width:0;max-width:100%;height:18px;line-height:18px;font-size:var(--text-xs);color:var(--color-muted);flex-shrink:0;align-items:center;gap:5px;margin-top:auto;font-weight:400;display:inline-flex;overflow:hidden}.project-activity-label{text-overflow:ellipsis;min-width:0;overflow:hidden}.project-activity-dot{background:currentColor;border-radius:50%;flex-shrink:0;width:6px;height:6px}.project-activity[data-state=running],.project-activity[data-state=queued]{color:var(--brand-orange)}.project-activity[data-state=failed]{color:var(--color-danger)}:root{--brand-black:#161615;--brand-orange:#fd523a;--brand-white:#fefcf5;--brand-cold-white:#fdfefe;--color-canvas:var(--brand-cold-white);--color-text:var(--brand-black);--color-muted:#747a7a;--color-surface:var(--brand-cold-white);--color-soft:#f3f5f5;--color-hover:#edf0f0;--color-line:#e0e5e5;--color-accent-soft:#fff0e8;--color-link:#ac3324;--color-danger:#a72d2d;--color-danger-soft:#fff0ec;--color-danger-line:#ebc6bd;--color-on-dark:var(--brand-cold-white);--color-rail-muted:#c6c6c0;--color-rail-hover:#30302c;--color-backdrop:#16161566;--shadow-menu:0 12px 40px #16161514;--shadow-modal:0 24px 80px #16161526;--shadow-floating:0 6px 28px #1616150a;--radius-sm:6px;--radius-md:10px;--radius-lg:16px;--font-body:-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;--font-mono:ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;--text-xs:12px;--text-sm:13px;--text-base:15px;--text-lg:17px;--text-title:28px;--text-project:38px;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:32px;--space-7:40px;--space-8:48px;--control-height:44px;--sidebar-width:72px;--page-gutter:48px;--pane-width:340px;--line:var(--color-line);--muted:var(--color-muted);font-family:var(--font-body);color:var(--color-text);background:var(--color-canvas);font-synthesis:none;font-size:var(--text-base);--lightningcss-light:initial;--lightningcss-dark: ;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;line-height:1.6}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}button,input,textarea,select{font:inherit;color:inherit}button,.button{justify-content:center;align-items:center;gap:var(--space-2);min-height:var(--control-height);border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface);font-size:var(--text-sm);cursor:pointer;flex-shrink:0;padding:9px 16px;font-weight:550;line-height:22px;text-decoration:none;transition:background-color .12s,color .12s;display:inline-flex}button:hover,.button:hover{background:var(--color-hover)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--brand-black);border-color:var(--brand-black);color:var(--color-on-dark)}button.primary:hover{background:var(--color-rail-hover)}button.danger{background:var(--color-danger);border-color:var(--color-danger);color:var(--color-on-dark)}:focus-visible{outline:2px solid var(--brand-orange);outline-offset:3px}input,select,textarea{width:100%;min-width:0;min-height:var(--control-height);border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface);padding:10px 12px}input::placeholder,textarea::placeholder{color:var(--color-muted)}textarea{resize:vertical}input:disabled,textarea:disabled{background:var(--color-soft);color:var(--color-muted)}input[type=checkbox],input[type=radio]{width:16px;height:16px;min-height:16px;accent-color:var(--brand-black);flex:0 0 16px;margin:0;padding:0}.check-field{width:fit-content;font-size:var(--text-sm);cursor:pointer;align-items:center;gap:8px;display:inline-flex}h1,h2,h3,p{margin:0}h1{font-size:var(--text-title);letter-spacing:-.7px;font-weight:750;line-height:1.35}h2{font-size:22px;font-weight:700;line-height:1.5}h3{font-size:var(--text-lg);font-weight:650}p{color:var(--color-muted);line-height:1.8}small,.muted{font-size:var(--text-sm);color:var(--color-muted)}a{color:var(--color-link);text-underline-offset:4px}code,pre{font-family:var(--font-mono)}fieldset{border:0;min-width:0;margin:0;padding:0}details>summary{cursor:pointer;font-size:var(--text-sm);padding:12px 0}details p{margin:8px 0}dt{color:var(--color-muted)}dd{overflow-wrap:anywhere;margin:0}.summary{font-size:var(--text-sm);grid-template-columns:auto 1fr;gap:8px 18px;margin:12px 0;display:grid}.brand{align-items:center;line-height:1;display:inline-flex}.brand img{width:176px;height:auto;display:block}.brand-compact img{object-fit:contain;width:42px;height:58px}.mascot{object-fit:contain;width:80px;height:112px;display:block}.icon{fill:none;stroke:currentColor;stroke-linejoin:round;stroke-linecap:round;flex-shrink:0}.stack{gap:var(--space-5);flex-direction:column;min-width:0;display:flex}.field{gap:var(--space-2);font-size:var(--text-sm);flex-direction:column;min-width:0;display:flex}.field>span{font-weight:600}.field small{font-weight:400;line-height:1.7}.row{align-items:center;gap:var(--space-2);display:flex}.wrap{flex-wrap:wrap}.actions{justify-content:flex-end;gap:var(--space-2);flex-wrap:wrap;display:flex}.form-grid{gap:var(--space-4);grid-template-columns:minmax(0,1fr) minmax(0,1fr);display:grid}.notice{border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-soft);font-size:var(--text-sm);overflow-wrap:anywhere;padding:12px 16px}.notice:empty{display:none}.notice.error{background:var(--color-danger-soft);border-color:var(--color-danger-line);color:var(--color-danger)}.repository-status-card{border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-soft);font-size:var(--text-sm);align-items:flex-start;gap:12px;padding:16px;display:flex}.repository-status-card>svg{flex:none}.repository-status-card strong{display:block}.repository-status-card p{color:var(--color-muted);margin:4px 0 0}.repository-status-card.active{background:var(--color-accent-soft);border-color:var(--color-link);color:var(--color-link)}.repository-status-card.error{background:var(--color-danger-soft);border-color:var(--color-danger-line);color:var(--color-danger)}.error-text{color:var(--color-danger);overflow-wrap:anywhere}.badge{border:1px solid var(--color-line);background:var(--color-soft);border-radius:var(--radius-sm);font-size:var(--text-xs);color:var(--color-muted);vertical-align:middle;align-items:center;padding:2px 8px;line-height:20px;display:inline-flex}.badge.warn{background:var(--color-accent-soft);color:var(--color-link)}.panel{border:1px solid var(--color-line);border-radius:var(--radius-lg);background:var(--color-surface);padding:var(--space-5);min-width:0}.panel>h2,.panel>h3{margin-bottom:var(--space-4)}.section-heading{justify-content:space-between;align-items:center;gap:var(--space-3);margin-bottom:var(--space-5);flex-wrap:wrap;display:flex}.section-heading h2{align-items:center;gap:var(--space-3);display:flex}.stack>.section-heading{margin-bottom:0}.count{color:var(--color-muted);margin-left:var(--space-2);font-variant-numeric:tabular-nums;align-items:center;font-size:.75em;font-weight:450;display:inline-flex}.avatar{background:var(--color-soft);width:48px;height:48px;color:var(--color-muted);border-radius:50%;flex-shrink:0;place-items:center;font-size:20px;font-weight:650;display:inline-grid}.avatar.small{width:32px;height:32px;font-size:var(--text-sm)}.empty{text-align:center;color:var(--color-muted);padding:48px 24px}.empty h3{margin-bottom:var(--space-2)}.empty p{font-size:var(--text-sm)}.empty-state{justify-content:center;align-items:center;gap:var(--space-3);text-align:center;padding:var(--space-8) var(--space-5);flex-direction:column;min-width:0;margin:auto;display:flex}.empty-state .mascot{margin-bottom:var(--space-4)}.empty-state>.icon{color:var(--color-muted);margin-bottom:var(--space-2)}.empty-state h3{font-size:var(--text-base);font-weight:600}.empty-state p{max-width:320px;font-size:var(--text-sm)}.icon-button{width:var(--control-height);height:var(--control-height);min-height:var(--control-height);border-radius:var(--radius-md);color:var(--color-text);background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;padding:10px;display:inline-flex;position:relative}.icon-button:hover{background:var(--color-hover)}:where(form,dialog,.task-card,.settings-section,.member-card) .icon-button{width:32px;height:32px;min-height:32px;padding:7px}:where(form,dialog,.task-card,.settings-section,.member-card) .icon-button>.icon{width:18px;height:18px}[data-tooltip]:after{content:attr(data-tooltip);z-index:50;border-radius:var(--radius-sm);background:var(--brand-black);color:var(--color-on-dark);white-space:nowrap;font-size:var(--text-xs);visibility:hidden;opacity:0;pointer-events:none;padding:5px 8px;font-weight:400;line-height:1.5;position:absolute;bottom:calc(100% + 6px);right:0}[data-tooltip]:hover:after,[data-tooltip]:focus-visible:after{visibility:visible;opacity:1}.selection-item{color:inherit;background:0 0;border:0;text-decoration:none}.selection-item:hover{background:0 0}.selection-content{min-width:0;max-width:100%;padding:8px 12px;display:inline-flex;position:relative}.selection-inner{z-index:1;align-items:center;gap:12px;min-width:0;max-width:100%;display:inline-flex;position:relative}.selection-mark{pointer-events:none;fill:none;width:100%;height:100%;stroke:var(--brand-orange);stroke-linecap:round;stroke-linejoin:round;position:absolute;inset:0;overflow:visible}.selection-mark path{stroke-dasharray:1;stroke-dashoffset:0;animation:selection-draw var(--selection-duration) var(--selection-easing) both}.selection-mark .selection-mark-tail{animation-duration:var(--selection-tail-duration);animation-delay:var(--selection-tail-delay)}@keyframes selection-draw{0%{stroke-dashoffset:1px}to{stroke-dashoffset:0}}.selection-item[data-selection-variant=inverse][data-selected=true] .selection-content{background:var(--color-on-dark);color:var(--brand-black);border-radius:var(--radius-md)}.toolbar-actions{align-items:center;gap:var(--space-3);display:flex}.sr-only{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.workspace{min-width:0;min-height:100dvh}.sidebar{z-index:30;width:var(--sidebar-width);background:var(--brand-black);color:var(--color-on-dark);scrollbar-width:none;flex-direction:column;align-items:center;padding:24px 8px;display:flex;position:fixed;inset:0 auto 0 0;overflow-y:auto}.sidebar nav{flex-direction:column;gap:12px;display:flex}.sidebar nav a{width:56px;height:68px;color:var(--color-rail-muted);justify-content:center;align-items:center;padding:0;display:flex;position:relative}.sidebar nav a:hover,.sidebar nav a[aria-current=page]{color:var(--color-on-dark)}.sidebar .selection-inner{flex-direction:column;gap:4px}.sidebar nav .icon{width:26px;height:26px}.navigation-label{font-size:var(--text-xs);font-weight:600;line-height:16px}.main-shell{margin-left:var(--sidebar-width);min-width:0}.workspace-home .main-shell{margin-left:0}.dropdown{min-width:0;position:relative}.dropdown-trigger{text-align:left;background:0 0;border:0;padding:8px 0}.dropdown-trigger:hover{background:0 0}.dropdown-menu{z-index:40;width:320px;max-width:calc(100vw - 40px);max-height:min(480px,70dvh);padding:var(--space-2);border:1px solid var(--color-line);border-radius:var(--radius-lg);background:var(--color-surface);box-shadow:var(--shadow-menu);position:absolute;top:calc(100% + 12px);left:0;overflow:auto}.dropdown-menu [role=menuitem]{justify-content:flex-start;align-items:center;gap:var(--space-3);text-align:left;border:0;width:100%;padding:12px;display:flex}.dropdown-menu [role=menuitem]:hover,.dropdown-menu [role=menuitem]:focus-visible{background:var(--color-soft)}.dropdown-menu [role=menuitem]>span{overflow-wrap:anywhere;flex:1;min-width:0}.account-menu-wrap{max-width:160px;margin-left:auto}.account-menu-wrap .dropdown-trigger,.account-home{max-width:100%;font-size:var(--text-lg)}.account-menu-wrap strong,.account-home strong{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.account-home{max-width:160px;min-height:var(--control-height);color:var(--color-text);flex-shrink:0;align-items:center;margin-left:auto;padding:8px 0;text-decoration:none;display:flex}.account-home:hover{color:var(--color-muted)}.account-menu-wrap .dropdown-menu{width:200px;left:auto;right:0}main#main{padding:48px var(--page-gutter);outline:0;min-width:0}.page-header{justify-content:space-between;align-items:center;gap:var(--space-5);margin-bottom:var(--space-6);display:flex}.page-header p{margin-top:var(--space-2);font-size:var(--text-sm)}.skip-link{z-index:100;background:var(--color-surface);padding:12px;position:fixed;top:-100px;left:12px}.skip-link:focus{top:12px}.file-explorer{height:100dvh;min-height:600px}.file-tree-pane{flex-direction:column;min-width:0;min-height:0;display:flex}.explorer-heading{justify-content:space-between;align-items:center;gap:var(--space-2);flex-shrink:0;min-height:48px;margin-bottom:32px;display:flex}.explorer-heading h1{align-items:center;gap:var(--space-3);letter-spacing:-.5px;min-width:0;font-size:26px;display:flex}[role=tree]{scrollbar-width:thin;min-height:0;padding:4px;overflow:auto}.tree-item{width:100%;min-height:40px;padding:2px 2px 2px calc((var(--tree-level) - 1) * 18px);font-size:var(--text-base);text-align:left;justify-content:flex-start;align-items:center;gap:2px;display:flex}.tree-item:focus-visible{outline-offset:-2px}.tree-item .selection-content{padding-top:5px;padding-bottom:5px}.tree-chevron{width:16px;height:24px;color:var(--color-muted);flex-shrink:0;align-items:center;display:inline-flex}.tree-chevron.expanded{transform:rotate(90deg)}.tree-name{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.tree-status{color:var(--color-muted);font-size:var(--text-xs);padding:6px 24px;display:block}.tree-action{min-height:32px;font-size:var(--text-xs);background:0 0;margin:4px 16px;padding:4px 12px}.file-detail,.session-reader{min-width:0;min-height:0;padding:48px var(--page-gutter) 32px;flex-direction:column;display:flex;overflow:hidden}.file-detail-header{justify-content:space-between;align-items:center;gap:var(--space-4);flex-shrink:0;min-height:48px;margin-bottom:32px;display:flex}.file-detail-path{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--text-base);overflow:hidden}.file-detail-path>span{color:var(--color-muted)}.file-detail>.preview-body{flex:1;min-height:0;overflow:auto}.preview-body{min-width:0;padding:0 8px 24px 0}.preview-body-html{flex:1;display:flex}.html-preview{background:0 0;border:0;flex:1;width:100%;min-width:0;min-height:400px;display:block}.file-detail>.notice{margin-bottom:var(--space-3)}.file-entry-retry{align-self:flex-start;margin:12px 0}.raw{white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--text-sm);margin:0;line-height:1.8}.markdown{overflow-wrap:anywhere;min-width:0;font-size:16px;line-height:1.85}.markdown h1{font-size:30px}.markdown h2{font-size:23px}.markdown h3{font-size:18px}.markdown h1,.markdown h2,.markdown h3{margin:28px 0 12px}.markdown>:first-child{margin-top:0}.markdown p,.markdown ul,.markdown ol{color:var(--color-text);margin:12px 0}.markdown pre{background:var(--color-soft);border-radius:var(--radius-md);font-size:var(--text-sm);padding:18px;overflow:auto}.markdown code{background:var(--color-soft);border-radius:var(--radius-sm);padding:2px 4px}.markdown pre code{padding:0}.markdown blockquote{border-left:3px solid var(--brand-orange);margin:18px 0;padding:0 18px}.markdown table{border-collapse:collapse;max-width:100%;display:block;overflow:auto}.markdown td,.markdown th{border:1px solid var(--color-line);padding:8px 12px}.markdown input[type=checkbox]{appearance:none;vertical-align:-3px;border:2px solid var(--color-line);opacity:1;background:0 0;border-radius:50%;width:18px;height:18px;min-height:0;margin:0 8px 0 0;padding:0;position:relative}.markdown .task-list-item{list-style:none}.markdown .contains-task-list{padding-left:0}.markdown input[type=checkbox]:checked{border-color:var(--brand-orange)}.markdown input[type=checkbox]:checked:after{content:"";border:solid var(--brand-orange);border-width:0 2px 2px 0;width:5px;height:9px;position:absolute;top:1px;left:4px;transform:rotate(45deg)}.session-explorer{align-items:start;height:auto;min-height:100dvh}.session-explorer>.file-tree-pane{height:100dvh;position:sticky;top:0}.session-explorer .session-reader{min-height:100dvh;overflow:visible}.session-search-dock{z-index:2;border:1px solid var(--color-line);border-radius:var(--radius-lg);background:var(--color-surface);width:min(100%,760px);box-shadow:var(--shadow-floating);flex-shrink:0;align-self:center;margin:24px 0 0;padding:10px 14px;position:sticky;bottom:24px}.session-search-input-row{align-items:center;gap:var(--space-2);display:flex}.session-search-input-row input{min-width:0;font-size:var(--text-base);background:0 0;border:0;flex:1;padding:8px 4px}.session-search-input-row input:focus{outline:0}.session-search-dock:focus-within{outline:2px solid var(--brand-orange);outline-offset:2px}.search-scope-chip{align-items:center;gap:var(--space-2);border-radius:var(--radius-sm);background:var(--color-hover);max-width:100%;height:22px;min-height:0;color:var(--color-muted);line-height:18px;font-size:var(--text-xs);text-align:left;border:0;padding:2px 6px;display:flex}.search-scope-chip .scope-label{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.search-scope-chip>span:last-child{flex-shrink:0;margin-left:auto}.session-reader-content{flex-direction:column;flex:1;min-height:0;display:flex;overflow:visible}.session-conversation{min-width:0}.conversation-header{padding-bottom:var(--space-5);border-bottom:1px solid var(--color-line)}.conversation-header p{font-size:var(--text-sm);margin-top:var(--space-2)}.session-title{overflow-wrap:anywhere;font-size:22px;line-height:1.5}.session-messages{flex-direction:column;display:flex}.session-message.matched .assistant-bubble{outline:2px solid var(--brand-orange);outline-offset:3px}.session-item{text-align:left;align-items:flex-start;gap:var(--space-2);padding:var(--space-5) 0;border:0;border-bottom:1px solid var(--color-line);background:0 0;border-radius:0;flex-direction:column;display:flex}.session-item>*{overflow-wrap:anywhere;min-width:0;max-width:100%}.session-excerpt{color:var(--color-muted);font-size:var(--text-sm);white-space:normal;font-weight:400}mark.search-highlight{color:inherit;background:linear-gradient(transparent 12%, color-mix(in srgb, var(--brand-orange) 32%, transparent) 12% 90%, transparent 90%);-webkit-box-decoration-break:clone;box-decoration-break:clone;border-radius:2px;padding:0}.management-page{max-width:1120px;margin:0 auto}.settings-layout{min-height:100dvh}.settings-navigation .page-header{min-height:48px;margin-bottom:32px}.settings-navigation h1{font-size:26px}.settings-tabs{gap:var(--space-3);flex-direction:column;display:flex}.settings-tabs[aria-orientation=horizontal]{gap:var(--space-5);flex-direction:row}.site-settings-content{padding-top:var(--space-7);margin-top:var(--space-5);border-top:1px solid var(--color-line)}.settings-tabs [role=tab]{font-size:var(--text-base);justify-content:flex-start;padding:2px 4px;font-weight:600}.settings-tabs .lucide-message-circle{transform:scale(.9)}.settings-content{min-width:0;padding:48px var(--page-gutter)}.settings-content [role=tabpanel]{min-width:0}.settings-section{padding:0 0 var(--space-6)}.settings-section+.settings-section{border-top:1px solid var(--color-line);padding-top:var(--space-6)}.settings-section>h2{margin-bottom:var(--space-5)}.settings-section form,.settings-section>.stack{max-width:800px}.member-list{min-width:0}.member-card{justify-content:space-between;align-items:center;gap:var(--space-4);border-bottom:1px solid var(--color-line);min-width:0;padding:24px 0;display:flex}.member-heading{align-items:center;gap:var(--space-5);min-width:0;display:flex}.member-heading>div{min-width:0}.member-heading h3{overflow-wrap:anywhere;font-size:19px}.member-heading small{overflow-wrap:anywhere}.member-actions{gap:var(--space-1);display:flex}.form-section-title{margin-top:var(--space-4);padding-top:var(--space-5);border-top:1px solid var(--color-line)}.application-row{gap:var(--space-4);border-bottom:1px solid var(--color-line);grid-template-columns:90px minmax(0,1fr);padding:20px 0;display:grid}.application-row:last-child{border-bottom:0;padding-bottom:0}.application-row strong{font-size:var(--text-sm);overflow-wrap:anywhere;font-weight:600}.ai-model-row{grid-template-columns:minmax(0,1fr) auto;align-items:center;padding-top:0}.ai-model-row>div{min-width:0}.ai-model-row small{overflow-wrap:anywhere;display:block}.connect-panel{gap:var(--space-4);flex-direction:column;display:flex}.connect-panel>h2{margin:0}.connect-panel p{font-size:var(--text-sm)}.command{align-items:center;gap:var(--space-2);border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-soft);padding:12px;display:flex}.command code{font-size:var(--text-sm);overflow-wrap:anywhere;white-space:pre-wrap;flex:1;min-width:0}.command button{min-height:32px;padding:6px}.scope-path{border-top:1px solid var(--color-line);font-size:var(--text-xs);overflow-wrap:anywhere;color:var(--color-muted);margin-top:20px;padding-top:16px}.model-default-row{padding:8px 0}.model-default-controls{align-items:flex-end;gap:var(--space-3);display:flex}.model-default-controls .field{flex:1;min-width:0}.model-default-controls .icon-button{margin-bottom:2px}.settings-section-actions{margin-bottom:var(--space-4);justify-content:flex-end;display:flex}.site-page{max-width:1320px;margin:0 auto}.site-brand-header{justify-content:space-between;align-items:center;gap:var(--space-5);margin-bottom:64px;display:flex}.site-page .page-header{margin-bottom:28px}.site-page .page-header h1{font-size:36px}.project-list{grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:28px;display:grid}.project-card{text-align:left;border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-canvas);flex-direction:column;align-items:flex-start;gap:24px;min-height:230px;padding:30px;display:flex;position:relative}.project-card:hover{border-color:var(--brand-orange);background:var(--color-canvas)}.project-card>span{min-width:0}.project-card strong{overflow-wrap:anywhere;font-size:22px;display:block}.project-card small{overflow-wrap:anywhere;margin-top:10px;font-weight:400;display:block}.project-card>.icon:last-child{color:var(--color-muted);position:absolute;bottom:28px;right:24px}dialog{border:1px solid var(--color-line);border-radius:var(--radius-lg);background:var(--color-canvas);width:calc(100% - 32px);max-width:520px;color:var(--color-text);box-shadow:var(--shadow-modal);max-height:85dvh;padding:0;overflow:auto}dialog::backdrop{background:var(--color-backdrop)}.dialog-content{padding:var(--space-6)}.dialog-header{margin-bottom:var(--space-5);justify-content:space-between;align-items:center;gap:var(--space-3);display:flex}.dialog-header h2{font-size:22px}.boot{gap:var(--space-5);max-width:520px;margin:100px auto;padding:24px;display:grid}.access{grid-template-columns:minmax(280px,42%) minmax(0,1fr);min-height:100dvh;display:grid}.access-aside{background:var(--color-soft);flex-direction:column;padding:40px;display:flex;position:relative;overflow:hidden}.access-art{flex:1;place-items:center;padding:48px 0;display:grid}.access-art .mascot{width:min(70%,250px);height:auto;max-height:45dvh}.access-copy{padding:16px 0 8px}.access-copy h2{letter-spacing:-1px;margin:0;font-size:30px}.access-main{justify-content:center;align-items:center;padding:56px 48px;display:flex}.access-form{gap:var(--space-5);flex-direction:column;width:100%;max-width:380px;display:flex}.access-form>p{font-size:var(--text-sm);margin-top:-10px}.wide{width:100%}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}.sidebar .selection-content{justify-content:center;align-items:center;width:100%;height:100%;padding:8px}.split-layout{grid-template-columns:var(--pane-width) minmax(0, 1fr);display:grid}@media (width<=680px){.file-explorer{grid-template-rows:auto minmax(320px,1fr);grid-template-columns:minmax(0,1fr);height:auto}.file-explorer>.file-tree-pane{border-right:0;border-bottom:1px solid var(--color-line);max-height:36dvh;padding:24px 16px}.file-explorer>.file-detail{min-height:60dvh;padding:24px 16px}}.file-tree-pane,.settings-navigation{border-right:1px solid var(--color-line);padding:48px 24px 32px 28px}main#main:is([data-page=files],[data-page=sessions],[data-page=materials],[data-page=memory],[data-page=help],[data-page=settings]){padding:0}.setup-runtime{color:var(--muted);flex-wrap:wrap;gap:8px 14px;font-size:12px;display:flex}.navigation-label{white-space:nowrap}.resource-library .memory-page{overflow:visible}@media (width<=680px){.resource-library>.file-tree-pane,.help-explorer>.file-tree-pane{height:auto;position:static}.resource-library>.session-reader,.help-explorer>.session-reader{min-height:60dvh;padding:24px 16px}}.sidebar nav{flex-shrink:0;margin-block:auto}.sidebar .project-activity{position:absolute;bottom:16px}@media (height<=720px){.sidebar{padding-block:16px}.sidebar nav{gap:8px}.sidebar .project-activity{display:none}}
|