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
@@ -8,13 +8,13 @@ import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/application/access"
|
||||
filesvc "github.com/Tencent/WeKnora/internal/application/service/file"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/storageurl"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/application/access"
|
||||
filesvc "academy/internal/application/service/file"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/storageurl"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
secutils "academy/internal/utils"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/application/repository"
|
||||
"github.com/Tencent/WeKnora/internal/application/service"
|
||||
filesvc "github.com/Tencent/WeKnora/internal/application/service/file"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/application/repository"
|
||||
"academy/internal/application/service"
|
||||
filesvc "academy/internal/application/service/file"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -82,7 +82,7 @@ func (f *resourceURLFixture) catalogWrapped() interfaces.FileService {
|
||||
// references and verifies that both the document and KB are still live.
|
||||
func newResourceURLFixture(t *testing.T) *resourceURLFixture {
|
||||
t.Helper()
|
||||
t.Setenv("APP_EXTERNAL_URL", "https://weknora.example/prefix")
|
||||
t.Setenv("APP_EXTERNAL_URL", "https://academy.example/prefix")
|
||||
db, err := gorm.Open(sqlite.Open(filepath.Join(t.TempDir(), "images.db")), &gorm.Config{
|
||||
Logger: logger.Default.LogMode(logger.Silent),
|
||||
})
|
||||
@@ -150,7 +150,7 @@ func TestMCPResourceURLsRewriteTextAndTypedStructuredContent(t *testing.T) {
|
||||
result := f.rewrite(original)
|
||||
text := result.Content[0].(mcp.TextContent).Text
|
||||
require.NotContains(t, text, "resource://")
|
||||
require.Contains(t, text, "https://weknora.example/prefix/r/")
|
||||
require.Contains(t, text, "https://academy.example/prefix/r/")
|
||||
raw, err := json.Marshal(result.StructuredContent)
|
||||
require.NoError(t, err)
|
||||
require.NotContains(t, string(raw), "resource://")
|
||||
@@ -158,7 +158,7 @@ func TestMCPResourceURLsRewriteTextAndTypedStructuredContent(t *testing.T) {
|
||||
url := strings.TrimSuffix(strings.TrimPrefix(text, ", ")")
|
||||
require.Equal(t, 3, strings.Count(string(raw), url))
|
||||
resource, err := f.srv.resourceCatalog.ResolveAccessGrant(f.ctx, strings.TrimPrefix(
|
||||
url, "https://weknora.example/prefix/r/",
|
||||
url, "https://academy.example/prefix/r/",
|
||||
))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, uint64(2), resource.TenantID)
|
||||
@@ -236,7 +236,7 @@ func TestMCPResourceURLsUnrestrictedEndpointCoversSharedKB(t *testing.T) {
|
||||
kbs.kbs[id] = &types.KnowledgeBase{ID: id, TenantID: 1}
|
||||
}
|
||||
result := f.rewrite(mcp.NewToolResultText(f.ref))
|
||||
require.True(t, strings.HasPrefix(result.Content[0].(mcp.TextContent).Text, "https://weknora.example/prefix/r/"))
|
||||
require.True(t, strings.HasPrefix(result.Content[0].(mcp.TextContent).Text, "https://academy.example/prefix/r/"))
|
||||
require.Equal(t, 1, kbs.lookups, "only KBs that bind the reference are authorized")
|
||||
|
||||
f = newResourceURLFixture(t)
|
||||
@@ -252,7 +252,7 @@ func TestMCPResourceURLsStructuredContentShapes(t *testing.T) {
|
||||
raw, err := json.Marshal(result.StructuredContent)
|
||||
require.NoError(t, err)
|
||||
require.NotContains(t, string(raw), "resource://")
|
||||
require.Contains(t, string(raw), "https://weknora.example/prefix/r/")
|
||||
require.Contains(t, string(raw), "https://academy.example/prefix/r/")
|
||||
|
||||
type plain struct{ Count uint64 }
|
||||
result = f.rewrite(mcp.NewToolResultStructured(plain{Count: 7}, "no references"))
|
||||
@@ -327,6 +327,6 @@ func TestMCPExistingToolTransportRewritesResourceURLs(t *testing.T) {
|
||||
raw, err := json.Marshal(response)
|
||||
require.NoError(t, err)
|
||||
require.NotContains(t, string(raw), "resource://")
|
||||
require.Contains(t, string(raw), "https://weknora.example/prefix/r/")
|
||||
require.Contains(t, string(raw), "https://academy.example/prefix/r/")
|
||||
require.NotContains(t, toolNames(t, rpc(t, r, "tools/list", map[string]any{})), "get_image")
|
||||
}
|
||||
@@ -6,10 +6,10 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/agent/tools"
|
||||
"github.com/Tencent/WeKnora/internal/application/access"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/agent/tools"
|
||||
"academy/internal/application/access"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// allowedKnowledgeBases returns every knowledge base the endpoint may touch,
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/application/access"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/application/access"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
)
|
||||
|
||||
type stubKBService struct {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Package mcpserver hosts WeKnora's own MCP server surface: the Streamable
|
||||
// Package mcpserver hosts Academy's own MCP server surface: the Streamable
|
||||
// HTTP endpoint that external MCP clients (Claude Desktop, Cursor, VS Code
|
||||
// Copilot, ...) connect to. Every request is authenticated by
|
||||
// middleware.MCPEndpointAuth against a workspace MCPEndpoint row, and the
|
||||
@@ -18,11 +18,11 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/config"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/ratelimit"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/config"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/ratelimit"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
"github.com/mark3labs/mcp-go/server"
|
||||
"github.com/redis/go-redis/v9"
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
serverName = "weknora"
|
||||
serverName = "academy"
|
||||
serverVersion = "1.0.0"
|
||||
|
||||
rateLimitKeyPrefix = "mcp:endpoint:ratelimit:"
|
||||
@@ -128,7 +128,7 @@ func (s *Server) Handler() http.Handler {
|
||||
return s.handler
|
||||
}
|
||||
|
||||
const serverInstructions = "WeKnora knowledge workspace. Start with list_knowledge_bases to see what is in scope, " +
|
||||
const serverInstructions = "Academy knowledge workspace. Start with list_knowledge_bases to see what is in scope, " +
|
||||
"then use search_knowledge for semantic questions, grep_chunks for exact keywords, read_document to read " +
|
||||
"a whole document, and ask to get a synthesized answer with citations. Wiki tools browse the generated " +
|
||||
"wiki when a knowledge base has one. Write tools (add/update/delete_document) exist only on endpoints " +
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/event"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/event"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
"github.com/google/uuid"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
)
|
||||
@@ -26,7 +26,7 @@ const (
|
||||
func askTool() mcp.Tool {
|
||||
return mcp.NewTool(types.MCPEndpointToolAsk,
|
||||
mcp.WithDescription("Ask the workspace a question and get a synthesized answer with citations. "+
|
||||
"WeKnora retrieves from the knowledge bases in scope and runs the agent configured on this "+
|
||||
"Academy retrieves from the knowledge bases in scope and runs the agent configured on this "+
|
||||
"endpoint. Pass the returned session_id on follow-up questions to keep the conversation going. "+
|
||||
"This can take up to a few minutes for agentic runs; prefer search_knowledge when you only need "+
|
||||
"raw passages."),
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/event"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/event"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -108,7 +108,7 @@ func TestAskExposesImageHandlesToTextAndStructuredClients(t *testing.T) {
|
||||
require.Len(t, parsed.References[0].Images, 2)
|
||||
require.Equal(t, publicURL, parsed.References[0].Images[1].URL)
|
||||
img := parsed.References[0].Images[0]
|
||||
require.True(t, strings.HasPrefix(img.URL, "https://weknora.example/prefix/r/"))
|
||||
require.True(t, strings.HasPrefix(img.URL, "https://academy.example/prefix/r/"))
|
||||
require.Equal(t, "chart", img.Caption)
|
||||
require.Equal(t, "values", img.OCRText)
|
||||
require.Contains(t, result.Content[0].(mcp.TextContent).Text, img.URL)
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/application/access"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/application/access"
|
||||
"academy/internal/types"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/agent/tools"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/agent/tools"
|
||||
"academy/internal/types"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/agent/tools"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/agent/tools"
|
||||
"academy/internal/types"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user