Documentation
¶
Index ¶
- Constants
- func DeterministicInvocationID(serviceName string, origin InvocationOrigin, scheduleExpr, message string) string
- func Register(name string, d Driver)
- func Registered() map[string]Driver
- func RetirementError(name string) error
- type BaseImageProvider
- type ChannelConfig
- type ChannelDMConfig
- type ChannelGuildConfig
- type ChannelInfo
- type ContainerRef
- type DirectTurnWaker
- type Driver
- type GeneratedSkill
- type GuildInfo
- type HandleInfo
- type Health
- type Healthcheck
- type HermesConfig
- type Invocation
- type InvocationOrigin
- type MaterializeOpts
- type MaterializeResult
- type Mount
- type OpenRouterPreferences
- type PostApplyOpts
- type ResolvedClaw
- type ResolvedFeed
- type ResolvedInclude
- type ResolvedSkill
- type ResolvedSurface
- type RunResultContract
- type RunWorkerCompiler
- type RunWorkerOpts
- type RunWorkerSpec
- type RunnerBaseProvider
- type RunnerVersionProber
- type ServiceEndpoint
- type ServiceSurfaceInfo
Constants ¶
const ( RunPlaceholderTask = "{{claw.run.task}}" RunPlaceholderSession = "{{claw.run.session}}" RunPlaceholderCllamaToken = "{{claw.run.cllama_token}}" )
Run placeholders are substituted by the run supervisor at launch. They only ever appear as complete values inside RunWorkerSpec.Inputs.
Variables ¶
This section is empty.
Functions ¶
func DeterministicInvocationID ¶ added in v0.5.2
func DeterministicInvocationID(serviceName string, origin InvocationOrigin, scheduleExpr, message string) string
func Registered ¶ added in v0.10.0
func RetirementError ¶ added in v0.28.0
RetirementError returns the canonical migration error for a retired runner. Other unknown names return nil and keep the generic unknown-driver path.
Types ¶
type BaseImageProvider ¶ added in v0.2.0
BaseImageProvider is optionally implemented by drivers that can auto-build their base image when it's not available locally.
type ChannelConfig ¶
type ChannelConfig struct {
Guilds map[string]ChannelGuildConfig // guild ID → routing config
DM ChannelDMConfig
AllowFromHandles bool // append all declared platform handles to each guild users[] allowlist
AllowFromServices []string // append Discord bot IDs derived from these pod service envs
}
ChannelConfig is the full routing config declared in a map-form channel surface. Non-nil only when the pod declares map form (channel://discord: {...}).
type ChannelDMConfig ¶
type ChannelDMConfig struct {
Enabled bool
Policy string // "pairing", "allowlist", "open", "disabled", or "" (legacy "denylist" alias supported)
AllowFrom []string // user IDs allowed to DM the bot
}
ChannelDMConfig is the DM routing config for a channel surface.
type ChannelGuildConfig ¶
type ChannelGuildConfig struct {
Policy string // "allowlist", "denylist", or "" (inherit platform default)
Users []string // user IDs for the policy list
RequireMention bool
}
ChannelGuildConfig is the routing config for one guild in a channel surface.
type ChannelInfo ¶
ChannelInfo describes a single channel within a guild.
type ContainerRef ¶
type DirectTurnWaker ¶ added in v0.29.0
type DirectTurnWaker interface {
WakeHelper() string
InvocationTimeoutSeconds(*ResolvedClaw) (int, error)
}
DirectTurnWaker opts a runner into compiler-owned scheduling and bounded direct turns, independently of the lifecycle Driver interface.
type Driver ¶
type Driver interface {
Validate(rc *ResolvedClaw) error
Materialize(rc *ResolvedClaw, opts MaterializeOpts) (*MaterializeResult, error)
PostApply(rc *ResolvedClaw, opts PostApplyOpts) error
HealthProbe(ref ContainerRef) (*Health, error)
}
Driver translates Clawfile intent into runner-specific enforcement. Fail-closed: Validate runs before compose up, PostApply runs after.
type GeneratedSkill ¶
type GuildInfo ¶
type GuildInfo struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Channels []ChannelInfo `json:"channels,omitempty"`
}
GuildInfo describes one guild/server/workspace membership.
type HandleInfo ¶
type HandleInfo struct {
ID string `json:"id"`
Username string `json:"username,omitempty"`
Guilds []GuildInfo `json:"guilds,omitempty"`
}
HandleInfo is the full contact card for an agent on a platform. Enables sibling services to mention, message, and route to this agent.
type Healthcheck ¶
type HermesConfig ¶ added in v0.14.1
type Invocation ¶
type Invocation struct {
ID string `json:"id,omitempty"`
Schedule string // 5-field cron expression (e.g., "15 8 * * 1-5")
Message string // agent task payload (agentTurn message)
Channel string `json:"channel,omitempty"` // resolved delivery platform
To string // platform delivery target (channel/chat ID; empty = driver default behavior)
Name string // human-readable job name (optional, derived from message if empty)
Origin InvocationOrigin `json:"origin,omitempty"`
When *schedule.When `json:"when,omitempty"`
}
Invocation is a scheduled agent task resolved from image labels or pod x-claw.invoke.
type InvocationOrigin ¶ added in v0.5.2
type InvocationOrigin string
const ( OriginImage InvocationOrigin = "image" OriginPod InvocationOrigin = "pod" )
type MaterializeOpts ¶
type MaterializeResult ¶
type MaterializeResult struct {
Mounts []Mount
Tmpfs []string // paths needing tmpfs (for read_only: true)
Environment map[string]string // additional env vars
User string // optional compose user override (lower priority than explicit compose user)
Healthcheck *Healthcheck
ReadOnly bool // default: true
Restart string // default: "on-failure"
StopGracePeriod string // optional driver default; explicit compose value wins
SkillDir string // container path for skills (e.g., "/claw/skills")
SkillLayout string // "" (flat, default) or "directory" (Claude Code: skills/name/SKILL.md)
}
MaterializeResult describes what the compose generator must add to the service.
type OpenRouterPreferences ¶ added in v0.31.0
type OpenRouterPreferences struct {
Only []string
ZDR *bool // true only
AllowFallbacks *bool // false only
RequireParameters *bool // true only
DataCollection string // "deny" only
}
OpenRouterPreferences is the validated subset of OpenRouter's provider routing object. Every field may only narrow routing: the booleans accept a single value and data collection can only be denied.
func (*OpenRouterPreferences) Object ¶ added in v0.31.0
func (p *OpenRouterPreferences) Object() map[string]interface{}
Object returns the OpenRouter "provider" request object.
type PostApplyOpts ¶
type PostApplyOpts struct {
ContainerID string
}
type ResolvedClaw ¶
type ResolvedClaw struct {
ServiceName string
ImageRef string
ClawType string
Agent string // filename from image labels (e.g., "AGENTS.md")
AgentHostPath string // resolved host path for bind mount
Persona string // runtime persona ref from x-claw or image metadata
PersonaHostPath string // resolved host path for persona workspace mount
Models map[string]string // slot -> provider/model
ReasoningEffort map[string]string // slot -> per-run reasoning effort (x-claw.reasoning-effort)
Handles map[string]*HandleInfo // platform -> contact card (from x-claw handles block)
PeerHandles map[string]map[string]*HandleInfo // service name -> platform -> HandleInfo for sibling services
Includes []ResolvedInclude // composed contract fragments from x-claw.include
Feeds []ResolvedFeed
Surfaces []ResolvedSurface
Skills []ResolvedSkill
Privileges map[string]string
Configures []string // openclaw config set commands from labels
Invocations []Invocation // scheduled agent tasks from image labels + pod x-claw.invoke
Count int // from pod x-claw (default 1)
Environment map[string]string // from pod environment block
RuntimeEnv map[string]string // compose interpolation context: pod .env plus process env
Timezone string // resolved service timezone from TZ env (falls back to UTC)
Cllama []string // ordered cllama proxy types (e.g., ["passthrough"])
CllamaToken string // per-agent bearer token injected when cllama is active
Hermes *HermesConfig // Hermes-specific pod config
// ProviderPreferences maps an openrouter/* model slot to the OpenRouter
// routing preferences a per-run worker sends (x-claw.provider-preferences).
ProviderPreferences map[string]*OpenRouterPreferences
}
ResolvedClaw combines image-level claw labels with pod-level x-claw overrides.
type ResolvedFeed ¶ added in v0.3.5
type ResolvedInclude ¶ added in v0.2.0
type ResolvedSkill ¶
type ResolvedSurface ¶
type ResolvedSurface struct {
Scheme string // channel, service, volume, host, egress
Target string // discord, fleet-master, shared-cache, etc.
AccessMode string // read-only, read-write (for volume/host surfaces)
Ports []string // exposed ports from service definition (service surfaces only)
SkillName string // mounted skill filename for this surface when one exists
ServiceInfo *ServiceSurfaceInfo // non-nil when a service surface has descriptor metadata
ChannelConfig *ChannelConfig // non-nil only for map-form channel surfaces
}
type RunResultContract ¶ added in v0.29.0
type RunResultContract struct {
// Source is "stdout".
Source string `json:"source"`
// Marker, when set, starts the answer: the answer is everything after the
// first occurrence of Marker in the stream, minus one trailing newline.
Marker string `json:"marker,omitempty"`
}
RunResultContract describes how the supervisor extracts a worker's answer.
type RunWorkerCompiler ¶ added in v0.29.0
type RunWorkerCompiler interface {
ValidateRunWorker(rc *ResolvedClaw) error
CompileRunWorker(rc *ResolvedClaw, opts RunWorkerOpts) (*RunWorkerSpec, error)
}
RunWorkerCompiler is optionally implemented by drivers that can run as a one-shot per-run worker (x-claw.lifecycle: per-run). Validation is separate from Validate so long-lived service requirements are never weakened.
type RunWorkerOpts ¶ added in v0.29.0
type RunWorkerOpts struct {
PodName string
}
type RunWorkerSpec ¶ added in v0.29.0
type RunWorkerSpec struct {
// Entrypoint and Command are pinned; the image ENTRYPOINT is overridden.
// Command elements may reference inputs as ${NAME} Compose interpolations.
Entrypoint []string `json:"entrypoint"`
Command []string `json:"command,omitempty"`
// Environment holds static, non-secret container env.
Environment map[string]string `json:"environment,omitempty"`
// Inputs maps a container env name to a value template. Templates may embed
// run placeholders. Inputs are interpolated, never written to disk.
Inputs map[string]string `json:"inputs"`
// Tmpfs mounts are the only writable paths; the root filesystem is read-only.
Tmpfs []string `json:"tmpfs"`
// Result describes where the worker reports its answer.
Result RunResultContract `json:"result"`
}
RunWorkerSpec is the secret-free, driver-compiled process contract for a per-run worker. The supervisor never interprets driver configuration: it substitutes placeholders into Inputs and passes each input to the container through Compose interpolation, so no task text or secret is written into the rendered project file.
type RunnerBaseProvider ¶ added in v0.10.0
type RunnerBaseProvider interface {
BaseImageProvider
RunnerAlias() string
}
RunnerBaseProvider is optionally implemented by drivers whose base image is a synthetic local alias refreshed from upstream sources.
type RunnerVersionProber ¶ added in v0.10.0
type RunnerVersionProber interface {
RunnerVersionProbe() []string
}
RunnerVersionProber is optionally implemented by RunnerBaseProvider drivers that can report the installed upstream runner version.
type ServiceEndpoint ¶ added in v0.3.5
type ServiceSurfaceInfo ¶ added in v0.3.5
type ServiceSurfaceInfo struct {
Description string
AuthType string
AuthEnv string
Endpoints []ServiceEndpoint
}