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
+21
-21
@@ -21,17 +21,17 @@ import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
agenttools "github.com/Tencent/WeKnora/internal/agent/tools"
|
||||
"github.com/Tencent/WeKnora/internal/config"
|
||||
apperrors "github.com/Tencent/WeKnora/internal/errors"
|
||||
"github.com/Tencent/WeKnora/internal/event"
|
||||
"github.com/Tencent/WeKnora/internal/infrastructure/docparser"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
mcppkg "github.com/Tencent/WeKnora/internal/mcp"
|
||||
"github.com/Tencent/WeKnora/internal/ratelimit"
|
||||
"github.com/Tencent/WeKnora/internal/storageurl"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
agenttools "academy/internal/agent/tools"
|
||||
"academy/internal/config"
|
||||
apperrors "academy/internal/errors"
|
||||
"academy/internal/event"
|
||||
"academy/internal/infrastructure/docparser"
|
||||
"academy/internal/logger"
|
||||
mcppkg "academy/internal/mcp"
|
||||
"academy/internal/ratelimit"
|
||||
"academy/internal/storageurl"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
"github.com/google/uuid"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"gorm.io/gorm"
|
||||
@@ -99,7 +99,7 @@ func stripImageXMLTags(s string) string {
|
||||
}
|
||||
|
||||
// rewriteStorageURLs replaces all storage references in content with HTTP URLs
|
||||
// so IM clients — which cannot attach WeKnora credentials to an image fetch —
|
||||
// so IM clients — which cannot attach Academy credentials to an image fetch —
|
||||
// can render them. See internal/storageurl for the shared implementation.
|
||||
func rewriteStorageURLs(ctx context.Context, content string, resolver *storageurl.FileServiceResolver) string {
|
||||
if resolver == nil {
|
||||
@@ -298,9 +298,9 @@ type inflightEntry struct {
|
||||
|
||||
// Service orchestrates IM message handling:
|
||||
// 1. Receives a unified IncomingMessage from an Adapter
|
||||
// 2. Resolves or creates a WeKnora session for the IM channel
|
||||
// 2. Resolves or creates a Academy session for the IM channel
|
||||
// 3. Dispatches slash-commands (/help, /kb, /clear, etc.) without entering QA
|
||||
// 4. Calls the WeKnora QA pipeline for normal messages
|
||||
// 4. Calls the Academy QA pipeline for normal messages
|
||||
// 5. Collects the streaming answer and sends it back via the Adapter
|
||||
type Service struct {
|
||||
db *gorm.DB
|
||||
@@ -527,7 +527,7 @@ func (s *Service) buildIMMCPAuthNotice(ctx context.Context, services []imMCPAuth
|
||||
if authURL != "" {
|
||||
lines = append(lines, fmt.Sprintf("• %s:%s", name, authURL))
|
||||
} else {
|
||||
lines = append(lines, fmt.Sprintf("• %s(请在 WeKnora 管理后台完成 OAuth 授权)", name))
|
||||
lines = append(lines, fmt.Sprintf("• %s(请在 Academy 管理后台完成 OAuth 授权)", name))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1796,7 +1796,7 @@ func (s *Service) HandleMessage(ctx context.Context, msg *IncomingMessage, chann
|
||||
sessionCtx := context.WithValue(ctx, types.TenantInfoContextKey, tenant)
|
||||
sessionCtx = withIMIdentity(sessionCtx, channel, msg)
|
||||
|
||||
// 2. Resolve or create a WeKnora session
|
||||
// 2. Resolve or create a Academy session
|
||||
channelSession, err := s.resolveSession(sessionCtx, msg, tenantID, agentID, channelID, channel.SessionMode)
|
||||
if err != nil {
|
||||
return fmt.Errorf("resolve session: %w", err)
|
||||
@@ -1827,7 +1827,7 @@ func (s *Service) HandleMessage(ctx context.Context, msg *IncomingMessage, chann
|
||||
return nil
|
||||
}
|
||||
|
||||
// 4. Get the WeKnora session
|
||||
// 4. Get the Academy session
|
||||
session, err := s.sessionService.GetSession(sessionCtx, channelSession.SessionID)
|
||||
if err != nil {
|
||||
// The underlying session may have been deleted from the UI while the
|
||||
@@ -2147,7 +2147,7 @@ func (s *Service) handleCommand(
|
||||
switch result.Action {
|
||||
case ActionClear:
|
||||
// Soft-delete the current ChannelSession so the next IM message
|
||||
// starts a completely fresh WeKnora session. Conversation history
|
||||
// starts a completely fresh Academy session. Conversation history
|
||||
// is keyed by session ID and rebuilt from DB on demand, so no
|
||||
// separate cache invalidation step is needed.
|
||||
if err := s.db.Model(&ChannelSession{}).
|
||||
@@ -2241,7 +2241,7 @@ func (s *Service) sendStreamReply(ctx context.Context, msg *IncomingMessage, str
|
||||
return nil
|
||||
}
|
||||
|
||||
// isSessionNotFound reports whether err indicates the underlying WeKnora
|
||||
// isSessionNotFound reports whether err indicates the underlying Academy
|
||||
// session no longer exists. The session repository translates GORM's
|
||||
// ErrRecordNotFound into apperrors.ErrSessionNotFound, so the application
|
||||
// sentinel is what GetSession returns today; the GORM check is kept as a
|
||||
@@ -2338,7 +2338,7 @@ func (s *Service) resolveUserSession(ctx context.Context, msg *IncomingMessage,
|
||||
return nil, fmt.Errorf("query channel session: %w", result.Error)
|
||||
}
|
||||
|
||||
// Create a new WeKnora session. Start untitled when there's text to summarise
|
||||
// Create a new Academy session. Start untitled when there's text to summarise
|
||||
// so it gets a content-based title after the first message (see HandleMessage);
|
||||
// fall back to the IM identity title otherwise.
|
||||
title := imInitialSessionTitle(msg, buildUserSessionTitle)
|
||||
@@ -2979,7 +2979,7 @@ func (s *Service) fallbackNonStream(ctx context.Context, msg *IncomingMessage, s
|
||||
})
|
||||
}
|
||||
|
||||
// runQA executes the WeKnora QA pipeline and returns the full answer text.
|
||||
// runQA executes the Academy QA pipeline and returns the full answer text.
|
||||
func (s *Service) runQA(ctx context.Context, session *types.Session, query string, customAgent *types.CustomAgent, kbIDs []string, attachments types.MessageAttachments, imageURLs []string, userKey string, quote *QuotedMessage) (string, error) {
|
||||
// Cancellable context (no hard deadline): each agent round has its own
|
||||
// LLMCallTimeout. The context can still be cancelled by /stop.
|
||||
|
||||
Reference in new issue
Block a user