Documentation
¶
Overview ¶
Package device defines persistence data shared by daemon gateways and their stores.
Index ¶
Constants ¶
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.
const OwnerStatusConnected = "connected"
const OwnerStatusDraining = "draining"
const OwnerStatusExpired = "expired"
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 ¶
HashCredential preserves the paired runtime bearer format, including trimming whitespace appended when operators paste tokens.
Types ¶
type ArchivedCancellationReceipt ¶
ArchivedCancellationReceipt authorizes only the original delivery's receipt drain. It grants neither Runtime credentials nor permission to start work.
type ClaimOwner ¶
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 RenewOwner ¶
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.