Documentation
¶
Overview ¶
Package interop implements the synthetic cross-language pending-boundary adapter.
Index ¶
- func Client(ctx context.Context, c Config) error
- func DispatchObservations(event Object, subscriptions []Object, called map[string]bool, ...)
- func LifecycleClient(ctx context.Context, c LifecycleConfig) error
- func LifecycleServer(parent context.Context, c LifecycleConfig) error
- func Load(path string, v any) error
- func Server(ctx context.Context, c Config) error
- func ValidateElicitationAnswer(request, answer Object, validate func(string, any) error) error
- func ValidateElicitationCorrelation(request, result Object) error
- type Auth
- type CompactionHook
- type Config
- type LifecycleConfig
- type Object
- func Apply(request, response Object) (Object, error)
- func ApplyElicitationEffects(request, result Object, resolve func(Object) ([]byte, error), ...) (Object, error)
- func Capabilities() Object
- func CompactionCapabilities(boundary string, observeOnly bool) (Object, error)
- func ProjectContent(event Object, selection map[string]string, bodyAllowed bool) (Object, error)
- func PublicBoundary(ctx context.Context, request Object, ...) (Object, bool, error)
- func ReadSelectedElicitation(meta Object, stage string, resolve func(Object) ([]byte, error), ...) (Object, error)
- func ReceiveBoundary(ctx context.Context, request Object, callback func(Object) (Object, error)) (Object, error)
- func RunCompaction(instructions, itemID string, before, after []CompactionHook, ...) (Object, error)
- func RunCompactionParts(instructions []any, itemID string, before, after []CompactionHook, ...) (Object, error)
- func ToolCapabilities() Object
- func UploadContent(ctx context.Context, binding UploadBinding, body []byte) (Object, int, error)
- func ValidateElicitationExchange(request, result Object, resolve func(Object) ([]byte, error), ...) (Object, error)
- func ValidateElicitationMode(mode string, capabilities Object, origin string) (Object, error)
- type PublicBoundaryOptions
- type Result
- type Scenario
- type TaskLineage
- type UploadAuth
- type UploadBinding
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DispatchObservations ¶
func DispatchObservations(event Object, subscriptions []Object, called map[string]bool, prepare func(Object, Object) (Object, error), notify func(Object) error)
DispatchObservations delivers an already-settled boundary to explicit observers and remaining uncalled matching intercept subscriptions. prepare must apply the subscription's existing permissions/selections and confirm selected uploads. Each worker is best effort: no wait, response effects, or decision reopening.
func LifecycleClient ¶
func LifecycleClient(ctx context.Context, c LifecycleConfig) error
func LifecycleServer ¶
func LifecycleServer(parent context.Context, c LifecycleConfig) error
func ValidateElicitationAnswer ¶
ValidateElicitationAnswer validates submitted values; schema defaults remain annotations and are neither applied nor checked against the declared type.
func ValidateElicitationCorrelation ¶
ValidateElicitationCorrelation must run before body resolution or effects.
Types ¶
type Auth ¶
type Auth struct {
Mode string `json:"mode"`
Token string `json:"token"`
TokenEndpoint string `json:"tokenEndpoint"`
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
Assertion string `json:"assertion"`
SigningKey string `json:"signingKey"`
Issuer string `json:"issuer"`
Audience string `json:"audience"`
Purpose string `json:"purpose"`
Clock float64 `json:"clock"`
CAFile string `json:"caFile"`
CertFile string `json:"certFile"`
KeyFile string `json:"keyFile"`
}
type CompactionHook ¶
type CompactionHook struct {
Supplier string
FailurePolicy string
Run func(Object) ([]Object, error)
}
CompactionHook is a serial host-owned subscription. Run receives a detached snapshot. A failed response never commits any of its staged effects.
type Config ¶
type Config struct {
Transport string `json:"transport"`
Endpoint string `json:"endpoint"`
ReadinessFile string `json:"readinessFile"`
ScenarioFile string `json:"scenarioFile"`
ReportFile string `json:"reportFile"`
ServerCommand []string `json:"serverCommand"`
ServerCwd string `json:"serverCwd"`
ServerConfig string `json:"serverConfig"`
SchemaDir string `json:"schemaDir"`
Auth Auth `json:"auth"`
}
type LifecycleConfig ¶
type LifecycleConfig struct {
Config
Suite string `json:"suite"`
Upload UploadBinding `json:"upload"`
UploadAuth struct {
Token string `json:"token"`
Subscriptions []string `json:"subscriptions"`
} `json:"uploadAuth"`
Uploads map[string]UploadBinding `json:"uploads"`
ContentSelections map[string]map[string]string `json:"contentSelections"`
ControlEndpoint string `json:"controlEndpoint"`
ChildPidFile string `json:"childPidFile"`
}
type Object ¶
func Apply ¶
Apply stages a whole response in private memory, committing no partial state on structural, capability, or flow-admission failure. Host input validation runs after protocol acceptance and can refuse execution without rejection.
func ApplyElicitationEffects ¶
func ApplyElicitationEffects(request, result Object, resolve func(Object) ([]byte, error), validate func(string, any) error, principal string, effects []any) (Object, error)
ApplyElicitationEffects stages a complete list without mutating inputs or uploads. A nil result means a before-request return/deny boundary. Callers publish only the returned validated state, after uploading its complete JSON.
func Capabilities ¶
func Capabilities() Object
func CompactionCapabilities ¶
CompactionCapabilities advertises only enforceable text replacement.
func ProjectContent ¶
ProjectContent never grants access. BodyAllowed must come from receiver or host policy, not from event fields or a subscriber's requested selection.
func PublicBoundary ¶
func PublicBoundary(ctx context.Context, request Object, exchange func(context.Context, string, []byte) ([]byte, error), settings ...PublicBoundaryOptions) (Object, bool, error)
PublicBoundary runs a fixture occurrence through the public client. The exchange retains host transport/auth and test-controller scheduling, not acceptance.
func ReadSelectedElicitation ¶
func ReadSelectedElicitation(meta Object, stage string, resolve func(Object) ([]byte, error), validate func(string, any) error) (Object, error)
ReadSelectedElicitation never resolves metadata/omit; selected gaps fail closed.
func ReceiveBoundary ¶
func ReceiveBoundary(ctx context.Context, request Object, callback func(Object) (Object, error)) (Object, error)
ReceiveBoundary runs a fixture callback behind the public server's canonical admission and response acceptance. Authentication and host effects stay with the adapter. The in-memory HTTP exchange also serves owned stdio fixtures.
func RunCompaction ¶
func RunCompaction(instructions, itemID string, before, after []CompactionHook, generate func(string) (string, error), observeOnly bool) (Object, error)
RunCompaction runs the before pipeline, generation/substitution, then after controls. Only applied=true permits downstream use. Returned bodies are inline text parts; no upload or reference cache is needed. Observe-only after callbacks run on detached goroutines after settlement; their results, errors and panics cannot change settlement or delay downstream use.
func RunCompactionParts ¶ added in v0.3.0
func RunCompactionParts(instructions []any, itemID string, before, after []CompactionHook, generate func(string) (string, error), observeOnly bool) (Object, error)
RunCompactionParts retains the ordered canonical instruction parts, including their identities. Generation consumes their effective text in part order.
func ToolCapabilities ¶
func ToolCapabilities() Object
func UploadContent ¶
UploadContent sends arbitrary octets to the exact configured endpoint. The returned reference is usable only after validating synchronous 201 confirmation.
func ValidateElicitationExchange ¶
func ValidateElicitationExchange(request, result Object, resolve func(Object) ([]byte, error), validate func(string, any) error, principal string) (Object, error)
ValidateElicitationExchange binds complete uploaded MCP objects to normalized metadata without applying effects or checking effect grants. Resolve and validate are host-owned. Principal MUST come from the authenticated transport, never event.source or elicitation.server.
type PublicBoundaryOptions ¶
type PublicBoundaryOptions struct {
Content hooks.ContentOptions
ContentSelection Object
Upload Object
UploadClient *http.Client
InterceptOptions []hooks.InterceptOption
Accepted func(*hooks.Result)
}
PublicBoundaryOptions supplies host-owned content and pinned boundary context. Upload credentials remain separate from the event exchange.
type Scenario ¶
type Scenario struct {
ID string `json:"id"`
Request json.RawMessage `json:"request"`
Response json.RawMessage `json:"response"`
Expected Object `json:"expected"`
HostExpected Object `json:"hostExpected"`
Tags []string `json:"tags"`
ExpectError bool `json:"expectError"`
Barrier string `json:"barrier"`
}
type TaskLineage ¶
type TaskLineage struct {
RequireKnownParents bool
// contains filtered or unexported fields
}
TaskLineage tracks source-local identity, not task execution lifetime. A subscriber can receive a child first. Producers may require known parents.
func (*TaskLineage) Accept ¶
func (l *TaskLineage) Accept(event Object) error
Accept follows canonical envelope validation. Rejected edges leave no state.
type UploadAuth ¶
type UploadBinding ¶
type UploadBinding struct {
Endpoint string `json:"endpoint"`
TimeoutMs int `json:"timeoutMs"`
MaxBytes *int64 `json:"maxBytes"`
Auth *UploadAuth `json:"auth,omitempty"`
}
UploadBinding is independent of event authentication and transport.
Source Files
¶
- atomic.go
- auth.go
- catalogue.go
- client.go
- compaction.go
- config.go
- content.go
- elicitation.go
- fixture_host.go
- lifecycle.go
- lifecycle_adversarial.go
- lifecycle_client.go
- lifecycle_public_server.go
- lifecycle_server.go
- lineage.go
- ndjson.go
- observation.go
- observation_chain.go
- process_unix.go
- public_client.go
- public_dispatch.go
- public_lifecycle.go
- public_server.go
- registration.go
- selection.go
- server.go
- typed_server_glue.go
- upload_fixture.go
- validation.go