Documentation
¶
Overview ¶
Package cmd has the workspaces' flags, and their registry, for the server
Index ¶
Constants ¶
const ( // FilerName is the name of the workspace of the folder, which is its // namespace's, and its MCP server's FilerName = "files" // FilerTitle is the title of the workspace of the folder FilerTitle = "Files" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCommands ¶
type ClientCommands struct {
WorkspaceCommands
}
ClientCommands are the commands which call the workspaces' API
type FilerFlags ¶
type FilerFlags struct {
Path string `name:"path" help:"Folder whose files are a workspace, or none, when it's not set." type:"path"`
Description string `` /* 126-byte string literal not displayed */
}
FilerFlags are the flags of the filer, which is a workspace, of the files of a folder, in the server, when its path is set
func (FilerFlags) WithFiler ¶
func (flags FilerFlags) WithFiler(ctx server.Cmd, tools *toolkit.Toolkit, fn func(*filer.Server) error) error
WithFiler serves the folder, when its path is set, as an MCP server of its files, with the command's version, which its client is connected to, in memory, and connected again, should the server close its session, and whose namespace is added to the toolkit, so it's a workspace, and calls the function with the server, which it runs, or nil, when its path isn't set. Once the function returns, the namespace is removed, and the client disconnected.
type Flags ¶
type Flags struct{}
Flags are the workspaces' flags for the server, which has none yet
func (Flags) WithWorkspaces ¶
func (flags Flags) WithWorkspaces(ctx server.Cmd, srv *servercmd.RunServer, fn func(*workspace.Registry) error, opts ...workspace.Opt) error
WithWorkspaces creates the registry of the server's workspaces, with the options, such as the broadcaster its changes are published to, registers its HTTP handlers with the server, when there is one, and calls the function with it, returning any error. Its watches end when the function returns.
type WorkspaceCommands ¶
type WorkspaceCommands struct {
Workspaces WorkspaceListCmd `cmd:"" name:"workspaces" help:"List the workspaces, such as MCP connectors with resources." group:"WORKSPACES"`
Workspace WorkspaceGetCmd `cmd:"" name:"workspace" help:"Get a workspace by name." group:"WORKSPACES"`
Read WorkspaceReadCmd `` /* 156-byte string literal not displayed */
Resources WorkspaceResourceCmd `` /* 158-byte string literal not displayed */
}
WorkspaceCommands list the workspaces, and their folders and resources
type WorkspaceGetCmd ¶
type WorkspaceGetCmd struct {
Name string `arg:"" name:"name" help:"Name of the workspace, which is its namespace's."`
}
type WorkspaceListCmd ¶
type WorkspaceListCmd struct{}
type WorkspaceReadCmd ¶
type WorkspaceReadCmd struct {
URI string `arg:"" name:"uri" help:"URI of the resource, as it's listed, resource://<workspace>/<uri>."`
Format string `` /* 155-byte string literal not displayed */
Offset uint64 `name:"offset" help:"With markdown, the byte of its Markdown the part starts at, which is a part's next."`
Limit uint64 `name:"limit" help:"With markdown, the most bytes of its Markdown which are read."`
Output string `name:"output" short:"o" help:"File to write the content to, or standard output, when it's omitted, or -." type:"path"`
}
type WorkspaceResourceCmd ¶
type WorkspaceResourceCmd struct {
Name string `` /* 132-byte string literal not displayed */
schema.ListRequest
}