Documentation
¶
Index ¶
- func RequestCWD(value string) string
- type ActiveRunError
- type BrowseEntry
- type BrowseResult
- type CancelRunResponse
- type ChatInputBlock
- type ChatRequest
- type ChatResponse
- type DecideRequest
- type DecideResponse
- type EventPayload
- type EventSink
- type Options
- type RunEvent
- type RunEventBatch
- type RunManager
- type Service
- func (s *Service) CancelRun(runID string) (CancelRunResponse, error)
- func (s *Service) ClearSession(sessionID string) error
- func (s *Service) Config(cwd string) (map[string]any, error)
- func (s *Service) CreateSession(req SessionCreateRequest) (mycode.SessionData, error)
- func (s *Service) DecideRun(runID string, req DecideRequest) (DecideResponse, error)
- func (s *Service) DeleteSession(sessionID string) error
- func (s *Service) ListSessions(cwd string) (SessionsResponse, error)
- func (s *Service) LoadSession(sessionID string) (SessionResponse, error)
- func (s *Service) RunEventsAfter(runID string, after int) (RunEventBatch, error)
- func (s *Service) Settings() (map[string]any, error)
- func (s *Service) StartChat(req ChatRequest) (ChatResponse, error)
- func (s *Service) UpdateSettings(req SettingsRequest) (map[string]any, error)
- func (s *Service) WorkspaceBrowse(root, path string) (BrowseResult, error)
- func (s *Service) WorkspaceRoots() map[string]any
- type SessionCreateRequest
- type SessionListItem
- type SessionResponse
- type SessionsResponse
- type SettingsRequest
- type StatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestCWD ¶
Types ¶
type ActiveRunError ¶
type ActiveRunError struct {
RunID string
}
ActiveRunError signals the session already has a run in flight.
func (ActiveRunError) Error ¶
func (e ActiveRunError) Error() string
type BrowseEntry ¶
type BrowseResult ¶
type BrowseResult struct {
Root string `json:"root"`
Path string `json:"path"`
Current string `json:"current"`
Entries []BrowseEntry `json:"entries"`
Error string `json:"error"`
}
type CancelRunResponse ¶
type ChatInputBlock ¶
type ChatRequest ¶
type ChatRequest struct {
SessionID string `json:"session_id"`
Message string `json:"message"`
Input []ChatInputBlock `json:"input"`
Provider string `json:"provider"`
Model string `json:"model"`
CWD string `json:"cwd"`
APIKey string `json:"api_key"`
APIBase string `json:"api_base"`
ReasoningEffort string `json:"reasoning_effort"`
RewindTo *int `json:"rewind_to"`
}
type ChatResponse ¶
type DecideRequest ¶
type DecideResponse ¶
type DecideResponse struct {
Status string `json:"status"`
}
type EventPayload ¶
type EventPayload struct {
RunID string `json:"run_id"`
SessionID string `json:"session_id"`
Event map[string]any `json:"event"`
}
EventPayload is what desktop adapters consume.
type EventSink ¶
type EventSink func(EventPayload)
type Options ¶
type Options struct {
Store *mycode.SessionStore
Runs *RunManager
Sink EventSink
}
type RunEventBatch ¶
RunEventBatch is the replay result for one after cursor.
type RunManager ¶
type RunManager struct {
// contains filtered or unexported fields
}
func NewRunManager ¶
func NewRunManager(sink EventSink) *RunManager
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) ClearSession ¶
func (*Service) CreateSession ¶
func (s *Service) CreateSession(req SessionCreateRequest) (mycode.SessionData, error)
func (*Service) DecideRun ¶
func (s *Service) DecideRun(runID string, req DecideRequest) (DecideResponse, error)
func (*Service) DeleteSession ¶
func (*Service) ListSessions ¶
func (s *Service) ListSessions(cwd string) (SessionsResponse, error)
func (*Service) LoadSession ¶
func (s *Service) LoadSession(sessionID string) (SessionResponse, error)
func (*Service) RunEventsAfter ¶
func (s *Service) RunEventsAfter(runID string, after int) (RunEventBatch, error)
func (*Service) StartChat ¶
func (s *Service) StartChat(req ChatRequest) (ChatResponse, error)
func (*Service) UpdateSettings ¶
func (s *Service) UpdateSettings(req SettingsRequest) (map[string]any, error)
func (*Service) WorkspaceBrowse ¶
func (s *Service) WorkspaceBrowse(root, path string) (BrowseResult, error)
func (*Service) WorkspaceRoots ¶
type SessionCreateRequest ¶
type SessionCreateRequest struct {
CWD string `json:"cwd"`
}
type SessionListItem ¶
type SessionResponse ¶
type SessionsResponse ¶
type SessionsResponse struct {
Sessions []SessionListItem `json:"sessions"`
}
type SettingsRequest ¶
type SettingsRequest struct {
Config json.RawMessage `json:"config"`
}
type StatusError ¶
func (*StatusError) Error ¶
func (e *StatusError) Error() string
Click to show internal directories.
Click to hide internal directories.