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
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:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
// setWhitelistForTest swaps the SSRF whitelist singleton for the duration of
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/im"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/im"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// NewFactory returns an im.AdapterFactory for WeCom channels.
|
||||
|
||||
@@ -20,9 +20,9 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/im"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/im"
|
||||
"academy/internal/logger"
|
||||
secutils "academy/internal/utils"
|
||||
ws "github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
@@ -784,7 +784,7 @@ func stripAtMentionBasic(content string) string {
|
||||
}
|
||||
|
||||
// stripAtMention removes the leading "@BotName" prefix from group chat messages.
|
||||
// Bot names may contain spaces (e.g., "WeKnora Bot"), so this adds two strategies
|
||||
// Bot names may contain spaces (e.g., "Academy Bot"), so this adds two strategies
|
||||
// on top of stripAtMentionBasic: (1) double-space split with bot-name learning,
|
||||
// (2) cached/configured bot name prefix match.
|
||||
// Concurrent calls are safe; atomic.Value races are benign (same bot name).
|
||||
|
||||
@@ -16,10 +16,10 @@ func TestStripAtMentionBasic(t *testing.T) {
|
||||
{"single-word bot double-space", "@Bot /stop", "/stop"},
|
||||
{"single-word bot single-space", "@Bot /stop", "/stop"},
|
||||
{"single-word bot double-space chinese", "@Bot 你好世界", "你好世界"},
|
||||
{"multi-word bot double-space", "@WeKnora Bot /stop", "/stop"},
|
||||
{"multi-word bot double-space chinese", "@WeKnora Bot 什么是上下文工程", "什么是上下文工程"},
|
||||
{"multi-word bot single-space command", "@WeKnora Bot /stop", "/stop"},
|
||||
{"multi-word bot single-space chinese", "@WeKnora Bot 什么是老登", "什么是老登"},
|
||||
{"multi-word bot double-space", "@Academy Bot /stop", "/stop"},
|
||||
{"multi-word bot double-space chinese", "@Academy Bot 什么是上下文工程", "什么是上下文工程"},
|
||||
{"multi-word bot single-space command", "@Academy Bot /stop", "/stop"},
|
||||
{"multi-word bot single-space chinese", "@Academy Bot 什么是老登", "什么是老登"},
|
||||
{"leading whitespace", " @Bot hello ", "hello"},
|
||||
{"double-space in user content", "@Bot hello world", "hello world"},
|
||||
}
|
||||
@@ -37,25 +37,25 @@ func TestLongConnClient_StripAtMention(t *testing.T) {
|
||||
t.Run("learns bot name from double-space then handles single-space", func(t *testing.T) {
|
||||
c := &LongConnClient{}
|
||||
|
||||
// First message: double-space → learn "WeKnora Bot"
|
||||
got := c.stripAtMention("@WeKnora Bot 什么是上下文工程")
|
||||
// First message: double-space → learn "Academy Bot"
|
||||
got := c.stripAtMention("@Academy Bot 什么是上下文工程")
|
||||
if got != "什么是上下文工程" {
|
||||
t.Errorf("first message: got %q, want %q", got, "什么是上下文工程")
|
||||
}
|
||||
|
||||
// Verify bot name was cached
|
||||
if name, _ := c.botDisplayName.Load().(string); name != "WeKnora Bot" {
|
||||
t.Errorf("cached bot name = %q, want %q", name, "WeKnora Bot")
|
||||
if name, _ := c.botDisplayName.Load().(string); name != "Academy Bot" {
|
||||
t.Errorf("cached bot name = %q, want %q", name, "Academy Bot")
|
||||
}
|
||||
|
||||
// Second message: single-space → should use cached name
|
||||
got = c.stripAtMention("@WeKnora Bot /stop")
|
||||
got = c.stripAtMention("@Academy Bot /stop")
|
||||
if got != "/stop" {
|
||||
t.Errorf("second message: got %q, want %q", got, "/stop")
|
||||
}
|
||||
|
||||
// Single-space with chinese content
|
||||
got = c.stripAtMention("@WeKnora Bot 什么是B+树")
|
||||
got = c.stripAtMention("@Academy Bot 什么是B+树")
|
||||
if got != "什么是B+树" {
|
||||
t.Errorf("chinese single-space: got %q, want %q", got, "什么是B+树")
|
||||
}
|
||||
@@ -63,10 +63,10 @@ func TestLongConnClient_StripAtMention(t *testing.T) {
|
||||
|
||||
t.Run("preconfigured bot name", func(t *testing.T) {
|
||||
c := &LongConnClient{}
|
||||
c.botDisplayName.Store("WeKnora Bot")
|
||||
c.botDisplayName.Store("Academy Bot")
|
||||
|
||||
// Single-space should work immediately without learning
|
||||
got := c.stripAtMention("@WeKnora Bot /stop")
|
||||
got := c.stripAtMention("@Academy Bot /stop")
|
||||
if got != "/stop" {
|
||||
t.Errorf("got %q, want %q", got, "/stop")
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func TestLongConnClient_StripAtMention(t *testing.T) {
|
||||
t.Run("cold start single-space command", func(t *testing.T) {
|
||||
c := &LongConnClient{}
|
||||
// No cached name, single space → heuristic detects " /" boundary
|
||||
got := c.stripAtMention("@WeKnora Bot /stop")
|
||||
got := c.stripAtMention("@Academy Bot /stop")
|
||||
if got != "/stop" {
|
||||
t.Errorf("got %q, want %q", got, "/stop")
|
||||
}
|
||||
@@ -140,7 +140,7 @@ func TestLongConnClient_StripAtMention(t *testing.T) {
|
||||
t.Run("cold start single-space chinese", func(t *testing.T) {
|
||||
c := &LongConnClient{}
|
||||
// No cached name, single space → heuristic detects non-ASCII boundary
|
||||
got := c.stripAtMention("@WeKnora Bot 什么是老登")
|
||||
got := c.stripAtMention("@Academy Bot 什么是老登")
|
||||
if got != "什么是老登" {
|
||||
t.Errorf("got %q, want %q", got, "什么是老登")
|
||||
}
|
||||
@@ -149,7 +149,7 @@ func TestLongConnClient_StripAtMention(t *testing.T) {
|
||||
t.Run("cold start all-ascii content falls back to first word", func(t *testing.T) {
|
||||
c := &LongConnClient{}
|
||||
// No cached name, all ASCII → heuristic can't find boundary, strips first @word
|
||||
got := c.stripAtMention("@WeKnora Bot hello")
|
||||
got := c.stripAtMention("@Academy Bot hello")
|
||||
if got != "Bot hello" {
|
||||
t.Errorf("got %q, want %q", got, "Bot hello")
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package wecom
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/im"
|
||||
"academy/internal/im"
|
||||
)
|
||||
|
||||
// mixedMsg builds a botMessage with msgtype "mixed" from text/image parts.
|
||||
@@ -86,7 +86,7 @@ func TestConvertMixedMessage(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "group chat: mention stripped from caption",
|
||||
msg: mixedMsg(textItem("@WeKnora Bot 这张图里是什么?"), imageItem("https://img.example/1", "key1")),
|
||||
msg: mixedMsg(textItem("@Academy Bot 这张图里是什么?"), imageItem("https://img.example/1", "key1")),
|
||||
chatType: im.ChatTypeGroup,
|
||||
wantType: im.MessageTypeImage,
|
||||
wantContent: "这张图里是什么?",
|
||||
|
||||
@@ -3,7 +3,7 @@ package wecom
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/im"
|
||||
"academy/internal/im"
|
||||
)
|
||||
|
||||
// extractQuoteContent extracts text content from a quoted botMessage.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Package wecom implements the WeCom (企业微信) IM adapter for WeKnora.
|
||||
// Package wecom implements the WeCom (企业微信) IM adapter for Academy.
|
||||
//
|
||||
// WeCom Smart Bot flow:
|
||||
// 1. User sends a message to the bot (direct or @mention in group)
|
||||
@@ -31,9 +31,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/im"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/im"
|
||||
"academy/internal/logger"
|
||||
secutils "academy/internal/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/im"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/im"
|
||||
"academy/internal/logger"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user