pub struct RectilinearEngine { /* private fields */ }Implementations§
Source§impl RectilinearEngine
impl RectilinearEngine
Sourcepub fn new(
db_path: String,
gemini_api_key: Option<String>,
) -> Result<Self, RectilinearError>
pub fn new( db_path: String, gemini_api_key: Option<String>, ) -> Result<Self, RectilinearError>
Create a new engine with an explicit database path and optional Gemini API key. Linear API keys are resolved per-workspace from config.
Sourcepub fn linear_api_key_for_workspace(
&self,
workspace_id: &str,
) -> Result<String, RectilinearError>
pub fn linear_api_key_for_workspace( &self, workspace_id: &str, ) -> Result<String, RectilinearError>
Resolve the Linear API key for a given workspace from config.
Sourcepub fn list_workspaces(&self) -> Result<Vec<String>, RectilinearError>
pub fn list_workspaces(&self) -> Result<Vec<String>, RectilinearError>
List all configured workspace names.
Sourcepub fn get_active_workspace(&self) -> Result<String, RectilinearError>
pub fn get_active_workspace(&self) -> Result<String, RectilinearError>
Get the active workspace name.
Sourcepub fn get_issue(
&self,
id_or_identifier: String,
) -> Result<Option<RtIssue>, RectilinearError>
pub fn get_issue( &self, id_or_identifier: String, ) -> Result<Option<RtIssue>, RectilinearError>
Look up an issue by UUID or identifier (e.g. “CUT-123”).
Sourcepub fn get_triage_queue(
&self,
team: Option<String>,
include_completed: bool,
workspace_id: String,
) -> Result<Vec<RtIssue>, RectilinearError>
pub fn get_triage_queue( &self, team: Option<String>, include_completed: bool, workspace_id: String, ) -> Result<Vec<RtIssue>, RectilinearError>
Get unprioritized issues for triage.
Sourcepub fn search_fts(
&self,
query: String,
limit: u32,
workspace_id: String,
) -> Result<Vec<RtSearchResult>, RectilinearError>
pub fn search_fts( &self, query: String, limit: u32, workspace_id: String, ) -> Result<Vec<RtSearchResult>, RectilinearError>
Full-text search (FTS5, BM25 ranking). Synchronous — hits local SQLite only.
Sourcepub fn count_issues(
&self,
team: Option<String>,
workspace_id: String,
) -> Result<u64, RectilinearError>
pub fn count_issues( &self, team: Option<String>, workspace_id: String, ) -> Result<u64, RectilinearError>
Count issues in the local database.
Sourcepub fn count_embedded_issues(
&self,
team: Option<String>,
workspace_id: String,
) -> Result<u64, RectilinearError>
pub fn count_embedded_issues( &self, team: Option<String>, workspace_id: String, ) -> Result<u64, RectilinearError>
Count issues that have at least one embedding chunk.
Sourcepub fn get_sync_progress(&self) -> Option<RtSyncProgress>
pub fn get_sync_progress(&self) -> Option<RtSyncProgress>
Return the current sync progress, if a sync or embedding pass is active.
Sourcepub fn get_field_completeness(
&self,
team: Option<String>,
workspace_id: String,
) -> Result<RtFieldCompleteness, RectilinearError>
pub fn get_field_completeness( &self, team: Option<String>, workspace_id: String, ) -> Result<RtFieldCompleteness, RectilinearError>
Get field completeness counts in a single query.
Sourcepub fn list_all_issues(
&self,
team: Option<String>,
filter: Option<String>,
limit: u32,
offset: u32,
workspace_id: String,
) -> Result<Vec<RtIssueSummary>, RectilinearError>
pub fn list_all_issues( &self, team: Option<String>, filter: Option<String>, limit: u32, offset: u32, workspace_id: String, ) -> Result<Vec<RtIssueSummary>, RectilinearError>
List all issues with lightweight summary data. Supports pagination and filtering.
Sourcepub fn list_synced_teams(
&self,
workspace_id: String,
) -> Result<Vec<RtTeamSummary>, RectilinearError>
pub fn list_synced_teams( &self, workspace_id: String, ) -> Result<Vec<RtTeamSummary>, RectilinearError>
List teams with synced issues and their embedding coverage. Local-only, no network.
Sourcepub fn get_relations(
&self,
issue_id: String,
) -> Result<Vec<RtRelation>, RectilinearError>
pub fn get_relations( &self, issue_id: String, ) -> Result<Vec<RtRelation>, RectilinearError>
Get enriched relations for an issue.
Sourcepub fn get_active_issues(
&self,
team: String,
state_types: Vec<String>,
workspace_id: String,
) -> Result<Vec<RtIssueEnriched>, RectilinearError>
pub fn get_active_issues( &self, team: String, state_types: Vec<String>, workspace_id: String, ) -> Result<Vec<RtIssueEnriched>, RectilinearError>
Get issues filtered by team and state types, enriched with blocker info.
Sourcepub async fn list_teams(
&self,
workspace_id: String,
) -> Result<Vec<RtTeam>, RectilinearError>
pub async fn list_teams( &self, workspace_id: String, ) -> Result<Vec<RtTeam>, RectilinearError>
List all teams from Linear.
Sourcepub async fn test_gemini_api_key(&self) -> Result<(), RectilinearError>
pub async fn test_gemini_api_key(&self) -> Result<(), RectilinearError>
Validate the configured Gemini API key without generating embeddings.
Sourcepub async fn sync_team(
&self,
team_key: String,
full: bool,
workspace_id: String,
) -> Result<u64, RectilinearError>
pub async fn sync_team( &self, team_key: String, full: bool, workspace_id: String, ) -> Result<u64, RectilinearError>
Sync issues from Linear for a team. Returns the number of issues synced.
Sourcepub async fn search_hybrid(
&self,
query: String,
team: Option<String>,
limit: u32,
workspace_id: String,
) -> Result<Vec<RtSearchResult>, RectilinearError>
pub async fn search_hybrid( &self, query: String, team: Option<String>, limit: u32, workspace_id: String, ) -> Result<Vec<RtSearchResult>, RectilinearError>
Hybrid search (FTS + vector via RRF). Requires embedder for vector component.
Sourcepub async fn find_duplicates(
&self,
text: String,
team: Option<String>,
threshold: f32,
workspace_id: String,
) -> Result<Vec<RtSearchResult>, RectilinearError>
pub async fn find_duplicates( &self, text: String, team: Option<String>, threshold: f32, workspace_id: String, ) -> Result<Vec<RtSearchResult>, RectilinearError>
Find potential duplicate issues by semantic similarity.
Sourcepub async fn save_issue(
&self,
issue_id: String,
title: Option<String>,
description: Option<String>,
priority: Option<i32>,
state: Option<String>,
labels: Option<Vec<String>>,
workspace_id: String,
) -> Result<(), RectilinearError>
pub async fn save_issue( &self, issue_id: String, title: Option<String>, description: Option<String>, priority: Option<i32>, state: Option<String>, labels: Option<Vec<String>>, workspace_id: String, ) -> Result<(), RectilinearError>
Update an issue in Linear (title, description, priority, state, labels).
Sourcepub async fn add_comment(
&self,
issue_id: String,
body: String,
workspace_id: String,
) -> Result<(), RectilinearError>
pub async fn add_comment( &self, issue_id: String, body: String, workspace_id: String, ) -> Result<(), RectilinearError>
Add a comment to a Linear issue.
Sourcepub async fn refresh_issue(
&self,
id_or_identifier: String,
workspace_id: String,
) -> Result<Option<RtIssue>, RectilinearError>
pub async fn refresh_issue( &self, id_or_identifier: String, workspace_id: String, ) -> Result<Option<RtIssue>, RectilinearError>
Fetch a single issue live from Linear and upsert into local DB. Accepts either a UUID or identifier (e.g. “CUT-123”).
Sourcepub async fn embed_issues(
&self,
team: Option<String>,
limit: u32,
workspace_id: String,
) -> Result<u64, RectilinearError>
pub async fn embed_issues( &self, team: Option<String>, limit: u32, workspace_id: String, ) -> Result<u64, RectilinearError>
Generate embeddings for issues that don’t have them yet. Returns the number of issues embedded.