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

+8 -8
View File
@@ -11,10 +11,10 @@ import (
"sync/atomic"
"time"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/logger"
"academy/internal/types"
"academy/internal/types/interfaces"
secutils "academy/internal/utils"
"github.com/google/uuid"
"github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/client/transport"
@@ -398,7 +398,7 @@ func (c *mcpGoClient) checkErrorAndDisconnectIfNeeded(err error) {
}
}
// oauthCall runs one MCP operation with WeKnora-owned token lifecycle checks.
// oauthCall runs one MCP operation with Academy-owned token lifecycle checks.
// A resource-server 401 forces exactly one refresh and one retry. Other errors
// are never retried, which avoids duplicating tool side effects after ambiguous
// network failures.
@@ -473,7 +473,7 @@ func (c *mcpGoClient) Initialize(ctx context.Context) (*InitializeResult, error)
ProtocolVersion: mcp.LATEST_PROTOCOL_VERSION,
Capabilities: mcp.ClientCapabilities{},
ClientInfo: mcp.Implementation{
Name: "WeKnora",
Name: "Academy",
Version: "1.0.0",
},
},
@@ -670,7 +670,7 @@ func (c *mcpGoClient) listRawTools(ctx context.Context) ([]*types.MCPTool, error
// metadata/header helpers without losing unknown JSON Schema fields.
params.Meta = &mcp.Meta{}
params.Meta.SetProtocolVersion(version)
params.Meta.SetClientInfo(mcp.Implementation{Name: "WeKnora", Version: "1.0.0"})
params.Meta.SetClientInfo(mcp.Implementation{Name: "Academy", Version: "1.0.0"})
params.Meta.SetClientCapabilities(mcp.ClientCapabilities{})
headers = make(http.Header)
for name, value := range mcp.StandardHeaders(version, mcp.MethodToolsList, nil) {
@@ -679,7 +679,7 @@ func (c *mcpGoClient) listRawTools(ctx context.Context) ([]*types.MCPTool, error
}
response, err := c.client.GetTransport().SendRequest(ctx, transport.JSONRPCRequest{
JSONRPC: mcp.JSONRPC_VERSION,
ID: mcp.NewRequestId("weknora-tools-" + uuid.NewString()),
ID: mcp.NewRequestId("academy-tools-" + uuid.NewString()),
Method: "tools/list",
Params: params,
Header: headers,
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
sdkmcp "github.com/mark3labs/mcp-go/mcp"
sdkserver "github.com/mark3labs/mcp-go/server"
"github.com/stretchr/testify/require"
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
sdk "github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"
"github.com/stretchr/testify/require"
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
"github.com/mark3labs/mcp-go/client/transport"
sdk "github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"sync/atomic"
"testing"
"github.com/Tencent/WeKnora/internal/types"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
secutils "academy/internal/utils"
"github.com/mark3labs/mcp-go/client/transport"
sdk "github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/require"
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
sdk "github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"
"github.com/stretchr/testify/require"
@@ -6,8 +6,8 @@ import (
"net/http/httptest"
"testing"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
sdkmcp "github.com/mark3labs/mcp-go/mcp"
sdkserver "github.com/mark3labs/mcp-go/server"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"testing"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
"github.com/mark3labs/mcp-go/client/transport"
)
+1 -1
View File
@@ -37,7 +37,7 @@ func TestRawToolsPaginationErrorsAndCancellation(t *testing.T) {
calls++
id, err := json.Marshal(request.ID)
require.NoError(t, err)
require.Contains(t, string(id), `"weknora-tools-`)
require.Contains(t, string(id), `"academy-tools-`)
require.False(t, seenIDs[string(id)])
seenIDs[string(id)] = true
require.Equal(t, "tools/list", request.Method)
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"sync"
"time"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/logger"
"academy/internal/types"
"academy/internal/types/interfaces"
)
// MCPManager manages MCP client connections
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
sdkmcp "github.com/mark3labs/mcp-go/mcp"
sdkserver "github.com/mark3labs/mcp-go/server"
"github.com/stretchr/testify/require"
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
"github.com/stretchr/testify/require"
)
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
sdkserver "github.com/mark3labs/mcp-go/server"
"github.com/stretchr/testify/require"
)
+5 -5
View File
@@ -11,8 +11,8 @@ import (
"strings"
"time"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/logger"
"academy/internal/types"
"github.com/mark3labs/mcp-go/client/transport"
)
@@ -56,10 +56,10 @@ func (e *OAuthGrantRejectedError) Error() string {
// AuthorizeWithAssertion obtains principal's token for service with the JWT
// bearer grant and stores it the way an authorization code callback does.
//
// It serves deployments where an application in front of WeKnora signs the
// user in and calls WeKnora for that user, so no browser can follow an
// It serves deployments where an application in front of Academy signs the
// user in and calls Academy for that user, so no browser can follow an
// authorization redirect. That application presents an assertion of the
// user's identity; WeKnora forwards it unread, because validating it is up to
// user's identity; Academy forwards it unread, because validating it is up to
// the authorization server. The grant is sent with the service's
// pre-registered client, or else the client already registered for it.
func (m *OAuthManager) AuthorizeWithAssertion(
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
secutils "academy/internal/utils"
"github.com/stretchr/testify/require"
)
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"strings"
"time"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/logger"
"academy/internal/types"
"academy/internal/types/interfaces"
"github.com/google/uuid"
"github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/client/transport"
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
"github.com/mark3labs/mcp-go/client/transport"
"github.com/stretchr/testify/require"
)
+5 -5
View File
@@ -9,17 +9,17 @@ import (
"strings"
"time"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/logger"
"academy/internal/types"
"academy/internal/types/interfaces"
secutils "academy/internal/utils"
"github.com/mark3labs/mcp-go/client/transport"
"github.com/redis/go-redis/v9"
)
// clientRegistrationName is sent as client_name during dynamic client
// registration (RFC 7591).
const clientRegistrationName = "WeKnora"
const clientRegistrationName = "Academy"
// oauthCallbackTimeout bounds token exchange after the browser lands on the
// public callback route. The Gin request context is canceled once the client
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"net/http/httptest"
"testing"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/types/interfaces"
secutils "academy/internal/utils"
"github.com/stretchr/testify/require"
)
@@ -5,7 +5,7 @@ import (
"net/url"
"testing"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
"github.com/stretchr/testify/require"
)
+2 -2
View File
@@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
"github.com/mark3labs/mcp-go/client/transport"
"github.com/stretchr/testify/require"
)
@@ -150,7 +150,7 @@ func TestManagedTokenStoreLeavesRefreshToOAuthRuntime(t *testing.T) {
token, err := store.GetToken(context.Background())
require.NoError(t, err)
require.True(t, token.ExpiresAt.IsZero(), "mcp-go must not race WeKnora's coordinated refresh")
require.True(t, token.ExpiresAt.IsZero(), "mcp-go must not race Academy's coordinated refresh")
row, err := repo.GetTokenForPrincipal(context.Background(), 7, principal, "svc-1")
require.NoError(t, err)
require.False(t, row.ExpiresAt.IsZero(), "the database must retain the real expiry for preflight checks")
+4 -4
View File
@@ -9,7 +9,7 @@ import (
"sync"
"time"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
"github.com/redis/go-redis/v9"
)
@@ -80,11 +80,11 @@ func newOAuthStateStore(rdb *redis.Client) *oauthStateStore {
}
func (s *oauthStateStore) key(state string) string {
ns := strings.TrimSpace(os.Getenv("WEKNORA_REDIS_NAMESPACE"))
ns := strings.TrimSpace(os.Getenv("ACADEMY_REDIS_NAMESPACE"))
if ns != "" {
return "weknora:mcp_oauth_state:" + ns + ":" + state
return "academy:mcp_oauth_state:" + ns + ":" + state
}
return "weknora:mcp_oauth_state:" + state
return "academy:mcp_oauth_state:" + state
}
func (s *oauthStateStore) attemptKey(state string) string {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
"github.com/stretchr/testify/require"
)
+4 -4
View File
@@ -5,8 +5,8 @@ import (
"fmt"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/types"
"academy/internal/types/interfaces"
"github.com/mark3labs/mcp-go/client/transport"
)
@@ -14,7 +14,7 @@ import (
// scoped to a single (tenant, principal, service) tuple. The mcp-go OAuth handler
// calls SaveToken after a successful authorization or refresh. Runtime MCP
// transports receive the managedTokenStore wrapper below so refresh decisions
// stay in WeKnora's coordinated lifecycle instead of the dependency.
// stay in Academy's coordinated lifecycle instead of the dependency.
type dbTokenStore struct {
repo interfaces.MCPOAuthRepository
tenantID uint64
@@ -22,7 +22,7 @@ type dbTokenStore struct {
serviceID string
}
// managedTokenStore hides local expiry from mcp-go transports. WeKnora checks
// managedTokenStore hides local expiry from mcp-go transports. Academy checks
// the persisted ExpiresAt before every operation and performs the coordinated
// refresh itself; allowing the dependency to also auto-refresh would bypass
// the cross-instance lease and collapse refresh failures into a generic
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"github.com/Tencent/WeKnora/internal/types"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
secutils "academy/internal/utils"
)
// ValidateServiceOutboundURLs validates every URL that the MCP transport or
+1 -1
View File
@@ -3,7 +3,7 @@ package mcp
import (
"testing"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
)
func TestValidateServiceOutboundURLsRejectsOAuthMetadataSSRF(t *testing.T) {