@haex-space/vault-sdk 4.0.0 → 4.2.0

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.
Files changed (42) hide show
  1. package/dist/cli/index.mjs.map +1 -1
  2. package/dist/{client-GdCi-m2s.d.mts → client-7bZyiRwE.d.mts} +127 -36
  3. package/dist/{client-C6pEREPM.d.ts → client-BPwsH1so.d.ts} +127 -36
  4. package/dist/index.d.mts +9 -6
  5. package/dist/index.d.ts +9 -6
  6. package/dist/index.js +79 -25
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +78 -24
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/node.d.mts +1 -1
  11. package/dist/node.d.ts +1 -1
  12. package/dist/node.mjs +1 -1
  13. package/dist/node.mjs.map +1 -1
  14. package/dist/nuxt.js +1 -1
  15. package/dist/nuxt.js.map +1 -1
  16. package/dist/react.d.mts +2 -2
  17. package/dist/react.d.ts +2 -2
  18. package/dist/react.js +79 -25
  19. package/dist/react.js.map +1 -1
  20. package/dist/react.mjs +78 -24
  21. package/dist/react.mjs.map +1 -1
  22. package/dist/runtime/nuxt.plugin.client.d.mts +2 -2
  23. package/dist/runtime/nuxt.plugin.client.d.ts +2 -2
  24. package/dist/runtime/nuxt.plugin.client.js +77 -23
  25. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  26. package/dist/runtime/nuxt.plugin.client.mjs +77 -23
  27. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  28. package/dist/svelte.d.mts +2 -2
  29. package/dist/svelte.d.ts +2 -2
  30. package/dist/svelte.js +79 -25
  31. package/dist/svelte.js.map +1 -1
  32. package/dist/svelte.mjs +78 -24
  33. package/dist/svelte.mjs.map +1 -1
  34. package/dist/{types-Ba4G6ZpC.d.mts → types-BwFKGH70.d.mts} +1 -1
  35. package/dist/{types-Ba4G6ZpC.d.ts → types-BwFKGH70.d.ts} +1 -1
  36. package/dist/vue.d.mts +2 -2
  37. package/dist/vue.d.ts +2 -2
  38. package/dist/vue.js +79 -25
  39. package/dist/vue.js.map +1 -1
  40. package/dist/vue.mjs +78 -24
  41. package/dist/vue.mjs.map +1 -1
  42. package/package.json +2 -2
@@ -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, E as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, R as RequestOptions } from './types-Ba4G6ZpC.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, E as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, R as RequestOptions } from './types-BwFKGH70.js';
2
2
  import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
3
3
 
4
4
  /**
@@ -545,20 +545,54 @@ interface S3PublicConfig {
545
545
  bucket: string;
546
546
  }
547
547
  /**
548
- * Storage backend info (public, without credentials)
548
+ * A storage the extension may use, as the host lists it: names only, never
549
+ * credentials, endpoint or region.
549
550
  */
550
551
  interface StorageBackendInfo {
551
552
  id: string;
552
553
  /** Backend type (e.g., "s3") */
553
554
  type: string;
555
+ /** Name of the storage */
554
556
  name: string;
555
- enabled: boolean;
556
- createdAt: string;
557
- /** Public config without secrets (endpoint, bucket, region) */
557
+ /** Name of the provider the user gave the connection (e.g., "Hetzner") */
558
+ providerName: string;
559
+ /** Bucket of the storage */
560
+ bucket: string;
561
+ /** @deprecated Not sent by hosts that keep credentials to themselves (holzi). */
562
+ enabled?: boolean;
563
+ /** @deprecated Not sent by hosts that keep credentials to themselves (holzi). */
564
+ createdAt?: string;
565
+ /** @deprecated Not sent by hosts that keep credentials to themselves (holzi). */
558
566
  config?: S3PublicConfig;
559
567
  }
560
568
  /**
561
- * S3-compatible backend configuration
569
+ * What an extension proposes for a new S3 storage. The host shows it to the
570
+ * user and asks for credentials in its own window; an extension never sends
571
+ * or sees them.
572
+ */
573
+ interface S3Proposal {
574
+ /** Custom endpoint URL (for non-AWS S3-compatible services); the host may ask for a permission for its host */
575
+ endpoint?: string;
576
+ /** Region; required unless `sameProviderAs` is given */
577
+ region?: string;
578
+ /** Bucket name */
579
+ bucket: string;
580
+ /** Use path-style URLs instead of virtual-hosted-style */
581
+ pathStyle?: boolean;
582
+ /** Credentials are entered by the host and are never accepted in a proposal. */
583
+ accessKeyId?: never;
584
+ /** Credentials are entered by the host and are never accepted in a proposal. */
585
+ secretAccessKey?: never;
586
+ /** Credentials are entered by the host and are never accepted in a proposal. */
587
+ sessionToken?: never;
588
+ }
589
+ /**
590
+ * S3-compatible backend configuration with credentials.
591
+ *
592
+ * @deprecated Credentials are entered in the host, never passed by an
593
+ * extension: holzi refuses a request that carries `accessKeyId`,
594
+ * `secretAccessKey` or `sessionToken`. Use {@link S3Proposal}. Removed in the
595
+ * next major version.
562
596
  */
563
597
  interface S3Config {
564
598
  /** Custom endpoint URL (for non-AWS S3-compatible services) */
@@ -567,37 +601,73 @@ interface S3Config {
567
601
  region: string;
568
602
  /** Bucket name */
569
603
  bucket: string;
570
- /** Access key ID */
571
- accessKeyId: string;
572
- /** Secret access key */
573
- secretAccessKey: string;
574
- /** Session token for temporary credentials (e.g., Supabase S3 with user JWT for RLS) */
604
+ /** @deprecated Entered in the host. */
605
+ accessKeyId?: string;
606
+ /** @deprecated Entered in the host. */
607
+ secretAccessKey?: string;
608
+ /** @deprecated Entered in the host. */
575
609
  sessionToken?: string;
576
610
  /** Use path-style URLs instead of virtual-hosted-style */
577
611
  pathStyle?: boolean;
578
612
  }
579
- /**
580
- * Request to add a new storage backend
581
- */
582
- interface AddBackendRequest {
583
- /** Display name for the backend */
613
+ interface AddBackendRequestBase {
614
+ /** Display name for the storage */
584
615
  name: string;
585
616
  /** Backend type (currently only "s3") */
586
617
  type: "s3";
587
- /** Configuration (structure depends on type) */
588
- config: S3Config | Record<string, unknown>;
589
618
  }
590
619
  /**
591
- * Request to update a storage backend
592
- * Only provided fields are updated. Credentials are preserved if not provided.
620
+ * Request to add a new storage on a new connection. The host asks the user to
621
+ * confirm it and enters credentials in its own window.
622
+ */
623
+ type AddBackendRequest = (AddBackendRequestBase & {
624
+ /** A credential-free proposal for a new connection; region is required. */
625
+ config: S3Proposal & {
626
+ region: string;
627
+ };
628
+ /** A new connection cannot reuse an existing provider. */
629
+ sameProviderAs?: never;
630
+ })
631
+ /**
632
+ * Request to add a bucket on an existing connection. Endpoint, region and
633
+ * addressing are taken from the referenced storage.
634
+ */
635
+ | (AddBackendRequestBase & {
636
+ /** With an existing provider, only the bucket may be proposed. */
637
+ config: {
638
+ bucket: string;
639
+ endpoint?: never;
640
+ region?: never;
641
+ pathStyle?: never;
642
+ accessKeyId?: never;
643
+ secretAccessKey?: never;
644
+ sessionToken?: never;
645
+ };
646
+ /** A storage the extension may read. */
647
+ sameProviderAs: string;
648
+ });
649
+ /**
650
+ * Request to change a storage. The host asks the user to confirm it; new
651
+ * credentials are entered only in the host's own window.
593
652
  */
594
653
  interface UpdateBackendRequest {
595
654
  /** Backend ID to update */
596
655
  backendId: string;
597
656
  /** New display name (optional) */
598
657
  name?: string;
599
- /** New configuration (optional) - only non-empty fields are updated */
600
- config?: Partial<S3Config> | Record<string, unknown>;
658
+ /**
659
+ * Only the bucket can be changed through the extension request. Credentials
660
+ * and connection details never cross the bridge.
661
+ */
662
+ config?: {
663
+ bucket?: string;
664
+ endpoint?: never;
665
+ region?: never;
666
+ pathStyle?: never;
667
+ accessKeyId?: never;
668
+ secretAccessKey?: never;
669
+ sessionToken?: never;
670
+ };
601
671
  }
602
672
  /**
603
673
  * Object info from list operation
@@ -672,14 +742,16 @@ declare class BackendManagement {
672
742
  */
673
743
  list(): Promise<StorageBackendInfo[]>;
674
744
  /**
675
- * Add a new storage backend
676
- * @param request - Backend configuration
745
+ * Propose a new storage. The host asks the user; credentials are entered
746
+ * only there. Resolves with the new storage, which the extension may then
747
+ * read and write.
748
+ * @param request - The proposal, without credentials
677
749
  * @returns Created backend info
678
750
  */
679
751
  add(request: AddBackendRequest): Promise<StorageBackendInfo>;
680
752
  /**
681
- * Update a storage backend
682
- * Only provided fields are updated. Credentials are preserved if not provided.
753
+ * Change a storage after the user confirms it in the host.
754
+ * Only provided fields are updated; new credentials are entered in the host.
683
755
  * @param request - Update request with backendId and fields to update
684
756
  * @returns Updated backend info
685
757
  */
@@ -1160,7 +1232,20 @@ interface ShellInfo {
1160
1232
  }
1161
1233
  declare class ShellAPI {
1162
1234
  private readonly sdk;
1235
+ /** `shell:output` events per session handed on but not yet acknowledged. */
1236
+ private readonly unacknowledged;
1237
+ private flushScheduled;
1238
+ /** The host does not know `extension_shell_ack` (it reads output without backpressure). */
1239
+ private ackUnsupported;
1163
1240
  constructor(sdk: HaexVaultSdk);
1241
+ /**
1242
+ * Backpressure: the host keeps reading a shell's output only while this frame has few
1243
+ * events open, so a shell that writes fast waits instead of flooding the page. The SDK
1244
+ * acknowledges every event once the listeners have had it, in one request per session and
1245
+ * task.
1246
+ */
1247
+ private acknowledge;
1248
+ private flushAcknowledgements;
1164
1249
  /**
1165
1250
  * List available shell environments on the host system.
1166
1251
  * No filesystem permission required.
@@ -1333,7 +1418,7 @@ interface MailAccount {
1333
1418
  imap: ImapConfig;
1334
1419
  smtp?: SmtpConfig;
1335
1420
  }
1336
- /** Payload of `MAIL_EVENTS.NEW_MESSAGES`, emitted by a background poll watch. */
1421
+ /** Payload of `MAIL_EVENTS.NEW_MESSAGES`, emitted by a background mail watch. */
1337
1422
  interface MailNewMessagesEvent {
1338
1423
  accountId: string;
1339
1424
  mailboxName: string;
@@ -1481,16 +1566,22 @@ declare class MailAPI {
1481
1566
  */
1482
1567
  buildRfc822Async(imapHost: string, message: OutgoingMessage): Promise<string>;
1483
1568
  /**
1484
- * Start (or replace) a background poll watch for `accountId`/`mailboxName`.
1485
- * The host resolves credentials itself from `accountId` — no `ImapConfig`
1486
- * is passed in. Requires `mail` permission with action `poll` on the
1487
- * account's IMAP host (prompted on first call, same as `fetch`/`send`).
1569
+ * Start (or replace) a background watch for `accountId`/`mailboxName`.
1570
+ * Requires `mail` permission with action `poll` on the account's IMAP
1571
+ * host (`imap.host` when passed; prompted on first call, same as
1572
+ * `fetch`/`send`).
1573
+ *
1574
+ * Pass the account's `imap` config, as for every other mail call: the host
1575
+ * keeps the credentials in memory for as long as the watch runs and never
1576
+ * stores them. Hosts that wait with IMAP IDLE are told about new mail by the
1577
+ * server; `intervalSeconds` (clamped host-side to [30, 3600]) is the polling
1578
+ * interval for servers without IDLE. Listen for results via `onNewMessages`.
1488
1579
  *
1489
- * `intervalSeconds` is clamped host-side to [30, 3600]. Listen for
1490
- * results via `onNewMessages`.
1580
+ * `imap` is optional for hosts that resolve the credentials themselves from
1581
+ * `accountId`; holzi requires it.
1491
1582
  */
1492
- startWatchingAsync(accountId: string, mailboxName: string, intervalSeconds: number): Promise<void>;
1493
- /** Stop a background poll watch previously started with `startWatchingAsync`. */
1583
+ startWatchingAsync(accountId: string, mailboxName: string, intervalSeconds: number, imap?: ImapConfig): Promise<void>;
1584
+ /** Stop a background watch previously started with `startWatchingAsync`. */
1494
1585
  stopWatchingAsync(accountId: string, mailboxName: string): Promise<void>;
1495
1586
  /**
1496
1587
  * Register a callback for new-mail notifications from any active watch.
@@ -1720,4 +1811,4 @@ declare class HaexVaultSdk {
1720
1811
  private log;
1721
1812
  }
1722
1813
 
1723
- export { PasswordsAPI as $, type AuthorizedClient as A, type BlockedClient as B, type ConfirmOptions as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type MailMessage as G, HaexVaultSdk as H, type ImapConfig as I, type MailNewMessagesEvent as J, KnownPath as K, LOCALSEND_EVENTS as L, MailAPI as M, type MailboxInfo as N, type MessageEnvelope as O, type NotificationAction as P, type NotificationClickEvent as Q, type NotificationOptions as R, StorageAPI as S, NotificationsAPI as T, type OutgoingAttachment as U, type OutgoingMessage as V, type PasswordInput as W, type PasswordItemFull as X, type PasswordItemSummary as Y, type PasswordKeyValue as Z, type PasswordKeyValueInput as _, type ConnectionSecurity as a, type PendingAuthorization as a0, type PendingTransfer as a1, PermissionsAPI as a2, type AddBackendRequest as a3, type S3Config as a4, type S3PublicConfig as a5, RemoteStorageAPI as a6, type StorageBackendInfo as a7, type StorageObjectInfo as a8, type UpdateBackendRequest as a9, canExternalClientSendRequests as aA, isExternalClientConnected as aB, type RequestedExtension as aa, type SelectFileOptions as ab, type SelectFolderOptions as ac, type ServerInfo as ad, type ServerStatus as ae, type SessionAuthorization as af, type SharedSpace as ag, ShellAPI as ah, type ShellCreateOptions as ai, type ShellCreateResponse as aj, type ShellExitEvent as ak, type ShellOutputEvent as al, type SmtpConfig as am, type SpaceAccessTokenInfo as an, type SpaceAssignment as ao, type SpaceInvite as ap, type SpaceKeyGrantInfo as aq, type SpaceMember as ar, type SpaceMemberInfo as as, SpacesAPI as at, type SyncBackendInfo as au, TabAPI as av, type TransferDirection as aw, type TransferProgress as ax, type TransferState as ay, WebAPI as az, type DecryptedSpace as b, type DeepLink as c, type Device as d, type DeviceInfo as e, type DeviceType as f, DialogAPI as g, type DirEntry as h, type ExternalConnection as i, ExternalConnectionErrorCode as j, ExternalConnectionState as k, type ExternalRequest as l, type ExternalRequestEvent as m, type ExternalRequestHandler as n, type ExternalRequestPayload as o, type ExternalResponse as p, FilesystemAPI as q, type KnownPaths as r, LocalSendAPI as s, type LocalSendEvent as t, type FileInfo as u, type LocalSendSettings as v, type MailAccount as w, type MailAddress as x, type Attachment as y, type FetchRange as z };
1814
+ export { PasswordsAPI as $, type AuthorizedClient as A, type BlockedClient as B, type ConfirmOptions as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type MailMessage as G, HaexVaultSdk as H, type ImapConfig as I, type MailNewMessagesEvent as J, KnownPath as K, LOCALSEND_EVENTS as L, MailAPI as M, type MailboxInfo as N, type MessageEnvelope as O, type NotificationAction as P, type NotificationClickEvent as Q, type NotificationOptions as R, StorageAPI as S, NotificationsAPI as T, type OutgoingAttachment as U, type OutgoingMessage as V, type PasswordInput as W, type PasswordItemFull as X, type PasswordItemSummary as Y, type PasswordKeyValue as Z, type PasswordKeyValueInput as _, type ConnectionSecurity as a, type PendingAuthorization as a0, type PendingTransfer as a1, PermissionsAPI as a2, type AddBackendRequest as a3, type S3Config as a4, type S3Proposal as a5, type S3PublicConfig as a6, RemoteStorageAPI as a7, type StorageBackendInfo as a8, type StorageObjectInfo as a9, WebAPI as aA, canExternalClientSendRequests as aB, isExternalClientConnected as aC, type UpdateBackendRequest as aa, type RequestedExtension as ab, type SelectFileOptions as ac, type SelectFolderOptions as ad, type ServerInfo as ae, type ServerStatus as af, type SessionAuthorization as ag, type SharedSpace as ah, ShellAPI as ai, type ShellCreateOptions as aj, type ShellCreateResponse as ak, type ShellExitEvent as al, type ShellOutputEvent as am, type SmtpConfig as an, type SpaceAccessTokenInfo as ao, type SpaceAssignment as ap, type SpaceInvite as aq, type SpaceKeyGrantInfo as ar, type SpaceMember as as, type SpaceMemberInfo as at, SpacesAPI as au, type SyncBackendInfo as av, TabAPI as aw, type TransferDirection as ax, type TransferProgress as ay, type TransferState as az, type DecryptedSpace as b, type DeepLink as c, type Device as d, type DeviceInfo as e, type DeviceType as f, DialogAPI as g, type DirEntry as h, type ExternalConnection as i, ExternalConnectionErrorCode as j, ExternalConnectionState as k, type ExternalRequest as l, type ExternalRequestEvent as m, type ExternalRequestHandler as n, type ExternalRequestPayload as o, type ExternalResponse as p, FilesystemAPI as q, type KnownPaths as r, LocalSendAPI as s, type LocalSendEvent as t, type FileInfo as u, type LocalSendSettings as v, type MailAccount as w, type MailAddress as x, type Attachment as y, type FetchRange as z };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk } from './client-GdCi-m2s.mjs';
2
- export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3PublicConfig, a6 as RemoteStorageAPI, a7 as RemoteStorageBackendInfo, a8 as RemoteStorageObjectInfo, a9 as RemoteUpdateBackendRequest, aa as RequestedExtension, ab as SelectFileOptions, ac as SelectFolderOptions, ad as ServerInfo, ae as ServerStatus, af as SessionAuthorization, ag as SharedSpace, ah as ShellAPI, ai as ShellCreateOptions, aj as ShellCreateResponse, ak as ShellExitEvent, al as ShellOutputEvent, am as SmtpConfig, an as SpaceAccessTokenInfo, ao as SpaceAssignment, ap as SpaceInvite, aq as SpaceKeyGrantInfo, ar as SpaceMember, as as SpaceMemberInfo, at as SpacesAPI, au as SyncBackendInfo, av as TabAPI, aw as TransferDirection, ax as TransferProgress, ay as TransferState, az as WebAPI, aA as canExternalClientSendRequests, aB as isExternalClientConnected } from './client-GdCi-m2s.mjs';
3
- import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-Ba4G6ZpC.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, E as ExtensionInfo, a as ExtensionManifest, 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 MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-Ba4G6ZpC.mjs';
1
+ import { H as HaexVaultSdk } from './client-7bZyiRwE.mjs';
2
+ export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3Proposal, a6 as RemoteS3PublicConfig, a7 as RemoteStorageAPI, a8 as RemoteStorageBackendInfo, a9 as RemoteStorageObjectInfo, aa as RemoteUpdateBackendRequest, ab as RequestedExtension, ac as SelectFileOptions, ad as SelectFolderOptions, ae as ServerInfo, af as ServerStatus, ag as SessionAuthorization, ah as SharedSpace, ai as ShellAPI, aj as ShellCreateOptions, ak as ShellCreateResponse, al as ShellExitEvent, am as ShellOutputEvent, an as SmtpConfig, ao as SpaceAccessTokenInfo, ap as SpaceAssignment, aq as SpaceInvite, ar as SpaceKeyGrantInfo, as as SpaceMember, at as SpaceMemberInfo, au as SpacesAPI, av as SyncBackendInfo, aw as TabAPI, ax as TransferDirection, ay as TransferProgress, az as TransferState, aA as WebAPI, aB as canExternalClientSendRequests, aC as isExternalClientConnected } from './client-7bZyiRwE.mjs';
3
+ import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BwFKGH70.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, E as ExtensionInfo, a as ExtensionManifest, 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 MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-BwFKGH70.mjs';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
@@ -135,9 +135,9 @@ declare const MAIL_COMMANDS: {
135
135
  readonly sendMessage: "extension_mail_send_message";
136
136
  /** Build RFC822 bytes without sending (for Drafts via APPEND) */
137
137
  readonly buildRfc822: "extension_mail_build_rfc822";
138
- /** Start (or replace) a background poll watch for an account/mailbox */
138
+ /** Start (or replace) a background new-mail watch for an account/mailbox */
139
139
  readonly startWatch: "extension_mail_start_watch";
140
- /** Stop a background poll watch */
140
+ /** Stop a background new-mail watch */
141
141
  readonly stopWatch: "extension_mail_stop_watch";
142
142
  };
143
143
  type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
@@ -647,6 +647,8 @@ declare const SHELL_COMMANDS: {
647
647
  readonly create: "extension_shell_create";
648
648
  /** Write data to a shell session's stdin */
649
649
  readonly write: "extension_shell_write";
650
+ /** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
651
+ readonly ack: "extension_shell_ack";
650
652
  /** Resize a shell session's terminal */
651
653
  readonly resize: "extension_shell_resize";
652
654
  /** Close a shell session */
@@ -787,6 +789,7 @@ declare const TAURI_COMMANDS: {
787
789
  readonly listAvailable: "extension_shell_list_available";
788
790
  readonly create: "extension_shell_create";
789
791
  readonly write: "extension_shell_write";
792
+ readonly ack: "extension_shell_ack";
790
793
  readonly resize: "extension_shell_resize";
791
794
  readonly close: "extension_shell_close";
792
795
  };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk } from './client-C6pEREPM.js';
2
- export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3PublicConfig, a6 as RemoteStorageAPI, a7 as RemoteStorageBackendInfo, a8 as RemoteStorageObjectInfo, a9 as RemoteUpdateBackendRequest, aa as RequestedExtension, ab as SelectFileOptions, ac as SelectFolderOptions, ad as ServerInfo, ae as ServerStatus, af as SessionAuthorization, ag as SharedSpace, ah as ShellAPI, ai as ShellCreateOptions, aj as ShellCreateResponse, ak as ShellExitEvent, al as ShellOutputEvent, am as SmtpConfig, an as SpaceAccessTokenInfo, ao as SpaceAssignment, ap as SpaceInvite, aq as SpaceKeyGrantInfo, ar as SpaceMember, as as SpaceMemberInfo, at as SpacesAPI, au as SyncBackendInfo, av as TabAPI, aw as TransferDirection, ax as TransferProgress, ay as TransferState, az as WebAPI, aA as canExternalClientSendRequests, aB as isExternalClientConnected } from './client-C6pEREPM.js';
3
- import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-Ba4G6ZpC.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, E as ExtensionInfo, a as ExtensionManifest, 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 MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-Ba4G6ZpC.js';
1
+ import { H as HaexVaultSdk } from './client-BPwsH1so.js';
2
+ export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3Proposal, a6 as RemoteS3PublicConfig, a7 as RemoteStorageAPI, a8 as RemoteStorageBackendInfo, a9 as RemoteStorageObjectInfo, aa as RemoteUpdateBackendRequest, ab as RequestedExtension, ac as SelectFileOptions, ad as SelectFolderOptions, ae as ServerInfo, af as ServerStatus, ag as SessionAuthorization, ah as SharedSpace, ai as ShellAPI, aj as ShellCreateOptions, ak as ShellCreateResponse, al as ShellExitEvent, am as ShellOutputEvent, an as SmtpConfig, ao as SpaceAccessTokenInfo, ap as SpaceAssignment, aq as SpaceInvite, ar as SpaceKeyGrantInfo, as as SpaceMember, at as SpaceMemberInfo, au as SpacesAPI, av as SyncBackendInfo, aw as TabAPI, ax as TransferDirection, ay as TransferProgress, az as TransferState, aA as WebAPI, aB as canExternalClientSendRequests, aC as isExternalClientConnected } from './client-BPwsH1so.js';
3
+ import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BwFKGH70.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, E as ExtensionInfo, a as ExtensionManifest, 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 MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-BwFKGH70.js';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.js';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
@@ -135,9 +135,9 @@ declare const MAIL_COMMANDS: {
135
135
  readonly sendMessage: "extension_mail_send_message";
136
136
  /** Build RFC822 bytes without sending (for Drafts via APPEND) */
137
137
  readonly buildRfc822: "extension_mail_build_rfc822";
138
- /** Start (or replace) a background poll watch for an account/mailbox */
138
+ /** Start (or replace) a background new-mail watch for an account/mailbox */
139
139
  readonly startWatch: "extension_mail_start_watch";
140
- /** Stop a background poll watch */
140
+ /** Stop a background new-mail watch */
141
141
  readonly stopWatch: "extension_mail_stop_watch";
142
142
  };
143
143
  type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
@@ -647,6 +647,8 @@ declare const SHELL_COMMANDS: {
647
647
  readonly create: "extension_shell_create";
648
648
  /** Write data to a shell session's stdin */
649
649
  readonly write: "extension_shell_write";
650
+ /** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
651
+ readonly ack: "extension_shell_ack";
650
652
  /** Resize a shell session's terminal */
651
653
  readonly resize: "extension_shell_resize";
652
654
  /** Close a shell session */
@@ -787,6 +789,7 @@ declare const TAURI_COMMANDS: {
787
789
  readonly listAvailable: "extension_shell_list_available";
788
790
  readonly create: "extension_shell_create";
789
791
  readonly write: "extension_shell_write";
792
+ readonly ack: "extension_shell_ack";
790
793
  readonly resize: "extension_shell_resize";
791
794
  readonly close: "extension_shell_close";
792
795
  };
package/dist/index.js CHANGED
@@ -12,9 +12,9 @@ var __export = (target, all) => {
12
12
  __defProp(target, name, { get: all[name], enumerable: true });
13
13
  };
14
14
 
15
- // node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.28_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
15
+ // node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
16
16
  var init_cjs_shims = __esm({
17
- "node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.28_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
17
+ "node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
18
18
  }
19
19
  });
20
20
 
@@ -1111,6 +1111,8 @@ var SHELL_COMMANDS = {
1111
1111
  create: "extension_shell_create",
1112
1112
  /** Write data to a shell session's stdin */
1113
1113
  write: "extension_shell_write",
1114
+ /** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
1115
+ ack: "extension_shell_ack",
1114
1116
  /** Resize a shell session's terminal */
1115
1117
  resize: "extension_shell_resize",
1116
1118
  /** Close a shell session */
@@ -1153,9 +1155,9 @@ var MAIL_COMMANDS = {
1153
1155
  sendMessage: "extension_mail_send_message",
1154
1156
  /** Build RFC822 bytes without sending (for Drafts via APPEND) */
1155
1157
  buildRfc822: "extension_mail_build_rfc822",
1156
- /** Start (or replace) a background poll watch for an account/mailbox */
1158
+ /** Start (or replace) a background new-mail watch for an account/mailbox */
1157
1159
  startWatch: "extension_mail_start_watch",
1158
- /** Stop a background poll watch */
1160
+ /** Stop a background new-mail watch */
1159
1161
  stopWatch: "extension_mail_stop_watch"
1160
1162
  };
1161
1163
 
@@ -1791,26 +1793,32 @@ var BackendManagement = class {
1791
1793
  );
1792
1794
  }
1793
1795
  /**
1794
- * Add a new storage backend
1795
- * @param request - Backend configuration
1796
+ * Propose a new storage. The host asks the user; credentials are entered
1797
+ * only there. Resolves with the new storage, which the extension may then
1798
+ * read and write.
1799
+ * @param request - The proposal, without credentials
1796
1800
  * @returns Created backend info
1797
1801
  */
1798
1802
  async add(request) {
1799
1803
  return this.client.request(
1800
1804
  REMOTE_STORAGE_COMMANDS.addBackend,
1801
- { request }
1805
+ { request },
1806
+ // No deadline: the host waits for the user's answer in its dialog.
1807
+ { timeout: null }
1802
1808
  );
1803
1809
  }
1804
1810
  /**
1805
- * Update a storage backend
1806
- * Only provided fields are updated. Credentials are preserved if not provided.
1811
+ * Change a storage after the user confirms it in the host.
1812
+ * Only provided fields are updated; new credentials are entered in the host.
1807
1813
  * @param request - Update request with backendId and fields to update
1808
1814
  * @returns Updated backend info
1809
1815
  */
1810
1816
  async update(request) {
1811
1817
  return this.client.request(
1812
1818
  REMOTE_STORAGE_COMMANDS.updateBackend,
1813
- { request }
1819
+ { request },
1820
+ // No deadline: the host waits for the user's answer in its dialog.
1821
+ { timeout: null }
1814
1822
  );
1815
1823
  }
1816
1824
  /**
@@ -1818,18 +1826,22 @@ var BackendManagement = class {
1818
1826
  * @param backendId - Backend ID to remove
1819
1827
  */
1820
1828
  async remove(backendId) {
1821
- await this.client.request(REMOTE_STORAGE_COMMANDS.removeBackend, {
1822
- backendId
1823
- });
1829
+ await this.client.request(
1830
+ REMOTE_STORAGE_COMMANDS.removeBackend,
1831
+ { backendId },
1832
+ { timeout: null }
1833
+ );
1824
1834
  }
1825
1835
  /**
1826
1836
  * Test connection to a storage backend
1827
1837
  * @param backendId - Backend ID to test
1828
1838
  */
1829
1839
  async test(backendId) {
1830
- await this.client.request(REMOTE_STORAGE_COMMANDS.testBackend, {
1831
- backendId
1832
- });
1840
+ await this.client.request(
1841
+ REMOTE_STORAGE_COMMANDS.testBackend,
1842
+ { backendId },
1843
+ { timeout: null }
1844
+ );
1833
1845
  }
1834
1846
  };
1835
1847
 
@@ -2080,9 +2092,44 @@ var SpacesAPI = class {
2080
2092
 
2081
2093
  // src/api/shell.ts
2082
2094
  init_cjs_shims();
2095
+ var NOT_SUPPORTED = 8e3;
2096
+ function isUnsupported(error) {
2097
+ if (error?.code === NOT_SUPPORTED) return true;
2098
+ return typeof error === "string" && /\bcommand (\S+ )?not found\b/i.test(error);
2099
+ }
2083
2100
  var ShellAPI = class {
2084
2101
  constructor(sdk) {
2085
2102
  this.sdk = sdk;
2103
+ /** `shell:output` events per session handed on but not yet acknowledged. */
2104
+ this.unacknowledged = /* @__PURE__ */ new Map();
2105
+ this.flushScheduled = false;
2106
+ /** The host does not know `extension_shell_ack` (it reads output without backpressure). */
2107
+ this.ackUnsupported = false;
2108
+ this.sdk.on(SHELL_EVENTS.OUTPUT, (event) => this.acknowledge(event));
2109
+ }
2110
+ /**
2111
+ * Backpressure: the host keeps reading a shell's output only while this frame has few
2112
+ * events open, so a shell that writes fast waits instead of flooding the page. The SDK
2113
+ * acknowledges every event once the listeners have had it, in one request per session and
2114
+ * task.
2115
+ */
2116
+ acknowledge(event) {
2117
+ const sessionId = event.data?.sessionId;
2118
+ if (this.ackUnsupported || typeof sessionId !== "string") return;
2119
+ this.unacknowledged.set(sessionId, (this.unacknowledged.get(sessionId) ?? 0) + 1);
2120
+ if (this.flushScheduled) return;
2121
+ this.flushScheduled = true;
2122
+ queueMicrotask(() => this.flushAcknowledgements());
2123
+ }
2124
+ flushAcknowledgements() {
2125
+ this.flushScheduled = false;
2126
+ const counts = [...this.unacknowledged];
2127
+ this.unacknowledged.clear();
2128
+ for (const [sessionId, count] of counts) {
2129
+ this.sdk.request(SHELL_COMMANDS.ack, { sessionId, count }).catch((error) => {
2130
+ if (isUnsupported(error)) this.ackUnsupported = true;
2131
+ });
2132
+ }
2086
2133
  }
2087
2134
  /**
2088
2135
  * List available shell environments on the host system.
@@ -2300,22 +2347,29 @@ var MailAPI = class {
2300
2347
  });
2301
2348
  }
2302
2349
  /**
2303
- * Start (or replace) a background poll watch for `accountId`/`mailboxName`.
2304
- * The host resolves credentials itself from `accountId` — no `ImapConfig`
2305
- * is passed in. Requires `mail` permission with action `poll` on the
2306
- * account's IMAP host (prompted on first call, same as `fetch`/`send`).
2350
+ * Start (or replace) a background watch for `accountId`/`mailboxName`.
2351
+ * Requires `mail` permission with action `poll` on the account's IMAP
2352
+ * host (`imap.host` when passed; prompted on first call, same as
2353
+ * `fetch`/`send`).
2354
+ *
2355
+ * Pass the account's `imap` config, as for every other mail call: the host
2356
+ * keeps the credentials in memory for as long as the watch runs and never
2357
+ * stores them. Hosts that wait with IMAP IDLE are told about new mail by the
2358
+ * server; `intervalSeconds` (clamped host-side to [30, 3600]) is the polling
2359
+ * interval for servers without IDLE. Listen for results via `onNewMessages`.
2307
2360
  *
2308
- * `intervalSeconds` is clamped host-side to [30, 3600]. Listen for
2309
- * results via `onNewMessages`.
2361
+ * `imap` is optional for hosts that resolve the credentials themselves from
2362
+ * `accountId`; holzi requires it.
2310
2363
  */
2311
- async startWatchingAsync(accountId, mailboxName, intervalSeconds) {
2364
+ async startWatchingAsync(accountId, mailboxName, intervalSeconds, imap) {
2312
2365
  return this.client.request(MAIL_COMMANDS.startWatch, {
2313
2366
  accountId,
2314
2367
  mailboxName,
2315
- intervalSeconds
2368
+ intervalSeconds,
2369
+ imap
2316
2370
  });
2317
2371
  }
2318
- /** Stop a background poll watch previously started with `startWatchingAsync`. */
2372
+ /** Stop a background watch previously started with `startWatchingAsync`. */
2319
2373
  async stopWatchingAsync(accountId, mailboxName) {
2320
2374
  return this.client.request(MAIL_COMMANDS.stopWatch, {
2321
2375
  accountId,