Compare commits

...

2 Commits

5 changed files with 685 additions and 746 deletions

View File

@@ -10,7 +10,7 @@
], ],
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)", "author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
"license": "MIT", "license": "MIT",
"packageManager": "pnpm@10.30.1", "packageManager": "pnpm@10.30.2",
"type": "module", "type": "module",
"files": [ "files": [
"dist", "dist",
@@ -44,15 +44,15 @@
"devDependencies": { "devDependencies": {
"@inquirer/prompts": "^8.3.0", "@inquirer/prompts": "^8.3.0",
"@kevisual/ai": "^0.0.24", "@kevisual/ai": "^0.0.24",
"@kevisual/api": "^0.0.59", "@kevisual/api": "^0.0.60",
"@kevisual/load": "^0.0.6", "@kevisual/load": "^0.0.6",
"@kevisual/local-app-manager": "^0.1.32", "@kevisual/local-app-manager": "^0.1.32",
"@kevisual/logger": "^0.0.4", "@kevisual/logger": "^0.0.4",
"@kevisual/query": "0.0.49", "@kevisual/query": "0.0.52",
"@kevisual/router": "^0.0.84", "@kevisual/router": "^0.0.84",
"@kevisual/types": "^0.0.12", "@kevisual/types": "^0.0.12",
"@kevisual/use-config": "^1.0.30", "@kevisual/use-config": "^1.0.30",
"@opencode-ai/plugin": "^1.2.10", "@opencode-ai/plugin": "^1.2.14",
"@types/bun": "^1.3.9", "@types/bun": "^1.3.9",
"@types/node": "^25.3.0", "@types/node": "^25.3.0",
"@types/send": "^1.2.1", "@types/send": "^1.2.1",
@@ -76,11 +76,11 @@
"access": "public" "access": "public"
}, },
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.995.0", "@aws-sdk/client-s3": "^3.997.0",
"@kevisual/js-filter": "^0.0.5", "@kevisual/js-filter": "^0.0.5",
"@kevisual/oss": "^0.0.19", "@kevisual/oss": "^0.0.19",
"@kevisual/video-tools": "^0.0.13", "@kevisual/video-tools": "^0.0.13",
"@opencode-ai/sdk": "^1.2.10", "@opencode-ai/sdk": "^1.2.14",
"es-toolkit": "^1.44.0", "es-toolkit": "^1.44.0",
"eventemitter3": "^5.0.4", "eventemitter3": "^5.0.4",
"lowdb": "^7.0.1", "lowdb": "^7.0.1",

View File

@@ -9,6 +9,13 @@ const envKevisualDir = process.env.ASSISTANT_CONFIG_DIR
if (envKevisualDir) { if (envKevisualDir) {
kevisualDir = envKevisualDir; kevisualDir = envKevisualDir;
logger.debug('使用环境变量 ASSISTANT_CONFIG_DIR 作为 kevisual 目录:', kevisualDir); logger.debug('使用环境变量 ASSISTANT_CONFIG_DIR 作为 kevisual 目录:', kevisualDir);
} else {
if (!kevisualDir) {
const isCNB = process.env.CNB_GROUP_SLUG;
if (isCNB) {
kevisualDir = path.join('/workspace/kevisual');
}
}
} }
export const HomeConfigDir = path.join(kevisualDir, 'assistant-app'); export const HomeConfigDir = path.join(kevisualDir, 'assistant-app');

View File

@@ -20,7 +20,6 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
_opencodeURL.password = token _opencodeURL.password = token
const opencodeUrlSecret = _opencodeURL.toString() const opencodeUrlSecret = _opencodeURL.toString()
// console.log('btoa opencode auth: ', Buffer.from(`root:${token}`).toString('base64')) // console.log('btoa opencode auth: ', Buffer.from(`root:${token}`).toString('base64'))
const kevisualUrl = url.replace('{{port}}', '51515') const kevisualUrl = url.replace('{{port}}', '51515')
@@ -38,11 +37,6 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
- OpenWebUI: ${openWebUrl} - OpenWebUI: ${openWebUrl}
- Kevisual: ${kevisualUrl} - Kevisual: ${kevisualUrl}
### 直接访问
- Kevisual: ${kevisualUrl}
- OpenCode: ${url?.replace('{{port}}', '4096')}
- VSCode Web: ${vscodeWebUrl}
### 密码访问 ### 密码访问
- OpenClaw: ${openclawUrlSecret} - OpenClaw: ${openclawUrlSecret}
- OpenCode: ${opencodeUrlSecret} - OpenCode: ${opencodeUrlSecret}
@@ -54,6 +48,9 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。 使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。
保活说明
方法1 使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。
1. 安装插件[CNB LIVE](https://chromewebstore.google.com/detail/cnb-live/iajpiophkcdghonpijkcgpjafbcjhkko?pli=1) 1. 安装插件[CNB LIVE](https://chromewebstore.google.com/detail/cnb-live/iajpiophkcdghonpijkcgpjafbcjhkko?pli=1)
2. 打开vscode web获取,点击插件获取json数据替换keep.json中的数据保持在线状态。 2. 打开vscode web获取,点击插件获取json数据替换keep.json中的数据保持在线状态。
3. keep.json中的数据结构说明 3. keep.json中的数据结构说明
@@ -62,6 +59,7 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
- url: vscode web的访问地址可以直接访问vscode web - url: vscode web的访问地址可以直接访问vscode web
4. 运行cli命令ev cnb live -c /workspace/live/keep.json.(直接对话opencode或者openclaw调用cnb-live技能即可) 4. 运行cli命令ev cnb live -c /workspace/live/keep.json.(直接对话opencode或者openclaw调用cnb-live技能即可)
方法2环境变量设置CNB_COOKIE直接opencode或者openclaw的ui界面对话说cnb-keep-live保活他会自动调用保活同时不需要点cnb-lie插件获取配置。
` `
const labels = [ const labels = [
{ {
@@ -91,7 +89,7 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
{ {
key: 'openclawUrl', key: 'openclawUrl',
title: 'OpenClaw 地址', title: 'OpenClaw 地址',
value: openclawUrl, value: openclawUrl + '/openclaw',
description: 'OpenClaw 的访问地址,可以通过该地址访问 OpenClaw 服务' description: 'OpenClaw 的访问地址,可以通过该地址访问 OpenClaw 服务'
}, },
{ {
@@ -126,7 +124,7 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
} }
const createOSInfo = (more = false) => { const createOSInfo = (more = false) => {
const labels: Array<{ key: string; title: string; value: string; description: string }> = [] const labels: Array<{ key: string; title: string; value: string | number; description: string }> = []
const startTimer = useKey('CNB_BUILD_START_TIME') || '' const startTimer = useKey('CNB_BUILD_START_TIME') || ''
// CPU 使用率 // CPU 使用率
@@ -203,7 +201,7 @@ const createOSInfo = (more = false) => {
{ {
key: 'cpuCores', key: 'cpuCores',
title: 'CPU 核心数', title: 'CPU 核心数',
value: `${cpus.length}`, value: cpus.length,
description: 'CPU 核心数' description: 'CPU 核心数'
}, },
{ {
@@ -257,8 +255,8 @@ const createOSInfo = (more = false) => {
{ {
key: 'buildUptime', key: 'buildUptime',
title: '构建已运行时间', title: '构建已运行时间',
value: buildUptimeStr, value: buildUptime,
description: '构建已运行时间' description: `构建已运行时间: ${buildUptimeStr}`
} }
) )
if (maxRunTime > 0) { if (maxRunTime > 0) {
@@ -281,8 +279,8 @@ const createOSInfo = (more = false) => {
labels.unshift({ labels.unshift({
key: 'remainingTime', key: 'remainingTime',
title: '剩余时间', title: '剩余时间',
value: formatUptime(Math.floor((maxRunTime - buildUptime) / 1000)) + ' ' + timeTo4Str, value: maxRunTime - buildUptime,
description: '构建剩余时间' description: '构建剩余时间' + formatUptime(Math.floor((maxRunTime - buildUptime) / 1000)) + ' ' + timeTo4Str
}) })
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@kevisual/cli", "name": "@kevisual/cli",
"version": "0.1.12", "version": "0.1.13",
"description": "envision 命令行工具", "description": "envision 命令行工具",
"type": "module", "type": "module",
"basename": "/root/cli", "basename": "/root/cli",
@@ -46,7 +46,7 @@
"@kevisual/auth": "^2.0.3", "@kevisual/auth": "^2.0.3",
"@kevisual/context": "^0.0.8", "@kevisual/context": "^0.0.8",
"@kevisual/use-config": "^1.0.30", "@kevisual/use-config": "^1.0.30",
"@opencode-ai/sdk": "^1.2.10", "@opencode-ai/sdk": "^1.2.14",
"@types/busboy": "^1.5.4", "@types/busboy": "^1.5.4",
"busboy": "^1.6.0", "busboy": "^1.6.0",
"eventemitter3": "^5.0.4", "eventemitter3": "^5.0.4",
@@ -59,12 +59,12 @@
"unstorage": "^1.17.4" "unstorage": "^1.17.4"
}, },
"devDependencies": { "devDependencies": {
"@kevisual/api": "^0.0.59", "@kevisual/api": "^0.0.60",
"@kevisual/cnb": "^0.0.28", "@kevisual/cnb": "^0.0.32",
"@kevisual/dts": "^0.0.4", "@kevisual/dts": "^0.0.4",
"@kevisual/load": "^0.0.6", "@kevisual/load": "^0.0.6",
"@kevisual/logger": "^0.0.4", "@kevisual/logger": "^0.0.4",
"@kevisual/query": "0.0.49", "@kevisual/query": "0.0.52",
"@types/bun": "^1.3.9", "@types/bun": "^1.3.9",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/jsonwebtoken": "^9.0.10", "@types/jsonwebtoken": "^9.0.10",

1378
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff