@haex-space/vault-sdk 3.6.0 → 4.0.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 (51) hide show
  1. package/README.md +51 -19
  2. package/dist/cli/index.js +437 -355
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/cli/index.mjs +428 -339
  5. package/dist/cli/index.mjs.map +1 -1
  6. package/dist/{client-DnCZ3KyI.d.mts → client-C6pEREPM.d.ts} +63 -3
  7. package/dist/{client-uuhuCPDu.d.ts → client-GdCi-m2s.d.mts} +63 -3
  8. package/dist/haex_bundle_bg.wasm +0 -0
  9. package/dist/index.d.mts +14 -59
  10. package/dist/index.d.ts +14 -59
  11. package/dist/index.js +139 -105
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +158 -123
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/node.d.mts +53 -2
  16. package/dist/node.d.ts +53 -2
  17. package/dist/node.js +319 -2
  18. package/dist/node.js.map +1 -1
  19. package/dist/node.mjs +320 -5
  20. package/dist/node.mjs.map +1 -1
  21. package/dist/nuxt.js +7 -5
  22. package/dist/nuxt.js.map +1 -1
  23. package/dist/nuxt.mjs +3 -2
  24. package/dist/nuxt.mjs.map +1 -1
  25. package/dist/react.d.mts +2 -2
  26. package/dist/react.d.ts +2 -2
  27. package/dist/react.js +146 -7
  28. package/dist/react.js.map +1 -1
  29. package/dist/react.mjs +166 -27
  30. package/dist/react.mjs.map +1 -1
  31. package/dist/runtime/nuxt.plugin.client.d.mts +2 -2
  32. package/dist/runtime/nuxt.plugin.client.d.ts +2 -2
  33. package/dist/runtime/nuxt.plugin.client.js +54 -7
  34. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  35. package/dist/runtime/nuxt.plugin.client.mjs +54 -7
  36. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  37. package/dist/svelte.d.mts +2 -2
  38. package/dist/svelte.d.ts +2 -2
  39. package/dist/svelte.js +146 -7
  40. package/dist/svelte.js.map +1 -1
  41. package/dist/svelte.mjs +166 -27
  42. package/dist/svelte.mjs.map +1 -1
  43. package/dist/{types-DQZCRfC-.d.mts → types-Ba4G6ZpC.d.mts} +10 -2
  44. package/dist/{types-DQZCRfC-.d.ts → types-Ba4G6ZpC.d.ts} +10 -2
  45. package/dist/vue.d.mts +2 -2
  46. package/dist/vue.d.ts +2 -2
  47. package/dist/vue.js +146 -7
  48. package/dist/vue.js.map +1 -1
  49. package/dist/vue.mjs +166 -27
  50. package/dist/vue.mjs.map +1 -1
  51. package/package.json +8 -6
package/dist/vue.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import 'path';
2
+ import 'url';
1
3
  import { ref, readonly } from 'vue';
2
4
  import { drizzle } from 'drizzle-orm/sqlite-proxy';
3
5
 
@@ -5,6 +7,10 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
7
  var __esm = (fn, res) => function __init() {
6
8
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
9
  };
10
+ var init_esm_shims = __esm({
11
+ "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/esm_shims.js"() {
12
+ }
13
+ });
8
14
 
9
15
  // src/crypto/vaultKey.ts
10
16
  function arrayBufferToBase64(buffer) {
@@ -34,17 +40,29 @@ function base64ToArrayBuffer(base64) {
34
40
  }
35
41
  var init_vaultKey = __esm({
36
42
  "src/crypto/vaultKey.ts"() {
43
+ init_esm_shims();
37
44
  }
38
45
  });
39
46
 
40
47
  // src/crypto/userKeypair.ts
41
48
  var init_userKeypair = __esm({
42
49
  "src/crypto/userKeypair.ts"() {
50
+ init_esm_shims();
43
51
  init_vaultKey();
44
52
  }
45
53
  });
46
54
 
55
+ // src/vue.ts
56
+ init_esm_shims();
57
+
58
+ // src/index.ts
59
+ init_esm_shims();
60
+
61
+ // src/polyfills/index.ts
62
+ init_esm_shims();
63
+
47
64
  // src/polyfills/localStorage.ts
65
+ init_esm_shims();
48
66
  function installLocalStoragePolyfill() {
49
67
  if (typeof window === "undefined") {
50
68
  return;
@@ -139,6 +157,7 @@ function installSessionStoragePolyfill() {
139
157
  }
140
158
 
141
159
  // src/polyfills/cookies.ts
160
+ init_esm_shims();
142
161
  function installCookiePolyfill() {
143
162
  if (typeof window === "undefined" || typeof document === "undefined") {
144
163
  return;
@@ -199,6 +218,7 @@ function installCookiePolyfill() {
199
218
  }
200
219
 
201
220
  // src/polyfills/history.ts
221
+ init_esm_shims();
202
222
  function installHistoryPolyfill() {
203
223
  if (typeof window === "undefined" || typeof history === "undefined") {
204
224
  return;
@@ -262,7 +282,11 @@ function installHistoryPolyfill() {
262
282
  }
263
283
  }
264
284
 
285
+ // src/polyfills/debug.ts
286
+ init_esm_shims();
287
+
265
288
  // src/messages.ts
289
+ init_esm_shims();
266
290
  var HAEXSPACE_MESSAGE_TYPES = {
267
291
  /** Debug message for development/troubleshooting */
268
292
  DEBUG: "haexspace:debug",
@@ -306,7 +330,11 @@ function installDebugDiagnostics() {
306
330
  }
307
331
  }
308
332
 
333
+ // src/polyfills/baseTag.ts
334
+ init_esm_shims();
335
+
309
336
  // src/polyfills/consoleForwarding.ts
337
+ init_esm_shims();
310
338
  var originalConsole = {
311
339
  log: console.log,
312
340
  info: console.info,
@@ -387,7 +415,14 @@ if (typeof window !== "undefined") {
387
415
  installPolyfills();
388
416
  }
389
417
 
418
+ // src/client.ts
419
+ init_esm_shims();
420
+
421
+ // src/types.ts
422
+ init_esm_shims();
423
+
390
424
  // src/events.ts
425
+ init_esm_shims();
391
426
  var HAEXTENSION_EVENTS = {
392
427
  /** Context (theme, locale, platform) has changed */
393
428
  CONTEXT_CHANGED: "haextension:context:changed",
@@ -465,7 +500,17 @@ var HaexVaultSdkError = class extends Error {
465
500
  }
466
501
  };
467
502
 
503
+ // src/api/storage.ts
504
+ init_esm_shims();
505
+
506
+ // src/commands.ts
507
+ init_esm_shims();
508
+
509
+ // src/commands/index.ts
510
+ init_esm_shims();
511
+
468
512
  // src/commands/database.ts
513
+ init_esm_shims();
469
514
  var DATABASE_COMMANDS = {
470
515
  /** Execute a SELECT query */
471
516
  query: "extension_database_query",
@@ -478,6 +523,7 @@ var DATABASE_COMMANDS = {
478
523
  };
479
524
 
480
525
  // src/commands/permissions.ts
526
+ init_esm_shims();
481
527
  var PERMISSIONS_COMMANDS = {
482
528
  /** Check web/fetch permission */
483
529
  checkWeb: "extension_permissions_check_web",
@@ -488,6 +534,7 @@ var PERMISSIONS_COMMANDS = {
488
534
  };
489
535
 
490
536
  // src/commands/web.ts
537
+ init_esm_shims();
491
538
  var WEB_COMMANDS = {
492
539
  /** Open URL in external browser */
493
540
  open: "extension_web_open",
@@ -496,6 +543,7 @@ var WEB_COMMANDS = {
496
543
  };
497
544
 
498
545
  // src/commands/webStorage.ts
546
+ init_esm_shims();
499
547
  var WEB_STORAGE_COMMANDS = {
500
548
  /** Get item from storage */
501
549
  getItem: "extension_web_storage_get_item",
@@ -510,6 +558,7 @@ var WEB_STORAGE_COMMANDS = {
510
558
  };
511
559
 
512
560
  // src/commands/filesystem.ts
561
+ init_esm_shims();
513
562
  var FILESYSTEM_COMMANDS = {
514
563
  // Dialog commands
515
564
  /** Show save file dialog */
@@ -553,19 +602,27 @@ var FILESYSTEM_COMMANDS = {
553
602
  };
554
603
 
555
604
  // src/commands/externalBridge.ts
605
+ init_esm_shims();
556
606
  var EXTERNAL_BRIDGE_COMMANDS = {
557
607
  // Response handling (called by extensions)
558
608
  /** Respond to an external request */
559
609
  respond: "external_bridge_respond"};
560
610
 
561
611
  // src/commands/extension.ts
612
+ init_esm_shims();
562
613
  var EXTENSION_COMMANDS = {
563
614
  /** Get extension info (manifest, id, etc.) */
564
615
  getInfo: "extension_get_info",
565
616
  /** Get application context (theme, locale, etc.) */
566
- getContext: "extension_context_get"};
617
+ getContext: "extension_context_get",
618
+ /** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
619
+ tabAttention: "extension_tab_attention",
620
+ /** Ask the user to confirm, in a dialog the host draws over this extension's tab */
621
+ dialogConfirm: "extension_dialog_confirm"
622
+ };
567
623
 
568
624
  // src/commands/remoteStorage.ts
625
+ init_esm_shims();
569
626
  var REMOTE_STORAGE_COMMANDS = {
570
627
  // Backend Management
571
628
  /** List all storage backends */
@@ -590,6 +647,7 @@ var REMOTE_STORAGE_COMMANDS = {
590
647
  };
591
648
 
592
649
  // src/commands/localsend.ts
650
+ init_esm_shims();
593
651
  var LOCALSEND_COMMANDS = {
594
652
  // Initialization
595
653
  /** Initialize LocalSend (generate identity, etc.) */
@@ -636,6 +694,7 @@ var LOCALSEND_COMMANDS = {
636
694
  };
637
695
 
638
696
  // src/commands/spaces.ts
697
+ init_esm_shims();
639
698
  var SPACE_COMMANDS = {
640
699
  /** Bulk assign rows to spaces */
641
700
  assign: "extension_space_assign",
@@ -643,10 +702,13 @@ var SPACE_COMMANDS = {
643
702
  unassign: "extension_space_unassign",
644
703
  /** Get space assignments for a table */
645
704
  getAssignments: "extension_space_get_assignments",
705
+ /** Get members of a shared space */
706
+ getMembers: "extension_space_get_members",
646
707
  /** List all spaces the user is a member of (with decrypted names) */
647
708
  list: "extension_space_list"};
648
709
 
649
710
  // src/commands/shell.ts
711
+ init_esm_shims();
650
712
  var SHELL_COMMANDS = {
651
713
  /** List available shell environments (no permission required) */
652
714
  listAvailable: "extension_shell_list_available",
@@ -661,6 +723,7 @@ var SHELL_COMMANDS = {
661
723
  };
662
724
 
663
725
  // src/commands/passwords.ts
726
+ init_esm_shims();
664
727
  var PASSWORD_COMMANDS = {
665
728
  /** List items (no secrets) within the extension's tag scope */
666
729
  list: "extension_password_list",
@@ -675,6 +738,7 @@ var PASSWORD_COMMANDS = {
675
738
  };
676
739
 
677
740
  // src/commands/mail.ts
741
+ init_esm_shims();
678
742
  var MAIL_COMMANDS = {
679
743
  /** LIST mailboxes + optional STATUS counts */
680
744
  listMailboxes: "extension_mail_list_mailboxes",
@@ -701,6 +765,7 @@ var MAIL_COMMANDS = {
701
765
  };
702
766
 
703
767
  // src/commands/notifications.ts
768
+ init_esm_shims();
704
769
  var NOTIFICATION_COMMANDS = {
705
770
  /** Show an OS notification. Returns the assigned notification id. */
706
771
  show: "extension_notifications_show",
@@ -731,6 +796,7 @@ var StorageAPI = class {
731
796
  };
732
797
 
733
798
  // src/api/database.ts
799
+ init_esm_shims();
734
800
  function quoteIdent(identifier) {
735
801
  if (identifier.startsWith('"') && identifier.endsWith('"')) {
736
802
  return identifier;
@@ -830,6 +896,7 @@ var DatabaseAPI = class {
830
896
  };
831
897
 
832
898
  // src/api/filesystem.ts
899
+ init_esm_shims();
833
900
  init_vaultKey();
834
901
  var FilesystemAPI = class {
835
902
  constructor(client) {
@@ -896,10 +963,10 @@ var FilesystemAPI = class {
896
963
  * @param path Absolute path to the file
897
964
  * @returns File contents as Uint8Array
898
965
  */
899
- async readFile(path) {
966
+ async readFile(path2) {
900
967
  const base64 = await this.client.request(
901
968
  FILESYSTEM_COMMANDS.readFile,
902
- { path }
969
+ { path: path2 }
903
970
  );
904
971
  return base64ToArrayBuffer(base64);
905
972
  }
@@ -908,11 +975,11 @@ var FilesystemAPI = class {
908
975
  * @param path Absolute path to the file
909
976
  * @param data File contents as Uint8Array
910
977
  */
911
- async writeFile(path, data) {
978
+ async writeFile(path2, data) {
912
979
  const base64 = arrayBufferToBase64(data);
913
980
  await this.client.request(
914
981
  FILESYSTEM_COMMANDS.writeFile,
915
- { path, data: base64 }
982
+ { path: path2, data: base64 }
916
983
  );
917
984
  }
918
985
  /**
@@ -920,20 +987,20 @@ var FilesystemAPI = class {
920
987
  * @param path Absolute path to the directory
921
988
  * @returns Array of directory entries
922
989
  */
923
- async readDir(path) {
990
+ async readDir(path2) {
924
991
  return this.client.request(
925
992
  FILESYSTEM_COMMANDS.readDir,
926
- { path }
993
+ { path: path2 }
927
994
  );
928
995
  }
929
996
  /**
930
997
  * Create a directory (and parent directories if needed)
931
998
  * @param path Absolute path to create
932
999
  */
933
- async mkdir(path) {
1000
+ async mkdir(path2) {
934
1001
  await this.client.request(
935
1002
  FILESYSTEM_COMMANDS.mkdir,
936
- { path }
1003
+ { path: path2 }
937
1004
  );
938
1005
  }
939
1006
  /**
@@ -941,10 +1008,10 @@ var FilesystemAPI = class {
941
1008
  * @param path Absolute path to remove
942
1009
  * @param recursive If true, remove directories recursively
943
1010
  */
944
- async remove(path, recursive = false) {
1011
+ async remove(path2, recursive = false) {
945
1012
  await this.client.request(
946
1013
  FILESYSTEM_COMMANDS.remove,
947
- { path, recursive }
1014
+ { path: path2, recursive }
948
1015
  );
949
1016
  }
950
1017
  /**
@@ -952,10 +1019,10 @@ var FilesystemAPI = class {
952
1019
  * @param path Absolute path to check
953
1020
  * @returns True if the path exists
954
1021
  */
955
- async exists(path) {
1022
+ async exists(path2) {
956
1023
  return this.client.request(
957
1024
  FILESYSTEM_COMMANDS.exists,
958
- { path }
1025
+ { path: path2 }
959
1026
  );
960
1027
  }
961
1028
  /**
@@ -963,10 +1030,10 @@ var FilesystemAPI = class {
963
1030
  * @param path Absolute path
964
1031
  * @returns File metadata
965
1032
  */
966
- async stat(path) {
1033
+ async stat(path2) {
967
1034
  return this.client.request(
968
1035
  FILESYSTEM_COMMANDS.stat,
969
- { path }
1036
+ { path: path2 }
970
1037
  );
971
1038
  }
972
1039
  /**
@@ -1035,10 +1102,10 @@ var FilesystemAPI = class {
1035
1102
  * @param ruleId Unique identifier for this watch (e.g., sync rule ID)
1036
1103
  * @param path Absolute path to the directory to watch
1037
1104
  */
1038
- async watch(ruleId, path) {
1105
+ async watch(ruleId, path2) {
1039
1106
  await this.client.request(
1040
1107
  FILESYSTEM_COMMANDS.watch,
1041
- { ruleId, path }
1108
+ { ruleId, path: path2 }
1042
1109
  );
1043
1110
  }
1044
1111
  /**
@@ -1065,6 +1132,7 @@ var FilesystemAPI = class {
1065
1132
  };
1066
1133
 
1067
1134
  // src/api/web.ts
1135
+ init_esm_shims();
1068
1136
  var WebAPI = class {
1069
1137
  constructor(client) {
1070
1138
  this.client = client;
@@ -1178,6 +1246,7 @@ var WebAPI = class {
1178
1246
  };
1179
1247
 
1180
1248
  // src/api/permissions.ts
1249
+ init_esm_shims();
1181
1250
  var PermissionsAPI = class {
1182
1251
  constructor(client) {
1183
1252
  this.client = client;
@@ -1219,11 +1288,11 @@ var PermissionsAPI = class {
1219
1288
  * @param operation The operation type ("read" or "write")
1220
1289
  * @returns Promise<boolean> indicating if permission is granted
1221
1290
  */
1222
- async checkFilesystemAsync(path, operation) {
1291
+ async checkFilesystemAsync(path2, operation) {
1223
1292
  const response = await this.client.request(
1224
1293
  PERMISSIONS_COMMANDS.checkFilesystem,
1225
1294
  {
1226
- path,
1295
+ path: path2,
1227
1296
  operation
1228
1297
  }
1229
1298
  );
@@ -1232,6 +1301,7 @@ var PermissionsAPI = class {
1232
1301
  };
1233
1302
 
1234
1303
  // src/api/remoteStorage.ts
1304
+ init_esm_shims();
1235
1305
  init_vaultKey();
1236
1306
  var RemoteStorageAPI = class {
1237
1307
  constructor(client) {
@@ -1342,6 +1412,7 @@ var BackendManagement = class {
1342
1412
  };
1343
1413
 
1344
1414
  // src/api/localsend.ts
1415
+ init_esm_shims();
1345
1416
  var LOCALSEND_EVENTS = {
1346
1417
  /** New device discovered */
1347
1418
  deviceDiscovered: "localsend:device-discovered",
@@ -1513,6 +1584,7 @@ var LocalSendAPI = class {
1513
1584
  };
1514
1585
 
1515
1586
  // src/api/spaces.ts
1587
+ init_esm_shims();
1516
1588
  var SpacesAPI = class {
1517
1589
  constructor(client) {
1518
1590
  this.client = client;
@@ -1575,9 +1647,17 @@ var SpacesAPI = class {
1575
1647
  async listSpacesAsync() {
1576
1648
  return this.client.request(SPACE_COMMANDS.list);
1577
1649
  }
1650
+ /**
1651
+ * List members of a shared space (DID + label), flagging the current user.
1652
+ * Used to resolve assignment authors to names and to detect own vs shared-in content.
1653
+ */
1654
+ async getMembersAsync(spaceId) {
1655
+ return this.client.request(SPACE_COMMANDS.getMembers, { spaceId });
1656
+ }
1578
1657
  };
1579
1658
 
1580
1659
  // src/api/shell.ts
1660
+ init_esm_shims();
1581
1661
  var ShellAPI = class {
1582
1662
  constructor(sdk) {
1583
1663
  this.sdk = sdk;
@@ -1649,6 +1729,7 @@ var ShellAPI = class {
1649
1729
  };
1650
1730
 
1651
1731
  // src/api/passwords.ts
1732
+ init_esm_shims();
1652
1733
  var PasswordsAPI = class {
1653
1734
  constructor(client) {
1654
1735
  this.client = client;
@@ -1694,6 +1775,7 @@ var PasswordsAPI = class {
1694
1775
  };
1695
1776
 
1696
1777
  // src/api/mail.ts
1778
+ init_esm_shims();
1697
1779
  var MailAPI = class {
1698
1780
  constructor(client) {
1699
1781
  this.client = client;
@@ -1833,6 +1915,7 @@ var MailAPI = class {
1833
1915
  };
1834
1916
 
1835
1917
  // src/api/notifications.ts
1918
+ init_esm_shims();
1836
1919
  var NotificationsAPI = class {
1837
1920
  constructor(client) {
1838
1921
  this.client = client;
@@ -1864,7 +1947,36 @@ var NotificationsAPI = class {
1864
1947
  }
1865
1948
  };
1866
1949
 
1950
+ // src/api/tab.ts
1951
+ init_esm_shims();
1952
+ var TabAPI = class {
1953
+ constructor(client) {
1954
+ this.client = client;
1955
+ }
1956
+ /**
1957
+ * Mark the tab as wanting the user's attention (`true`), e.g. for unread
1958
+ * content, or clear the mark (`false`).
1959
+ */
1960
+ async requestAttention(active) {
1961
+ await this.client.request(EXTENSION_COMMANDS.tabAttention, { active });
1962
+ }
1963
+ };
1964
+
1965
+ // src/api/dialog.ts
1966
+ init_esm_shims();
1967
+ var DialogAPI = class {
1968
+ constructor(client) {
1969
+ this.client = client;
1970
+ }
1971
+ /** Asks the user; resolves `true` for confirm, `false` for cancel or when the dialog is closed. */
1972
+ async confirm(options) {
1973
+ const answer = await this.client.request(EXTENSION_COMMANDS.dialogConfirm, { ...options }, { timeout: null });
1974
+ return answer === true;
1975
+ }
1976
+ };
1977
+
1867
1978
  // src/client/tableName.ts
1979
+ init_esm_shims();
1868
1980
  function validatePublicKey(publicKey) {
1869
1981
  if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
1870
1982
  throw new HaexVaultSdkError(
@@ -1950,6 +2062,7 @@ function parseTableName(fullTableName) {
1950
2062
  }
1951
2063
 
1952
2064
  // src/client/init.ts
2065
+ init_esm_shims();
1953
2066
  var PORT_HANDSHAKE_TIMEOUT_MS = 1e4;
1954
2067
  function getCurrentWebviewLabel() {
1955
2068
  const internals = window.__TAURI_INTERNALS__;
@@ -2041,8 +2154,8 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
2041
2154
  data: { tables: payload.tables }
2042
2155
  }));
2043
2156
  await forwardEvent(listen, log, onEvent, listenOptions, HAEXTENSION_EVENTS.FILE_CHANGED, (payload) => {
2044
- const { ruleId, changeType, path } = payload;
2045
- return { ruleId, changeType, path };
2157
+ const { ruleId, changeType, path: path2 } = payload;
2158
+ return { ruleId, changeType, path: path2 };
2046
2159
  });
2047
2160
  await forwardEvent(listen, log, onEvent, listenOptions, SHELL_EVENTS.OUTPUT, (payload) => {
2048
2161
  const { sessionId, data } = payload;
@@ -2098,6 +2211,10 @@ function waitForHostPortAsync(log) {
2098
2211
  const handler = (event) => {
2099
2212
  const type = event.data?.type;
2100
2213
  if (type !== HAEXSPACE_MESSAGE_TYPES.PORT_INIT) return;
2214
+ if (event.source !== window.parent) {
2215
+ log("PORT_INIT from a window other than the parent \u2014 ignoring");
2216
+ return;
2217
+ }
2101
2218
  const port = event.ports[0];
2102
2219
  if (!port) {
2103
2220
  log("PORT_INIT received but event.ports is empty \u2014 ignoring");
@@ -2131,10 +2248,11 @@ postMessage error: ${e}`);
2131
2248
  }
2132
2249
 
2133
2250
  // src/client/transport.ts
2251
+ init_esm_shims();
2134
2252
  function generateRequestId(counter) {
2135
2253
  return `req_${counter}`;
2136
2254
  }
2137
- function sendPostMessage(method, params, requestId, config, extensionInfo2, pendingRequests, port) {
2255
+ function sendPostMessage(method, params, requestId, config, extensionInfo2, pendingRequests, port, timeoutMs = config.timeout) {
2138
2256
  if (!port) {
2139
2257
  return Promise.reject(
2140
2258
  new HaexVaultSdkError(
@@ -2149,14 +2267,14 @@ function sendPostMessage(method, params, requestId, config, extensionInfo2, pend
2149
2267
  timestamp: Date.now()
2150
2268
  };
2151
2269
  return new Promise((resolve, reject) => {
2152
- const timeout = setTimeout(() => {
2270
+ const timeout = timeoutMs === null ? void 0 : setTimeout(() => {
2153
2271
  pendingRequests.delete(requestId);
2154
2272
  reject(
2155
2273
  new HaexVaultSdkError("TIMEOUT" /* TIMEOUT */, "errors.timeout", {
2156
- timeout: config.timeout
2274
+ timeout: timeoutMs
2157
2275
  })
2158
2276
  );
2159
- }, config.timeout);
2277
+ }, timeoutMs);
2160
2278
  pendingRequests.set(requestId, { resolve, reject, timeout });
2161
2279
  if (config.debug) {
2162
2280
  console.log("[SDK Debug] ========== Sending Request ==========");
@@ -2182,6 +2300,7 @@ async function sendInvoke(method, params, config, _log) {
2182
2300
  }
2183
2301
 
2184
2302
  // src/client/events.ts
2303
+ init_esm_shims();
2185
2304
  function createMessageHandler(config, pendingRequests, extensionInfo2, onEvent) {
2186
2305
  return (event) => {
2187
2306
  if (config.debug) {
@@ -2281,6 +2400,9 @@ function removeEventListener(eventType, callback, eventListeners) {
2281
2400
  function notifySubscribers(subscribers) {
2282
2401
  subscribers.forEach((callback) => callback());
2283
2402
  }
2403
+
2404
+ // src/client/database.ts
2405
+ init_esm_shims();
2284
2406
  function createDrizzleInstance(schema, extensionInfo2, request, log) {
2285
2407
  if (!extensionInfo2) {
2286
2408
  throw new HaexVaultSdkError(
@@ -2349,6 +2471,7 @@ async function executeRaw(sql, params, request) {
2349
2471
  }
2350
2472
 
2351
2473
  // src/client/external.ts
2474
+ init_esm_shims();
2352
2475
  function registerExternalHandler(action, handler, handlers, log) {
2353
2476
  handlers.set(action, handler);
2354
2477
  log(`[ExternalRequest] Registered handler for action: ${action}`);
@@ -2390,12 +2513,14 @@ async function respondToExternalRequest(response, request) {
2390
2513
  }
2391
2514
 
2392
2515
  // src/commands/ai.ts
2516
+ init_esm_shims();
2393
2517
  var AI_COMMANDS = {
2394
2518
  /** Respond to an AI action request */
2395
2519
  actionRespond: "ai_action_respond"
2396
2520
  };
2397
2521
 
2398
2522
  // src/client/permissionRetry.ts
2523
+ init_esm_shims();
2399
2524
  var PERMISSION_DECISION_TIMEOUT_MS = 5 * 60 * 1e3;
2400
2525
  var MAX_PERMISSION_RETRIES = 3;
2401
2526
  function permissionKey(resourceType, action, target) {
@@ -2509,6 +2634,8 @@ var HaexVaultSdk = class {
2509
2634
  this.passwords = new PasswordsAPI(this);
2510
2635
  this.mail = new MailAPI(this);
2511
2636
  this.notifications = new NotificationsAPI(this);
2637
+ this.tab = new TabAPI(this);
2638
+ this.dialog = new DialogAPI(this);
2512
2639
  installConsoleForwarding(this.config.debug);
2513
2640
  this.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, (event) => {
2514
2641
  const data = event.data;
@@ -2664,7 +2791,7 @@ var HaexVaultSdk = class {
2664
2791
  // ==========================================================================
2665
2792
  // Communication
2666
2793
  // ==========================================================================
2667
- async request(method, params) {
2794
+ async request(method, params, options) {
2668
2795
  const resolvedParams = params ?? {};
2669
2796
  const send = () => {
2670
2797
  if (this.isNativeWindow && hasTauri()) {
@@ -2683,7 +2810,8 @@ var HaexVaultSdk = class {
2683
2810
  this.config,
2684
2811
  this._extensionInfo,
2685
2812
  this.pendingRequests,
2686
- this.hostPort
2813
+ this.hostPort,
2814
+ options?.timeout
2687
2815
  );
2688
2816
  };
2689
2817
  return withPermissionRetry(send, this.permissionWaiters, this.log.bind(this));
@@ -2860,26 +2988,37 @@ var HaexVaultSdk = class {
2860
2988
  }
2861
2989
  };
2862
2990
 
2991
+ // src/types/external.ts
2992
+ init_esm_shims();
2993
+
2994
+ // src/types/spaces.ts
2995
+ init_esm_shims();
2996
+
2863
2997
  // src/index.ts
2864
2998
  init_vaultKey();
2865
2999
  init_userKeypair();
2866
3000
 
2867
3001
  // src/crypto/didKey.ts
3002
+ init_esm_shims();
2868
3003
  init_userKeypair();
2869
3004
  init_vaultKey();
2870
3005
 
2871
3006
  // src/crypto/spaceKey.ts
3007
+ init_esm_shims();
2872
3008
  init_userKeypair();
2873
3009
  init_vaultKey();
2874
3010
 
2875
3011
  // src/crypto/claims.ts
3012
+ init_esm_shims();
2876
3013
  init_userKeypair();
2877
3014
 
2878
3015
  // src/crypto/recordSigning.ts
3016
+ init_esm_shims();
2879
3017
  init_userKeypair();
2880
3018
  init_vaultKey();
2881
3019
 
2882
3020
  // src/crypto/passkey.ts
3021
+ init_esm_shims();
2883
3022
  init_vaultKey();
2884
3023
 
2885
3024
  // src/index.ts