services

package
v0.1.129 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSourceContextEnricher added in v0.1.125

func NewSourceContextEnricher(
	registry *sources.Registry,
	fsStore repository.FilesystemStore,
	viewStore *views.ViewStore,
	backend repository.BackendRepository,
) hooks.ContextEnricher

func ParseSourceURI added in v0.1.47

func ParseSourceURI(uri string) (integration, resultID string, err error)

ParseSourceURI splits "integration://resultID" into its parts.

Types

type AccessService added in v0.1.47

type AccessService struct {
	pb.UnimplementedAccessLogServiceServer
	// contains filtered or unexported fields
}

AccessService ingests batched logical-read events emitted by mounts. Events are normalized with auth-derived workspace/session fields and persisted via the shared recorder.

func NewAccessService added in v0.1.47

func NewAccessService(recorder instrumentation.AccessRecorder, rdb *common.RedisClient) *AccessService

func (*AccessService) IngestAccessEvents added in v0.1.47

type AgentService added in v0.1.60

type AgentService struct {
	pb.UnimplementedAgentServiceServer
	// contains filtered or unexported fields
}

func NewAgentService added in v0.1.60

func NewAgentService(
	backend repository.BackendRepository,
	api *orchestration.AgentAPI,
	s2Client *common.S2Client,
) *AgentService

func (*AgentService) CancelAgentRun added in v0.1.60

func (*AgentService) CreateAgentProfile added in v0.1.60

func (*AgentService) CreateTask added in v0.1.60

func (*AgentService) DeleteTask added in v0.1.60

func (s *AgentService) DeleteTask(ctx context.Context, req *pb.DeleteTaskRequest) (*pb.DeleteResponse, error)

func (*AgentService) EnqueueRunInput added in v0.1.60

func (*AgentService) GetAgentProfile added in v0.1.60

func (*AgentService) GetAgentRun added in v0.1.60

func (s *AgentService) GetAgentRun(ctx context.Context, req *pb.GetAgentRunRequest) (*pb.AgentRunResponse, error)

func (*AgentService) GetTask added in v0.1.60

func (*AgentService) GetTaskLogs added in v0.1.60

func (*AgentService) ListAgentProfiles added in v0.1.60

func (*AgentService) ListAgentRunEvents added in v0.1.60

func (*AgentService) ListAgentRunSnapshots added in v0.1.60

func (*AgentService) ListAgentRuns added in v0.1.60

func (*AgentService) ListTasks added in v0.1.60

type ConfluenceFilter added in v0.1.95

type ConfluenceFilter struct {
	CQL         string `json:"cql"`
	Space       string `json:"space"`
	ContentType string `json:"content_type"` // "page", "blogpost", or "all"
	Label       string `json:"label"`
}

type ContextService

type ContextService struct {
	pb.UnimplementedContextServiceServer
	// contains filtered or unexported fields
}

ContextService provides S3-backed file storage for workspace context.

func NewContextService

func NewContextService(cfg types.S3Config) (*ContextService, error)

NewContextService creates a new context service with retry and timeout configuration

func (*ContextService) Create

Create creates a new empty file

func (*ContextService) Delete

Delete removes a file or directory

func (*ContextService) ListTree

ListTree returns flat listing of subtree (for future prefetching)

func (*ContextService) Mkdir

Mkdir creates a directory

func (*ContextService) Read

Read reads file content with size limits to prevent OOM

func (*ContextService) ReadDir

ReadDir lists directory contents with full metadata

Readlink reads a symbolic link target

func (*ContextService) Rename

Rename moves/renames a file or directory (copy then delete)

func (*ContextService) Stat

Stat returns file/directory attributes

Symlink creates a symbolic link

func (*ContextService) Truncate

Truncate changes file size

func (*ContextService) Write

Write writes file content with size limits

type FilesystemService

type FilesystemService struct {
	pb.UnimplementedFilesystemServiceServer
	// contains filtered or unexported fields
}

FilesystemService provides gRPC filesystem metadata operations. This service is used by the FUSE client for caching metadata.

func NewFilesystemService

func NewFilesystemService(store repository.FilesystemStore) *FilesystemService

NewFilesystemService creates a new FilesystemService.

func (*FilesystemService) Chmod

Chmod changes file permissions.

func (*FilesystemService) Create

Create creates a file.

func (*FilesystemService) Mkdir

Mkdir creates a directory.

func (*FilesystemService) ReadDir

ReadDir returns directory entries.

func (*FilesystemService) Remove

Remove removes a file or directory.

func (*FilesystemService) Rename

Rename renames a file or directory.

func (*FilesystemService) Stat

Stat returns metadata for a path. Uses pipelined Redis lookup (single round-trip for dir + file + symlink).

type GDriveFilter added in v0.1.50

type GDriveFilter struct {
	NameContains   string `json:"name_contains"`
	MimeType       string `json:"mime_type"`
	SharedWithMe   *bool  `json:"shared_with_me"`
	Starred        *bool  `json:"starred"`
	ModifiedAfter  string `json:"modified_after"`
	ModifiedBefore string `json:"modified_before"`
	FolderID       string `json:"folder_id"`
}

type GatewayService

type GatewayService struct {
	pb.UnimplementedGatewayServiceServer
	// contains filtered or unexported fields
}

func NewGatewayService

func NewGatewayService(
	backend repository.BackendRepository,
	fsStore repository.FilesystemStore,
	eventBus *common.EventBus,
	sourceRegistry *sources.Registry,
	seenTracker *hooks.SeenTracker,
) *GatewayService

func (*GatewayService) AddConnection

func (*GatewayService) AddMember

func (*GatewayService) CreateHook added in v0.1.28

func (s *GatewayService) CreateHook(ctx context.Context, req *pb.CreateHookRequest) (*pb.HookResponse, error)

func (*GatewayService) CreateToken

func (*GatewayService) CreateWorkerToken

func (*GatewayService) CreateWorkspace

func (*GatewayService) DeleteHook added in v0.1.28

func (*GatewayService) DeleteWorkspace

func (s *GatewayService) DeleteWorkspace(ctx context.Context, req *pb.DeleteWorkspaceRequest) (*pb.DeleteResponse, error)

func (*GatewayService) GetHook added in v0.1.28

func (s *GatewayService) GetHook(ctx context.Context, req *pb.GetHookRequest) (*pb.HookResponse, error)

func (*GatewayService) GetWorkspace

func (*GatewayService) ListConnections

func (*GatewayService) ListHookRuns added in v0.1.28

func (*GatewayService) ListHooks added in v0.1.28

func (*GatewayService) ListMembers

func (*GatewayService) ListTokens

func (*GatewayService) ListWorkerTokens

func (*GatewayService) ListWorkspaces

func (*GatewayService) RemoveConnection

func (s *GatewayService) RemoveConnection(ctx context.Context, req *pb.RemoveConnectionRequest) (*pb.DeleteResponse, error)

func (*GatewayService) RemoveMember

func (s *GatewayService) RemoveMember(ctx context.Context, req *pb.RemoveMemberRequest) (*pb.DeleteResponse, error)

func (*GatewayService) RevokeToken

func (s *GatewayService) RevokeToken(ctx context.Context, req *pb.RevokeTokenRequest) (*pb.DeleteResponse, error)

func (*GatewayService) SetSourceService added in v0.1.34

func (s *GatewayService) SetSourceService(svc *SourceService)

SetSourceService injects the SourceService so that connection mutations (add/remove) can invalidate the connected-integrations cache immediately.

func (*GatewayService) UpdateHook added in v0.1.28

func (s *GatewayService) UpdateHook(ctx context.Context, req *pb.UpdateHookRequest) (*pb.HookResponse, error)

type GitHubFilter added in v0.1.50

type GitHubFilter struct {
	Repo        string `json:"repo"`
	Type        string `json:"type"`
	State       string `json:"state"`
	Label       string `json:"label"`
	Author      string `json:"author"`
	ContentType string `json:"content_type"`
}

type GmailFilter added in v0.1.50

type GmailFilter struct {
	From               string `json:"from"`
	To                 string `json:"to"`
	Subject            string `json:"subject"`
	Label              string `json:"label"`
	Filename           string `json:"filename"`
	NewerThan          string `json:"newer_than"`
	OlderThan          string `json:"older_than"`
	HasAttachment      *bool  `json:"has_attachment"`
	IsUnread           *bool  `json:"is_unread"`
	IsStarred          *bool  `json:"is_starred"`
	IncludeAttachments *bool  `json:"include_attachments"`
	IncludeInline      *bool  `json:"include_inline"`
	IncludeMessageBody *bool  `json:"include_message_body"`
}

type LinearFilter added in v0.1.50

type LinearFilter struct {
	Type     string `json:"type"`
	Team     string `json:"team"`
	State    string `json:"state"`
	Assignee string `json:"assignee"`
	Priority string `json:"priority"`
	Label    string `json:"label"`
	Project  string `json:"project"`
}

type NotionFilter added in v0.1.50

type NotionFilter struct {
	Search string `json:"search"`
}

type PostHogFilter added in v0.1.50

type PostHogFilter struct {
	Type      string `json:"type"`
	Query     string `json:"query"`
	ProjectID int    `json:"project_id"`
}

type SlackFilter added in v0.1.50

type SlackFilter struct {
	Channel     string `json:"channel"`
	From        string `json:"from"`
	After       string `json:"after"`
	Before      string `json:"before"`
	HasLink     *bool  `json:"has_link"`
	HasReaction *bool  `json:"has_reaction"`
}

type SourceService

type SourceService struct {
	pb.UnimplementedSourceServiceServer
	// contains filtered or unexported fields
}

SourceService implements the gRPC SourceService for integration access.

func NewSourceServiceWithOAuth

func NewSourceServiceWithOAuth(registry *sources.Registry, backend repository.BackendRepository, fsStore repository.FilesystemStore, oauthRegistry *oauth.Registry, opts ...SourceServiceOption) *SourceService

func (*SourceService) CleanupTaskSourceWatches added in v0.1.110

func (s *SourceService) CleanupTaskSourceWatches(ctx context.Context, task *types.AgentTask) error

func (*SourceService) CreateView added in v0.1.50

func (*SourceService) DeleteView added in v0.1.50

func (*SourceService) ExecuteView added in v0.1.50

ExecuteView runs a view's query and returns materialized results.

func (*SourceService) GetView added in v0.1.50

func (*SourceService) InvalidateConnectionCache added in v0.1.34

func (s *SourceService) InvalidateConnectionCache(workspaceId uint)

func (*SourceService) InvalidateQueryCache

func (s *SourceService) InvalidateQueryCache(ctx context.Context, workspaceId uint, queryPath string) error

InvalidateQueryCache invalidates cached results for a query path.

func (*SourceService) ListResources added in v0.1.50

func (*SourceService) ListViews added in v0.1.50

func (*SourceService) Read

func (*SourceService) ReadBySourceURI added in v0.1.47

func (s *SourceService) ReadBySourceURI(ctx context.Context, workspaceId uint, memberId uint, sourceURI string) ([]byte, error)

ReadBySourceURI fetches content directly from a provider using a source URI of the form "integration://resultID". This bypasses the source-view layer entirely, so it works even if the query results have changed since the original read was recorded.

func (*SourceService) ReadDir

func (*SourceService) RefreshQuery added in v0.1.28

func (s *SourceService) RefreshQuery(ctx context.Context, query *types.FilesystemQuery) error

RefreshQuery re-executes a query and processes new results. Called by the source poller.

For task_followup queries with a TaskWaker configured, this bypasses the Redis SeenTracker + stream pipeline entirely: it compares results against a durable Postgres baseline and delivers input directly to the sleeping task. This is atomic, retry-safe, and works across replicas.

For all other queries, the existing SeenTracker + hook stream path is used.

func (*SourceService) RegisterTaskSourceWatches added in v0.1.110

func (s *SourceService) RegisterTaskSourceWatches(
	ctx context.Context,
	task *types.AgentTask,
	wakeSignal *types.RunExecutionWakeSignal,
	requests []*types.SourceWatchRequest,
) (*types.TaskBlockerSpec, error)

func (*SourceService) SeedSeenBaseline added in v0.1.119

func (s *SourceService) SeedSeenBaseline(ctx context.Context, workspaceID uint, query *types.FilesystemQuery)

SeedSeenBaseline marks a query path as "initialized" in the SeenTracker with the cached results the agent last saw, so the first poller run diffs properly against the agent's perspective instead of a fresh query.

Using cached results (not a fresh query) is critical: a fresh query could include items that arrived after the agent's last read but before watch registration, permanently baking them into the baseline so they never trigger a wake.

func (*SourceService) SetContextEnricher added in v0.1.125

func (s *SourceService) SetContextEnricher(enricher hooks.ContextEnricher)

func (*SourceService) SetTaskWaker added in v0.1.122

func (s *SourceService) SetTaskWaker(waker TaskWaker)

func (*SourceService) Stat

func (*SourceService) SyncView added in v0.1.50

SyncView handles the gRPC SyncView RPC.

func (*SourceService) SyncViewByExternalId added in v0.1.50

func (s *SourceService) SyncViewByExternalId(ctx context.Context, externalId string) (*SyncResult, error)

SyncViewByExternalId syncs a view by its external ID.

func (*SourceService) SyncViewByPath added in v0.1.50

func (s *SourceService) SyncViewByPath(ctx context.Context, queryPath string) ([]repository.QueryResult, error)

SyncViewByPath forces re-execution of a source view by path, bypassing all caches. Returns the results and emits hook events for newly seen items.

func (*SourceService) UpdateView added in v0.1.50

type SourceServiceOption added in v0.1.28

type SourceServiceOption func(*SourceService)

func WithCompressionMiddleware added in v0.1.43

func WithCompressionMiddleware(
	compressor compression.ContextCompressor,
	store *compression.CompressedStore,
	cfg compression.Config,
) SourceServiceOption

func WithEventBus added in v0.1.119

func WithEventBus(bus *common.EventBus) SourceServiceOption

func WithHookStream added in v0.1.28

func WithHookStream(emitter common.EventEmitter) SourceServiceOption

func WithRecorder added in v0.1.47

func WithRecorder(recorder instrumentation.AccessRecorder) SourceServiceOption

func WithSeenTracker added in v0.1.28

func WithSeenTracker(tracker *hooks.SeenTracker) SourceServiceOption

func WithTaskWaker added in v0.1.122

func WithTaskWaker(waker TaskWaker) SourceServiceOption

type StorageService

type StorageService struct {
	pb.UnimplementedContextServiceServer
	// contains filtered or unexported fields
}

StorageService provides S3-backed file storage with per-workspace buckets

func NewStorageService

func NewStorageService(client *clients.StorageClient, eventBus *common.EventBus) (*StorageService, error)

func (*StorageService) Create

Create creates an empty file

func (*StorageService) Delete

Delete removes a file or directory

func (*StorageService) GetDownloadURL

func (s *StorageService) GetDownloadURL(ctx context.Context, path string) (string, error)

GetDownloadURL generates a presigned GET URL for downloading a file

func (*StorageService) GetUploadURL

func (s *StorageService) GetUploadURL(ctx context.Context, path, contentType string) (string, string, error)

GetUploadURL generates a presigned PUT URL for uploading a file

func (*StorageService) InvalidateCache added in v0.1.14

func (s *StorageService) InvalidateCache(ctx context.Context, path string)

InvalidateCache clears the cache for a path (used when client requests fresh data)

func (*StorageService) ListTree

ListTree returns flat listing of subtree for prefetching

func (*StorageService) Mkdir

Mkdir creates a directory

func (*StorageService) NotifyUploadComplete

func (s *StorageService) NotifyUploadComplete(ctx context.Context, path string) error

NotifyUploadComplete invalidates caches after a file upload

func (*StorageService) Read

Read reads file content

func (*StorageService) ReadDir

ReadDir lists directory contents

Readlink reads symbolic link target

func (*StorageService) Rename

Rename moves/renames a file or directory

func (*StorageService) SetEventRecorder added in v0.1.95

func (s *StorageService) SetEventRecorder(r instrumentation.EventRecorder)

SetEventRecorder sets the product analytics event recorder.

func (*StorageService) SetHookStream added in v0.1.28

func (s *StorageService) SetHookStream(emitter common.EventEmitter)

SetHookStream sets the event emitter for hook event emission.

func (*StorageService) Stat

Stat returns file/directory attributes

Symlink creates a symbolic link

func (*StorageService) Truncate

Truncate changes file size

func (*StorageService) Write

Write writes file content

type SyncResult added in v0.1.50

type SyncResult struct {
	Query        *types.FilesystemQuery
	ResultsCount int
	NewResults   int
}

SyncResult is the outcome of a view sync operation.

type TaskWaker added in v0.1.122

type TaskWaker interface {
	WakeTask(ctx context.Context, workspaceID uint, taskID string, message string) error
}

TaskWaker delivers a wake message to a sleeping task. The implementation wraps AgentAPI.SubmitTaskInput with InputKindFreeText.

type ToolService

type ToolService struct {
	pb.UnimplementedToolServiceServer
	// contains filtered or unexported fields
}

func NewToolService

func NewToolService(registry *tools.Registry) *ToolService

func NewToolServiceWithBackend

func NewToolServiceWithBackend(registry *tools.Registry, backend repository.BackendRepository) *ToolService

func NewToolServiceWithOAuth

func NewToolServiceWithOAuth(registry *tools.Registry, backend repository.BackendRepository, oauthRegistry *oauth.Registry) *ToolService

func (*ToolService) ExecuteTool

func (*ToolService) GetToolHelp

func (*ToolService) ListTools

func (*ToolService) Resolver

func (s *ToolService) Resolver() *tools.WorkspaceToolResolver

Resolver returns the workspace tool resolver for use by other components

func (*ToolService) SetEventRecorder added in v0.1.95

func (s *ToolService) SetEventRecorder(r instrumentation.EventRecorder)

SetEventRecorder sets the product analytics event recorder.

type WebFilter added in v0.1.50

type WebFilter struct {
	Mode         string   `json:"mode"` // "map" or "search"
	URL          string   `json:"url"`
	Query        string   `json:"query"`
	IncludePaths []string `json:"include_paths"`
}

type WorkerService

type WorkerService struct {
	pb.UnimplementedWorkerServiceServer
	// contains filtered or unexported fields
}

func NewWorkerService

func NewWorkerService(
	sched *scheduler.Scheduler,
	backend repository.BackendRepository,
	workerRepo repository.WorkerRepository,
	taskQueue repository.TaskQueue,
	redisClient *common.RedisClient,
	schedulerConfig types.SchedulerConfig,
	viewStore *views.ViewStore,
	viewSync *views.ViewSync,
) *WorkerService

func (*WorkerService) AckTaskInput added in v0.1.98

func (*WorkerService) AllocateIP added in v0.1.23

func (*WorkerService) AppendTaskOutputRows added in v0.1.96

func (*WorkerService) ClaimTaskInput added in v0.1.98

func (*WorkerService) CreateTaskOutput added in v0.1.96

func (*WorkerService) Deregister

func (*WorkerService) FinalizeTaskOutput added in v0.1.96

func (*WorkerService) GetWorker

func (*WorkerService) Heartbeat

func (*WorkerService) ListWorkers added in v0.1.23

func (*WorkerService) RegisterWorker

func (*WorkerService) ReleaseIP added in v0.1.23

func (*WorkerService) SetTaskResult

func (*WorkerService) SetTaskStarted added in v0.1.28

func (*WorkerService) StartRecoveryLoop added in v0.1.66

func (s *WorkerService) StartRecoveryLoop(ctx context.Context)

func (*WorkerService) UpdateStatus

func (*WorkerService) UpdateTaskOutputStatus added in v0.1.106

func (*WorkerService) UpdateTaskState added in v0.1.96

Jump to

Keyboard shortcuts

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