Documentation
¶
Overview ¶
Package skawld provides an embeddable agent SDK for Go.
The root package is the primary public API. It exposes Agent, Session, event streaming, run options, and aliases for the common extension interfaces used by providers, tools, sessions, and permissions.
Index ¶
- Constants
- type Agent
- type AgentOptions
- type CanUseTool
- type CompactionRequest
- type CompactionResult
- type CompactionStrategy
- type ContentBlock
- type ContentTrust
- type DescribedTool
- type Event
- type EventType
- type FilesystemPolicy
- type IdempotencySupport
- type IdempotentTool
- type ImageSource
- type KeepLastTurnsCompactionStrategy
- type LegacyStreamingProvider
- type MCPHTTPServerConfig
- type MCPServerConfig
- type MCPStdioServerConfig
- type Message
- type ModelID
- type Observation
- type ObservationType
- type Observer
- type PermissionMode
- type PermissionOptions
- type PermissionRule
- type Principal
- type ProblemSolvingOptions
- type Provider
- type ProviderFactory
- type ProviderRequest
- type ProviderRetryPolicy
- type ProviderStream
- type ProviderStreamEvent
- type ProviderStreamResult
- type RiskLevel
- type RunHandle
- type RunImage
- type RunOptions
- type Session
- func (s *Session) Abort()
- func (s *Session) MessageCount() int
- func (s *Session) Metadata() map[string]interface{}
- func (s *Session) Run(ctx context.Context, prompt string, opts RunOptions) <-chan core.Event
- func (s *Session) StartRun(ctx context.Context, prompt string, opts RunOptions) *RunHandle
- func (s *Session) UpdateMeta(meta map[string]interface{}) error
- func (s *Session) UpdateMetaContext(ctx context.Context, meta map[string]interface{}) error
- type SessionOptions
- type SessionStore
- type SideEffectKind
- type StopReason
- type StreamingProvider
- type Tool
- type ToolContext
- type ToolDescriptor
- type ToolResult
- type Usage
Constants ¶
const ( PermissionModeDefault = core.PermissionModeDefault PermissionModeAcceptEdits = core.PermissionModeAcceptEdits PermissionModeYolo = core.PermissionModeYolo BlockText = core.BlockText BlockToolUse = core.BlockToolUse BlockToolResult = core.BlockToolResult BlockThinking = core.BlockThinking BlockImage = core.BlockImage RiskLow = core.RiskLow RiskMedium = core.RiskMedium RiskHigh = core.RiskHigh RiskCritical = core.RiskCritical SideEffectNone = core.SideEffectNone SideEffectIdempotent = core.SideEffectIdempotent SideEffectNonIdempotent = core.SideEffectNonIdempotent SideEffectUnknown = core.SideEffectUnknown IdempotencyNotApplicable = core.IdempotencyNotApplicable IdempotencyUnsupported = core.IdempotencyUnsupported IdempotencyOptional = core.IdempotencyOptional IdempotencyRequired = core.IdempotencyRequired TrustSystemPolicy = core.TrustSystemPolicy TrustHumanInstruction = core.TrustHumanInstruction TrustToolResult = core.TrustToolResult TrustUntrustedContent = core.TrustUntrustedContent EventSystem = core.EventSystem EventAssistant = core.EventAssistant EventUser = core.EventUser EventPartialAssistant = core.EventPartialAssistant EventToolCallStart = core.EventToolCallStart EventToolCallEnd = core.EventToolCallEnd EventPermissionRequest = core.EventPermissionRequest EventUsage = core.EventUsage EventCompaction = core.EventCompaction EventResult = core.EventResult EventError = core.EventError EventSkillsLoaded = core.EventSkillsLoaded EventSkillInvoked = core.EventSkillInvoked EventSkillCompleted = core.EventSkillCompleted EventSubagent = core.EventSubagent ObservationProviderAttempt = core.ObservationProviderAttempt ObservationToolExecution = core.ObservationToolExecution ObservationPermissionCallback = core.ObservationPermissionCallback ObservationCompaction = core.ObservationCompaction ObservationMCPCall = core.ObservationMCPCall ObservationStoreOperation = core.ObservationStoreOperation )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent owns shared SDK runtime resources and can create multiple sessions concurrently. Close should be called when MCP or store resources are no longer needed.
func NewAgent ¶
func NewAgent(opts AgentOptions) (*Agent, error)
func (*Agent) Options ¶
func (a *Agent) Options() AgentOptions
func (*Agent) Store ¶
func (a *Agent) Store() core.SessionStore
Store returns the underlying session store so callers can list, delete, and query sessions.
type AgentOptions ¶
type AgentOptions struct {
Provider core.Provider
ProviderFactory core.ProviderFactory
Model core.ModelID
Tools *tools.Registry
// CloseTools transfers registered tool resource lifecycle to Agent.Close.
// Tools constructed internally are always owned by the Agent.
CloseTools bool
Permissions PermissionOptions
SessionStore core.SessionStore
CWD string
FilesystemPolicy tools.FilesystemPolicy
Principal core.Principal
ToolProfile tools.Profile
Logger *slog.Logger
Observer core.Observer
SystemPrompt string
ProblemSolving ProblemSolvingOptions
ProviderRetry *ProviderRetryPolicy
// MaxRetries is retained for compatibility. Prefer ProviderRetry, whose
// non-nil zero value can explicitly disable retries.
MaxRetries int
MaxOutputTokens *int
IncludePartialMessages bool
MaxTurns int
ToolConcurrency int
CompactionStrategy CompactionStrategy
CompactionThreshold float64
DisableCompaction bool
MCPServers []mcp.ServerConfig
SkillsDir string
SubagentsDir string
DisableSkills bool
DisableSubagents bool
}
AgentOptions configures an Agent. NewAgent clones the supplied Tools registry before adding runtime tools, so callers keep ownership of their registry after construction.
func AgentOptionsFromConfig ¶
func AgentOptionsFromConfig(opts config.AgentOptions) AgentOptions
type CanUseTool ¶
type CanUseTool = permissions.CanUseTool
type CompactionRequest ¶
type CompactionResult ¶
type CompactionStrategy ¶
type CompactionStrategy interface {
Name() string
Compact(ctx context.Context, req CompactionRequest) (CompactionResult, error)
}
func DefaultCompactionStrategy ¶
func DefaultCompactionStrategy() CompactionStrategy
type ContentBlock ¶
type ContentBlock = core.ContentBlock
type ContentTrust ¶
type ContentTrust = core.ContentTrust
type DescribedTool ¶
type DescribedTool = core.DescribedTool
type FilesystemPolicy ¶
type FilesystemPolicy = tools.FilesystemPolicy
type IdempotencySupport ¶
type IdempotencySupport = core.IdempotencySupport
type IdempotentTool ¶
type IdempotentTool = core.IdempotentTool
type ImageSource ¶
type ImageSource = core.ImageSource
type KeepLastTurnsCompactionStrategy ¶
func (KeepLastTurnsCompactionStrategy) Compact ¶
func (s KeepLastTurnsCompactionStrategy) Compact(ctx context.Context, req CompactionRequest) (CompactionResult, error)
func (KeepLastTurnsCompactionStrategy) Name ¶
func (s KeepLastTurnsCompactionStrategy) Name() string
type LegacyStreamingProvider ¶
type LegacyStreamingProvider = core.LegacyStreamingProvider
type MCPHTTPServerConfig ¶
type MCPHTTPServerConfig = mcp.HTTPServerConfig
type MCPServerConfig ¶
type MCPServerConfig = mcp.ServerConfig
type MCPStdioServerConfig ¶
type MCPStdioServerConfig = mcp.StdioServerConfig
type Observation ¶
type Observation = core.Observation
type ObservationType ¶
type ObservationType = core.ObservationType
type PermissionMode ¶
type PermissionMode = core.PermissionMode
type PermissionOptions ¶
type PermissionOptions struct {
Mode core.PermissionMode
Rules []permissions.Rule
CanUseTool permissions.CanUseTool
}
type PermissionRule ¶
type PermissionRule = permissions.Rule
type ProblemSolvingOptions ¶
type ProblemSolvingOptions struct {
Enabled bool
AutoRepoMap bool
RequirePlanBeforeWrite bool
AutoVerify bool
MaxConsecutiveToolErrors int
}
ProblemSolvingOptions enables lightweight orchestration hints that help a coding agent choose better next actions without changing provider APIs.
type ProviderFactory ¶
type ProviderFactory = core.ProviderFactory
type ProviderRequest ¶
type ProviderRequest = core.ProviderRequest
type ProviderRetryPolicy ¶
type ProviderStream ¶
type ProviderStream = core.ProviderStream
type ProviderStreamEvent ¶
type ProviderStreamEvent = core.ProviderStreamEvent
type ProviderStreamResult ¶
type ProviderStreamResult = core.ProviderStreamResult
type RunOptions ¶
type Session ¶
type Session struct {
ID string
CreatedAt time.Time
Principal core.Principal
// Meta is a compatibility snapshot. Use Metadata for a concurrency-safe
// copy when sessions may be accessed by multiple goroutines.
Meta map[string]interface{}
// contains filtered or unexported fields
}
Session holds one conversation history. A Session permits one active run at a time; metadata and run lifecycle methods are safe to call from concurrent goroutines.
func (*Session) MessageCount ¶
func (*Session) UpdateMeta ¶
type SessionOptions ¶
type SessionStore ¶
type SessionStore = core.SessionStore
type SideEffectKind ¶
type SideEffectKind = core.SideEffectKind
type StopReason ¶
type StopReason = core.StopReason
type StreamingProvider ¶
type StreamingProvider = core.StreamingProvider
type ToolContext ¶
type ToolContext = core.ToolContext
type ToolDescriptor ¶
type ToolDescriptor = core.ToolDescriptor
type ToolResult ¶
type ToolResult = core.ToolResult
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package audit defines durable, structured records for consequential SDK actions.
|
Package audit defines durable, structured records for consequential SDK actions. |
|
Package automation composes observation, learning, review, publication, and deterministic execution into one safe application-facing lifecycle.
|
Package automation composes observation, learning, review, publication, and deterministic execution into one safe application-facing lifecycle. |
|
cmd
|
|
|
raven
command
Raven CLI — a premium AI coding assistant terminal UI.
|
Raven CLI — a premium AI coding assistant terminal UI. |
|
raven/internal/tui
Package tui implements the Raven terminal UI rendering layer.
|
Package tui implements the Raven terminal UI rendering layer. |
|
Package config loads JSON configuration files into AgentOptions.
|
Package config loads JSON configuration files into AgentOptions. |
|
Package evaluation provides deterministic regression testing for published workflows.
|
Package evaluation provides deterministic regression testing for published workflows. |
|
examples
|
|
|
agent_evaluation
command
|
|
|
extractor_evaluation
command
|
|
|
http_observation
command
|
|
|
interactive_cli
command
|
|
|
invoice_reconciliation
command
|
|
|
learned_invoice
command
Command learned_invoice demonstrates the complete local lifecycle: semantic demonstrations -> structured extraction -> compilation -> evaluation -> human review -> publication -> deterministic resolution -> approval -> execution.
|
Command learned_invoice demonstrates the complete local lifecycle: semantic demonstrations -> structured extraction -> compilation -> evaluation -> human review -> publication -> deterministic resolution -> approval -> execution. |
|
mcp_agent
command
|
|
|
minimal
command
|
|
|
multiple_demonstrations
command
|
|
|
workflow_evaluation
command
|
|
|
internal
|
|
|
Package learning contains the optional trace-to-workflow boundary.
|
Package learning contains the optional trace-to-workflow boundary. |
|
structured
Package structured provides a provider-neutral, structured-output workflow extractor.
|
Package structured provides a provider-neutral, structured-output workflow extractor. |
|
Package observation models semantic human demonstrations.
|
Package observation models semantic human demonstrations. |
|
browseradapter
Package browseradapter converts browser-extension or instrumentation events into semantic observations.
|
Package browseradapter converts browser-extension or instrumentation events into semantic observations. |
|
httpadapter
Package httpadapter receives authenticated business events over HTTP and converts them into semantic observation events.
|
Package httpadapter receives authenticated business events over HTTP and converts them into semantic observation events. |
|
Package policy is the mandatory safety boundary between proposed actions and real-world execution.
|
Package policy is the mandatory safety boundary between proposed actions and real-world execution. |
|
sqlite
Package sqlite provides a SQLite-backed core.SessionStore implementation.
|
Package sqlite provides a SQLite-backed core.SessionStore implementation. |
|
Package skills loads SKILL.md files and exposes them through the Skill tool.
|
Package skills loads SKILL.md files and exposes them through the Skill tool. |
|
Package storage defines production data-protection and retention contracts shared by durable storage adapters.
|
Package storage defines production data-protection and retention contracts shared by durable storage adapters. |
|
sqlite
Package sqlite provides durable local persistence for workflow-learning domain stores.
|
Package sqlite provides durable local persistence for workflow-learning domain stores. |
|
Package subagents loads child-agent definitions and exposes the Subagent tool.
|
Package subagents loads child-agent definitions and exposes the Subagent tool. |
|
Package telemetry adapts safe SDK observations into vendor-neutral metric and completed-span records.
|
Package telemetry adapts safe SDK observations into vendor-neutral metric and completed-span records. |
|
mcp
Package mcp provides a small Model Context Protocol client and adapts MCP server tools to the SDK's core.Tool interface.
|
Package mcp provides a small Model Context Protocol client and adapts MCP server tools to the SDK's core.Tool interface. |
|
Package workflow provides the canonical, provider-independent workflow model and deterministic runtime.
|
Package workflow provides the canonical, provider-independent workflow model and deterministic runtime. |