@haex-space/vault-sdk 2.5.74 → 2.5.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,9 @@ var HAEXTENSION_EVENTS = {
9
9
  /** Context (theme, locale, platform) has changed */
10
10
  CONTEXT_CHANGED: "haextension:context:changed",
11
11
  /** Search request from HaexHub */
12
- SEARCH_REQUEST: "haextension:search:request"
12
+ SEARCH_REQUEST: "haextension:search:request",
13
+ /** File system change detected (from native file watcher) */
14
+ FILE_CHANGED: "filesync:file-changed"
13
15
  };
14
16
  var EXTERNAL_EVENTS = {
15
17
  /** External request from authorized client */
@@ -133,7 +135,14 @@ var FILESYSTEM_COMMANDS = {
133
135
  /** Rename file or directory */
134
136
  rename: "extension_filesystem_rename",
135
137
  /** Copy file or directory */
136
- copy: "extension_filesystem_copy"
138
+ copy: "extension_filesystem_copy",
139
+ // File watcher operations
140
+ /** Start watching a directory for changes */
141
+ watch: "extension_filesystem_watch",
142
+ /** Stop watching a directory */
143
+ unwatch: "extension_filesystem_unwatch",
144
+ /** Check if a directory is being watched */
145
+ isWatching: "extension_filesystem_is_watching"
137
146
  };
138
147
 
139
148
  // src/commands/externalBridge.ts
@@ -500,6 +509,42 @@ var FilesystemAPI = class {
500
509
  { from, to }
501
510
  );
502
511
  }
512
+ // ==========================================================================
513
+ // File Watcher Operations
514
+ // ==========================================================================
515
+ /**
516
+ * Start watching a directory for file changes
517
+ * When files change, the "filesync:file-changed" event is emitted
518
+ * @param ruleId Unique identifier for this watch (e.g., sync rule ID)
519
+ * @param path Absolute path to the directory to watch
520
+ */
521
+ async watch(ruleId, path) {
522
+ await this.client.request(
523
+ FILESYSTEM_COMMANDS.watch,
524
+ { ruleId, path }
525
+ );
526
+ }
527
+ /**
528
+ * Stop watching a directory
529
+ * @param ruleId The rule ID that was used when starting the watch
530
+ */
531
+ async unwatch(ruleId) {
532
+ await this.client.request(
533
+ FILESYSTEM_COMMANDS.unwatch,
534
+ { ruleId }
535
+ );
536
+ }
537
+ /**
538
+ * Check if a directory is currently being watched
539
+ * @param ruleId The rule ID to check
540
+ * @returns True if the directory is being watched
541
+ */
542
+ async isWatching(ruleId) {
543
+ return this.client.request(
544
+ FILESYSTEM_COMMANDS.isWatching,
545
+ { ruleId }
546
+ );
547
+ }
503
548
  };
504
549
 
505
550
  // src/api/web.ts