mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-11-03 22:43:26 +08:00
Unify the --kb resolver (accepts name or UUID) across kb/doc/chunk/session/ search/chat/link; `agent create` attaches knowledge bases via --attach-kb (no longer --kb). Rename the MCP tool agent_invoke → session_ask and drop dead MCP error codes. Add `session stop` (StopSession), completing the start / continue-stream / stop triad. Across these commands, bring the agent contract up to par: --dry-run previews on mutations (incl. kb pin/unpin, session stop), agent-help blobs on the read/health surface, accurate destructive-confirmation verbs, and search has_more truncation signalling so an agent can tell its results were capped.
29 lines
850 B
Go
29 lines
850 B
Go
// Package sessioncmd holds `weknora session` command tree (list / view /
|
|
// delete / ask / continue-stream / 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
|
|
// shadowing - same hygiene as `profilecmd`.
|
|
package sessioncmd
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
|
|
)
|
|
|
|
// NewCmd builds the `weknora session` parent command.
|
|
func NewCmd(f *cmdutil.Factory) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "session",
|
|
Short: "Manage chat sessions",
|
|
}
|
|
cmd.AddCommand(NewCmdList(f))
|
|
cmd.AddCommand(NewCmdView(f))
|
|
cmd.AddCommand(NewCmdDelete(f))
|
|
cmd.AddCommand(NewCmdAsk(f))
|
|
cmd.AddCommand(NewCmdContinueStream(f))
|
|
cmd.AddCommand(NewCmdStop(f))
|
|
return cmd
|
|
}
|