mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 16:30:27 +00:00
- Add generic types to all Resolve() calls for type safety - Introduce VaultService abstraction layer for file operations - Add AI File Exclusions setting with textarea and glob pattern support - Refactor FileSystemService to use VaultService instead of direct Vault access - Improve code organization with comments and renamed variables - Update styles for exclusions input field
17 lines
No EOL
608 B
TypeScript
17 lines
No EOL
608 B
TypeScript
import type AIAgentPlugin from "main";
|
|
import { Resolve } from "./DependencyService";
|
|
import { Services } from "./Services";
|
|
import type { TFile, WorkspaceLeaf } from "obsidian";
|
|
|
|
export class WorkSpaceService {
|
|
private readonly plugin: AIAgentPlugin = Resolve<AIAgentPlugin>(Services.AIAgentPlugin);
|
|
|
|
public async openNote(noteName: string) {
|
|
const file: TFile | null = this.plugin.app.metadataCache.getFirstLinkpathDest(noteName, "");
|
|
const leaf: WorkspaceLeaf = this.plugin.app.workspace.getLeaf(false);
|
|
|
|
if (file) {
|
|
await leaf.openFile(file);
|
|
}
|
|
}
|
|
} |