docresolver

package
v1.0.69 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package docresolver resolves document IDs, URLs, and natural titles to one typed document target before a shortcut performs a business operation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candidate

type Candidate struct {
	CanonicalID  string `json:"canonicalId"`
	Name         string `json:"name,omitempty"`
	Product      string `json:"product"`
	ResourceType string `json:"resourceType,omitempty"`
	URL          string `json:"canonicalUrl,omitempty"`
	ContainerID  string `json:"containerId,omitempty"`
}

Candidate is a credential-free document search candidate.

type Reader

type Reader interface {
	CallMCPData(product, tool string, params map[string]any) (map[string]any, error)
}

Reader is the read-only RuntimeContext surface needed by the resolver.

type Resolution

type Resolution struct {
	ContractVersion string      `json:"contractVersion"`
	Status          string      `json:"status"`
	Query           string      `json:"query,omitempty"`
	MatchedBy       string      `json:"matchedBy"`
	Complete        bool        `json:"complete"`
	Selected        Candidate   `json:"selected"`
	Candidates      []Candidate `json:"candidates"`
}

Resolution is the stable result consumed by document shortcuts.

func Resolve

func Resolve(rt Reader, node, query string) (Resolution, error)

Resolve accepts exactly one stable node/URL or natural title. Natural title resolution exhausts pagination before selecting a unique candidate.

Jump to

Keyboard shortcuts

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