bridge

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 18 Imported by: 0

Documentation

Overview

Package bridge exposes the currently qualified Corvint read surfaces without coupling them to an MCP transport implementation.

Index

Constants

View Source
const (
	ToolQuery  = "corvint.query"
	ToolImpact = "corvint.impact"
	ToolStatus = "corvint.status"
)

Variables

This section is empty.

Functions

func New

func New(root string) (*Registry, *Error)

Types

type Abstention

type Abstention struct {
	Active bool   `json:"active"`
	Reason string `json:"reason"`
}

type Error

type Error struct{ Code string }

Error is a closed, sanitized failure. It never contains repository paths, tool output, or underlying process errors.

func (*Error) Error

func (failure *Error) Error() string

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry binds every call to one canonical local repository root.

func (*Registry) Call

func (registry *Registry) Call(ctx context.Context, name string, arguments []byte) (Result, *Error)

func (*Registry) Tools

func (registry *Registry) Tools() []ToolDescriptor

Tools is the exact delivered surface. Standalone evidence and dashboard snapshot tools are omitted; query and impact receipts carry their evidence.

type RepositoryBinding

type RepositoryBinding struct {
	CommitRevision   string `json:"commitRevision"`
	DirtyPathCount   int    `json:"dirtyPathCount"`
	DirtyPathsSHA256 string `json:"dirtyPathsSha256"`
	ObjectFormat     string `json:"objectFormat"`
	ProfileID        string `json:"profileId"`
	TreeRevision     string `json:"treeRevision"`
	WorktreeState    string `json:"worktreeState"`
}

type Result

type Result struct {
	Schema         string             `json:"schema"`
	Tool           string             `json:"tool"`
	Mutates        bool               `json:"mutates"`
	State          string             `json:"state"`
	EpistemicClass string             `json:"epistemicClass"`
	AuthorityClass string             `json:"authorityClass"`
	Repository     *RepositoryBinding `json:"repository"`
	Receipt        map[string]any     `json:"receipt"`
	Abstention     Abstention         `json:"abstention"`
}

func (Result) CanonicalJSON

func (result Result) CanonicalJSON() ([]byte, *Error)

CanonicalJSON returns deterministic compact bytes for the MCP text content.

func (Result) Object

func (result Result) Object() (map[string]any, *Error)

Object returns the closed representation consumed by the MCP handler. Receipt is passed through without flattening or reinterpreting its fields.

type ToolAnnotations

type ToolAnnotations struct {
	ReadOnlyHint    bool `json:"readOnlyHint"`
	DestructiveHint bool `json:"destructiveHint"`
	IdempotentHint  bool `json:"idempotentHint"`
	OpenWorldHint   bool `json:"openWorldHint"`
}

type ToolDescriptor

type ToolDescriptor struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	InputSchema map[string]any  `json:"inputSchema"`
	Annotations ToolAnnotations `json:"annotations"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL