Documentation
¶
Overview ¶
Package rpc holds the wire types of lockfile's console methods, shared by the console's backend and its clients (CLI and MCP). Every result is built from the closed list of design §7b.
Index ¶
Constants ¶
const ( MethodPlugins = "file.plugins" MethodPlan = "file.plan" MethodRun = "file.run" MethodAnswers = "file.answers" MethodRelease = "file.release" )
Method names. lockkit serves hello, status, change.request and logout.
const ( MsgPlanParams = "invalid params: give exactly one of key and handle, 1 or more distinct plugins, an intent of at most 200 bytes" MsgParams = "invalid params" MsgNoSuchPlan = "unknown, used or expired plan, or the policy changed since it was approved: plan again" MsgConnLost = "the console lost its connection to the source; the human must restart or reconnect it" MsgPending = "a policy change awaits the human in the console" MsgClosed = "the console closed the connection" MsgInternal = "console error" )
Fixed texts of the errors that are not refusals: none carries anything the agent did not send. Clients print these, never the console's text.
const MaxIntent = 200
MaxIntent bounds the agent's one-line reason shown on the approval screen, in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandleParams ¶
type HandleParams struct {
Handle string `json:"handle"`
}
HandleParams names a fetched file.
type PlanParams ¶
type PlanParams struct {
Key string `json:"key,omitempty"`
Handle string `json:"handle,omitempty"`
Plugins []string `json:"plugins"`
Intent string `json:"intent,omitempty"`
}
PlanParams asks the human to approve a plan: a fetch of Key, or a follow-up on Handle (exactly one), and the plugins to run on it.
type PlanResult ¶
type PlanResult struct {
PlanID string `json:"plan_id"`
// Answers is how many answers the plan reveals at most.
Answers int `json:"answers"`
}
PlanResult names an approved plan, run once with file.run.
type PluginInfo ¶
type PluginInfo struct {
Plugin string `json:"plugin"`
Version string `json:"version"`
Marketplace string `json:"marketplace"`
Official bool `json:"official"`
Warning string `json:"warning,omitempty"`
Question string `json:"question"`
One string `json:"one"`
Zero string `json:"zero"`
}
PluginInfo is an installed, approved plugin as its signed manifest describes it.
type Released ¶
type Released struct {
Released bool `json:"released"`
}
Released answers file.release.
type RunParams ¶
type RunParams struct {
PlanID string `json:"plan_id"`
}
RunParams runs an approved plan.