resources

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentExecutionProfileDynamic  = "dynamic"
	AgentExecutionProfileContract = "contract"

	AgentDuplicateToolCallPolicyShortCircuit = "short_circuit"
	AgentDuplicateToolCallPolicyDeny         = "deny"

	AgentContractViolationPolicyObserve           = "observe"
	AgentContractViolationPolicyNonRetryableError = "non_retryable_error"

	AgentToolUseBehaviorRunLLMAgain     = "run_llm_again"
	AgentToolUseBehaviorStopOnFirstTool = "stop_on_first_tool"
)
View Source
const (
	EvalScoringExactMatch = "exact_match"
	EvalScoringLLMJudge   = "llm_judge"
	EvalScoringManual     = "manual"
	EvalScoringCustom     = "custom"
)

Eval scoring strategy constants.

View Source
const (
	EvalRunPhasePending       = "Pending"
	EvalRunPhaseRunning       = "Running"
	EvalRunPhaseScoring       = "Scoring"
	EvalRunPhasePendingReview = "PendingReview"
	EvalRunPhaseSucceeded     = "Succeeded"
	EvalRunPhaseFailed        = "Failed"
	EvalRunPhaseCancelled     = "Cancelled"
)

Eval run phase constants.

View Source
const (
	MemoryOperationRead   = "read"
	MemoryOperationWrite  = "write"
	MemoryOperationSearch = "search"
	MemoryOperationList   = "list"
	MemoryOperationIngest = "ingest"
)
View Source
const (
	SealedSecretOwnerAnnotation = "orloj.dev/sealedsecret-owner"
	SealingAlgorithm            = "rsa-oaep-sha256+aes-256-gcm"
)
View Source
const APIRedactedSecretPlaceholder = "***"

APIRedactedSecretPlaceholder is the value the HTTP API uses for redacted secret fields in GET responses.

View Source
const DefaultNamespace = "default"

Variables

This section is empty.

Functions

func DetectKind

func DetectKind(data []byte) (string, error)

DetectKind extracts resource kind from a JSON or constrained YAML manifest.

func EdgeConditionMatchesOutput added in v0.15.0

func EdgeConditionMatchesOutput(c *EdgeCondition, output string) bool

EdgeConditionMatchesOutput evaluates an EdgeCondition against the given output string.

func EncodeTaskApprovalResumeContext added in v0.10.0

func EncodeTaskApprovalResumeContext(ctx TaskApprovalResumeContext) (map[string]any, error)

func EnforceContainerResourceCeiling added in v0.13.0

func EnforceContainerResourceCeiling(res ContainerResources, ceiling ContainerResourceCeiling, resourceKind, resourceName string) error

EnforceContainerResourceCeiling checks that the given resources do not exceed the operator ceiling. Returns a descriptive error when exceeded.

func ExecutionAgentOrder added in v0.12.0

func ExecutionAgentOrder(system AgentSystem) []string

ExecutionAgentOrder returns a topological ordering of agents in the AgentSystem suitable for sequential execution. If no graph is present, declaration order from spec.agents is used. This duplicates the controller semantics used for task reconciliation.

func GraphOutgoingAgents

func GraphOutgoingAgents(node GraphEdge) []string

GraphOutgoingAgents returns normalized outgoing target agent names.

func IsFirstExecutionAgent added in v0.12.0

func IsFirstExecutionAgent(system AgentSystem, agentName string) bool

IsFirstExecutionAgent reports whether agentName is the first agent in ExecutionAgentOrder.

func MemoryToolNamesForOperations

func MemoryToolNamesForOperations(ops []string) []string

MemoryToolNamesForOperations returns built-in memory tool names for the normalized operation set.

func MergeRedactedSecretPlaceholders added in v0.5.0

func MergeRedactedSecretPlaceholders(dst *Secret, current Secret) error

MergeRedactedSecretPlaceholders replaces API redaction sentinels in dst with values from current (the stored secret). Call before Normalize() on a PUT body that round-tripped through the UI or GET API.

func NormalizeMemoryOperation

func NormalizeMemoryOperation(raw string) (string, bool)

NormalizeMemoryOperation normalizes operation names and accepts either short names like "read" or legacy-style tool names like "memory.read".

func NormalizeMemoryOperations

func NormalizeMemoryOperations(raw []string) ([]string, error)

NormalizeMemoryOperations deduplicates and validates memory operations.

func NormalizeNamespace

func NormalizeNamespace(namespace string) string

func NormalizeObjectMetaNamespace

func NormalizeObjectMetaNamespace(meta *ObjectMeta)

func ParseManifest added in v0.2.0

func ParseManifest(kind string, raw []byte) (normKind string, name string, obj any, err error)

ParseManifest parses and normalizes a manifest of a supported kind. kind should be the value from DetectKind (any casing); it is normalized with strings.ToLower(strings.TrimSpace(kind)). On success, normKind is the normalized kind string, name is metadata.name, and obj is the typed resource suitable for json.Marshal (same shape as apply uses).

func ParseMemoryBytes added in v0.13.0

func ParseMemoryBytes(s string) (int64, error)

ParseMemoryBytes converts a memory string to bytes. Accepted suffixes (case-insensitive): gi, mi, ki (IEC binary), g, m, k (Docker-style, also 1024-based), b (bytes). A bare integer is treated as bytes.

func ParseModelEndpointRef

func ParseModelEndpointRef(defaultNamespace string, ref string) (namespace string, name string)

ParseModelEndpointRef resolves model endpoint references in name or namespace/name form.

func ParseSealingPrivateKeyPEM added in v0.11.0

func ParseSealingPrivateKeyPEM(raw string) (*rsa.PrivateKey, string, error)

func ParseSealingPublicKeyPEM added in v0.11.0

func ParseSealingPublicKeyPEM(raw string) (*rsa.PublicKey, string, error)

func TaskApprovalAllowsRequestChanges added in v0.10.0

func TaskApprovalAllowsRequestChanges(a TaskApproval) bool

func TaskApprovalMaxReviewCycles added in v0.10.0

func TaskApprovalMaxReviewCycles(a TaskApproval) int

func UnwrapFencedCodeBlock added in v0.15.0

func UnwrapFencedCodeBlock(content string) string

UnwrapFencedCodeBlock strips markdown code fences (```lang ... ```) from content that models sometimes wrap around JSON output. If the content is not fenced the original string is returned unchanged.

func ValidateContainerResources added in v0.13.0

func ValidateContainerResources(res ContainerResources, fieldPrefix string) error

ValidateContainerResources checks that the fields of a ContainerResources struct are well-formed when set.

func ValidateMetadataName added in v0.12.0

func ValidateMetadataName(name string) error

ValidateMetadataName checks that a resource name is safe for use as a URL path segment and as a store key component. It rejects empty names, names containing '/', whitespace, or reserved subresource suffixes.

Types

type Agent

type Agent struct {
	APIVersion string      `json:"apiVersion" yaml:"apiVersion"`
	Kind       string      `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta  `json:"metadata" yaml:"metadata"`
	Spec       AgentSpec   `json:"spec" yaml:"spec"`
	Status     AgentStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Agent represents the desired and observed state for a single agent runtime.

func ParseAgentManifest

func ParseAgentManifest(data []byte) (Agent, error)

ParseAgentManifest accepts either JSON or a constrained YAML subset for Agent resources.

func (*Agent) Normalize

func (a *Agent) Normalize() error

Normalize applies defaults and validates the resource.

func (*Agent) ResolvedModel added in v0.14.0

func (a *Agent) ResolvedModel() string

ResolvedModel returns the runtime-resolved model ID. This is populated after model ref resolution and should be used instead of reading Spec.Model directly.

type AgentExecutionSpec

type AgentExecutionSpec struct {
	Profile                 string         `json:"profile,omitempty" yaml:"profile,omitempty"`
	ToolSequence            []string       `json:"tool_sequence,omitempty" yaml:"tool_sequence,omitempty"`
	RequiredOutputMarkers   []string       `json:"required_output_markers,omitempty" yaml:"required_output_markers,omitempty"`
	DuplicateToolCallPolicy string         `json:"duplicate_tool_call_policy,omitempty" yaml:"duplicate_tool_call_policy,omitempty"`
	OnContractViolation     string         `json:"on_contract_violation,omitempty" yaml:"on_contract_violation,omitempty"`
	ToolUseBehavior         string         `json:"tool_use_behavior,omitempty" yaml:"tool_use_behavior,omitempty"`
	OutputSchema            map[string]any `json:"output_schema,omitempty" yaml:"output_schema,omitempty"`
}

AgentExecutionSpec configures optional per-agent execution contracts.

type AgentLimits

type AgentLimits struct {
	MaxSteps int    `json:"max_steps,omitempty" yaml:"max_steps,omitempty"`
	Timeout  string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
}

AgentLimits configures execution safety bounds.

type AgentList

type AgentList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []Agent `json:"items" yaml:"items"`
}

AgentList is returned by list API calls.

type AgentOverride added in v0.15.0

type AgentOverride struct {
	Prompt   string `json:"prompt,omitempty" yaml:"prompt,omitempty"`
	ModelRef string `json:"model_ref,omitempty" yaml:"model_ref,omitempty"`
}

AgentOverride holds per-agent prompt/model overrides for A/B comparisons.

type AgentPolicy

type AgentPolicy struct {
	APIVersion string          `json:"apiVersion" yaml:"apiVersion"`
	Kind       string          `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta      `json:"metadata" yaml:"metadata"`
	Spec       AgentPolicySpec `json:"spec" yaml:"spec"`
	Status     PolicyStatus    `json:"status,omitempty" yaml:"status,omitempty"`
}

AgentPolicy defines governance limits for runtime behavior.

func ParseAgentPolicyManifest

func ParseAgentPolicyManifest(data []byte) (AgentPolicy, error)

ParseAgentPolicyManifest parses AgentPolicy resources from JSON or constrained YAML.

func (*AgentPolicy) Normalize

func (p *AgentPolicy) Normalize() error

type AgentPolicyList

type AgentPolicyList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []AgentPolicy `json:"items" yaml:"items"`
}

type AgentPolicySpec

type AgentPolicySpec struct {
	MaxTokensPerRun int      `json:"max_tokens_per_run,omitempty" yaml:"max_tokens_per_run,omitempty"`
	AllowedModels   []string `json:"allowed_models,omitempty" yaml:"allowed_models,omitempty"`
	BlockedTools    []string `json:"blocked_tools,omitempty" yaml:"blocked_tools,omitempty"`
	ApplyMode       string   `json:"apply_mode,omitempty" yaml:"apply_mode,omitempty"`
	TargetSystems   []string `json:"target_systems,omitempty" yaml:"target_systems,omitempty"`
	TargetTasks     []string `json:"target_tasks,omitempty" yaml:"target_tasks,omitempty"`
	TargetAgents    []string `json:"target_agents,omitempty" yaml:"target_agents,omitempty"`
	MaxChildDepth   int      `json:"max_child_depth,omitempty" yaml:"max_child_depth,omitempty"`
	MaxChildTasks   int      `json:"max_child_tasks,omitempty" yaml:"max_child_tasks,omitempty"`
}

type AgentRole

type AgentRole struct {
	APIVersion string          `json:"apiVersion" yaml:"apiVersion"`
	Kind       string          `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta      `json:"metadata" yaml:"metadata"`
	Spec       AgentRoleSpec   `json:"spec" yaml:"spec"`
	Status     AgentRoleStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

AgentRole defines reusable permission grants that can be bound to agents.

func ParseAgentRoleManifest

func ParseAgentRoleManifest(data []byte) (AgentRole, error)

ParseAgentRoleManifest parses AgentRole resources from JSON or constrained YAML.

func (*AgentRole) Normalize

func (r *AgentRole) Normalize() error

type AgentRoleList

type AgentRoleList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []AgentRole `json:"items" yaml:"items"`
}

type AgentRoleSpec

type AgentRoleSpec struct {
	Description string   `json:"description,omitempty" yaml:"description,omitempty"`
	Permissions []string `json:"permissions,omitempty" yaml:"permissions,omitempty"`
}

type AgentRoleStatus

type AgentRoleStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type AgentSpec

type AgentSpec struct {
	// Model stores the resolved model id for runtime execution.
	// WARNING: This field is NOT part of the external Agent API (tagged json:"-").
	// It is populated at runtime from ModelRef resolution. Do not set directly
	// in struct literals — use ModelRef instead. Read via Agent.ResolvedModel().
	Model             string             `json:"-" yaml:"-"`
	ModelRef          string             `json:"model_ref,omitempty" yaml:"model_ref,omitempty"`
	FallbackModelRefs []string           `json:"fallback_model_refs,omitempty" yaml:"fallback_model_refs,omitempty"`
	Prompt            string             `json:"prompt" yaml:"prompt"`
	Tools             []string           `json:"tools,omitempty" yaml:"tools,omitempty"`
	AllowedTools      []string           `json:"allowed_tools,omitempty" yaml:"allowed_tools,omitempty"`
	Roles             []string           `json:"roles,omitempty" yaml:"roles,omitempty"`
	Memory            MemorySpec         `json:"memory,omitempty" yaml:"memory,omitempty"`
	Execution         AgentExecutionSpec `json:"execution,omitempty" yaml:"execution,omitempty"`
	Limits            AgentLimits        `json:"limits,omitempty" yaml:"limits,omitempty"`
}

AgentSpec defines desired runtime behavior.

type AgentStatus

type AgentStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

AgentStatus represents current runtime state.

type AgentSystem

type AgentSystem struct {
	APIVersion string            `json:"apiVersion" yaml:"apiVersion"`
	Kind       string            `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta        `json:"metadata" yaml:"metadata"`
	Spec       AgentSystemSpec   `json:"spec" yaml:"spec"`
	Status     AgentSystemStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

AgentSystem defines a multi-agent architecture and execution graph.

func ParseAgentSystemManifest

func ParseAgentSystemManifest(data []byte) (AgentSystem, error)

ParseAgentSystemManifest parses AgentSystem resources from JSON or constrained YAML.

func (*AgentSystem) Normalize

func (a *AgentSystem) Normalize() error

type AgentSystemList

type AgentSystemList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []AgentSystem `json:"items" yaml:"items"`
}

type AgentSystemSpec

type AgentSystemSpec struct {
	Agents           []string              `json:"agents,omitempty" yaml:"agents,omitempty"`
	Graph            map[string]GraphEdge  `json:"graph,omitempty" yaml:"graph,omitempty"`
	CompletionReview *ReviewCheckpointSpec `json:"completion_review,omitempty" yaml:"completion_review,omitempty"`
	ContextAdapter   string                `json:"context_adapter,omitempty" yaml:"context_adapter,omitempty"`
}

type AgentSystemStatus

type AgentSystemStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type ContainerResourceCeiling added in v0.13.0

type ContainerResourceCeiling struct {
	MaxMemory    string
	MaxCPUs      string
	MaxPidsLimit int
}

ContainerResourceCeiling defines operator-level upper bounds for per-tool and per-McpServer container resource overrides. Zero/empty means unbounded.

type ContainerResources added in v0.13.0

type ContainerResources struct {
	Memory    string `json:"memory,omitempty" yaml:"memory,omitempty"`
	CPUs      string `json:"cpus,omitempty" yaml:"cpus,omitempty"`
	PidsLimit int    `json:"pids_limit,omitempty" yaml:"pids_limit,omitempty"`
}

ContainerResources defines per-tool or per-McpServer container resource overrides. When set, these take precedence over the global --tool-container-{memory,cpus,pids-limit} flags.

type ContextAdapter added in v0.12.0

type ContextAdapter struct {
	APIVersion string               `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
	Kind       string               `json:"kind,omitempty" yaml:"kind,omitempty"`
	Metadata   ObjectMeta           `json:"metadata" yaml:"metadata"`
	Spec       ContextAdapterSpec   `json:"spec" yaml:"spec"`
	Status     ContextAdapterStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

ContextAdapter configures a task-time hook that sanitizes task input via a Tool before any agent sees it.

func ParseContextAdapterManifest added in v0.12.0

func ParseContextAdapterManifest(data []byte) (ContextAdapter, error)

ParseContextAdapterManifest parses ContextAdapter resources from JSON or YAML (Kubernetes-style).

func (*ContextAdapter) Normalize added in v0.12.0

func (c *ContextAdapter) Normalize() error

type ContextAdapterList added in v0.12.0

type ContextAdapterList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []ContextAdapter `json:"items" yaml:"items"`
}

type ContextAdapterSpec added in v0.12.0

type ContextAdapterSpec struct {
	ToolRef string `json:"tool_ref" yaml:"tool_ref"`
	OnError string `json:"on_error,omitempty" yaml:"on_error,omitempty"`
}

type ContextAdapterStatus added in v0.12.0

type ContextAdapterStatus struct {
	Phase   string `json:"phase,omitempty" yaml:"phase,omitempty"`
	Message string `json:"message,omitempty" yaml:"message,omitempty"`
}

type EdgeCondition added in v0.8.0

type EdgeCondition struct {
	// OutputContains matches if the output contains this string (case-insensitive).
	OutputContains string `json:"output_contains,omitempty" yaml:"output_contains,omitempty"`
	// OutputNotContains matches if the output does NOT contain this string (case-insensitive).
	OutputNotContains string `json:"output_not_contains,omitempty" yaml:"output_not_contains,omitempty"`
	// OutputMatches matches if the output matches this regex pattern.
	OutputMatches string `json:"output_matches,omitempty" yaml:"output_matches,omitempty"`
	// CompiledOutputMatches is the pre-compiled regex from OutputMatches, populated during normalization.
	CompiledOutputMatches *regexp.Regexp `json:"-" yaml:"-"`
	// Default marks this edge as the fallback when no conditional edge matches.
	Default bool `json:"default,omitempty" yaml:"default,omitempty"`

	// OutputJSONPath extracts a value from JSON output using dot-notation (e.g. "$.route").
	// When set, one of the comparison operators (Equals, NotEquals, Contains, GreaterThan,
	// LessThan) must also be set.
	OutputJSONPath string `json:"output_json_path,omitempty" yaml:"output_json_path,omitempty"`
	// Equals matches when the extracted JSON value equals this string.
	Equals string `json:"equals,omitempty" yaml:"equals,omitempty"`
	// NotEquals matches when the extracted JSON value does NOT equal this string.
	NotEquals string `json:"not_equals,omitempty" yaml:"not_equals,omitempty"`
	// Contains matches when the extracted JSON value (string or array) contains this value.
	Contains string `json:"contains,omitempty" yaml:"contains,omitempty"`
	// GreaterThan matches when the extracted numeric JSON value is greater than this threshold.
	GreaterThan string `json:"greater_than,omitempty" yaml:"greater_than,omitempty"`
	// LessThan matches when the extracted numeric JSON value is less than this threshold.
	LessThan string `json:"less_than,omitempty" yaml:"less_than,omitempty"`
}

EdgeCondition defines a predicate evaluated against the completing agent's output to determine whether a graph edge should fire. All non-empty fields must match (logical AND). Use Default to mark a fallback edge.

type EvalDataset added in v0.15.0

type EvalDataset struct {
	APIVersion string            `json:"apiVersion" yaml:"apiVersion"`
	Kind       string            `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta        `json:"metadata" yaml:"metadata"`
	Spec       EvalDatasetSpec   `json:"spec" yaml:"spec"`
	Status     EvalDatasetStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

EvalDataset is a declarative list of (input, expected output) pairs.

func ParseEvalDatasetManifest added in v0.15.0

func ParseEvalDatasetManifest(data []byte) (EvalDataset, error)

func (*EvalDataset) Normalize added in v0.15.0

func (d *EvalDataset) Normalize() error

type EvalDatasetList added in v0.15.0

type EvalDatasetList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []EvalDataset `json:"items" yaml:"items"`
}

type EvalDatasetSpec added in v0.15.0

type EvalDatasetSpec struct {
	Description string       `json:"description,omitempty" yaml:"description,omitempty"`
	Samples     []EvalSample `json:"samples" yaml:"samples"`
}

type EvalDatasetStatus added in v0.15.0

type EvalDatasetStatus struct {
	Phase string `json:"phase,omitempty" yaml:"phase,omitempty"`
}

type EvalExpected added in v0.15.0

type EvalExpected struct {
	OutputContains    string `json:"output_contains,omitempty" yaml:"output_contains,omitempty"`
	OutputNotContains string `json:"output_not_contains,omitempty" yaml:"output_not_contains,omitempty"`
	OutputMatches     string `json:"output_matches,omitempty" yaml:"output_matches,omitempty"`
	OutputJSONPath    string `json:"output_json_path,omitempty" yaml:"output_json_path,omitempty"`
	Equals            string `json:"equals,omitempty" yaml:"equals,omitempty"`
	NotEquals         string `json:"not_equals,omitempty" yaml:"not_equals,omitempty"`
	Contains          string `json:"contains,omitempty" yaml:"contains,omitempty"`
	GreaterThan       string `json:"greater_than,omitempty" yaml:"greater_than,omitempty"`
	LessThan          string `json:"less_than,omitempty" yaml:"less_than,omitempty"`
}

EvalExpected mirrors EdgeCondition semantics for deterministic output matching.

func (EvalExpected) IsEmpty added in v0.15.0

func (e EvalExpected) IsEmpty() bool

type EvalRun added in v0.15.0

type EvalRun struct {
	APIVersion string        `json:"apiVersion" yaml:"apiVersion"`
	Kind       string        `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta    `json:"metadata" yaml:"metadata"`
	Spec       EvalRunSpec   `json:"spec" yaml:"spec"`
	Status     EvalRunStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

EvalRun represents a single evaluation execution.

func ParseEvalRunManifest added in v0.15.0

func ParseEvalRunManifest(data []byte) (EvalRun, error)

func (*EvalRun) Normalize added in v0.15.0

func (r *EvalRun) Normalize() error

type EvalRunList added in v0.15.0

type EvalRunList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []EvalRun `json:"items" yaml:"items"`
}

type EvalRunSpec added in v0.15.0

type EvalRunSpec struct {
	DatasetRef            string                   `json:"dataset_ref" yaml:"dataset_ref"`
	System                string                   `json:"system" yaml:"system"`
	ModelEndpointOverride string                   `json:"model_endpoint_override,omitempty" yaml:"model_endpoint_override,omitempty"`
	AgentOverrides        map[string]AgentOverride `json:"agent_overrides,omitempty" yaml:"agent_overrides,omitempty"`
	Scoring               EvalScoringConfig        `json:"scoring,omitempty" yaml:"scoring,omitempty"`
	Concurrency           int                      `json:"concurrency,omitempty" yaml:"concurrency,omitempty"`
	Timeout               string                   `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	Labels                map[string]string        `json:"labels,omitempty" yaml:"labels,omitempty"`
	Suspended             bool                     `json:"suspended,omitempty" yaml:"suspended,omitempty"`
}

type EvalRunStatus added in v0.15.0

type EvalRunStatus struct {
	Phase             string             `json:"phase,omitempty" yaml:"phase,omitempty"`
	TotalSamples      int                `json:"totalSamples,omitempty" yaml:"totalSamples,omitempty"`
	CompletedSamples  int                `json:"completedSamples,omitempty" yaml:"completedSamples,omitempty"`
	PassedSamples     int                `json:"passedSamples,omitempty" yaml:"passedSamples,omitempty"`
	FailedSamples     int                `json:"failedSamples,omitempty" yaml:"failedSamples,omitempty"`
	ErroredSamples    int                `json:"erroredSamples,omitempty" yaml:"erroredSamples,omitempty"`
	Results           []EvalSampleResult `json:"results,omitempty" yaml:"results,omitempty"`
	Summary           EvalSummary        `json:"summary,omitempty" yaml:"summary,omitempty"`
	DatasetGeneration int64              `json:"datasetGeneration,omitempty" yaml:"datasetGeneration,omitempty"`
	StartedAt         string             `json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
	CompletedAt       string             `json:"completedAt,omitempty" yaml:"completedAt,omitempty"`
	CancelledAt       string             `json:"cancelledAt,omitempty" yaml:"cancelledAt,omitempty"`
}

type EvalSample added in v0.15.0

type EvalSample struct {
	Name     string             `json:"name" yaml:"name"`
	Input    map[string]string  `json:"input" yaml:"input"`
	Expected EvalExpected       `json:"expected,omitempty" yaml:"expected,omitempty"`
	Scoring  *EvalScoringConfig `json:"scoring,omitempty" yaml:"scoring,omitempty"`
}

EvalSample represents a single evaluation sample within a dataset.

type EvalSampleResult added in v0.15.0

type EvalSampleResult struct {
	SampleName string   `json:"sample_name" yaml:"sample_name"`
	TaskName   string   `json:"task_name,omitempty" yaml:"task_name,omitempty"`
	Score      *float64 `json:"score" yaml:"score"`
	Pass       *bool    `json:"pass" yaml:"pass"`
	Error      string   `json:"error,omitempty" yaml:"error,omitempty"`
	Latency    string   `json:"latency,omitempty" yaml:"latency,omitempty"`
	Tokens     int      `json:"tokens,omitempty" yaml:"tokens,omitempty"`
	Output     string   `json:"output,omitempty" yaml:"output,omitempty"`
	Reasoning  string   `json:"reasoning,omitempty" yaml:"reasoning,omitempty"`
	Comment    string   `json:"comment,omitempty" yaml:"comment,omitempty"`
}

EvalSampleResult holds the outcome for a single evaluated sample.

type EvalScoringConfig added in v0.15.0

type EvalScoringConfig struct {
	Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"`
	ModelRef string `json:"model_ref,omitempty" yaml:"model_ref,omitempty"`
	Rubric   string `json:"rubric,omitempty" yaml:"rubric,omitempty"`
	ToolRef  string `json:"tool_ref,omitempty" yaml:"tool_ref,omitempty"`
}

EvalScoringConfig configures how a sample or run is scored.

type EvalSummary added in v0.15.0

type EvalSummary struct {
	PassRate    float64 `json:"pass_rate,omitempty" yaml:"pass_rate,omitempty"`
	MeanScore   float64 `json:"mean_score,omitempty" yaml:"mean_score,omitempty"`
	P50Latency  string  `json:"p50_latency,omitempty" yaml:"p50_latency,omitempty"`
	P95Latency  string  `json:"p95_latency,omitempty" yaml:"p95_latency,omitempty"`
	TotalTokens int     `json:"total_tokens,omitempty" yaml:"total_tokens,omitempty"`
	TotalCost   float64 `json:"total_cost,omitempty" yaml:"total_cost,omitempty"`
}

EvalSummary holds aggregate metrics for a completed eval run.

func ComputeEvalSummary added in v0.15.0

func ComputeEvalSummary(results []EvalSampleResult) EvalSummary

ComputeEvalSummary calculates aggregate metrics from a set of sample results.

type GraphEdge

type GraphEdge struct {
	// Legacy single-hop edge. Preserved for backward compatibility.
	Next string `json:"next,omitempty" yaml:"next,omitempty"`
	// Rich edge list for fan-out and per-edge metadata.
	Edges []GraphRoute `json:"edges,omitempty" yaml:"edges,omitempty"`
	// Join semantics for this downstream node.
	Join GraphJoin `json:"join,omitempty" yaml:"join,omitempty"`
	// Delegates dispatched after the node's first execution. Reports
	// flow back and trigger a review re-execution before edges fire.
	Delegates []GraphRoute `json:"delegates,omitempty" yaml:"delegates,omitempty"`
	// DelegateJoin controls how delegate returns are collected.
	DelegateJoin GraphJoin `json:"delegate_join,omitempty" yaml:"delegate_join,omitempty"`
	// Review gates this node's output behind a human approval checkpoint.
	Review *ReviewCheckpointSpec `json:"review,omitempty" yaml:"review,omitempty"`
}

type GraphJoin

type GraphJoin struct {
	// Mode: wait_for_all | quorum.
	Mode string `json:"mode,omitempty" yaml:"mode,omitempty"`
	// QuorumCount is an absolute minimum number of upstream branches.
	QuorumCount int `json:"quorum_count,omitempty" yaml:"quorum_count,omitempty"`
	// QuorumPercent is percentage-based minimum of expected branches (0-100).
	QuorumPercent int `json:"quorum_percent,omitempty" yaml:"quorum_percent,omitempty"`
	// OnFailure: deadletter | skip | continue_partial.
	OnFailure string `json:"on_failure,omitempty" yaml:"on_failure,omitempty"`
}

func NormalizeGraphJoin

func NormalizeGraphJoin(join GraphJoin) (GraphJoin, error)

NormalizeGraphJoin applies defaults and validates join configuration.

type GraphRoute

type GraphRoute struct {
	To string `json:"to,omitempty" yaml:"to,omitempty"`
	// Optional labels used by routing/observability layers.
	Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	// Optional policy key/value bag for edge-level controls.
	Policy map[string]string `json:"policy,omitempty" yaml:"policy,omitempty"`
	// Optional condition that must match the completing agent's output for this edge to fire.
	Condition *EdgeCondition `json:"condition,omitempty" yaml:"condition,omitempty"`
}

func FilterRoutesForOutput added in v0.8.0

func FilterRoutesForOutput(routes []GraphRoute, output string) []GraphRoute

FilterRoutesForOutput applies edge conditions against the completing agent's output and returns only the routes that should fire. When no edges carry conditions the full set is returned (backward-compatible). When conditions are present: matched conditional edges fire first; if none match, default edges fire; if no defaults exist either, an empty slice is returned (the task completes at this node).

func GraphOutgoingRoutes

func GraphOutgoingRoutes(node GraphEdge) []GraphRoute

GraphOutgoingRoutes returns normalized outgoing routes in deterministic order. Legacy next is treated as the first route and deduplicated against edges[*].to.

type ListMeta

type ListMeta struct {
	Continue string `json:"continue,omitempty" yaml:"continue,omitempty"`
}

ListMeta carries pagination metadata in list responses. Continue holds the cursor (last item's name) for the next page; empty means no more results.

type McpReconnectPolicy

type McpReconnectPolicy struct {
	MaxAttempts int    `json:"max_attempts,omitempty" yaml:"max_attempts,omitempty"`
	Backoff     string `json:"backoff,omitempty" yaml:"backoff,omitempty"`
}

type McpServer

type McpServer struct {
	APIVersion string          `json:"apiVersion" yaml:"apiVersion"`
	Kind       string          `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta      `json:"metadata" yaml:"metadata"`
	Spec       McpServerSpec   `json:"spec" yaml:"spec"`
	Status     McpServerStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

McpServer declares an MCP (Model Context Protocol) server connection. The controller connects to the server, discovers tools via tools/list, and auto-generates Tool resources for each discovered tool.

func ParseMcpServerManifest

func ParseMcpServerManifest(data []byte) (McpServer, error)

ParseMcpServerManifest parses McpServer resources from JSON or constrained YAML.

func (*McpServer) Normalize

func (m *McpServer) Normalize() error

type McpServerEnvVar

type McpServerEnvVar struct {
	Name      string `json:"name" yaml:"name"`
	Value     string `json:"value,omitempty" yaml:"value,omitempty"`
	SecretRef string `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
	MountPath string `json:"mountPath,omitempty" yaml:"mountPath,omitempty"`
}

type McpServerList

type McpServerList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []McpServer `json:"items" yaml:"items"`
}

type McpServerSpec

type McpServerSpec struct {
	Transport          string             `json:"transport" yaml:"transport"`
	Command            string             `json:"command,omitempty" yaml:"command,omitempty"`
	Args               []string           `json:"args,omitempty" yaml:"args,omitempty"`
	Env                []McpServerEnvVar  `json:"env,omitempty" yaml:"env,omitempty"`
	Endpoint           string             `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
	Image              string             `json:"image,omitempty" yaml:"image,omitempty"`
	ImagePullSecret    string             `json:"image_pull_secret,omitempty" yaml:"image_pull_secret,omitempty"`
	IdleTimeout        string             `json:"idle_timeout,omitempty" yaml:"idle_timeout,omitempty"`
	Auth               ToolAuth           `json:"auth,omitempty" yaml:"auth,omitempty"`
	ToolFilter         McpToolFilter      `json:"tool_filter,omitempty" yaml:"tool_filter,omitempty"`
	Reconnect          McpReconnectPolicy `json:"reconnect,omitempty" yaml:"reconnect,omitempty"`
	Resources          ContainerResources `json:"resources,omitempty" yaml:"resources,omitempty"`
	DefaultToolRuntime *ToolRuntimePolicy `json:"default_tool_runtime,omitempty" yaml:"default_tool_runtime,omitempty"`
}

type McpServerStatus

type McpServerStatus struct {
	Phase              string   `json:"phase,omitempty" yaml:"phase,omitempty"`
	DiscoveredTools    []string `json:"discoveredTools,omitempty" yaml:"discoveredTools,omitempty"`
	GeneratedTools     []string `json:"generatedTools,omitempty" yaml:"generatedTools,omitempty"`
	LastSyncedAt       string   `json:"lastSyncedAt,omitempty" yaml:"lastSyncedAt,omitempty"`
	LastError          string   `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64    `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type McpToolFilter

type McpToolFilter struct {
	Include []string `json:"include,omitempty" yaml:"include,omitempty"`
}

type Memory

type Memory struct {
	APIVersion string       `json:"apiVersion" yaml:"apiVersion"`
	Kind       string       `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta   `json:"metadata" yaml:"metadata"`
	Spec       MemoryConfig `json:"spec" yaml:"spec"`
	Status     MemoryStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Memory defines persistent storage configuration for agents.

func ParseMemoryManifest

func ParseMemoryManifest(data []byte) (Memory, error)

ParseMemoryManifest parses Memory resources from JSON or constrained YAML.

func (*Memory) Normalize

func (m *Memory) Normalize() error

type MemoryAuthConfig

type MemoryAuthConfig struct {
	SecretRef string `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
}

type MemoryConfig

type MemoryConfig struct {
	Type              string           `json:"type,omitempty" yaml:"type,omitempty"`
	Provider          string           `json:"provider,omitempty" yaml:"provider,omitempty"`
	EmbeddingModel    string           `json:"embedding_model,omitempty" yaml:"embedding_model,omitempty"`
	Endpoint          string           `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
	EndpointSecretRef string           `json:"endpoint_secret_ref,omitempty" yaml:"endpoint_secret_ref,omitempty"`
	Auth              MemoryAuthConfig `json:"auth,omitempty" yaml:"auth,omitempty"`
}

type MemoryList

type MemoryList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []Memory `json:"items" yaml:"items"`
}

type MemorySpec

type MemorySpec struct {
	Ref      string   `json:"ref,omitempty" yaml:"ref,omitempty"`
	Type     string   `json:"type,omitempty" yaml:"type,omitempty"`
	Provider string   `json:"provider,omitempty" yaml:"provider,omitempty"`
	Allow    []string `json:"allow,omitempty" yaml:"allow,omitempty"`
}

MemorySpec configures runtime memory backend.

type MemoryStatus

type MemoryStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type ModelEndpoint

type ModelEndpoint struct {
	APIVersion string              `json:"apiVersion"`
	Kind       string              `json:"kind"`
	Metadata   ObjectMeta          `json:"metadata"`
	Spec       ModelEndpointSpec   `json:"spec"`
	Status     ModelEndpointStatus `json:"status,omitempty"`
}

ModelEndpoint declares a model-provider endpoint for agent runtime routing.

func ParseModelEndpointManifest

func ParseModelEndpointManifest(data []byte) (ModelEndpoint, error)

ParseModelEndpointManifest parses ModelEndpoint resources from JSON or constrained YAML.

func ResolveAgentModelRef

func ResolveAgentModelRef(ctx context.Context, defaultNamespace string, modelRef string, endpoints ModelEndpointLookup) (ModelEndpoint, string, error)

ResolveAgentModelRef resolves an agent model_ref to a concrete endpoint and model identifier.

func (*ModelEndpoint) Normalize

func (m *ModelEndpoint) Normalize() error

type ModelEndpointAuth

type ModelEndpointAuth struct {
	SecretRef string `json:"secretRef,omitempty"`
}

type ModelEndpointList

type ModelEndpointList struct {
	ListMeta `json:",inline"`
	Items    []ModelEndpoint `json:"items"`
}

type ModelEndpointLookup

type ModelEndpointLookup interface {
	Get(ctx context.Context, name string) (ModelEndpoint, bool, error)
}

ModelEndpointLookup resolves model endpoints by scoped name (namespace/name).

type ModelEndpointSpec

type ModelEndpointSpec struct {
	Provider     string            `json:"provider,omitempty"`
	BaseURL      string            `json:"base_url,omitempty"`
	DefaultModel string            `json:"default_model,omitempty"`
	Options      map[string]string `json:"options,omitempty"`
	Auth         ModelEndpointAuth `json:"auth,omitempty"`
	// AllowPrivate permits outbound connections from this endpoint's
	// model gateway to trusted local/private model servers, including
	// loopback, RFC 1918 / ULA, and carrier-grade NAT addresses (e.g.
	// Ollama, vLLM, LM Studio, or LiteLLM). Link-local, cloud metadata,
	// and unspecified addresses remain blocked regardless.
	//
	// Pointer so that the schema can distinguish "unset" (defaulted by
	// provider) from explicit true/false. Defaults: ollama -> true,
	// everything else -> false.
	AllowPrivate *bool `json:"allowPrivate,omitempty"`
}

type ModelEndpointStatus

type ModelEndpointStatus struct {
	Phase              string `json:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty"`
}

type ObjectMeta

type ObjectMeta struct {
	Name            string            `json:"name" yaml:"name"`
	Namespace       string            `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Labels          map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations     map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	ResourceVersion string            `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
	Generation      int64             `json:"generation,omitempty" yaml:"generation,omitempty"`
	CreatedAt       string            `json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
}

ObjectMeta stores metadata for a resource.

type OperationRule

type OperationRule struct {
	OperationClass string `json:"operation_class,omitempty" yaml:"operation_class,omitempty"`
	Verdict        string `json:"verdict,omitempty" yaml:"verdict,omitempty"`
}

type PolicyStatus

type PolicyStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type ReviewCheckpointSpec added in v0.10.0

type ReviewCheckpointSpec struct {
	CheckpointID        string `json:"checkpoint_id,omitempty" yaml:"checkpoint_id,omitempty"`
	DisplayName         string `json:"display_name,omitempty" yaml:"display_name,omitempty"`
	Reason              string `json:"reason,omitempty" yaml:"reason,omitempty"`
	TTL                 string `json:"ttl,omitempty" yaml:"ttl,omitempty"`
	AllowRequestChanges *bool  `json:"allow_request_changes,omitempty" yaml:"allow_request_changes,omitempty"`
	MaxReviewCycles     int    `json:"max_review_cycles,omitempty" yaml:"max_review_cycles,omitempty"`
}

type SealedSecret added in v0.11.0

type SealedSecret struct {
	APIVersion string             `json:"apiVersion"`
	Kind       string             `json:"kind"`
	Metadata   ObjectMeta         `json:"metadata"`
	Spec       SealedSecretSpec   `json:"spec"`
	Status     SealedSecretStatus `json:"status,omitempty"`
}

func ParseSealedSecretManifest added in v0.11.0

func ParseSealedSecretManifest(data []byte) (SealedSecret, error)

func SealSecret added in v0.11.0

func SealSecret(secret Secret, keyID string, publicKey *rsa.PublicKey) (SealedSecret, error)

func (*SealedSecret) Normalize added in v0.11.0

func (s *SealedSecret) Normalize() error

type SealedSecretList added in v0.11.0

type SealedSecretList struct {
	ListMeta `json:",inline"`
	Items    []SealedSecret `json:"items"`
}

type SealedSecretSpec added in v0.11.0

type SealedSecretSpec struct {
	EncryptedData map[string]SealedValue     `json:"encryptedData,omitempty"`
	Template      SealedSecretTemplateSecret `json:"template,omitempty"`
}

type SealedSecretStatus added in v0.11.0

type SealedSecretStatus struct {
	Phase              string `json:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty"`
}

type SealedSecretTemplateSecret added in v0.11.0

type SealedSecretTemplateSecret struct {
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type SealedValue added in v0.11.0

type SealedValue struct {
	KeyID      string `json:"keyId,omitempty"`
	WrappedKey string `json:"wrappedKey,omitempty"`
	Ciphertext string `json:"ciphertext,omitempty"`
}

type SealingKeyMaterial added in v0.11.0

type SealingKeyMaterial struct {
	KeyID         string
	PublicKeyPEM  string
	PrivateKeyPEM string
	PublicKey     *rsa.PublicKey
	PrivateKey    *rsa.PrivateKey
}

func GenerateSealingKeyMaterial added in v0.11.0

func GenerateSealingKeyMaterial() (SealingKeyMaterial, error)

type Secret

type Secret struct {
	APIVersion string       `json:"apiVersion" yaml:"apiVersion"`
	Kind       string       `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta   `json:"metadata" yaml:"metadata"`
	Spec       SecretSpec   `json:"spec" yaml:"spec"`
	Status     SecretStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Secret stores sensitive values for runtime tool auth. Data values are base64-encoded (Kubernetes style).

func ParseSecretManifest

func ParseSecretManifest(data []byte) (Secret, error)

ParseSecretManifest parses Secret resources from JSON or constrained YAML.

func ParseSecretManifestForPut added in v0.5.0

func ParseSecretManifestForPut(data []byte, current Secret) (Secret, error)

ParseSecretManifestForPut parses a Secret PUT body and merges API redaction placeholders using current stored values.

func UnsealSealedSecret added in v0.11.0

func UnsealSealedSecret(item SealedSecret, expectedKeyID string, privateKey *rsa.PrivateKey) (Secret, error)

func (*Secret) Normalize

func (s *Secret) Normalize() error

type SecretList

type SecretList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []Secret `json:"items" yaml:"items"`
}

type SecretSpec

type SecretSpec struct {
	Data       map[string]string `json:"data,omitempty" yaml:"data,omitempty"`
	StringData map[string]string `json:"stringData,omitempty" yaml:"stringData,omitempty"`
}

type SecretStatus

type SecretStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type Task

type Task struct {
	APIVersion string     `json:"apiVersion" yaml:"apiVersion"`
	Kind       string     `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta `json:"metadata" yaml:"metadata"`
	Spec       TaskSpec   `json:"spec" yaml:"spec"`
	Status     TaskStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Task defines one execution request routed to an AgentSystem.

func ParseTaskManifest

func ParseTaskManifest(data []byte) (Task, error)

ParseTaskManifest parses Task resources from JSON or constrained YAML.

func (Task) DeepCopy added in v0.10.0

func (t Task) DeepCopy() Task

func (*Task) Normalize

func (t *Task) Normalize() error

type TaskApproval added in v0.10.0

type TaskApproval struct {
	APIVersion string             `json:"apiVersion" yaml:"apiVersion"`
	Kind       string             `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta         `json:"metadata" yaml:"metadata"`
	Spec       TaskApprovalSpec   `json:"spec" yaml:"spec"`
	Status     TaskApprovalStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

TaskApproval captures a pending human review checkpoint for agent or task output.

func ParseTaskApprovalManifest added in v0.10.0

func ParseTaskApprovalManifest(data []byte) (TaskApproval, error)

ParseTaskApprovalManifest parses TaskApproval resources from JSON or constrained YAML.

func (*TaskApproval) Normalize added in v0.10.0

func (a *TaskApproval) Normalize() error

type TaskApprovalList added in v0.10.0

type TaskApprovalList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []TaskApproval `json:"items" yaml:"items"`
}

type TaskApprovalResumeContext added in v0.10.0

type TaskApprovalResumeContext struct {
	Mode              string                      `json:"mode,omitempty" yaml:"mode,omitempty"`
	Action            string                      `json:"action,omitempty" yaml:"action,omitempty"`
	System            string                      `json:"system,omitempty" yaml:"system,omitempty"`
	ProducingAgent    string                      `json:"producing_agent,omitempty" yaml:"producing_agent,omitempty"`
	CurrentMessage    *TaskApprovalResumeMessage  `json:"current_message,omitempty" yaml:"current_message,omitempty"`
	NextMessages      []TaskApprovalResumeMessage `json:"next_messages,omitempty" yaml:"next_messages,omitempty"`
	RerunMessage      *TaskApprovalResumeMessage  `json:"rerun_message,omitempty" yaml:"rerun_message,omitempty"`
	RuntimeInput      map[string]string           `json:"runtime_input,omitempty" yaml:"runtime_input,omitempty"`
	NextRuntimeInput  map[string]string           `json:"next_runtime_input,omitempty" yaml:"next_runtime_input,omitempty"`
	Output            map[string]string           `json:"output,omitempty" yaml:"output,omitempty"`
	CurrentAgentIndex int                         `json:"current_agent_index,omitempty" yaml:"current_agent_index,omitempty"`
	NextAgentIndex    int                         `json:"next_agent_index,omitempty" yaml:"next_agent_index,omitempty"`
}

func DecodeTaskApprovalResumeContext added in v0.10.0

func DecodeTaskApprovalResumeContext(data map[string]any) (TaskApprovalResumeContext, error)

type TaskApprovalResumeMessage added in v0.10.0

type TaskApprovalResumeMessage struct {
	MessageID      string `json:"message_id,omitempty" yaml:"message_id,omitempty"`
	IdempotencyKey string `json:"idempotency_key,omitempty" yaml:"idempotency_key,omitempty"`
	TaskID         string `json:"task_id,omitempty" yaml:"task_id,omitempty"`
	Attempt        int    `json:"attempt,omitempty" yaml:"attempt,omitempty"`
	System         string `json:"system,omitempty" yaml:"system,omitempty"`
	Namespace      string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	FromAgent      string `json:"from_agent,omitempty" yaml:"from_agent,omitempty"`
	ToAgent        string `json:"to_agent,omitempty" yaml:"to_agent,omitempty"`
	BranchID       string `json:"branch_id,omitempty" yaml:"branch_id,omitempty"`
	ParentBranchID string `json:"parent_branch_id,omitempty" yaml:"parent_branch_id,omitempty"`
	Type           string `json:"type,omitempty" yaml:"type,omitempty"`
	Payload        string `json:"payload,omitempty" yaml:"payload,omitempty"`
	Timestamp      string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	TraceID        string `json:"trace_id,omitempty" yaml:"trace_id,omitempty"`
	ParentID       string `json:"parent_id,omitempty" yaml:"parent_id,omitempty"`
	DelegateOf     string `json:"delegate_of,omitempty" yaml:"delegate_of,omitempty"`
}

type TaskApprovalSpec added in v0.10.0

type TaskApprovalSpec struct {
	TaskRef             string         `json:"task_ref" yaml:"task_ref"`
	CheckpointID        string         `json:"checkpoint_id" yaml:"checkpoint_id"`
	CheckpointType      string         `json:"checkpoint_type,omitempty" yaml:"checkpoint_type,omitempty"`
	Agent               string         `json:"agent,omitempty" yaml:"agent,omitempty"`
	Reason              string         `json:"reason,omitempty" yaml:"reason,omitempty"`
	TTL                 string         `json:"ttl,omitempty" yaml:"ttl,omitempty"`
	AllowRequestChanges *bool          `json:"allow_request_changes,omitempty" yaml:"allow_request_changes,omitempty"`
	MaxReviewCycles     int            `json:"max_review_cycles,omitempty" yaml:"max_review_cycles,omitempty"`
	ReviewCycle         int            `json:"review_cycle,omitempty" yaml:"review_cycle,omitempty"`
	Supersedes          string         `json:"supersedes,omitempty" yaml:"supersedes,omitempty"`
	Output              any            `json:"output,omitempty" yaml:"output,omitempty"`
	OutputFormat        string         `json:"output_format,omitempty" yaml:"output_format,omitempty"`
	ResumeContext       map[string]any `json:"resume_context,omitempty" yaml:"resume_context,omitempty"`
}

type TaskApprovalStatus added in v0.10.0

type TaskApprovalStatus struct {
	Phase     string `json:"phase,omitempty" yaml:"phase,omitempty"`
	Decision  string `json:"decision,omitempty" yaml:"decision,omitempty"`
	DecidedBy string `json:"decided_by,omitempty" yaml:"decided_by,omitempty"`
	DecidedAt string `json:"decided_at,omitempty" yaml:"decided_at,omitempty"`
	Comment   string `json:"comment,omitempty" yaml:"comment,omitempty"`
	ExpiresAt string `json:"expires_at,omitempty" yaml:"expires_at,omitempty"`
}

type TaskBlockedOn added in v0.10.0

type TaskBlockedOn struct {
	Kind   string `json:"kind,omitempty" yaml:"kind,omitempty"`
	Name   string `json:"name,omitempty" yaml:"name,omitempty"`
	Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
}

type TaskDelegationState added in v0.8.0

type TaskDelegationState struct {
	Attempt        int              `json:"attempt,omitempty" yaml:"attempt,omitempty"`
	Node           string           `json:"node,omitempty" yaml:"node,omitempty"`
	Mode           string           `json:"mode,omitempty" yaml:"mode,omitempty"`
	Expected       int              `json:"expected,omitempty" yaml:"expected,omitempty"`
	QuorumRequired int              `json:"quorum_required,omitempty" yaml:"quorum_required,omitempty"`
	Activated      bool             `json:"activated,omitempty" yaml:"activated,omitempty"`
	ActivatedAt    string           `json:"activated_at,omitempty" yaml:"activated_at,omitempty"`
	ActivatedBy    string           `json:"activated_by,omitempty" yaml:"activated_by,omitempty"`
	Sources        []TaskJoinSource `json:"sources,omitempty" yaml:"sources,omitempty"`
}

type TaskHistoryEvent

type TaskHistoryEvent struct {
	Timestamp string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	Type      string `json:"type,omitempty" yaml:"type,omitempty"`
	Worker    string `json:"worker,omitempty" yaml:"worker,omitempty"`
	Message   string `json:"message,omitempty" yaml:"message,omitempty"`
}

type TaskJoinSource

type TaskJoinSource struct {
	MessageID string `json:"message_id,omitempty" yaml:"message_id,omitempty"`
	FromAgent string `json:"from_agent,omitempty" yaml:"from_agent,omitempty"`
	BranchID  string `json:"branch_id,omitempty" yaml:"branch_id,omitempty"`
	Timestamp string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	Payload   string `json:"payload,omitempty" yaml:"payload,omitempty"`
}

type TaskJoinState

type TaskJoinState struct {
	Attempt        int              `json:"attempt,omitempty" yaml:"attempt,omitempty"`
	Node           string           `json:"node,omitempty" yaml:"node,omitempty"`
	Mode           string           `json:"mode,omitempty" yaml:"mode,omitempty"`
	Expected       int              `json:"expected,omitempty" yaml:"expected,omitempty"`
	QuorumRequired int              `json:"quorum_required,omitempty" yaml:"quorum_required,omitempty"`
	Activated      bool             `json:"activated,omitempty" yaml:"activated,omitempty"`
	ActivatedAt    string           `json:"activated_at,omitempty" yaml:"activated_at,omitempty"`
	ActivatedBy    string           `json:"activated_by,omitempty" yaml:"activated_by,omitempty"`
	Sources        []TaskJoinSource `json:"sources,omitempty" yaml:"sources,omitempty"`
}

type TaskList

type TaskList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []Task `json:"items" yaml:"items"`
}

type TaskMessage

type TaskMessage struct {
	Timestamp      string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	MessageID      string `json:"message_id,omitempty" yaml:"message_id,omitempty"`
	IdempotencyKey string `json:"idempotency_key,omitempty" yaml:"idempotency_key,omitempty"`
	TaskID         string `json:"task_id,omitempty" yaml:"task_id,omitempty"`
	Attempt        int    `json:"attempt,omitempty" yaml:"attempt,omitempty"`
	System         string `json:"system,omitempty" yaml:"system,omitempty"`
	FromAgent      string `json:"from_agent,omitempty" yaml:"from_agent,omitempty"`
	ToAgent        string `json:"to_agent,omitempty" yaml:"to_agent,omitempty"`
	BranchID       string `json:"branch_id,omitempty" yaml:"branch_id,omitempty"`
	ParentBranchID string `json:"parent_branch_id,omitempty" yaml:"parent_branch_id,omitempty"`
	Type           string `json:"type,omitempty" yaml:"type,omitempty"`
	Content        string `json:"content,omitempty" yaml:"content,omitempty"`
	TraceID        string `json:"trace_id,omitempty" yaml:"trace_id,omitempty"`
	ParentID       string `json:"parent_id,omitempty" yaml:"parent_id,omitempty"`
	Phase          string `json:"phase,omitempty" yaml:"phase,omitempty"`
	Attempts       int    `json:"attempts,omitempty" yaml:"attempts,omitempty"`
	MaxAttempts    int    `json:"max_attempts,omitempty" yaml:"max_attempts,omitempty"`
	LastError      string `json:"last_error,omitempty" yaml:"last_error,omitempty"`
	Worker         string `json:"worker,omitempty" yaml:"worker,omitempty"`
	ProcessedAt    string `json:"processed_at,omitempty" yaml:"processed_at,omitempty"`
	NextAttemptAt  string `json:"next_attempt_at,omitempty" yaml:"next_attempt_at,omitempty"`
	DelegateOf     string `json:"delegate_of,omitempty" yaml:"delegate_of,omitempty"`
}

type TaskMessageIdempotency

type TaskMessageIdempotency struct {
	Key       string `json:"key,omitempty" yaml:"key,omitempty"`
	MessageID string `json:"message_id,omitempty" yaml:"message_id,omitempty"`
	State     string `json:"state,omitempty" yaml:"state,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	ExpiresAt string `json:"expires_at,omitempty" yaml:"expires_at,omitempty"`
	Worker    string `json:"worker,omitempty" yaml:"worker,omitempty"`
}

type TaskMessageRetryPolicy

type TaskMessageRetryPolicy struct {
	MaxAttempts  int      `json:"max_attempts,omitempty" yaml:"max_attempts,omitempty"`
	Backoff      string   `json:"backoff,omitempty" yaml:"backoff,omitempty"`
	MaxBackoff   string   `json:"max_backoff,omitempty" yaml:"max_backoff,omitempty"`
	Jitter       string   `json:"jitter,omitempty" yaml:"jitter,omitempty"`
	NonRetryable []string `json:"non_retryable,omitempty" yaml:"non_retryable,omitempty"`
}

type TaskRequirements

type TaskRequirements struct {
	Region string `json:"region,omitempty" yaml:"region,omitempty"`
	GPU    bool   `json:"gpu,omitempty" yaml:"gpu,omitempty"`
	Model  string `json:"model,omitempty" yaml:"model,omitempty"`
}

type TaskRetryPolicy

type TaskRetryPolicy struct {
	MaxAttempts int    `json:"max_attempts,omitempty" yaml:"max_attempts,omitempty"`
	Backoff     string `json:"backoff,omitempty" yaml:"backoff,omitempty"`
}

type TaskSchedule

type TaskSchedule struct {
	APIVersion string             `json:"apiVersion" yaml:"apiVersion"`
	Kind       string             `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta         `json:"metadata" yaml:"metadata"`
	Spec       TaskScheduleSpec   `json:"spec" yaml:"spec"`
	Status     TaskScheduleStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

TaskSchedule defines recurring task creation from a template task.

func ParseTaskScheduleManifest

func ParseTaskScheduleManifest(data []byte) (TaskSchedule, error)

ParseTaskScheduleManifest parses TaskSchedule resources from JSON or constrained YAML.

func (*TaskSchedule) Normalize

func (t *TaskSchedule) Normalize() error

type TaskScheduleList

type TaskScheduleList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []TaskSchedule `json:"items" yaml:"items"`
}

type TaskScheduleSpec

type TaskScheduleSpec struct {
	TaskRef                 string    `json:"task_ref,omitempty" yaml:"task_ref,omitempty"`
	TaskTemplate            *TaskSpec `json:"task_template,omitempty" yaml:"task_template,omitempty"`
	Schedule                string    `json:"schedule,omitempty" yaml:"schedule,omitempty"`
	TimeZone                string    `json:"time_zone,omitempty" yaml:"time_zone,omitempty"`
	Suspend                 bool      `json:"suspend,omitempty" yaml:"suspend,omitempty"`
	StartingDeadlineSeconds int       `json:"starting_deadline_seconds,omitempty" yaml:"starting_deadline_seconds,omitempty"`
	ConcurrencyPolicy       string    `json:"concurrency_policy,omitempty" yaml:"concurrency_policy,omitempty"`
	SuccessfulHistoryLimit  int       `json:"successful_history_limit,omitempty" yaml:"successful_history_limit,omitempty"`
	FailedHistoryLimit      int       `json:"failed_history_limit,omitempty" yaml:"failed_history_limit,omitempty"`
}

type TaskScheduleStatus

type TaskScheduleStatus struct {
	Phase              string   `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string   `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	LastScheduleTime   string   `json:"lastScheduleTime,omitempty" yaml:"lastScheduleTime,omitempty"`
	LastSuccessfulTime string   `json:"lastSuccessfulTime,omitempty" yaml:"lastSuccessfulTime,omitempty"`
	NextScheduleTime   string   `json:"nextScheduleTime,omitempty" yaml:"nextScheduleTime,omitempty"`
	LastTriggeredTask  string   `json:"lastTriggeredTask,omitempty" yaml:"lastTriggeredTask,omitempty"`
	ActiveRuns         []string `json:"activeRuns,omitempty" yaml:"activeRuns,omitempty"`
	ObservedGeneration int64    `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type TaskSpec

type TaskSpec struct {
	System       string                 `json:"system,omitempty" yaml:"system,omitempty"`
	Mode         string                 `json:"mode,omitempty" yaml:"mode,omitempty"`
	Input        map[string]string      `json:"input,omitempty" yaml:"input,omitempty"`
	Priority     string                 `json:"priority,omitempty" yaml:"priority,omitempty"`
	MaxTurns     int                    `json:"max_turns,omitempty" yaml:"max_turns,omitempty"`
	Retry        TaskRetryPolicy        `json:"retry,omitempty" yaml:"retry,omitempty"`
	MessageRetry TaskMessageRetryPolicy `json:"message_retry,omitempty" yaml:"message_retry,omitempty"`
	Requirements TaskRequirements       `json:"requirements,omitempty" yaml:"requirements,omitempty"`
}

type TaskStatus

type TaskStatus struct {
	Phase              string                   `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string                   `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	StartedAt          string                   `json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
	CompletedAt        string                   `json:"completedAt,omitempty" yaml:"completedAt,omitempty"`
	NextAttemptAt      string                   `json:"nextAttemptAt,omitempty" yaml:"nextAttemptAt,omitempty"`
	Attempts           int                      `json:"attempts,omitempty" yaml:"attempts,omitempty"`
	Output             map[string]string        `json:"output,omitempty" yaml:"output,omitempty"`
	AssignedWorker     string                   `json:"assignedWorker,omitempty" yaml:"assignedWorker,omitempty"`
	ClaimedBy          string                   `json:"claimedBy,omitempty" yaml:"claimedBy,omitempty"`
	LeaseUntil         string                   `json:"leaseUntil,omitempty" yaml:"leaseUntil,omitempty"`
	LastHeartbeat      string                   `json:"lastHeartbeat,omitempty" yaml:"lastHeartbeat,omitempty"`
	Trace              []TaskTraceEvent         `json:"trace,omitempty" yaml:"trace,omitempty"`
	History            []TaskHistoryEvent       `json:"history,omitempty" yaml:"history,omitempty"`
	Messages           []TaskMessage            `json:"messages,omitempty" yaml:"messages,omitempty"`
	MessageIdempotency []TaskMessageIdempotency `json:"message_idempotency,omitempty" yaml:"message_idempotency,omitempty"`
	JoinStates         []TaskJoinState          `json:"join_states,omitempty" yaml:"join_states,omitempty"`
	DelegationStates   []TaskDelegationState    `json:"delegation_states,omitempty" yaml:"delegation_states,omitempty"`
	BlockedOn          *TaskBlockedOn           `json:"blocked_on,omitempty" yaml:"blocked_on,omitempty"`
	ObservedGeneration int64                    `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type TaskTraceEvent

type TaskTraceEvent struct {
	Timestamp           string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
	StepID              string `json:"step_id,omitempty" yaml:"step_id,omitempty"`
	Attempt             int    `json:"attempt,omitempty" yaml:"attempt,omitempty"`
	Step                int    `json:"step,omitempty" yaml:"step,omitempty"`
	BranchID            string `json:"branch_id,omitempty" yaml:"branch_id,omitempty"`
	Type                string `json:"type,omitempty" yaml:"type,omitempty"`
	Agent               string `json:"agent,omitempty" yaml:"agent,omitempty"`
	Tool                string `json:"tool,omitempty" yaml:"tool,omitempty"`
	ToolContractVersion string `json:"tool_contract_version,omitempty" yaml:"tool_contract_version,omitempty"`
	ToolRequestID       string `json:"tool_request_id,omitempty" yaml:"tool_request_id,omitempty"`
	ToolAttempt         int    `json:"tool_attempt,omitempty" yaml:"tool_attempt,omitempty"`
	ErrorCode           string `json:"error_code,omitempty" yaml:"error_code,omitempty"`
	ErrorReason         string `json:"error_reason,omitempty" yaml:"error_reason,omitempty"`
	Retryable           *bool  `json:"retryable,omitempty" yaml:"retryable,omitempty"`
	Message             string `json:"message,omitempty" yaml:"message,omitempty"`
	LatencyMS           int64  `json:"latency_ms,omitempty" yaml:"latency_ms,omitempty"`
	Tokens              int    `json:"tokens,omitempty" yaml:"tokens,omitempty"`
	InputTokens         int    `json:"input_tokens,omitempty" yaml:"input_tokens,omitempty"`
	OutputTokens        int    `json:"output_tokens,omitempty" yaml:"output_tokens,omitempty"`
	TokenUsageSource    string `json:"token_usage_source,omitempty" yaml:"token_usage_source,omitempty"`
	ToolCalls           int    `json:"tool_calls,omitempty" yaml:"tool_calls,omitempty"`
	MemoryWrites        int    `json:"memory_writes,omitempty" yaml:"memory_writes,omitempty"`
	ToolAuthProfile     string `json:"tool_auth_profile,omitempty" yaml:"tool_auth_profile,omitempty"`
	ToolAuthSecretRef   string `json:"tool_auth_secret_ref,omitempty" yaml:"tool_auth_secret_ref,omitempty"`
}

type TaskWebhook

type TaskWebhook struct {
	APIVersion string            `json:"apiVersion" yaml:"apiVersion"`
	Kind       string            `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta        `json:"metadata" yaml:"metadata"`
	Spec       TaskWebhookSpec   `json:"spec" yaml:"spec"`
	Status     TaskWebhookStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

TaskWebhook defines event-driven task creation from inbound webhook deliveries.

func ParseTaskWebhookManifest

func ParseTaskWebhookManifest(data []byte) (TaskWebhook, error)

ParseTaskWebhookManifest parses TaskWebhook resources from JSON or constrained YAML.

func (*TaskWebhook) Normalize

func (t *TaskWebhook) Normalize() error

type TaskWebhookAuthSpec

type TaskWebhookAuthSpec struct {
	Profile           string `json:"profile,omitempty" yaml:"profile,omitempty"`
	SecretRef         string `json:"secret_ref,omitempty" yaml:"secret_ref,omitempty"`
	SignatureHeader   string `json:"signature_header,omitempty" yaml:"signature_header,omitempty"`
	SignaturePrefix   string `json:"signature_prefix,omitempty" yaml:"signature_prefix,omitempty"`
	TimestampHeader   string `json:"timestamp_header,omitempty" yaml:"timestamp_header,omitempty"`
	MaxSkewSeconds    int    `json:"max_skew_seconds,omitempty" yaml:"max_skew_seconds,omitempty"`
	Algorithm         string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
	PayloadFormat     string `json:"payload_format,omitempty" yaml:"payload_format,omitempty"`
	PayloadPrefix     string `json:"payload_prefix,omitempty" yaml:"payload_prefix,omitempty"`
	PayloadSeparator  string `json:"payload_separator,omitempty" yaml:"payload_separator,omitempty"`
	SignatureEncoding string `json:"signature_encoding,omitempty" yaml:"signature_encoding,omitempty"`
	HeaderFormat      string `json:"header_format,omitempty" yaml:"header_format,omitempty"`
	SignatureKey      string `json:"signature_key,omitempty" yaml:"signature_key,omitempty"`
	TimestampKey      string `json:"timestamp_key,omitempty" yaml:"timestamp_key,omitempty"`
}

type TaskWebhookIdempotency

type TaskWebhookIdempotency struct {
	EventIDHeader       string `json:"event_id_header,omitempty" yaml:"event_id_header,omitempty"`
	EventIDFromBody     string `json:"event_id_from_body,omitempty" yaml:"event_id_from_body,omitempty"`
	DedupeWindowSeconds int    `json:"dedupe_window_seconds,omitempty" yaml:"dedupe_window_seconds,omitempty"`
}

type TaskWebhookList

type TaskWebhookList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []TaskWebhook `json:"items" yaml:"items"`
}

type TaskWebhookPayloadSpec

type TaskWebhookPayloadSpec struct {
	Mode     string `json:"mode,omitempty" yaml:"mode,omitempty"`
	InputKey string `json:"input_key,omitempty" yaml:"input_key,omitempty"`
}

type TaskWebhookSpec

type TaskWebhookSpec struct {
	TaskRef      string                 `json:"task_ref,omitempty" yaml:"task_ref,omitempty"`
	TaskTemplate *TaskSpec              `json:"task_template,omitempty" yaml:"task_template,omitempty"`
	Suspend      bool                   `json:"suspend,omitempty" yaml:"suspend,omitempty"`
	Auth         TaskWebhookAuthSpec    `json:"auth,omitempty" yaml:"auth,omitempty"`
	Idempotency  TaskWebhookIdempotency `json:"idempotency,omitempty" yaml:"idempotency,omitempty"`
	Payload      TaskWebhookPayloadSpec `json:"payload,omitempty" yaml:"payload,omitempty"`
}

type TaskWebhookStatus

type TaskWebhookStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
	EndpointID         string `json:"endpointID,omitempty" yaml:"endpointID,omitempty"`
	EndpointPath       string `json:"endpointPath,omitempty" yaml:"endpointPath,omitempty"`
	LastDeliveryTime   string `json:"lastDeliveryTime,omitempty" yaml:"lastDeliveryTime,omitempty"`
	LastEventID        string `json:"lastEventID,omitempty" yaml:"lastEventID,omitempty"`
	LastTriggeredTask  string `json:"lastTriggeredTask,omitempty" yaml:"lastTriggeredTask,omitempty"`
	AcceptedCount      int64  `json:"acceptedCount,omitempty" yaml:"acceptedCount,omitempty"`
	DuplicateCount     int64  `json:"duplicateCount,omitempty" yaml:"duplicateCount,omitempty"`
	RejectedCount      int64  `json:"rejectedCount,omitempty" yaml:"rejectedCount,omitempty"`
}

type Tool

type Tool struct {
	APIVersion string     `json:"apiVersion" yaml:"apiVersion"`
	Kind       string     `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta `json:"metadata" yaml:"metadata"`
	Spec       ToolSpec   `json:"spec" yaml:"spec"`
	Status     ToolStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Tool defines an external capability that agents can call.

func ParseToolManifest

func ParseToolManifest(data []byte) (Tool, error)

ParseToolManifest parses Tool resources from JSON or constrained YAML.

func (*Tool) Normalize

func (t *Tool) Normalize() error

type ToolApproval

type ToolApproval struct {
	APIVersion string             `json:"apiVersion" yaml:"apiVersion"`
	Kind       string             `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta         `json:"metadata" yaml:"metadata"`
	Spec       ToolApprovalSpec   `json:"spec" yaml:"spec"`
	Status     ToolApprovalStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

ToolApproval captures a pending human/system approval request for a tool invocation.

func ParseToolApprovalManifest added in v0.2.0

func ParseToolApprovalManifest(data []byte) (ToolApproval, error)

ParseToolApprovalManifest parses ToolApproval resources from JSON or constrained YAML.

func (*ToolApproval) Normalize

func (a *ToolApproval) Normalize() error

type ToolApprovalList

type ToolApprovalList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []ToolApproval `json:"items" yaml:"items"`
}

type ToolApprovalSpec

type ToolApprovalSpec struct {
	TaskRef        string `json:"task_ref" yaml:"task_ref"`
	Tool           string `json:"tool" yaml:"tool"`
	OperationClass string `json:"operation_class,omitempty" yaml:"operation_class,omitempty"`
	Agent          string `json:"agent,omitempty" yaml:"agent,omitempty"`
	Input          string `json:"input,omitempty" yaml:"input,omitempty"`
	Reason         string `json:"reason,omitempty" yaml:"reason,omitempty"`
	TTL            string `json:"ttl,omitempty" yaml:"ttl,omitempty"`
}

type ToolApprovalStatus

type ToolApprovalStatus struct {
	Phase     string `json:"phase,omitempty" yaml:"phase,omitempty"`
	Decision  string `json:"decision,omitempty" yaml:"decision,omitempty"`
	DecidedBy string `json:"decided_by,omitempty" yaml:"decided_by,omitempty"`
	DecidedAt string `json:"decided_at,omitempty" yaml:"decided_at,omitempty"`
	Comment   string `json:"comment,omitempty" yaml:"comment,omitempty"`
	ExpiresAt string `json:"expires_at,omitempty" yaml:"expires_at,omitempty"`
}

type ToolAuth

type ToolAuth struct {
	Profile    string   `json:"profile,omitempty" yaml:"profile,omitempty"`
	SecretRef  string   `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
	HeaderName string   `json:"headerName,omitempty" yaml:"headerName,omitempty"`
	TokenURL   string   `json:"tokenURL,omitempty" yaml:"tokenURL,omitempty"`
	Scopes     []string `json:"scopes,omitempty" yaml:"scopes,omitempty"`
}

type ToolCliEnvRef added in v0.5.0

type ToolCliEnvRef struct {
	Name      string `json:"name" yaml:"name"`
	SecretRef string `json:"secretRef" yaml:"secretRef"`
	Key       string `json:"key,omitempty" yaml:"key,omitempty"`
}

ToolCliEnvRef maps an Orloj secret to a process environment variable.

type ToolCliSpec added in v0.5.0

type ToolCliSpec struct {
	Command         string             `json:"command,omitempty" yaml:"command,omitempty"`
	Args            []string           `json:"args,omitempty" yaml:"args,omitempty"`
	Image           string             `json:"image,omitempty" yaml:"image,omitempty"`
	ImagePullSecret string             `json:"image_pull_secret,omitempty" yaml:"image_pull_secret,omitempty"`
	Network         string             `json:"network,omitempty" yaml:"network,omitempty"`
	StdinFromInput  bool               `json:"stdin_from_input,omitempty" yaml:"stdin_from_input,omitempty"`
	Output          string             `json:"output,omitempty" yaml:"output,omitempty"`
	WorkingDir      string             `json:"working_dir,omitempty" yaml:"working_dir,omitempty"`
	Env             map[string]string  `json:"env,omitempty" yaml:"env,omitempty"`
	EnvFrom         []ToolCliEnvRef    `json:"env_from,omitempty" yaml:"env_from,omitempty"`
	Resources       ContainerResources `json:"resources,omitempty" yaml:"resources,omitempty"`
}

ToolCliSpec defines the configuration for CLI tool invocations.

type ToolList

type ToolList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []Tool `json:"items" yaml:"items"`
}

type ToolPermission

type ToolPermission struct {
	APIVersion string               `json:"apiVersion" yaml:"apiVersion"`
	Kind       string               `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta           `json:"metadata" yaml:"metadata"`
	Spec       ToolPermissionSpec   `json:"spec" yaml:"spec"`
	Status     ToolPermissionStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

ToolPermission defines required permissions for invoking a tool action.

func ParseToolPermissionManifest

func ParseToolPermissionManifest(data []byte) (ToolPermission, error)

ParseToolPermissionManifest parses ToolPermission resources from JSON or constrained YAML.

func (*ToolPermission) Normalize

func (p *ToolPermission) Normalize() error

type ToolPermissionList

type ToolPermissionList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []ToolPermission `json:"items" yaml:"items"`
}

type ToolPermissionSpec

type ToolPermissionSpec struct {
	ToolRef             string          `json:"tool_ref,omitempty" yaml:"tool_ref,omitempty"`
	Action              string          `json:"action,omitempty" yaml:"action,omitempty"`
	RequiredPermissions []string        `json:"required_permissions,omitempty" yaml:"required_permissions,omitempty"`
	MatchMode           string          `json:"match_mode,omitempty" yaml:"match_mode,omitempty"`
	ApplyMode           string          `json:"apply_mode,omitempty" yaml:"apply_mode,omitempty"`
	TargetAgents        []string        `json:"target_agents,omitempty" yaml:"target_agents,omitempty"`
	OperationRules      []OperationRule `json:"operation_rules,omitempty" yaml:"operation_rules,omitempty"`
}

type ToolPermissionStatus

type ToolPermissionStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type ToolRetryPolicy

type ToolRetryPolicy struct {
	MaxAttempts int    `json:"max_attempts,omitempty" yaml:"max_attempts,omitempty"`
	Backoff     string `json:"backoff,omitempty" yaml:"backoff,omitempty"`
	MaxBackoff  string `json:"max_backoff,omitempty" yaml:"max_backoff,omitempty"`
	Jitter      string `json:"jitter,omitempty" yaml:"jitter,omitempty"`
}

type ToolRuntimePolicy

type ToolRuntimePolicy struct {
	Timeout       string          `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	IsolationMode string          `json:"isolation_mode,omitempty" yaml:"isolation_mode,omitempty"`
	Retry         ToolRetryPolicy `json:"retry,omitempty" yaml:"retry,omitempty"`
}

type ToolSpec

type ToolSpec struct {
	Type             string            `json:"type,omitempty" yaml:"type,omitempty"`
	Endpoint         string            `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
	Description      string            `json:"description,omitempty" yaml:"description,omitempty"`
	InputSchema      map[string]any    `json:"input_schema,omitempty" yaml:"input_schema,omitempty"`
	McpServerRef     string            `json:"mcp_server_ref,omitempty" yaml:"mcp_server_ref,omitempty"`
	McpToolName      string            `json:"mcp_tool_name,omitempty" yaml:"mcp_tool_name,omitempty"`
	Cli              ToolCliSpec       `json:"cli,omitempty" yaml:"cli,omitempty"`
	Wasm             ToolWasmSpec      `json:"wasm,omitempty" yaml:"wasm,omitempty"`
	Capabilities     []string          `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
	OperationClasses []string          `json:"operation_classes,omitempty" yaml:"operation_classes,omitempty"`
	RiskLevel        string            `json:"risk_level,omitempty" yaml:"risk_level,omitempty"`
	Runtime          ToolRuntimePolicy `json:"runtime,omitempty" yaml:"runtime,omitempty"`
	Auth             ToolAuth          `json:"auth,omitempty" yaml:"auth,omitempty"`
}

type ToolStatus

type ToolStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
}

type ToolWasmSpec added in v0.11.0

type ToolWasmSpec struct {
	Module          string `json:"module,omitempty" yaml:"module,omitempty"`
	Entrypoint      string `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"`
	MaxMemoryBytes  int64  `json:"max_memory_bytes,omitempty" yaml:"max_memory_bytes,omitempty"`
	Fuel            uint64 `json:"fuel,omitempty" yaml:"fuel,omitempty"`
	EnableWASI      bool   `json:"enable_wasi" yaml:"enable_wasi"`
	ImagePullSecret string `json:"image_pull_secret,omitempty" yaml:"image_pull_secret,omitempty"`
}

ToolWasmSpec configures per-tool WASM module execution. Module may be a local path, HTTPS URL, or OCI artifact reference (oci://...).

type TypeMeta

type TypeMeta struct {
	APIVersion string `json:"apiVersion" yaml:"apiVersion"`
	Kind       string `json:"kind" yaml:"kind"`
}

TypeMeta mirrors Kubernetes-style resource identity fields.

type Worker

type Worker struct {
	APIVersion string       `json:"apiVersion" yaml:"apiVersion"`
	Kind       string       `json:"kind" yaml:"kind"`
	Metadata   ObjectMeta   `json:"metadata" yaml:"metadata"`
	Spec       WorkerSpec   `json:"spec" yaml:"spec"`
	Status     WorkerStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Worker defines a runtime worker that executes claimed tasks.

func ParseWorkerManifest

func ParseWorkerManifest(data []byte) (Worker, error)

ParseWorkerManifest parses Worker resources from JSON or constrained YAML.

func (*Worker) Normalize

func (w *Worker) Normalize() error

type WorkerCapabilities

type WorkerCapabilities struct {
	GPU             bool     `json:"gpu,omitempty" yaml:"gpu,omitempty"`
	SupportedModels []string `json:"supported_models,omitempty" yaml:"supported_models,omitempty"`
}

type WorkerList

type WorkerList struct {
	ListMeta `json:",inline" yaml:",inline"`
	Items    []Worker `json:"items" yaml:"items"`
}

type WorkerSpec

type WorkerSpec struct {
	Region             string             `json:"region,omitempty" yaml:"region,omitempty"`
	Capabilities       WorkerCapabilities `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
	MaxConcurrentTasks int                `json:"max_concurrent_tasks,omitempty" yaml:"max_concurrent_tasks,omitempty"`
}

type WorkerStatus

type WorkerStatus struct {
	Phase              string `json:"phase,omitempty" yaml:"phase,omitempty"`
	LastError          string `json:"lastError,omitempty" yaml:"lastError,omitempty"`
	LastHeartbeat      string `json:"lastHeartbeat,omitempty" yaml:"lastHeartbeat,omitempty"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty"`
	CurrentTasks       int    `json:"currentTasks,omitempty" yaml:"currentTasks,omitempty"`
}