services

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 GatewayService

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

func NewGatewayService

func NewGatewayService(backend repository.BackendRepository, s2Client *common.S2Client, fsStore repository.FilesystemStore, eventBus *common.EventBus, sourceRegistry *sources.Registry) *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) CreateTask added in v0.1.31

func (s *GatewayService) CreateTask(ctx context.Context, req *pb.CreateTaskRequest) (*pb.TaskResponse, error)

func (*GatewayService) CreateToken

func (*GatewayService) CreateWorkerToken

func (*GatewayService) CreateWorkspace

func (*GatewayService) DeleteHook added in v0.1.28

func (*GatewayService) DeleteTask added in v0.1.31

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) GetTask

func (s *GatewayService) GetTask(ctx context.Context, req *pb.GetTaskRequest) (*pb.TaskResponse, error)

func (*GatewayService) GetTaskLogs

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) ListTasks

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) SetTaskQueue added in v0.1.31

func (s *GatewayService) SetTaskQueue(queue repository.TaskQueue, defaultImage string)

SetTaskQueue wires the task queue and default image for CreateTask. Called after the queue is initialized during gateway startup.

func (*GatewayService) UpdateHook added in v0.1.28

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

type SourceService

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

SourceService implements the gRPC SourceService for integration access.

func NewSourceService

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

NewSourceService creates a new SourceService.

func NewSourceServiceWithOAuth

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

NewSourceServiceWithOAuth creates a SourceService with OAuth refresh support.

func (*SourceService) CreateSmartQuery

CreateSmartQuery creates a new smart query via LLM inference

func (*SourceService) DeleteSmartQuery

DeleteSmartQuery removes a smart query by external_id

func (*SourceService) ExecuteSmartQuery

ExecuteSmartQuery runs a query and returns materialized results

func (*SourceService) GetSmartQuery

GetSmartQuery retrieves a smart query by path

func (*SourceService) InvalidateConnectionCache added in v0.1.34

func (s *SourceService) InvalidateConnectionCache(workspaceId uint)

InvalidateConnectionCache evicts the cached connected-integrations set for a workspace. Call this when connections are added or removed so that subsequent ReadDir/Stat/Read calls reflect the change immediately.

func (*SourceService) InvalidateQueryCache

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

InvalidateQueryCache invalidates cached results for a query path. Call this before ReadDir when refresh=true to force re-execution.

func (*SourceService) ListSmartQueries

ListSmartQueries lists queries under a parent path

func (*SourceService) Read

Read reads file content

func (*SourceService) ReadDir

ReadDir lists directory contents

Readlink reads a symbolic link target

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 emits hook events if new results are found. ONLY called by the source poller — never by user browsing or task filesystem reads. This prevents a feedback loop where hook-triggered tasks re-trigger hooks. Satisfies hooks.QueryRefresher.

func (*SourceService) RefreshSmartQuery

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

RefreshSmartQuery forces re-execution of a smart query, bypassing all caches. Returns the fresh results from the provider (e.g., Gmail API).

func (*SourceService) Stat

Stat returns file/directory attributes for a source path

func (*SourceService) UpdateSmartQuery

UpdateSmartQuery updates an existing query's name and/or guidance

type SourceServiceOption added in v0.1.28

type SourceServiceOption func(*SourceService)

SourceServiceOption configures optional dependencies on SourceService.

func WithHookStream added in v0.1.28

func WithHookStream(emitter common.EventEmitter) SourceServiceOption

WithHookStream sets the event emitter for hook event emission.

func WithSeenTracker added in v0.1.28

func WithSeenTracker(tracker *hooks.SeenTracker) SourceServiceOption

WithSeenTracker sets the seen tracker for change detection.

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) 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 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

type WorkerService

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

func NewWorkerService

func NewWorkerService(sched *scheduler.Scheduler, backend *repository.PostgresBackend, workerRepo repository.WorkerRepository) *WorkerService

func (*WorkerService) AllocateIP added in v0.1.23

func (*WorkerService) Deregister

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) UpdateStatus

Jump to

Keyboard shortcuts

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