Documentation
¶
Overview ¶
Package clientcmd is the agent's side of lockfile, shared by the CLI and the MCP server: it calls a running console and turns every answer into a value of the closed list of design §7b. Nothing the console sends is passed on as text: results are decoded into typed values, and every error becomes a registered refusal or a fixed message chosen here.
Index ¶
- Variables
- func Answers(ctx context.Context, profile, handle string) (answers.Result, error)
- func Plan(ctx context.Context, profile string, p rpc.PlanParams) (rpc.PlanResult, error)
- func PlanAndRun(ctx context.Context, profile string, p rpc.PlanParams) (answers.Result, error)
- func Plugins(ctx context.Context, profile string) ([]rpc.PluginInfo, error)
- func Release(ctx context.Context, profile, handle string) (rpc.Released, error)
- func Resolve(pinned, arg string) (string, error)
- func Run(ctx context.Context, profile, planID string) (answers.Result, error)
- func SourceNames() ([]string, error)
- func Sources(ctx context.Context) ([]rpc.Source, error)
- func StartCommand(profile string) string
- func StatusLines(out []StatusEntry) []string
- type Error
- type Kind
- type Status
- type StatusEntry
Constants ¶
This section is empty.
Variables ¶
var NoConsoleText = "no lockfile console is running: ask the user to start one in the lockfile account (" + StartCommand("NAME") + ")"
NoConsoleText says that no console runs and how to start one.
Functions ¶
func Plan ¶
func Plan(ctx context.Context, profile string, p rpc.PlanParams) (rpc.PlanResult, error)
Plan asks the human to approve a plan.
func PlanAndRun ¶
PlanAndRun plans, then runs the plan once approved, on one connection.
func Resolve ¶
Resolve picks the profile of a call: pinned (MCP --profile), given, or the only running console's. A given profile no console serves is the unknown_profile refusal naming its start command.
func SourceNames ¶
SourceNames lists the profiles of the running consoles (mcpkit.Profiles).
func Sources ¶
Sources lists the profiles of the running consoles, sorted. A socket nobody answers on is left out.
func StartCommand ¶
StartCommand is the command that starts profile's console.
func StatusLines ¶
func StatusLines(out []StatusEntry) []string
StatusLines is a status report as text.
Types ¶
type Error ¶
Error is an error as the agent reads it: Msg is a closed code or a fixed text, Refusal the structured refusal when there is one.
type Status ¶
type Status struct {
Profile string `json:"profile"`
Production bool `json:"production"`
AutoApprove bool `json:"auto_approve"`
Level int `json:"level"`
IdleTimeoutInS int `json:"idle_timeout_in_s"`
SessionEndsInS int `json:"session_ends_in_s"`
Product rpc.Status `json:"product"`
}
Status is a console's state as the agent sees it: console fields of lockkit's status and lockfile's part, nothing else.