@haex-space/vault-sdk 2.6.7 → 2.7.1

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.
@@ -1,4 +1,4 @@
1
- import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, f as EventCallback, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult } from './types-B1O6KckK.js';
1
+ import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, f as EventCallback, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult } from './types-DmCSegdY.js';
2
2
  import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
3
3
 
4
4
  /**
@@ -335,6 +335,23 @@ interface SelectFileOptions {
335
335
  /** Allow multiple file selection */
336
336
  multiple?: boolean;
337
337
  }
338
+ /**
339
+ * Well-known system directory identifiers.
340
+ * Resolved to platform-specific paths by haex-vault via Tauri's PathResolver.
341
+ */
342
+ declare enum KnownPath {
343
+ Home = "home",
344
+ Pictures = "pictures",
345
+ Downloads = "downloads",
346
+ Documents = "documents",
347
+ Desktop = "desktop",
348
+ Videos = "videos"
349
+ }
350
+ /**
351
+ * Map of known path names to their resolved absolute paths.
352
+ * Not all paths may be available on every platform.
353
+ */
354
+ type KnownPaths = Partial<Record<KnownPath, string>>;
338
355
  declare class FilesystemAPI {
339
356
  private client;
340
357
  constructor(client: HaexVaultSdk);
@@ -425,6 +442,12 @@ declare class FilesystemAPI {
425
442
  * @param to Destination path
426
443
  */
427
444
  copy(from: string, to: string): Promise<void>;
445
+ /**
446
+ * Get well-known system directory paths (home, pictures, downloads, etc.)
447
+ * These paths are resolved via Tauri's PathResolver and are platform-aware.
448
+ * @returns Map of known path names to their absolute paths
449
+ */
450
+ knownPaths(): Promise<KnownPaths>;
428
451
  /**
429
452
  * Start watching a directory for file changes
430
453
  * When files change, the "filesync:file-changed" event is emitted
@@ -1211,6 +1234,10 @@ declare class HaexVaultSdk {
1211
1234
  readonly localsend: LocalSendAPI;
1212
1235
  readonly spaces: SpacesAPI;
1213
1236
  readonly shell: ShellAPI;
1237
+ /** Unified action system - register handlers that work for both Bridge and AI requests */
1238
+ readonly actions: {
1239
+ register: (action: string, handler: ExternalRequestHandler) => (() => void);
1240
+ };
1214
1241
  constructor(config?: HaexHubConfig);
1215
1242
  ready(): Promise<void>;
1216
1243
  get setupCompleted(): boolean;
@@ -1249,9 +1276,10 @@ declare class HaexVaultSdk {
1249
1276
  private initIframe;
1250
1277
  private handleEvent;
1251
1278
  private handleExternalRequestInternal;
1279
+ private handleActionRequestInternal;
1252
1280
  private runSetupAsync;
1253
1281
  private notifySubscribersInternal;
1254
1282
  private log;
1255
1283
  }
1256
1284
 
1257
- export { type SpaceMemberInfo as $, type AuthorizedClient as A, type BlockedClient as B, type RequestedExtension as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type SelectFileOptions as G, HaexVaultSdk as H, type SelectFolderOptions as I, type ServerInfo as J, type ServerStatus as K, LOCALSEND_EVENTS as L, type SessionAuthorization as M, type SharedSpace as N, ShellAPI as O, type PendingAuthorization as P, type ShellCreateOptions as Q, RemoteStorageAPI as R, StorageAPI as S, type ShellCreateResponse as T, type UpdateBackendRequest as U, type ShellExitEvent as V, type ShellOutputEvent as W, type SpaceAccessTokenInfo as X, type SpaceAssignment as Y, type SpaceInvite as Z, type SpaceKeyGrantInfo as _, type SpaceRole as a, SpaceRoles as a0, SpacesAPI as a1, type SyncBackendInfo as a2, type TransferDirection as a3, type TransferProgress as a4, type TransferState as a5, WebAPI as a6, canExternalClientSendRequests as a7, isExternalClientConnected as a8, type DecryptedSpace as b, type Device as c, type DeviceInfo as d, type DeviceType as e, type DirEntry as f, type ExternalConnection as g, ExternalConnectionErrorCode as h, ExternalConnectionState as i, type ExternalRequest as j, type ExternalRequestEvent as k, type ExternalRequestHandler as l, type ExternalRequestPayload as m, type ExternalResponse as n, FilesystemAPI as o, LocalSendAPI as p, type LocalSendEvent as q, type FileInfo as r, type LocalSendSettings as s, type PendingTransfer as t, PermissionsAPI as u, type AddBackendRequest as v, type S3Config as w, type S3PublicConfig as x, type StorageBackendInfo as y, type StorageObjectInfo as z };
1285
+ export { type SpaceInvite as $, type AuthorizedClient as A, type BlockedClient as B, type StorageObjectInfo as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type RequestedExtension as G, HaexVaultSdk as H, type SelectFileOptions as I, type SelectFolderOptions as J, KnownPath as K, LOCALSEND_EVENTS as L, type ServerInfo as M, type ServerStatus as N, type SessionAuthorization as O, type PendingAuthorization as P, type SharedSpace as Q, RemoteStorageAPI as R, StorageAPI as S, ShellAPI as T, type UpdateBackendRequest as U, type ShellCreateOptions as V, type ShellCreateResponse as W, type ShellExitEvent as X, type ShellOutputEvent as Y, type SpaceAccessTokenInfo as Z, type SpaceAssignment as _, type SpaceRole as a, type SpaceKeyGrantInfo as a0, type SpaceMemberInfo as a1, SpaceRoles as a2, SpacesAPI as a3, type SyncBackendInfo as a4, type TransferDirection as a5, type TransferProgress as a6, type TransferState as a7, WebAPI as a8, canExternalClientSendRequests as a9, isExternalClientConnected as aa, type DecryptedSpace as b, type Device as c, type DeviceInfo as d, type DeviceType as e, type DirEntry as f, type ExternalConnection as g, ExternalConnectionErrorCode as h, ExternalConnectionState as i, type ExternalRequest as j, type ExternalRequestEvent as k, type ExternalRequestHandler as l, type ExternalRequestPayload as m, type ExternalResponse as n, FilesystemAPI as o, type KnownPaths as p, LocalSendAPI as q, type LocalSendEvent as r, type FileInfo as s, type LocalSendSettings as t, type PendingTransfer as u, PermissionsAPI as v, type AddBackendRequest as w, type S3Config as x, type S3PublicConfig as y, type StorageBackendInfo as z };
@@ -1,4 +1,4 @@
1
- import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, f as EventCallback, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult } from './types-B1O6KckK.mjs';
1
+ import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, f as EventCallback, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult } from './types-DmCSegdY.mjs';
2
2
  import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
3
3
 
4
4
  /**
@@ -335,6 +335,23 @@ interface SelectFileOptions {
335
335
  /** Allow multiple file selection */
336
336
  multiple?: boolean;
337
337
  }
338
+ /**
339
+ * Well-known system directory identifiers.
340
+ * Resolved to platform-specific paths by haex-vault via Tauri's PathResolver.
341
+ */
342
+ declare enum KnownPath {
343
+ Home = "home",
344
+ Pictures = "pictures",
345
+ Downloads = "downloads",
346
+ Documents = "documents",
347
+ Desktop = "desktop",
348
+ Videos = "videos"
349
+ }
350
+ /**
351
+ * Map of known path names to their resolved absolute paths.
352
+ * Not all paths may be available on every platform.
353
+ */
354
+ type KnownPaths = Partial<Record<KnownPath, string>>;
338
355
  declare class FilesystemAPI {
339
356
  private client;
340
357
  constructor(client: HaexVaultSdk);
@@ -425,6 +442,12 @@ declare class FilesystemAPI {
425
442
  * @param to Destination path
426
443
  */
427
444
  copy(from: string, to: string): Promise<void>;
445
+ /**
446
+ * Get well-known system directory paths (home, pictures, downloads, etc.)
447
+ * These paths are resolved via Tauri's PathResolver and are platform-aware.
448
+ * @returns Map of known path names to their absolute paths
449
+ */
450
+ knownPaths(): Promise<KnownPaths>;
428
451
  /**
429
452
  * Start watching a directory for file changes
430
453
  * When files change, the "filesync:file-changed" event is emitted
@@ -1211,6 +1234,10 @@ declare class HaexVaultSdk {
1211
1234
  readonly localsend: LocalSendAPI;
1212
1235
  readonly spaces: SpacesAPI;
1213
1236
  readonly shell: ShellAPI;
1237
+ /** Unified action system - register handlers that work for both Bridge and AI requests */
1238
+ readonly actions: {
1239
+ register: (action: string, handler: ExternalRequestHandler) => (() => void);
1240
+ };
1214
1241
  constructor(config?: HaexHubConfig);
1215
1242
  ready(): Promise<void>;
1216
1243
  get setupCompleted(): boolean;
@@ -1249,9 +1276,10 @@ declare class HaexVaultSdk {
1249
1276
  private initIframe;
1250
1277
  private handleEvent;
1251
1278
  private handleExternalRequestInternal;
1279
+ private handleActionRequestInternal;
1252
1280
  private runSetupAsync;
1253
1281
  private notifySubscribersInternal;
1254
1282
  private log;
1255
1283
  }
1256
1284
 
1257
- export { type SpaceMemberInfo as $, type AuthorizedClient as A, type BlockedClient as B, type RequestedExtension as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type SelectFileOptions as G, HaexVaultSdk as H, type SelectFolderOptions as I, type ServerInfo as J, type ServerStatus as K, LOCALSEND_EVENTS as L, type SessionAuthorization as M, type SharedSpace as N, ShellAPI as O, type PendingAuthorization as P, type ShellCreateOptions as Q, RemoteStorageAPI as R, StorageAPI as S, type ShellCreateResponse as T, type UpdateBackendRequest as U, type ShellExitEvent as V, type ShellOutputEvent as W, type SpaceAccessTokenInfo as X, type SpaceAssignment as Y, type SpaceInvite as Z, type SpaceKeyGrantInfo as _, type SpaceRole as a, SpaceRoles as a0, SpacesAPI as a1, type SyncBackendInfo as a2, type TransferDirection as a3, type TransferProgress as a4, type TransferState as a5, WebAPI as a6, canExternalClientSendRequests as a7, isExternalClientConnected as a8, type DecryptedSpace as b, type Device as c, type DeviceInfo as d, type DeviceType as e, type DirEntry as f, type ExternalConnection as g, ExternalConnectionErrorCode as h, ExternalConnectionState as i, type ExternalRequest as j, type ExternalRequestEvent as k, type ExternalRequestHandler as l, type ExternalRequestPayload as m, type ExternalResponse as n, FilesystemAPI as o, LocalSendAPI as p, type LocalSendEvent as q, type FileInfo as r, type LocalSendSettings as s, type PendingTransfer as t, PermissionsAPI as u, type AddBackendRequest as v, type S3Config as w, type S3PublicConfig as x, type StorageBackendInfo as y, type StorageObjectInfo as z };
1285
+ export { type SpaceInvite as $, type AuthorizedClient as A, type BlockedClient as B, type StorageObjectInfo as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type RequestedExtension as G, HaexVaultSdk as H, type SelectFileOptions as I, type SelectFolderOptions as J, KnownPath as K, LOCALSEND_EVENTS as L, type ServerInfo as M, type ServerStatus as N, type SessionAuthorization as O, type PendingAuthorization as P, type SharedSpace as Q, RemoteStorageAPI as R, StorageAPI as S, ShellAPI as T, type UpdateBackendRequest as U, type ShellCreateOptions as V, type ShellCreateResponse as W, type ShellExitEvent as X, type ShellOutputEvent as Y, type SpaceAccessTokenInfo as Z, type SpaceAssignment as _, type SpaceRole as a, type SpaceKeyGrantInfo as a0, type SpaceMemberInfo as a1, SpaceRoles as a2, SpacesAPI as a3, type SyncBackendInfo as a4, type TransferDirection as a5, type TransferProgress as a6, type TransferState as a7, WebAPI as a8, canExternalClientSendRequests as a9, isExternalClientConnected as aa, type DecryptedSpace as b, type Device as c, type DeviceInfo as d, type DeviceType as e, type DirEntry as f, type ExternalConnection as g, ExternalConnectionErrorCode as h, ExternalConnectionState as i, type ExternalRequest as j, type ExternalRequestEvent as k, type ExternalRequestHandler as l, type ExternalRequestPayload as m, type ExternalResponse as n, FilesystemAPI as o, type KnownPaths as p, LocalSendAPI as q, type LocalSendEvent as r, type FileInfo as s, type LocalSendSettings as t, type PendingTransfer as u, PermissionsAPI as v, type AddBackendRequest as w, type S3Config as x, type S3PublicConfig as y, type StorageBackendInfo as z };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as SpaceRole, H as HaexVaultSdk } from './client-DvH4bGGw.mjs';
2
- export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, b as DecryptedSpace, c as Device, d as DeviceInfo, e as DeviceType, f as DirEntry, E as ExternalAuthDecision, g as ExternalConnection, h as ExternalConnectionErrorCode, i as ExternalConnectionState, j as ExternalRequest, k as ExternalRequestEvent, l as ExternalRequestHandler, m as ExternalRequestPayload, n as ExternalResponse, F as FileStat, o as FilesystemAPI, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, P as PendingAuthorization, t as PendingTransfer, u as PermissionsAPI, v as RemoteAddBackendRequest, w as RemoteS3Config, x as RemoteS3PublicConfig, R as RemoteStorageAPI, y as RemoteStorageBackendInfo, z as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, C as RequestedExtension, G as SelectFileOptions, I as SelectFolderOptions, J as ServerInfo, K as ServerStatus, M as SessionAuthorization, N as SharedSpace, O as ShellAPI, Q as ShellCreateOptions, T as ShellCreateResponse, V as ShellExitEvent, W as ShellOutputEvent, X as SpaceAccessTokenInfo, Y as SpaceAssignment, Z as SpaceInvite, _ as SpaceKeyGrantInfo, $ as SpaceMemberInfo, a0 as SpaceRoles, a1 as SpacesAPI, a2 as SyncBackendInfo, a3 as TransferDirection, a4 as TransferProgress, a5 as TransferState, a6 as WebAPI, a7 as canExternalClientSendRequests, a8 as isExternalClientConnected } from './client-DvH4bGGw.mjs';
3
- import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-B1O6KckK.mjs';
4
- export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, a as ExtensionInfo, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-B1O6KckK.mjs';
1
+ import { a as SpaceRole, H as HaexVaultSdk } from './client-BUsw25aA.mjs';
2
+ export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, b as DecryptedSpace, c as Device, d as DeviceInfo, e as DeviceType, f as DirEntry, E as ExternalAuthDecision, g as ExternalConnection, h as ExternalConnectionErrorCode, i as ExternalConnectionState, j as ExternalRequest, k as ExternalRequestEvent, l as ExternalRequestHandler, m as ExternalRequestPayload, n as ExternalResponse, F as FileStat, o as FilesystemAPI, K as KnownPath, p as KnownPaths, L as LOCALSEND_EVENTS, q as LocalSendAPI, r as LocalSendEvent, s as LocalSendFileInfo, t as LocalSendSettings, P as PendingAuthorization, u as PendingTransfer, v as PermissionsAPI, w as RemoteAddBackendRequest, x as RemoteS3Config, y as RemoteS3PublicConfig, R as RemoteStorageAPI, z as RemoteStorageBackendInfo, C as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, G as RequestedExtension, I as SelectFileOptions, J as SelectFolderOptions, M as ServerInfo, N as ServerStatus, O as SessionAuthorization, Q as SharedSpace, T as ShellAPI, V as ShellCreateOptions, W as ShellCreateResponse, X as ShellExitEvent, Y as ShellOutputEvent, Z as SpaceAccessTokenInfo, _ as SpaceAssignment, $ as SpaceInvite, a0 as SpaceKeyGrantInfo, a1 as SpaceMemberInfo, a2 as SpaceRoles, a3 as SpacesAPI, a4 as SyncBackendInfo, a5 as TransferDirection, a6 as TransferProgress, a7 as TransferState, a8 as WebAPI, a9 as canExternalClientSendRequests, aa as isExternalClientConnected } from './client-BUsw25aA.mjs';
3
+ import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-DmCSegdY.mjs';
4
+ export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, a as ExtensionInfo, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-DmCSegdY.mjs';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
@@ -351,6 +351,8 @@ declare const FILESYSTEM_COMMANDS: {
351
351
  readonly rename: "extension_filesystem_rename";
352
352
  /** Copy file or directory */
353
353
  readonly copy: "extension_filesystem_copy";
354
+ /** Get well-known system directory paths */
355
+ readonly knownPaths: "extension_filesystem_known_paths";
354
356
  /** Start watching a directory for changes */
355
357
  readonly watch: "extension_filesystem_watch";
356
358
  /** Stop watching a directory */
@@ -607,6 +609,7 @@ declare const TAURI_COMMANDS: {
607
609
  readonly selectFile: "extension_filesystem_select_file";
608
610
  readonly rename: "extension_filesystem_rename";
609
611
  readonly copy: "extension_filesystem_copy";
612
+ readonly knownPaths: "extension_filesystem_known_paths";
610
613
  readonly watch: "extension_filesystem_watch";
611
614
  readonly unwatch: "extension_filesystem_unwatch";
612
615
  readonly isWatching: "extension_filesystem_is_watching";
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as SpaceRole, H as HaexVaultSdk } from './client-CScVlK1m.js';
2
- export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, b as DecryptedSpace, c as Device, d as DeviceInfo, e as DeviceType, f as DirEntry, E as ExternalAuthDecision, g as ExternalConnection, h as ExternalConnectionErrorCode, i as ExternalConnectionState, j as ExternalRequest, k as ExternalRequestEvent, l as ExternalRequestHandler, m as ExternalRequestPayload, n as ExternalResponse, F as FileStat, o as FilesystemAPI, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, P as PendingAuthorization, t as PendingTransfer, u as PermissionsAPI, v as RemoteAddBackendRequest, w as RemoteS3Config, x as RemoteS3PublicConfig, R as RemoteStorageAPI, y as RemoteStorageBackendInfo, z as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, C as RequestedExtension, G as SelectFileOptions, I as SelectFolderOptions, J as ServerInfo, K as ServerStatus, M as SessionAuthorization, N as SharedSpace, O as ShellAPI, Q as ShellCreateOptions, T as ShellCreateResponse, V as ShellExitEvent, W as ShellOutputEvent, X as SpaceAccessTokenInfo, Y as SpaceAssignment, Z as SpaceInvite, _ as SpaceKeyGrantInfo, $ as SpaceMemberInfo, a0 as SpaceRoles, a1 as SpacesAPI, a2 as SyncBackendInfo, a3 as TransferDirection, a4 as TransferProgress, a5 as TransferState, a6 as WebAPI, a7 as canExternalClientSendRequests, a8 as isExternalClientConnected } from './client-CScVlK1m.js';
3
- import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-B1O6KckK.js';
4
- export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, a as ExtensionInfo, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-B1O6KckK.js';
1
+ import { a as SpaceRole, H as HaexVaultSdk } from './client-3B1iWut9.js';
2
+ export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, b as DecryptedSpace, c as Device, d as DeviceInfo, e as DeviceType, f as DirEntry, E as ExternalAuthDecision, g as ExternalConnection, h as ExternalConnectionErrorCode, i as ExternalConnectionState, j as ExternalRequest, k as ExternalRequestEvent, l as ExternalRequestHandler, m as ExternalRequestPayload, n as ExternalResponse, F as FileStat, o as FilesystemAPI, K as KnownPath, p as KnownPaths, L as LOCALSEND_EVENTS, q as LocalSendAPI, r as LocalSendEvent, s as LocalSendFileInfo, t as LocalSendSettings, P as PendingAuthorization, u as PendingTransfer, v as PermissionsAPI, w as RemoteAddBackendRequest, x as RemoteS3Config, y as RemoteS3PublicConfig, R as RemoteStorageAPI, z as RemoteStorageBackendInfo, C as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, G as RequestedExtension, I as SelectFileOptions, J as SelectFolderOptions, M as ServerInfo, N as ServerStatus, O as SessionAuthorization, Q as SharedSpace, T as ShellAPI, V as ShellCreateOptions, W as ShellCreateResponse, X as ShellExitEvent, Y as ShellOutputEvent, Z as SpaceAccessTokenInfo, _ as SpaceAssignment, $ as SpaceInvite, a0 as SpaceKeyGrantInfo, a1 as SpaceMemberInfo, a2 as SpaceRoles, a3 as SpacesAPI, a4 as SyncBackendInfo, a5 as TransferDirection, a6 as TransferProgress, a7 as TransferState, a8 as WebAPI, a9 as canExternalClientSendRequests, aa as isExternalClientConnected } from './client-3B1iWut9.js';
3
+ import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-DmCSegdY.js';
4
+ export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, a as ExtensionInfo, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-DmCSegdY.js';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.js';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
@@ -351,6 +351,8 @@ declare const FILESYSTEM_COMMANDS: {
351
351
  readonly rename: "extension_filesystem_rename";
352
352
  /** Copy file or directory */
353
353
  readonly copy: "extension_filesystem_copy";
354
+ /** Get well-known system directory paths */
355
+ readonly knownPaths: "extension_filesystem_known_paths";
354
356
  /** Start watching a directory for changes */
355
357
  readonly watch: "extension_filesystem_watch";
356
358
  /** Stop watching a directory */
@@ -607,6 +609,7 @@ declare const TAURI_COMMANDS: {
607
609
  readonly selectFile: "extension_filesystem_select_file";
608
610
  readonly rename: "extension_filesystem_rename";
609
611
  readonly copy: "extension_filesystem_copy";
612
+ readonly knownPaths: "extension_filesystem_known_paths";
610
613
  readonly watch: "extension_filesystem_watch";
611
614
  readonly unwatch: "extension_filesystem_unwatch";
612
615
  readonly isWatching: "extension_filesystem_is_watching";
package/dist/index.js CHANGED
@@ -684,6 +684,8 @@ var HAEXTENSION_EVENTS = {
684
684
  var EXTERNAL_EVENTS = {
685
685
  /** External request from authorized client */
686
686
  REQUEST: "haextension:external:request",
687
+ /** AI action request (tool calls from AI assistant) */
688
+ ACTION_REQUEST: "haextension:action:request",
687
689
  /** New external client requesting authorization */
688
690
  AUTHORIZATION_REQUEST: "external:authorization-request"
689
691
  };
@@ -847,6 +849,8 @@ var FILESYSTEM_COMMANDS = {
847
849
  rename: "extension_filesystem_rename",
848
850
  /** Copy file or directory */
849
851
  copy: "extension_filesystem_copy",
852
+ /** Get well-known system directory paths */
853
+ knownPaths: "extension_filesystem_known_paths",
850
854
  // File watcher operations
851
855
  /** Start watching a directory for changes */
852
856
  watch: "extension_filesystem_watch",
@@ -1146,6 +1150,15 @@ var DatabaseAPI = class {
1146
1150
 
1147
1151
  // src/api/filesystem.ts
1148
1152
  init_vaultKey();
1153
+ var KnownPath = /* @__PURE__ */ ((KnownPath2) => {
1154
+ KnownPath2["Home"] = "home";
1155
+ KnownPath2["Pictures"] = "pictures";
1156
+ KnownPath2["Downloads"] = "downloads";
1157
+ KnownPath2["Documents"] = "documents";
1158
+ KnownPath2["Desktop"] = "desktop";
1159
+ KnownPath2["Videos"] = "videos";
1160
+ return KnownPath2;
1161
+ })(KnownPath || {});
1149
1162
  var FilesystemAPI = class {
1150
1163
  constructor(client) {
1151
1164
  this.client = client;
@@ -1329,6 +1342,19 @@ var FilesystemAPI = class {
1329
1342
  );
1330
1343
  }
1331
1344
  // ==========================================================================
1345
+ // Known Paths (System Directories)
1346
+ // ==========================================================================
1347
+ /**
1348
+ * Get well-known system directory paths (home, pictures, downloads, etc.)
1349
+ * These paths are resolved via Tauri's PathResolver and are platform-aware.
1350
+ * @returns Map of known path names to their absolute paths
1351
+ */
1352
+ async knownPaths() {
1353
+ return this.client.request(
1354
+ FILESYSTEM_COMMANDS.knownPaths
1355
+ );
1356
+ }
1357
+ // ==========================================================================
1332
1358
  // File Watcher Operations
1333
1359
  // ==========================================================================
1334
1360
  /**
@@ -2120,6 +2146,24 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
2120
2146
  } catch (error) {
2121
2147
  log("Failed to setup external request listener:", error);
2122
2148
  }
2149
+ try {
2150
+ await listen(EXTERNAL_EVENTS.ACTION_REQUEST, (event) => {
2151
+ log("====== AI ACTION REQUEST RECEIVED ======");
2152
+ log("Payload:", JSON.stringify(event.payload));
2153
+ if (event.payload) {
2154
+ onEvent({
2155
+ type: EXTERNAL_EVENTS.ACTION_REQUEST,
2156
+ data: event.payload,
2157
+ timestamp: Date.now()
2158
+ });
2159
+ } else {
2160
+ log("AI action request event has no payload!");
2161
+ }
2162
+ });
2163
+ log("AI action request listener registered successfully");
2164
+ } catch (error) {
2165
+ log("Failed to setup AI action request listener:", error);
2166
+ }
2123
2167
  log("Registering file change listener for:", HAEXTENSION_EVENTS.FILE_CHANGED);
2124
2168
  try {
2125
2169
  await listen(HAEXTENSION_EVENTS.FILE_CHANGED, (event) => {
@@ -2439,7 +2483,7 @@ function createMessageHandler(config, pendingRequests, extensionInfo, onEvent) {
2439
2483
  }
2440
2484
  };
2441
2485
  }
2442
- function processEvent(event, log, eventListeners, onContextChanged, onExternalRequest) {
2486
+ function processEvent(event, log, eventListeners, onContextChanged, onExternalRequest, onActionRequest) {
2443
2487
  if (event.type === HAEXTENSION_EVENTS.CONTEXT_CHANGED) {
2444
2488
  const contextEvent = event;
2445
2489
  onContextChanged(contextEvent.data.context);
@@ -2450,6 +2494,13 @@ function processEvent(event, log, eventListeners, onContextChanged, onExternalRe
2450
2494
  onExternalRequest(externalEvent);
2451
2495
  return;
2452
2496
  }
2497
+ if (event.type === EXTERNAL_EVENTS.ACTION_REQUEST) {
2498
+ const actionEvent = event;
2499
+ if (onActionRequest) {
2500
+ onActionRequest(actionEvent);
2501
+ }
2502
+ return;
2503
+ }
2453
2504
  emitEvent(event, log, eventListeners);
2454
2505
  }
2455
2506
  function emitEvent(event, log, eventListeners) {
@@ -2586,6 +2637,12 @@ async function respondToExternalRequest(response, request) {
2586
2637
  await request(EXTERNAL_BRIDGE_COMMANDS.respond, response);
2587
2638
  }
2588
2639
 
2640
+ // src/commands/ai.ts
2641
+ var AI_COMMANDS = {
2642
+ /** Respond to an AI action request */
2643
+ actionRespond: "ai_action_respond"
2644
+ };
2645
+
2589
2646
  // src/client.ts
2590
2647
  var HaexVaultSdk = class {
2591
2648
  constructor(config = {}) {
@@ -2607,6 +2664,12 @@ var HaexVaultSdk = class {
2607
2664
  this.setupHook = null;
2608
2665
  // Public APIs
2609
2666
  this.orm = null;
2667
+ /** Unified action system - register handlers that work for both Bridge and AI requests */
2668
+ this.actions = {
2669
+ register: (action, handler) => {
2670
+ return this.onExternalRequest(action, handler);
2671
+ }
2672
+ };
2610
2673
  this.config = {
2611
2674
  debug: config.debug ?? false,
2612
2675
  timeout: config.timeout ?? DEFAULT_TIMEOUT,
@@ -2896,12 +2959,23 @@ var HaexVaultSdk = class {
2896
2959
  this._context = ctx;
2897
2960
  this.notifySubscribersInternal();
2898
2961
  },
2899
- (extEvent) => this.handleExternalRequestInternal(extEvent.data)
2962
+ (extEvent) => this.handleExternalRequestInternal(extEvent.data),
2963
+ (actionEvent) => this.handleActionRequestInternal(actionEvent.data)
2900
2964
  );
2901
2965
  }
2902
2966
  async handleExternalRequestInternal(request) {
2903
2967
  await handleExternalRequest(request, this.externalRequestHandlers, this.respondToExternalRequest.bind(this), this.log.bind(this));
2904
2968
  }
2969
+ async handleActionRequestInternal(request) {
2970
+ await handleExternalRequest(
2971
+ request,
2972
+ this.externalRequestHandlers,
2973
+ async (response) => {
2974
+ await this.request(AI_COMMANDS.actionRespond, response);
2975
+ },
2976
+ this.log.bind(this)
2977
+ );
2978
+ }
2905
2979
  // ==========================================================================
2906
2980
  // Private: Setup
2907
2981
  // ==========================================================================
@@ -3596,6 +3670,7 @@ exports.HAEXSPACE_MESSAGE_TYPES = HAEXSPACE_MESSAGE_TYPES;
3596
3670
  exports.HAEXTENSION_EVENTS = HAEXTENSION_EVENTS;
3597
3671
  exports.HaexVaultSdk = HaexVaultSdk;
3598
3672
  exports.HaexVaultSdkError = HaexVaultSdkError;
3673
+ exports.KnownPath = KnownPath;
3599
3674
  exports.LOCALSEND_EVENTS = LOCALSEND_EVENTS;
3600
3675
  exports.LocalSendAPI = LocalSendAPI;
3601
3676
  exports.PermissionErrorCode = PermissionErrorCode;