@blueking/ai-ui-sdk 0.0.13 → 0.0.15-beta.1
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/README.md +290 -0
- package/dist/common/chart-helper.d.ts +1 -1
- package/dist/common/chart-helper.js +173 -0
- package/dist/common/util.d.ts +21 -0
- package/dist/common/util.js +143 -0
- package/dist/css/fonts/iconcool.eot +0 -0
- package/dist/css/fonts/iconcool.svg +53 -0
- package/dist/css/fonts/iconcool.ttf +0 -0
- package/dist/css/fonts/iconcool.woff +0 -0
- package/dist/css/iconcool.js +10 -0
- package/dist/css/style.css +43 -0
- package/dist/hooks/use-chat.d.ts +843 -18
- package/dist/hooks/use-chat.js +533 -0
- package/dist/hooks/use-click-proxy.js +77 -0
- package/dist/hooks/use-http.d.ts +15 -0
- package/dist/hooks/use-http.js +48 -0
- package/dist/hooks/use-reference-doc.d.ts +1 -1
- package/dist/hooks/use-reference-doc.js +185 -0
- package/dist/hooks/use-style.js +11 -0
- package/dist/hooks/use-summary.d.ts +1 -1
- package/dist/hooks/use-summary.js +55 -0
- package/dist/hooks/use-think.js +135 -0
- package/dist/http/fetch/error-interceptor.d.ts +3 -0
- package/dist/http/fetch/error-interceptor.js +6 -0
- package/dist/http/fetch/index.d.ts +25 -0
- package/dist/http/fetch/request-error.d.ts +6 -0
- package/dist/http/fetch/request-error.js +25 -0
- package/dist/http/fetch/success-interceptor.d.ts +3 -0
- package/dist/http/fetch/success-interceptor.js +92 -0
- package/dist/http/helper/knowledge.d.ts +43 -0
- package/dist/http/helper/knowledge.js +227 -0
- package/dist/http/helper/permission.d.ts +7 -0
- package/dist/http/helper/permission.js +28 -0
- package/dist/http/helper/session.d.ts +31 -0
- package/dist/http/helper/session.js +147 -0
- package/dist/http/helper/tool.d.ts +13 -0
- package/dist/http/helper/tool.js +49 -0
- package/dist/main.d.ts +12 -2
- package/dist/main.js +22 -239
- package/dist/types/enum.d.ts +36 -0
- package/dist/types/enum.js +101 -0
- package/dist/types/file.d.ts +13 -0
- package/dist/types/file.js +1 -0
- package/dist/types/knowledge.d.ts +133 -0
- package/dist/types/knowledge.js +1 -0
- package/dist/types/permission.d.ts +48 -0
- package/dist/types/permission.js +1 -0
- package/dist/types/{type.d.ts → session.d.ts} +84 -23
- package/dist/types/session.js +1 -0
- package/dist/types/tool.d.ts +60 -0
- package/dist/types/tool.js +1 -0
- package/package.json +3 -3
- package/dist/common/type-transform.d.ts +0 -7
@@ -0,0 +1,53 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3
|
+
<svg>
|
4
|
+
<metadata>
|
5
|
+
Created by font-carrier
|
6
|
+
</metadata>
|
7
|
+
<defs>
|
8
|
+
<font id="iconfont" horiz-adv-x="1024" vert-adv-y="1024" >
|
9
|
+
<font-face
|
10
|
+
|
11
|
+
font-family="iconfont"
|
12
|
+
|
13
|
+
font-weight="400"
|
14
|
+
|
15
|
+
font-stretch="normal"
|
16
|
+
|
17
|
+
units-per-em="1024"
|
18
|
+
|
19
|
+
ascent="812"
|
20
|
+
|
21
|
+
descent="-212"
|
22
|
+
|
23
|
+
/>
|
24
|
+
<missing-glyph />
|
25
|
+
|
26
|
+
|
27
|
+
<glyph glyph-name="x" unicode="x" horiz-adv-x="100"
|
28
|
+
d="M20 20 L50 20 L50 -20 Z" />
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
<glyph glyph-name="uniE103" unicode="" d="M512 444L736 220 688 172 512 348 336 172 288 220 512 444Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
33
|
+
|
34
|
+
|
35
|
+
<glyph glyph-name="uniE105" unicode="" d="M263.04 51.04A148.48 148.48 0 0 0 261.12 275.04L353.6 367.52 308.48 413.28 216 320.8A212.8 212.8 0 0 1 217.92 5.92 212.8 212.8 0 0 1 532.8 4L625.28 96.48 579.84 140 487.36 47.52A148.48 148.48 0 0 0 263.04 51.04ZM491.2 596L398.72 503.52 444.16 458.4 536.64 550.88A148.48 148.48 0 0 0 760.64 548.96 148.48 148.48 0 0 0 762.56 324.96L672 232.16 717.12 186.72 809.6 279.2A212.8 212.8 0 0 1 807.68 594.08 212.8 212.8 0 0 1 491.2 596ZM398.7857 232.1123L579.805 413.1316 625.0598 367.8768 444.0405 186.8574 398.7857 232.1123Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
36
|
+
|
37
|
+
|
38
|
+
<glyph glyph-name="uniE104" unicode="" d="M320.9863 608.6846L191.6223 608.6846C174.3738 608.6846 160 594.1825 160 576.78L160-62.7621C160-80.1646 174.3738-94.6667 191.6223-94.6667L320.9863-94.6667C338.2348-94.6667 352.6086-80.1646 352.6086-62.7621L352.6086 576.78C352.6086 594.1825 338.2348 608.6846 320.9863 608.6846ZM285.0519 478.1658L227.5568 478.1658C211.7456 478.1658 198.8092 491.2176 198.8092 507.1699 198.8092 523.1222 211.7456 536.1741 227.5568 536.1741L285.0519 536.1741C300.863 536.1741 313.7994 523.1222 313.7994 507.1699 313.7994 491.2177 300.863 478.1658 285.0519 478.1658ZM578.2769 716L448.9129 716C431.6644 716 417.2906 701.4979 417.2906 684.0954L417.2906-62.7621C417.2906-80.1646 431.6644-94.6667 448.9129-94.6667L578.2769-94.6667C595.5255-94.6667 609.8993-80.1646 609.8993-62.7621L609.8993 684.0954C611.3366 701.4979 596.9629 716 578.2769 716ZM543.7799 584.031L486.2848 584.031C470.4736 584.031 457.5372 597.0829 457.5372 613.0352 457.5372 628.9875 470.4736 642.0394 486.2848 642.0394L543.7799 642.0394C559.591 642.0394 572.5274 628.9875 572.5274 613.0352 572.5274 597.0829 559.591 584.031 543.7799 584.031ZM927.5598-29.4073L806.82 598.5331C802.5079 614.4854 789.5715 624.6369 773.7603 624.6369L768.0108 624.6369 641.5216 599.9833C624.273 597.0829 612.774 579.6804 615.6488 562.2779L737.8259-67.1127C740.7006-83.065 753.637-93.2165 769.4482-93.2165L775.1977-93.2165 901.6869-68.5629C918.9355-64.2123 930.4345-46.8098 927.5598-29.4073L927.5598-29.4073ZM762.2613 499.9189L704.7662 488.3172 699.0167 488.3172C686.0803 488.3172 673.1439 498.4687 670.2691 511.5206 667.3944 527.4729 677.456 543.4252 693.2672 546.3256L750.7623 557.9273C766.5734 560.8277 782.3846 550.6762 785.2593 534.7239 788.1341 518.7716 778.0725 502.8193 762.2613 499.9189L762.2613 499.9189Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
39
|
+
|
40
|
+
|
41
|
+
<glyph glyph-name="uniE102" unicode="" d="M528 716C589.8559 716 640 665.8559 640 604 640 603.6241 639.9981 603.2487 639.9945 602.8737 774.7291 551.3341 870.4 420.8396 870.4 268 870.4 245.4507 868.3176 223.3878 864.3345 201.9931 883.9388 181.8561 896 154.3366 896 124 896 62.1441 845.8559 12 784 12 777.3525 12 770.8402 12.5791 764.5109 13.6897 699.7526-50.6495 610.5184-90.4 512-90.4 413.4816-90.4 324.2474-50.6495 259.4612 13.6877 253.1598 12.5791 246.6475 12 240 12 178.1441 12 128 62.1441 128 124 128 154.3366 140.0612 181.8561 159.6499 202.0249 155.6824 223.3878 153.6 245.4507 153.6 268 153.6 432.8448 264.8905 571.6963 416.4355 613.5184 421.2316 670.9212 469.3514 716 528 716ZM436.5201 539.3665L432.0511 538.0893C315.4696 503.6336 230.4 395.7514 230.4 268 230.4 257.0771 231.0219 246.2994 232.2322 235.7004L233.8549 235.8343 240 236C301.8559 236 352 185.8559 352 124 352 97.8684 343.0507 73.8271 328.0498 54.7737 377.3611 12.1827 441.6696-13.6 512-13.6 582.3304-13.6 646.6389 12.1827 695.9893 54.812 680.9493 73.8271 672 97.8684 672 124 672 185.8559 722.1441 236 784 236 786.6073 236 789.1938 235.9109 791.7567 235.7356 792.9781 246.2994 793.6 257.0771 793.6 268 793.6 387.9728 718.5746 490.4224 612.8817 530.9909 592.3503 507.0949 561.938 492 528 492 490.2178 492 456.8051 510.7083 436.5201 539.3665Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
42
|
+
|
43
|
+
|
44
|
+
<glyph glyph-name="uniE101" unicode="" d="M708.9231 654.4615L984.6154 654.4615C1006.3669 654.4615 1024 636.8284 1024 615.0769L1024-133.2308C1024-176.7338 988.7338-212 945.2308-212L708.9231-212 708.9231 654.4615 708.9231 654.4615ZM0-172.6154C0-183.0608 4.1494-193.0785 11.5355-200.4645 18.9215-207.8506 28.9392-212 39.3846-212L945.2308-212C901.7277-212 866.4615-176.7338 866.4615-133.2308L866.4615 772.6154C866.4615 794.3669 848.8284 812 827.0769 812L39.3846 812C17.6331 812 0 794.3669 0 772.6154L0-172.6154ZM196.9231 523.1795C175.1716 523.1795 157.5385 505.5464 157.5385 483.7949 157.5385 462.0433 175.1716 444.4103 196.9231 444.4103L354.4615 444.4103C376.2131 444.4103 393.8462 462.0433 393.8462 483.7949 393.8462 505.5464 376.2131 523.1795 354.4615 523.1795L196.9231 523.1795ZM196.9231 286.8718C175.1716 286.8718 157.5385 269.2387 157.5385 247.4872 157.5385 225.7357 175.1716 208.1026 196.9231 208.1026L669.5385 208.1026C691.29 208.1026 708.9231 225.7357 708.9231 247.4872 708.9231 269.2387 691.29 286.8718 669.5385 286.8718L196.9231 286.8718ZM196.9231 50.5641C175.1716 50.5641 157.5385 32.931 157.5385 11.1795 157.5385-10.572 175.1716-28.2051 196.9231-28.2051L433.2308-28.2051C454.9823-28.2051 472.6154-10.572 472.6154 11.1795 472.6154 32.931 454.9823 50.5641 433.2308 50.5641L196.9231 50.5641 196.9231 50.5641Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
45
|
+
|
46
|
+
|
47
|
+
<glyph glyph-name="uniE106" unicode="" d="M512 620C759.4 620 960 476.7 960 300 960 123.3 759.4-20 512-20 264.6-20 64 123.3 64 300 64 476.7 264.6 620 512 620ZM512 556C457.8 556 405.4 548.5 356.1 533.6 309.5 519.5 267.8 499.5 232.4 474.2 165.1 426.1 128 364.2 128 300 128 235.8 165.1 173.9 232.4 125.8 267.8 100.5 309.5 80.5 356.1 66.4 405.4 51.5 457.8 44 512 44 566.2 44 618.6 51.5 667.9 66.4 714.5 80.5 756.2 100.5 791.6 125.8 858.9 173.9 896 235.8 896 300 896 364.2 858.9 426.1 791.6 474.2 756.2 499.5 714.5 519.5 667.9 533.6 618.6 548.5 566.2 556 512 556ZM512 460C600.4 460 672 388.4 672 300 672 211.6 600.4 140 512 140 423.6 140 352 211.6 352 300 352 388.4 423.6 460 512 460ZM512 396C459.1 396 416 352.9 416 300 416 247.1 459.1 204 512 204 564.9 204 608 247.1 608 300 608 352.9 564.9 396 512 396Z" horiz-adv-x="1024" vert-adv-y="1024" />
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
</font>
|
52
|
+
</defs>
|
53
|
+
</svg>
|
Binary file
|
Binary file
|
@@ -0,0 +1,10 @@
|
|
1
|
+
!function() {
|
2
|
+
var svgCode = '<svg xmlns="http://www.w3.org/2000/svg" data-name="ai-ui-sdk" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0;visibility:hidden"><symbol id="ai-ui-sdk-angle-up" viewBox="0 0 32 32"><path fill="#63656e" d="M16 11.5l7 7-1.5 1.5-5.5-5.5-5.5 5.5L9 18.5l7-7z"/></symbol><symbol id="ai-ui-sdk-links" viewBox="0 0 1024 1024"><path d="M263.04 760.96a148.48 148.48 0 01-1.92-224l92.48-92.48-45.12-45.76L216 491.2a212.8 212.8 0 001.92 314.88A212.8 212.8 0 00532.8 808l92.48-92.48L579.84 672l-92.48 92.48a148.48 148.48 0 01-224.32-3.52zM491.2 216l-92.48 92.48 45.44 45.12 92.48-92.48a148.48 148.48 0 01224 1.92 148.48 148.48 0 011.92 224L672 579.84l45.12 45.44 92.48-92.48a212.8 212.8 0 00-1.92-314.88A212.8 212.8 0 00491.2 216z"/><path d="M398.786 579.888l181.019-181.02 45.255 45.255-181.02 181.02-45.254-45.255z"/></symbol><symbol id="ai-ui-sdk-zhishiku" viewBox="0 0 1024 1024"><path d="M320.986 203.315H191.622c-17.248 0-31.622 14.503-31.622 31.905v639.542c0 17.403 14.374 31.905 31.622 31.905h129.364c17.249 0 31.623-14.502 31.623-31.905V235.22c0-17.402-14.374-31.905-31.623-31.905zm-35.934 130.52h-57.495c-15.811 0-28.748-13.053-28.748-29.005 0-15.952 12.937-29.004 28.748-29.004h57.495c15.811 0 28.747 13.052 28.747 29.004 0 15.952-12.936 29.004-28.747 29.004zM578.277 96H448.913c-17.249 0-31.622 14.502-31.622 31.905v746.857c0 17.403 14.373 31.905 31.622 31.905h129.364c17.248 0 31.622-14.502 31.622-31.905V127.905C611.337 110.502 596.963 96 578.277 96zM543.78 227.969h-57.495c-15.811 0-28.748-13.052-28.748-29.004 0-15.952 12.937-29.004 28.748-29.004h57.495c15.811 0 28.747 13.052 28.747 29.004 0 15.952-12.936 29.004-28.747 29.004zm383.78 613.438l-120.74-627.94c-4.312-15.952-17.249-26.104-33.06-26.104h-5.75l-126.488 24.654c-17.249 2.9-28.748 20.303-25.873 37.705l122.177 629.39c2.875 15.953 15.811 26.104 31.622 26.104h5.75l126.489-24.653c17.248-4.35 28.748-21.753 25.873-39.156zM762.26 312.081l-57.495 11.602h-5.75c-12.936 0-25.872-10.152-28.747-23.204-2.875-15.952 7.187-31.904 22.998-34.805l57.495-11.601c15.811-2.9 31.623 7.25 34.497 23.203 2.875 15.952-7.187 31.905-22.998 34.805z"/></symbol><symbol id="ai-ui-sdk-sikao" viewBox="0 0 1024 1024"><path d="M528 96c61.856 0 112 50.144 112 112 0 .376-.002.751-.006 1.126C774.73 260.666 870.4 391.16 870.4 544c0 22.55-2.082 44.612-6.066 66.007C883.94 630.144 896 657.663 896 688c0 61.856-50.144 112-112 112a112.7 112.7 0 01-19.49-1.69C699.754 862.65 610.519 902.4 512 902.4s-187.753-39.75-252.539-104.088A112.33 112.33 0 01240 800c-61.856 0-112-50.144-112-112 0-30.337 12.061-57.856 31.65-78.025A361.172 361.172 0 01153.6 544c0-164.845 111.29-303.696 262.836-345.518C421.232 141.079 469.35 96 528 96zm-91.48 176.633l-4.469 1.278C315.47 308.366 230.4 416.249 230.4 544c0 10.923.622 21.7 1.832 32.3l1.623-.134L240 576c61.856 0 112 50.144 112 112 0 26.132-8.95 50.173-23.95 69.226C377.36 799.817 441.67 825.6 512 825.6c70.33 0 134.639-25.783 183.99-68.412C680.95 738.173 672 714.132 672 688c0-61.856 50.144-112 112-112 2.607 0 5.194.09 7.757.264A280.989 280.989 0 00793.6 544c0-119.973-75.025-222.422-180.718-262.99C592.35 304.904 561.938 320 528 320c-37.782 0-71.195-18.708-91.48-47.367z"/></symbol><symbol id="ai-ui-sdk-wenzhang" viewBox="0 0 1024 1024"><path fill="#3D4265" d="M708.923 157.538h275.692c21.752 0 39.385 17.634 39.385 39.385v748.308c0 43.503-35.266 78.769-78.77 78.769H708.924V157.538z"/><path fill="#3A84FF" d="M0 984.615A39.385 39.385 0 0039.385 1024H945.23c-43.503 0-78.77-35.266-78.77-78.77V39.386C866.462 17.633 848.829 0 827.078 0H39.385C17.633 0 0 17.633 0 39.385v945.23z"/><path fill="#FFF" d="M196.923 288.82c-21.751 0-39.385 17.634-39.385 39.385 0 21.752 17.634 39.385 39.385 39.385h157.539c21.751 0 39.384-17.633 39.384-39.385 0-21.751-17.633-39.384-39.384-39.384H196.923zm0 236.308c-21.751 0-39.385 17.633-39.385 39.385 0 21.751 17.634 39.384 39.385 39.384h472.615c21.752 0 39.385-17.633 39.385-39.384 0-21.752-17.633-39.385-39.385-39.385H196.923zm0 236.308c-21.751 0-39.385 17.633-39.385 39.385 0 21.751 17.634 39.384 39.385 39.384h236.308c21.751 0 39.384-17.633 39.384-39.384 0-21.752-17.633-39.385-39.384-39.385H196.923z"/></g></symbol><symbol id="ai-ui-sdk-yanjing-kejian" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M512 192c247.4 0 448 143.3 448 320S759.4 832 512 832 64 688.7 64 512s200.6-320 448-320zm0 64c-54.2 0-106.6 7.5-155.9 22.4-46.6 14.1-88.3 34.1-123.7 59.4C165.1 385.9 128 447.8 128 512c0 64.2 37.1 126.1 104.4 174.2 35.4 25.3 77.1 45.3 123.7 59.4C405.4 760.5 457.8 768 512 768s106.6-7.5 155.9-22.4c46.6-14.1 88.3-34.1 123.7-59.4C858.9 638.1 896 576.2 896 512c0-64.2-37.1-126.1-104.4-174.2-35.4-25.3-77.1-45.3-123.7-59.4C618.6 263.5 566.2 256 512 256zm0 96c88.4 0 160 71.6 160 160s-71.6 160-160 160-160-71.6-160-160 71.6-160 160-160zm0 64c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96z"/></symbol></svg>';
|
3
|
+
if (document.body) {
|
4
|
+
document.body.insertAdjacentHTML('afterbegin', svgCode);
|
5
|
+
} else {
|
6
|
+
document.addEventListener('DOMContentLoaded', function() {
|
7
|
+
document.body.insertAdjacentHTML('afterbegin', svgCode);
|
8
|
+
});
|
9
|
+
}
|
10
|
+
}();
|
@@ -0,0 +1,43 @@
|
|
1
|
+
@font-face {
|
2
|
+
font-family: "ai-ui-sdk";
|
3
|
+
src: url('./fonts/iconcool.svg') format("svg"),
|
4
|
+
url('./fonts/iconcool.ttf') format("truetype"),
|
5
|
+
url('./fonts/iconcool.woff') format("woff"),
|
6
|
+
url('./fonts/iconcool.eot') format("embedded-opentype");
|
7
|
+
font-weight: normal;
|
8
|
+
font-style: normal;
|
9
|
+
}
|
10
|
+
|
11
|
+
.ai-ui-sdk-icon {
|
12
|
+
/* use !important to prevent issues with browser extensions that change fonts */
|
13
|
+
font-family: 'ai-ui-sdk' !important;
|
14
|
+
speak: none;
|
15
|
+
font-style: normal;
|
16
|
+
font-weight: normal;
|
17
|
+
font-variant: normal;
|
18
|
+
text-transform: none;
|
19
|
+
line-height: 1;
|
20
|
+
text-align: center;
|
21
|
+
/* Better Font Rendering =========== */
|
22
|
+
-webkit-font-smoothing: antialiased;
|
23
|
+
-moz-osx-font-smoothing: grayscale;
|
24
|
+
}
|
25
|
+
|
26
|
+
.ai-ui-sdk-angle-up:before {
|
27
|
+
content: "\e103";
|
28
|
+
}
|
29
|
+
.ai-ui-sdk-links:before {
|
30
|
+
content: "\e105";
|
31
|
+
}
|
32
|
+
.ai-ui-sdk-zhishiku:before {
|
33
|
+
content: "\e104";
|
34
|
+
}
|
35
|
+
.ai-ui-sdk-sikao:before {
|
36
|
+
content: "\e102";
|
37
|
+
}
|
38
|
+
.ai-ui-sdk-wenzhang:before {
|
39
|
+
content: "\e101";
|
40
|
+
}
|
41
|
+
.ai-ui-sdk-yanjing-kejian:before {
|
42
|
+
content: "\e106";
|
43
|
+
}
|