Documentation
¶
Overview ¶
Package bind chooses which of a client's tools a declared capability binds to when the client gives no input schema to check a contract against.
Where a schema IS available the satisfaction rule (package satisfy) decides and this package is not used.
Everything here is normative: two runners must reach the same choice from the same inventory, so nothing depends on map order, inventory order or locale. Change the arithmetic and you change what every primitive binds to.
Index ¶
Constants ¶
const Floor = 0.60
Floor is the minimum score that binds. Chosen from measurement against two clients' real inventories; see bind_test.go.
Variables ¶
This section is empty.
Functions ¶
func Candidates ¶
Candidates returns the choice Resolve makes, and with it every tool whose name clears the floor, best first. A caller that can also check a tool's schema walks the list and takes the first that passes.
Types ¶
type Choice ¶
type Choice struct {
Bound *Tool
Score float64
RunnerUp *Tool // nil when there was no second candidate
RunnerUpScore float64
// Gated is set when the bound tool's server did not say what it does. The
// runner treats it as a write whatever the primitive declared.
Gated bool
// Refused says why nothing bound. Empty when Bound is set.
Refused string
}
Choice is the outcome for one declared capability.
type Effect ¶
type Effect string
Effect is what a primitive declares for a tool, and what a tool's own server says about it. Unknown is only ever the second.
type Tool ¶
type Tool struct {
Server string
Name string
Annotated Effect // what the server says; Unknown when it says nothing
// Schema is the tool's input schema, where the client gives one. Binding
// by name does not read it.
Schema map[string]any `json:"-"`
}
Tool is one entry of a client's inventory, as its bridge reports it.