移除未使用的 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)