Documentation
¶
Overview ¶
Package appoperation carries exact App operation coordinates through admitted browser and trusted planner requests. It grants no authority: the broker must check its current policy and the verified caller coordinates.
Index ¶
- Variables
- func AgentInvocationFrom(ctx context.Context) (string, bool)
- func ArgumentsDigest(raw json.RawMessage) (string, error)
- func CanonicalArguments(raw json.RawMessage) (json.RawMessage, string, error)
- func DecodeArguments(raw json.RawMessage) (map[string]any, error)
- func WithAgentCall(ctx context.Context, agent, server, tool string, args json.RawMessage) (context.Context, error)
- func WithAgentInvocation(ctx context.Context, agent string) context.Context
- func WithAgentRead(ctx context.Context, agent, server, resource string) (context.Context, error)
- func WithCall(ctx context.Context, ref, agent, server, resource, generation, tool string, ...) (context.Context, error)
- func WithRead(ctx context.Context, ref, agent, server, resource string) (context.Context, error)
- type Binding
Constants ¶
This section is empty.
Variables ¶
var ErrInvalid = errors.New("invalid app operation binding")
ErrInvalid is a closed, content-free refusal of an operation binding.
Functions ¶
func AgentInvocationFrom ¶ added in v1.33.2
AgentInvocationFrom returns the agent stamped by trusted planner dispatch.
func ArgumentsDigest ¶
func ArgumentsDigest(raw json.RawMessage) (string, error)
ArgumentsDigest hashes a bounded, duplicate-free JSON object after key sorting and string normalization. Number spelling is preserved (including integers beyond float64 precision). Absent arguments mean the empty object.
func CanonicalArguments ¶ added in v1.33.2
func CanonicalArguments(raw json.RawMessage) (json.RawMessage, string, error)
CanonicalArguments returns key-sorted, duplicate-free object JSON with exact number spelling and its SHA-256 digest, using the app-operation-v1 codec.
func DecodeArguments ¶
func DecodeArguments(raw json.RawMessage) (map[string]any, error)
DecodeArguments validates closed object input and preserves exact JSON numbers.
func WithAgentCall ¶ added in v1.33.2
func WithAgentCall(ctx context.Context, agent, server, tool string, args json.RawMessage) (context.Context, error)
WithAgentCall binds one trusted planner invocation to its final outgoing input. The random reference is a call coordinate, never authority or a browser selector.
func WithAgentInvocation ¶ added in v1.33.2
WithAgentInvocation marks the trusted planner dispatch boundary with its reach-admitted effective agent. This is not a Protocol or model input.
func WithAgentRead ¶ added in v1.33.2
WithAgentRead binds one trusted planner invocation to an exact App resource.
Types ¶
type Binding ¶
type Binding struct {
Version string `json:"version"`
Reference string `json:"reference"`
Kind string `json:"kind"`
AgentID string `json:"agent_id"`
ServerID string `json:"server_id"`
ResourceURI string `json:"resource_uri"`
Generation string `json:"generation,omitempty"`
Tool string `json:"tool,omitempty"`
ArgumentsSHA256 string `json:"arguments_sha256,omitempty"`
Arguments json.RawMessage `json:"arguments,omitempty"`
}
Binding is the broker request extension. Agent tool bindings carry bounded canonical outgoing arguments; identity and destination remain authenticated separately.
func (Binding) CheckCall ¶
CheckCall compares the actual outgoing MCP arguments, after any transformation.
func (Binding) CheckResource ¶
CheckResource refuses reuse for another source or resource before credential resolution or network dispatch.