feat: add run script

This commit is contained in:
熊潇 2025-04-27 23:50:22 +08:00
parent 6867de838e
commit 97acbfcf35
11 changed files with 93 additions and 517 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@kevisual/assistant-cli",
"version": "0.0.1",
"version": "0.0.4",
"description": "",
"main": "dist/assistant.mjs",
"keywords": [
@ -15,14 +15,16 @@
"files": [
"dist",
"bin",
"bun.config.mjs"
"bun.config.mjs",
"libs"
],
"scripts": {
"dev": "bun run src/run.ts ",
"dev:server": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 bun --watch src/run-server.ts ",
"build:lib": "bun run bun-lib.config.mjs",
"postbuild:lib": "dts -i src/lib.ts -o assistant-lib.d.ts -d libs -t",
"build": "rimraf dist && bun run bun.config.mjs"
"build": "rimraf dist && bun run bun.config.mjs",
"postbuild": "pnpm run build:lib"
},
"bin": {
"ev-assistant": "bin/assistant.js",
@ -61,13 +63,9 @@
"inquirer": "^12.6.0",
"lodash-es": "^4.17.21",
"nanoid": "^5.1.5",
"pino": "^9.6.0",
"pino-pretty": "^13.0.0",
"send": "^1.2.0",
"supports-color": "^10.0.0",
"tslib": "^2.8.1",
"ws": "npm:@kevisual/ws",
"zustand": "^5.0.3"
"ws": "npm:@kevisual/ws"
},
"engines": {
"node": ">=22.0.0"
@ -76,7 +74,6 @@
"access": "public"
},
"dependencies": {
"esbuild": "^0.25.3",
"pm2": "^6.0.5"
}
}

477
assistant/pnpm-lock.yaml generated
View File

@ -8,9 +8,6 @@ importers:
.:
dependencies:
esbuild:
specifier: ^0.25.3
version: 0.25.3
pm2:
specifier: ^6.0.5
version: 6.0.5(supports-color@10.0.0)
@ -84,27 +81,15 @@ importers:
nanoid:
specifier: ^5.1.5
version: 5.1.5
pino:
specifier: ^9.6.0
version: 9.6.0
pino-pretty:
specifier: ^13.0.0
version: 13.0.0
send:
specifier: ^1.2.0
version: 1.2.0(supports-color@10.0.0)
supports-color:
specifier: ^10.0.0
version: 10.0.0
tslib:
specifier: ^2.8.1
version: 2.8.1
ws:
specifier: npm:@kevisual/ws
version: '@kevisual/ws@8.0.0'
zustand:
specifier: ^5.0.3
version: 5.0.3
tasks/silkyai-cli:
dependencies:
@ -153,156 +138,6 @@ packages:
resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==}
engines: {node: '>=6.9.0'}
'@esbuild/aix-ppc64@0.25.3':
resolution: {integrity: sha512-W8bFfPA8DowP8l//sxjJLSLkD8iEjMc7cBVyP+u4cEv9sM7mdUCkgsj+t0n/BWPFtv7WWCN5Yzj0N6FJNUUqBQ==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [aix]
'@esbuild/android-arm64@0.25.3':
resolution: {integrity: sha512-XelR6MzjlZuBM4f5z2IQHK6LkK34Cvv6Rj2EntER3lwCBFdg6h2lKbtRjpTTsdEjD/WSe1q8UyPBXP1x3i/wYQ==}
engines: {node: '>=18'}
cpu: [arm64]
os: [android]
'@esbuild/android-arm@0.25.3':
resolution: {integrity: sha512-PuwVXbnP87Tcff5I9ngV0lmiSu40xw1At6i3GsU77U7cjDDB4s0X2cyFuBiDa1SBk9DnvWwnGvVaGBqoFWPb7A==}
engines: {node: '>=18'}
cpu: [arm]
os: [android]
'@esbuild/android-x64@0.25.3':
resolution: {integrity: sha512-ogtTpYHT/g1GWS/zKM0cc/tIebFjm1F9Aw1boQ2Y0eUQ+J89d0jFY//s9ei9jVIlkYi8AfOjiixcLJSGNSOAdQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [android]
'@esbuild/darwin-arm64@0.25.3':
resolution: {integrity: sha512-eESK5yfPNTqpAmDfFWNsOhmIOaQA59tAcF/EfYvo5/QWQCzXn5iUSOnqt3ra3UdzBv073ykTtmeLJZGt3HhA+w==}
engines: {node: '>=18'}
cpu: [arm64]
os: [darwin]
'@esbuild/darwin-x64@0.25.3':
resolution: {integrity: sha512-Kd8glo7sIZtwOLcPbW0yLpKmBNWMANZhrC1r6K++uDR2zyzb6AeOYtI6udbtabmQpFaxJ8uduXMAo1gs5ozz8A==}
engines: {node: '>=18'}
cpu: [x64]
os: [darwin]
'@esbuild/freebsd-arm64@0.25.3':
resolution: {integrity: sha512-EJiyS70BYybOBpJth3M0KLOus0n+RRMKTYzhYhFeMwp7e/RaajXvP+BWlmEXNk6uk+KAu46j/kaQzr6au+JcIw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [freebsd]
'@esbuild/freebsd-x64@0.25.3':
resolution: {integrity: sha512-Q+wSjaLpGxYf7zC0kL0nDlhsfuFkoN+EXrx2KSB33RhinWzejOd6AvgmP5JbkgXKmjhmpfgKZq24pneodYqE8Q==}
engines: {node: '>=18'}
cpu: [x64]
os: [freebsd]
'@esbuild/linux-arm64@0.25.3':
resolution: {integrity: sha512-xCUgnNYhRD5bb1C1nqrDV1PfkwgbswTTBRbAd8aH5PhYzikdf/ddtsYyMXFfGSsb/6t6QaPSzxtbfAZr9uox4A==}
engines: {node: '>=18'}
cpu: [arm64]
os: [linux]
'@esbuild/linux-arm@0.25.3':
resolution: {integrity: sha512-dUOVmAUzuHy2ZOKIHIKHCm58HKzFqd+puLaS424h6I85GlSDRZIA5ycBixb3mFgM0Jdh+ZOSB6KptX30DD8YOQ==}
engines: {node: '>=18'}
cpu: [arm]
os: [linux]
'@esbuild/linux-ia32@0.25.3':
resolution: {integrity: sha512-yplPOpczHOO4jTYKmuYuANI3WhvIPSVANGcNUeMlxH4twz/TeXuzEP41tGKNGWJjuMhotpGabeFYGAOU2ummBw==}
engines: {node: '>=18'}
cpu: [ia32]
os: [linux]
'@esbuild/linux-loong64@0.25.3':
resolution: {integrity: sha512-P4BLP5/fjyihmXCELRGrLd793q/lBtKMQl8ARGpDxgzgIKJDRJ/u4r1A/HgpBpKpKZelGct2PGI4T+axcedf6g==}
engines: {node: '>=18'}
cpu: [loong64]
os: [linux]
'@esbuild/linux-mips64el@0.25.3':
resolution: {integrity: sha512-eRAOV2ODpu6P5divMEMa26RRqb2yUoYsuQQOuFUexUoQndm4MdpXXDBbUoKIc0iPa4aCO7gIhtnYomkn2x+bag==}
engines: {node: '>=18'}
cpu: [mips64el]
os: [linux]
'@esbuild/linux-ppc64@0.25.3':
resolution: {integrity: sha512-ZC4jV2p7VbzTlnl8nZKLcBkfzIf4Yad1SJM4ZMKYnJqZFD4rTI+pBG65u8ev4jk3/MPwY9DvGn50wi3uhdaghg==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [linux]
'@esbuild/linux-riscv64@0.25.3':
resolution: {integrity: sha512-LDDODcFzNtECTrUUbVCs6j9/bDVqy7DDRsuIXJg6so+mFksgwG7ZVnTruYi5V+z3eE5y+BJZw7VvUadkbfg7QA==}
engines: {node: '>=18'}
cpu: [riscv64]
os: [linux]
'@esbuild/linux-s390x@0.25.3':
resolution: {integrity: sha512-s+w/NOY2k0yC2p9SLen+ymflgcpRkvwwa02fqmAwhBRI3SC12uiS10edHHXlVWwfAagYSY5UpmT/zISXPMW3tQ==}
engines: {node: '>=18'}
cpu: [s390x]
os: [linux]
'@esbuild/linux-x64@0.25.3':
resolution: {integrity: sha512-nQHDz4pXjSDC6UfOE1Fw9Q8d6GCAd9KdvMZpfVGWSJztYCarRgSDfOVBY5xwhQXseiyxapkiSJi/5/ja8mRFFA==}
engines: {node: '>=18'}
cpu: [x64]
os: [linux]
'@esbuild/netbsd-arm64@0.25.3':
resolution: {integrity: sha512-1QaLtOWq0mzK6tzzp0jRN3eccmN3hezey7mhLnzC6oNlJoUJz4nym5ZD7mDnS/LZQgkrhEbEiTn515lPeLpgWA==}
engines: {node: '>=18'}
cpu: [arm64]
os: [netbsd]
'@esbuild/netbsd-x64@0.25.3':
resolution: {integrity: sha512-i5Hm68HXHdgv8wkrt+10Bc50zM0/eonPb/a/OFVfB6Qvpiirco5gBA5bz7S2SHuU+Y4LWn/zehzNX14Sp4r27g==}
engines: {node: '>=18'}
cpu: [x64]
os: [netbsd]
'@esbuild/openbsd-arm64@0.25.3':
resolution: {integrity: sha512-zGAVApJEYTbOC6H/3QBr2mq3upG/LBEXr85/pTtKiv2IXcgKV0RT0QA/hSXZqSvLEpXeIxah7LczB4lkiYhTAQ==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openbsd]
'@esbuild/openbsd-x64@0.25.3':
resolution: {integrity: sha512-fpqctI45NnCIDKBH5AXQBsD0NDPbEFczK98hk/aa6HJxbl+UtLkJV2+Bvy5hLSLk3LHmqt0NTkKNso1A9y1a4w==}
engines: {node: '>=18'}
cpu: [x64]
os: [openbsd]
'@esbuild/sunos-x64@0.25.3':
resolution: {integrity: sha512-ROJhm7d8bk9dMCUZjkS8fgzsPAZEjtRJqCAmVgB0gMrvG7hfmPmz9k1rwO4jSiblFjYmNvbECL9uhaPzONMfgA==}
engines: {node: '>=18'}
cpu: [x64]
os: [sunos]
'@esbuild/win32-arm64@0.25.3':
resolution: {integrity: sha512-YWcow8peiHpNBiIXHwaswPnAXLsLVygFwCB3A7Bh5jRkIBFWHGmNQ48AlX4xDvQNoMZlPYzjVOQDYEzWCqufMQ==}
engines: {node: '>=18'}
cpu: [arm64]
os: [win32]
'@esbuild/win32-ia32@0.25.3':
resolution: {integrity: sha512-qspTZOIGoXVS4DpNqUYUs9UxVb04khS1Degaw/MnfMe7goQ3lTfQ13Vw4qY/Nj0979BGvMRpAYbs/BAxEvU8ew==}
engines: {node: '>=18'}
cpu: [ia32]
os: [win32]
'@esbuild/win32-x64@0.25.3':
resolution: {integrity: sha512-ICgUR+kPimx0vvRzf+N/7L7tVSQeE3BYY+NhHRHXS1kBuPO7z2+7ea2HbhDyZdTephgvNvKrlDDKUexuCVBVvg==}
engines: {node: '>=18'}
cpu: [x64]
os: [win32]
'@inquirer/checkbox@4.1.5':
resolution: {integrity: sha512-swPczVU+at65xa5uPfNP9u3qx/alNwiaykiI/ExpsmMSQW55trmZcwhYWzw/7fj+n6Q8z1eENvR7vFfq9oPSAQ==}
engines: {node: '>=18'}
@ -720,10 +555,6 @@ packages:
asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
atomic-sleep@1.0.0:
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
engines: {node: '>=8.0.0'}
basic-ftp@5.0.5:
resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==}
engines: {node: '>=10.0.0'}
@ -787,9 +618,6 @@ packages:
color-name@1.1.4:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
colorette@2.0.20:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
@ -823,9 +651,6 @@ packages:
resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==}
engines: {node: '>= 14'}
dateformat@4.6.3:
resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==}
dayjs@1.11.13:
resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==}
@ -892,9 +717,6 @@ packages:
resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}
engines: {node: '>= 0.8'}
end-of-stream@1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
enquirer@2.3.6:
resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==}
engines: {node: '>=8.6'}
@ -915,11 +737,6 @@ packages:
resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}
engines: {node: '>= 0.4'}
esbuild@0.25.3:
resolution: {integrity: sha512-qKA6Pvai73+M2FtftpNKRxJ78GIjmFXFxd/1DVBqGo/qNhLSfv+G12n9pNoWdytJC8U00TrViOwpjT0zgqQS8Q==}
engines: {node: '>=18'}
hasBin: true
escape-html@1.0.3:
resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
@ -972,19 +789,9 @@ packages:
extrareqp2@1.0.0:
resolution: {integrity: sha512-Gum0g1QYb6wpPJCVypWP3bbIuaibcFiJcpuPM10YSXp/tzqi84x9PJageob+eN4xVRIOto4wjSGNLyMD54D2xA==}
fast-copy@3.0.2:
resolution: {integrity: sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==}
fast-json-patch@3.1.1:
resolution: {integrity: sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==}
fast-redact@3.5.0:
resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==}
engines: {node: '>=6'}
fast-safe-stringify@2.1.1:
resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
fclone@1.0.11:
resolution: {integrity: sha512-GDqVQezKzRABdeqflsgMr7ktzgF9CyS+p2oe0jJqUY6izSSbhPIQJDpoU4PtGcD7VPM9xh/dVrTu6z1nwgmEGw==}
@ -1083,9 +890,6 @@ packages:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
help-me@5.0.0:
resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==}
http-errors@2.0.0:
resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==}
engines: {node: '>= 0.8'}
@ -1160,10 +964,6 @@ packages:
isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
joycon@3.1.1:
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
js-git@0.7.8:
resolution: {integrity: sha512-+E5ZH/HeRnoc/LW0AmAyhU+mNcWBzAKE+30+IDMLSLbbK+Tdt02AdkOKq9u15rlJsDEGFqtgckc8ZM59LhhiUA==}
@ -1217,9 +1017,6 @@ packages:
resolution: {integrity: sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==}
engines: {node: '>= 0.6'}
minimist@1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
mkdirp@1.0.4:
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
engines: {node: '>=10'}
@ -1273,17 +1070,10 @@ packages:
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
engines: {node: '>=0.10.0'}
on-exit-leak-free@2.1.2:
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
engines: {node: '>=14.0.0'}
on-finished@2.4.1:
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
engines: {node: '>= 0.8'}
once@1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
openai@4.96.0:
resolution: {integrity: sha512-dKoW56i02Prv2XQolJ9Rl9Svqubqkzg3QpwEOBuSVZLk05Shelu7s+ErRTwFc1Bs3JZ2qBqBfVpXQiJhwOGG8A==}
hasBin: true
@ -1341,20 +1131,6 @@ packages:
resolution: {integrity: sha512-g0VU+y08pKw5M8EZ2rIGiEBaB8wrQMjYGFfW2QVIfyT8V+fq8YFLkvlz4bz5ljvFDJYNFCWT3PWqcRr2FKO81w==}
engines: {node: '>=10'}
pino-abstract-transport@2.0.0:
resolution: {integrity: sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==}
pino-pretty@13.0.0:
resolution: {integrity: sha512-cQBBIVG3YajgoUjo1FdKVRX6t9XPxwB9lcNJVD5GCnNM4Y6T12YYx8c6zEejxQsU0wrg9TwmDulcE9LR7qcJqA==}
hasBin: true
pino-std-serializers@7.0.0:
resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==}
pino@9.6.0:
resolution: {integrity: sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==}
hasBin: true
pm2-axon-rpc@0.7.1:
resolution: {integrity: sha512-FbLvW60w+vEyvMjP/xom2UPhUN/2bVpdtLfKJeYM3gwzYhoTEEChCOICfFzxkxuoEleOlnpjie+n1nue91bDQw==}
engines: {node: '>=5'}
@ -1378,9 +1154,6 @@ packages:
engines: {node: '>=16.0.0'}
hasBin: true
process-warning@4.0.1:
resolution: {integrity: sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==}
promptly@2.2.0:
resolution: {integrity: sha512-aC9j+BZsRSSzEsXBNBwDnAxujdx19HycZoKgRgzWnS8eOHg1asuf9heuLprfbe739zY3IdUQx+Egv6Jn135WHA==}
@ -1391,12 +1164,6 @@ packages:
proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
pump@3.0.2:
resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==}
quick-format-unescaped@4.0.4:
resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}
range-parser@1.2.1:
resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}
engines: {node: '>= 0.6'}
@ -1409,10 +1176,6 @@ packages:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
real-require@0.2.0:
resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
engines: {node: '>= 12.13.0'}
require-in-the-middle@5.2.0:
resolution: {integrity: sha512-efCx3b+0Z69/LGJmm9Yvi4cqEdxnoGnxYxGxBghkkTTFeXRtTCmmhO0AnAfHz59k957uTSuy8WaHqOs8wbYUWg==}
engines: {node: '>=6'}
@ -1447,19 +1210,12 @@ packages:
safe-buffer@5.2.1:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
safe-stable-stringify@2.5.0:
resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==}
engines: {node: '>=10'}
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
sax@1.4.1:
resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==}
secure-json-parse@2.7.0:
resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==}
selfsigned@2.4.1:
resolution: {integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==}
engines: {node: '>=10'}
@ -1511,9 +1267,6 @@ packages:
resolution: {integrity: sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==}
engines: {node: '>= 10.0.0', npm: '>= 3.0.0'}
sonic-boom@4.2.0:
resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==}
source-map-support@0.5.21:
resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
@ -1521,10 +1274,6 @@ packages:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
split2@4.2.0:
resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}
engines: {node: '>= 10.x'}
sprintf-js@1.1.2:
resolution: {integrity: sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==}
@ -1543,10 +1292,6 @@ packages:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
strip-json-comments@3.1.1:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
supports-color@10.0.0:
resolution: {integrity: sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==}
engines: {node: '>=18'}
@ -1565,9 +1310,6 @@ packages:
os: [darwin, linux, win32, freebsd, openbsd, netbsd, sunos, android]
hasBin: true
thread-stream@3.1.0:
resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==}
tmp@0.0.33:
resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
engines: {node: '>=0.6.0'}
@ -1634,9 +1376,6 @@ packages:
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
engines: {node: '>=8'}
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
ws@7.5.10:
resolution: {integrity: sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==}
engines: {node: '>=8.3.0'}
@ -1656,24 +1395,6 @@ packages:
resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==}
engines: {node: '>=18'}
zustand@5.0.3:
resolution: {integrity: sha512-14fwWQtU3pH4dE0dOpdMiWjddcH+QzKIgk1cl8epwSE7yag43k/AD/m4L6+K7DytAOr9gGBe3/EXj9g7cdostg==}
engines: {node: '>=12.20.0'}
peerDependencies:
'@types/react': '>=18.0.0'
immer: '>=9.0.6'
react: '>=18.0.0'
use-sync-external-store: '>=1.2.0'
peerDependenciesMeta:
'@types/react':
optional: true
immer:
optional: true
react:
optional: true
use-sync-external-store:
optional: true
snapshots:
'@babel/code-frame@7.26.2':
@ -1686,81 +1407,6 @@ snapshots:
'@babel/helper-validator-identifier@7.25.9':
optional: true
'@esbuild/aix-ppc64@0.25.3':
optional: true
'@esbuild/android-arm64@0.25.3':
optional: true
'@esbuild/android-arm@0.25.3':
optional: true
'@esbuild/android-x64@0.25.3':
optional: true
'@esbuild/darwin-arm64@0.25.3':
optional: true
'@esbuild/darwin-x64@0.25.3':
optional: true
'@esbuild/freebsd-arm64@0.25.3':
optional: true
'@esbuild/freebsd-x64@0.25.3':
optional: true
'@esbuild/linux-arm64@0.25.3':
optional: true
'@esbuild/linux-arm@0.25.3':
optional: true
'@esbuild/linux-ia32@0.25.3':
optional: true
'@esbuild/linux-loong64@0.25.3':
optional: true
'@esbuild/linux-mips64el@0.25.3':
optional: true
'@esbuild/linux-ppc64@0.25.3':
optional: true
'@esbuild/linux-riscv64@0.25.3':
optional: true
'@esbuild/linux-s390x@0.25.3':
optional: true
'@esbuild/linux-x64@0.25.3':
optional: true
'@esbuild/netbsd-arm64@0.25.3':
optional: true
'@esbuild/netbsd-x64@0.25.3':
optional: true
'@esbuild/openbsd-arm64@0.25.3':
optional: true
'@esbuild/openbsd-x64@0.25.3':
optional: true
'@esbuild/sunos-x64@0.25.3':
optional: true
'@esbuild/win32-arm64@0.25.3':
optional: true
'@esbuild/win32-ia32@0.25.3':
optional: true
'@esbuild/win32-x64@0.25.3':
optional: true
'@inquirer/checkbox@4.1.5(@types/node@22.15.2)':
dependencies:
'@inquirer/core': 10.1.10(@types/node@22.15.2)
@ -2180,8 +1826,6 @@ snapshots:
asynckit@0.4.0: {}
atomic-sleep@1.0.0: {}
basic-ftp@5.0.5: {}
binary-extensions@2.3.0: {}
@ -2240,8 +1884,6 @@ snapshots:
color-name@1.1.4: {}
colorette@2.0.20: {}
combined-stream@1.0.8:
dependencies:
delayed-stream: 1.0.0
@ -2268,8 +1910,6 @@ snapshots:
data-uri-to-buffer@6.0.2: {}
dateformat@4.6.3: {}
dayjs@1.11.13: {}
dayjs@1.8.36: {}
@ -2318,10 +1958,6 @@ snapshots:
encodeurl@2.0.0: {}
end-of-stream@1.4.4:
dependencies:
once: 1.4.0
enquirer@2.3.6:
dependencies:
ansi-colors: 4.1.3
@ -2341,34 +1977,6 @@ snapshots:
has-tostringtag: 1.0.2
hasown: 2.0.2
esbuild@0.25.3:
optionalDependencies:
'@esbuild/aix-ppc64': 0.25.3
'@esbuild/android-arm': 0.25.3
'@esbuild/android-arm64': 0.25.3
'@esbuild/android-x64': 0.25.3
'@esbuild/darwin-arm64': 0.25.3
'@esbuild/darwin-x64': 0.25.3
'@esbuild/freebsd-arm64': 0.25.3
'@esbuild/freebsd-x64': 0.25.3
'@esbuild/linux-arm': 0.25.3
'@esbuild/linux-arm64': 0.25.3
'@esbuild/linux-ia32': 0.25.3
'@esbuild/linux-loong64': 0.25.3
'@esbuild/linux-mips64el': 0.25.3
'@esbuild/linux-ppc64': 0.25.3
'@esbuild/linux-riscv64': 0.25.3
'@esbuild/linux-s390x': 0.25.3
'@esbuild/linux-x64': 0.25.3
'@esbuild/netbsd-arm64': 0.25.3
'@esbuild/netbsd-x64': 0.25.3
'@esbuild/openbsd-arm64': 0.25.3
'@esbuild/openbsd-x64': 0.25.3
'@esbuild/sunos-x64': 0.25.3
'@esbuild/win32-arm64': 0.25.3
'@esbuild/win32-ia32': 0.25.3
'@esbuild/win32-x64': 0.25.3
escape-html@1.0.3: {}
escape-string-regexp@4.0.0: {}
@ -2411,14 +2019,8 @@ snapshots:
transitivePeerDependencies:
- debug
fast-copy@3.0.2: {}
fast-json-patch@3.1.1: {}
fast-redact@3.5.0: {}
fast-safe-stringify@2.1.1: {}
fclone@1.0.11: {}
fdir@6.4.4(picomatch@4.0.2):
@ -2506,8 +2108,6 @@ snapshots:
dependencies:
function-bind: 1.1.2
help-me@5.0.0: {}
http-errors@2.0.0:
dependencies:
depd: 2.0.0
@ -2587,8 +2187,6 @@ snapshots:
isexe@2.0.0: {}
joycon@3.1.1: {}
js-git@0.7.8:
dependencies:
bodec: 0.1.0
@ -2636,8 +2234,6 @@ snapshots:
dependencies:
mime-db: 1.54.0
minimist@1.2.8: {}
mkdirp@1.0.4: {}
module-details-from-path@1.0.3: {}
@ -2670,16 +2266,10 @@ snapshots:
normalize-path@3.0.0: {}
on-exit-leak-free@2.1.2: {}
on-finished@2.4.1:
dependencies:
ee-first: 1.1.1
once@1.4.0:
dependencies:
wrappy: 1.0.2
openai@4.96.0(@kevisual/ws@8.0.0):
dependencies:
'@types/node': 18.19.87
@ -2738,42 +2328,6 @@ snapshots:
dependencies:
safe-buffer: 5.2.1
pino-abstract-transport@2.0.0:
dependencies:
split2: 4.2.0
pino-pretty@13.0.0:
dependencies:
colorette: 2.0.20
dateformat: 4.6.3
fast-copy: 3.0.2
fast-safe-stringify: 2.1.1
help-me: 5.0.0
joycon: 3.1.1
minimist: 1.2.8
on-exit-leak-free: 2.1.2
pino-abstract-transport: 2.0.0
pump: 3.0.2
secure-json-parse: 2.7.0
sonic-boom: 4.2.0
strip-json-comments: 3.1.1
pino-std-serializers@7.0.0: {}
pino@9.6.0:
dependencies:
atomic-sleep: 1.0.0
fast-redact: 3.5.0
on-exit-leak-free: 2.1.2
pino-abstract-transport: 2.0.0
pino-std-serializers: 7.0.0
process-warning: 4.0.1
quick-format-unescaped: 4.0.4
real-require: 0.2.0
safe-stable-stringify: 2.5.0
sonic-boom: 4.2.0
thread-stream: 3.1.0
pm2-axon-rpc@0.7.1(supports-color@10.0.0):
dependencies:
debug: 4.4.0(supports-color@10.0.0)
@ -2847,8 +2401,6 @@ snapshots:
- supports-color
- utf-8-validate
process-warning@4.0.1: {}
promptly@2.2.0:
dependencies:
read: 1.0.7
@ -2868,13 +2420,6 @@ snapshots:
proxy-from-env@1.1.0: {}
pump@3.0.2:
dependencies:
end-of-stream: 1.4.4
once: 1.4.0
quick-format-unescaped@4.0.4: {}
range-parser@1.2.1: {}
read@1.0.7:
@ -2885,8 +2430,6 @@ snapshots:
dependencies:
picomatch: 2.3.1
real-require@0.2.0: {}
require-in-the-middle@5.2.0(supports-color@10.0.0):
dependencies:
debug: 4.4.0(supports-color@10.0.0)
@ -2945,14 +2488,10 @@ snapshots:
safe-buffer@5.2.1: {}
safe-stable-stringify@2.5.0: {}
safer-buffer@2.1.2: {}
sax@1.4.1: {}
secure-json-parse@2.7.0: {}
selfsigned@2.4.1:
dependencies:
'@types/node-forge': 1.3.11
@ -3009,10 +2548,6 @@ snapshots:
ip-address: 9.0.5
smart-buffer: 4.2.0
sonic-boom@4.2.0:
dependencies:
atomic-sleep: 1.0.0
source-map-support@0.5.21:
dependencies:
buffer-from: 1.1.2
@ -3020,8 +2555,6 @@ snapshots:
source-map@0.6.1: {}
split2@4.2.0: {}
sprintf-js@1.1.2: {}
sprintf-js@1.1.3: {}
@ -3038,8 +2571,6 @@ snapshots:
dependencies:
ansi-regex: 5.0.1
strip-json-comments@3.1.1: {}
supports-color@10.0.0: {}
supports-color@7.2.0:
@ -3051,10 +2582,6 @@ snapshots:
systeminformation@5.25.11:
optional: true
thread-stream@3.1.0:
dependencies:
real-require: 0.2.0
tmp@0.0.33:
dependencies:
os-tmpdir: 1.0.2
@ -3112,12 +2639,8 @@ snapshots:
string-width: 4.2.3
strip-ansi: 6.0.1
wrappy@1.0.2: {}
ws@7.5.10: {}
yallist@4.0.0: {}
yoctocolors-cjs@2.1.2: {}
zustand@5.0.3: {}

View File

@ -1,2 +1,3 @@
packages:
- 'tasks/**'
- '!assistant-app/**'

View File

@ -0,0 +1,34 @@
import { program, Command, assistantConfig } from '@/program.ts';
import { spawnSync } from 'node:child_process';
const runScriptsCommand = new Command('run-scripts')
.alias('run')
.arguments('<cmd> [env]')
.description('运行脚本在assistant.config.json中配置的脚本')
.action(async (cmd, env) => {
assistantConfig.checkMounted();
const configs = assistantConfig.getCacheAssistantConfig();
const scripts = configs?.scripts || {};
try {
const script = scripts[cmd];
if (!script) {
console.error(`Script "${cmd}" not found.`);
return;
}
// console.log(`Running script "${script}"...`);
const command = [script, ...(env ? [env] : [])].join(' ');
// console.log(`Command: ${command}`, env);
const res = spawnSync(command, { shell: true, stdio: 'inherit', cwd: assistantConfig.configDir });
if (res.error) {
console.error(`Error running script "${cmd}":`, res.error);
return;
}
if (res.status !== 0) {
console.error(`Script "${cmd}" exited with code ${res.status}`);
return;
}
console.log(`Script "${cmd}" run successfully.`);
} catch (error) {
console.error(`Failed to run script "${cmd}":`, error);
}
});
program.addCommand(runScriptsCommand);

View File

@ -3,6 +3,7 @@ import './command/config-manager/index.ts';
import './command/app-manager/index.ts';
import './command/asst-server/index.ts';
import './command/app/index.ts';
import './command/run-scripts/index.ts';
/**
*

View File

@ -75,6 +75,9 @@ export type AssistantConfigData = {
apiKey?: string;
model?: string;
};
scripts?: {
[key: string]: string;
};
};
let assistantConfig: AssistantConfigData;
type AssistantConfigOptions = {

View File

@ -1,25 +1,36 @@
import { pino } from 'pino';
export class Logger {
level: string;
constructor(level: string) {
this.level = level;
}
info(message: string, data?: any, ...args: any[]) {
if (this.level === 'info') {
console.log(`INFO: ${message}`, data, ...args);
}
}
error(message: string, data?: any, ...args: any[]) {
if (this.level === 'error') {
console.error(`ERROR: ${message}`, data, ...args);
}
}
warn(message: string, data?: any, ...args: any[]) {
if (this.level === 'warn') {
console.warn(`WARN: ${message}`, data, ...args);
}
}
debug(message: string, data?: any, ...args: any[]) {
if (this.level === 'debug') {
console.debug(`DEBUG: ${message}`, data, ...args);
}
}
log(message: string, ...args: any[]) {
if (this.level === 'log') {
console.log(`LOG: ${message}`, ...args);
}
}
}
const logger = new Logger(process.env.LOG_LEVEL || 'info');
export const logger = pino({
level: process.env.LOG_LEVEL || 'info',
transport: {
target: 'pino-pretty',
options: {
colorize: true,
translateTime: 'SYS:standard',
ignore: 'pid,hostname',
},
},
serializers: {
error: pino.stdSerializers.err,
req: pino.stdSerializers.req,
res: pino.stdSerializers.res,
},
base: {
app: 'assistant',
env: process.env.NODE_ENV || 'production',
},
});
export const console = {
log: logger.info,
error: logger.error,
@ -28,10 +39,10 @@ export const console = {
debug: logger.debug,
};
export const logError = (message: string, data?: any) => logger.error({ data }, message);
export const logWarning = (message: string, data?: any) => logger.warn({ data }, message);
export const logInfo = (message: string, data?: any) => logger.info({ data }, message);
export const logDebug = (message: string, data?: any) => logger.debug({ data }, message);
export const logError = (message: string, data?: any) => logger.error(data, message);
export const logWarning = (message: string, data?: any) => logger.warn(data, message);
export const logInfo = (message: string, data?: any) => logger.info(data, message);
export const logDebug = (message: string, data?: any) => logger.debug(data, message);
export const log = {
log: logInfo,

View File

@ -1,6 +1,6 @@
{
"name": "@kevisual/silky-cli",
"version": "0.0.3",
"version": "0.0.9",
"description": "",
"main": "index.js",
"scripts": {

View File

@ -7,6 +7,14 @@ export class AssistantInit extends BaseAssistantInit {
protected getDefaultInitAssistantConfig() {
const config = super.getDefaultInitAssistantConfig();
config.registry = 'https://kevisual.silkyai.cn';
config.pageApi = 'https://kevisual.silkyai.cn';
config.scripts = {
init: 'silky init',
'init:env': 'silky init-env',
'init:talkshow': 'silky init-talkshow',
'server:start': 'asst server -s',
"app:download": "asst app download -i root/center"
};
return config;
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@kevisual/envision-cli",
"version": "0.0.42",
"version": "0.0.43",
"description": "envision command tools",
"main": "dist/app.mjs",
"type": "module",
@ -36,8 +36,6 @@
],
"author": "abearxiong",
"dependencies": {
"pino": "^9.6.0",
"pino-pretty": "^13.0.0",
"pm2": "^6.0.5"
},
"devDependencies": {

View File