feat: integrate knowledge base creation in RepoCard and update app context key

- Updated the context key for the QueryRouterServer from 'router' to 'app'.
- Added functionality to create a knowledge base in RepoCard component.
- Introduced a new BookOpen icon and tooltip for knowledge base indication.
- Implemented a toast notification for successful knowledge base creation.
- Cleaned up imports in main.tsx by commenting out unused app import.
This commit is contained in:
2026-02-16 00:46:07 +08:00
parent f876a65c6b
commit 3d66eee666
5 changed files with 271 additions and 183 deletions

View File

@@ -3,8 +3,7 @@ import { QueryRouterServer } from '@kevisual/router/browser'
import { useContextKey } from '@kevisual/context'
import { useConfigStore } from '@/app/config/store'
import { CNB } from '@kevisual/cnb'
export const app = useContextKey('router', new QueryRouterServer())
export const app = useContextKey('app', new QueryRouterServer())
export const cnb: CNB = useContextKey('cnb', () => {
const state = useConfigStore.getState()
@@ -13,9 +12,19 @@ export const cnb: CNB = useContextKey('cnb', () => {
if (config.ENABLE_CORS) {
cors.baseUrl = config.CNB_CORS_URL || 'https://cors.kevisual.cn'
}
console.log('state', state)
// if(state.config.)
return new CNB({
token: config.CNB_API_KEY,
cookie: config.CNB_COOKIE,
cors
})
})
})
//
// import '@kevisual/cnb-ai'
const url = 'https://kevisual.cn/root/cnb-ai/dist/app.js'
setTimeout(() => {
import(/* @vite-ignore */url)
}, 2000)