Documentation
¶
Overview ¶
Package mcpserver exposes an agent Session through a small, local-only MCP tool surface. Policy, validation, execution, and sensitive capture ownership remain in package agent.
Index ¶
- Constants
- type ActInput
- type ActMode
- type ActOutput
- type CapabilitiesOutput
- type CaptureOutput
- type CloseOutput
- type FindOutput
- type ObservationOutput
- type ObserveOutput
- type ReleaseObservationInput
- type ReleaseObservationOutput
- type Server
- type Session
- type ToolError
- type VisualConditionSession
- type WaitOutput
Constants ¶
const ( // ToolFind evaluates a visual condition against one explicit observation. ToolFind = "robotgo_find" // ToolWait performs one policy-bounded visual wait over an explicit region. ToolWait = "robotgo_wait" // ToolReleaseObservation zeroes and removes one retained observation. ToolReleaseObservation = "robotgo_release_observation" )
const ( // ToolCapabilities reports the immutable operation catalog. ToolCapabilities = "robotgo_capabilities" // ToolObserve performs one policy-gated diagnostics or capture observation. ToolObserve = "robotgo_observe" // ToolAct plans or executes one typed action. ToolAct = "robotgo_act" // ToolClose closes the underlying RobotGo agent session. ToolClose = "robotgo_close" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActInput ¶
type ActInput struct {
Mode ActMode `json:"mode,omitempty"`
Request agent.ActionRequest `json:"request"`
}
ActInput is the strict input of robotgo_act. An omitted mode is dry-run.
type ActMode ¶
type ActMode string
ActMode controls whether robotgo_act only plans or actually executes.
type ActOutput ¶
type ActOutput struct {
Result *agent.ActionResult `json:"result,omitempty"`
Error *ToolError `json:"error,omitempty"`
}
ActOutput is the structured output of robotgo_act.
type CapabilitiesOutput ¶
type CapabilitiesOutput struct {
Catalog agent.OperationCatalog `json:"catalog"`
Error *ToolError `json:"error,omitempty"`
}
CapabilitiesOutput is the structured output of robotgo_capabilities.
type CaptureOutput ¶
type CaptureOutput struct {
Region agent.CaptureRegion `json:"region"`
Width int `json:"width"`
Height int `json:"height"`
}
CaptureOutput reports only geometry. The agent observation's pixels and lineage digest deliberately remain private to the in-process session.
type CloseOutput ¶
CloseOutput is the structured output of robotgo_close.
type FindOutput ¶
type FindOutput struct {
Result *agent.FindColorResult `json:"result,omitempty"`
Error *ToolError `json:"error,omitempty"`
}
FindOutput is the privacy-reduced output of robotgo_find.
type ObservationOutput ¶
type ObservationOutput struct {
SchemaVersion string `json:"schema_version"`
ObservationID string `json:"observation_id"`
CreatedAt time.Time `json:"created_at"`
Diagnostics agent.RuntimeDiagnostics `json:"diagnostics"`
Capture *CaptureOutput `json:"capture,omitempty"`
}
ObservationOutput is the privacy-reduced MCP projection of an observation.
type ObserveOutput ¶
type ObserveOutput struct {
Observation *ObservationOutput `json:"observation,omitempty"`
Error *ToolError `json:"error,omitempty"`
}
ObserveOutput is the structured output of robotgo_observe.
type ReleaseObservationInput ¶
type ReleaseObservationInput struct {
ObservationID string `json:"observation_id"`
}
ReleaseObservationInput identifies session-owned capture state to zero.
type ReleaseObservationOutput ¶
type ReleaseObservationOutput struct {
Released bool `json:"released"`
Error *ToolError `json:"error,omitempty"`
}
ReleaseObservationOutput confirms that no retained observation with the requested ID remains. Releasing the same valid ID repeatedly is successful.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server binds one process-exclusive agent session to one MCP connection.
type Session ¶
type Session interface {
Catalog() agent.OperationCatalog
Observe(context.Context, agent.ObserveRequest) (*agent.Observation, error)
DryRun(context.Context, agent.ActionRequest) (agent.ActionResult, error)
Execute(context.Context, agent.ActionRequest) (agent.ActionResult, error)
Close() error
}
Session is the protocol-independent behavior consumed by the adapter. *agent.Session implements Session.
type ToolError ¶
ToolError is a stable, payload-free error returned in structured tool output. Unclassified backend error strings are never forwarded.
type VisualConditionSession ¶
type VisualConditionSession interface {
Session
FindColor(context.Context, agent.FindColorRequest) (agent.FindColorResult, error)
WaitColor(context.Context, agent.WaitColorRequest) (agent.WaitColorResult, error)
ReleaseObservation(string) error
}
VisualConditionSession is the additive session extension used by the visual tools. Keeping it separate preserves source compatibility for existing Session implementations; implementations without the extension retain the original four-tool surface. *agent.Session implements VisualConditionSession.
type WaitOutput ¶
type WaitOutput struct {
Result *agent.WaitColorResult `json:"result,omitempty"`
Error *ToolError `json:"error,omitempty"`
}
WaitOutput is the privacy-reduced output of robotgo_wait.