@haex-space/vault-sdk 3.7.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-DH4Km77u.d.ts → client-C6pEREPM.d.ts} +48 -3
  7. package/dist/{client-Dn4AbXbT.d.mts → client-GdCi-m2s.d.mts} +48 -3
  8. package/dist/haex_bundle_bg.wasm +0 -0
  9. package/dist/index.d.mts +11 -59
  10. package/dist/index.d.ts +11 -59
  11. package/dist/index.js +130 -105
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +149 -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 +137 -7
  28. package/dist/react.js.map +1 -1
  29. package/dist/react.mjs +157 -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 +45 -7
  34. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  35. package/dist/runtime/nuxt.plugin.client.mjs +45 -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 +137 -7
  40. package/dist/svelte.js.map +1 -1
  41. package/dist/svelte.mjs +157 -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 +137 -7
  48. package/dist/vue.js.map +1 -1
  49. package/dist/vue.mjs +157 -27
  50. package/dist/vue.mjs.map +1 -1
  51. package/package.json +8 -6
package/dist/svelte.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import 'path';
2
+ import 'url';
1
3
  import { writable, readonly } from 'svelte/store';
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/svelte.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",
@@ -649,6 +708,7 @@ var SPACE_COMMANDS = {
649
708
  list: "extension_space_list"};
650
709
 
651
710
  // src/commands/shell.ts
711
+ init_esm_shims();
652
712
  var SHELL_COMMANDS = {
653
713
  /** List available shell environments (no permission required) */
654
714
  listAvailable: "extension_shell_list_available",
@@ -663,6 +723,7 @@ var SHELL_COMMANDS = {
663
723
  };
664
724
 
665
725
  // src/commands/passwords.ts
726
+ init_esm_shims();
666
727
  var PASSWORD_COMMANDS = {
667
728
  /** List items (no secrets) within the extension's tag scope */
668
729
  list: "extension_password_list",
@@ -677,6 +738,7 @@ var PASSWORD_COMMANDS = {
677
738
  };
678
739
 
679
740
  // src/commands/mail.ts
741
+ init_esm_shims();
680
742
  var MAIL_COMMANDS = {
681
743
  /** LIST mailboxes + optional STATUS counts */
682
744
  listMailboxes: "extension_mail_list_mailboxes",
@@ -703,6 +765,7 @@ var MAIL_COMMANDS = {
703
765
  };
704
766
 
705
767
  // src/commands/notifications.ts
768
+ init_esm_shims();
706
769
  var NOTIFICATION_COMMANDS = {
707
770
  /** Show an OS notification. Returns the assigned notification id. */
708
771
  show: "extension_notifications_show",
@@ -733,6 +796,7 @@ var StorageAPI = class {
733
796
  };
734
797
 
735
798
  // src/api/database.ts
799
+ init_esm_shims();
736
800
  function quoteIdent(identifier) {
737
801
  if (identifier.startsWith('"') && identifier.endsWith('"')) {
738
802
  return identifier;
@@ -832,6 +896,7 @@ var DatabaseAPI = class {
832
896
  };
833
897
 
834
898
  // src/api/filesystem.ts
899
+ init_esm_shims();
835
900
  init_vaultKey();
836
901
  var FilesystemAPI = class {
837
902
  constructor(client) {
@@ -898,10 +963,10 @@ var FilesystemAPI = class {
898
963
  * @param path Absolute path to the file
899
964
  * @returns File contents as Uint8Array
900
965
  */
901
- async readFile(path) {
966
+ async readFile(path2) {
902
967
  const base64 = await this.client.request(
903
968
  FILESYSTEM_COMMANDS.readFile,
904
- { path }
969
+ { path: path2 }
905
970
  );
906
971
  return base64ToArrayBuffer(base64);
907
972
  }
@@ -910,11 +975,11 @@ var FilesystemAPI = class {
910
975
  * @param path Absolute path to the file
911
976
  * @param data File contents as Uint8Array
912
977
  */
913
- async writeFile(path, data) {
978
+ async writeFile(path2, data) {
914
979
  const base64 = arrayBufferToBase64(data);
915
980
  await this.client.request(
916
981
  FILESYSTEM_COMMANDS.writeFile,
917
- { path, data: base64 }
982
+ { path: path2, data: base64 }
918
983
  );
919
984
  }
920
985
  /**
@@ -922,20 +987,20 @@ var FilesystemAPI = class {
922
987
  * @param path Absolute path to the directory
923
988
  * @returns Array of directory entries
924
989
  */
925
- async readDir(path) {
990
+ async readDir(path2) {
926
991
  return this.client.request(
927
992
  FILESYSTEM_COMMANDS.readDir,
928
- { path }
993
+ { path: path2 }
929
994
  );
930
995
  }
931
996
  /**
932
997
  * Create a directory (and parent directories if needed)
933
998
  * @param path Absolute path to create
934
999
  */
935
- async mkdir(path) {
1000
+ async mkdir(path2) {
936
1001
  await this.client.request(
937
1002
  FILESYSTEM_COMMANDS.mkdir,
938
- { path }
1003
+ { path: path2 }
939
1004
  );
940
1005
  }
941
1006
  /**
@@ -943,10 +1008,10 @@ var FilesystemAPI = class {
943
1008
  * @param path Absolute path to remove
944
1009
  * @param recursive If true, remove directories recursively
945
1010
  */
946
- async remove(path, recursive = false) {
1011
+ async remove(path2, recursive = false) {
947
1012
  await this.client.request(
948
1013
  FILESYSTEM_COMMANDS.remove,
949
- { path, recursive }
1014
+ { path: path2, recursive }
950
1015
  );
951
1016
  }
952
1017
  /**
@@ -954,10 +1019,10 @@ var FilesystemAPI = class {
954
1019
  * @param path Absolute path to check
955
1020
  * @returns True if the path exists
956
1021
  */
957
- async exists(path) {
1022
+ async exists(path2) {
958
1023
  return this.client.request(
959
1024
  FILESYSTEM_COMMANDS.exists,
960
- { path }
1025
+ { path: path2 }
961
1026
  );
962
1027
  }
963
1028
  /**
@@ -965,10 +1030,10 @@ var FilesystemAPI = class {
965
1030
  * @param path Absolute path
966
1031
  * @returns File metadata
967
1032
  */
968
- async stat(path) {
1033
+ async stat(path2) {
969
1034
  return this.client.request(
970
1035
  FILESYSTEM_COMMANDS.stat,
971
- { path }
1036
+ { path: path2 }
972
1037
  );
973
1038
  }
974
1039
  /**
@@ -1037,10 +1102,10 @@ var FilesystemAPI = class {
1037
1102
  * @param ruleId Unique identifier for this watch (e.g., sync rule ID)
1038
1103
  * @param path Absolute path to the directory to watch
1039
1104
  */
1040
- async watch(ruleId, path) {
1105
+ async watch(ruleId, path2) {
1041
1106
  await this.client.request(
1042
1107
  FILESYSTEM_COMMANDS.watch,
1043
- { ruleId, path }
1108
+ { ruleId, path: path2 }
1044
1109
  );
1045
1110
  }
1046
1111
  /**
@@ -1067,6 +1132,7 @@ var FilesystemAPI = class {
1067
1132
  };
1068
1133
 
1069
1134
  // src/api/web.ts
1135
+ init_esm_shims();
1070
1136
  var WebAPI = class {
1071
1137
  constructor(client) {
1072
1138
  this.client = client;
@@ -1180,6 +1246,7 @@ var WebAPI = class {
1180
1246
  };
1181
1247
 
1182
1248
  // src/api/permissions.ts
1249
+ init_esm_shims();
1183
1250
  var PermissionsAPI = class {
1184
1251
  constructor(client) {
1185
1252
  this.client = client;
@@ -1221,11 +1288,11 @@ var PermissionsAPI = class {
1221
1288
  * @param operation The operation type ("read" or "write")
1222
1289
  * @returns Promise<boolean> indicating if permission is granted
1223
1290
  */
1224
- async checkFilesystemAsync(path, operation) {
1291
+ async checkFilesystemAsync(path2, operation) {
1225
1292
  const response = await this.client.request(
1226
1293
  PERMISSIONS_COMMANDS.checkFilesystem,
1227
1294
  {
1228
- path,
1295
+ path: path2,
1229
1296
  operation
1230
1297
  }
1231
1298
  );
@@ -1234,6 +1301,7 @@ var PermissionsAPI = class {
1234
1301
  };
1235
1302
 
1236
1303
  // src/api/remoteStorage.ts
1304
+ init_esm_shims();
1237
1305
  init_vaultKey();
1238
1306
  var RemoteStorageAPI = class {
1239
1307
  constructor(client) {
@@ -1344,6 +1412,7 @@ var BackendManagement = class {
1344
1412
  };
1345
1413
 
1346
1414
  // src/api/localsend.ts
1415
+ init_esm_shims();
1347
1416
  var LOCALSEND_EVENTS = {
1348
1417
  /** New device discovered */
1349
1418
  deviceDiscovered: "localsend:device-discovered",
@@ -1515,6 +1584,7 @@ var LocalSendAPI = class {
1515
1584
  };
1516
1585
 
1517
1586
  // src/api/spaces.ts
1587
+ init_esm_shims();
1518
1588
  var SpacesAPI = class {
1519
1589
  constructor(client) {
1520
1590
  this.client = client;
@@ -1587,6 +1657,7 @@ var SpacesAPI = class {
1587
1657
  };
1588
1658
 
1589
1659
  // src/api/shell.ts
1660
+ init_esm_shims();
1590
1661
  var ShellAPI = class {
1591
1662
  constructor(sdk) {
1592
1663
  this.sdk = sdk;
@@ -1658,6 +1729,7 @@ var ShellAPI = class {
1658
1729
  };
1659
1730
 
1660
1731
  // src/api/passwords.ts
1732
+ init_esm_shims();
1661
1733
  var PasswordsAPI = class {
1662
1734
  constructor(client) {
1663
1735
  this.client = client;
@@ -1703,6 +1775,7 @@ var PasswordsAPI = class {
1703
1775
  };
1704
1776
 
1705
1777
  // src/api/mail.ts
1778
+ init_esm_shims();
1706
1779
  var MailAPI = class {
1707
1780
  constructor(client) {
1708
1781
  this.client = client;
@@ -1842,6 +1915,7 @@ var MailAPI = class {
1842
1915
  };
1843
1916
 
1844
1917
  // src/api/notifications.ts
1918
+ init_esm_shims();
1845
1919
  var NotificationsAPI = class {
1846
1920
  constructor(client) {
1847
1921
  this.client = client;
@@ -1873,7 +1947,36 @@ var NotificationsAPI = class {
1873
1947
  }
1874
1948
  };
1875
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
+
1876
1978
  // src/client/tableName.ts
1979
+ init_esm_shims();
1877
1980
  function validatePublicKey(publicKey) {
1878
1981
  if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
1879
1982
  throw new HaexVaultSdkError(
@@ -1959,6 +2062,7 @@ function parseTableName(fullTableName) {
1959
2062
  }
1960
2063
 
1961
2064
  // src/client/init.ts
2065
+ init_esm_shims();
1962
2066
  var PORT_HANDSHAKE_TIMEOUT_MS = 1e4;
1963
2067
  function getCurrentWebviewLabel() {
1964
2068
  const internals = window.__TAURI_INTERNALS__;
@@ -2050,8 +2154,8 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
2050
2154
  data: { tables: payload.tables }
2051
2155
  }));
2052
2156
  await forwardEvent(listen, log, onEvent, listenOptions, HAEXTENSION_EVENTS.FILE_CHANGED, (payload) => {
2053
- const { ruleId, changeType, path } = payload;
2054
- return { ruleId, changeType, path };
2157
+ const { ruleId, changeType, path: path2 } = payload;
2158
+ return { ruleId, changeType, path: path2 };
2055
2159
  });
2056
2160
  await forwardEvent(listen, log, onEvent, listenOptions, SHELL_EVENTS.OUTPUT, (payload) => {
2057
2161
  const { sessionId, data } = payload;
@@ -2107,6 +2211,10 @@ function waitForHostPortAsync(log) {
2107
2211
  const handler = (event) => {
2108
2212
  const type = event.data?.type;
2109
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
+ }
2110
2218
  const port = event.ports[0];
2111
2219
  if (!port) {
2112
2220
  log("PORT_INIT received but event.ports is empty \u2014 ignoring");
@@ -2140,10 +2248,11 @@ postMessage error: ${e}`);
2140
2248
  }
2141
2249
 
2142
2250
  // src/client/transport.ts
2251
+ init_esm_shims();
2143
2252
  function generateRequestId(counter) {
2144
2253
  return `req_${counter}`;
2145
2254
  }
2146
- function sendPostMessage(method, params, requestId, config, extensionInfo2, pendingRequests, port) {
2255
+ function sendPostMessage(method, params, requestId, config, extensionInfo2, pendingRequests, port, timeoutMs = config.timeout) {
2147
2256
  if (!port) {
2148
2257
  return Promise.reject(
2149
2258
  new HaexVaultSdkError(
@@ -2158,14 +2267,14 @@ function sendPostMessage(method, params, requestId, config, extensionInfo2, pend
2158
2267
  timestamp: Date.now()
2159
2268
  };
2160
2269
  return new Promise((resolve, reject) => {
2161
- const timeout = setTimeout(() => {
2270
+ const timeout = timeoutMs === null ? void 0 : setTimeout(() => {
2162
2271
  pendingRequests.delete(requestId);
2163
2272
  reject(
2164
2273
  new HaexVaultSdkError("TIMEOUT" /* TIMEOUT */, "errors.timeout", {
2165
- timeout: config.timeout
2274
+ timeout: timeoutMs
2166
2275
  })
2167
2276
  );
2168
- }, config.timeout);
2277
+ }, timeoutMs);
2169
2278
  pendingRequests.set(requestId, { resolve, reject, timeout });
2170
2279
  if (config.debug) {
2171
2280
  console.log("[SDK Debug] ========== Sending Request ==========");
@@ -2191,6 +2300,7 @@ async function sendInvoke(method, params, config, _log) {
2191
2300
  }
2192
2301
 
2193
2302
  // src/client/events.ts
2303
+ init_esm_shims();
2194
2304
  function createMessageHandler(config, pendingRequests, extensionInfo2, onEvent) {
2195
2305
  return (event) => {
2196
2306
  if (config.debug) {
@@ -2290,6 +2400,9 @@ function removeEventListener(eventType, callback, eventListeners) {
2290
2400
  function notifySubscribers(subscribers) {
2291
2401
  subscribers.forEach((callback) => callback());
2292
2402
  }
2403
+
2404
+ // src/client/database.ts
2405
+ init_esm_shims();
2293
2406
  function createDrizzleInstance(schema, extensionInfo2, request, log) {
2294
2407
  if (!extensionInfo2) {
2295
2408
  throw new HaexVaultSdkError(
@@ -2358,6 +2471,7 @@ async function executeRaw(sql, params, request) {
2358
2471
  }
2359
2472
 
2360
2473
  // src/client/external.ts
2474
+ init_esm_shims();
2361
2475
  function registerExternalHandler(action, handler, handlers, log) {
2362
2476
  handlers.set(action, handler);
2363
2477
  log(`[ExternalRequest] Registered handler for action: ${action}`);
@@ -2399,12 +2513,14 @@ async function respondToExternalRequest(response, request) {
2399
2513
  }
2400
2514
 
2401
2515
  // src/commands/ai.ts
2516
+ init_esm_shims();
2402
2517
  var AI_COMMANDS = {
2403
2518
  /** Respond to an AI action request */
2404
2519
  actionRespond: "ai_action_respond"
2405
2520
  };
2406
2521
 
2407
2522
  // src/client/permissionRetry.ts
2523
+ init_esm_shims();
2408
2524
  var PERMISSION_DECISION_TIMEOUT_MS = 5 * 60 * 1e3;
2409
2525
  var MAX_PERMISSION_RETRIES = 3;
2410
2526
  function permissionKey(resourceType, action, target) {
@@ -2518,6 +2634,8 @@ var HaexVaultSdk = class {
2518
2634
  this.passwords = new PasswordsAPI(this);
2519
2635
  this.mail = new MailAPI(this);
2520
2636
  this.notifications = new NotificationsAPI(this);
2637
+ this.tab = new TabAPI(this);
2638
+ this.dialog = new DialogAPI(this);
2521
2639
  installConsoleForwarding(this.config.debug);
2522
2640
  this.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, (event) => {
2523
2641
  const data = event.data;
@@ -2673,7 +2791,7 @@ var HaexVaultSdk = class {
2673
2791
  // ==========================================================================
2674
2792
  // Communication
2675
2793
  // ==========================================================================
2676
- async request(method, params) {
2794
+ async request(method, params, options) {
2677
2795
  const resolvedParams = params ?? {};
2678
2796
  const send = () => {
2679
2797
  if (this.isNativeWindow && hasTauri()) {
@@ -2692,7 +2810,8 @@ var HaexVaultSdk = class {
2692
2810
  this.config,
2693
2811
  this._extensionInfo,
2694
2812
  this.pendingRequests,
2695
- this.hostPort
2813
+ this.hostPort,
2814
+ options?.timeout
2696
2815
  );
2697
2816
  };
2698
2817
  return withPermissionRetry(send, this.permissionWaiters, this.log.bind(this));
@@ -2869,26 +2988,37 @@ var HaexVaultSdk = class {
2869
2988
  }
2870
2989
  };
2871
2990
 
2991
+ // src/types/external.ts
2992
+ init_esm_shims();
2993
+
2994
+ // src/types/spaces.ts
2995
+ init_esm_shims();
2996
+
2872
2997
  // src/index.ts
2873
2998
  init_vaultKey();
2874
2999
  init_userKeypair();
2875
3000
 
2876
3001
  // src/crypto/didKey.ts
3002
+ init_esm_shims();
2877
3003
  init_userKeypair();
2878
3004
  init_vaultKey();
2879
3005
 
2880
3006
  // src/crypto/spaceKey.ts
3007
+ init_esm_shims();
2881
3008
  init_userKeypair();
2882
3009
  init_vaultKey();
2883
3010
 
2884
3011
  // src/crypto/claims.ts
3012
+ init_esm_shims();
2885
3013
  init_userKeypair();
2886
3014
 
2887
3015
  // src/crypto/recordSigning.ts
3016
+ init_esm_shims();
2888
3017
  init_userKeypair();
2889
3018
  init_vaultKey();
2890
3019
 
2891
3020
  // src/crypto/passkey.ts
3021
+ init_esm_shims();
2892
3022
  init_vaultKey();
2893
3023
 
2894
3024
  // src/index.ts