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

+4 -4
View File
@@ -4,10 +4,10 @@ import (
"context"
"encoding/json"
"github.com/Tencent/WeKnora/internal/application/repository/retriever/opensearch"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/application/repository/retriever/opensearch"
"academy/internal/logger"
"academy/internal/types"
"academy/internal/types/interfaces"
)
// auditSinkAdapter bridges the OpenSearch driver's AuditSink (which the driver
+4 -4
View File
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/types"
"academy/internal/types/interfaces"
)
// fakeAuditSvc records Log calls.
@@ -36,7 +36,7 @@ func TestAuditSinkAdapter_EmitsWithTenant(t *testing.T) {
f := &fakeAuditSvc{}
sink := newAuditSinkAdapter(f)
sink.EmitIndexCreated(ctxWithTenant(42), "weknora_768", 768)
sink.EmitIndexCreated(ctxWithTenant(42), "academy_768", 768)
if len(f.logged) != 1 {
t.Fatalf("want 1 audit entry, got %d", len(f.logged))
}
@@ -61,7 +61,7 @@ func TestAuditSinkAdapter_SkipsWithoutTenant(t *testing.T) {
f := &fakeAuditSvc{}
sink := newAuditSinkAdapter(f)
// background ctx carries no tenant → adapter must skip (never write tenant=0)
sink.EmitIndexCreated(context.Background(), "weknora_768", 768)
sink.EmitIndexCreated(context.Background(), "academy_768", 768)
sink.EmitReindexExecuted(context.Background(), "a", "b", 1)
if len(f.logged) != 0 {
t.Errorf("want 0 audit entries without tenant, got %d", len(f.logged))
+10 -10
View File
@@ -9,12 +9,12 @@ import (
"github.com/redis/go-redis/v9"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/application/service/sandboxalloc"
"github.com/Tencent/WeKnora/internal/background"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/stream"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/application/service"
"academy/internal/application/service/sandboxalloc"
"academy/internal/background"
"academy/internal/sandbox"
"academy/internal/stream"
"academy/internal/types/interfaces"
)
// newBackgroundActivityRegistry returns the registry of live background work.
@@ -47,12 +47,12 @@ func newBackgroundNoticeInbox(streams interfaces.StreamManager) interfaces.Notic
return background.NewMemoryNoticeInbox(nil)
}
// redisNamespace matches the session-binding store: WEKNORA_REDIS_NAMESPACE,
// or "weknora" when that variable is empty.
// redisNamespace matches the session-binding store: ACADEMY_REDIS_NAMESPACE,
// or "academy" when that variable is empty.
func redisNamespace() string {
namespace := strings.TrimSpace(os.Getenv("WEKNORA_REDIS_NAMESPACE"))
namespace := strings.TrimSpace(os.Getenv("ACADEMY_REDIS_NAMESPACE"))
if namespace == "" {
return "weknora"
return "academy"
}
return namespace
}
@@ -10,9 +10,9 @@ import (
"github.com/redis/go-redis/v9"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/localsandbox"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/application/service"
"academy/internal/localsandbox"
"academy/internal/types/interfaces"
)
// newShellJobService wires Lite shell jobs. Remote sandboxes are hidden, so
@@ -46,7 +46,7 @@ func newShellJobService(
return nil, err
}
local, err := service.NewLocalShellJobService(
provider.LocalSandboxService(), bg, events, filepath.Join(home, ".weknora", "jobs"),
provider.LocalSandboxService(), bg, events, filepath.Join(home, ".academy", "jobs"),
)
if err != nil {
return nil, err
@@ -7,8 +7,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/background"
"academy/internal/application/service"
"academy/internal/background"
)
func TestDesktopWithoutHostManagerStaysRemoteOnly(t *testing.T) {
+2 -2
View File
@@ -5,8 +5,8 @@ package container
import (
"github.com/redis/go-redis/v9"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/application/service"
"academy/internal/types/interfaces"
)
// newShellJobService is the web constructor dig provides. Host wiring and the
+9 -9
View File
@@ -5,15 +5,15 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/agent/tools"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/application/service/sandboxalloc"
"github.com/Tencent/WeKnora/internal/background"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/sandbox/allocation"
"github.com/Tencent/WeKnora/internal/stream"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/agent/tools"
"academy/internal/application/service"
"academy/internal/application/service/sandboxalloc"
"academy/internal/background"
"academy/internal/sandbox"
"academy/internal/sandbox/allocation"
"academy/internal/stream"
"academy/internal/types"
"academy/internal/types/interfaces"
"github.com/alicebob/miniredis/v2"
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/require"
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"sync"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/types"
"academy/internal/types/interfaces"
)
// cleanupStepTimeout bounds one shutdown hook that waits on in-flight work
+81 -81
View File
@@ -18,7 +18,7 @@ import (
"strings"
"time"
modelruntime "github.com/Tencent/WeKnora/internal/models/runtime"
modelruntime "academy/internal/models/runtime"
sqlite_vec "github.com/asg017/sqlite-vec-go-bindings/cgo"
_ "github.com/duckdb/duckdb-go/v2"
@@ -36,77 +36,77 @@ import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"github.com/Tencent/WeKnora/internal/agent/approval"
"github.com/Tencent/WeKnora/internal/agent/hitl"
"github.com/Tencent/WeKnora/internal/agent/operations"
"github.com/Tencent/WeKnora/internal/application/repository"
dorisRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/doris"
elasticsearchRepoV7 "github.com/Tencent/WeKnora/internal/application/repository/retriever/elasticsearch/v7"
elasticsearchRepoV8 "github.com/Tencent/WeKnora/internal/application/repository/retriever/elasticsearch/v8"
milvusRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/milvus"
neo4jRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/neo4j"
openSearchRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/opensearch"
postgresRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/postgres"
qdrantRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/qdrant"
sqliteRetrieverRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/sqlite"
tencentVectorDBRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/tencentvectordb"
weaviateRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/weaviate"
"github.com/Tencent/WeKnora/internal/application/service"
chatpipeline "github.com/Tencent/WeKnora/internal/application/service/chat_pipeline"
"github.com/Tencent/WeKnora/internal/application/service/file"
"github.com/Tencent/WeKnora/internal/application/service/memory"
"github.com/Tencent/WeKnora/internal/application/service/retriever"
"github.com/Tencent/WeKnora/internal/application/service/sandboxalloc"
"github.com/Tencent/WeKnora/internal/browserskill"
"github.com/Tencent/WeKnora/internal/common"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/database"
"github.com/Tencent/WeKnora/internal/datasource"
confluenceConnector "github.com/Tencent/WeKnora/internal/datasource/connector/confluence"
dingtalkConnector "github.com/Tencent/WeKnora/internal/datasource/connector/dingtalk"
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/drive"
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/wiki"
gitlabConnector "github.com/Tencent/WeKnora/internal/datasource/connector/gitlab"
imaConnector "github.com/Tencent/WeKnora/internal/datasource/connector/ima"
"github.com/Tencent/WeKnora/internal/im/wecompush"
notionConnector "github.com/Tencent/WeKnora/internal/datasource/connector/notion"
rssConnector "github.com/Tencent/WeKnora/internal/datasource/connector/rss"
seafileConnector "github.com/Tencent/WeKnora/internal/datasource/connector/seafile"
yuqueConnector "github.com/Tencent/WeKnora/internal/datasource/connector/yuque"
"github.com/Tencent/WeKnora/internal/event"
"github.com/Tencent/WeKnora/internal/handler"
"github.com/Tencent/WeKnora/internal/handler/session"
"github.com/Tencent/WeKnora/internal/handler/orgcenter"
"github.com/Tencent/WeKnora/internal/handler/training"
imPkg "github.com/Tencent/WeKnora/internal/im"
"github.com/Tencent/WeKnora/internal/im/dingtalk"
"github.com/Tencent/WeKnora/internal/im/feishu"
"github.com/Tencent/WeKnora/internal/im/mattermost"
"github.com/Tencent/WeKnora/internal/im/qqbot"
"github.com/Tencent/WeKnora/internal/im/slack"
"github.com/Tencent/WeKnora/internal/im/telegram"
"github.com/Tencent/WeKnora/internal/im/wechat"
"github.com/Tencent/WeKnora/internal/im/wecom"
"github.com/Tencent/WeKnora/internal/im/yunzhijia"
"github.com/Tencent/WeKnora/internal/infrastructure/docparser"
infra_web_search "github.com/Tencent/WeKnora/internal/infrastructure/web_search"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/mcp"
"github.com/Tencent/WeKnora/internal/mcpserver"
"github.com/Tencent/WeKnora/internal/models/api"
"github.com/Tencent/WeKnora/internal/models/embedding"
"github.com/Tencent/WeKnora/internal/models/limiter" // register built-in vendors
"github.com/Tencent/WeKnora/internal/models/utils/ollama"
"github.com/Tencent/WeKnora/internal/router"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/sandbox/admission"
"github.com/Tencent/WeKnora/internal/storageallowlist"
"github.com/Tencent/WeKnora/internal/stream"
"github.com/Tencent/WeKnora/internal/tracing/langfuse"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/agent/approval"
"academy/internal/agent/hitl"
"academy/internal/agent/operations"
"academy/internal/application/repository"
dorisRepo "academy/internal/application/repository/retriever/doris"
elasticsearchRepoV7 "academy/internal/application/repository/retriever/elasticsearch/v7"
elasticsearchRepoV8 "academy/internal/application/repository/retriever/elasticsearch/v8"
milvusRepo "academy/internal/application/repository/retriever/milvus"
neo4jRepo "academy/internal/application/repository/retriever/neo4j"
openSearchRepo "academy/internal/application/repository/retriever/opensearch"
postgresRepo "academy/internal/application/repository/retriever/postgres"
qdrantRepo "academy/internal/application/repository/retriever/qdrant"
sqliteRetrieverRepo "academy/internal/application/repository/retriever/sqlite"
tencentVectorDBRepo "academy/internal/application/repository/retriever/tencentvectordb"
weaviateRepo "academy/internal/application/repository/retriever/weaviate"
"academy/internal/application/service"
chatpipeline "academy/internal/application/service/chat_pipeline"
"academy/internal/application/service/file"
"academy/internal/application/service/memory"
"academy/internal/application/service/retriever"
"academy/internal/application/service/sandboxalloc"
"academy/internal/browserskill"
"academy/internal/common"
"academy/internal/config"
"academy/internal/database"
"academy/internal/datasource"
confluenceConnector "academy/internal/datasource/connector/confluence"
dingtalkConnector "academy/internal/datasource/connector/dingtalk"
"academy/internal/datasource/connector/feishu/core"
"academy/internal/datasource/connector/feishu/drive"
"academy/internal/datasource/connector/feishu/wiki"
gitlabConnector "academy/internal/datasource/connector/gitlab"
imaConnector "academy/internal/datasource/connector/ima"
"academy/internal/im/wecompush"
notionConnector "academy/internal/datasource/connector/notion"
rssConnector "academy/internal/datasource/connector/rss"
seafileConnector "academy/internal/datasource/connector/seafile"
yuqueConnector "academy/internal/datasource/connector/yuque"
"academy/internal/event"
"academy/internal/handler"
"academy/internal/handler/session"
"academy/internal/handler/orgcenter"
"academy/internal/handler/training"
imPkg "academy/internal/im"
"academy/internal/im/dingtalk"
"academy/internal/im/feishu"
"academy/internal/im/mattermost"
"academy/internal/im/qqbot"
"academy/internal/im/slack"
"academy/internal/im/telegram"
"academy/internal/im/wechat"
"academy/internal/im/wecom"
"academy/internal/im/yunzhijia"
"academy/internal/infrastructure/docparser"
infra_web_search "academy/internal/infrastructure/web_search"
"academy/internal/logger"
"academy/internal/mcp"
"academy/internal/mcpserver"
"academy/internal/models/api"
"academy/internal/models/embedding"
"academy/internal/models/limiter" // register built-in vendors
"academy/internal/models/utils/ollama"
"academy/internal/router"
"academy/internal/sandbox"
"academy/internal/sandbox/admission"
"academy/internal/storageallowlist"
"academy/internal/stream"
"academy/internal/tracing/langfuse"
"academy/internal/types"
"academy/internal/types/interfaces"
secutils "academy/internal/utils"
"github.com/tencent/vectordatabase-sdk-go/tcvectordb"
"github.com/weaviate/weaviate-go-client/v5/weaviate"
"github.com/weaviate/weaviate-go-client/v5/weaviate/auth"
@@ -292,7 +292,7 @@ func BuildContainer(container *dig.Container) *dig.Container {
must(container.Provide(func(s *service.TenantSandboxConfigService) service.WorkspaceSandboxPolicy {
return s
}))
must(container.Provide(service.NewWeKnoraCloudService))
must(container.Provide(service.NewAcademyCloudService))
// Extract services - register individual extracters with names
must(container.Provide(service.NewChunkExtractService, dig.Name("chunkExtractor")))
@@ -810,7 +810,7 @@ func BuildContainer(container *dig.Container) *dig.Container {
must(container.Provide(handler.NewIMHandler))
must(container.Provide(handler.NewEmbedChannelHandler))
must(container.Provide(handler.NewMCPEndpointHandler))
must(container.Provide(handler.NewWeKnoraCloudHandler))
must(container.Provide(handler.NewAcademyCloudHandler))
logger.Debugf(ctx, "[Container] HTTP handlers registered")
// Wire the chat package's local image resolver so multimodal chat can read
@@ -934,7 +934,7 @@ func initLangfuse() (*langfuse.Manager, error) {
}
// defaultModelMaxConcurrency is the per-model cap on concurrent background
// (ingestion/enrichment) chat calls when WEKNORA_MODEL_MAX_CONCURRENCY /
// (ingestion/enrichment) chat calls when ACADEMY_MODEL_MAX_CONCURRENCY /
// model.max_concurrency is unset. summary / question / graph enrichment all
// share the same model, so this bounds their combined pressure on one provider
// across every replica. Interactive chat is never gated.
@@ -949,7 +949,7 @@ func resolveModelMaxConcurrency(ss interfaces.SystemSettingService) int {
return defaultModelMaxConcurrency
}
return int(ss.GetInt(context.Background(), "model.max_concurrency",
"WEKNORA_MODEL_MAX_CONCURRENCY", int64(defaultModelMaxConcurrency)))
"ACADEMY_MODEL_MAX_CONCURRENCY", int64(defaultModelMaxConcurrency)))
}
// registerModelConcurrencyLimiter builds the Redis-backed per-model background
@@ -1070,7 +1070,7 @@ func initDatabase(cfg *config.Config) (*gorm.DB, error) {
case "sqlite":
dbPath := os.Getenv("DB_PATH")
if dbPath == "" {
dbPath = "./data/weknora.db"
dbPath = "./data/academy.db"
}
if dir := filepath.Dir(dbPath); dir != "." && dir != "" {
if err := os.MkdirAll(dir, 0o755); err != nil {
@@ -1450,7 +1450,7 @@ func initRawFileService(_ *config.Config) (interfaces.FileService, error) {
}
pathPrefix := os.Getenv("S3_PATH_PREFIX")
if pathPrefix == "" {
pathPrefix = "weknora/"
pathPrefix = "academy/"
}
return file.NewS3FileService(
os.Getenv("S3_ENDPOINT"),
@@ -1470,7 +1470,7 @@ func initRawFileService(_ *config.Config) (interfaces.FileService, error) {
obsRegion := os.Getenv("OBS_REGION")
obsPathPrefix := os.Getenv("OBS_PATH_PREFIX")
if obsPathPrefix == "" {
obsPathPrefix = "weknora/"
obsPathPrefix = "academy/"
}
return file.NewObsFileService(
os.Getenv("OBS_ENDPOINT"),
@@ -1490,7 +1490,7 @@ func initRawFileService(_ *config.Config) (interfaces.FileService, error) {
}
pathPrefix := os.Getenv("OSS_PATH_PREFIX")
if pathPrefix == "" {
pathPrefix = "weknora/"
pathPrefix = "academy/"
}
return file.NewOssFileServiceWithTempBucket(
os.Getenv("OSS_ENDPOINT"),
@@ -1768,7 +1768,7 @@ func initRetrieveEngineRegistry(
}
dorisDatabase := os.Getenv("DORIS_DATABASE")
if dorisDatabase == "" {
dorisDatabase = "weknora"
dorisDatabase = "academy"
}
dorisUsername := os.Getenv("DORIS_USERNAME")
if dorisUsername == "" {
@@ -3,8 +3,8 @@ package container
import (
"testing"
"github.com/Tencent/WeKnora/internal/datasource"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/datasource"
"academy/internal/types"
)
func TestConnectorRegistryIncludesDingTalk(t *testing.T) {
+15 -15
View File
@@ -20,21 +20,21 @@ import (
"google.golang.org/grpc"
"gorm.io/gorm"
dorisRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/doris"
elasticsearchRepoV7 "github.com/Tencent/WeKnora/internal/application/repository/retriever/elasticsearch/v7"
elasticsearchRepoV8 "github.com/Tencent/WeKnora/internal/application/repository/retriever/elasticsearch/v8"
milvusRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/milvus"
openSearchRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/opensearch"
postgresRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/postgres"
qdrantRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/qdrant"
sqliteRetrieverRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/sqlite"
tencentVectorDBRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/tencentvectordb"
weaviateRepo "github.com/Tencent/WeKnora/internal/application/repository/retriever/weaviate"
"github.com/Tencent/WeKnora/internal/application/service/retriever"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"github.com/Tencent/WeKnora/internal/utils"
dorisRepo "academy/internal/application/repository/retriever/doris"
elasticsearchRepoV7 "academy/internal/application/repository/retriever/elasticsearch/v7"
elasticsearchRepoV8 "academy/internal/application/repository/retriever/elasticsearch/v8"
milvusRepo "academy/internal/application/repository/retriever/milvus"
openSearchRepo "academy/internal/application/repository/retriever/opensearch"
postgresRepo "academy/internal/application/repository/retriever/postgres"
qdrantRepo "academy/internal/application/repository/retriever/qdrant"
sqliteRetrieverRepo "academy/internal/application/repository/retriever/sqlite"
tencentVectorDBRepo "academy/internal/application/repository/retriever/tencentvectordb"
weaviateRepo "academy/internal/application/repository/retriever/weaviate"
"academy/internal/application/service/retriever"
"academy/internal/config"
"academy/internal/types"
"academy/internal/types/interfaces"
"academy/internal/utils"
"github.com/tencent/vectordatabase-sdk-go/tcvectordb"
)
@@ -9,8 +9,8 @@ import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/config"
"academy/internal/types"
)
// osClusterHandler simulates an OpenSearch cluster for the driver's
+1 -1
View File
@@ -3,7 +3,7 @@ package container
import (
"testing"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
)
func TestBuildMilvusClientConfig_UsesDatabaseName(t *testing.T) {
+3 -3
View File
@@ -9,9 +9,9 @@ import (
"gorm.io/gorm"
"github.com/Tencent/WeKnora/internal/handler/session"
"github.com/Tencent/WeKnora/internal/localsandbox"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/handler/session"
"academy/internal/localsandbox"
"academy/internal/types"
)
type hostProjectLookupImpl struct {
@@ -10,8 +10,8 @@ import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"github.com/Tencent/WeKnora/internal/localsandbox"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/localsandbox"
"academy/internal/types"
)
func hostProjectLookupTestDB(t *testing.T) *gorm.DB {
+3 -3
View File
@@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/dig"
"github.com/Tencent/WeKnora/internal/application/service"
"academy/internal/application/service"
"gorm.io/gorm"
)
@@ -35,7 +35,7 @@ func moduleRoot(t *testing.T) string {
// The host OS sandbox is a desktop-only compile. cmd/server (standard and
// make build-lite) must not even link the package.
func TestCmdServerDoesNotDependOnLocalSandbox(t *testing.T) {
cmd := exec.Command("go", "list", "-deps", "github.com/Tencent/WeKnora/cmd/server")
cmd := exec.Command("go", "list", "-deps", "academy/cmd/server")
cmd.Dir = moduleRoot(t)
out, err := cmd.CombinedOutput()
require.NoError(t, err, string(out))
@@ -59,7 +59,7 @@ func TestStubHostWiringRegistersWithoutLocalSandbox(t *testing.T) {
func TestContainerPackageImportListOmitsLocalSandbox(t *testing.T) {
cmd := exec.Command(
"go", "list", "-f", "{{join .Imports \"\\n\"}}",
"github.com/Tencent/WeKnora/internal/container",
"academy/internal/container",
)
cmd.Dir = moduleRoot(t)
out, err := cmd.CombinedOutput()
@@ -6,10 +6,10 @@ import (
"errors"
"time"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/application/service"
"academy/internal/logger"
"academy/internal/types"
"academy/internal/types/interfaces"
"github.com/hibiken/asynq"
"gorm.io/gorm"
)
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"os"
"time"
"github.com/Tencent/WeKnora/internal/application/repository"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/application/repository"
"academy/internal/logger"
"academy/internal/types"
"gorm.io/gorm"
)
@@ -6,8 +6,8 @@ import (
"testing"
"time"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/application/service"
"academy/internal/types"
"github.com/hibiken/asynq"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -7,10 +7,10 @@ import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"github.com/Tencent/WeKnora/internal/application/repository"
"github.com/Tencent/WeKnora/internal/application/service/retriever"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/application/repository"
"academy/internal/application/service/retriever"
"academy/internal/config"
"academy/internal/types/interfaces"
)
// TestRetrieveEngineRegistryWiring checks that the container can still build
+11 -11
View File
@@ -11,14 +11,14 @@ import (
"github.com/redis/go-redis/v9"
"gorm.io/gorm"
"github.com/Tencent/WeKnora/internal/application/service/sandboxalloc"
apperrors "github.com/Tencent/WeKnora/internal/errors"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/sandbox/admission"
"github.com/Tencent/WeKnora/internal/sandbox/allocation"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/application/service/sandboxalloc"
apperrors "academy/internal/errors"
"academy/internal/logger"
"academy/internal/sandbox"
"academy/internal/sandbox/admission"
"academy/internal/sandbox/allocation"
"academy/internal/types"
"academy/internal/types/interfaces"
)
// newSandboxManager is deliberately disabled. Every executable backend now
@@ -33,9 +33,9 @@ func newSandboxManager(
// sandboxRedisNamespace is the Redis key prefix shared by session bindings
// and user-machine digests. An empty env var means the historical default.
func sandboxRedisNamespace() string {
namespace := strings.TrimSpace(os.Getenv("WEKNORA_REDIS_NAMESPACE"))
namespace := strings.TrimSpace(os.Getenv("ACADEMY_REDIS_NAMESPACE"))
if namespace == "" {
namespace = "weknora"
namespace = "academy"
}
return namespace
}
@@ -191,5 +191,5 @@ func newAdmissionRegistry(redisClient *redis.Client) admission.Registry {
if redisClient == nil {
return admission.NewMemory()
}
return admission.NewRedis(redisClient, "weknora:sandbox:user:")
return admission.NewRedis(redisClient, "academy:sandbox:user:")
}
+11 -11
View File
@@ -8,12 +8,12 @@ import (
"path/filepath"
"strings"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/localsandbox"
"github.com/Tencent/WeKnora/internal/localsandbox/adapter"
"github.com/Tencent/WeKnora/internal/localsandbox/skilltree"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/sandbox"
"academy/internal/application/service"
"academy/internal/localsandbox"
"academy/internal/localsandbox/adapter"
"academy/internal/localsandbox/skilltree"
"academy/internal/logger"
"academy/internal/sandbox"
)
// Host adapters must not version the user's workspace. This compile-time check
@@ -30,7 +30,7 @@ type hostSandboxDeps struct {
homeDir string
appDataDir string
// sessionRoot is where auto-allocated session workspaces go. Empty falls
// back to ~/Documents/WeKnoraLite.
// back to ~/Documents/AcademyLite.
sessionRoot string
skillsRoot string
// projects maps a session to a user-approved project directory.
@@ -161,16 +161,16 @@ func finishHostSandbox(parts *hostSandboxParts, skillsRoot string) service.HostS
}
func defaultHostSessionRoot(homeDir string) string {
return filepath.Join(homeDir, "Documents", "WeKnoraLite")
return filepath.Join(homeDir, "Documents", "AcademyLite")
}
func defaultHostSkillsRoot(homeDir string) string {
return filepath.Join(homeDir, ".weknora", "skills")
return filepath.Join(homeDir, ".academy", "skills")
}
func hostAppDataDir(home string) string {
if dir, err := os.UserConfigDir(); err == nil && strings.TrimSpace(dir) != "" {
return filepath.Join(dir, "WeKnora Lite")
return filepath.Join(dir, "Academy Lite")
}
return filepath.Join(home, "Library", "Application Support", "WeKnora Lite")
return filepath.Join(home, "Library", "Application Support", "Academy Lite")
}
+1 -1
View File
@@ -1,6 +1,6 @@
package container
import "github.com/Tencent/WeKnora/internal/handler/session"
import "academy/internal/handler/session"
// HostApprovalModeLoader reads the desktop approval-mode preference.
// Nil (server binaries, tests that do not decorate) means ModeAuto.
+1 -1
View File
@@ -2,7 +2,7 @@
package container
import "github.com/Tencent/WeKnora/internal/application/service"
import "academy/internal/application/service"
// Dummy dig types so BuildContainer can Provide the same constructor names
// without importing localsandbox. The desktop-tagged files replace these.
+9 -9
View File
@@ -10,9 +10,9 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/dig"
"github.com/Tencent/WeKnora/internal/application/service"
"github.com/Tencent/WeKnora/internal/localsandbox"
"github.com/Tencent/WeKnora/internal/sandbox"
"academy/internal/application/service"
"academy/internal/localsandbox"
"academy/internal/sandbox"
"gorm.io/gorm"
)
@@ -47,7 +47,7 @@ func TestFinishHostSandboxKeepsChatWhenSkillTreeCannotOpen(t *testing.T) {
parts := buildHostSandbox(hostSandboxDeps{
newBackend: func() (localsandbox.Backend, error) { return stubBackend{}, nil },
homeDir: "/Users/dev",
appDataDir: "/Users/dev/App Support/WeKnora",
appDataDir: "/Users/dev/App Support/Academy",
})
require.NotNil(t, parts)
require.NotNil(t, parts.manager)
@@ -72,19 +72,19 @@ func TestHostSandboxManagerNilWhenAvailableFails(t *testing.T) {
}))
}
func TestDefaultHostSessionRootUsesWeKnoraLite(t *testing.T) {
require.Equal(t, "/Users/dev/Documents/WeKnoraLite", defaultHostSessionRoot("/Users/dev"))
func TestDefaultHostSessionRootUsesAcademyLite(t *testing.T) {
require.Equal(t, "/Users/dev/Documents/AcademyLite", defaultHostSessionRoot("/Users/dev"))
}
func TestDefaultHostSkillsRootIsDotWeknora(t *testing.T) {
require.Equal(t, "/Users/dev/.weknora/skills", defaultHostSkillsRoot("/Users/dev"))
func TestDefaultHostSkillsRootIsDotAcademy(t *testing.T) {
require.Equal(t, "/Users/dev/.academy/skills", defaultHostSkillsRoot("/Users/dev"))
}
func TestHostSandboxManagerEnabledWhenBackendAvailable(t *testing.T) {
mgr := buildHostSandboxManager(hostSandboxDeps{
newBackend: func() (localsandbox.Backend, error) { return stubBackend{}, nil },
homeDir: "/Users/dev",
appDataDir: "/Users/dev/App Support/WeKnora",
appDataDir: "/Users/dev/App Support/Academy",
})
require.NotNil(t, mgr)
require.Equal(t, sandbox.SandboxTypeHost, mgr.GetType())
+3 -3
View File
@@ -11,9 +11,9 @@ import (
"github.com/stretchr/testify/require"
"gorm.io/gorm"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/sandbox/allocation"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/sandbox"
"academy/internal/sandbox/allocation"
"academy/internal/types"
)
func TestSelectSessionBindingStorePrefersRedis(t *testing.T) {
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"os"
"testing"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/types"
"academy/internal/utils"
)
func TestMain(m *testing.M) {
@@ -3,7 +3,7 @@ package container
import (
"testing"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gorm.io/driver/sqlite"
@@ -8,7 +8,7 @@ import (
milvusclient "github.com/milvus-io/milvus/client/v2/milvusclient"
secutils "github.com/Tencent/WeKnora/internal/utils"
secutils "academy/internal/utils"
)
func whitelistOnly(t *testing.T, whitelist, only string) {