toolcall

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package toolcall declares the completed-call finalizer SDK seam (ADR 0007 / issue #152).

Core owns exact original event replay and must pass Finalize a defensive copy of ArgsJSON; finalizers must treat CompletedCall as immutable input.

Phase 5 adapter contract: when a repair engine / finalizer returns ActionPass (or an engine OutcomePass) with nil ArgsJSON, core must replay the exact original buffered argument bytes and lifecycle events. Nil means “unchanged originals”, never empty args.

Index

Constants

View Source
const (
	ReasonValidPassThrough          = "valid_pass_through"
	ReasonSyntaxRepaired            = "syntax_repaired"
	ReasonToolNameNormalized        = "tool_name_normalized"
	ReasonPropertyRenamed           = "property_renamed"
	ReasonDefaultInserted           = "default_inserted"
	ReasonConstInserted             = "const_inserted"
	ReasonEnumInserted              = "enum_inserted"
	ReasonAdditionalPropertyRemoved = "additional_property_removed"
	ReasonAmbiguousToolName         = "ambiguous_tool_name"
	ReasonAmbiguousProperty         = "ambiguous_property"
	ReasonUnrepairable              = "unrepairable"
	ReasonSchemaInvalid             = "schema_invalid"
	ReasonSchemaUnsupported         = "schema_unsupported"
	ReasonArgsTooLarge              = "args_too_large"
	ReasonScalarCoercionDisabled    = "scalar_coercion_disabled"
	ReasonCanceled                  = "canceled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	ActionUnspecified Action = iota
	ActionPass
	ActionRewrite
	ActionReject
)

type CompletedCall

type CompletedCall struct {
	ToolCallID string
	ToolName   string
	ArgsJSON   []byte
}

type Finalizer

type Finalizer interface {
	ID() string
	Order() int
	Finalize(ctx context.Context, call CompletedCall, tool lipapi.ToolDef, catalog []lipapi.ToolDef, meta Meta) (Result, error)
}

func MaterializeSorted

func MaterializeSorted(finalizers []Finalizer) []Finalizer

type Meta

type Meta struct {
	TraceID    string
	ALegID     string
	BLegID     string
	AttemptSeq int
}

type RejectError

type RejectError struct {
	ReasonCode string
	ToolCallID string
}

func (*RejectError) Error

func (e *RejectError) Error() string

type Result

type Result struct {
	Action     Action
	ToolName   string
	ArgsJSON   []byte
	ReasonCode string
}

Jump to

Keyboard shortcuts

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