移除未使用的 cnb 导出,更新依赖版本,添加 opencode 客户端示例

This commit is contained in:
xiongxiao
2026-03-13 01:56:22 +08:00
committed by cnb
parent 525f0af8ba
commit 176c82f1ac
5 changed files with 19 additions and 9 deletions

View File

@@ -22,8 +22,6 @@ try {
process.exit(1)
}
await new Promise(resolve => setTimeout(resolve, 1000))
export const cnbItem = await cnbManager.getCNB({ username: 'default' });
export const cnb = cnbItem?.cnb;
export const app = await useContextKey<App>('app', () => {
return new App({})
})

View File

@@ -1,5 +1,5 @@
import { runAgent } from '@kevisual/ai/agent'
import { app, notCNBCheck, cnbManager, cnb } from '../../app.ts';
import { app, cnbManager } from '../../app.ts';
import z from 'zod';
app.route({

View File

@@ -0,0 +1,12 @@
import { createOpencodeClient } from "@opencode-ai/sdk"
const client = await createOpencodeClient({
// baseUrl: "https://yccb64t1z-100.cnb.run",
// auth: async () => {
// return 'cm9vdDozR0I2MDg5ZGpYOE5oMDFjM1FteE5DWDd0ZkI='
// }
baseUrl: "http://localhost:4096",
})
const sessionList = await client.session.list()
console.log(sessionList.data)

1
mod.ts
View File

@@ -1 +0,0 @@
export * from './src/index.ts'

View File

@@ -32,19 +32,19 @@
"devDependencies": {
"@ai-sdk/openai-compatible": "^2.0.35",
"@kevisual/ai": "^0.0.28",
"@kevisual/api": "^0.0.62",
"@kevisual/api": "^0.0.64",
"@kevisual/code-builder": "^0.0.6",
"@kevisual/context": "^0.0.8",
"@kevisual/dts": "^0.0.4",
"@kevisual/remote-app": "^0.0.6",
"@kevisual/remote-app": "^0.0.7",
"@kevisual/types": "^0.0.12",
"@opencode-ai/plugin": "^1.2.24",
"@types/bun": "^1.3.10",
"@types/node": "^25.4.0",
"@types/node": "^25.5.0",
"@types/ws": "^8.18.1",
"ai": "^6.0.116",
"commander": "^14.0.3",
"dayjs": "^1.11.19",
"dayjs": "^1.11.20",
"dotenv": "^17.3.1"
},
"publishConfig": {
@@ -57,6 +57,7 @@
"@kevisual/query": "^0.0.53",
"@kevisual/router": "^0.1.1",
"@kevisual/use-config": "^1.0.30",
"@opencode-ai/sdk": "^1.2.24",
"es-toolkit": "^1.45.1",
"nanoid": "^5.1.6",
"unstorage": "^1.17.4",
@@ -64,7 +65,7 @@
"zod": "^4.3.6"
},
"exports": {
".": "./mod.ts",
".": "./src/index.ts",
"./opencode": "./dist/opencode.js",
"./keep": "./dist/keep.js",
"./keep.ts": "./src/keep.ts",