feat(s1p2): add inotify-based filesystem write detection with external conflict tracking

This commit is contained in:
Hibryda 2026-03-11 00:56:27 +01:00
parent 6b239c5ce5
commit e5d9f51df7
8 changed files with 501 additions and 7 deletions

View file

@ -0,0 +1,28 @@
// Filesystem watcher bridge — listens for inotify-based write events from Rust
// Part of S-1 Phase 2: real-time filesystem write detection
import { invoke } from '@tauri-apps/api/core';
import { listen, type UnlistenFn } from '@tauri-apps/api/event';
export interface FsWriteEvent {
project_id: string;
file_path: string;
timestamp_ms: number;
}
/** Start watching a project's CWD for filesystem writes */
export function fsWatchProject(projectId: string, cwd: string): Promise<void> {
return invoke('fs_watch_project', { projectId, cwd });
}
/** Stop watching a project's CWD */
export function fsUnwatchProject(projectId: string): Promise<void> {
return invoke('fs_unwatch_project', { projectId });
}
/** Listen for filesystem write events from all watched projects */
export function onFsWriteDetected(
callback: (event: FsWriteEvent) => void,
): Promise<UnlistenFn> {
return listen<FsWriteEvent>('fs-write-detected', (e) => callback(e.payload));
}