providers

package
v0.1.78 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GDriveProvider

type GDriveProvider struct {
	// contains filtered or unexported fields
}

GDriveProvider implements sources.Provider for Google Drive integration. It exposes Google Drive resources as a read-only filesystem under /sources/gdrive/

func NewGDriveProvider

func NewGDriveProvider() *GDriveProvider

NewGDriveProvider creates a new Google Drive source provider

func (*GDriveProvider) ExecuteQuery

ExecuteQuery runs a Google Drive search query and returns results with generated filenames. This implements the sources.QueryExecutor interface for filesystem queries. Supports pagination via spec.PageToken for fetching subsequent pages.

func (*GDriveProvider) FormatFilename

func (g *GDriveProvider) FormatFilename(format string, metadata map[string]string) string

FormatFilename generates a filename from metadata using a format template. Supported placeholders: {id}, {name}, {date}, {created}, {mime_type}, {ext} - {name} is the basename (no extension) - {ext} is the extension (includes leading dot, e.g. ".pdf") This implements the sources.QueryExecutor interface.

func (*GDriveProvider) Name

func (g *GDriveProvider) Name() string

func (*GDriveProvider) Read

func (g *GDriveProvider) Read(ctx context.Context, pctx *sources.ProviderContext, path string, offset, length int64) ([]byte, error)

Read reads file content

func (*GDriveProvider) ReadDir

func (g *GDriveProvider) ReadDir(ctx context.Context, pctx *sources.ProviderContext, path string) ([]sources.DirEntry, error)

ReadDir lists directory contents

func (*GDriveProvider) ReadResult

func (g *GDriveProvider) ReadResult(ctx context.Context, pctx *sources.ProviderContext, resultID string) ([]byte, error)

ReadResult fetches the content of a Drive file by its file ID. This implements the sources.QueryExecutor interface.

func (g *GDriveProvider) Readlink(ctx context.Context, pctx *sources.ProviderContext, path string) (string, error)

Readlink is not supported for Drive

func (*GDriveProvider) Search

func (g *GDriveProvider) Search(ctx context.Context, pctx *sources.ProviderContext, query string, limit int) ([]sources.SearchResult, error)

Search executes a Google Drive search query and returns results The query uses Google Drive query syntax (e.g., "name contains 'invoice'", "mimeType='application/pdf'")

func (*GDriveProvider) Stat

Stat returns file/directory attributes

type GitHubProvider

type GitHubProvider struct {
	// contains filtered or unexported fields
}

GitHubProvider implements sources.Provider for GitHub integration. It exposes GitHub resources as a read-only filesystem under /sources/github/

func NewGitHubProvider

func NewGitHubProvider() *GitHubProvider

NewGitHubProvider creates a new GitHub source provider

func (*GitHubProvider) DefaultResourceType added in v0.1.50

func (g *GitHubProvider) DefaultResourceType() string

DefaultResourceType implements sources.ResourceLister.

func (*GitHubProvider) ExecuteQuery

ExecuteQuery runs a GitHub search query and returns results with generated filenames. This implements the sources.QueryExecutor interface for filesystem queries. Supports pagination via spec.PageToken for fetching subsequent pages.

func (*GitHubProvider) FormatFilename

func (g *GitHubProvider) FormatFilename(format string, metadata map[string]string) string

FormatFilename generates a filename from metadata using the format template.

func (*GitHubProvider) ListResources added in v0.1.50

func (g *GitHubProvider) ListResources(ctx context.Context, pctx *sources.ProviderContext, resourceType string) ([]sources.Resource, error)

ListResources implements sources.ResourceLister.

func (*GitHubProvider) Name

func (g *GitHubProvider) Name() string

func (*GitHubProvider) Read

func (g *GitHubProvider) Read(ctx context.Context, pctx *sources.ProviderContext, path string, offset, length int64) ([]byte, error)

Read reads file content

func (*GitHubProvider) ReadDir

func (g *GitHubProvider) ReadDir(ctx context.Context, pctx *sources.ProviderContext, path string) ([]sources.DirEntry, error)

ReadDir lists directory contents

func (*GitHubProvider) ReadResult

func (g *GitHubProvider) ReadResult(ctx context.Context, pctx *sources.ProviderContext, resultID string) ([]byte, error)

ReadResult fetches the content by ID. ID formats:

  • "repo:owner/repo" - repository
  • "pr:owner/repo#number:content_type" - pull request
  • "issue:owner/repo#number:content_type" - issue
  • "commit:owner/repo@sha:content_type" - commit
  • "release:owner/repo@tag:content_type" - release
  • "workflow:owner/repo#id:content_type" - workflow run
  • "file:owner/repo@ref:path:content_type" - file
  • "branch:owner/repo@name" - branch
func (g *GitHubProvider) Readlink(ctx context.Context, pctx *sources.ProviderContext, path string) (string, error)

Readlink is not supported for GitHub

func (*GitHubProvider) Search

func (g *GitHubProvider) Search(ctx context.Context, pctx *sources.ProviderContext, query string, limit int) ([]sources.SearchResult, error)

Search is not supported for GitHub (use the repository browser instead)

func (*GitHubProvider) Stat

Stat returns file/directory attributes

type GmailProvider

type GmailProvider struct {
	// contains filtered or unexported fields
}

GmailProvider implements sources.Provider for Gmail integration. Structure: /sources/gmail/messages/{category}/{sender}/{subject}/

func NewGmailProvider

func NewGmailProvider() *GmailProvider

NewGmailProvider creates a new Gmail source provider

func (*GmailProvider) ExecuteQuery

ExecuteQuery runs a Gmail search query and returns results with generated filenames. This implements the sources.QueryExecutor interface for filesystem queries. Supports pagination via spec.PageToken for fetching subsequent pages.

func (*GmailProvider) FormatFilename

func (g *GmailProvider) FormatFilename(format string, metadata map[string]string) string

FormatFilename generates a filename from metadata using a format template. Supported placeholders: {id}, {date}, {from}, {to}, {subject}, {snippet} This implements the sources.QueryExecutor interface.

func (*GmailProvider) Name

func (g *GmailProvider) Name() string

func (*GmailProvider) Read

func (g *GmailProvider) Read(ctx context.Context, pctx *sources.ProviderContext, path string, offset, length int64) ([]byte, error)

Read reads file content

func (*GmailProvider) ReadDir

func (g *GmailProvider) ReadDir(ctx context.Context, pctx *sources.ProviderContext, path string) ([]sources.DirEntry, error)

ReadDir lists directory contents

func (*GmailProvider) ReadResult

func (g *GmailProvider) ReadResult(ctx context.Context, pctx *sources.ProviderContext, resultID string) ([]byte, error)

ReadResult fetches the content of an email by its message ID. This implements the sources.QueryExecutor interface.

func (g *GmailProvider) Readlink(ctx context.Context, pctx *sources.ProviderContext, path string) (string, error)

Readlink is not supported for Gmail

func (*GmailProvider) Search

func (g *GmailProvider) Search(ctx context.Context, pctx *sources.ProviderContext, query string, limit int) ([]sources.SearchResult, error)

Search executes a Gmail search query and returns results The query is passed directly to Gmail's search API (e.g., "is:unread", "from:john newer_than:7d")

func (*GmailProvider) Stat

Stat returns file/directory attributes

type LinearProvider added in v0.1.9

type LinearProvider struct {
	// contains filtered or unexported fields
}

LinearProvider implements sources.Provider for Linear integration. Primary usage is via smart queries: mkdir /sources/linear/my-assigned-issues

func NewLinearProvider added in v0.1.9

func NewLinearProvider() *LinearProvider

func (*LinearProvider) DefaultResourceType added in v0.1.54

func (l *LinearProvider) DefaultResourceType() string

func (*LinearProvider) ExecuteQuery added in v0.1.9

func (*LinearProvider) FormatFilename added in v0.1.9

func (l *LinearProvider) FormatFilename(format string, metadata map[string]string) string

func (*LinearProvider) ListResources added in v0.1.54

func (l *LinearProvider) ListResources(ctx context.Context, pctx *sources.ProviderContext, resourceType string) ([]sources.Resource, error)

func (*LinearProvider) Name added in v0.1.9

func (l *LinearProvider) Name() string

func (*LinearProvider) Read added in v0.1.9

func (l *LinearProvider) Read(ctx context.Context, pctx *sources.ProviderContext, path string, offset, length int64) ([]byte, error)

func (*LinearProvider) ReadDir added in v0.1.9

func (l *LinearProvider) ReadDir(ctx context.Context, pctx *sources.ProviderContext, path string) ([]sources.DirEntry, error)

func (*LinearProvider) ReadResult added in v0.1.9

func (l *LinearProvider) ReadResult(ctx context.Context, pctx *sources.ProviderContext, resultID string) ([]byte, error)
func (l *LinearProvider) Readlink(ctx context.Context, pctx *sources.ProviderContext, path string) (string, error)

func (*LinearProvider) Search added in v0.1.9

func (l *LinearProvider) Search(ctx context.Context, pctx *sources.ProviderContext, query string, limit int) ([]sources.SearchResult, error)

func (*LinearProvider) Stat added in v0.1.9

type NotionProvider

type NotionProvider struct {
	// contains filtered or unexported fields
}

NotionProvider implements sources.Provider for Notion integration. It exposes Notion resources as a read-only filesystem under /sources/notion/

func NewNotionProvider

func NewNotionProvider() *NotionProvider

NewNotionProvider creates a new Notion source provider

func (*NotionProvider) ExecuteQuery

ExecuteQuery runs a Notion search query and returns results with generated filenames. This implements the sources.QueryExecutor interface for filesystem queries. Supports pagination via spec.PageToken (Notion's start_cursor) for fetching subsequent pages.

func (*NotionProvider) FormatFilename

func (n *NotionProvider) FormatFilename(format string, metadata map[string]string) string

FormatFilename generates a filename from metadata using a format template. Supported placeholders: {id}, {title}, {type}, {date}, {created} This implements the sources.QueryExecutor interface.

func (*NotionProvider) Name

func (n *NotionProvider) Name() string

func (*NotionProvider) Read

func (n *NotionProvider) Read(ctx context.Context, pctx *sources.ProviderContext, path string, offset, length int64) ([]byte, error)

Read reads file content

func (*NotionProvider) ReadDir

func (n *NotionProvider) ReadDir(ctx context.Context, pctx *sources.ProviderContext, path string) ([]sources.DirEntry, error)

ReadDir lists directory contents

func (*NotionProvider) ReadResult

func (n *NotionProvider) ReadResult(ctx context.Context, pctx *sources.ProviderContext, resultID string) ([]byte, error)

ReadResult fetches the content of a Notion page by its page ID. Returns the page content as markdown. This implements the sources.QueryExecutor interface.

func (n *NotionProvider) Readlink(ctx context.Context, pctx *sources.ProviderContext, path string) (string, error)

Readlink is not supported for Notion

func (*NotionProvider) Search

func (n *NotionProvider) Search(ctx context.Context, pctx *sources.ProviderContext, query string, limit int) ([]sources.SearchResult, error)

Search executes a Notion search query and returns results The query is a plain text search term

func (*NotionProvider) Stat

Stat returns file/directory attributes

type PostHogProvider added in v0.1.32

type PostHogProvider struct{}

PostHogProvider implements sources.Provider, sources.NativeBrowsable, and sources.CredentialValidator for PostHog integration. It exposes PostHog resources as a read-only filesystem under /sources/posthog/.

Filesystem layout:

/sources/posthog/
  {project-id}_{project-name}/
    events/
      {event-id}.json
    feature-flags/
      {flag-key}.json
    insights/
      {insight-short-id}_{insight-name}.json
    cohorts/
      {cohort-id}_{cohort-name}.json

func NewPostHogProvider added in v0.1.32

func NewPostHogProvider() *PostHogProvider

func (*PostHogProvider) ExecuteQuery added in v0.1.32

ExecuteQuery runs a PostHog search query and returns results. Implements the sources.QueryExecutor interface for source view queries.

func (*PostHogProvider) FormatFilename added in v0.1.32

func (p *PostHogProvider) FormatFilename(format string, metadata map[string]string) string

FormatFilename generates a filename from metadata using a format template. Supported placeholders: {id}, {key}, {name}, {event}, {date}, {short_id}, {active}, {count}

func (*PostHogProvider) IsNativeBrowsable added in v0.1.32

func (p *PostHogProvider) IsNativeBrowsable() bool

IsNativeBrowsable returns true — PostHog exposes a native file tree.

func (*PostHogProvider) Name added in v0.1.32

func (p *PostHogProvider) Name() string

func (*PostHogProvider) Read added in v0.1.32

func (p *PostHogProvider) Read(ctx context.Context, pctx *sources.ProviderContext, path string, offset, length int64) ([]byte, error)

Read reads file content.

func (*PostHogProvider) ReadDir added in v0.1.32

ReadDir lists directory contents.

func (*PostHogProvider) ReadResult added in v0.1.32

func (p *PostHogProvider) ReadResult(ctx context.Context, pctx *sources.ProviderContext, resultID string) ([]byte, error)

ReadResult fetches content for a specific PostHog resource by its composite ID. Composite ID format: "{projectID}:{resourceType}:{resourceID}"

func (*PostHogProvider) Search added in v0.1.32

func (*PostHogProvider) Stat added in v0.1.32

Stat returns file/directory attributes for a path within the integration.

func (*PostHogProvider) ValidateCredentials added in v0.1.32

func (p *PostHogProvider) ValidateCredentials(ctx context.Context, creds *types.IntegrationCredentials) error

ValidateCredentials checks that the API key is valid by calling the projects endpoint. For project-scoped keys (Extra["project_id"] set), it calls GetProject instead of ListProjects.

type SlackProvider added in v0.1.9

type SlackProvider struct {
	// contains filtered or unexported fields
}

SlackProvider implements sources.Provider for Slack integration. It exposes Slack data as a read-only filesystem under /sources/slack/ Primary usage is via smart queries: mkdir /sources/slack/team-updates

func NewSlackProvider added in v0.1.9

func NewSlackProvider() *SlackProvider

NewSlackProvider creates a new Slack source provider

func (*SlackProvider) DefaultResourceType added in v0.1.50

func (s *SlackProvider) DefaultResourceType() string

DefaultResourceType implements sources.ResourceLister.

func (*SlackProvider) ExecuteQuery added in v0.1.9

ExecuteQuery runs a Slack search query and returns results with generated filenames. This implements the sources.QueryExecutor interface for filesystem queries. Users create smart queries like: mkdir /sources/slack/team-updates

func (*SlackProvider) FormatFilename added in v0.1.9

func (s *SlackProvider) FormatFilename(format string, metadata map[string]string) string

FormatFilename generates a filename from metadata using a format template. Supported placeholders: {id}, {channel}, {user}, {date}, {text} This implements the sources.QueryExecutor interface.

func (*SlackProvider) ListResources added in v0.1.50

func (s *SlackProvider) ListResources(ctx context.Context, pctx *sources.ProviderContext, resourceType string) ([]sources.Resource, error)

ListResources implements sources.ResourceLister.

func (*SlackProvider) Name added in v0.1.9

func (s *SlackProvider) Name() string

func (*SlackProvider) Read added in v0.1.9

func (s *SlackProvider) Read(ctx context.Context, pctx *sources.ProviderContext, path string, offset, length int64) ([]byte, error)

Read reads file content

func (*SlackProvider) ReadDir added in v0.1.9

func (s *SlackProvider) ReadDir(ctx context.Context, pctx *sources.ProviderContext, path string) ([]sources.DirEntry, error)

ReadDir lists directory contents

func (*SlackProvider) ReadResult added in v0.1.9

func (s *SlackProvider) ReadResult(ctx context.Context, pctx *sources.ProviderContext, resultID string) ([]byte, error)

ReadResult fetches the content of a Slack message by its timestamp. Returns the message formatted as readable text. This implements the sources.QueryExecutor interface.

func (s *SlackProvider) Readlink(ctx context.Context, pctx *sources.ProviderContext, path string) (string, error)

Readlink is not supported for Slack

func (*SlackProvider) Search added in v0.1.9

func (s *SlackProvider) Search(ctx context.Context, pctx *sources.ProviderContext, query string, limit int) ([]sources.SearchResult, error)

Search executes a Slack search query and returns results Uses Slack's search.messages API

func (*SlackProvider) Stat added in v0.1.9

Stat returns file/directory attributes

type WebProvider added in v0.1.49

type WebProvider struct {
	// contains filtered or unexported fields
}

WebProvider discovers and scrapes web pages via Firecrawl, exposing each page as a markdown file through smart queries.

Two modes (selected by the "web_mode" metadata key):

map    (default) — discover pages on a site via /map, scrape lazily
search           — web search via /search, scrape top results

Usage:

mkdir /sources/web/hennessy-cocktails   # map mode (URL in guidance)
mkdir /sources/web/latest-ai-news      # search mode (no URL)

func NewWebProvider added in v0.1.49

func NewWebProvider(apiKey string) *WebProvider

func (*WebProvider) ExecuteQuery added in v0.1.49

ExecuteQuery discovers pages via /map or /search depending on the "web_mode" metadata key. Each result is scraped lazily in ReadResult.

func (*WebProvider) FormatFilename added in v0.1.49

func (w *WebProvider) FormatFilename(format string, meta map[string]string) string

FormatFilename replaces {id}, {title}, {path}, {date} placeholders.

func (*WebProvider) Name added in v0.1.49

func (w *WebProvider) Name() string

func (*WebProvider) Read added in v0.1.49

func (w *WebProvider) Read(_ context.Context, _ *sources.ProviderContext, _ string, _, _ int64) ([]byte, error)

func (*WebProvider) ReadDir added in v0.1.49

func (*WebProvider) ReadResult added in v0.1.49

func (w *WebProvider) ReadResult(ctx context.Context, _ *sources.ProviderContext, resultID string) ([]byte, error)

ReadResult scrapes a single page and returns its markdown content.

func (*WebProvider) Search added in v0.1.49

func (*WebProvider) Stat added in v0.1.49

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL