runtimedevice

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package device defines persistence data shared by daemon gateways and their stores.

Index

Constants

View Source
const ArchivedCancellationReceiptLimit = 20 * time.Second

ArchivedCancellationReceiptLimit bounds receipt draining after an administrator archive. It is not a model/tool timeout and never restarts on heartbeat or retry.

View Source
const OwnerStatusConnected = "connected"
View Source
const OwnerStatusDraining = "draining"
View Source
const OwnerStatusExpired = "expired"
View Source
const RuntimeTypeAgentDaemon = "agent_daemon"

RuntimeTypeAgentDaemon is the type of every device credential: the device runs the agent daemon. The gateway authenticates only this type.

Variables

This section is empty.

Functions

func HashCredential

func HashCredential(plaintext string) string

HashCredential preserves the paired runtime bearer format, including trimming whitespace appended when operators paste tokens.

Types

type ArchivedCancellationReceipt

type ArchivedCancellationReceipt struct {
	RunID    string
	Deadline time.Time
}

ArchivedCancellationReceipt authorizes only the original delivery's receipt drain. It grants neither Runtime credentials nor permission to start work.

type ClaimOwner

type ClaimOwner struct {
	DeviceID       string
	WorkspaceID    string
	OwnerPodID     string
	OwnerURL       string
	LeaseExpiresAt time.Time
	Now            time.Time
}

type Credential

type Credential struct {
	ID             string
	WorkspaceID    string
	Name           string
	Type           string
	CredentialHash string
	// RuntimeNodeID is the persisted managed allocation binding, never caller input.
	RuntimeNodeID string
	// RuntimeAllocationID distinguishes managed cloud compute from self-hosted devices.
	RuntimeAllocationID string
}

Credential is the minimal device identity needed for gateway authentication. CredentialHash is never sent over the daemon protocol.

type Heartbeat

type Heartbeat struct {
	RuntimeID string
	// CredentialHash comes from gateway authentication, never a daemon frame.
	CredentialHash      string
	DaemonVersion       string
	ActiveRequests      int
	HeartbeatTimestamp  int64
	SupportedAgentKinds []SupportedAgentKind
}

Heartbeat is the WebSocket daemon heartbeat payload after gateway normalization.

type HeartbeatStatus

type HeartbeatStatus struct {
	Liveness string
	// Deleted is true when the heartbeat UPDATE matched zero rows,
	// meaning the runtime was soft-deleted (or never existed). The
	// gateway uses this to send a permanent WS close frame so the
	// daemon stops reconnecting.
	Deleted bool
}

HeartbeatStatus is the post-heartbeat liveness the runner uses to detect state changes.

type KindCapabilities

type KindCapabilities struct {
	SubagentObservations  bool `json:"subagent_observations,omitempty"`
	Streaming             bool `json:"streaming,omitempty"`
	Permissions           bool `json:"permissions,omitempty"`
	Usage                 bool `json:"usage,omitempty"`
	Resume                bool `json:"resume,omitempty"`
	NativeSessionRecovery bool `json:"native_session_recovery,omitempty"`
	Steering              bool `json:"steering,omitempty"`
	MessageItems          bool `json:"message_items,omitempty"`

	ToolObservations               bool `json:"tool_observations,omitempty"`
	EnvironmentNone                bool `json:"environment_none,omitempty"`
	LocalEnvironment               bool `json:"local_environment,omitempty"`
	Preparation                    bool `json:"preparation,omitempty"`
	WorkspaceReadPreparation       bool `json:"workspace_read_preparation,omitempty"`
	WorkspaceOutputExport          bool `json:"workspace_output_export,omitempty"`
	ProgrammaticToolCallingDisable bool `json:"programmatic_tool_calling_disable,omitempty"`
	WebSearchControl               bool `json:"web_search_control,omitempty"`
	// ExecutionControls supports typed search and verbosity controls.
	ExecutionControls    bool `json:"execution_controls,omitempty"`
	TextVerbosity        bool `json:"text_verbosity,omitempty"`
	StructuredOutput     bool `json:"structured_output,omitempty"`
	ToolSearch           bool `json:"tool_search,omitempty"`
	MessageImages        bool `json:"message_images,omitempty"`
	FunctionResultImages bool `json:"function_result_images,omitempty"`
	SubagentControl      bool `json:"subagent_control,omitempty"`
	FunctionTools        bool `json:"function_tools,omitempty"`
	MCPHTTPTools         bool `json:"mcp_http_tools,omitempty"`
	MCPHTTPRequired      bool `json:"mcp_http_required,omitempty"`
	MCPHTTPBearerAuth    bool `json:"mcp_http_bearer_auth,omitempty"`
	DurableInputReceipts bool `json:"durable_input_receipts,omitempty"`
	DurableTurns         bool `json:"durable_turns,omitempty"`
	WorkspaceAuthoring   bool `json:"workspace_authoring,omitempty"`
}

KindCapabilities mirrors the daemon heartbeat capability shape after gateway-level normalization. Persistence stays separate from wire protocol structs.

type Owner

type Owner struct {
	DeviceID       string
	WorkspaceID    string
	OwnerPodID     string
	OwnerURL       string
	Generation     int64
	Status         string
	ConnectedAt    time.Time
	LastSeenAt     time.Time
	LeaseExpiresAt time.Time
	UpdatedAt      time.Time
}

Owner is the persisted view of the current WebSocket owner for one agent_daemon device. Generation is a fencing token: renewal/release paths must carry it so stale pods can't act.

type ReleaseOwner

type ReleaseOwner struct {
	DeviceID   string
	OwnerPodID string
	Generation int64
}

type RenewOwner

type RenewOwner struct {
	DeviceID       string
	OwnerPodID     string
	Generation     int64
	LeaseExpiresAt time.Time
	Now            time.Time
}

type SupportedAgentKind

type SupportedAgentKind struct {
	Kind         string           `json:"kind"`
	Available    bool             `json:"available"`
	Version      string           `json:"version,omitempty"`
	Capabilities KindCapabilities `json:"capabilities,omitempty"`
}

SupportedAgentKind is the sanitized runtime.config view of one daemon-side agent_kind.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL