Documentation
¶
Overview ¶
Package session defines the durable, harness-neutral session model.
Index ¶
- Constants
- func ValidText(value string) bool
- func ValidateExternal(value *string, maxBytes int, path ...any) error
- type APIError
- type Acceptance
- type AgentConfiguration
- type AgentInput
- type Cancellation
- type CodexConfiguration
- type Configuration
- type ConfigurationInput
- type CreateSession
- type CredentialStore
- type Credentials
- type Detail
- type Error
- type Event
- type EventPage
- type HistoryItem
- type HistoryPage
- type HookResult
- type HooksConfiguration
- type HooksInput
- type Limits
- type Message
- type Page
- type Position
- type ResolvedConfiguration
- type Run
- type SandboxConfiguration
- type SandboxInput
- type SandboxState
- type Session
- type Status
- type TextMessage
- type ToolCall
- type Usage
Constants ¶
View Source
const ( NamespaceMaxBytes = 128 ExternalKeyMaxBytes = 512 InputFingerprintMaxBytes = 256 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Acceptance ¶
type AgentConfiguration ¶
type AgentConfiguration struct {
Profile string `json:"profile"`
Model string `json:"model"`
Codex CodexConfiguration `json:"codex,omitzero"`
Instructions string `json:"instructions"`
}
type AgentInput ¶
type Cancellation ¶
type CodexConfiguration ¶ added in v0.1.5
type CodexConfiguration struct {
Effort string `json:"effort,omitzero"`
}
type Configuration ¶
type Configuration struct {
Agent AgentConfiguration `json:"agent"`
Sandbox SandboxConfiguration `json:"sandbox"`
Limits Limits `json:"limits"`
Hooks HooksConfiguration `json:"hooks"`
}
type ConfigurationInput ¶
type ConfigurationInput struct {
Agent AgentInput `json:"agent"`
Sandbox SandboxInput `json:"sandbox"`
Limits Limits `json:"limits"`
Hooks *HooksInput `json:"hooks,omitzero"`
}
type CreateSession ¶
type CreateSession struct {
Namespace *string `json:"namespace,omitzero"`
ExternalKey *string `json:"external_key,omitzero"`
InputFingerprint *string `json:"input_fingerprint,omitzero"`
Configuration ConfigurationInput `json:"configuration"`
Messages []TextMessage `json:"messages"`
Env map[string]string `json:"env,omitzero"`
EnvFrom []string `json:"env_from,omitzero"`
}
type CredentialStore ¶
type Credentials ¶
type Credentials struct {
Mode string `json:"mode" toml:"mode"`
AccountID string `json:"account_id,omitzero" toml:"account_id"`
APIKeyEnv string `json:"api_key_env" toml:"api_key_env"`
Store *CredentialStore `json:"store" toml:"-"`
Key string `json:"key" toml:"key"`
}
type HistoryItem ¶
type HistoryPage ¶
type HistoryPage struct {
Page[HistoryItem]
EventCursor string `json:"event_cursor"`
}
type HookResult ¶
type HookResult struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
StartedAt *time.Time `json:"started_at"`
DeadlineAt *time.Time `json:"deadline_at"`
FinishedAt *time.Time `json:"finished_at"`
ExitCode *int `json:"exit_code"`
Signal *int `json:"signal"`
Output json.RawMessage `json:"output"`
OutputCompleteness string `json:"output_completeness"`
TruncationReason *string `json:"truncation_reason"`
Error *Error `json:"error"`
}
type HooksConfiguration ¶
type HooksInput ¶
type Message ¶
type Message struct {
ExternalKey *string `json:"external_key"`
Metadata json.RawMessage `json:"metadata"`
ID uuid.UUID `json:"id"`
SessionID uuid.UUID `json:"session_id"`
RunID uuid.UUID `json:"run_id"`
Role string `json:"role"`
Kind *string `json:"kind"`
Text string `json:"text"`
DeliveryStatus *string `json:"delivery_status"`
Error *Error `json:"error"`
RegisteredSequence string `json:"registered_sequence"`
Position *Position `json:"position"`
CreatedAt time.Time `json:"created_at"`
}
type ResolvedConfiguration ¶
type ResolvedConfiguration struct {
Version int `json:"version"`
Harness string `json:"harness"`
Public Configuration `json:"public"`
Credentials Credentials `json:"credentials"`
}
type Run ¶
type Run struct {
Usage Usage `json:"usage"`
InputFingerprint *string `json:"input_fingerprint"`
EnvNames []string `json:"env_names"`
EnvFrom []string `json:"env_from"`
ID uuid.UUID `json:"id"`
SessionID uuid.UUID `json:"session_id"`
Number int `json:"number"`
Status Status `json:"status"`
Phase *string `json:"phase"`
AgentStatus *Status `json:"agent_status"`
AgentError *Error `json:"agent_error"`
Hooks []HookResult `json:"hooks"`
Observation *string `json:"observation"`
CreatedAt time.Time `json:"created_at"`
ExecutionStartedAt *time.Time `json:"execution_started_at"`
DeadlineAt *time.Time `json:"deadline_at"`
FinishedAt *time.Time `json:"finished_at"`
CancelRequestedAt *time.Time `json:"cancel_requested_at"`
StopReason *string `json:"stop_reason"`
StopMethod *string `json:"stop_method"`
FinalMessage *Message `json:"final_message"`
Error *Error `json:"error"`
}
type SandboxConfiguration ¶
type SandboxInput ¶
type SandboxState ¶
type Session ¶
type Session struct {
Usage Usage `json:"usage"`
Namespace *string `json:"namespace"`
ExternalKey *string `json:"external_key"`
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
Configuration Configuration `json:"configuration"`
Sandbox SandboxState `json:"sandbox"`
ActiveRunID *uuid.UUID `json:"active_run_id"`
LastRunID uuid.UUID `json:"last_run_id"`
LastRunCreatedAt time.Time `json:"last_run_created_at"`
Status Status `json:"status"`
Phase *string `json:"phase"`
FinalMessage *Message `json:"final_message"`
Error *Error `json:"error"`
}
type TextMessage ¶
type TextMessage struct {
ExternalKey *string `json:"external_key,omitzero"`
Text string `json:"text"`
Metadata json.RawMessage `json:"metadata,omitzero"`
}
type ToolCall ¶
type ToolCall struct {
ID uuid.UUID `json:"id"`
SessionID uuid.UUID `json:"session_id"`
RunID uuid.UUID `json:"run_id"`
Name string `json:"name"`
Input json.RawMessage `json:"input"`
Status string `json:"status"`
Result json.RawMessage `json:"result"`
OutputCompleteness string `json:"output_completeness"`
TruncationReason *string `json:"truncation_reason"`
RegisteredSequence string `json:"registered_sequence"`
Position *Position `json:"position"`
CreatedAt time.Time `json:"created_at"`
}
Click to show internal directories.
Click to hide internal directories.