Thomas G. Lopes
commited on
Commit
·
aac02fe
1
Parent(s):
6a8491a
always have default project
Browse files- package.json +2 -0
- pnpm-lock.yaml +136 -0
- src/app.css +14 -4
- src/app.d.ts +2 -0
- src/lib/components/Icons/IconExternal.svelte +0 -7
- src/lib/components/InferencePlayground/InferencePlayground.svelte +4 -12
- src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte +5 -5
- src/lib/components/InferencePlayground/InferencePlaygroundProjectSelect.svelte +52 -38
- src/lib/stores/session.ts +64 -29
- src/lib/types.ts +6 -1
- vite.config.ts +5 -0
package.json
CHANGED
@@ -13,6 +13,7 @@
|
|
13 |
"format": "prettier . --write ."
|
14 |
},
|
15 |
"devDependencies": {
|
|
|
16 |
"@ryoppippi/unplugin-typia": "^1.0.0",
|
17 |
"@samchon/openapi": "^3.0.0",
|
18 |
"@sveltejs/adapter-auto": "^3.2.2",
|
@@ -38,6 +39,7 @@
|
|
38 |
"ts-patch": "^3.3.0",
|
39 |
"tslib": "^2.4.1",
|
40 |
"typescript": "^5.8.2",
|
|
|
41 |
"vite": "^5.0.3"
|
42 |
},
|
43 |
"type": "module",
|
|
|
13 |
"format": "prettier . --write ."
|
14 |
},
|
15 |
"devDependencies": {
|
16 |
+
"@iconify-json/carbon": "^1.2.8",
|
17 |
"@ryoppippi/unplugin-typia": "^1.0.0",
|
18 |
"@samchon/openapi": "^3.0.0",
|
19 |
"@sveltejs/adapter-auto": "^3.2.2",
|
|
|
39 |
"ts-patch": "^3.3.0",
|
40 |
"tslib": "^2.4.1",
|
41 |
"typescript": "^5.8.2",
|
42 |
+
"unplugin-icons": "^22.1.0",
|
43 |
"vite": "^5.0.3"
|
44 |
},
|
45 |
"type": "module",
|
pnpm-lock.yaml
CHANGED
@@ -27,6 +27,9 @@ importers:
|
|
27 |
specifier: ^8.0.0
|
28 |
version: 8.0.0(@samchon/[email protected])([email protected])
|
29 |
devDependencies:
|
|
|
|
|
|
|
30 |
'@ryoppippi/unplugin-typia':
|
31 |
specifier: ^1.0.0
|
32 |
version: 1.2.0(@samchon/[email protected])([email protected])([email protected])([email protected])([email protected])
|
@@ -102,6 +105,9 @@ importers:
|
|
102 |
typescript:
|
103 |
specifier: ^5.8.2
|
104 |
version: 5.8.2
|
|
|
|
|
|
|
105 |
vite:
|
106 |
specifier: ^5.0.3
|
107 |
version: 5.4.14([email protected])
|
@@ -116,6 +122,12 @@ packages:
|
|
116 |
resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
|
117 |
engines: {node: '>=6.0.0'}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
'@esbuild/[email protected]':
|
120 |
resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==}
|
121 |
engines: {node: '>=12'}
|
@@ -458,6 +470,15 @@ packages:
|
|
458 |
resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}
|
459 |
deprecated: Use @eslint/object-schema instead
|
460 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
'@internationalized/[email protected]':
|
462 |
resolution: {integrity: sha512-VJ5WS3fcVx0bejE/YHfbDKR/yawZgKqn/if+oEeLqNwBtPzVB06olkfcnojTmEMX+gTpH+FlQ69SHNitJ8/erQ==}
|
463 |
|
@@ -975,6 +996,9 @@ packages:
|
|
975 | |
976 |
resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==}
|
977 |
|
|
|
|
|
|
|
978 | |
979 |
resolution: {integrity: sha512-EiPU8G6dQG0GFHNR8ljnZFki/8a+cQwEQ+7wpxdChl02Q8HXlwEZWD5lqAF8vC2sEC3Tehr8hy7vErz88LHyUA==}
|
980 |
engines: {node: ^14.18.0 || >=16.10.0}
|
@@ -1150,6 +1174,9 @@ packages:
|
|
1150 |
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
|
1151 |
engines: {node: '>=0.10.0'}
|
1152 |
|
|
|
|
|
|
|
1153 | |
1154 |
resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==}
|
1155 |
engines: {node: '>=4'}
|
@@ -1243,6 +1270,10 @@ packages:
|
|
1243 |
resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
|
1244 |
engines: {node: '>=8'}
|
1245 |
|
|
|
|
|
|
|
|
|
1246 | |
1247 |
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
|
1248 |
engines: {node: '>=10'}
|
@@ -1389,6 +1420,9 @@ packages:
|
|
1389 | |
1390 |
resolution: {integrity: sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A==}
|
1391 |
|
|
|
|
|
|
|
1392 | |
1393 |
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
|
1394 |
engines: {node: '>= 0.8.0'}
|
@@ -1465,6 +1499,10 @@ packages:
|
|
1465 |
resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==}
|
1466 |
engines: {node: '>=14'}
|
1467 |
|
|
|
|
|
|
|
|
|
1468 | |
1469 |
resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==}
|
1470 |
|
@@ -1648,6 +1686,9 @@ packages:
|
|
1648 | |
1649 |
resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==}
|
1650 |
|
|
|
|
|
|
|
1651 | |
1652 |
resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==}
|
1653 |
engines: {node: '>= 10'}
|
@@ -1990,6 +2031,9 @@ packages:
|
|
1990 | |
1991 |
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
|
1992 |
|
|
|
|
|
|
|
1993 | |
1994 |
resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
|
1995 |
engines: {node: '>=0.6.0'}
|
@@ -2058,10 +2102,37 @@ packages:
|
|
2058 | |
2059 |
resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==}
|
2060 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2061 | |
2062 |
resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==}
|
2063 |
engines: {node: '>=14.0.0'}
|
2064 |
|
|
|
|
|
|
|
|
|
2065 | |
2066 |
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
2067 |
|
@@ -2200,6 +2271,13 @@ snapshots:
|
|
2200 |
'@jridgewell/gen-mapping': 0.3.8
|
2201 |
'@jridgewell/trace-mapping': 0.3.25
|
2202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2203 |
'@esbuild/[email protected]':
|
2204 |
optional: true
|
2205 |
|
@@ -2402,6 +2480,25 @@ snapshots:
|
|
2402 |
|
2403 |
'@humanwhocodes/[email protected]': {}
|
2404 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2405 |
'@internationalized/[email protected]':
|
2406 |
dependencies:
|
2407 |
'@swc/helpers': 0.5.15
|
@@ -2930,6 +3027,8 @@ snapshots:
|
|
2930 |
|
2931 | |
2932 |
|
|
|
|
|
2933 | |
2934 |
|
2935 | |
@@ -3156,6 +3255,8 @@ snapshots:
|
|
3156 |
|
3157 | |
3158 |
|
|
|
|
|
3159 | |
3160 |
dependencies:
|
3161 |
chardet: 0.7.0
|
@@ -3257,6 +3358,8 @@ snapshots:
|
|
3257 |
dependencies:
|
3258 |
type-fest: 0.20.2
|
3259 |
|
|
|
|
|
3260 | |
3261 |
dependencies:
|
3262 |
array-union: 2.1.0
|
@@ -3384,6 +3487,8 @@ snapshots:
|
|
3384 |
|
3385 | |
3386 |
|
|
|
|
|
3387 | |
3388 |
dependencies:
|
3389 |
prelude-ls: 1.2.1
|
@@ -3439,6 +3544,12 @@ snapshots:
|
|
3439 | |
3440 |
optional: true
|
3441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3442 | |
3443 |
|
3444 | |
@@ -3605,6 +3716,12 @@ snapshots:
|
|
3605 |
mlly: 1.7.4
|
3606 |
pathe: 2.0.3
|
3607 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3608 | |
3609 |
dependencies:
|
3610 |
lilconfig: 2.1.0
|
@@ -3883,6 +4000,8 @@ snapshots:
|
|
3883 |
|
3884 | |
3885 |
|
|
|
|
|
3886 | |
3887 |
dependencies:
|
3888 |
os-tmpdir: 1.0.2
|
@@ -3944,11 +4063,28 @@ snapshots:
|
|
3944 |
|
3945 | |
3946 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3947 | |
3948 |
dependencies:
|
3949 |
acorn: 8.14.0
|
3950 |
webpack-virtual-modules: 0.6.2
|
3951 |
|
|
|
|
|
|
|
|
|
|
|
3952 | |
3953 |
dependencies:
|
3954 |
punycode: 2.3.1
|
|
|
27 |
specifier: ^8.0.0
|
28 |
version: 8.0.0(@samchon/[email protected])([email protected])
|
29 |
devDependencies:
|
30 |
+
'@iconify-json/carbon':
|
31 |
+
specifier: ^1.2.8
|
32 |
+
version: 1.2.8
|
33 |
'@ryoppippi/unplugin-typia':
|
34 |
specifier: ^1.0.0
|
35 |
version: 1.2.0(@samchon/[email protected])([email protected])([email protected])([email protected])([email protected])
|
|
|
105 |
typescript:
|
106 |
specifier: ^5.8.2
|
107 |
version: 5.8.2
|
108 |
+
unplugin-icons:
|
109 |
+
specifier: ^22.1.0
|
110 |
+
version: 22.1.0([email protected])
|
111 |
vite:
|
112 |
specifier: ^5.0.3
|
113 |
version: 5.4.14([email protected])
|
|
|
122 |
resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
|
123 |
engines: {node: '>=6.0.0'}
|
124 |
|
125 |
+
'@antfu/[email protected]':
|
126 |
+
resolution: {integrity: sha512-xvX6P/lo1B3ej0OsaErAjqgFYzYVcJpamjLAFLYh9vRJngBrMoUG7aVnrGTeqM7yxbyTD5p3F2+0/QUEh8Vzhw==}
|
127 |
+
|
128 |
+
'@antfu/[email protected]':
|
129 |
+
resolution: {integrity: sha512-Mex9nXf9vR6AhcXmMrlz/HVgYYZpVGJ6YlPgwl7UnaFpnshXs6EK/oa5Gpf3CzENMjkvEx2tQtntGnb7UtSTOQ==}
|
130 |
+
|
131 |
'@esbuild/[email protected]':
|
132 |
resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==}
|
133 |
engines: {node: '>=12'}
|
|
|
470 |
resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}
|
471 |
deprecated: Use @eslint/object-schema instead
|
472 |
|
473 |
+
'@iconify-json/[email protected]':
|
474 |
+
resolution: {integrity: sha512-6xh4YiFBz6qoSnB3XMe23WvjTJroDFXB17J1MbiT7nATFe+70+em1acRXr8hgP/gYpwFMHFc4IvjA/IPTPnTzg==}
|
475 |
+
|
476 |
+
'@iconify/[email protected]':
|
477 |
+
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}
|
478 |
+
|
479 |
+
'@iconify/[email protected]':
|
480 |
+
resolution: {integrity: sha512-GmQ78prtwYW6EtzXRU1rY+KwOKfz32PD7iJh6Iyqw68GiKuoZ2A6pRtzWONz5VQJbp50mEjXh/7NkumtrAgRKA==}
|
481 |
+
|
482 |
'@internationalized/[email protected]':
|
483 |
resolution: {integrity: sha512-VJ5WS3fcVx0bejE/YHfbDKR/yawZgKqn/if+oEeLqNwBtPzVB06olkfcnojTmEMX+gTpH+FlQ69SHNitJ8/erQ==}
|
484 |
|
|
|
996 | |
997 |
resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==}
|
998 |
|
999 | |
1000 |
+
resolution: {integrity: sha512-hkT3yDPFbs95mNCy1+7qNKC6Pro+/ibzYxtM2iqEigpf0sVw+bg4Zh9/snjsBcf990vfIsg5+1U7VyiyBb3etg==}
|
1001 |
+
|
1002 | |
1003 |
resolution: {integrity: sha512-EiPU8G6dQG0GFHNR8ljnZFki/8a+cQwEQ+7wpxdChl02Q8HXlwEZWD5lqAF8vC2sEC3Tehr8hy7vErz88LHyUA==}
|
1004 |
engines: {node: ^14.18.0 || >=16.10.0}
|
|
|
1174 |
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
|
1175 |
engines: {node: '>=0.10.0'}
|
1176 |
|
1177 | |
1178 |
+
resolution: {integrity: sha512-xsZH6PXaER4XoV+NiT7JHp1bJodJVT+cxeSH1G0f0tlT0lJqYuHUP3bUx2HtfTDvOagMINYp8rsqusxud3RXhw==}
|
1179 |
+
|
1180 | |
1181 |
resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==}
|
1182 |
engines: {node: '>=4'}
|
|
|
1270 |
resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
|
1271 |
engines: {node: '>=8'}
|
1272 |
|
1273 | |
1274 |
+
resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==}
|
1275 |
+
engines: {node: '>=18'}
|
1276 |
+
|
1277 | |
1278 |
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
|
1279 |
engines: {node: '>=10'}
|
|
|
1420 | |
1421 |
resolution: {integrity: sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A==}
|
1422 |
|
1423 | |
1424 |
+
resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
|
1425 |
+
|
1426 | |
1427 |
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
|
1428 |
engines: {node: '>= 0.8.0'}
|
|
|
1499 |
resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==}
|
1500 |
engines: {node: '>=14'}
|
1501 |
|
1502 | |
1503 |
+
resolution: {integrity: sha512-WunYko2W1NcdfAFpuLUoucsgULmgDBRkdxHxWQ7mK0cQqwPiy8E1enjuRBrhLtZkB5iScJ1XIPdhVEFK8aOLSg==}
|
1504 |
+
engines: {node: '>=14'}
|
1505 |
+
|
1506 | |
1507 |
resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==}
|
1508 |
|
|
|
1686 | |
1687 |
resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==}
|
1688 |
|
1689 | |
1690 |
+
resolution: {integrity: sha512-wmJwA+8ihJixSoHKxZJRBQG1oY8Yr9pGLzRmSsNms0iNWyHHAlZCa7mmKiFR10YPZuz/2k169JiS/inOjBCZ2A==}
|
1691 |
+
|
1692 | |
1693 |
resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==}
|
1694 |
engines: {node: '>= 10'}
|
|
|
2031 | |
2032 |
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
|
2033 |
|
2034 | |
2035 |
+
resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}
|
2036 |
+
|
2037 | |
2038 |
resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
|
2039 |
engines: {node: '>=0.6.0'}
|
|
|
2102 | |
2103 |
resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==}
|
2104 |
|
2105 | |
2106 |
+
resolution: {integrity: sha512-ect2ZNtk1Zgwb0NVHd0C1IDW/MV+Jk/xaq4t8o6rYdVS3+L660ZdD5kTSQZvsgdwCvquRw+/wYn75hsweRjoIA==}
|
2107 |
+
peerDependencies:
|
2108 |
+
'@svgr/core': '>=7.0.0'
|
2109 |
+
'@svgx/core': ^1.0.1
|
2110 |
+
'@vue/compiler-sfc': ^3.0.2 || ^2.7.0
|
2111 |
+
svelte: ^3.0.0 || ^4.0.0 || ^5.0.0
|
2112 |
+
vue-template-compiler: ^2.6.12
|
2113 |
+
vue-template-es2015-compiler: ^1.9.0
|
2114 |
+
peerDependenciesMeta:
|
2115 |
+
'@svgr/core':
|
2116 |
+
optional: true
|
2117 |
+
'@svgx/core':
|
2118 |
+
optional: true
|
2119 |
+
'@vue/compiler-sfc':
|
2120 |
+
optional: true
|
2121 |
+
svelte:
|
2122 |
+
optional: true
|
2123 |
+
vue-template-compiler:
|
2124 |
+
optional: true
|
2125 |
+
vue-template-es2015-compiler:
|
2126 |
+
optional: true
|
2127 |
+
|
2128 | |
2129 |
resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==}
|
2130 |
engines: {node: '>=14.0.0'}
|
2131 |
|
2132 | |
2133 |
+
resolution: {integrity: sha512-m1ekpSwuOT5hxkJeZGRxO7gXbXT3gF26NjQ7GdVHoLoF8/nopLcd/QfPigpCy7i51oFHiRJg/CyHhj4vs2+KGw==}
|
2134 |
+
engines: {node: '>=18.12.0'}
|
2135 |
+
|
2136 | |
2137 |
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
2138 |
|
|
|
2271 |
'@jridgewell/gen-mapping': 0.3.8
|
2272 |
'@jridgewell/trace-mapping': 0.3.25
|
2273 |
|
2274 |
+
'@antfu/[email protected]':
|
2275 |
+
dependencies:
|
2276 |
+
package-manager-detector: 0.2.11
|
2277 |
+
tinyexec: 0.3.2
|
2278 |
+
|
2279 |
+
'@antfu/[email protected]': {}
|
2280 |
+
|
2281 |
'@esbuild/[email protected]':
|
2282 |
optional: true
|
2283 |
|
|
|
2480 |
|
2481 |
'@humanwhocodes/[email protected]': {}
|
2482 |
|
2483 |
+
'@iconify-json/[email protected]':
|
2484 |
+
dependencies:
|
2485 |
+
'@iconify/types': 2.0.0
|
2486 |
+
|
2487 |
+
'@iconify/[email protected]': {}
|
2488 |
+
|
2489 |
+
'@iconify/[email protected]':
|
2490 |
+
dependencies:
|
2491 |
+
'@antfu/install-pkg': 1.0.0
|
2492 |
+
'@antfu/utils': 8.1.1
|
2493 |
+
'@iconify/types': 2.0.0
|
2494 |
+
debug: 4.4.0
|
2495 |
+
globals: 15.15.0
|
2496 |
+
kolorist: 1.8.0
|
2497 |
+
local-pkg: 1.1.1
|
2498 |
+
mlly: 1.7.4
|
2499 |
+
transitivePeerDependencies:
|
2500 |
+
- supports-color
|
2501 |
+
|
2502 |
'@internationalized/[email protected]':
|
2503 |
dependencies:
|
2504 |
'@swc/helpers': 0.5.15
|
|
|
3027 |
|
3028 | |
3029 |
|
3030 |
+
[email protected]: {}
|
3031 |
+
|
3032 | |
3033 |
|
3034 | |
|
|
3255 |
|
3256 | |
3257 |
|
3258 |
+
[email protected]: {}
|
3259 |
+
|
3260 | |
3261 |
dependencies:
|
3262 |
chardet: 0.7.0
|
|
|
3358 |
dependencies:
|
3359 |
type-fest: 0.20.2
|
3360 |
|
3361 |
+
[email protected]: {}
|
3362 |
+
|
3363 | |
3364 |
dependencies:
|
3365 |
array-union: 2.1.0
|
|
|
3487 |
|
3488 | |
3489 |
|
3490 |
+
[email protected]: {}
|
3491 |
+
|
3492 | |
3493 |
dependencies:
|
3494 |
prelude-ls: 1.2.1
|
|
|
3544 | |
3545 |
optional: true
|
3546 |
|
3547 | |
3548 |
+
dependencies:
|
3549 |
+
mlly: 1.7.4
|
3550 |
+
pkg-types: 2.1.0
|
3551 |
+
quansync: 0.2.8
|
3552 |
+
|
3553 | |
3554 |
|
3555 | |
|
|
3716 |
mlly: 1.7.4
|
3717 |
pathe: 2.0.3
|
3718 |
|
3719 | |
3720 |
+
dependencies:
|
3721 |
+
confbox: 0.2.1
|
3722 |
+
exsolve: 1.0.4
|
3723 |
+
pathe: 2.0.3
|
3724 |
+
|
3725 | |
3726 |
dependencies:
|
3727 |
lilconfig: 2.1.0
|
|
|
4000 |
|
4001 | |
4002 |
|
4003 |
+
[email protected]: {}
|
4004 |
+
|
4005 | |
4006 |
dependencies:
|
4007 |
os-tmpdir: 1.0.2
|
|
|
4063 |
|
4064 | |
4065 |
|
4066 | |
4067 |
+
dependencies:
|
4068 |
+
'@antfu/install-pkg': 1.0.0
|
4069 |
+
'@iconify/utils': 2.3.0
|
4070 |
+
debug: 4.4.0
|
4071 |
+
local-pkg: 1.1.1
|
4072 |
+
unplugin: 2.2.0
|
4073 |
+
optionalDependencies:
|
4074 |
+
svelte: 4.2.19
|
4075 |
+
transitivePeerDependencies:
|
4076 |
+
- supports-color
|
4077 |
+
|
4078 | |
4079 |
dependencies:
|
4080 |
acorn: 8.14.0
|
4081 |
webpack-virtual-modules: 0.6.2
|
4082 |
|
4083 | |
4084 |
+
dependencies:
|
4085 |
+
acorn: 8.14.0
|
4086 |
+
webpack-virtual-modules: 0.6.2
|
4087 |
+
|
4088 | |
4089 |
dependencies:
|
4090 |
punycode: 2.3.1
|
src/app.css
CHANGED
@@ -23,11 +23,11 @@
|
|
23 |
}
|
24 |
}
|
25 |
|
26 |
-
|
27 |
-
font-size: 15px;
|
28 |
-
}
|
29 |
-
|
30 |
@theme {
|
|
|
|
|
|
|
31 |
--animate-fade-in: fade-in 0.15s ease;
|
32 |
@keyframes fade-in {
|
33 |
0% {
|
@@ -41,7 +41,17 @@ html {
|
|
41 |
}
|
42 |
}
|
43 |
|
|
|
44 |
@utility abs-x-center {
|
45 |
left: 50%;
|
46 |
@apply -translate-x-1/2;
|
47 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
}
|
25 |
|
26 |
+
/* Theme config */
|
|
|
|
|
|
|
27 |
@theme {
|
28 |
+
--text-2xs: 0.625rem;
|
29 |
+
--text-3xs: 0.5rem;
|
30 |
+
|
31 |
--animate-fade-in: fade-in 0.15s ease;
|
32 |
@keyframes fade-in {
|
33 |
0% {
|
|
|
41 |
}
|
42 |
}
|
43 |
|
44 |
+
/* Utilities */
|
45 |
@utility abs-x-center {
|
46 |
left: 50%;
|
47 |
@apply -translate-x-1/2;
|
48 |
}
|
49 |
+
|
50 |
+
@utility btn {
|
51 |
+
@apply flex h-[39px] items-center justify-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2.5 text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-blue-700 focus:ring-4 focus:ring-gray-100 focus:outline-hidden dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700;
|
52 |
+
}
|
53 |
+
|
54 |
+
/* Elements & Classes */
|
55 |
+
html {
|
56 |
+
font-size: 15px;
|
57 |
+
}
|
src/app.d.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
// See https://kit.svelte.dev/docs/types#app
|
2 |
// for information about these interfaces
|
3 |
declare global {
|
|
|
1 |
+
import "unplugin-icons/types/svelte";
|
2 |
+
|
3 |
// See https://kit.svelte.dev/docs/types#app
|
4 |
// for information about these interfaces
|
5 |
declare global {
|
src/lib/components/Icons/IconExternal.svelte
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<script lang="ts">
|
2 |
-
export let classNames = "";
|
3 |
-
</script>
|
4 |
-
|
5 |
-
<svg class={classNames} xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"
|
6 |
-
><path fill="currentColor" d="M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6H10z" /></svg
|
7 |
-
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/lib/components/InferencePlayground/InferencePlayground.svelte
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
import HFTokenModal from "./InferencePlaygroundHFTokenModal.svelte";
|
25 |
import ModelSelector from "./InferencePlaygroundModelSelector.svelte";
|
26 |
import ModelSelectorModal from "./InferencePlaygroundModelSelectorModal.svelte";
|
27 |
-
import IconExternal from "
|
28 |
import InferencePlaygroundProjectSelect from "./InferencePlaygroundProjectSelect.svelte";
|
29 |
|
30 |
const startMessageUser: ConversationMessage = { role: "user", content: "" };
|
@@ -303,11 +303,7 @@
|
|
303 |
{!viewSettings ? "Settings" : "Hide Settings"}
|
304 |
</button>
|
305 |
{/if}
|
306 |
-
<button
|
307 |
-
type="button"
|
308 |
-
on:click={reset}
|
309 |
-
class="flex size-[39px] flex-none items-center justify-center rounded-lg border border-gray-200 bg-white text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 focus:outline-hidden dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
310 |
-
>
|
311 |
<IconDelete />
|
312 |
</button>
|
313 |
</div>
|
@@ -317,11 +313,7 @@
|
|
317 |
{/each}
|
318 |
</div>
|
319 |
<div class="flex flex-1 justify-end gap-x-2">
|
320 |
-
<button
|
321 |
-
type="button"
|
322 |
-
on:click={() => (viewCode = !viewCode)}
|
323 |
-
class="flex h-[39px] items-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2.5 text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 focus:outline-hidden dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
|
324 |
-
>
|
325 |
<IconCode />
|
326 |
{!viewCode ? "View Code" : "Hide Code"}</button
|
327 |
>
|
@@ -388,7 +380,7 @@
|
|
388 |
target="_blank"
|
389 |
class="flex items-center gap-0.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
390 |
>
|
391 |
-
<IconExternal />
|
392 |
Model page
|
393 |
</a>
|
394 |
</div>
|
|
|
24 |
import HFTokenModal from "./InferencePlaygroundHFTokenModal.svelte";
|
25 |
import ModelSelector from "./InferencePlaygroundModelSelector.svelte";
|
26 |
import ModelSelectorModal from "./InferencePlaygroundModelSelectorModal.svelte";
|
27 |
+
import IconExternal from "~icons/carbon/arrow-up-right";
|
28 |
import InferencePlaygroundProjectSelect from "./InferencePlaygroundProjectSelect.svelte";
|
29 |
|
30 |
const startMessageUser: ConversationMessage = { role: "user", content: "" };
|
|
|
303 |
{!viewSettings ? "Settings" : "Hide Settings"}
|
304 |
</button>
|
305 |
{/if}
|
306 |
+
<button type="button" on:click={reset} class="btn size-[39px]">
|
|
|
|
|
|
|
|
|
307 |
<IconDelete />
|
308 |
</button>
|
309 |
</div>
|
|
|
313 |
{/each}
|
314 |
</div>
|
315 |
<div class="flex flex-1 justify-end gap-x-2">
|
316 |
+
<button type="button" on:click={() => (viewCode = !viewCode)} class="btn">
|
|
|
|
|
|
|
|
|
317 |
<IconCode />
|
318 |
{!viewCode ? "View Code" : "Hide Code"}</button
|
319 |
>
|
|
|
380 |
target="_blank"
|
381 |
class="flex items-center gap-0.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
382 |
>
|
383 |
+
<IconExternal class="text-2xs" />
|
384 |
Model page
|
385 |
</a>
|
386 |
</div>
|
src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte
CHANGED
@@ -10,8 +10,8 @@
|
|
10 |
import { token } from "$lib/stores/token";
|
11 |
import { entries, fromEntries, keys } from "$lib/utils/object";
|
12 |
import type { InferenceProvider } from "@huggingface/inference";
|
13 |
-
import IconCopyCode from "
|
14 |
-
import IconExternal from "
|
15 |
import {
|
16 |
getInferenceSnippet,
|
17 |
type GetInferenceSnippetReturn,
|
@@ -191,7 +191,7 @@
|
|
191 |
target="_blank"
|
192 |
class="relative -bottom-[1px] flex items-center gap-1 text-sm font-normal text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
193 |
>
|
194 |
-
<IconExternal
|
195 |
Docs
|
196 |
</a>
|
197 |
</h2>
|
@@ -200,7 +200,7 @@
|
|
200 |
class="flex items-center gap-x-2 rounded-md border bg-white px-1.5 py-0.5 text-sm shadow-xs transition dark:border-gray-800 dark:bg-gray-800"
|
201 |
use:copy={installInstructions.content}
|
202 |
>
|
203 |
-
<IconCopyCode
|
204 |
</button>
|
205 |
</div>
|
206 |
</div>
|
@@ -226,7 +226,7 @@
|
|
226 |
class="flex items-center gap-x-2 rounded-md border bg-white px-1.5 py-0.5 text-sm shadow-xs transition dark:border-gray-800 dark:bg-gray-800"
|
227 |
use:copy={selectedSnippet?.content}
|
228 |
>
|
229 |
-
<IconCopyCode
|
230 |
</button>
|
231 |
</div>
|
232 |
</div>
|
|
|
10 |
import { token } from "$lib/stores/token";
|
11 |
import { entries, fromEntries, keys } from "$lib/utils/object";
|
12 |
import type { InferenceProvider } from "@huggingface/inference";
|
13 |
+
import IconCopyCode from "~icons/carbon/copy";
|
14 |
+
import IconExternal from "~icons/carbon/arrow-up-right";
|
15 |
import {
|
16 |
getInferenceSnippet,
|
17 |
type GetInferenceSnippetReturn,
|
|
|
191 |
target="_blank"
|
192 |
class="relative -bottom-[1px] flex items-center gap-1 text-sm font-normal text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
193 |
>
|
194 |
+
<IconExternal class="text-xs" />
|
195 |
Docs
|
196 |
</a>
|
197 |
</h2>
|
|
|
200 |
class="flex items-center gap-x-2 rounded-md border bg-white px-1.5 py-0.5 text-sm shadow-xs transition dark:border-gray-800 dark:bg-gray-800"
|
201 |
use:copy={installInstructions.content}
|
202 |
>
|
203 |
+
<IconCopyCode class="text-2xs" /> Copy code
|
204 |
</button>
|
205 |
</div>
|
206 |
</div>
|
|
|
226 |
class="flex items-center gap-x-2 rounded-md border bg-white px-1.5 py-0.5 text-sm shadow-xs transition dark:border-gray-800 dark:bg-gray-800"
|
227 |
use:copy={selectedSnippet?.content}
|
228 |
>
|
229 |
+
<IconCopyCode class="text-2xs" /> Copy code
|
230 |
</button>
|
231 |
</div>
|
232 |
</div>
|
src/lib/components/InferencePlayground/InferencePlaygroundProjectSelect.svelte
CHANGED
@@ -3,12 +3,15 @@
|
|
3 |
import { cn } from "$lib/utils/cn";
|
4 |
import { createSelect, createSync } from "@melt-ui/svelte";
|
5 |
import IconCaret from "../Icons/IconCaret.svelte";
|
6 |
-
import IconDelete from "
|
|
|
|
|
|
|
7 |
|
8 |
let classNames: string = "";
|
9 |
export { classNames as class };
|
10 |
|
11 |
-
|
12 |
|
13 |
const {
|
14 |
elements: { trigger, menu, option },
|
@@ -16,22 +19,22 @@
|
|
16 |
} = createSelect<string, false>();
|
17 |
const sync = createSync({ selected });
|
18 |
$: sync.selected({ value: getActiveProject($session).id, label: getActiveProject($session).name }, p => {
|
19 |
-
if (p
|
20 |
-
|
21 |
-
} else if (p) {
|
22 |
-
$session.activeProjectId = p?.value;
|
23 |
-
}
|
24 |
});
|
|
|
|
|
|
|
|
|
25 |
</script>
|
26 |
|
27 |
-
<div class="flex
|
28 |
<button
|
29 |
{...$trigger}
|
30 |
use:trigger
|
31 |
class={cn(
|
32 |
-
"relative flex items-center justify-between gap-6 overflow-hidden rounded-lg border bg-gray-100/80 px-3 py-1.5 leading-tight whitespace-nowrap shadow-sm",
|
33 |
-
"hover:brightness-95 dark:border-gray-700 dark:bg-gray-800 dark:hover:brightness-110"
|
34 |
-
classNames
|
35 |
)}
|
36 |
>
|
37 |
<div class="flex items-center gap-1 text-sm">
|
@@ -39,36 +42,47 @@
|
|
39 |
</div>
|
40 |
<IconCaret classNames="text-xl bg-gray-100 dark:bg-gray-600 rounded-sm size-4 flex-none absolute right-2" />
|
41 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
{...$option({ value: id, label: name })}
|
47 |
-
use:option
|
48 |
-
class="group block w-full p-1 text-sm dark:text-white"
|
49 |
-
>
|
50 |
-
<div
|
51 |
-
class="flex items-center gap-2 rounded-md px-2 py-1.5 group-data-[highlighted]:bg-gray-200 dark:group-data-[highlighted]:bg-gray-700"
|
52 |
-
>
|
53 |
-
{name}
|
54 |
-
<button
|
55 |
-
class="ml-auto grid place-items-center rounded-md p-1 hover:bg-gray-300 dark:hover:bg-gray-600"
|
56 |
-
on:click={e => {
|
57 |
-
e.stopPropagation();
|
58 |
-
session.deleteProject(id);
|
59 |
-
}}
|
60 |
-
>
|
61 |
-
<IconDelete />
|
62 |
-
</button>
|
63 |
-
</div>
|
64 |
-
</button>
|
65 |
-
{/each}
|
66 |
-
<button {...$option({ value: newProjectId })} use:option class="group block w-full p-1 text-sm dark:text-white">
|
67 |
<div
|
68 |
-
class="flex items-center gap-2 rounded-md
|
69 |
>
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
</div>
|
72 |
</button>
|
73 |
-
|
74 |
</div>
|
|
|
3 |
import { cn } from "$lib/utils/cn";
|
4 |
import { createSelect, createSync } from "@melt-ui/svelte";
|
5 |
import IconCaret from "../Icons/IconCaret.svelte";
|
6 |
+
import IconDelete from "~icons/carbon/trash-can";
|
7 |
+
import IconCross from "../Icons/IconCross.svelte";
|
8 |
+
import IconSave from "~icons/carbon/save";
|
9 |
+
import IconEdit from "~icons/carbon/edit";
|
10 |
|
11 |
let classNames: string = "";
|
12 |
export { classNames as class };
|
13 |
|
14 |
+
$: isDefault = getActiveProject($session).id === "default";
|
15 |
|
16 |
const {
|
17 |
elements: { trigger, menu, option },
|
|
|
19 |
} = createSelect<string, false>();
|
20 |
const sync = createSync({ selected });
|
21 |
$: sync.selected({ value: getActiveProject($session).id, label: getActiveProject($session).name }, p => {
|
22 |
+
if (!p) return;
|
23 |
+
$session.activeProjectId = p?.value;
|
|
|
|
|
|
|
24 |
});
|
25 |
+
|
26 |
+
function saveProject() {
|
27 |
+
session.saveProject(prompt("Project name") || "Project #" + ($session.projects.length + 1));
|
28 |
+
}
|
29 |
</script>
|
30 |
|
31 |
+
<div class={cn("flex w-full items-stretch gap-2 ", classNames)}>
|
32 |
<button
|
33 |
{...$trigger}
|
34 |
use:trigger
|
35 |
class={cn(
|
36 |
+
"relative flex grow items-center justify-between gap-6 overflow-hidden rounded-lg border bg-gray-100/80 px-3 py-1.5 leading-tight whitespace-nowrap shadow-sm",
|
37 |
+
"hover:brightness-95 dark:border-gray-700 dark:bg-gray-800 dark:hover:brightness-110"
|
|
|
38 |
)}
|
39 |
>
|
40 |
<div class="flex items-center gap-1 text-sm">
|
|
|
42 |
</div>
|
43 |
<IconCaret classNames="text-xl bg-gray-100 dark:bg-gray-600 rounded-sm size-4 flex-none absolute right-2" />
|
44 |
</button>
|
45 |
+
{#if isDefault}
|
46 |
+
<button class="btn size-[32px] p-0" on:click={saveProject}>
|
47 |
+
<IconSave />
|
48 |
+
</button>
|
49 |
+
{:else}
|
50 |
+
<button class="btn size-[32px] p-0" on:click={() => ($session.activeProjectId = "default")}>
|
51 |
+
<IconCross />
|
52 |
+
</button>
|
53 |
+
{/if}
|
54 |
+
</div>
|
55 |
|
56 |
+
<div {...$menu} use:menu class="rounded-lg border bg-gray-100 dark:border-gray-700 dark:bg-gray-800">
|
57 |
+
{#each $session.projects as { name, id } (id)}
|
58 |
+
<button {...$option({ value: id, label: name })} use:option class="group block w-full p-1 text-sm dark:text-white">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
<div
|
60 |
+
class="flex items-center gap-2 rounded-md py-1.5 pr-1 pl-2 group-data-[highlighted]:bg-gray-200 dark:group-data-[highlighted]:bg-gray-700"
|
61 |
>
|
62 |
+
{name}
|
63 |
+
{#if id !== "default"}
|
64 |
+
<div class="ml-auto flex items-center gap-1">
|
65 |
+
<button
|
66 |
+
class="grid place-items-center rounded-md p-1 text-xs hover:bg-gray-300 dark:hover:bg-gray-600"
|
67 |
+
on:click={e => {
|
68 |
+
e.stopPropagation();
|
69 |
+
session.updateProject(id, { name: prompt("Project name", name) || name });
|
70 |
+
}}
|
71 |
+
>
|
72 |
+
<IconEdit />
|
73 |
+
</button>
|
74 |
+
<button
|
75 |
+
class="grid place-items-center rounded-md p-1 text-xs hover:bg-gray-300 dark:hover:bg-gray-600"
|
76 |
+
on:click={e => {
|
77 |
+
e.stopPropagation();
|
78 |
+
session.deleteProject(id);
|
79 |
+
}}
|
80 |
+
>
|
81 |
+
<IconDelete />
|
82 |
+
</button>
|
83 |
+
</div>
|
84 |
+
{/if}
|
85 |
</div>
|
86 |
</button>
|
87 |
+
{/each}
|
88 |
</div>
|
src/lib/stores/session.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4 |
PipelineTag,
|
5 |
type Conversation,
|
6 |
type ConversationMessage,
|
|
|
7 |
type ModelWithTokenizer,
|
8 |
type Project,
|
9 |
type Session,
|
@@ -36,35 +37,35 @@ const emptyModel: ModelWithTokenizer = {
|
|
36 |
},
|
37 |
};
|
38 |
|
39 |
-
function
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
};
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
|
65 |
-
|
66 |
-
|
67 |
|
|
|
68 |
const store = writable<Session>(undefined, set => {
|
69 |
const { defaultConversation, defaultProject } = getDefaults();
|
70 |
|
@@ -148,6 +149,9 @@ function createSessionStore() {
|
|
148 |
localStorage.removeItem(LOCAL_STORAGE_KEY);
|
149 |
}
|
150 |
|
|
|
|
|
|
|
151 |
function addProject(name: string) {
|
152 |
const { defaultConversation } = getDefaults();
|
153 |
update(s => {
|
@@ -161,19 +165,50 @@ function createSessionStore() {
|
|
161 |
});
|
162 |
}
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
function deleteProject(id: string) {
|
|
|
|
|
|
|
165 |
update(s => {
|
166 |
const projects = s.projects.filter(p => p.id !== id);
|
167 |
if (projects.length === 0) {
|
168 |
const { defaultProject } = getDefaults();
|
169 |
-
|
|
|
170 |
}
|
|
|
171 |
const currProject = projects.find(p => p.id === s.activeProjectId);
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
});
|
174 |
}
|
175 |
|
176 |
-
return { ...store, set, update, clearSavedSession, addProject, deleteProject };
|
177 |
}
|
178 |
|
179 |
export const session = createSessionStore();
|
|
|
4 |
PipelineTag,
|
5 |
type Conversation,
|
6 |
type ConversationMessage,
|
7 |
+
type DefaultProject,
|
8 |
type ModelWithTokenizer,
|
9 |
type Project,
|
10 |
type Session,
|
|
|
37 |
},
|
38 |
};
|
39 |
|
40 |
+
function getDefaults() {
|
41 |
+
const $models = get(models);
|
42 |
+
const featured = getTrending($models);
|
43 |
+
const defaultModel = featured[0] ?? $models[0] ?? emptyModel;
|
44 |
+
|
45 |
+
// Parse URL query parameters
|
46 |
+
const searchParams = new URLSearchParams(window.location.search);
|
47 |
+
const searchProviders = searchParams.getAll("provider");
|
48 |
+
const searchModelIds = searchParams.getAll("modelId");
|
49 |
+
const modelsFromSearch = searchModelIds.map(id => $models.find(model => model.id === id)).filter(Boolean);
|
50 |
+
|
51 |
+
const defaultConversation: Conversation = {
|
52 |
+
model: defaultModel,
|
53 |
+
config: { ...defaultGenerationConfig },
|
54 |
+
messages: [{ ...startMessageUser }],
|
55 |
+
systemMessage,
|
56 |
+
streaming: true,
|
57 |
+
};
|
|
|
58 |
|
59 |
+
const defaultProject: DefaultProject = {
|
60 |
+
name: "Default",
|
61 |
+
id: "default",
|
62 |
+
conversations: [defaultConversation],
|
63 |
+
};
|
64 |
|
65 |
+
return { defaultProject, defaultConversation };
|
66 |
+
}
|
67 |
|
68 |
+
function createSessionStore() {
|
69 |
const store = writable<Session>(undefined, set => {
|
70 |
const { defaultConversation, defaultProject } = getDefaults();
|
71 |
|
|
|
149 |
localStorage.removeItem(LOCAL_STORAGE_KEY);
|
150 |
}
|
151 |
|
152 |
+
/**
|
153 |
+
* @deprecated - Use `saveProject` instead
|
154 |
+
*/
|
155 |
function addProject(name: string) {
|
156 |
const { defaultConversation } = getDefaults();
|
157 |
update(s => {
|
|
|
165 |
});
|
166 |
}
|
167 |
|
168 |
+
/**
|
169 |
+
* Saves a new project with the data inside the default project
|
170 |
+
*/
|
171 |
+
function saveProject(name: string) {
|
172 |
+
update(s => {
|
173 |
+
const defaultProject = s.projects.find(p => p.id === "default");
|
174 |
+
if (!defaultProject) return s;
|
175 |
+
const project: Project = {
|
176 |
+
...defaultProject,
|
177 |
+
name,
|
178 |
+
id: crypto.randomUUID(),
|
179 |
+
};
|
180 |
+
|
181 |
+
return { ...s, projects: [...s.projects, project], activeProjectId: project.id };
|
182 |
+
});
|
183 |
+
}
|
184 |
+
|
185 |
function deleteProject(id: string) {
|
186 |
+
// Can't delete default project!
|
187 |
+
if (id === "default") return;
|
188 |
+
|
189 |
update(s => {
|
190 |
const projects = s.projects.filter(p => p.id !== id);
|
191 |
if (projects.length === 0) {
|
192 |
const { defaultProject } = getDefaults();
|
193 |
+
const newSession = { ...s, projects: [defaultProject], activeProjectId: defaultProject.id };
|
194 |
+
return typia.is<Session>(newSession) ? newSession : s;
|
195 |
}
|
196 |
+
|
197 |
const currProject = projects.find(p => p.id === s.activeProjectId);
|
198 |
+
const newSession = { ...s, projects, activeProjectId: currProject?.id ?? projects[0]?.id! };
|
199 |
+
return typia.is<Session>(newSession) ? newSession : s;
|
200 |
+
});
|
201 |
+
}
|
202 |
+
|
203 |
+
function updateProject(id: string, data: Partial<Project>) {
|
204 |
+
update(s => {
|
205 |
+
const projects = s.projects.map(p => (p.id === id ? { ...p, ...data } : p));
|
206 |
+
const newSession = { ...s, projects };
|
207 |
+
return typia.is<Session>(newSession) ? newSession : s;
|
208 |
});
|
209 |
}
|
210 |
|
211 |
+
return { ...store, set, update, clearSavedSession, addProject, deleteProject, saveProject, updateProject };
|
212 |
}
|
213 |
|
214 |
export const session = createSessionStore();
|
src/lib/types.ts
CHANGED
@@ -18,8 +18,13 @@ export type Project = {
|
|
18 |
name: string;
|
19 |
};
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
export type Session = {
|
22 |
-
projects: Project[];
|
23 |
activeProjectId: string;
|
24 |
};
|
25 |
|
|
|
18 |
name: string;
|
19 |
};
|
20 |
|
21 |
+
export type DefaultProject = Project & {
|
22 |
+
id: "default";
|
23 |
+
name: "Default";
|
24 |
+
};
|
25 |
+
|
26 |
export type Session = {
|
27 |
+
projects: [DefaultProject, ...Project[]];
|
28 |
activeProjectId: string;
|
29 |
};
|
30 |
|
vite.config.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import { sveltekit } from "@sveltejs/kit/vite";
|
2 |
import { defineConfig } from "vite";
|
3 |
import UnpluginTypia from "@ryoppippi/unplugin-typia/vite";
|
|
|
4 |
|
5 |
export default defineConfig({
|
6 |
plugins: [
|
@@ -9,5 +10,9 @@ export default defineConfig({
|
|
9 |
cache: false,
|
10 |
}),
|
11 |
sveltekit(),
|
|
|
|
|
|
|
|
|
12 |
],
|
13 |
});
|
|
|
1 |
import { sveltekit } from "@sveltejs/kit/vite";
|
2 |
import { defineConfig } from "vite";
|
3 |
import UnpluginTypia from "@ryoppippi/unplugin-typia/vite";
|
4 |
+
import Icons from "unplugin-icons/vite";
|
5 |
|
6 |
export default defineConfig({
|
7 |
plugins: [
|
|
|
10 |
cache: false,
|
11 |
}),
|
12 |
sveltekit(),
|
13 |
+
Icons({
|
14 |
+
compiler: "svelte",
|
15 |
+
autoInstall: true,
|
16 |
+
}),
|
17 |
],
|
18 |
});
|