Documentation
¶
Index ¶
- func Run(ctx context.Context, options Options) error
- type ActivityPageView
- type ActivityView
- type AddProjectRequest
- type AddProjectResult
- type BlameLineView
- type BlameView
- type DiffSummaryView
- type ErrPickerCancelled
- type ErrPickerUnavailable
- type EventView
- type FilePatchView
- type FileView
- type IndexView
- type ManualSaveView
- type Options
- type ProjectView
- type ProjectWorktreeView
- type Server
- type Service
- func (service *Service) Blame(ctx context.Context, key, path string, line int) (BlameView, error)
- func (service *Service) Diff(ctx context.Context, key string) (DiffSummaryView, error)
- func (service *Service) Patch(ctx context.Context, key, path string) (FilePatchView, error)
- func (service *Service) Saves(ctx context.Context) ([]ManualSaveView, error)
- func (service *Service) SessionTurns(ctx context.Context, key string) (SessionTurnsView, error)
- func (service *Service) Sessions(ctx context.Context) ([]SessionSummaryView, error)
- func (service *Service) Turn(ctx context.Context, key string) (TurnDetailView, error)
- func (service *Service) Workspace(ctx context.Context) (WorkspaceView, error)
- type SessionSummaryView
- type SessionTurnsView
- type TurnDetailView
- type TurnSummaryView
- type WorkspaceView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActivityPageView ¶
type ActivityPageView struct {
Items []ActivityView `json:"items"`
Truncated bool `json:"truncated"`
}
type ActivityView ¶
type ActivityView struct {
StoreID string `json:"store_id"`
ProjectName string `json:"project_name"`
SessionKey string `json:"session_key"`
SessionID string `json:"session_id"`
Title string `json:"title,omitempty"`
Adapter string `json:"adapter,omitempty"`
Model string `json:"model,omitempty"`
Branch string `json:"branch,omitempty"`
Status string `json:"status,omitempty"`
TurnCount int `json:"turn_count"`
FileCount int `json:"file_count"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
}
ActivityView is one session in the cross-project feed. It carries the owning store so a click can route back into that project.
type AddProjectRequest ¶
type AddProjectRequest struct {
Directory string `json:"directory"`
Agent string `json:"agent,omitempty"`
UpdateGitignore bool `json:"update_gitignore"`
GitSync bool `json:"git_sync"`
}
AddProjectRequest initializes recording in a directory. This mirrors the flags turnal init accepts.
type AddProjectResult ¶
type AddProjectResult struct {
StoreID string `json:"store_id"`
Root string `json:"root"`
StorePath string `json:"-"`
Attached bool `json:"attached"`
GitignoreUpdated bool `json:"gitignore_updated"`
Hooks []string `json:"hooks,omitempty"`
Warning string `json:"warning,omitempty"`
}
AddProjectResult reports what the add flow changed on disk.
type BlameLineView ¶
type BlameLineView struct {
Line int `json:"line"`
Text string `json:"text"`
Kind string `json:"kind"`
TurnKey string `json:"turn_key,omitempty"`
TurnID uint64 `json:"turn_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
Adapter string `json:"adapter,omitempty"`
Prompt string `json:"prompt,omitempty"`
ToolNames []string `json:"tool_names,omitempty"`
Time time.Time `json:"time,omitempty"`
}
type BlameView ¶
type BlameView struct {
Path string `json:"path"`
LatestCommit string `json:"latest_commit"`
LatestTime time.Time `json:"latest_time"`
CompleteTurns int `json:"complete_turns"`
Lines []BlameLineView `json:"lines"`
Warnings []string `json:"warnings,omitempty"`
Truncated bool `json:"truncated"`
TruthSource string `json:"truth_source"`
}
type DiffSummaryView ¶
type DiffSummaryView struct {
TurnKey string `json:"turn_key"`
Files []FileView `json:"files"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
BinaryFiles int `json:"binary_files"`
PreCommit string `json:"pre_commit"`
PostCommit string `json:"post_commit"`
TruthSource string `json:"truth_source"`
}
type ErrPickerCancelled ¶
type ErrPickerCancelled struct{}
ErrPickerCancelled reports that the user dismissed the dialog. This is an ordinary outcome, not a failure.
func (ErrPickerCancelled) Error ¶
func (ErrPickerCancelled) Error() string
type ErrPickerUnavailable ¶
ErrPickerUnavailable reports that no native folder dialog could be run, so the caller should fall back to typing a path.
func (ErrPickerUnavailable) Error ¶
func (err ErrPickerUnavailable) Error() string
type FilePatchView ¶
type IndexView ¶
type IndexView struct {
Projects []ProjectView `json:"projects"`
ReadOnly bool `json:"read_only"`
NetworkSilent bool `json:"network_silent"`
ViewerStartedAt time.Time `json:"viewer_started_at"`
CurrentStoreID string `json:"current_store_id,omitempty"`
}
IndexView is the payload for the global landing page.
type ManualSaveView ¶
type ManualSaveView struct {
ID string `json:"id"`
Message string `json:"message,omitempty"`
Time time.Time `json:"time,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
ManualSaveView is a standalone folder snapshot, intentionally separate from agent sessions and turns.
type ProjectView ¶
type ProjectView struct {
StoreID string `json:"store_id"`
RepoID string `json:"repo_id,omitempty"`
Name string `json:"name"`
Root string `json:"root"`
Branch string `json:"branch,omitempty"`
Present bool `json:"present"`
IndexState string `json:"index_state,omitempty"`
HistoryState string `json:"history_state,omitempty"`
SessionCount int `json:"session_count"`
TurnCount int `json:"turn_count"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
LastActivity time.Time `json:"last_activity,omitempty"`
LastPrompt string `json:"last_prompt,omitempty"`
LastAdapter string `json:"last_adapter,omitempty"`
AddedAt time.Time `json:"added_at,omitempty"`
Worktrees []ProjectWorktreeView `json:"worktrees,omitempty"`
}
ProjectView is one recorded project in the global index. Present is false when the store directory is gone; the project stays listed because its recorded history outlives the working tree.
type ProjectWorktreeView ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct {
Repo *checkpoint.Repo
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *checkpoint.Repo) (*Service, error)
func (*Service) Saves ¶
func (service *Service) Saves(ctx context.Context) ([]ManualSaveView, error)
Saves returns standalone folder snapshots separately from agent sessions.
func (*Service) SessionTurns ¶
func (*Service) Sessions ¶
func (service *Service) Sessions(ctx context.Context) ([]SessionSummaryView, error)
type SessionSummaryView ¶
type SessionSummaryView struct {
Key string `json:"key"`
ID string `json:"id"`
StreamID string `json:"stream_id"`
WorktreeID string `json:"worktree_id,omitempty"`
Adapter string `json:"adapter,omitempty"`
Model string `json:"model,omitempty"`
Branch string `json:"branch,omitempty"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
EventCount int `json:"event_count"`
TurnCount int `json:"turn_count"`
CompleteTurns int `json:"complete_turns"`
ErrorCount int `json:"error_count"`
FileCount int `json:"file_count"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Status string `json:"status"`
PromptPreview string `json:"prompt_preview,omitempty"`
// contains filtered or unexported fields
}
type SessionTurnsView ¶
type SessionTurnsView struct {
Session SessionSummaryView `json:"session"`
Turns []TurnSummaryView `json:"turns"`
}
type TurnDetailView ¶
type TurnSummaryView ¶
type TurnSummaryView struct {
Key string `json:"key"`
ID uint64 `json:"id"`
Status string `json:"status"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
Adapter string `json:"adapter,omitempty"`
Prompt string `json:"prompt,omitempty"`
Assistant string `json:"assistant,omitempty"`
ToolNames []string `json:"tool_names,omitempty"`
EventCount int `json:"event_count"`
ErrorCount int `json:"error_count"`
Files []FileView `json:"files,omitempty"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
PreCommit string `json:"pre_commit,omitempty"`
PostCommit string `json:"post_commit,omitempty"`
Checkpointed bool `json:"checkpointed"`
}
type WorkspaceView ¶
type WorkspaceView struct {
Name string `json:"name"`
Root string `json:"root"`
RepoID string `json:"repo_id"`
StoreID string `json:"store_id"`
WorktreeID string `json:"worktree_id"`
SessionCount int `json:"session_count"`
TurnCount int `json:"turn_count"`
IndexState string `json:"index_state"`
HistoryState string `json:"history_state"`
Problems []string `json:"problems,omitempty"`
LastActivity time.Time `json:"last_activity,omitempty"`
ReadOnly bool `json:"read_only"`
NetworkSilent bool `json:"network_silent"`
ViewerStartedAt time.Time `json:"viewer_started_at"`
}