refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s

- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名)
- 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块)
- docreader proto 描述符采用等长替换,保持序列化字节布局有效
- Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像
- 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
runny committed 2026-11-13 20:52:51 +08:00
1 parent 9097ee699d
commit 9058149576
3136 files changed
+18018 -18004

No files matched your search

@@ -905,9 +905,9 @@ function formatApiKeyAccessModeLabel(key: TenantAPIKey): string {
type PlaygroundStatus = '' | 'running' | 'success' | 'failed' | 'stopped'
type WeKnoraDesktopWindow = Window & {
__WEKNORA_API_BASE__?: string
__WEKNORA_API_LAN_BASE__?: string
type AcademyDesktopWindow = Window & {
__ACADEMY_API_BASE__?: string
__ACADEMY_API_LAN_BASE__?: string
go?: {
main?: {
App?: {
@@ -1070,14 +1070,14 @@ func signExternalUserToken(hmacSecret, externalUserID string, tenantID uint64) (
claims := jwt.MapClaims{
"sub": externalUserID, // e.g. "user_123"
"tenant_id": float64(tenantID),
"aud": "weknora",
"aud": "academy",
"exp": time.Now().Add(time.Hour).Unix(),
}
return jwt.NewWithClaims(jwt.SigningMethodHS256, claims).
SignedString([]byte(hmacSecret))
}
// Send on each WeKnora API request:
// Send on each Academy API request:
// ${headerName}: <JWT from signExternalUserToken>
// Tenant ID for this workspace: ${tid}`
})
@@ -1315,9 +1315,9 @@ async function copy(text: string) {
}
async function tryLoadWailsApiBaseURL() {
const win = window as WeKnoraDesktopWindow
const win = window as AcademyDesktopWindow
for (let i = 0; i < 40; i++) {
const injected = win.__WEKNORA_API_BASE__
const injected = win.__ACADEMY_API_BASE__
if (typeof injected === 'string' && injected.trim()) {
wailsApiBaseURL.value = injected.trim().replace(/\/$/, '')
await tryLoadWailsLanHints(win)
@@ -1341,8 +1341,8 @@ async function tryLoadWailsApiBaseURL() {
await tryLoadWailsLanHints(win)
}
async function tryLoadWailsLanHints(win: WeKnoraDesktopWindow) {
const injectedLan = win.__WEKNORA_API_LAN_BASE__
async function tryLoadWailsLanHints(win: AcademyDesktopWindow) {
const injectedLan = win.__ACADEMY_API_LAN_BASE__
if (typeof injectedLan === 'string' && injectedLan.trim()) {
wailsApiLanBaseURL.value = injectedLan.trim().replace(/\/$/, '')
}
@@ -1367,12 +1367,12 @@ async function tryLoadWailsLanHints(win: WeKnoraDesktopWindow) {
}
}
function desktopPortBindingsAvailable(win: WeKnoraDesktopWindow) {
function desktopPortBindingsAvailable(win: AcademyDesktopWindow) {
const app = win.go?.main?.App
return typeof app?.GetDesktopHTTPPortSetting === 'function' && typeof app?.SetDesktopHTTPPortSetting === 'function'
}
function desktopBindPublicBindingsAvailable(win: WeKnoraDesktopWindow) {
function desktopBindPublicBindingsAvailable(win: AcademyDesktopWindow) {
const app = win.go?.main?.App
return (
typeof app?.GetDesktopHTTPBindPublicSetting === 'function' &&
@@ -1381,7 +1381,7 @@ function desktopBindPublicBindingsAvailable(win: WeKnoraDesktopWindow) {
}
async function loadDesktopApiPrefs() {
const win = window as WeKnoraDesktopWindow
const win = window as AcademyDesktopWindow
if (desktopPortBindingsAvailable(win)) {
showDesktopPortSetting.value = true
try {
@@ -1404,7 +1404,7 @@ async function loadDesktopApiPrefs() {
const onDesktopBindPublicChange = async (value: boolean) => {
const next = value === true
const fn = (window as WeKnoraDesktopWindow).go?.main?.App?.SetDesktopHTTPBindPublicSetting
const fn = (window as AcademyDesktopWindow).go?.main?.App?.SetDesktopHTTPBindPublicSetting
if (typeof fn !== 'function') return
try {
await Promise.resolve(fn(next))
@@ -1422,7 +1422,7 @@ const saveDesktopPort = async () => {
MessagePlugin.warning(t('tenant.api.desktopPortInvalid'))
return
}
const fn = (window as WeKnoraDesktopWindow).go?.main?.App?.SetDesktopHTTPPortSetting
const fn = (window as AcademyDesktopWindow).go?.main?.App?.SetDesktopHTTPPortSetting
if (typeof fn !== 'function') return
try {
await Promise.resolve(fn(port))
@@ -131,7 +131,7 @@ const installCommand = 'openclaw skills install @lyingbug/weknora'
const envExample = computed(() => {
const base = apiBaseUrlDisplay.value || 'https://your-server.com/api/v1'
return `export WEKNORA_BASE_URL="${base}"\nexport WEKNORA_API_KEY="sk-your-api-key"`
return `export ACADEMY_BASE_URL="${base}"\nexport ACADEMY_API_KEY="sk-your-api-key"`
})
const openClawHub = () => {
@@ -82,21 +82,21 @@ const { apiBaseUrlDisplay } = useApiBaseUrlDisplay()
const steps = computed(() => [
{
key: 'install',
command: 'git clone https://github.com/Tencent/WeKnora.git\ncd WeKnora/cli\ngo build -o weknora .\nexport PATH="$PWD:$PATH"',
command: 'git clone https://github.com/Tencent/WeKnora.git\ncd Academy/cli\ngo build -o academy .\nexport PATH="$PWD:$PATH"',
},
{ key: 'connect', command: buildCLIConnectCommand(apiBaseUrlDisplay.value, window.location.origin) },
{ key: 'verify', command: 'weknora doctor\nweknora kb list' },
{ key: 'verify', command: 'academy doctor\nacademy kb list' },
])
const examples = [
{
key: 'commands',
command: 'weknora doc upload ./document.pdf --kb "KB_ID"\nweknora search chunks "query" --kb "KB_ID"\nweknora chat "question" --kb "KB_ID" --format text\nweknora agent list',
command: 'academy doc upload ./document.pdf --kb "KB_ID"\nacademy search chunks "query" --kb "KB_ID"\nacademy chat "question" --kb "KB_ID" --format text\nacademy agent list',
},
{
key: 'mcp',
command: JSON.stringify({
mcpServers: {
weknora: { command: 'weknora', args: ['--profile', 'weknora', 'mcp', 'serve'] },
academy: { command: 'academy', args: ['--profile', 'academy', 'mcp', 'serve'] },
},
}, null, 2),
},
@@ -6,12 +6,12 @@ import { buildCLIConnectCommand } from './cliIntegration'
test('CLI hosts preserve proxy prefixes and omit the SDK API suffix', () => {
for (const [base, origin, host] of [
['https://kb.example.com/api/v1', 'https://ui.example.com', 'https://kb.example.com'],
['/app/weknora/api/v1', 'https://kb.example.com', 'https://kb.example.com/app/weknora'],
['/app/academy/api/v1', 'https://kb.example.com', 'https://kb.example.com/app/academy'],
['http://127.0.0.1:19321/api/v1/', 'wails://wails.localhost', 'http://127.0.0.1:19321'],
['http://127.0.0.1:19321/api/v1', 'null', 'http://127.0.0.1:19321'],
]) {
const command = buildCLIConnectCommand(base!, origin!)
assert.ok(command.includes(`--host '${host}' --use &&\nweknora auth login`))
assert.ok(command.includes(`--host '${host}' --use &&\nacademy auth login`))
}
})
@@ -12,5 +12,5 @@ export function buildCLIConnectCommand(apiBaseUrl: string, origin: string): stri
}
// POSIX shell quoting prevents URL characters from becoming shell syntax.
const quotedHost = `'${host.replace(/'/g, `'"'"'`)}'`
return `weknora profile add weknora --host ${quotedHost} --use &&\nweknora auth login`
return `academy profile add academy --host ${quotedHost} --use &&\nacademy auth login`
}
@@ -17,17 +17,17 @@ test('buildMcpEndpointUrl strips the api prefix and joins the endpoint path', ()
})
test('mcpServerKey slugs the endpoint name', () => {
assert.equal(mcpServerKey('Docs Bot!'), 'weknora-docs-bot')
assert.equal(mcpServerKey(' '), 'weknora')
assert.equal(mcpServerKey('产品知识库'), 'weknora')
assert.equal(mcpServerKey('产品知识库', '3f9a2c1e-aaaa'), 'weknora-3f9a2c1e')
assert.equal(mcpServerKey('Docs Bot!'), 'academy-docs-bot')
assert.equal(mcpServerKey(' '), 'academy')
assert.equal(mcpServerKey('产品知识库'), 'academy')
assert.equal(mcpServerKey('产品知识库', '3f9a2c1e-aaaa'), 'academy-3f9a2c1e')
assert.notEqual(mcpServerKey('知识库A', 'id-one'), mcpServerKey('知识库B', 'id-two'))
})
test('http snippet carries url and bearer header', () => {
const parsed = JSON.parse(buildHttpClientSnippet('Docs', 'https://h/mcp/1', 'mcp_t'))
assert.deepEqual(parsed, {
mcpServers: { 'weknora-docs': { url: 'https://h/mcp/1', headers: { Authorization: 'Bearer mcp_t' } } },
mcpServers: { 'academy-docs': { url: 'https://h/mcp/1', headers: { Authorization: 'Bearer mcp_t' } } },
})
})
@@ -35,14 +35,14 @@ test('snippets fall back to a placeholder when no token is known', () => {
assert.match(buildHttpClientSnippet('a', 'u', ''), new RegExp(MCP_TOKEN_PLACEHOLDER))
assert.match(buildClaudeCodeCommand('a', 'u', ''), new RegExp(MCP_TOKEN_PLACEHOLDER))
const bridge = JSON.parse(buildStdioBridgeSnippet('a', 'https://h/mcp/1', ''))
assert.equal(bridge.mcpServers['weknora-a'].command, 'npx')
assert.ok(bridge.mcpServers['weknora-a'].args.includes('https://h/mcp/1'))
assert.equal(bridge.mcpServers['academy-a'].command, 'npx')
assert.ok(bridge.mcpServers['academy-a'].args.includes('https://h/mcp/1'))
})
test('claude code command uses the http transport', () => {
assert.equal(
buildClaudeCodeCommand('Docs', 'https://h/mcp/1', 'mcp_t'),
'claude mcp add --transport http weknora-docs https://h/mcp/1 --header "Authorization: Bearer mcp_t"',
'claude mcp add --transport http academy-docs https://h/mcp/1 --header "Authorization: Bearer mcp_t"',
)
})
@@ -1,5 +1,5 @@
/**
* Pure helpers for the "WeKnora as MCP server" integration page. Kept free
* Pure helpers for the "Academy as MCP server" integration page. Kept free
* of Vue so the snippet builders can be unit-tested with node:test.
*/
@@ -26,9 +26,9 @@ export function mcpServerKey(name: string, id = ''): string {
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
if (slug) return `weknora-${slug}`
if (slug) return `academy-${slug}`
const idSlug = (id || '').replace(/[^a-z0-9]/gi, '').slice(0, 8).toLowerCase()
return idSlug ? `weknora-${idSlug}` : 'weknora'
return idSlug ? `academy-${idSlug}` : 'academy'
}
/** JSON block for clients that speak Streamable HTTP natively (Cursor, VS Code, Claude Desktop connectors). */