Documentation
¶
Index ¶
- func BuildPrompt(id, reportPath, firstPinFeedback, firstPinURL string) string
- func DefaultRoot() (string, error)
- func ValidateRelativePath(raw string) (string, error)
- type CommittedReport
- type ListOptions
- type ListResponse
- type PinSearchHit
- type PinSearchResponse
- type Pragmas
- type PruneOptions
- type Report
- type ReportMetadata
- type SessionSummary
- type Store
- func (s *Store) BeginReport(ctx context.Context, metadata ReportMetadata) (*Report, error)
- func (s *Store) Close() error
- func (s *Store) DeleteSession(ctx context.Context, id string) error
- func (s *Store) GetPin(ctx context.Context, id string, number int, fields []string) (map[string]any, error)
- func (s *Store) GetSession(ctx context.Context, id string) (map[string]any, error)
- func (s *Store) GetSessionSummary(ctx context.Context, id string) (SessionSummary, error)
- func (s *Store) LatestSession(ctx context.Context) (SessionSummary, error)
- func (s *Store) ListSessions(ctx context.Context, opts ListOptions) (ListResponse, error)
- func (s *Store) Pragmas(ctx context.Context) (Pragmas, error)
- func (s *Store) Prune(ctx context.Context, opts PruneOptions) (int, error)
- func (s *Store) Root() string
- func (s *Store) SearchPins(ctx context.Context, query string, limit int) (PinSearchResponse, error)
- func (s *Store) SearchSessions(ctx context.Context, query string, limit int) (ListResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPrompt ¶
BuildPrompt returns the host-owned clipboard prompt.
func DefaultRoot ¶
DefaultRoot returns the platform data directory for local sessions.
func ValidateRelativePath ¶
ValidateRelativePath rejects absolute paths, traversal, and empty path segments.
Types ¶
type CommittedReport ¶
type CommittedReport struct {
ID string `json:"id"`
Path string `json:"path"`
Prompt string `json:"prompt"`
CreatedAt string `json:"created_at"`
}
CommittedReport describes a report after it has been indexed.
type ListOptions ¶
ListOptions configures local session listing.
type ListResponse ¶
type ListResponse struct {
Results []SessionSummary `json:"results"`
NextCursor *string `json:"next_cursor"`
Count int `json:"count"`
}
ListResponse mirrors the cloud list response shape with local string ids.
type PinSearchHit ¶
type PinSearchHit struct {
Pin map[string]any `json:"pin"`
Session SessionSummary `json:"session"`
}
PinSearchHit is a local pin search result with the parent session summary.
type PinSearchResponse ¶
type PinSearchResponse struct {
Results []PinSearchHit `json:"results"`
Total int `json:"total"`
}
PinSearchResponse is the local search_pins response.
type PruneOptions ¶
PruneOptions configures local retention cleanup.
type Report ¶
type Report struct {
// contains filtered or unexported fields
}
Report is an in-progress local report written under a temporary directory.
func (*Report) AppendFile ¶
AppendFile appends chunk data under the report temp directory.
type ReportMetadata ¶
type ReportMetadata struct {
URL string `json:"url,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExtensionVersion string `json:"extension_version,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
TotalSize int64 `json:"total_size,omitempty"`
FirstPinFeedback string `json:"first_pin_feedback,omitempty"`
FirstPinURL string `json:"first_pin_url,omitempty"`
}
ReportMetadata is local-only report metadata supplied by the extension.
type SessionSummary ¶
type SessionSummary struct {
ID string `json:"id"`
URL string `json:"url"`
Status string `json:"status"`
PinCount int `json:"pin_count"`
FirstPinFeedback string `json:"first_pin_feedback"`
UpdatedAt string `json:"updated_at"`
CreatedAt string `json:"created_at"`
ReportPath string `json:"report_path"`
TotalSize int64 `json:"total_size"`
}
SessionSummary is a compact local session row.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the local report store used by native-host and MCP.
func (*Store) BeginReport ¶
BeginReport creates a new temporary report.
func (*Store) DeleteSession ¶
DeleteSession removes a local report directory and index rows.
func (*Store) GetPin ¶
func (s *Store) GetPin(ctx context.Context, id string, number int, fields []string) (map[string]any, error)
GetPin reads a local pin and returns file path envelopes for heavy assets.
func (*Store) GetSession ¶
GetSession reads a local session.json and stamps the local report id.
func (*Store) GetSessionSummary ¶
GetSessionSummary returns indexed local session metadata, including the report path.
func (*Store) LatestSession ¶
func (s *Store) LatestSession(ctx context.Context) (SessionSummary, error)
LatestSession returns the newest committed local session.
func (*Store) ListSessions ¶
func (s *Store) ListSessions(ctx context.Context, opts ListOptions) (ListResponse, error)
ListSessions returns newest committed local sessions first.
func (*Store) SearchPins ¶
SearchPins searches local pin feedback and URLs.
func (*Store) SearchSessions ¶
SearchSessions searches local sessions by URL, id, and first pin feedback.