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

+14 -14
View File
@@ -7,11 +7,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/sse"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/output"
"academy/cli/internal/sse"
sdk "academy/client"
)
// sessionAskFields enumerates the fields surfaced for `--jq` projection
@@ -49,7 +49,7 @@ type AskService interface {
AgentQAStreamWithRequest(ctx context.Context, sessionID string, req *sdk.AgentQARequest, cb sdk.AgentEventCallback, opts ...sdk.ResourceURLOptions) error
}
// NewCmdAsk builds `weknora session ask --agent <agent-id> "<text>"`.
// NewCmdAsk builds `academy session ask --agent <agent-id> "<text>"`.
func NewCmdAsk(f *cmdutil.Factory) *cobra.Command {
opts := &AskOptions{}
cmd := &cobra.Command{
@@ -60,7 +60,7 @@ a new session is auto-created and its id is reported in the output for
the caller to thread follow-ups.
AI agents: this is the primary entrypoint for invoking custom agents.
The 'weknora agent' subtree handles CRUD only (list / view / create /
The 'academy agent' subtree handles CRUD only (list / view / create /
update / delete / status / check).
Modes:
@@ -72,9 +72,9 @@ Modes:
Pass --reference to include bounded kb_id/chunk_id reference indexes. Pass
--verbose to include reasoning, tool activity, and lifecycle frames. Combine
both flags for the complete projected stream.`,
Example: ` weknora session ask --agent ag_x "Summarize Q3 sales"
weknora session ask --session sess_x --agent ag_x "Follow-up question"
weknora session ask --agent ag_x "Multi-step task" --format ndjson`,
Example: ` academy session ask --agent ag_x "Summarize Q3 sales"
academy session ask --session sess_x --agent ag_x "Follow-up question"
academy session ask --agent ag_x "Multi-step task" --format ndjson`,
Args: cobra.ExactArgs(1),
RunE: func(c *cobra.Command, args []string) error {
fopts, err := cmdutil.CheckFormatFlag(c)
@@ -100,9 +100,9 @@ both flags for the complete projected stream.`,
UsedFor: "Invoke a custom agent in a session context. Default JSON returns a bounded answer-event projection. --reference adds indexed citations; --verbose adds reasoning, tools, and lifecycle events. --format ndjson streams raw SDK agent events; --format text renders the selected events live.",
RequiredFlags: []string{"<text> (positional)", "--agent"},
Examples: []string{
`weknora session ask --agent ag_x "Summarize Q3 sales"`,
`weknora session ask --agent ag_x "Summarize Q3 sales" --jq '[.data.events[].content] | join("")'`,
`weknora session ask --session sess_x --agent ag_x "Follow-up question"`,
`academy session ask --agent ag_x "Summarize Q3 sales"`,
`academy session ask --agent ag_x "Summarize Q3 sales" --jq '[.data.events[].content] | join("")'`,
`academy session ask --session sess_x --agent ag_x "Follow-up question"`,
},
Output: "Default --format json: {ok,data:{events:[answer...],session_id,agent_id,query}}. --reference adds kb_id/chunk_id reference events; --verbose adds execution events. --format ndjson remains raw.",
})
@@ -125,7 +125,7 @@ func runAsk(ctx context.Context, opts *AskOptions, fopts *cmdutil.FormatOptions,
sessionID := opts.SessionID
autoCreated := false
if sessionID == "" {
sess, err := svc.CreateSession(ctx, &sdk.CreateSessionRequest{Title: "weknora session ask"})
sess, err := svc.CreateSession(ctx, &sdk.CreateSessionRequest{Title: "academy session ask"})
if err != nil {
if cmdutil.IsCancelled(ctx, err) {
return cmdutil.Wrapf(cmdutil.CodeOperationCancelled, err, "session ask cancelled")
+4 -4
View File
@@ -8,10 +8,10 @@ import (
"strings"
"testing"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"github.com/Tencent/WeKnora/cli/internal/iostreams"
"github.com/Tencent/WeKnora/cli/internal/sse"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/sse"
sdk "academy/client"
)
// scriptedAskSvc serves a canned stream of agent events to runAsk.
+13 -13
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"
"github.com/Tencent/WeKnora/cli/internal/prompt"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/prompt"
)
// sessionDeleteFields enumerates the fields surfaced for `--format json`
@@ -32,7 +32,7 @@ type deleteResult struct {
Deleted bool `json:"deleted"`
}
// NewCmdDelete builds `weknora session delete`. Single-id keeps the simpler
// NewCmdDelete builds `academy session delete`. Single-id keeps the simpler
// code path; multi-id uses keep-going semantics (one -y confirms all,
// failures collected, exit 1 if any fail).
func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
@@ -55,10 +55,10 @@ Multi-id:
AI agents: This is a high-risk write. Without -y/--yes the CLI exits 10
and writes input.confirmation_required to stderr. NEVER auto-pass -y
without the user's explicit go-ahead.`,
Example: ` weknora session delete s_abc # interactive confirm
weknora session delete s_abc -y # no prompt
weknora session delete s_abc -y --format json # bare {id, deleted:true} JSON
weknora session delete s_a s_b s_c -y # delete 3, keep-going`,
Example: ` academy session delete s_abc # interactive confirm
academy session delete s_abc -y # no prompt
academy session delete s_abc -y --format json # bare {id, deleted:true} JSON
academy session delete s_a s_b s_c -y # delete 3, keep-going`,
Args: cobra.MinimumNArgs(1),
RunE: func(c *cobra.Command, args []string) error {
opts.Yes, _ = c.Flags().GetBool("yes")
@@ -83,7 +83,7 @@ without the user's explicit go-ahead.`,
if len(args) == 1 {
return runDelete(c.Context(), opts, fopts, cli, f.Prompter(), args[0])
}
batchRetry := append([]string{"weknora", "session", "delete"}, args...)
batchRetry := append([]string{"academy", "session", "delete"}, args...)
batchRetry = append(batchRetry, "-y")
if err := cmdutil.ConfirmDestructiveBatch(f.Prompter(), opts.Yes, fopts.WantsJSON(), "delete", "session", len(args), "session.delete", batchRetry); err != nil {
return err
@@ -112,9 +112,9 @@ without the user's explicit go-ahead.`,
UsedFor: "permanently delete one or more chat sessions and their messages",
RequiredFlags: []string{"<session-id>... (positional, at least one)"},
Examples: []string{
"weknora session delete s_abc -y",
"weknora session delete s_a s_b s_c -y",
"weknora session delete s_abc -y --format json",
"academy session delete s_abc -y",
"academy session delete s_a s_b s_c -y",
"academy session delete s_abc -y --format json",
},
Output: "envelope.data shape depends on the form: a single session id -> {id, deleted:true}; multiple ids -> batch envelope (top-level status success|partial|error, ok=(failures==0), data per-item [{id, ok, error?}], meta.successes/failures — read data[].ok per id).",
Warnings: []string{
@@ -126,7 +126,7 @@ without the user's explicit go-ahead.`,
}
func runDelete(ctx context.Context, opts *DeleteOptions, fopts *cmdutil.FormatOptions, svc DeleteService, p prompt.Prompter, id string) error {
if err := cmdutil.ConfirmDestructive(p, opts.Yes, fopts.WantsJSON(), "delete", "session", id, "session.delete", []string{"weknora", "session", "delete", id, "-y"}); err != nil {
if err := cmdutil.ConfirmDestructive(p, opts.Yes, fopts.WantsJSON(), "delete", "session", id, "session.delete", []string{"academy", "session", "delete", id, "-y"}); err != nil {
return err
}
+3 -3
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"
"github.com/Tencent/WeKnora/cli/internal/testutil"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/testutil"
)
// fakeDeleteSvc records what id was deleted.
+7 -7
View File
@@ -10,11 +10,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"
)
const (
@@ -46,7 +46,7 @@ type ListService interface {
) ([]sdk.Session, int, error)
}
// NewCmdList builds `weknora session list`.
// NewCmdList builds `academy session list`.
func NewCmdList(f *cmdutil.Factory) *cobra.Command {
opts := &ListOptions{PageSize: defaultPageSize}
cmd := &cobra.Command{
@@ -79,7 +79,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
cmdutil.AddFormatFlag(cmd, sessionListFields...)
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "List chat sessions for the active profile. Results come with meta.count; use --limit to cap, --all-pages to walk every server page, --since to filter by recency (e.g. 7d).",
Examples: []string{"weknora session list --format json", "weknora session list --all-pages --since 7d --format json"},
Examples: []string{"academy session list --format json", "academy session list --all-pages --since 7d --format json"},
Output: "envelope.data is an array of Session objects with id, title, updated_at; meta.count is the returned count; meta.total_count is the server-side total before --since filtering; meta.has_more=true when --limit truncated",
})
return cmd
+3 -3
View File
@@ -9,9 +9,9 @@ import (
"testing"
"time"
"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"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
+3 -3
View File
@@ -12,9 +12,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"
)
// fakeListService scripts a GetSessionsByTenant response.
+12 -12
View File
@@ -1,4 +1,4 @@
// resume.go implements `weknora session resume` —
// resume.go implements `academy session resume` —
// re-attach to an SSE event buffer for an in-progress or already-completed
// assistant message under a known session_id.
//
@@ -14,7 +14,7 @@
// After TTL the server returns an error which the CLI maps to
// local.sse_stream_aborted.
//
// Output shape matches `weknora chat` and `weknora session ask` NDJSON mode:
// Output shape matches `academy chat` and `academy session ask` NDJSON mode:
// one CLI-injected init line carrying {session_id, message_id, profile} at
// stream head, then SDK StreamResponse events verbatim. The init line lets
// agents thread the resume to the original message in their dedupe table
@@ -26,10 +26,10 @@ 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"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/output"
sdk "academy/client"
)
// resumeFields enumerates the NDJSON init-event + raw SDK event
@@ -54,7 +54,7 @@ type ResumeService interface {
ContinueStream(ctx context.Context, sessionID, messageID string, cb func(*sdk.StreamResponse) error, opts ...sdk.ResourceURLOptions) error
}
// NewCmdResume builds `weknora session resume <session-id> --message <id>`.
// NewCmdResume builds `academy session resume <session-id> --message <id>`.
func NewCmdResume(f *cmdutil.Factory) *cobra.Command {
opts := &ResumeOptions{}
cmd := &cobra.Command{
@@ -90,8 +90,8 @@ regardless of --format value. The operator use case (incident response,
debugging) always wants the raw event log; there is no human-text rendering.
--format json and --format ndjson behave identically here; --format text is
silently treated as NDJSON.`,
Example: ` weknora session resume sess_xyz --message msg_abc
weknora session resume sess_xyz -m msg_abc --format ndjson`,
Example: ` academy session resume sess_xyz --message msg_abc
academy session resume sess_xyz -m msg_abc --format ndjson`,
Args: cobra.ExactArgs(1),
RunE: func(c *cobra.Command, args []string) error {
opts.SessionID = args[0]
@@ -113,10 +113,10 @@ silently treated as NDJSON.`,
cmdutil.AddFormatFlag(cmd, resumeFields...)
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "Resume an SSE event stream for an in-progress or completed assistant message. Produces an NDJSON event stream: init line (session_id, message_id) then raw SDK StreamResponse events.",
RequiredFlags: []string{"<session-id> (positional)", "--message (persisted assistant message id — get it from `weknora message list --session <id>`; a live stream's assistant_message_id is not resumable once the message persists)"},
RequiredFlags: []string{"<session-id> (positional)", "--message (persisted assistant message id — get it from `academy message list --session <id>`; a live stream's assistant_message_id is not resumable once the message persists)"},
Examples: []string{
"weknora session resume sess_xyz --message msg_abc --format json",
"# Get the message id from: weknora message list --session <session-id> (the persisted assistant message)",
"academy session resume sess_xyz --message msg_abc --format json",
"# Get the message id from: academy message list --session <session-id> (the persisted assistant message)",
},
Output: "NDJSON stream: {type:init, session_id, message_id, profile} then SDK StreamResponse events (response_type, content, done, knowledge_references, assistant_message_id, ...)",
Warnings: []string{
+3 -3
View File
@@ -11,9 +11,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"
)
// scriptedResumeSvc serves a canned stream of StreamResponse events
+4 -4
View File
@@ -1,18 +1,18 @@
// Package sessioncmd holds `weknora session` command tree (list / view /
// Package sessioncmd holds `academy session` command tree (list / view /
// delete / ask / resume / stop) for chat history and agent invocation.
//
// Package name `sessioncmd` (not `session`) so callers can `import sdk
// "github.com/Tencent/WeKnora/client"` and use `sdk.Session` without
// "academy/client"` and use `sdk.Session` without
// shadowing - same hygiene as `profilecmd`.
package sessioncmd
import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
"academy/cli/internal/cmdutil"
)
// NewCmd builds the `weknora session` parent command.
// NewCmd builds the `academy session` parent command.
func NewCmd(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "session",
+7 -7
View File
@@ -1,4 +1,4 @@
// stop.go implements `weknora session stop` — cancel server-side generation
// stop.go implements `academy session stop` — cancel server-side generation
// for a specific assistant message under a known session.
//
// Unlike Ctrl-C (which only drops the local connection while the server keeps
@@ -15,9 +15,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"
)
var stopFields = []string{"session_id", "message_id", "stopped"}
@@ -42,7 +42,7 @@ type stopResult struct {
Stopped bool `json:"stopped"`
}
// NewCmdStop builds `weknora session stop <session-id> --message <id>`.
// NewCmdStop builds `academy session stop <session-id> --message <id>`.
func NewCmdStop(f *cmdutil.Factory) *cobra.Command {
opts := &StopOptions{}
cmd := &cobra.Command{
@@ -53,7 +53,7 @@ session. Unlike Ctrl-C (which only drops the local connection while the server
keeps generating and billing tokens), this tells the server to stop.
Symmetric with 'session resume': both key on (session_id, message_id).`,
Example: ` weknora session stop sess_xyz --message msg_abc`,
Example: ` academy session stop sess_xyz --message msg_abc`,
Args: cobra.ExactArgs(1),
RunE: func(c *cobra.Command, args []string) error {
opts.SessionID = args[0]
@@ -83,7 +83,7 @@ Symmetric with 'session resume': both key on (session_id, message_id).`,
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "Stop server-side generation for an in-flight assistant message (counterpart to resume). The message_id comes from the init event of the chat / session ask / resume stream you're stopping.",
RequiredFlags: []string{"<session-id> (positional)", "--message (message_id from the init event of the stream you're stopping)"},
Examples: []string{"weknora session stop sess_xyz --message msg_abc"},
Examples: []string{"academy session stop sess_xyz --message msg_abc"},
Output: "envelope {session_id, message_id, stopped:true}",
})
return cmd
+2 -2
View File
@@ -9,8 +9,8 @@ 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"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
)
// fakeStopSvc records the (sessionID, messageID) pair passed to StopSession
+12 -12
View File
@@ -7,10 +7,10 @@ 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/prompt"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/prompt"
sdk "academy/client"
)
var resolveFields = []string{"pending_id", "decision", "resolved"}
@@ -45,11 +45,11 @@ type resolveResult struct {
const resolveLong = `Resolve a pending tool approval raised during an agent run.
When a server-side agent run (weknora session ask) needs to call a tool
When a server-side agent run (academy session ask) needs to call a tool
that requires approval, the stream emits a tool-approval event carrying a
pending id and the run blocks. This command unblocks it: approve (default)
lets the tool call execute, --reject cancels it. After resolving, resume
the answer with weknora session resume.
the answer with academy session resume.
--modified-args replaces the tool call arguments on approve (JSON object).
It conflicts with --reject (rejected calls never execute).
@@ -76,9 +76,9 @@ func newCmdResolve(f *cmdutil.Factory) *cobra.Command {
Use: "resolve <pending-id>",
Short: "Approve or reject a pending tool call (high-risk write)",
Long: resolveLong,
Example: ` weknora session tool-approval resolve pend_abc -y # approve
weknora session tool-approval resolve pend_abc --reject --reason "wrong target" -y
weknora session tool-approval resolve pend_abc -y --format json`,
Example: ` academy session tool-approval resolve pend_abc -y # approve
academy session tool-approval resolve pend_abc --reject --reason "wrong target" -y
academy session tool-approval resolve pend_abc -y --format json`,
Args: cobra.ExactArgs(1),
RunE: func(c *cobra.Command, args []string) error {
fopts, err := cmdutil.CheckFormatFlag(c)
@@ -125,8 +125,8 @@ func newCmdResolve(f *cmdutil.Factory) *cobra.Command {
UsedFor: "approve or reject a pending tool call from an agent run; then resume with session resume",
RequiredFlags: []string{"<pending-id> (positional)"},
Examples: []string{
"weknora session tool-approval resolve pend_abc -y",
"weknora session tool-approval resolve pend_abc --reject -y",
"academy session tool-approval resolve pend_abc -y",
"academy session tool-approval resolve pend_abc --reject -y",
},
Output: "envelope.data is {pending_id, decision (approve|reject), resolved:true}",
Warnings: []string{
@@ -199,7 +199,7 @@ func runResolve(ctx context.Context, opts *ResolveOptions, fopts *cmdutil.Format
return err
}
decision := decisionOf(opts.Reject)
retryCmd := append([]string{"weknora", "session", "tool-approval", "resolve", opts.PendingID}, retryArgOf(opts.Reject)...)
retryCmd := append([]string{"academy", "session", "tool-approval", "resolve", opts.PendingID}, retryArgOf(opts.Reject)...)
retryCmd = append(retryCmd, "-y")
if err := cmdutil.ConfirmDestructive(p, opts.Yes, fopts.WantsJSON(), decision, "tool call", opts.PendingID, "session.tool_approval.resolve", retryCmd); err != nil {
return err
+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/testutil"
sdk "github.com/Tencent/WeKnora/client"
"academy/cli/internal/cmdutil"
"academy/cli/internal/iostreams"
"academy/cli/internal/testutil"
sdk "academy/client"
)
type fakeResolveSvc struct {
+5 -5
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"
)
const (
@@ -46,7 +46,7 @@ type ViewService interface {
LoadMessages(ctx context.Context, sessionID string, limit int, beforeTime *time.Time, opts ...sdk.ResourceURLOptions) ([]sdk.Message, error)
}
// NewCmdView builds `weknora session view <id>`. Renders session metadata
// NewCmdView builds `academy session view <id>`. Renders session metadata
// only by default. With `--full`, also loads the chat history via
// `LoadMessages` and renders messages (or projects them into the JSON
// payload under `messages`).
@@ -88,7 +88,7 @@ Pass --full to also load the chat history (LoadMessages SDK call). Use
cmdutil.SetAgentHelp(cmd, cmdutil.AgentHelp{
UsedFor: "fetch one chat session by id; --full also loads its message history",
RequiredFlags: []string{"<session-id> (positional)"},
Examples: []string{"weknora session view sess_abc", "weknora session view sess_abc --full --limit 50"},
Examples: []string{"academy session view sess_abc", "academy session view sess_abc --full --limit 50"},
Output: "envelope.data is the session object; with --full it also carries the loaded messages",
})
return cmd
+3 -3
View File
@@ -11,9 +11,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"
)
// fakeViewService scripts a GetSession + LoadMessages response.