Documentation
¶
Index ¶
- func DispatchExecuteRun(ctx context.Context, req ExecuteDispatchRequest, cb ExecuteDispatchCallbacks)
- func ReplaySession(ctx context.Context, path string, w io.Writer) error
- func RunNative(ctx context.Context, req NativeRequest, cb NativeCallbacks)
- func RunSubprocess(ctx context.Context, req SubprocessRequest, runner harnesses.Harness, ...)
- func SessionLogDir(overrideDir, configDir string) string
- func SessionLogPath(dir, sessionID string) (string, error)
- func SystemClock() time.Time
- func TailSessionLog(ctx context.Context, sessionID string, subscribe SessionSubscriber) (<-chan harnesses.Event, error)
- func ToolNames(tools []agentcore.Tool) []string
- func UsageReport(ctx context.Context, logDir string, opts session.UsageOptions) (*session.UsageReport, error)
- func WriteSessionLog(ctx context.Context, path string, w io.Writer) error
- type Clock
- type ExecuteDispatchCallbacks
- type ExecuteDispatchRequest
- type ExecuteRunnerDecision
- type ExecuteRunnerRequest
- type ExecuteRunnerResult
- type NativeCallbacks
- type NativeDecision
- type NativeProviderRequest
- type NativeProviderResolution
- type NativeRequest
- type NativeRouteCandidate
- type Runtime
- type RuntimeDeps
- type SessionLogEntry
- type SessionSubscriber
- type SubprocessCallbacks
- type SubprocessRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DispatchExecuteRun ¶
func DispatchExecuteRun(ctx context.Context, req ExecuteDispatchRequest, cb ExecuteDispatchCallbacks)
DispatchExecuteRun selects the concrete runner for an Execute request.
func ReplaySession ¶
ReplaySession renders a human-readable transcript for one session log path.
func RunNative ¶
func RunNative(ctx context.Context, req NativeRequest, cb NativeCallbacks)
RunNative drives the in-process agent loop without depending on root public service types.
func RunSubprocess ¶
func RunSubprocess(ctx context.Context, req SubprocessRequest, runner harnesses.Harness, cb SubprocessCallbacks)
RunSubprocess executes a subprocess harness and forwards its event stream.
func SessionLogDir ¶
SessionLogDir resolves the public service session-log directory from the per-service override and the loaded config value.
func SessionLogPath ¶
SessionLogPath resolves the JSONL path for a public service session.
func SystemClock ¶
SystemClock returns the current UTC wall-clock time.
func TailSessionLog ¶
func TailSessionLog(ctx context.Context, sessionID string, subscribe SessionSubscriber) (<-chan harnesses.Event, error)
TailSessionLog proxies session-hub events to a caller-owned channel that closes on upstream completion or context cancellation.
func UsageReport ¶
func UsageReport(ctx context.Context, logDir string, opts session.UsageOptions) (*session.UsageReport, error)
UsageReport aggregates session usage from the service-owned log directory.
Types ¶
type Clock ¶
Clock is the API-neutral time seam used by service implementation state. It deliberately has no dependency on root package contract types so the root facade can import this package without creating a cycle.
type ExecuteDispatchCallbacks ¶
type ExecuteDispatchCallbacks struct {
RunNative func(context.Context)
RunSubprocess func(context.Context, harnesses.Harness)
RunVirtual func(context.Context)
RunScript func(context.Context)
IsHTTPProvider func(harness string) bool
Finalize func(harnesses.FinalData)
}
ExecuteDispatchCallbacks connect the internal dispatcher to root-owned public event/session adapters.
type ExecuteDispatchRequest ¶
type ExecuteDispatchRequest struct {
Decision ExecuteRunnerDecision
Started time.Time
}
ExecuteDispatchRequest carries API-neutral data needed to choose the concrete execute runner.
type ExecuteRunnerDecision ¶
type ExecuteRunnerDecision struct {
Harness string
Provider string
ServerInstance string
Model string
}
ExecuteRunnerDecision is the API-neutral routing data needed by internal virtual/script runner implementations.
type ExecuteRunnerRequest ¶
type ExecuteRunnerRequest struct {
Prompt string
Metadata map[string]string
Decision ExecuteRunnerDecision
Started time.Time
}
ExecuteRunnerRequest is the API-neutral request data needed by internal virtual/script runner implementations.
type ExecuteRunnerResult ¶
ExecuteRunnerResult is the normalized result produced by an internal runner.
func RunScript ¶
func RunScript(ctx context.Context, req ExecuteRunnerRequest) ExecuteRunnerResult
RunScript executes the service script harness mechanics without depending on root public service types.
func RunVirtual ¶
func RunVirtual(ctx context.Context, req ExecuteRunnerRequest) ExecuteRunnerResult
RunVirtual executes the service virtual harness mechanics without depending on root public service types.
type NativeCallbacks ¶
type NativeCallbacks struct {
ResolveProvider func(NativeProviderRequest) NativeProviderResolution
ProviderNotConfiguredError func(NativeProviderRequest, NativeDecision) string
Compactor func(model string) agentcore.Compactor
ObserveAgentEvent func(agentcore.Event)
EmitEvent func(harnesses.EventType, any)
BeforeFinal func(harnesses.FinalData)
Finalize func(harnesses.FinalData)
ToolWiringHook func(harness string, toolNames []string)
PromptAssertionHook func(systemPrompt, prompt string, contextFiles []string)
CompactionAssertionHook func(messagesBefore, messagesAfter, tokensFreed int)
ObserveTokenUsage func(provider string, tokens int, at time.Time)
}
NativeCallbacks are root-owned service seams used by the internal runner without importing root public contract types.
type NativeDecision ¶
type NativeDecision struct {
Harness string
Provider string
ServerInstance string
Model string
Candidates []NativeRouteCandidate
}
NativeDecision is the API-neutral routing data needed by the native runner.
type NativeProviderRequest ¶
NativeProviderRequest is the narrow provider-selection request that crosses from the internal runner back into root-owned provider configuration.
type NativeProviderResolution ¶
NativeProviderResolution is the API-neutral result of root-owned provider construction.
type NativeRequest ¶
type NativeRequest struct {
Prompt string
SystemPrompt string
Model string
Provider string
Harness string
WorkDir string
Temperature *float32
TopP *float64
TopK *int
MinP *float64
RepetitionPenalty *float64
Seed *int64
SamplingSource string
Reasoning agentcore.Reasoning
NoStream bool
Permissions string
Tools []agentcore.Tool
ToolPreset string
PlanningMode bool
MaxIterations int
MaxTokens int
ReasoningByteLimit int
ProviderTimeout time.Duration
Timeout time.Duration
CachePolicy string
StallMaxReadOnlyIteration *int
Metadata map[string]string
Decision NativeDecision
Started time.Time
SessionID string
}
NativeRequest is the API-neutral request data needed by the native runner.
type NativeRouteCandidate ¶
type NativeRouteCandidate struct {
Provider string
Endpoint string
ServerInstance string
Model string
Eligible bool
}
NativeRouteCandidate is the API-neutral subset of root RouteCandidate used by the native failover provider.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is implementation-local service state that can be constructed from the root facade without depending on root public contract types.
func NewRuntime ¶
func NewRuntime(deps RuntimeDeps) Runtime
NewRuntime constructs implementation state with defaulted dependencies.
type RuntimeDeps ¶
type RuntimeDeps struct {
Now Clock
}
RuntimeDeps groups constructor dependencies that are safe to pass from the root facade into internal implementation packages.
func (RuntimeDeps) Clock ¶
func (d RuntimeDeps) Clock() Clock
Clock returns the configured clock or the system clock when no test seam is supplied.
type SessionLogEntry ¶
SessionLogEntry is an API-neutral projection of one service session log.
func ListSessionLogs ¶
func ListSessionLogs(ctx context.Context, logDir string) ([]SessionLogEntry, error)
ListSessionLogs returns JSONL session logs sorted by session ID.
type SessionSubscriber ¶
SessionSubscriber is the narrow root-facade seam TailSessionLog needs from the in-memory session hub.
type SubprocessCallbacks ¶
type SubprocessCallbacks struct {
BeforeExecute func()
BeforeFinal func(harnesses.FinalData)
ObserveEvent func(harnesses.Event) harnesses.Event
EmitEvent func(harnesses.Event) bool
Finalize func(harnesses.FinalData)
WriteEnd func(map[string]string, harnesses.FinalData)
}
SubprocessCallbacks bridge service-owned event/progress/session-log behavior without importing root public service types.
type SubprocessRequest ¶
type SubprocessRequest struct {
Prompt string
SystemPrompt string
WorkDir string
Permissions string
Temperature *float32
Seed *int64
Reasoning reasoning.Reasoning
Timeout time.Duration
IdleTimeout time.Duration
SessionLogDir string
Metadata map[string]string
Decision ExecuteRunnerDecision
Started time.Time
SessionLogPath string
}
SubprocessRequest is the API-neutral request data needed by subprocess harness runner implementations.