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

+20 -20
View File
@@ -10,9 +10,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
"github.com/Tencent/WeKnora/cli/internal/output"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/output"
)
// schemaRisk mirrors the destructive-write risk annotation in the schema view.
@@ -45,16 +45,16 @@ type commandSchema struct {
Flags []schemaFlag `json:"flags,omitempty"`
}
// schemaIndexEntry is one row of the no-argument `weknora schema` index.
// schemaIndexEntry is one row of the no-argument `academy schema` index.
type schemaIndexEntry struct {
Command string `json:"command"`
UsedFor string `json:"used_for,omitempty"`
}
// newCmdSchema builds the `weknora schema` introspection command. With no args
// newCmdSchema builds the `academy schema` introspection command. With no args
// it lists every leaf command and its purpose; with a command path it prints
// that command's full contract. This makes the structured help (otherwise only
// reachable via WEKNORA_AGENT_HELP=1 on --help) a first-class, discoverable
// reachable via ACADEMY_AGENT_HELP=1 on --help) a first-class, discoverable
// command — mirroring how mainstream agent-first CLIs expose schema introspection.
func newCmdSchema() *cobra.Command {
cmd := &cobra.Command{
@@ -63,11 +63,11 @@ func newCmdSchema() *cobra.Command {
Long: `Print the machine-readable contract for a command, or — with no argument —
an index of every command and what it is used for.
weknora schema # index: every leaf command + used_for
weknora schema kb create # the contract for one command
weknora schema doc update # used_for, flags, examples, output, risk
academy schema # index: every leaf command + used_for
academy schema kb create # the contract for one command
academy schema doc update # used_for, flags, examples, output, risk
This is the discoverable form of WEKNORA_AGENT_HELP=1 <cmd> --help: an agent
This is the discoverable form of ACADEMY_AGENT_HELP=1 <cmd> --help: an agent
can enumerate the surface and learn how to call any command without scraping
human help prose.`,
Args: cobra.ArbitraryArgs,
@@ -92,9 +92,9 @@ human help prose.`,
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "introspect the CLI surface: list every command (no args) or print one command's contract (used_for, flags, examples, output, risk).",
Examples: []string{
"weknora schema",
"weknora schema kb create",
"weknora schema doc update --format json",
"academy schema",
"academy schema kb create",
"academy schema doc update --format json",
},
Output: "with no args, envelope.data is an array of {command, used_for}; with a command path, envelope.data is {command, used_for, required_flags, examples, output, warnings, risk, flags}",
})
@@ -123,20 +123,20 @@ func resolveSchemaTarget(root *cobra.Command, args []string) (*cobra.Command, er
available := availableSubcommandNames(root)
hint := fmt.Sprintf("available top-level commands: %s", strings.Join(available, ", "))
if sug := cmdutil.SuggestClosest(unknown, available); len(sug) > 0 {
hint = fmt.Sprintf("did you mean: %s? (run `weknora schema` to list all)", strings.Join(sug, ", "))
hint = fmt.Sprintf("did you mean: %s? (run `academy schema` to list all)", strings.Join(sug, ", "))
}
return nil, cmdutil.NewError(cmdutil.CodeInputUnknownSubcommand,
fmt.Sprintf("no command named %q", strings.Join(args, " "))).
WithHint(hint).
WithRetryArgv([]string{"weknora", "schema"})
WithRetryArgv([]string{"academy", "schema"})
}
// Leftover args that are not the command's own resource positionals mean a
// deeper path was requested that doesn't exist (e.g. `schema kb bogus`).
if len(rest) > 0 && target.HasSubCommands() {
return nil, cmdutil.NewError(cmdutil.CodeInputUnknownSubcommand,
fmt.Sprintf("no subcommand %q under %q", rest[0], strings.TrimPrefix(target.CommandPath(), "weknora "))).
fmt.Sprintf("no subcommand %q under %q", rest[0], strings.TrimPrefix(target.CommandPath(), "academy "))).
WithHint(fmt.Sprintf("available: %s", strings.Join(availableSubcommandNames(target), ", "))).
WithRetryArgv(append([]string{"weknora", "schema"}, strings.Fields(strings.TrimPrefix(target.CommandPath(), "weknora "))...))
WithRetryArgv(append([]string{"academy", "schema"}, strings.Fields(strings.TrimPrefix(target.CommandPath(), "academy "))...))
}
return target, nil
}
@@ -153,7 +153,7 @@ func emitCommandSchema(target *cobra.Command, fopts *cmdutil.FormatOptions) erro
// buildCommandSchema assembles the schema view from the command's AgentHelp,
// risk annotation, and local (non-inherited) flags.
func buildCommandSchema(target *cobra.Command) commandSchema {
cs := commandSchema{Command: strings.TrimPrefix(target.CommandPath(), "weknora ")}
cs := commandSchema{Command: strings.TrimPrefix(target.CommandPath(), "academy ")}
if ah, ok := cmdutil.AgentHelpFor(target); ok {
cs.UsedFor = ah.UsedFor
cs.RequiredFlags = ah.RequiredFlags
@@ -184,7 +184,7 @@ func buildCommandSchema(target *cobra.Command) commandSchema {
// writeCommandSchemaText renders one command's contract as readable prose for
// the human (--format text) path.
func writeCommandSchemaText(w io.Writer, cs commandSchema) error {
fmt.Fprintf(w, "weknora %s\n", cs.Command)
fmt.Fprintf(w, "academy %s\n", cs.Command)
if cs.UsedFor != "" {
fmt.Fprintf(w, "\n%s\n", cs.UsedFor)
}
@@ -240,7 +240,7 @@ func emitSchemaIndex(root *cobra.Command, fopts *cmdutil.FormatOptions) error {
walk(sub)
continue
}
e := schemaIndexEntry{Command: strings.TrimPrefix(sub.CommandPath(), "weknora ")}
e := schemaIndexEntry{Command: strings.TrimPrefix(sub.CommandPath(), "academy ")}
if ah, ok := cmdutil.AgentHelpFor(sub); ok {
e.UsedFor = ah.UsedFor
} else {