Documentation
¶
Index ¶
- func BytesHash(input []byte) string
- func ComputeToolHash(serverName, toolName, description string, inputSchema interface{}) string
- func ComputeToolHashWithOutputSchema(serverName, toolName, description string, inputSchema interface{}, ...) string
- func NormalizeJSON(s string) string
- func StringHash(input string) string
- func ToolHash(serverName, toolName, description string, parametersSchema interface{}) (string, error)
- func ToolHashWithOutputSchema(serverName, toolName, description string, parametersSchema interface{}, ...) (string, error)
- func VerifyToolHash(serverName, toolName, description string, parametersSchema interface{}, ...) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeToolHash ¶
ComputeToolHash computes a SHA256 hash for a tool (alias for ToolHash that doesn't return error)
func ComputeToolHashWithOutputSchema ¶ added in v0.33.4
func ComputeToolHashWithOutputSchema(serverName, toolName, description string, inputSchema interface{}, outputSchemaJSON string) string
ComputeToolHashWithOutputSchema computes a SHA256 hash for a tool including output schema.
func NormalizeJSON ¶ added in v0.33.4
NormalizeJSON parses s and re-serializes it with object keys sorted, so that semantically identical JSON with different key order or whitespace produces a stable, comparable string. Empty or non-JSON input is returned unchanged.
This is the single canonical JSON normalizer shared by the upstream tool capture (internal/upstream/core) and the tool-approval hash (internal/runtime), so a schema hashes identically no matter which path observed it.
func ToolHash ¶
func ToolHash(serverName, toolName, description string, parametersSchema interface{}) (string, error)
ToolHash computes SHA-256 hash for tool change detection. Format: sha256(canonical JSON of serverName, toolName, description, input schema)
func ToolHashWithOutputSchema ¶ added in v0.33.4
func ToolHashWithOutputSchema(serverName, toolName, description string, parametersSchema interface{}, outputSchemaJSON string) (string, error)
ToolHashWithOutputSchema computes SHA-256 hash for the full tool contract. Output schema is included because it describes the data shape returned to the agent and therefore belongs to the human-approved tool contract. Format: sha256(canonical JSON of serverName, toolName, description, input schema, output schema)
Types ¶
This section is empty.