Documentation
¶
Overview ¶
Package exec implements the runtime's private plan compiler and scheduler.
Index ¶
- func ApplyBindings(input map[string]any, evidence map[string]any, bindings []Binding) (map[string]any, error)
- func Lookup(value any, path string) (any, bool)
- type AgenticExecutor
- type AgenticResult
- type Approval
- type Barrier
- type Batch
- type Binding
- type DeadlinePolicy
- type Deterministic
- type ExecutionPlan
- type InputResolver
- type Request
- type Resolver
- type Scheduler
- type Step
- type StepResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyBindings ¶
Types ¶
type AgenticExecutor ¶
type AgenticExecutor func(context.Context, Step, json.RawMessage) (AgenticResult, error)
type AgenticResult ¶
type AgenticResult struct {
Content any
Action *tool.ActionReceipt
ToolCalls int
ModelCalls int
PromptTokens int
CompletionTokens int
TotalTokens int
PendingArguments json.RawMessage
}
type Approval ¶
type Approval struct {
ToolID string
Arguments json.RawMessage
}
type Binding ¶
type Binding = plan.InputBinding
type DeadlinePolicy ¶
type Deterministic ¶
type Deterministic struct{}
func (Deterministic) Resolve ¶
func (Deterministic) Resolve(_ context.Context, req Request) (json.RawMessage, error)
type ExecutionPlan ¶
type InputResolver ¶
type InputResolver func(Step) json.RawMessage
type Scheduler ¶
type Scheduler struct {
Registry *tool.Registry
MaxParallel int
Policy policy.Runner
Guard func(context.Context, tool.Tool) error
// Confirm is called before a tool that declares a confirmation policy is
// executed. Returning false produces a confirmation-required receipt and
// leaves the external system untouched.
Confirm func(context.Context, tool.Spec, json.RawMessage) (bool, error)
Deadline DeadlinePolicy
Barrier *Barrier
Observe func(policy.Event)
// Completed replays successful checkpointed steps without executing them.
Completed map[string]StepResult
// Approvals bind resume authorization to an exact step, tool and arguments.
Approvals map[string]Approval
Agentic AgenticExecutor
}
func (Scheduler) Run ¶
func (s Scheduler) Run(ctx context.Context, execution ExecutionPlan, resolve InputResolver) ([]StepResult, error)
type Step ¶
type Step struct {
ID string
Kind plan.StepKind
Importance plan.StepImportance
Title string
Description string
Capability string
DependsOn []string
Optional bool
Input map[string]any
Bindings []plan.InputBinding
Condition *plan.Condition
Mode plan.StepMode
Goal string
SuccessCriteria string
Capabilities []string
ToolBudget plan.ToolCallBudget
ApprovedToolID string
ApprovedInput []byte
}
type StepResult ¶
type StepResult struct {
StepID string
RequestedCapability string
Capability string
ToolID string
Content any
Receipt bool
Action *tool.ActionReceipt
Err error
Duration time.Duration
Attempts int
Fallbacks int
Skipped bool
ConditionUnknown bool
Input json.RawMessage
ModelCalls int
PromptTokens int
CompletionTokens int
TotalTokens int
}
Click to show internal directories.
Click to hide internal directories.