invocation

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalManager

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

func NewApprovalManager

func NewApprovalManager(ttl time.Duration) *ApprovalManager

func (*ApprovalManager) Clear

func (m *ApprovalManager) Clear()

func (*ApprovalManager) ClearServer

func (m *ApprovalManager) ClearServer(
	server mcpServer.ServerID,
)

ClearServer removes pending tokens and remembered decisions belonging to an MCP server. It is called whenever that server's runtime session ends.

func (*ApprovalManager) Create

func (m *ApprovalManager) Create(
	ctx context.Context,
	summary mcpServer.MCPApprovalSummary,
) (string, error)

func (*ApprovalManager) LookupDecision

func (*ApprovalManager) Resolve

func (*ApprovalManager) VerifyAndConsumeToken

func (m *ApprovalManager) VerifyAndConsumeToken(
	ctx context.Context,
	token string,
	expected mcpServer.MCPApprovalSummary,
) (string, error)

type Runtime

type Runtime interface {
	CallToolDryRun(
		ctx context.Context,
		server mcpServer.ServerID,
		request mcpServer.InvokeMCPToolRequestBody,
	) (mcpServer.RuntimeConfig, mcpServer.MCPToolCapability, error)

	CallTool(
		ctx context.Context,
		server mcpServer.ServerID,
		request mcpServer.InvokeMCPToolRequestBody,
	) (*mcpServer.InvokeMCPToolResponseBody, error)

	SetSessionLifecycleCleaner(
		cleaner mcpConnection.SessionLifecycleCleaner,
	)
}

type ToolBridge

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

func NewToolBridge

func NewToolBridge(
	runtime *mcpConnection.MCPRuntimeManager,
	approvals *ApprovalManager,
) *ToolBridge

func (*ToolBridge) Evaluate

func (*ToolBridge) EvaluateMapped

EvaluateMapped evaluates a model-originated provider-tool call against the persisted mapping produced by MCP inference hydration.

The mapping is authoritative for server identity, provider name, choice ID, discovered digest, and any conversation policy tightening.

func (*ToolBridge) Invoke

func (*ToolBridge) InvokeMapped

InvokeMapped invokes a provider-tool mapping after revalidating the current connected runtime snapshot and applying only policy-tightening constraints.

func (*ToolBridge) ResolveApproval

func (b *ToolBridge) ResolveApproval(
	ctx context.Context,
	approvalID string,
	resolution mcpServer.MCPApprovalResolution,
) (mcpServer.MCPApprovalResolutionResult, error)

Jump to

Keyboard shortcuts

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