Documentation
¶
Overview ¶
Package adapter contains explicit, versioned harness capability profiles. It never infers write or execution capabilities from a JSON schema shape.
Index ¶
Constants ¶
const ( HumanShimID = "human-shim" HumanShimVersion = "1" )
const ( OpenCodeID = "opencode" OpenCodeVersion = "1.17.18" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EditSemantics ¶
type EditSemantics string
const ( EditExact EditSemantics = "exact" EditFuzzy EditSemantics = "fuzzy" EditLine EditSemantics = "line" )
type EditTool ¶
type EditTool struct {
Tool
Semantics EditSemantics `json:"semantics"`
OldField string `json:"old_field"`
NewField string `json:"new_field"`
}
type PathStyle ¶
type PathStyle string
PathStyle describes how a harness addresses files. Mirror code uses this declaration instead of guessing from a field name or JSON schema.
type Profile ¶
type Profile struct {
HarnessID string `json:"harness_id"`
HarnessVersion string `json:"harness_version"`
PathStyle PathStyle `json:"path_style,omitempty"`
ResultCodec ResultCodec `json:"result_codec,omitempty"`
Read *Tool `json:"read,omitempty"`
Search *Tool `json:"search,omitempty"`
Write *Tool `json:"write,omitempty"`
Edit *EditTool `json:"edit,omitempty"`
Delete *Tool `json:"delete,omitempty"`
Rename *Tool `json:"rename,omitempty"`
Exec *ExecTool `json:"exec,omitempty"`
NativeTools map[string]ToolAuthorization `json:"native_tools,omitempty"`
ParallelCalls bool `json:"parallel_calls"`
ErrorShape string `json:"error_shape"`
}
func HumanShimProfile ¶
func HumanShimProfile() Profile
func OpenCode11718Profile ¶
func OpenCode11718Profile() Profile
OpenCode11718Profile describes only the native tools observed from OpenCode 1.17.18. Keep the version in the constructor name so a future schema change is introduced as a separate profile instead of silently widening this one.
func (Profile) AllowsTool ¶
AllowsTool reports whether name is explicitly mapped by this exact harness profile. It deliberately performs no schema-shape inference.
func (Profile) AuthorizeTool ¶
func (profile Profile) AuthorizeTool(name string) (ToolAuthorization, bool)
AuthorizeTool reports the reviewed authorization class for name. Exact filesystem mappings are standard workspace capabilities, while the mapped command tool is privileged. A false result is intentionally not equivalent to safe: unclassified native/custom/MCP tools require explicit privileged authorization at the gateway, where caller declaration is checked separately.
func (Profile) IsExecTool ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewDefaultRegistry ¶
func NewDefaultRegistry() *Registry
NewDefaultRegistry returns the exact, versioned adapters shipped with the daemon. Real harness adapters are registered only after their tool contracts have been captured and reviewed.
func NewRegistry ¶
func NewRegistry() *Registry
type ResultCodec ¶
type ResultCodec string
ResultCodec names an exact, versioned tool-result contract. A profile may omit it when it is not eligible for workspace reconciliation.
const ( ResultHumanShimV1 ResultCodec = "human_shim_v1" ResultOpenCode11718 ResultCodec = "opencode_1_17_18" )
type ToolAuthorization ¶
type ToolAuthorization string
ToolAuthorization classifies caller-native tools that do not need a workspace semantic mapping. Standard tools are known not to grant command, network, sub-agent, or otherwise open-ended authority. Privileged tools (and tools an exact profile does not classify) require the task's explicit active capability opt-in before Human may return them.
This is deliberately separate from Tool mappings: a native tool such as todowrite can be safe to return without being usable for mirror reconciliation, while task/webfetch must not inherit authority merely from appearing in the caller's schema.
const ( ToolAuthorizationStandard ToolAuthorization = "standard" ToolAuthorizationPrivileged ToolAuthorization = "privileged" )