Documentation
¶
Index ¶
- Constants
- Variables
- func DecodePayload[T any](envelope Envelope) (T, error)
- type APIRelayRequest
- type APIRelayResponse
- type ArtifactEntry
- type ArtifactEntryKind
- type ArtifactSyncRequest
- type CommandOpenRequest
- type Envelope
- type ErrorClass
- type ErrorCode
- type ErrorPayload
- type Hello
- type HelloAck
- type MessageType
- type Operation
- type PreflightRequest
- type PreparedRepo
- type ProbeResponse
- type ProcessStartRequest
- type ProcessStatusRequest
- type ProcessStatusResponse
- type SessionCloseRequest
- type SessionExitEvent
- type SessionInputRequest
- type SessionOutputEvent
- type SessionResizeRequest
- type SessionResponse
- type SessionSignalRequest
- type WorkspacePrepareRequest
- type WorkspacePrepareResponse
- type WorkspaceRepo
- type WorkspaceRepoAuth
- type WorkspaceResetRequest
Constants ¶
View Source
const ProtocolVersion = 1
Variables ¶
View Source
var ( ErrUnexpectedMessage = errors.New("websocket runtime message is unexpected") ErrUnsupportedVersion = errors.New("websocket runtime version is unsupported") )
Functions ¶
func DecodePayload ¶
Types ¶
type APIRelayRequest ¶ added in v0.7.0
type APIRelayRequest struct {
Method string `json:"method"`
URL string `json:"url"`
Headers map[string][]string `json:"headers,omitempty"`
Body []byte `json:"body,omitempty"`
}
APIRelayRequest forwards JSON-oriented OpenASE CLI requests over the websocket runtime channel.
type APIRelayResponse ¶ added in v0.7.0
type ArtifactEntry ¶
type ArtifactEntry struct {
Path string `json:"path"`
Kind ArtifactEntryKind `json:"kind"`
Mode int64 `json:"mode,omitempty"`
ContentBase64 string `json:"content_base64,omitempty"`
}
type ArtifactEntryKind ¶
type ArtifactEntryKind string
const ( ArtifactEntryKindFile ArtifactEntryKind = "file" ArtifactEntryKindDir ArtifactEntryKind = "dir" )
type ArtifactSyncRequest ¶
type ArtifactSyncRequest struct {
TargetRoot string `json:"target_root"`
RemovePaths []string `json:"remove_paths,omitempty"`
Entries []ArtifactEntry `json:"entries,omitempty"`
}
type CommandOpenRequest ¶
type Envelope ¶
type Envelope struct {
Version int `json:"version"`
Type MessageType `json:"type"`
RequestID string `json:"request_id,omitempty"`
Operation Operation `json:"operation,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
Error *ErrorPayload `json:"error,omitempty"`
}
func ParseEnvelope ¶
type ErrorClass ¶
type ErrorClass string
const ( ErrorClassAuth ErrorClass = "auth" ErrorClassMisconfiguration ErrorClass = "misconfiguration" ErrorClassTransient ErrorClass = "transient" ErrorClassUnsupported ErrorClass = "unsupported" ErrorClassInternal ErrorClass = "internal" )
func (ErrorClass) IsValid ¶
func (c ErrorClass) IsValid() bool
type ErrorCode ¶
type ErrorCode string
const ( ErrorCodeInvalidRequest ErrorCode = "invalid_request" ErrorCodeProtocolVersion ErrorCode = "protocol_version" ErrorCodeWorkspace ErrorCode = "workspace" ErrorCodeArtifactSync ErrorCode = "artifact_sync" ErrorCodePreflight ErrorCode = "preflight" ErrorCodeSessionNotFound ErrorCode = "session_not_found" ErrorCodeProcessStart ErrorCode = "process_start" ErrorCodeProcessSignal ErrorCode = "process_signal" ErrorCodeUnsupported ErrorCode = "unsupported" ErrorCodeInternal ErrorCode = "internal" )
type ErrorPayload ¶
type MessageType ¶
type MessageType string
const ( MessageTypeHello MessageType = "hello" MessageTypeHelloAck MessageType = "hello_ack" MessageTypeRequest MessageType = "request" MessageTypeResponse MessageType = "response" MessageTypeEvent MessageType = "event" )
func (MessageType) IsValid ¶
func (t MessageType) IsValid() bool
type Operation ¶
type Operation string
const ( OperationProbe Operation = "probe" OperationPreflight Operation = "preflight" OperationWorkspacePrepare Operation = "workspace_prepare" OperationWorkspaceReset Operation = "workspace_reset" OperationArtifactSync Operation = "artifact_sync" OperationCommandOpen Operation = "command_open" OperationSessionInput Operation = "session_input" OperationSessionResize Operation = "session_resize" OperationSessionSignal Operation = "session_signal" OperationSessionClose Operation = "session_close" OperationProcessStart Operation = "process_start" OperationProcessStatus Operation = "process_status" OperationAPIRelay Operation = "api_relay" OperationSessionOutput Operation = "session_output" OperationSessionExit Operation = "session_exit" )
type PreflightRequest ¶
type PreparedRepo ¶
type ProbeResponse ¶
type ProbeResponse struct {
CheckedAt string `json:"checked_at"`
Output string `json:"output"`
Resources map[string]any `json:"resources,omitempty"`
DetectedOS string `json:"detected_os,omitempty"`
DetectedArch string `json:"detected_arch,omitempty"`
DetectionStatus string `json:"detection_status,omitempty"`
}
type ProcessStartRequest ¶
type ProcessStatusRequest ¶
type ProcessStatusRequest struct {
SessionID string `json:"session_id"`
}
type ProcessStatusResponse ¶
type SessionCloseRequest ¶
type SessionCloseRequest struct {
SessionID string `json:"session_id"`
}
type SessionExitEvent ¶
type SessionInputRequest ¶
type SessionOutputEvent ¶
type SessionResizeRequest ¶ added in v0.7.0
type SessionResponse ¶
type SessionResponse struct {
SessionID string `json:"session_id"`
}
type SessionSignalRequest ¶
type WorkspacePrepareRequest ¶
type WorkspacePrepareRequest struct {
WorkspaceRoot string `json:"workspace_root"`
OrganizationSlug string `json:"organization_slug"`
ProjectSlug string `json:"project_slug"`
AgentName string `json:"agent_name,omitempty"`
TicketIdentifier string `json:"ticket_identifier"`
MachineID string `json:"machine_id,omitempty"`
RunID string `json:"run_id,omitempty"`
TicketID string `json:"ticket_id,omitempty"`
Repos []WorkspaceRepo `json:"repos,omitempty"`
}
type WorkspacePrepareResponse ¶
type WorkspacePrepareResponse struct {
Path string `json:"path"`
BranchName string `json:"branch_name"`
Repos []PreparedRepo `json:"repos,omitempty"`
}
type WorkspaceRepo ¶
type WorkspaceRepo struct {
Name string `json:"name"`
RepositoryURL string `json:"repository_url"`
DefaultBranch string `json:"default_branch,omitempty"`
WorkspaceDirname *string `json:"workspace_dirname,omitempty"`
BranchName *string `json:"branch_name,omitempty"`
HTTPBasicAuth *WorkspaceRepoAuth `json:"http_basic_auth,omitempty"`
}
type WorkspaceRepoAuth ¶
type WorkspaceResetRequest ¶
type WorkspaceResetRequest struct {
Path string `json:"path"`
}
Click to show internal directories.
Click to hide internal directories.