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

@@ -1,17 +1,17 @@
/**
* WeKnora embed widget SDK — floating chat launcher.
* Academy embed widget SDK — floating chat launcher.
*
* Programmatic:
* WeKnora.init({ channel, token, position, primaryColor, title, baseUrl })
* WeKnora.open() | close() | toggle() | destroy()
* WeKnora.on('ready', fn) | off('ready', fn)
* Academy.init({ channel, token, position, primaryColor, title, baseUrl })
* Academy.open() | close() | toggle() | destroy()
* Academy.on('ready', fn) | off('ready', fn)
*
* Host context & actions (postMessage to iframe):
* WeKnora.setContext({ userId, page, ... })
* Academy.setContext({ userId, page, ... })
* Inject visitor/page context merged into each chat query.
* WeKnora.openWithQuery('How do I reset my password?')
* Academy.openWithQuery('How do I reset my password?')
* Opens the panel (if closed) and sends the query when the iframe is ready.
* WeKnora.setLocale('en-US')
* Academy.setLocale('en-US')
* Switch embed UI language (zh-CN | zh-TW | en-US | ko-KR | ja-JP | ru-RU).
*
* Secure mode (recommended): instead of `token`, pass `tokenEndpoint` — a URL on
@@ -26,8 +26,8 @@
(function (global) {
'use strict';
var HOST_SOURCE = 'weknora-host';
var EMBED_SOURCE = 'weknora-embed';
var HOST_SOURCE = 'academy-host';
var EMBED_SOURCE = 'academy-embed';
var POSITIONS = ['bottom-right', 'bottom-left', 'top-right', 'top-left'];
var DEFAULT_POSITION = 'bottom-right';
var DEFAULT_COLOR = '#07C05F';
@@ -57,7 +57,7 @@
var handlers = listeners[event];
if (!handlers) return;
handlers.slice().forEach(function (fn) {
try { fn(payload); } catch (e) { console.error('[WeKnora]', e); }
try { fn(payload); } catch (e) { console.error('[Academy]', e); }
});
}
@@ -71,7 +71,7 @@
// fetches a fresh token here and refreshes it before expiry.
var tokenEndpoint = opts.tokenEndpoint || opts.token_endpoint || '';
if (!channelId || (!staticToken && !tokenEndpoint)) {
console.warn('[WeKnora] channel and (token or tokenEndpoint) are required');
console.warn('[Academy] channel and (token or tokenEndpoint) are required');
return null;
}
@@ -118,7 +118,7 @@
return tok;
})
.catch(function (e) {
console.error('[WeKnora] failed to load token', e);
console.error('[Academy] failed to load token', e);
throw e;
})
.then(function (tok) { tokenInFlight = null; return tok; }, function (e) { tokenInFlight = null; throw e; });
@@ -132,7 +132,7 @@
if (!baseUrl) {
var script = document.currentScript;
if (script && script.src) {
baseUrl = script.src.replace(/\/weknora-widget\.js.*$/, '');
baseUrl = script.src.replace(/\/academy-widget\.js.*$/, '');
} else {
baseUrl = global.location ? global.location.origin : '';
}
@@ -242,7 +242,7 @@
function postHostPayload(type, payload) {
if (!iframe.contentWindow) {
console.warn('[WeKnora] iframe not ready');
console.warn('[Academy] iframe not ready');
return false;
}
postToIframe({ source: HOST_SOURCE, type: type, payload: payload || {} });
@@ -256,7 +256,7 @@
return;
}
if (tries >= 20) {
console.warn('[WeKnora] iframe not ready');
console.warn('[Academy] iframe not ready');
return;
}
setTimeout(function () { whenIframeReady(fn, tries + 1); }, 100);
@@ -264,7 +264,7 @@
function setContext(ctx) {
if (!ctx || typeof ctx !== 'object') {
console.warn('[WeKnora] setContext expects an object');
console.warn('[Academy] setContext expects an object');
return;
}
postHostPayload('set_context', ctx);
@@ -273,7 +273,7 @@
function openWithQuery(query) {
var text = String(query || '').trim();
if (!text) {
console.warn('[WeKnora] openWithQuery requires a non-empty query');
console.warn('[Academy] openWithQuery requires a non-empty query');
return;
}
setOpen(true);
@@ -285,7 +285,7 @@
function setLocale(locale) {
var loc = String(locale || '').trim();
if (!loc) {
console.warn('[WeKnora] setLocale requires a locale string');
console.warn('[Academy] setLocale requires a locale string');
return;
}
postHostPayload('set_locale', { locale: loc });
@@ -409,7 +409,7 @@
setLocale: function (locale) { if (instance) instance.setLocale(locale); },
};
global.WeKnora = api;
global.Academy = api;
var legacyScript = document.currentScript;
if (legacyScript) {