docsbridge

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package docsbridge exposes the experimental source-documentation draft/consume implementation (docs/specs/source-documentation-draft-v0.md) as read-only MCP tools. It calls exactly the native compiler the corvint CLI's `docs draft` and `docs consume` commands call (internal/doccompiler and internal/contextindex.BuildContext); it never shells out to corvint and never duplicates the compiler's claims, provenance, or limit logic.

Index

Constants

View Source
const (
	ToolDraft   = "corvint.docs_draft"
	ToolConsume = "corvint.docs_consume"
)

Variables

This section is empty.

Functions

func New

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

Types

type Error

type Error struct{ Code string }

Error is a closed, sanitized transport-level failure: malformed arguments, an unknown tool name, or cancellation. It never carries repository paths or underlying process output.

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, matching internal/mcp/bridge.Registry's identity and Git-directory checks exactly.

func (*Registry) Call

func (registry *Registry) Call(ctx context.Context, name string, arguments []byte) (structured map[string]any, text string, toolFailure *ToolFailure, transportErr *Error)

Call dispatches one tool by name. It returns exactly one of: a successful structured/text pair, a ToolFailure (the caller must report isError: true), or a transport Error (invalid arguments, unknown tool, or cancellation).

func (*Registry) Tools

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

Tools is the exact delivered surface: the two experimental docs tools only.

type ToolFailure

type ToolFailure struct{ Code, Message string }

ToolFailure is a business-level refusal from the native compiler, reported as an MCP tool error (isError: true), never as a successful call. Code and Message are exactly the CLI's `docs` stderr envelope fields for the same input (unsupported-documentation-source, documentation-limit-exceeded, stale-documentation-draft, repository-unavailable).

Jump to

Keyboard shortcuts

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