tools

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package tools is the public SDK facade over Harbor's internal/tools package — the transport-agnostic tool catalog, the descriptor/policy vocabulary, and the planner-facing catalog view (RFC §3.6, §6.10; D-204). Alias-based re-exports only: no behavior lives here. The policy execution shell, invoke hooks, error classification, search-cache seam, and event payload structs are deliberately private.

Index

Constants

View Source
const (
	// ErrClassTransient — retryable infrastructure failures.
	ErrClassTransient = internal.ErrClassTransient
	// ErrClassTimeout — the per-attempt deadline elapsed.
	ErrClassTimeout = internal.ErrClassTimeout
	// ErrClass5xx — server-side 5xx failures.
	ErrClass5xx = internal.ErrClass5xx
	// ErrClassPermanent — non-retryable failures.
	ErrClassPermanent = internal.ErrClassPermanent
)

ErrorClass values.

View Source
const (
	// LoadingAlways — the tool is always visible to the planner.
	LoadingAlways = internal.LoadingAlways
	// LoadingDeferred — the tool is discovered via tool_search.
	LoadingDeferred = internal.LoadingDeferred
)

LoadingMode values.

View Source
const (
	// SideEffectPure — no side effects.
	SideEffectPure = internal.SideEffectPure
	// SideEffectRead — reads external state.
	SideEffectRead = internal.SideEffectRead
	// SideEffectWrite — writes external state.
	SideEffectWrite = internal.SideEffectWrite
	// SideEffectExternal — calls an external system.
	SideEffectExternal = internal.SideEffectExternal
	// SideEffectStateful — mutates durable state.
	SideEffectStateful = internal.SideEffectStateful
)

SideEffect values.

View Source
const (
	// TransportInProcess — an in-process Go function tool.
	TransportInProcess = internal.TransportInProcess
	// TransportHTTP — an HTTP endpoint tool.
	TransportHTTP = internal.TransportHTTP
	// TransportMCP — a southbound MCP server tool.
	TransportMCP = internal.TransportMCP
	// TransportA2A — a southbound A2A remote-agent tool.
	TransportA2A = internal.TransportA2A
	// TransportFlow — a typed DAG registered as one Tool.
	TransportFlow = internal.TransportFlow
)

TransportKind values.

View Source
const (
	// ValidateNone — no schema validation.
	ValidateNone = internal.ValidateNone
	// ValidateBoth — validate args and results.
	ValidateBoth = internal.ValidateBoth
	// ValidateIn — validate args only.
	ValidateIn = internal.ValidateIn
	// ValidateOut — validate results only.
	ValidateOut = internal.ValidateOut
)

ValidateMode values.

View Source
const (
	// EventTypeToolInvoked — a tool invocation started.
	EventTypeToolInvoked = internal.EventTypeToolInvoked
	// EventTypeToolCompleted — a tool invocation succeeded.
	EventTypeToolCompleted = internal.EventTypeToolCompleted
	// EventTypeToolFailed — a tool invocation failed.
	EventTypeToolFailed = internal.EventTypeToolFailed
	// EventTypeToolInvalidArgs — args failed schema validation.
	EventTypeToolInvalidArgs = internal.EventTypeToolInvalidArgs
	// EventTypeToolPolicyExhausted — the policy retry budget ran out.
	EventTypeToolPolicyExhausted = internal.EventTypeToolPolicyExhausted
)

Tool lifecycle event types (published on the events bus).

Variables

View Source
var (
	// ErrToolNotFound — the named tool is not in the catalog.
	ErrToolNotFound = internal.ErrToolNotFound
	// ErrToolInvalidArgs — arguments failed the tool's schema.
	ErrToolInvalidArgs = internal.ErrToolInvalidArgs
	// ErrToolPolicyExhausted — policy retries are exhausted.
	ErrToolPolicyExhausted = internal.ErrToolPolicyExhausted
	// ErrToolDuplicateName — a tool with this name is already registered.
	ErrToolDuplicateName = internal.ErrToolDuplicateName
)

Re-exported sentinel errors callers compare via errors.Is.

View Source
var (
	// WithAuthScopes sets the OAuth scopes the tool requires.
	WithAuthScopes = internal.WithAuthScopes
	// WithBus threads the event bus into the registration.
	WithBus = internal.WithBus
	// WithCostHint sets the human-readable cost hint.
	WithCostHint = internal.WithCostHint
	// WithDescription sets the planner-visible description.
	WithDescription = internal.WithDescription
	// WithExamples attaches worked invocation examples.
	WithExamples = internal.WithExamples
	// WithLatencyHint sets the expected latency hint.
	WithLatencyHint = internal.WithLatencyHint
	// WithLoading sets the catalog LoadingMode.
	WithLoading = internal.WithLoading
	// WithPolicy sets the per-tool execution policy.
	WithPolicy = internal.WithPolicy
	// WithSafetyNotes sets the planner-visible safety notes.
	WithSafetyNotes = internal.WithSafetyNotes
	// WithSideEffect declares the tool's side-effect class.
	WithSideEffect = internal.WithSideEffect
	// WithSource records the tool's provenance.
	WithSource = internal.WithSource
	// WithTags attaches discovery tags.
	WithTags = internal.WithTags
)

Descriptor options (see internal/tools DescriptorOption docs).

View Source
var Catalog = internal.Catalog

Catalog extracts the catalog from ctx, reporting presence.

View Source
var DefaultPolicy = internal.DefaultPolicy

DefaultPolicy returns the default per-tool execution policy.

View Source
var MustCatalog = internal.MustCatalog

MustCatalog extracts the catalog from ctx, panicking when absent.

View Source
var NewCatalog = internal.NewCatalog

NewCatalog constructs an empty tool catalog.

View Source
var NewPlannerView = internal.NewPlannerView

NewPlannerView builds the identity-filtered planner-facing view of a catalog.

View Source
var VisibleNames = internal.VisibleNames

VisibleNames lists the tool names visible under a filter.

View Source
var WithCatalog = internal.WithCatalog

WithCatalog returns a child context carrying the catalog.

Functions

This section is empty.

Types

type CatalogFilter

type CatalogFilter = internal.CatalogFilter

CatalogFilter scopes catalog reads by the identity triple.

type CatalogOption

type CatalogOption = internal.CatalogOption

CatalogOption customises NewCatalog.

type DescriptorOption

type DescriptorOption = internal.DescriptorOption

DescriptorOption customises a descriptor at registration time.

type ErrorClass

type ErrorClass = internal.ErrorClass

ErrorClass classifies a tool failure for the policy shell (retry-vs-stop decisions). Re-exported in Phase 112b (D-206): harbortest.SimulateFailure takes one, so external test authors must be able to name the class values.

type LoadingMode

type LoadingMode = internal.LoadingMode

LoadingMode is the catalog loading strategy for a tool.

type PlannerView

type PlannerView = internal.PlannerView

PlannerView is the identity-filtered, planner-facing catalog view.

type SideEffect

type SideEffect = internal.SideEffect

SideEffect declares a tool's side-effect class.

type Tool

type Tool = internal.Tool

Tool is one registered tool (descriptor + invoker), any transport.

type ToolCatalog

type ToolCatalog = internal.ToolCatalog

ToolCatalog is the catalog interface tools register on and the runtime dispatches against.

type ToolDescriptor

type ToolDescriptor = internal.ToolDescriptor

ToolDescriptor is a tool's catalog-visible metadata.

type ToolExample

type ToolExample = internal.ToolExample

ToolExample is one worked invocation example on a descriptor.

type ToolPolicy

type ToolPolicy = internal.ToolPolicy

ToolPolicy is the per-tool timeout/retry/validation policy.

type ToolProvider

type ToolProvider = internal.ToolProvider

ToolProvider is the per-transport invocation seam.

type ToolResult

type ToolResult = internal.ToolResult

ToolResult is the canonical invocation result envelope.

type ToolSourceID

type ToolSourceID = internal.ToolSourceID

ToolSourceID names where a tool came from (config, MCP server, ...).

type TransportKind

type TransportKind = internal.TransportKind

TransportKind names a tool's transport.

type ValidateMode

type ValidateMode = internal.ValidateMode

ValidateMode selects schema validation of args and/or results.

Directories

Path Synopsis
Package auth is the public SDK facade over Harbor's internal/tools/auth package — the tool-side OAuth completion leg: a plain http.Handler that exchanges the provider redirect and resumes the parked pause (RFC §3.6, §6.3; D-204/D-206; Phase 111b/D-199).
Package auth is the public SDK facade over Harbor's internal/tools/auth package — the tool-side OAuth completion leg: a plain http.Handler that exchanges the provider redirect and resumes the parked pause (RFC §3.6, §6.3; D-204/D-206; Phase 111b/D-199).
Package builtin is the public SDK facade over Harbor's internal/tools/builtin package — the runtime's built-in tool set (clock, text, artifact_fetch, tool/skill discovery, declarative actions) registered by name onto a catalog (RFC §3.6, §6.10; D-204).
Package builtin is the public SDK facade over Harbor's internal/tools/builtin package — the runtime's built-in tool set (clock, text, artifact_fetch, tool/skill discovery, declarative actions) registered by name onto a catalog (RFC §3.6, §6.10; D-204).
Package inproc is the public SDK facade over Harbor's internal/tools/drivers/inproc package — the in-process tool driver that registers plain Go functions as Tools with reflection-derived schemas (RFC §3.6, §6.10; D-204).
Package inproc is the public SDK facade over Harbor's internal/tools/drivers/inproc package — the in-process tool driver that registers plain Go functions as Tools with reflection-derived schemas (RFC §3.6, §6.10; D-204).

Jump to

Keyboard shortcuts

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