Documentation
¶
Overview ¶
Package runtimeapi defines the wire contract of the platform runtime API (design §13.2). Three callers use separate authentication paths:
- Seats (seat-runner, steadmesh-tools, harnesses) call /v1/* with a projected ServiceAccount token whose only audience is steadmesh-gateway. The platform resolves the token to a seat with a TokenReview; clients cannot select a different principal. Mutating calls carry HeaderGeneration and are fenced.
- The controller calls /internal/v1/* with its own ServiceAccount token.
- Operators use orgctl, which reads Kubernetes status and calls /internal/v1 through the controller's verify flow.
Index ¶
- Constants
- func BranchSnapshotSHA256(r RunBranchRequest) string
- func TaskResultSHA256(r *TaskRunResult) string
- func ValidTaskPath(p string) bool
- func ValidateElasticTeam(req *ElasticTeamRequest) error
- func ValidateRunBranch(r *RunBranchRequest) error
- func ValidateTaskFiles(files []TaskFile) error
- func ValidateTaskRun(req *TaskRunRequest) error
- type AccessResponse
- type Bootstrap
- type CheckResult
- type Checkpoint
- type ConnectionInfo
- type ConsoleActivity
- type ConsoleActivityItem
- type ConsoleArtifact
- type ConsoleArtifactList
- type ConsoleCapability
- type ConsoleChannelBinding
- type ConsoleCheck
- type ConsoleConnection
- type ConsoleConversation
- type ConsoleConversationDetail
- type ConsoleConversationList
- type ConsoleDelivery
- type ConsoleEvent
- type ConsoleExecution
- type ConsoleExecutionDetail
- type ConsoleExecutionList
- type ConsoleMemoryStore
- type ConsoleMessage
- type ConsoleOperation
- type ConsoleOperationList
- type ConsoleOrganization
- type ConsoleSeatConfig
- type ConsoleSeatDetail
- type ConsoleSeatList
- type ConsoleSeatStatus
- type ConsoleWorkItem
- type ConsoleWorkList
- type ConsoleWorkPublication
- type ConsoleWorkStep
- type CredentialResponse
- type CredentialStatus
- type ElasticTeam
- type ElasticTeamRequest
- type ElasticTeamWorker
- type ElasticWorkerRequest
- type Envelope
- type Error
- type ExecutionEvent
- type FenceRequest
- type GitHubSandbox
- type Handoff
- type InboxAckRequest
- type InboxDelivery
- type InstructionInfo
- type InstructionProposal
- type LeaseAcquireRequest
- type LeaseRenewRequest
- type LeaseResponse
- type MemoryStoreInfo
- type ModelBudgetStatus
- type ModelRequest
- type Operation
- type ParticipantContext
- type PoolMember
- type PoolSpawnRequest
- type ProbeResponse
- type ProbeResult
- type RecipientInfo
- type Recovery
- type RetiringSeat
- type RunAlternative
- type RunAlternativeState
- type RunBranchComparison
- type RunBranchRequest
- type RunBranchSelectRequest
- type RunBranchSelection
- type RuntimeResponse
- type SeatIdentity
- type SeatRuntime
- type Self
- type StateRequest
- type SyncRequest
- type SyncResponse
- type TaskFile
- type TaskRun
- type TaskRunFinish
- type TaskRunRequest
- type TaskRunResult
- type ToolCallRequest
- type ToolCallResult
- type ToolDescriptor
- type ToolList
- type VerifyResponse
- type WorkSummary
Constants ¶
const ( PathConsoleOrgs = "/console/v1/organizations" // GET list; /{id}/{seats,conversations,operations,artifacts,activity} PathConsoleSeats = "/console/v1/seats/" // {id}, {id}/executions PathConsoleExecutions = "/console/v1/executions/" // {id} PathConsoleConversations = "/console/v1/conversations/" // {id} )
const ( ActivityMessage = "message" ActivityRunStarted = "run_started" ActivityRunFinished = "run_finished" ActivityToolRequest = "tool_request" ActivityToolResult = "tool_result" ActivityError = "error" ActivityOperation = "operation" )
Activity item kinds.
const ( PathTaskRuns = "/v1/task-runs" PathTaskWorker = "/v1/task-worker" MaxTaskFiles = 64 MaxTaskFileBytes = 256 << 10 MaxTaskOutputBytes = 16 << 10 MaxTaskPromptBytes = 32 << 10 MaxActiveTaskRuns = 4 MaxTaskRunsPerExecution = 16 TaskPending = "pending" TaskRunning = "running" TaskCompleted = "completed" TaskFailed = "failed" TaskCancelled = "cancelled" TaskTimedOut = "timed_out" )
const ( // HeaderGeneration carries the caller's execution lease generation. HeaderGeneration = "X-Steadmesh-Generation" // HeaderExecution carries the current execution id, for event correlation. HeaderExecution = "X-Steadmesh-Execution" // Seat-facing paths. PathLeaseAcquire = "/v1/lease/acquire" PathLeaseRenew = "/v1/lease/renew" PathLeaseRelease = "/v1/lease/release" PathState = "/v1/state" PathSelf = "/v1/self" PathBootstrap = "/v1/bootstrap" PathTools = "/v1/tools" // GET: list descriptors PathToolCall = "/v1/tools/" // POST /v1/tools/{name} PathInboxNext = "/v1/inbox/next" // GET ?wait=<seconds> PathInboxAck = "/v1/inbox/" // POST /v1/inbox/{delivery_id}/ack PathExecEvents = "/v1/executions/" // POST /v1/executions/{id}/events PathCheckpoint = "/v1/checkpoint" // PUT PathModelProxy = "/v1/model/" // /v1/model/{connection}/... (Anthropic-compatible) PathAccess = "/v1/access" // GET: the seat's current sandbox access (egress gateway, runner) PathCredentials = "/v1/credentials/" // POST /v1/credentials/{connection}: a sandbox-delivered credential PathChannels = "/v1/channels/" // /v1/channels/{organization}/{connection}/...: humans reaching a dial-in communication adapter // Controller-facing paths. PathInternalSync = "/internal/v1/organizations:sync" // POST PathInternalOrgs = "/internal/v1/organizations/" // {id}/runtime, {id}/verify, {id} DELETE PathInternalSeats = "/internal/v1/seats/" // {id}/fence, {id}/probe, {id}/probe/{probe_id} PathHealthz = "/healthz" PathReadyz = "/readyz" )
const ( // CredentialCurrent: the latest secret content is in use. CredentialCurrent = "current" // CredentialNone: the connection has no secret reference. CredentialNone = "none" // CredentialReplacementRejected: the secret changed, the new credential // failed validation, and the previous one stays in use until // PreviousUntil. CredentialReplacementRejected = "replacement_rejected" // CredentialSecretMissing: the secret was deleted; the previous // credential stays in use until PreviousUntil. CredentialSecretMissing = "secret_missing" // CredentialRefreshFailing: the secret store or the new credential's // validation is failing transiently; the current credential stays in use. CredentialRefreshFailing = "refresh_failing" CredentialUnavailable = "unavailable" )
Credential refresh states.
const ( EventEgressDenied = "egress_denied" EventEgressRevoked = "egress_revoked" EventCredentialIssued = "credential_issued" EventCredentialDenied = "credential_denied" )
Sandbox access event kinds, recorded on the seat's execution.
const EventModelRequest = "model_request"
EventModelRequest is the ExecutionEvent.Kind the platform records for each model request a seat makes through the model proxy. Data is a ModelRequest.
const EventProbeResult = "probe_result"
EventProbeResult is the ExecutionEvent.Kind the runner posts for an origin=probe delivery before acking it (outcome=completed). Data is a ProbeResult; the platform reads data.checks from any event kind.
const MaxEventDataBytes = 8 * 1024
MaxEventDataBytes is the largest ExecutionEvent.Data the platform stores. POST /v1/executions/{id}/events accepts one ExecutionEvent or a JSON array of them. The runner replaces larger payloads with {"truncated":true,"bytes":N,"preview":"..."}.
const MaxParticipantContextBytes = 4096 // per editable field, measured in bytes
const MaxRunAlternatives = 4
const PathElasticTeams = "/v1/elastic-teams"
const PathModelBudgets = "/v1/model-budgets"
Variables ¶
This section is empty.
Functions ¶
func BranchSnapshotSHA256 ¶ added in v0.6.0
func BranchSnapshotSHA256(r RunBranchRequest) string
BranchSnapshotSHA256 identifies exactly the supplied shared handoff/files. Alternative-specific instructions are deliberately outside this snapshot.
func TaskResultSHA256 ¶ added in v0.6.0
func TaskResultSHA256(r *TaskRunResult) string
func ValidTaskPath ¶ added in v0.6.0
ValidTaskPath rejects traversal, hidden Git metadata, OS-specific separators and file/directory ambiguity. A task never receives a repository's .git.
func ValidateElasticTeam ¶ added in v0.7.0
func ValidateElasticTeam(req *ElasticTeamRequest) error
func ValidateRunBranch ¶ added in v0.6.0
func ValidateRunBranch(r *RunBranchRequest) error
ValidateRunBranch normalizes defaults before idempotency hashing. The task validator remains the single authority for files, paths and timeout limits.
func ValidateTaskFiles ¶ added in v0.6.0
func ValidateTaskRun ¶ added in v0.6.0
func ValidateTaskRun(req *TaskRunRequest) error
Types ¶
type AccessResponse ¶ added in v0.2.0
type AccessResponse struct {
SeatID string `json:"seat_id"`
SeatKey string `json:"seat_key"`
Egress []access.EgressRule `json:"egress"`
// Browser is true while the seat may use its browser.
Browser bool `json:"browser"`
// BrowserSession is the browser_session connection to load, if any.
BrowserSession string `json:"browser_session,omitempty"`
// GitHub lists the seat's github connections with sandbox delivery.
GitHub []GitHubSandbox `json:"github,omitempty"`
}
AccessResponse is a seat's current sandbox access. The egress gateway and the seat runner poll it, so live changes apply without a restart.
type Bootstrap ¶
type Bootstrap struct {
// ParticipantInstructions are operator-owned inline native-pool instructions.
ParticipantInstructions string `json:"participant_instructions,omitempty"`
Context ParticipantContext `json:"context"`
Self Self `json:"self"`
// Instructions is the rendered, ordered instruction text.
Instructions string `json:"instructions"`
// Guidance is platform guidance on memory retrieval and progress keeping.
Guidance string `json:"guidance"`
Recovery Recovery `json:"recovery"`
}
type CheckResult ¶
type Checkpoint ¶
type ConnectionInfo ¶
type ConsoleActivity ¶
type ConsoleActivity struct {
Items []ConsoleActivityItem `json:"items"`
}
ConsoleActivity is a page of activity after a cursor time, oldest first. Callers poll with after set slightly before the newest At they have seen and de-duplicate by Key, so late-committing rows are not missed.
type ConsoleActivityItem ¶
type ConsoleActivityItem struct {
// Key identifies the item for de-duplication across overlapping polls.
Key string `json:"key"`
Kind string `json:"kind"`
At time.Time `json:"at"`
SeatKey string `json:"seat_key,omitempty"`
PeerSeat string `json:"peer_seat,omitempty"`
Peer string `json:"peer,omitempty"` // binding or connection for non-seat peers
ExecutionID string `json:"execution_id,omitempty"`
MessageID string `json:"message_id,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
Status string `json:"status,omitempty"`
Summary string `json:"summary"`
}
ConsoleActivityItem is one entry of the organisation's activity feed.
type ConsoleArtifact ¶
type ConsoleArtifactList ¶
type ConsoleArtifactList struct {
Artifacts []ConsoleArtifact `json:"artifacts"`
}
type ConsoleCapability ¶
type ConsoleCapability struct {
Resource string `json:"resource"`
Operations []string `json:"operations"`
Targets []string `json:"targets,omitempty"`
Sources []string `json:"sources,omitempty"`
}
ConsoleCapability is one independent operation/target grant clause of a seat.
type ConsoleChannelBinding ¶
type ConsoleCheck ¶
type ConsoleCheck struct {
OK bool `json:"ok"`
Detail string `json:"detail,omitempty"`
CheckedAt time.Time `json:"checked_at"`
// Credential is the credential refresh state at the last check.
Credential CredentialStatus `json:"credential"`
}
type ConsoleConnection ¶
type ConsoleConnection struct {
Key string `json:"key"`
Adapter string `json:"adapter"`
Required bool `json:"required"`
SecretKind string `json:"secret_kind,omitempty"`
SecretPath string `json:"secret_path,omitempty"`
Check *ConsoleCheck `json:"check,omitempty"`
}
ConsoleConnection describes a connection and its last verification. The secret reference is reported as kind (vault, k8s) and path only.
type ConsoleConversation ¶
type ConsoleConversationDetail ¶
type ConsoleConversationDetail struct {
Conversation ConsoleConversation `json:"conversation"`
Messages []ConsoleMessage `json:"messages"`
}
type ConsoleConversationList ¶
type ConsoleConversationList struct {
Conversations []ConsoleConversation `json:"conversations"`
}
type ConsoleDelivery ¶
type ConsoleEvent ¶
type ConsoleExecution ¶
type ConsoleExecution struct {
ID string `json:"id"`
SeatID string `json:"seat_id"`
SeatKey string `json:"seat_key"`
LeaseGeneration int64 `json:"lease_generation"`
ConfigRevision string `json:"config_revision"`
HarnessAdapter string `json:"harness_adapter"`
TriggerMessageID string `json:"trigger_message_id,omitempty"`
TriggerSummary string `json:"trigger_summary,omitempty"`
TriggerOrigin string `json:"trigger_origin,omitempty"`
State string `json:"state"`
Error string `json:"error,omitempty"`
StartedAt time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Events int `json:"events"`
}
ConsoleExecution is one run of a seat. A seat keeps its id across Pod replacements; each run has its own id and the lease generation it ran under.
type ConsoleExecutionDetail ¶
type ConsoleExecutionDetail struct {
Execution ConsoleExecution `json:"execution"`
Trigger *ConsoleMessage `json:"trigger,omitempty"`
Events []ConsoleEvent `json:"events"`
Operations []ConsoleOperation `json:"operations"`
Sent []ConsoleMessage `json:"sent"`
}
ConsoleExecutionDetail is a run with its trigger, events, connector operations and the messages its seat sent while it ran.
type ConsoleExecutionList ¶
type ConsoleExecutionList struct {
Executions []ConsoleExecution `json:"executions"`
}
type ConsoleMemoryStore ¶
type ConsoleMemoryStore struct {
Key string `json:"key"`
Personal bool `json:"personal"`
Records int `json:"records"`
LastUpdatedAt *time.Time `json:"last_updated_at,omitempty"`
}
ConsoleMemoryStore is memory metadata only; record bodies are not exposed.
type ConsoleMessage ¶
type ConsoleMessage struct {
ID string `json:"id"`
ConversationID string `json:"conversation_id"`
ConversationKind string `json:"conversation_kind"`
Origin string `json:"origin"`
SenderSeat string `json:"sender_seat,omitempty"`
RecipientSeat string `json:"recipient_seat,omitempty"`
RecipientBinding string `json:"recipient_binding,omitempty"`
Route string `json:"route,omitempty"`
ParentID string `json:"parent_id,omitempty"`
CorrelationID string `json:"correlation_id,omitempty"`
Body string `json:"body"`
CreatedAt time.Time `json:"created_at"`
Deliveries []ConsoleDelivery `json:"deliveries,omitempty"`
// Outbox is the external delivery state of a reply to a human.
Outbox string `json:"outbox,omitempty"`
}
ConsoleMessage is a message with its delivery to each recipient seat.
type ConsoleOperation ¶
type ConsoleOperationList ¶
type ConsoleOperationList struct {
Operations []ConsoleOperation `json:"operations"`
}
type ConsoleOrganization ¶
type ConsoleOrganization struct {
ID string `json:"id"`
Key string `json:"key"`
Namespace string `json:"namespace"`
DisplayName string `json:"display_name"`
Revision string `json:"revision"`
Teams []string `json:"teams"`
Seats []ConsoleSeatConfig `json:"seats"`
Connections []ConsoleConnection `json:"connections"`
Bindings []ConsoleChannelBinding `json:"channel_bindings,omitempty"`
}
ConsoleOrganization is an organisation's committed configuration as the platform holds it.
type ConsoleSeatConfig ¶
type ConsoleSeatConfig struct {
SeatID string `json:"seat_id"`
OrganizationID string `json:"organization_id"`
Key string `json:"key"`
DisplayName string `json:"display_name"`
RoleRef string `json:"role_ref"`
Teams []string `json:"teams,omitempty"`
IsRepresentative bool `json:"is_representative"`
HarnessAdapter string `json:"harness_adapter"`
Model string `json:"model,omitempty"`
ConfigRevision string `json:"config_revision"`
PolicyRevision int64 `json:"policy_revision"`
PersistentWorkspace bool `json:"persistent_workspace"`
PersonalMemory string `json:"personal_memory,omitempty"`
SendTo []string `json:"send_to,omitempty"`
ChannelBindings []string `json:"channel_bindings,omitempty"`
Capabilities []ConsoleCapability `json:"capabilities,omitempty"`
CreatedAt time.Time `json:"created_at"`
AdoptedFrom string `json:"adopted_from,omitempty"`
// RetiredAt is set for a retired seat, whose history stays readable.
RetiredAt *time.Time `json:"retired_at,omitempty"`
}
ConsoleSeatConfig is a seat's committed configuration.
type ConsoleSeatDetail ¶
type ConsoleSeatDetail struct {
Config ConsoleSeatConfig `json:"config"`
Status ConsoleSeatStatus `json:"status"`
Handoff *Handoff `json:"handoff,omitempty"`
Checkpoint *Checkpoint `json:"checkpoint,omitempty"`
Memory []ConsoleMemoryStore `json:"memory,omitempty"`
Executions []ConsoleExecution `json:"executions"`
}
ConsoleSeatDetail is everything the platform records about one seat.
type ConsoleSeatList ¶
type ConsoleSeatList struct {
Seats []ConsoleSeatStatus `json:"seats"`
}
type ConsoleSeatStatus ¶
type ConsoleSeatStatus struct {
SeatRuntime
// Current is the running execution, if any.
Current *ConsoleExecution `json:"current,omitempty"`
// LastProgressAt is the time of the seat's latest tool result or output,
// as distinct from lease liveness.
LastProgressAt *time.Time `json:"last_progress_at,omitempty"`
// Unknown counts the seat's connector operations with unknown outcome.
UnknownOperations int `json:"unknown_operations"`
}
ConsoleSeatStatus is the live state of a seat from the platform's records.
type ConsoleWorkItem ¶ added in v0.2.0
type ConsoleWorkItem struct {
RecordID string `json:"record_id"`
Store string `json:"store"`
Revision int `json:"revision"`
ID string `json:"id"`
Objective string `json:"objective"`
Creator string `json:"creator"`
Owner string `json:"owner,omitempty"`
Status string `json:"status"`
Blocker string `json:"blocker,omitempty"`
Plan []ConsoleWorkStep `json:"plan,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
Acceptance []string `json:"acceptance,omitempty"`
Evidence []string `json:"evidence,omitempty"`
Links []string `json:"links,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
Publications []ConsoleWorkPublication `json:"publications,omitempty"`
}
ConsoleWorkItem is a work item from a shared store: its schema fields and publication state, never free-form note text.
type ConsoleWorkList ¶ added in v0.2.0
type ConsoleWorkList struct {
Work []ConsoleWorkItem `json:"work"`
}
type ConsoleWorkPublication ¶ added in v0.2.0
type ConsoleWorkPublication struct {
Connection string `json:"connection"`
State string `json:"state"`
ExternalID string `json:"external_id,omitempty"`
ExternalURL string `json:"external_url,omitempty"`
PublishedRevision int `json:"published_revision"`
LastError string `json:"last_error,omitempty"`
}
ConsoleWorkPublication is a work item's state in an optional tracker.
type ConsoleWorkStep ¶ added in v0.2.0
type CredentialResponse ¶ added in v0.2.0
type CredentialResponse struct {
Connection string `json:"connection"`
// Username for git (x-access-token for GitHub).
Username string `json:"username"`
Token string `json:"token"`
// ExpiresAt is zero for credentials that do not expire (a PAT).
ExpiresAt time.Time `json:"expires_at,omitzero"`
// Revocable reports whether Steadmesh can invalidate the credential.
Revocable bool `json:"revocable"`
// Data carries non-token credentials, e.g. a browser storage state.
Data json.RawMessage `json:"data,omitempty"`
}
CredentialResponse is a credential delivered to the sandbox.
type CredentialStatus ¶ added in v0.2.0
type CredentialStatus struct {
State string `json:"state"`
// SecretVersion is the store's version of the secret in use
// (Kubernetes resourceVersion or Vault KV version).
SecretVersion string `json:"secret_version,omitempty"`
RefreshedAt *time.Time `json:"refreshed_at,omitempty"`
// Error explains a degraded or unavailable state.
Error string `json:"error,omitempty"`
// PreviousUntil is when a previous credential stops being used.
PreviousUntil *time.Time `json:"previous_until,omitempty"`
// FailingSince is when refresh started failing.
FailingSince *time.Time `json:"failing_since,omitempty"`
}
CredentialStatus is the non-secret refresh state of a connection's credential.
func (CredentialStatus) Degraded ¶ added in v0.2.0
func (s CredentialStatus) Degraded() bool
Degraded reports whether the credential works now but needs attention.
type ElasticTeam ¶ added in v0.7.0
type ElasticTeam struct {
ID string `json:"id"`
RequestID string `json:"request_id"`
ParentExecutionID string `json:"parent_execution_id"`
Workers []ElasticTeamWorker `json:"workers"`
}
type ElasticTeamRequest ¶ added in v0.7.0
type ElasticTeamRequest struct {
RequestID string `json:"request_id"`
Workers []ElasticWorkerRequest `json:"workers"`
}
ElasticTeamRequest admits the entire required team or no workers at all. Workers cannot alter templates or request an independent execution identity.
type ElasticTeamWorker ¶ added in v0.7.0
type ElasticWorkerRequest ¶ added in v0.7.0
type ElasticWorkerRequest struct {
Name string `json:"name"`
Template string `json:"template"`
Task TaskRunRequest `json:"task"`
}
type Envelope ¶
type Envelope struct {
MessageID string `json:"message_id"`
OrganizationID string `json:"organization_id"`
ConversationID string `json:"conversation_id"`
Origin string `json:"origin"` // human, external_agent, seat, system, schedule, probe
// For human origin: the binding key and verified external user.
Binding string `json:"binding,omitempty"`
ExternalUserID string `json:"external_user_id,omitempty"`
// For external_agent origin: the authenticated caller, never a human identity.
ExternalCallerID string `json:"external_caller_id,omitempty"`
SenderSeat string `json:"sender_seat,omitempty"`
SenderSeatID string `json:"sender_seat_id,omitempty"`
RecipientSeat string `json:"recipient_seat"`
ParentID string `json:"parent_id,omitempty"`
CorrelationID string `json:"correlation_id,omitempty"`
Body string `json:"body"`
CreatedAt time.Time `json:"created_at"`
// ReplyRoute describes how to reply: "binding:<key>", "seat:<key>", or "external:<message_id>".
ReplyRoute string `json:"reply_route,omitempty"`
}
Envelope is the durable message envelope. Origin fields are assigned by trusted ingress; agent-authored text cannot overwrite them.
type Error ¶
type Error struct {
Code string `json:"code"` // unauthenticated, forbidden, fenced, conflict, not_found, invalid, blocked, unavailable
Message string `json:"message"`
}
Error is the JSON body of every non-2xx response.
type ExecutionEvent ¶
type FenceRequest ¶
type FenceRequest struct {
// ExpectedGeneration must match the current generation; the platform then
// increments it so the previous holder's calls are rejected.
ExpectedGeneration int64 `json:"expected_generation"`
}
type GitHubSandbox ¶ added in v0.2.0
type GitHubSandbox struct {
Connection string `json:"connection"`
// Host is the git host the credential is for.
Host string `json:"host"`
}
GitHubSandbox is a github connection whose credential the sandbox may fetch.
type Handoff ¶
type Handoff struct {
Objective string `json:"objective"`
Unresolved []string `json:"unresolved,omitempty"`
RecordIDs []string `json:"record_ids,omitempty"`
PendingMessageIDs []string `json:"pending_message_ids,omitempty"`
OperationIDs []string `json:"operation_ids,omitempty"`
Notes string `json:"notes,omitempty"`
}
type InboxAckRequest ¶
type InboxDelivery ¶
type InboxDelivery struct {
DeliveryID int64 `json:"delivery_id"`
ExecutionID string `json:"execution_id"`
Attempt int `json:"attempt"`
Message Envelope `json:"message"`
// Passive are messages sent with wake=false that were waiting for this
// seat's next turn. They are delivered with this turn and need no ack.
Passive []Envelope `json:"passive,omitempty"`
}
type InstructionInfo ¶
type InstructionProposal ¶ added in v0.7.0
type InstructionProposal struct {
ID string `json:"id"`
Sequence int64 `json:"sequence"`
OwnerSeatID string `json:"owner_seat_id"`
Instructions string `json:"instructions"`
Reason string `json:"reason"`
ExpectedContextRevision int `json:"expected_context_revision"`
PolicyToken string `json:"policy_token"`
Status string `json:"status"`
ReviewerSeatID string `json:"reviewer_seat_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
InstructionProposal exposes proposed text, not the owner's private context.
type LeaseAcquireRequest ¶
type LeaseAcquireRequest struct {
// Holder is informational; the platform records the Pod UID from the token.
Holder string `json:"holder,omitempty"`
}
type LeaseRenewRequest ¶
type LeaseRenewRequest struct {
Generation int64 `json:"generation"`
}
type LeaseResponse ¶
type MemoryStoreInfo ¶
type ModelBudgetStatus ¶ added in v0.6.0
type ModelBudgetStatus struct {
Limits *spec.ModelBudgets `json:"limits,omitempty"`
Day string `json:"day"`
ResetsAt time.Time `json:"resets_at"`
OrganizationOutputTokens int64 `json:"organization_output_tokens"`
SeatOutputTokens int64 `json:"seat_output_tokens"`
ExecutionOutputTokens int64 `json:"execution_output_tokens"`
}
ModelBudgetStatus reports charged usage, including pending and uncertain reservations. Execution usage is included only for the caller's execution.
type ModelRequest ¶ added in v0.2.0
type ModelRequest struct {
BudgetReservationID string `json:"budget_reservation_id,omitempty"`
ReservedOutputTokens int64 `json:"reserved_output_tokens,omitempty"`
Connection string `json:"connection"`
API string `json:"api"`
Model string `json:"model,omitempty"`
UpstreamHost string `json:"upstream_host"`
Status int `json:"status"`
Stream bool `json:"stream,omitempty"`
DurationMS int64 `json:"duration_ms"`
// Usage is the token usage the endpoint reported, when it did.
Usage map[string]int64 `json:"usage,omitempty"`
// Rejected is why the platform refused the request before sending it.
Rejected string `json:"rejected,omitempty"`
// CredentialRefreshed is true when the request was retried after the
// connection's credential was refreshed.
CredentialRefreshed bool `json:"credential_refreshed,omitempty"`
}
ModelRequest records what a seat actually asked of which endpoint.
type Operation ¶
type Operation struct {
ID string `json:"id"`
Connection string `json:"connection"`
Operation string `json:"operation"`
Target string `json:"target,omitempty"`
IdempotencyKey string `json:"idempotency_key"`
Status string `json:"status"` // pending, succeeded, failed, unknown
ExternalReceipt string `json:"external_receipt,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type ParticipantContext ¶ added in v0.7.0
type ParticipantContext struct {
ApproverSeatID string `json:"approver_seat_id,omitempty"`
Revision int `json:"revision"`
Instructions string `json:"instructions"`
Summary string `json:"summary"`
ActorSeatID string `json:"actor_seat_id,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
ParticipantContext is private, agent-authored working context. It never replaces operator instructions, mission, policy, identity or grants.
type PoolMember ¶ added in v0.7.0
type PoolMember struct {
SeatID string `json:"seat_id"`
SeatKey string `json:"seat_key"`
Team string `json:"team"`
Template string `json:"template"`
State string `json:"state"`
RetainedUntil *time.Time `json:"retained_until,omitempty"`
PurgedAt *time.Time `json:"purged_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
PoolMember is an independently authenticated ordinary seat, not a child task.
type PoolSpawnRequest ¶ added in v0.7.0
type ProbeResponse ¶
type ProbeResult ¶
ProbeResult is the Data of an EventProbeResult event. Checks maps a check name (tool, workspace, model) to "ok" or "fail: <reason>"; a value starting with "fail" or equal to "false" fails the probe.
type RecipientInfo ¶
type Recovery ¶
type Recovery struct {
// Session is the harness checkpoint, if any.
Session *Checkpoint `json:"session,omitempty"`
Handoff *Handoff `json:"handoff,omitempty"`
// PendingMessages is the number of undelivered inbox messages.
PendingMessages int `json:"pending_messages"`
// UnknownOperations are external operations whose outcome is unknown and
// must be reconciled by the agent before being reissued (§6.3).
UnknownOperations []Operation `json:"unknown_operations,omitempty"`
// Work lists the unfinished work items this seat owns, so it can pick
// them up again after a restart.
Work []WorkSummary `json:"work,omitempty"`
// Note explains the recovery state, e.g. "native session not convertible;
// resumed from portable handoff" (§6.4).
Note string `json:"note,omitempty"`
}
type RetiringSeat ¶ added in v0.3.0
RetiringSeat is a seat winding down before retirement.
type RunAlternative ¶ added in v0.6.0
type RunAlternativeState ¶ added in v0.6.0
type RunAlternativeState struct {
Name string `json:"name"`
TaskRunID string `json:"task_run_id"`
State string `json:"state"`
OutputPreview string `json:"output_preview,omitempty"`
OutputTruncated bool `json:"output_truncated,omitempty"`
ErrorPreview string `json:"error_preview,omitempty"`
ErrorTruncated bool `json:"error_truncated,omitempty"`
ResultSHA256 string `json:"result_sha256,omitempty"`
ArtifactCount int `json:"artifact_count"`
ArtifactBytes int `json:"artifact_bytes"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type RunBranchComparison ¶ added in v0.6.0
type RunBranchComparison struct {
ID string `json:"id"`
RequestID string `json:"request_id"`
ParentExecutionID string `json:"parent_execution_id"`
SnapshotSHA256 string `json:"snapshot_sha256"`
InputFileCount int `json:"input_file_count"`
Revision int `json:"revision"`
AllTerminal bool `json:"all_terminal"`
Alternatives []RunAlternativeState `json:"alternatives"`
Selection *RunBranchSelection `json:"selection,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
RunBranchComparison is bounded metadata and result previews. tasks.get and the task-run API retrieve the full per-alternative inputs and results.
type RunBranchRequest ¶ added in v0.6.0
type RunBranchRequest struct {
RequestID string `json:"request_id"`
Handoff string `json:"handoff"`
InputFiles []TaskFile `json:"input_files,omitempty"`
ArtifactPaths []string `json:"artifact_paths,omitempty"`
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
Alternatives []RunAlternative `json:"alternatives"`
}
RunBranchRequest starts independent alternatives from explicitly supplied context. It never reads a parent workspace, checkpoint, environment or secret. The request and each child's input are immutable after creation.
type RunBranchSelectRequest ¶ added in v0.6.0
type RunBranchSelection ¶ added in v0.6.0
type RunBranchSelection struct {
TaskRunID string `json:"task_run_id"`
ResultSHA256 string `json:"result_sha256"`
SelectedAt time.Time `json:"selected_at"`
}
RunBranchSelection records a deliberate choice, never a merge or file write. The digest binds the choice to the complete, immutable result reviewed.
type RuntimeResponse ¶
type RuntimeResponse struct {
Seats map[string]SeatRuntime `json:"seats"`
}
type SeatIdentity ¶
type SeatRuntime ¶
type SeatRuntime struct {
SeatID string `json:"seat_id"`
SeatKey string `json:"seat_key"`
PendingDeliveries int `json:"pending_deliveries"`
// TaskWorkers keeps the parent warm until children and cleanup finish.
TaskWorkers int `json:"task_workers"`
OldestPendingAge float64 `json:"oldest_pending_age_seconds"`
LeaseGeneration int64 `json:"lease_generation"`
LeaseHolder string `json:"lease_holder,omitempty"`
LeaseExpiresAt time.Time `json:"lease_expires_at"`
State string `json:"state"`
StateDetail string `json:"state_detail,omitempty"`
AdoptedRevision string `json:"adopted_revision,omitempty"`
LastActivity *time.Time `json:"last_activity,omitempty"`
LatestCheckpoint string `json:"latest_checkpoint,omitempty"`
DeadDeliveries int `json:"dead_deliveries"`
// RetireBy is set while the seat is retiring: removed from the
// declaration and winding down until then.
RetireBy *time.Time `json:"retire_by,omitempty"`
}
SeatRuntime is the platform's view of one seat, used for wake and idle decisions.
type Self ¶
type Self struct {
OrganizationID string `json:"organization_id"`
OrganizationKey string `json:"organization_key"`
OrganizationName string `json:"organization_name"`
SeatID string `json:"seat_id"`
SeatKey string `json:"seat_key"`
DisplayName string `json:"display_name"`
Teams []string `json:"teams,omitempty"`
IsRepresentative bool `json:"is_representative"`
ConfigRevision string `json:"config_revision"`
PolicyRevision int64 `json:"policy_revision"`
Instructions []InstructionInfo `json:"instructions"`
MemoryStores []MemoryStoreInfo `json:"memory_stores"`
Recipients []RecipientInfo `json:"recipients"`
Connections []ConnectionInfo `json:"connections"`
ChannelBindings []string `json:"channel_bindings,omitempty"`
// Timezone is the IANA time zone the seat reads and schedules times of
// day in: its human's for a representative.
Timezone string `json:"timezone"`
// RetiringUntil is set while the seat is retiring: it was removed from
// the declaration, takes no new messages and stops at this time.
RetiringUntil *time.Time `json:"retiring_until,omitempty"`
}
type StateRequest ¶
type StateRequest struct {
Generation int64 `json:"generation"`
State string `json:"state"` // Warm, Executing, Quiescing, Stopped
Detail string `json:"detail,omitempty"`
// AdoptedRevision is the config revision the runner is executing with.
AdoptedRevision string `json:"adopted_revision,omitempty"`
}
type SyncRequest ¶
type SyncRequest struct {
Namespace string `json:"namespace"`
Key string `json:"key"`
SourceUID string `json:"source_uid"`
// Manifest is a compile.Manifest serialised as JSON.
Manifest json.RawMessage `json:"manifest"`
}
SyncRequest establishes durable identities for an organisation's resolved manifest. It is idempotent.
type SyncResponse ¶
type SyncResponse struct {
// RuntimeSeats are effective runtime manifests including pool participants and updated peer routes, never persisted as desired spec.
RuntimeSeats map[string]json.RawMessage `json:"runtime_seats,omitempty"`
OrganizationID string `json:"organization_id"`
Seats map[string]SeatIdentity `json:"seats"`
// Retiring lists seats removed from the declaration that are winding
// down: they take no new messages, get one retirement notice turn and
// are retired at RetireBy at the latest.
Retiring map[string]RetiringSeat `json:"retiring,omitempty"`
}
type TaskFile ¶ added in v0.6.0
TaskFile is an explicit, bounded UTF-8 file. Paths are relative to a fresh workspace, never the persistent seat's volume. Binary artifacts are not v1.
type TaskRun ¶ added in v0.6.0
type TaskRun struct {
ID string `json:"id"`
ParentSeatID string `json:"parent_seat_id"`
ParentExecutionID string `json:"parent_execution_id"`
ParentGeneration int64 `json:"parent_generation"`
ConfigRevision string `json:"config_revision"`
ServiceAccount string `json:"service_account"`
PodUID string `json:"pod_uid,omitempty"`
State string `json:"state"`
Request TaskRunRequest `json:"request"`
Result *TaskRunResult `json:"result,omitempty"`
CreatedAt time.Time `json:"created_at"`
Deadline time.Time `json:"deadline"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
CleanedAt *time.Time `json:"cleaned_at,omitempty"`
// LaunchStartedAt is a durable, one-shot create fence. An unresolved launch
// retains capacity indefinitely; it must never be reclaimed by a lease TTL.
LaunchStartedAt *time.Time `json:"launch_started_at,omitempty"`
LaunchResolvedAt *time.Time `json:"launch_resolved_at,omitempty"`
}
TaskRun is durable after its disposable runtime has been removed. Technical completion is not approval of the agent's output or permission to apply it.
type TaskRunFinish ¶ added in v0.6.0
type TaskRunFinish struct {
State string `json:"state"`
Result TaskRunResult `json:"result"`
}
type TaskRunRequest ¶ added in v0.6.0
type TaskRunRequest struct {
// Template is server-assigned for an admitted elastic team member.
Template string `json:"template,omitempty"`
RequestID string `json:"request_id"`
Prompt string `json:"prompt"`
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
ToolNames []string `json:"tool_names,omitempty"`
InputFiles []TaskFile `json:"input_files,omitempty"`
ArtifactPaths []string `json:"artifact_paths,omitempty"`
}
TaskRunRequest cannot select a new model, identity, runtime or credential. ToolNames narrows existing read-only memory grants; omitted means none.
func BranchTaskRequest ¶ added in v0.6.0
func BranchTaskRequest(r RunBranchRequest, a RunAlternative, requestID string) TaskRunRequest
BranchTaskRequest uses only explicit handoff/files and an alternative's prompt. No platform tools are delegated, and no parent session is resumed.
type TaskRunResult ¶ added in v0.6.0
type ToolCallRequest ¶
type ToolCallRequest struct {
Arguments json.RawMessage `json:"arguments"`
}
type ToolCallResult ¶
type ToolCallResult struct {
// Content is the bounded JSON result.
Content json.RawMessage `json:"content"`
// IsError marks a tool-level failure the agent should see (denied,
// conflict, invalid). Transport errors use HTTP status codes instead.
IsError bool `json:"is_error,omitempty"`
}
type ToolDescriptor ¶
type ToolDescriptor struct {
Name string `json:"name"` // dotted, e.g. memory.search
Description string `json:"description"`
InputSchema json.RawMessage `json:"input_schema"`
}
type ToolList ¶
type ToolList struct {
Tools []ToolDescriptor `json:"tools"`
}
ToolList is the body of GET /v1/tools.
type VerifyResponse ¶
type VerifyResponse struct {
Connections map[string]CheckResult `json:"connections"`
Ingress map[string]CheckResult `json:"ingress"`
Bindings map[string]CheckResult `json:"bindings"`
// Credentials reports the refresh state of each connection's secret.
Credentials map[string]CredentialStatus `json:"credentials,omitempty"`
}
type WorkSummary ¶ added in v0.2.0
type WorkSummary struct {
WorkID string `json:"work_id"`
Objective string `json:"objective"`
Status string `json:"status"`
Revision int `json:"revision"`
CurrentStep string `json:"current_step,omitempty"`
LastNote string `json:"last_note,omitempty"`
}
WorkSummary is a work item in a seat's recovery context.