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

+10 -10
View File
@@ -9,9 +9,9 @@ import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
// modelCreateFields enumerates the fields surfaced for `--format json` discovery
@@ -78,14 +78,14 @@ func frontendModelType(t string) string {
}
}
// NewCmdCreate builds `weknora model create <name>`.
// NewCmdCreate builds `academy model create <name>`.
func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
opts := &CreateOptions{}
cmd := &cobra.Command{
Use: "create <name>",
Short: "Register a model (embedding / rerank / chat / VLLM / ASR)",
Long: `Register a model on the server so it can back a knowledge base's embedding /
summary config (see 'weknora kb config set') or an agent (--model).
summary config (see 'academy kb config set') or an agent (--model).
<name> is the model name as the provider knows it (e.g. "nomic-embed-text",
"gpt-4o", "qwen2"). --type and --source are required.
@@ -99,7 +99,7 @@ Two modes:
Remote (API): --source remote --provider <name> [--api-key-stdin] [--base-url <url>]
Registered active and routed to the provider's API.
--provider is required and is validated against the server's
live provider catalog (weknora api /api/v1/models/providers);
live provider catalog (academy api /api/v1/models/providers);
--base-url defaults to that provider's URL for the type when
omitted.
@@ -165,7 +165,7 @@ else goes through repeatable --param key=value.`,
}
cmd.Flags().StringVar(&opts.Type, "type", "", "Model type: "+strings.Join(modelTypeValues, " | ")+" (required; \"chat\" is accepted for KnowledgeQA)")
cmd.Flags().StringVar(&opts.Source, "source", "", "Where the model runs: "+strings.Join(createSourceValues, " | ")+" (required; local=Ollama, remote=provider API)")
cmd.Flags().StringVar(&opts.Provider, "provider", "", "Remote provider id, required+validated with --source remote (see `weknora api /api/v1/models/providers`)")
cmd.Flags().StringVar(&opts.Provider, "provider", "", "Remote provider id, required+validated with --source remote (see `academy api /api/v1/models/providers`)")
cmd.Flags().StringVar(&opts.DisplayName, "display-name", "", "Human-friendly name (optional)")
cmd.Flags().StringVar(&opts.Description, "description", "", "Description (optional)")
cmd.Flags().StringVar(&opts.BaseURL, "base-url", "", "Model API base URL (e.g. http://localhost:11434 for Ollama)")
@@ -178,11 +178,11 @@ else goes through repeatable --param key=value.`,
cmdutil.AddFormatFlag(cmd, modelCreateFields...)
cmdutil.AddDryRunFlag(cmd, &opts.DryRun)
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "register a model (embedding/rerank/chat/VLLM/ASR) so a KB or agent can use it; capture .data.id to pass to `weknora kb config set` / `agent create --model`.",
UsedFor: "register a model (embedding/rerank/chat/VLLM/ASR) so a KB or agent can use it; capture .data.id to pass to `academy kb config set` / `agent create --model`.",
RequiredFlags: []string{"<name> (positional)", "--type", "--source (local|remote)", "--provider (when --source remote)"},
Examples: []string{
`weknora model create nomic-embed-text --type Embedding --source local --dimension 768 # Ollama (server pulls it)`,
`printf '%s' "$OPENAI_KEY" | weknora model create text-embedding-3-small --type Embedding --source remote --provider openai --dimension 1536 --api-key-stdin`,
`academy model create nomic-embed-text --type Embedding --source local --dimension 768 # Ollama (server pulls it)`,
`printf '%s' "$OPENAI_KEY" | academy model create text-embedding-3-small --type Embedding --source remote --provider openai --dimension 1536 --api-key-stdin`,
},
Output: "envelope.data is the created Model object with id, name, type, source, parameters",
Warnings: []string{
+4 -4
View File
@@ -10,9 +10,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
type fakeCreateSvc struct {
@@ -151,7 +151,7 @@ func TestParseParams(t *testing.T) {
// withRootHarnessModel wraps a model subcommand under a synthetic root with the
// global persistent flags so flag/enum validation and gating route correctly.
func withRootHarnessModel(sub *cobra.Command, args ...string) *cobra.Command {
root := &cobra.Command{Use: "weknora"}
root := &cobra.Command{Use: "academy"}
pf := root.PersistentFlags()
pf.BoolP("yes", "y", false, "")
pf.String("format", "", "")
+6 -6
View File
@@ -6,9 +6,9 @@ import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
// DeleteService is the narrow SDK surface this command depends on.
@@ -21,7 +21,7 @@ type deleteOptions struct {
DryRun bool
}
// NewCmdDelete builds `weknora model delete <model-id>`.
// NewCmdDelete builds `academy model delete <model-id>`.
func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
opts := &deleteOptions{}
cmd := &cobra.Command{
@@ -50,7 +50,7 @@ agent still referencing the model will fail until repointed.`,
return err
}
if err := cmdutil.ConfirmDestructive(f.Prompter(), opts.Yes, fopts.WantsJSON(),
"delete", "model", id, "model.delete", []string{"weknora", "model", "delete", id, "-y"}); err != nil {
"delete", "model", id, "model.delete", []string{"academy", "model", "delete", id, "-y"}); err != nil {
return err
}
return runDelete(c.Context(), fopts, cli, id)
@@ -62,7 +62,7 @@ agent still referencing the model will fail until repointed.`,
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "delete a model by id",
RequiredFlags: []string{"<model-id> (positional)"},
Examples: []string{"weknora model delete model_abc -y"},
Examples: []string{"academy model delete model_abc -y"},
Output: "envelope.data is {id, deleted:true}",
Warnings: []string{
"Requires explicit user approval (exit 10 / input.confirmation_required); never auto-add -y.",
+4 -4
View File
@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
"github.com/Tencent/WeKnora/cli/internal/prompt"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/prompt"
sdk "academy/client"
)
// modelDryRunFactory builds a Factory whose Client / Prompter closures fail the
+9 -9
View File
@@ -9,11 +9,11 @@ import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
"github.com/Tencent/WeKnora/cli/internal/output"
"github.com/Tencent/WeKnora/cli/internal/text"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/output"
"academy/cli/internal/text"
sdk "academy/client"
)
// modelListFields enumerates the fields surfaced for `--format json` discovery
@@ -51,7 +51,7 @@ type ListService interface {
ListModels(ctx context.Context) ([]sdk.Model, error)
}
// NewCmdList builds `weknora model list`.
// NewCmdList builds `academy model list`.
func NewCmdList(f *cmdutil.Factory) *cobra.Command {
opts := &ListOptions{}
cmd := &cobra.Command{
@@ -85,9 +85,9 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "discover model ids for `agent create --model` and a KB's embedding/summary model",
Examples: []string{
"weknora model list",
"weknora model list --type KnowledgeQA --format json",
"weknora model list --source local",
"academy model list",
"academy model list --type KnowledgeQA --format json",
"academy model list --source local",
},
Output: "envelope.data is an array of Model objects (id, name, display_name, type, source, is_default); narrow it with --type / --source; meta.count is the returned count, meta.total_count is the full set and meta.has_more=true means --limit truncated it",
})
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"strings"
"testing"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
type fakeListSvc struct {
+8 -8
View File
@@ -1,9 +1,9 @@
// Package modelcmd holds the `weknora model` command tree: list / view.
// Package modelcmd holds the `academy model` command tree: list / view.
//
// These are read-only discovery commands. The model id is a required input to
// `weknora agent create --model <id>` and to a knowledge base's embedding /
// `academy agent create --model <id>` and to a knowledge base's embedding /
// summary model settings, so the CLI must offer a first-class way to find it
// rather than forcing callers down to the raw `weknora api` escape hatch.
// rather than forcing callers down to the raw `academy api` escape hatch.
//
// The directory is named `model/` to match the cobra subcommand; the Go
// package is `modelcmd` to avoid colliding with the SDK's Model type.
@@ -12,19 +12,19 @@ package modelcmd
import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
sdk "academy/client"
)
// NewCmd builds the `weknora model` parent and registers leaves. Called from
// NewCmd builds the `academy model` parent and registers leaves. Called from
// cli/cmd/root.go.
func NewCmd(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "model",
Short: "Manage models (list / view / create / update / delete)",
Long: `List, inspect, register, and delete the models configured on the server. Use
the model id to back a knowledge base's embedding / summary config ('weknora kb
init') or an agent ('weknora agent create --model <id>').`,
the model id to back a knowledge base's embedding / summary config ('academy kb
init') or an agent ('academy agent create --model <id>').`,
}
cmd.AddCommand(NewCmdList(f))
cmd.AddCommand(NewCmdView(f))
+8 -8
View File
@@ -7,9 +7,9 @@ import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
// UpdateOptions captures the surgical flag state for `model update`. Per-flag
@@ -36,7 +36,7 @@ type UpdateService interface {
UpdateModel(ctx context.Context, id string, req *sdk.UpdateModelRequest) (*sdk.Model, error)
}
// NewCmdUpdate builds `weknora model update <model-id>` — update a registered
// NewCmdUpdate builds `academy model update <model-id>` — update a registered
// model in place (id preserved), so KBs / agents referencing it keep working.
func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
opts := &UpdateOptions{}
@@ -83,7 +83,7 @@ Reversible write: without -y/--yes in a non-TTY / JSON context it exits 10
yes, _ := c.Flags().GetBool("yes")
// --api-key-stdin / --param excluded from retry_argv (stdin secret /
// repeatable), matching agent update's multi-value exclusions.
retry := cmdutil.BuildRetryArgv(c, []string{"weknora", "model", "update", id},
retry := cmdutil.BuildRetryArgv(c, []string{"academy", "model", "update", id},
"display-name", "description", "base-url", "default", "format")
if err := cmdutil.ConfirmWrite(f.Prompter(), yes, fopts.WantsJSON(), "update", "model", id, "model.update", retry); err != nil {
return err
@@ -111,9 +111,9 @@ Reversible write: without -y/--yes in a non-TTY / JSON context it exits 10
UsedFor: "update a registered model IN PLACE (id preserved, so KB/agent references keep working): rotate --api-key-stdin, change --base-url / --display-name / --description / --param, or set --default. Type and source are immutable.",
RequiredFlags: []string{"<model-id> (positional)", "at least one update flag"},
Examples: []string{
`printf '%s' "$NEW_KEY" | weknora model update mdl_abc --api-key-stdin -y`,
`weknora model update mdl_abc --base-url https://api.example.com/v1 -y`,
`weknora model update mdl_abc --default -y`,
`printf '%s' "$NEW_KEY" | academy model update mdl_abc --api-key-stdin -y`,
`academy model update mdl_abc --base-url https://api.example.com/v1 -y`,
`academy model update mdl_abc --default -y`,
},
Output: "envelope.data is the updated Model object (id preserved; provider api key never echoed)",
Warnings: []string{
+3 -3
View File
@@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
// fakeUpdateSvc scripts GetModel (fetch baseline) and captures the
+5 -5
View File
@@ -6,9 +6,9 @@ import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
// modelViewFields enumerates the fields surfaced for `--format json` discovery
@@ -24,7 +24,7 @@ type ViewService interface {
GetModel(ctx context.Context, id string) (*sdk.Model, error)
}
// NewCmdView builds `weknora model view <model-id>`.
// NewCmdView builds `academy model view <model-id>`.
func NewCmdView(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "view <model-id>",
@@ -48,7 +48,7 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "fetch one model's full record by id",
RequiredFlags: []string{"<model-id> (positional)"},
Examples: []string{"weknora model view model_abc --jq .data.type"},
Examples: []string{"academy model view model_abc --jq .data.type"},
Output: "envelope.data is the Model object (id, name, display_name, type, source, is_default, parameters)",
})
return cmd
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"strings"
"testing"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
sdk "academy/client"
)
type fakeViewSvc struct {