worker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToolRequestWasAttempted

func ToolRequestWasAttempted(err error) bool

ToolRequestWasAttempted reports whether err happened after the custom tool send path began.

func WithToolCallID

func WithToolCallID(ctx context.Context, toolCallID string) context.Context

WithToolCallID records the model provider's tool-call id for Tool CRD span metadata.

func WithToolIdempotencyKey

func WithToolIdempotencyKey(ctx context.Context, key string) context.Context

WithToolIdempotencyKey attaches a trusted idempotency key for HTTP tool execution.

Types

type ToolExecutionError added in v0.2.0

type ToolExecutionError struct {
	Err error
}

ToolExecutionError reports a failure returned by an admitted tool call. Authorization, transport, cancellation, and malformed-response errors do not carry this marker. Callers must not expose its upstream diagnostic as an MCP result without applying their own disclosure policy.

func (ToolExecutionError) Error added in v0.2.0

func (e ToolExecutionError) Error() string

func (ToolExecutionError) Unwrap added in v0.2.0

func (e ToolExecutionError) Unwrap() error

type ToolExecutor

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

ToolExecutor handles execution of custom Tool CRDs via HTTP or MCP-over-HTTP.

func NewToolExecutor

func NewToolExecutor() *ToolExecutor

NewToolExecutor creates a new tool executor

func NewToolExecutorForNamespace

func NewToolExecutorForNamespace(namespace string, k8sClient kubernetes.Interface, httpClient *http.Client, resolvers ...outboundaccess.Resolver) *ToolExecutor

NewToolExecutorForNamespace creates a Tool CRD executor with explicit dependencies. Controller-side brokered AgentRuntime tool execution uses this path so Orka, not the remote backend, resolves tool credentials.

func (*ToolExecutor) Execute

func (e *ToolExecutor) Execute(ctx context.Context, tool *corev1alpha1.Tool, args json.RawMessage) (result string, err error)

Execute executes a Tool CRD by making an HTTP request.

func (*ToolExecutor) SetAuthSecretValue

func (e *ToolExecutor) SetAuthSecretValue(name, key, value string)

SetAuthSecretValue supplies an exact task-scoped Tool auth Secret snapshot.

func (*ToolExecutor) SetTransactionAuthority

func (e *ToolExecutor) SetTransactionAuthority(token string, scopes []string)

SetTransactionAuthority sets task-scoped transaction authority. Calling it with an empty token intentionally disables fallback to process-global files.

func (*ToolExecutor) SetTransactionCredentialAuthority

func (e *ToolExecutor) SetTransactionCredentialAuthority(enforced, allowed bool, secret string)

SetTransactionCredentialAuthority sets immutable Task authorization for outbound credentials.

func (*ToolExecutor) SetTransactionExchangeConfig

func (e *ToolExecutor) SetTransactionExchangeConfig(config *TransactionExchangeConfig)

SetTransactionExchangeConfig supplies controller-resolved TTS settings.

type ToolRequestAttemptedError

type ToolRequestAttemptedError struct {
	Err error
}

ToolRequestAttemptedError wraps errors that occur after a custom tool request may already have reached the remote endpoint.

func (ToolRequestAttemptedError) Error

func (ToolRequestAttemptedError) Unwrap

func (e ToolRequestAttemptedError) Unwrap() error

type TransactionExchangeConfig

type TransactionExchangeConfig struct {
	TTS              contexttoken.TTSConfig
	Exchanger        contexttoken.Exchanger
	SubjectTokenType string
	OutboundScope    string
}

TransactionExchangeConfig carries controller-resolved TTS settings for brokered Tool execution, where worker environment variables are unavailable.

Jump to

Keyboard shortcuts

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