Documentation
¶
Index ¶
- func CloneRoots(sourcePath, targetPath string) error
- func DefaultDir() (string, error)
- func SaveConfig(path string, cfg Config) error
- type CommandRecord
- type CommandSnapshot
- type Config
- type CredentialStore
- type RequestRecord
- type State
- func (s *State) AddRoot(path string) error
- func (s *State) Close() error
- func (s *State) Command(id uuid.UUID) (CommandRecord, bool, error)
- func (s *State) Commands(limit int) ([]CommandSnapshot, error)
- func (s *State) CompleteCommand(id uuid.UUID, result json.RawMessage, errorMessage string) error
- func (s *State) DeleteRequest(key string) error
- func (s *State) MarkReceived(id uuid.UUID) (CommandRecord, bool, error)
- func (s *State) PutRequest(record RequestRecord) error
- func (s *State) PutTask(record TaskRecord) error
- func (s *State) PutWorkspace(record WorkspaceRecord) error
- func (s *State) ReconcileIdentity(keepCommandID uuid.UUID, workspaceIDs []uuid.UUID) error
- func (s *State) Request(key string) (RequestRecord, bool, error)
- func (s *State) Roots() ([]string, error)
- func (s *State) Task(id uuid.UUID) (TaskRecord, bool, error)
- func (s *State) TaskByThread(threadID string) (TaskRecord, bool, error)
- func (s *State) Tasks() ([]TaskRecord, error)
- func (s *State) Workspace(id uuid.UUID) (WorkspaceRecord, bool, error)
- func (s *State) Workspaces() ([]WorkspaceRecord, error)
- type TaskRecord
- type WorkspaceRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneRoots ¶ added in v1.2.1
CloneRoots prepares a state database for a new cloud identity without carrying over task, command or workspace identifiers owned by the old one.
func DefaultDir ¶
func SaveConfig ¶
Types ¶
type CommandRecord ¶
type CommandSnapshot ¶
type CommandSnapshot struct {
CommandID uuid.UUID `json:"commandId"`
CommandRecord
}
type Config ¶
type Config struct {
ServerURL string `json:"serverUrl"`
RunnerID uuid.UUID `json:"runnerId"`
NodeID string `json:"nodeId"`
Name string `json:"name"`
StatePath string `json:"statePath"`
}
func LoadConfig ¶
type CredentialStore ¶
type CredentialStore struct {
// contains filtered or unexported fields
}
func OpenCredentialStore ¶
func OpenCredentialStore(dir string) (*CredentialStore, error)
func (*CredentialStore) Delete ¶
func (s *CredentialStore) Delete() error
func (*CredentialStore) Get ¶
func (s *CredentialStore) Get() (string, error)
func (*CredentialStore) Set ¶
func (s *CredentialStore) Set(credential string) error
type RequestRecord ¶
type RequestRecord struct {
Key string `json:"key"`
TaskID uuid.UUID `json:"taskId"`
Method string `json:"method"`
RequestID json.RawMessage `json:"requestId"`
Params json.RawMessage `json:"params,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
RequestRecord is intentionally Runner-local. In particular, the raw Codex JSON-RPC request id must never be copied to the Control Plane database.
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) Commands ¶
func (s *State) Commands(limit int) ([]CommandSnapshot, error)
Commands returns the newest durable command records. UUIDv7 command keys sort chronologically, so walking the bucket backwards gives a bounded reconnect snapshot without allowing this message to grow forever.
func (*State) CompleteCommand ¶
func (*State) DeleteRequest ¶
func (*State) MarkReceived ¶
func (*State) PutRequest ¶
func (s *State) PutRequest(record RequestRecord) error
func (*State) PutTask ¶
func (s *State) PutTask(record TaskRecord) error
func (*State) PutWorkspace ¶
func (s *State) PutWorkspace(record WorkspaceRecord) error
func (*State) ReconcileIdentity ¶ added in v1.2.1
ReconcileIdentity removes stale runtime records after the user explicitly merges old Runner installations. Authorized roots and selected workspaces remain available; only the current reconcile command survives for ack/result.
func (*State) TaskByThread ¶
func (s *State) TaskByThread(threadID string) (TaskRecord, bool, error)
func (*State) Tasks ¶
func (s *State) Tasks() ([]TaskRecord, error)
func (*State) Workspaces ¶
func (s *State) Workspaces() ([]WorkspaceRecord, error)
type TaskRecord ¶
type TaskRecord struct {
TaskID uuid.UUID `json:"taskId"`
ThreadID string `json:"threadId"`
ActiveTurnID string `json:"activeTurnId,omitempty"`
RelayTurnID uuid.UUID `json:"relayTurnId,omitempty"`
WorkspaceID uuid.UUID `json:"workspaceId"`
Workspace string `json:"workspace"`
BaselineDiff string `json:"baselineDiff,omitempty"`
UpdatedAt time.Time `json:"updatedAt"`
}