Documentation
¶
Overview ¶
Package control defines the transport-independent contract for Wingthing runtime operations. Adapters decide how to authenticate and transport a call; the operation name, schema, grant, annotations, and audit policy live here.
Index ¶
- Constants
- func AuditTarget(name string, arguments json.RawMessage, result map[string]any) string
- func ObjectKinds(surface Surface) []string
- func OperationNames(surface Surface) []string
- func QualifyResult(wingID string, result map[string]any) map[string]any
- func SplitWingTarget(arguments json.RawMessage) (string, json.RawMessage, error)
- type AuditArgumentMode
- type Authority
- type DirectRequest
- type DirectResponse
- type Surface
- type Tool
Constants ¶
const ( SurfaceLocalMCP Surface = "local-mcp" SurfaceHTTPMCP Surface = "http-mcp" // SurfaceDirectMCP is the native multi-wing adapter. Portal operations are // local to the coordinator, while every wing-owned operation carries an // explicit wing_id used to select a peer-to-peer transport. SurfaceDirectMCP Surface = "direct-mcp" ContractVersion string = "v1" )
const DirectChannelPrefix = "control:v1:"
Variables ¶
This section is empty.
Functions ¶
func AuditTarget ¶
AuditTarget extracts the first bounded resource label approved by the operation definition. Full arguments remain digest-only.
func ObjectKinds ¶
ObjectKinds returns the semantic resource kinds visible through one surface. The order is stable for capability responses.
func OperationNames ¶
OperationNames returns the stable operation names exposed by one surface.
func QualifyResult ¶
QualifyResult makes the owning wing part of the result envelope so clients never need mutable "current wing" state to interpret an object ID. Resource objects returned by current list/send operations are qualified individually as well, so retaining one object outside its response cannot lose its wing.
func SplitWingTarget ¶
func SplitWingTarget(arguments json.RawMessage) (string, json.RawMessage, error)
SplitWingTarget validates and removes the transport-only wing_id argument. The selected wing receives only the operation's original contract.
Types ¶
type AuditArgumentMode ¶
type AuditArgumentMode string
AuditArgumentMode describes how an adapter may record tool arguments.
const ( // AuditArgumentsDigest permits only a digest of the complete argument // envelope. Adapters may separately record the bounded target selected by // AuditTargetKeys. AuditArgumentsDigest AuditArgumentMode = "digest" )
type Authority ¶
type Authority string
Authority identifies the component that owns an operation's state and handler. Portal operations use gateway inventory; wing operations use the selected execution runtime.
type DirectRequest ¶
type DirectRequest struct {
Version string `json:"version"`
ID string `json:"id"`
Tool string `json:"tool"`
Arguments json.RawMessage `json:"arguments"`
}
DirectRequest is one authenticated operation sent over a WebRTC control data channel. User identity is deliberately absent: the wing obtains it from the coordinator-authenticated signaling exchange.
type DirectResponse ¶
type DirectResponse struct {
Version string `json:"version"`
ID string `json:"id"`
Result map[string]any `json:"result,omitempty"`
IsError bool `json:"is_error,omitempty"`
Error string `json:"error,omitempty"`
}
DirectResponse is the bounded result envelope returned by a wing.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Title string `json:"title,omitempty"`
Description string `json:"description"`
InputSchema map[string]any `json:"inputSchema"`
Annotations map[string]any `json:"annotations,omitempty"`
Version string `json:"-"`
Grant string `json:"-"`
Surfaces []Surface `json:"-"`
Authority Authority `json:"-"`
AuditArguments AuditArgumentMode `json:"-"`
AuditTargetKeys []string `json:"-"`
}
Tool is one versioned Wingthing control operation. MCP adapters serialize the public fields directly. The remaining fields govern authorization, transport exposure, and audit redaction.
func ToolsForAuthority ¶
ToolsForAuthority returns the operations implemented by one authority and exposed through the requested surface.