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
+20
-20
@@ -1,5 +1,5 @@
|
||||
// Package linkcmd implements `weknora link` - binds the current working
|
||||
// directory to a knowledge base by writing .weknora/project.yaml. Always
|
||||
// Package linkcmd implements `academy link` - binds the current working
|
||||
// directory to a knowledge base by writing .academy/project.yaml. Always
|
||||
// overwrites an existing link silently rather than refusing when one is
|
||||
// already present. The cobra Long: text covers the user-facing modes
|
||||
// (--kb / TTY / non-TTY).
|
||||
@@ -14,9 +14,9 @@ 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/projectlink"
|
||||
"academy/cli/internal/cmdutil"
|
||||
"academy/cli/internal/iostreams"
|
||||
"academy/cli/internal/projectlink"
|
||||
)
|
||||
|
||||
// linkFields enumerates the fields surfaced for `--format json` discovery on
|
||||
@@ -36,28 +36,28 @@ type linkResult struct {
|
||||
ProjectLinkPath string `json:"project_link_path"`
|
||||
}
|
||||
|
||||
// NewCmd builds the `weknora link` command.
|
||||
// NewCmd builds the `academy link` command.
|
||||
func NewCmd(f *cmdutil.Factory) *cobra.Command {
|
||||
opts := &Options{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "link [kb]",
|
||||
Short: "Bind the current directory to a knowledge base",
|
||||
Long: `Writes .weknora/project.yaml in the current working directory pointing
|
||||
Long: `Writes .academy/project.yaml in the current working directory pointing
|
||||
at the supplied knowledge base. Subsequent commands run from this directory
|
||||
(or any subdirectory) automatically resolve --kb from the link unless
|
||||
overridden by the --kb flag or WEKNORA_KB_ID env var.
|
||||
overridden by the --kb flag or ACADEMY_KB_ID env var.
|
||||
|
||||
Pass the knowledge base as a positional argument (weknora link <id-or-name>) or
|
||||
Pass the knowledge base as a positional argument (academy link <id-or-name>) or
|
||||
via --kb — the two are equivalent — for non-interactive use (scripts, CI). Run
|
||||
on a TTY without either to be prompted from the list of available KBs. Always
|
||||
overwrites any existing link - re-run to switch.
|
||||
|
||||
AI agents: link writes to the user's working directory. Only run it when the
|
||||
user explicitly asked to bind this directory; don't run it as a side effect.`,
|
||||
Example: ` weknora link a32a63ff-fb36-4874-bcaa-30f48570a694 # positional UUID
|
||||
weknora link engineering # positional name → id
|
||||
weknora link --kb engineering # --kb form (equivalent)
|
||||
weknora link # interactive (TTY)`,
|
||||
Example: ` academy link a32a63ff-fb36-4874-bcaa-30f48570a694 # positional UUID
|
||||
academy link engineering # positional name → id
|
||||
academy link --kb engineering # --kb form (equivalent)
|
||||
academy link # interactive (TTY)`,
|
||||
// The knowledge base may be given as a positional arg (matching every
|
||||
// other <id> command) or via --kb; the two are equivalent.
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
@@ -101,9 +101,9 @@ user explicitly asked to bind this directory; don't run it as a side effect.`,
|
||||
cmdutil.AddFormatFlag(cmd, linkFields...)
|
||||
cmdutil.AddDryRunFlag(cmd, &opts.DryRun)
|
||||
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
|
||||
UsedFor: "Bind the current directory to a knowledge base by writing .weknora/project.yaml. Give the KB as a positional arg or --kb (non-interactive); only run when the user explicitly asks to link this directory.",
|
||||
UsedFor: "Bind the current directory to a knowledge base by writing .academy/project.yaml. Give the KB as a positional arg or --kb (non-interactive); only run when the user explicitly asks to link this directory.",
|
||||
RequiredFlags: []string{"<kb> positional or --kb (required when no TTY)"},
|
||||
Examples: []string{"weknora link engineering", "weknora link --kb a32a63ff-fb36-4874-bcaa-30f48570a694"},
|
||||
Examples: []string{"academy link engineering", "academy link --kb a32a63ff-fb36-4874-bcaa-30f48570a694"},
|
||||
Output: "envelope.data has profile, kb_id, kb_name, project_link_path",
|
||||
})
|
||||
return cmd
|
||||
@@ -153,8 +153,8 @@ func runLink(ctx context.Context, opts *Options, fopts *cmdutil.FormatOptions, f
|
||||
}
|
||||
|
||||
// resolveProfile picks the active profile to record in the link. There is no
|
||||
// per-invocation override flag on `weknora link` itself - to record under a
|
||||
// different profile, use the global persistent flag (`weknora --profile
|
||||
// per-invocation override flag on `academy link` itself - to record under a
|
||||
// different profile, use the global persistent flag (`academy --profile
|
||||
// staging link --kb my-kb`); the active profile at link time is what gets
|
||||
// written.
|
||||
func resolveProfile(f *cmdutil.Factory) (string, error) {
|
||||
@@ -164,14 +164,14 @@ func resolveProfile(f *cmdutil.Factory) (string, error) {
|
||||
}
|
||||
if cfg.CurrentProfile == "" {
|
||||
// `link` binds a directory to a profile+KB, so it needs a configured
|
||||
// profile — env credentials (WEKNORA_API_KEY) alone have no profile to
|
||||
// profile — env credentials (ACADEMY_API_KEY) alone have no profile to
|
||||
// record. Point at profile setup (not `auth login`, which loops with no
|
||||
// profile) and name the headless alternative so an env-cred agent isn't
|
||||
// stranded on a misleading hint.
|
||||
return "", cmdutil.NewError(cmdutil.CodeAuthUnauthenticated,
|
||||
"`link` records an active profile, but none is configured").
|
||||
WithHint("register one with `weknora profile add <name> --host <url> --use`; for a headless (WEKNORA_API_KEY) workflow, skip `link` and pass --kb per command or set WEKNORA_KB_ID").
|
||||
WithRetryArgv([]string{"weknora", "profile", "add", "--help"})
|
||||
WithHint("register one with `academy profile add <name> --host <url> --use`; for a headless (ACADEMY_API_KEY) workflow, skip `link` and pass --kb per command or set ACADEMY_KB_ID").
|
||||
WithRetryArgv([]string{"academy", "profile", "add", "--help"})
|
||||
}
|
||||
return cfg.CurrentProfile, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user