@haex-space/vault-sdk 4.4.0 → 4.6.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 +40 -0
  2. package/dist/cli/index.mjs.map +1 -1
  3. package/dist/{client-C44dqakd.d.ts → client-CcNhK76M.d.mts} +234 -2
  4. package/dist/{client-BCUfRZvU.d.mts → client-DIvNHfx-.d.ts} +234 -2
  5. package/dist/{config-D_HXjsEV.d.mts → config-P_6DqTHl.d.mts} +2 -1
  6. package/dist/{config-D_HXjsEV.d.ts → config-P_6DqTHl.d.ts} +2 -1
  7. package/dist/haex_bundle_bg.wasm +0 -0
  8. package/dist/index.d.mts +59 -7
  9. package/dist/index.d.ts +59 -7
  10. package/dist/index.js +153 -5
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +148 -5
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/node.d.mts +4 -3
  15. package/dist/node.d.ts +4 -3
  16. package/dist/node.mjs +1 -1
  17. package/dist/node.mjs.map +1 -1
  18. package/dist/nuxt.d.mts +2 -1
  19. package/dist/nuxt.d.ts +2 -1
  20. package/dist/nuxt.js +1 -1
  21. package/dist/nuxt.js.map +1 -1
  22. package/dist/nuxt.mjs.map +1 -1
  23. package/dist/react.d.mts +3 -2
  24. package/dist/react.d.ts +3 -2
  25. package/dist/react.js +146 -5
  26. package/dist/react.js.map +1 -1
  27. package/dist/react.mjs +145 -4
  28. package/dist/react.mjs.map +1 -1
  29. package/dist/runtime/nuxt.plugin.client.d.mts +4 -3
  30. package/dist/runtime/nuxt.plugin.client.d.ts +4 -3
  31. package/dist/runtime/nuxt.plugin.client.js +132 -1
  32. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  33. package/dist/runtime/nuxt.plugin.client.mjs +132 -1
  34. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  35. package/dist/svelte.d.mts +3 -2
  36. package/dist/svelte.d.ts +3 -2
  37. package/dist/svelte.js +146 -5
  38. package/dist/svelte.js.map +1 -1
  39. package/dist/svelte.mjs +145 -4
  40. package/dist/svelte.mjs.map +1 -1
  41. package/dist/{types-DoNvKiW_.d.mts → types-snPkjDCj.d.mts} +15 -1
  42. package/dist/{types-DoNvKiW_.d.ts → types-snPkjDCj.d.ts} +15 -1
  43. package/dist/vite.d.mts +2 -1
  44. package/dist/vite.d.ts +2 -1
  45. package/dist/vue.d.mts +3 -2
  46. package/dist/vue.d.ts +3 -2
  47. package/dist/vue.js +146 -5
  48. package/dist/vue.js.map +1 -1
  49. package/dist/vue.mjs +145 -4
  50. package/dist/vue.mjs.map +1 -1
  51. package/package.json +3 -3
@@ -35,6 +35,14 @@ declare const NOTIFICATION_EVENTS: {
35
35
  readonly CLICK: "haextension:notification:click";
36
36
  };
37
37
  type NotificationEvent = typeof NOTIFICATION_EVENTS[keyof typeof NOTIFICATION_EVENTS];
38
+ /**
39
+ * Events of model jobs (`models.runAsync`, holzi spec 055).
40
+ */
41
+ declare const MODEL_JOB_EVENTS: {
42
+ /** A job of this frame ended: completed, failed or cancelled. */
43
+ readonly COMPLETED: "haextension:model-job:completed";
44
+ };
45
+ type ModelJobEvent = typeof MODEL_JOB_EVENTS[keyof typeof MODEL_JOB_EVENTS];
38
46
  /**
39
47
  * Events for external client communication (browser extensions, CLI tools, servers, etc.)
40
48
  */
@@ -397,6 +405,11 @@ interface ExtensionManifest {
397
405
  filesystem?: any[];
398
406
  http?: any[];
399
407
  shell?: any[];
408
+ /** Reading the host's address book: `{ target: "*" | "<group name>", action?: "read" }`. */
409
+ contacts?: {
410
+ target: string;
411
+ action?: "read";
412
+ }[];
400
413
  };
401
414
  homepage?: string | null;
402
415
  description?: string | null;
@@ -497,4 +510,5 @@ declare class HaexVaultSdkError extends Error {
497
510
  };
498
511
  }
499
512
 
500
- export { type SearchRequestEvent as $, type ApplicationContext as A, HostErrorCode as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionInfo as E, type FileChangeEvent as F, MAIL_EVENTS as G, type HaexHubConfig as H, type IdentityClaim as I, type MailEvent as J, type ManifestI18nEntry as K, type ManifestTool as L, type Migration as M, type ManifestToolEffect as N, NOTIFICATION_EVENTS as O, type PermissionResponse as P, type NotificationEvent as Q, type RequestOptions as R, type SearchResult as S, type PermissionDeniedError as T, type PermissionErrorBase as U, PermissionErrorCode as V, type WebRequestOptions as W, type PermissionPromptError as X, PermissionStatus as Y, SHELL_EVENTS as Z, type SearchQuery as _, type ExtensionManifest as a, type ShellEvent as a0, type SyncTablesUpdatedEvent as a1, TABLE_SEPARATOR as a2, getTableName as a3, isPermissionDeniedError as a4, isPermissionError as a5, isPermissionPromptError as a6, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type EventCallback as f, type DatabasePermissionRequest as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
513
+ export { SHELL_EVENTS as $, HostErrorCode as B, MAIL_EVENTS as G, MODEL_JOB_EVENTS as J, NOTIFICATION_EVENTS as T, PermissionErrorCode as Y, PermissionStatus as _, TABLE_SEPARATOR as a4, getTableName as a5, isPermissionDeniedError as a6, isPermissionError as a7, isPermissionPromptError as a8, EXTERNAL_EVENTS as c, DEFAULT_TIMEOUT as j, ErrorCode as p, HAEXTENSION_EVENTS as v, HaexVaultSdkError as y };
514
+ export type { ApplicationContext as A, ClaimRequirement as C, DatabaseQueryResult as D, ExtensionInfo as E, FileChangeEvent as F, HaexHubConfig as H, IdentityClaim as I, MailEvent as K, ManifestI18nEntry as L, Migration as M, ManifestTool as N, ManifestToolEffect as O, PermissionResponse as P, ModelJobEvent as Q, RequestOptions as R, SearchResult as S, NotificationEvent as U, PermissionDeniedError as V, WebRequestOptions as W, PermissionErrorBase as X, PermissionPromptError as Z, ExtensionManifest as a, SearchQuery as a0, SearchRequestEvent as a1, ShellEvent as a2, SyncTablesUpdatedEvent as a3, HaexHubEvent as b, MigrationResult as d, WebResponse as e, EventCallback as f, DatabasePermissionRequest as g, SignedClaimPresentation as h, ContextChangedEvent as i, DatabaseColumnInfo as k, DatabaseExecuteParams as l, DatabasePermission as m, DatabaseQueryParams as n, DatabaseTableInfo as o, ExtensionRuntimeMode as q, ExternalEvent as r, FileChangePayload as s, FileChangeType as t, FilteredSyncTablesResult as u, HaexHubRequest as w, HaexHubResponse as x, HaextensionEvent as z };
@@ -35,6 +35,14 @@ declare const NOTIFICATION_EVENTS: {
35
35
  readonly CLICK: "haextension:notification:click";
36
36
  };
37
37
  type NotificationEvent = typeof NOTIFICATION_EVENTS[keyof typeof NOTIFICATION_EVENTS];
38
+ /**
39
+ * Events of model jobs (`models.runAsync`, holzi spec 055).
40
+ */
41
+ declare const MODEL_JOB_EVENTS: {
42
+ /** A job of this frame ended: completed, failed or cancelled. */
43
+ readonly COMPLETED: "haextension:model-job:completed";
44
+ };
45
+ type ModelJobEvent = typeof MODEL_JOB_EVENTS[keyof typeof MODEL_JOB_EVENTS];
38
46
  /**
39
47
  * Events for external client communication (browser extensions, CLI tools, servers, etc.)
40
48
  */
@@ -397,6 +405,11 @@ interface ExtensionManifest {
397
405
  filesystem?: any[];
398
406
  http?: any[];
399
407
  shell?: any[];
408
+ /** Reading the host's address book: `{ target: "*" | "<group name>", action?: "read" }`. */
409
+ contacts?: {
410
+ target: string;
411
+ action?: "read";
412
+ }[];
400
413
  };
401
414
  homepage?: string | null;
402
415
  description?: string | null;
@@ -497,4 +510,5 @@ declare class HaexVaultSdkError extends Error {
497
510
  };
498
511
  }
499
512
 
500
- export { type SearchRequestEvent as $, type ApplicationContext as A, HostErrorCode as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionInfo as E, type FileChangeEvent as F, MAIL_EVENTS as G, type HaexHubConfig as H, type IdentityClaim as I, type MailEvent as J, type ManifestI18nEntry as K, type ManifestTool as L, type Migration as M, type ManifestToolEffect as N, NOTIFICATION_EVENTS as O, type PermissionResponse as P, type NotificationEvent as Q, type RequestOptions as R, type SearchResult as S, type PermissionDeniedError as T, type PermissionErrorBase as U, PermissionErrorCode as V, type WebRequestOptions as W, type PermissionPromptError as X, PermissionStatus as Y, SHELL_EVENTS as Z, type SearchQuery as _, type ExtensionManifest as a, type ShellEvent as a0, type SyncTablesUpdatedEvent as a1, TABLE_SEPARATOR as a2, getTableName as a3, isPermissionDeniedError as a4, isPermissionError as a5, isPermissionPromptError as a6, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type EventCallback as f, type DatabasePermissionRequest as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
513
+ export { SHELL_EVENTS as $, HostErrorCode as B, MAIL_EVENTS as G, MODEL_JOB_EVENTS as J, NOTIFICATION_EVENTS as T, PermissionErrorCode as Y, PermissionStatus as _, TABLE_SEPARATOR as a4, getTableName as a5, isPermissionDeniedError as a6, isPermissionError as a7, isPermissionPromptError as a8, EXTERNAL_EVENTS as c, DEFAULT_TIMEOUT as j, ErrorCode as p, HAEXTENSION_EVENTS as v, HaexVaultSdkError as y };
514
+ export type { ApplicationContext as A, ClaimRequirement as C, DatabaseQueryResult as D, ExtensionInfo as E, FileChangeEvent as F, HaexHubConfig as H, IdentityClaim as I, MailEvent as K, ManifestI18nEntry as L, Migration as M, ManifestTool as N, ManifestToolEffect as O, PermissionResponse as P, ModelJobEvent as Q, RequestOptions as R, SearchResult as S, NotificationEvent as U, PermissionDeniedError as V, WebRequestOptions as W, PermissionErrorBase as X, PermissionPromptError as Z, ExtensionManifest as a, SearchQuery as a0, SearchRequestEvent as a1, ShellEvent as a2, SyncTablesUpdatedEvent as a3, HaexHubEvent as b, MigrationResult as d, WebResponse as e, EventCallback as f, DatabasePermissionRequest as g, SignedClaimPresentation as h, ContextChangedEvent as i, DatabaseColumnInfo as k, DatabaseExecuteParams as l, DatabasePermission as m, DatabaseQueryParams as n, DatabaseTableInfo as o, ExtensionRuntimeMode as q, ExternalEvent as r, FileChangePayload as s, FileChangeType as t, FilteredSyncTablesResult as u, HaexHubRequest as w, HaexHubResponse as x, HaextensionEvent as z };
package/dist/vite.d.mts CHANGED
@@ -34,4 +34,5 @@ interface VitePluginOptions {
34
34
  */
35
35
  declare function haexspacePlugin(options?: VitePluginOptions): Plugin;
36
36
 
37
- export { type VitePluginOptions, haexspacePlugin as default, haexspacePlugin };
37
+ export { haexspacePlugin as default, haexspacePlugin };
38
+ export type { VitePluginOptions };
package/dist/vite.d.ts CHANGED
@@ -34,4 +34,5 @@ interface VitePluginOptions {
34
34
  */
35
35
  declare function haexspacePlugin(options?: VitePluginOptions): Plugin;
36
36
 
37
- export { type VitePluginOptions, haexspacePlugin as default, haexspacePlugin };
37
+ export { haexspacePlugin as default, haexspacePlugin };
38
+ export type { VitePluginOptions };
package/dist/vue.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client-BCUfRZvU.mjs';
1
+ import { S as StorageAPI } from './client-CcNhK76M.mjs';
2
+ import { HaexVaultSdk } from './index.mjs';
2
3
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
4
  import { Ref } from 'vue';
4
- import { H as HaexHubConfig } from './types-DoNvKiW_.mjs';
5
+ import { HaexHubConfig } from './index.mjs';
5
6
 
6
7
  /**
7
8
  * Vue 3 composable for HaexVault SDK
package/dist/vue.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client-C44dqakd.js';
1
+ import { S as StorageAPI } from './client-DIvNHfx-.js';
2
+ import { HaexVaultSdk } from './index.js';
2
3
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
4
  import { Ref } from 'vue';
4
- import { H as HaexHubConfig } from './types-DoNvKiW_.js';
5
+ import { HaexHubConfig } from './index.js';
5
6
 
6
7
  /**
7
8
  * Vue 3 composable for HaexVault SDK
package/dist/vue.js CHANGED
@@ -4,13 +4,18 @@ var vue = require('vue');
4
4
  var sqliteProxy = require('drizzle-orm/sqlite-proxy');
5
5
 
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __esm = (fn, res) => function __init() {
8
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ var __esm = (fn, res, err) => function __init() {
8
+ if (err) throw err[0];
9
+ try {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ } catch (e) {
12
+ throw err = [e], e;
13
+ }
9
14
  };
10
15
 
11
- // 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
+ // node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.31_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
12
17
  var init_cjs_shims = __esm({
13
- "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
+ "node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.31_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
14
19
  }
15
20
  });
16
21
 
@@ -450,6 +455,10 @@ var NOTIFICATION_EVENTS = {
450
455
  /** A click on one of this extension's notifications (body or action button). */
451
456
  CLICK: "haextension:notification:click"
452
457
  };
458
+ var MODEL_JOB_EVENTS = {
459
+ /** A job of this frame ended: completed, failed or cancelled. */
460
+ COMPLETED: "haextension:model-job:completed"
461
+ };
453
462
  var EXTERNAL_EVENTS = {
454
463
  /** External request from authorized client */
455
464
  REQUEST: "haextension:external:request",
@@ -763,6 +772,30 @@ var PASSWORD_COMMANDS = {
763
772
  delete: "extension_password_delete"
764
773
  };
765
774
 
775
+ // src/commands/contacts.ts
776
+ init_cjs_shims();
777
+ var CONTACT_COMMANDS = {
778
+ /** Contacts in scope, a page at a time, optionally of one group */
779
+ list: "extension_contacts_list",
780
+ /** One contact with all its values, by id */
781
+ read: "extension_contacts_read",
782
+ /** Contacts in scope whose name, organization, phone or e-mail matches */
783
+ search: "extension_contacts_search",
784
+ /** The JPEG of a contact's photo, by its hash */
785
+ photo: "extension_contacts_photo"
786
+ };
787
+
788
+ // src/commands/models.ts
789
+ init_cjs_shims();
790
+ var MODEL_COMMANDS = {
791
+ /** The models the user allowed to this extension, without addresses or keys */
792
+ list: "extension_model_list",
793
+ /** Starts a job; the result follows as an event */
794
+ start: "extension_model_job_start",
795
+ /** Cancels a running job of this frame */
796
+ cancel: "extension_model_job_cancel"
797
+ };
798
+
766
799
  // src/commands/mail.ts
767
800
  init_cjs_shims();
768
801
  var MAIL_COMMANDS = {
@@ -1924,6 +1957,107 @@ var PasswordsAPI = class {
1924
1957
  }
1925
1958
  };
1926
1959
 
1960
+ // src/api/contacts.ts
1961
+ init_cjs_shims();
1962
+ init_vaultKey();
1963
+ var ContactsAPI = class {
1964
+ constructor(client) {
1965
+ this.client = client;
1966
+ }
1967
+ /** One page of the contacts in scope, optionally of one group. */
1968
+ async listAsync(options = {}) {
1969
+ return this.client.request(CONTACT_COMMANDS.list, {
1970
+ ...options
1971
+ });
1972
+ }
1973
+ /** One contact with all its values. */
1974
+ async readAsync(id) {
1975
+ return this.client.request(CONTACT_COMMANDS.read, { id });
1976
+ }
1977
+ /**
1978
+ * The contacts in scope whose name, organization, phone number or e-mail
1979
+ * address contains `query`, regardless of case and accents. The host's
1980
+ * default limit is 20, its maximum 200.
1981
+ */
1982
+ async searchAsync(query, limit) {
1983
+ const answer = await this.client.request(
1984
+ CONTACT_COMMANDS.search,
1985
+ limit === void 0 ? { query } : { query, limit }
1986
+ );
1987
+ return answer.contacts;
1988
+ }
1989
+ /** The JPEG of a photo a readable contact uses, by its hash. */
1990
+ async photoAsync(hash) {
1991
+ const base64 = await this.client.request(CONTACT_COMMANDS.photo, {
1992
+ hash
1993
+ });
1994
+ return base64ToArrayBuffer(base64);
1995
+ }
1996
+ };
1997
+
1998
+ // src/api/models.ts
1999
+ init_cjs_shims();
2000
+ var ModelsAPI = class {
2001
+ constructor(client) {
2002
+ this.client = client;
2003
+ }
2004
+ /** The models the user allowed to this extension; empty without any. */
2005
+ async listAsync() {
2006
+ const answer = await this.client.request(
2007
+ MODEL_COMMANDS.list,
2008
+ {}
2009
+ );
2010
+ return answer.models;
2011
+ }
2012
+ /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
2013
+ async startAsync(job) {
2014
+ const answer = await this.client.request(MODEL_COMMANDS.start, {
2015
+ job
2016
+ });
2017
+ return { jobId: answer.jobId };
2018
+ }
2019
+ /** Cancels a running job of this frame; `false` when it is unknown or already ended. */
2020
+ async cancelAsync(jobId) {
2021
+ const answer = await this.client.request(MODEL_COMMANDS.cancel, {
2022
+ jobId
2023
+ });
2024
+ return answer.cancelled;
2025
+ }
2026
+ /** Listens for the end of this frame's jobs. Returns an unsubscribe function. */
2027
+ onCompleted(handler) {
2028
+ const wrapped = (event) => {
2029
+ const data = event.data;
2030
+ if (data) handler(data);
2031
+ };
2032
+ this.client.on(MODEL_JOB_EVENTS.COMPLETED, wrapped);
2033
+ return () => this.client.off(MODEL_JOB_EVENTS.COMPLETED, wrapped);
2034
+ }
2035
+ /**
2036
+ * Starts a job and resolves with its end: `completed` with the result, or `failed` or
2037
+ * `cancelled` with the error. Errors of the start itself (an invalid job, a refused model or
2038
+ * consent, no fitting model) reject. The end can arrive before the start answers; it is kept
2039
+ * until then.
2040
+ */
2041
+ async runAsync(job) {
2042
+ const ended = /* @__PURE__ */ new Map();
2043
+ let waiting = null;
2044
+ const unsubscribe = this.onCompleted((completion) => {
2045
+ if (waiting && completion.jobId === waiting.jobId) waiting.resolve(completion);
2046
+ else ended.set(completion.jobId, completion);
2047
+ });
2048
+ try {
2049
+ const { jobId } = await this.startAsync(job);
2050
+ return await new Promise((resolve) => {
2051
+ const early = ended.get(jobId);
2052
+ if (early) resolve(early);
2053
+ else waiting = { jobId, resolve };
2054
+ });
2055
+ } finally {
2056
+ unsubscribe();
2057
+ }
2058
+ }
2059
+ };
2060
+
1927
2061
  // src/api/mail.ts
1928
2062
  init_cjs_shims();
1929
2063
  var MailAPI = class {
@@ -2880,6 +3014,7 @@ var AI_COMMANDS = {
2880
3014
  init_cjs_shims();
2881
3015
  var PERMISSION_DECISION_TIMEOUT_MS = 5 * 60 * 1e3;
2882
3016
  var MAX_PERMISSION_RETRIES = 3;
3017
+ var MAX_PERMISSION_PROMPTS = 8;
2883
3018
  function permissionKey(resourceType, action, target) {
2884
3019
  return `${resourceType}:${action}:${target}`;
2885
3020
  }
@@ -2915,14 +3050,18 @@ function toDeniedError(error) {
2915
3050
  return { ...error, code: 1002 /* DENIED */ };
2916
3051
  }
2917
3052
  async function withPermissionRetry(send, registry, log, timeoutMs = PERMISSION_DECISION_TIMEOUT_MS) {
3053
+ const asked = /* @__PURE__ */ new Map();
2918
3054
  for (let attempt = 0; ; attempt++) {
2919
3055
  try {
2920
3056
  return await send();
2921
3057
  } catch (error) {
2922
- if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_RETRIES) {
3058
+ if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_PROMPTS) {
2923
3059
  throw error;
2924
3060
  }
2925
3061
  const key = permissionKey(error.resourceType, error.action, error.target);
3062
+ const times = asked.get(key) ?? 0;
3063
+ if (times >= MAX_PERMISSION_RETRIES) throw error;
3064
+ asked.set(key, times + 1);
2926
3065
  log(`Permission prompt required for ${key} \u2014 waiting for user decision`);
2927
3066
  const outcome = await registry.wait(key, timeoutMs);
2928
3067
  if (outcome === "granted") {
@@ -2990,6 +3129,8 @@ var HaexVaultSdk = class {
2990
3129
  this.spaces = new SpacesAPI(this);
2991
3130
  this.shell = new ShellAPI(this);
2992
3131
  this.passwords = new PasswordsAPI(this);
3132
+ this.contacts = new ContactsAPI(this);
3133
+ this.models = new ModelsAPI(this);
2993
3134
  this.mail = new MailAPI(this);
2994
3135
  this.notifications = new NotificationsAPI(this);
2995
3136
  this.tab = new TabAPI(this);