@haex-space/vault-sdk 5.5.0 → 5.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 (49) hide show
  1. package/dist/autofill.js +1 -1
  2. package/dist/autofill.js.map +1 -1
  3. package/dist/autofill.mjs +1 -1
  4. package/dist/autofill.mjs.map +1 -1
  5. package/dist/cli/index.mjs.map +1 -1
  6. package/dist/{client-CtUpYUH7.d.ts → client-5T310pDa.d.mts} +142 -3
  7. package/dist/{client-BFDgj2tC.d.mts → client-r56Io3Ns.d.ts} +142 -3
  8. package/dist/haex_bundle_bg.wasm +0 -0
  9. package/dist/index.d.mts +7 -4
  10. package/dist/index.d.ts +7 -4
  11. package/dist/index.js +47 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +46 -2
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/node.d.mts +1 -1
  16. package/dist/node.d.ts +1 -1
  17. package/dist/node.mjs +1 -1
  18. package/dist/node.mjs.map +1 -1
  19. package/dist/nuxt.js +1 -1
  20. package/dist/nuxt.js.map +1 -1
  21. package/dist/passgen.js +1 -1
  22. package/dist/passgen.js.map +1 -1
  23. package/dist/passgen.mjs +1 -1
  24. package/dist/passgen.mjs.map +1 -1
  25. package/dist/react.d.mts +1 -1
  26. package/dist/react.d.ts +1 -1
  27. package/dist/react.js +56 -2
  28. package/dist/react.js.map +1 -1
  29. package/dist/react.mjs +55 -1
  30. package/dist/react.mjs.map +1 -1
  31. package/dist/runtime/nuxt.plugin.client.js +53 -0
  32. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  33. package/dist/runtime/nuxt.plugin.client.mjs +53 -0
  34. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  35. package/dist/svelte.d.mts +1 -1
  36. package/dist/svelte.d.ts +1 -1
  37. package/dist/svelte.js +56 -2
  38. package/dist/svelte.js.map +1 -1
  39. package/dist/svelte.mjs +55 -1
  40. package/dist/svelte.mjs.map +1 -1
  41. package/dist/{types-CNxDNQgb.d.mts → types-keveJwPq.d.mts} +3 -0
  42. package/dist/{types-CNxDNQgb.d.ts → types-keveJwPq.d.ts} +3 -0
  43. package/dist/vue.d.mts +1 -1
  44. package/dist/vue.d.ts +1 -1
  45. package/dist/vue.js +56 -2
  46. package/dist/vue.js.map +1 -1
  47. package/dist/vue.mjs +55 -1
  48. package/dist/vue.mjs.map +1 -1
  49. package/package.json +1 -1
package/dist/react.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as StorageAPI } from './client-BFDgj2tC.mjs';
1
+ import { S as StorageAPI } from './client-5T310pDa.mjs';
2
2
  import { HaexVaultSdk } from './index.mjs';
3
3
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
4
4
  import { HaexHubConfig, ExtensionInfo, ApplicationContext } from './index.mjs';
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as StorageAPI } from './client-CtUpYUH7.js';
1
+ import { S as StorageAPI } from './client-r56Io3Ns.js';
2
2
  import { HaexVaultSdk } from './index.js';
3
3
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
4
4
  import { HaexHubConfig, ExtensionInfo, ApplicationContext } from './index.js';
package/dist/react.js CHANGED
@@ -13,9 +13,9 @@ var __esm = (fn, res, err) => function __init() {
13
13
  }
14
14
  };
15
15
 
16
- // node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.32_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.33_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
17
17
  var init_cjs_shims = __esm({
18
- "node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.32_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.33_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
19
19
  }
20
20
  });
21
21
 
@@ -446,6 +446,9 @@ var HAEXTENSION_EVENTS = {
446
446
  FILE_CHANGED: "filesync:file-changed",
447
447
  /** Tables have been updated via sync (CRDT pull from server) */
448
448
  SYNC_TABLES_UPDATED: "haextension:sync:tables-updated",
449
+ /** The user used a control of this extension's header (holzi spec 090): `{ id, kind, value? }`.
450
+ * Subscribe through `client.header.onEvent`. */
451
+ HEADER_EVENT: "haextension:header:event",
449
452
  /** A runtime permission prompt was resolved (granted/denied) by the user.
450
453
  * The SDK uses this to auto-retry the original request; extensions may also
451
454
  * subscribe via `client.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, ...)`. */
@@ -649,8 +652,20 @@ var EXTENSION_COMMANDS = {
649
652
  getInfo: "extension_get_info",
650
653
  /** Get application context (theme, locale, etc.) */
651
654
  getContext: "extension_context_get",
655
+ /** Set application context (host-only, updates stored context for extensions) */
656
+ setContext: "extension_context_set",
657
+ /** Broadcast event to ALL extension webview windows (host-only, desktop only) */
658
+ webviewBroadcast: "extension_webview_broadcast",
659
+ /** Emit event to all webviews of a SPECIFIC extension (host-only, desktop only) */
660
+ webviewEmit: "extension_webview_emit",
661
+ /** Filter sync tables by extension permissions (returns filtered map) */
662
+ filterSyncTables: "extension_filter_sync_tables",
663
+ /** Emit sync tables to webviews (host-only, desktop only) */
664
+ emitSyncTables: "extension_emit_sync_tables",
652
665
  /** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
653
666
  tabAttention: "extension_tab_attention",
667
+ /** Replace the header of this extension's own tab (holzi spec 090): `null` */
668
+ headerSet: "extension_header_set",
654
669
  /** Ask the user to confirm, in a dialog the host draws over this extension's tab */
655
670
  dialogConfirm: "extension_dialog_confirm",
656
671
  /** Take the request the user gave this extension (holzi spec 063): `null` or `{ action, mail }` */
@@ -2561,6 +2576,44 @@ var TabAPI = class {
2561
2576
  }
2562
2577
  };
2563
2578
 
2579
+ // src/api/header.ts
2580
+ init_cjs_shims();
2581
+ var NOT_SUPPORTED2 = 8e3;
2582
+ function isUnknownMethod(error) {
2583
+ if (error?.code === NOT_SUPPORTED2) return true;
2584
+ const text = typeof error === "string" ? error : error?.message;
2585
+ return typeof text === "string" && /^Unknown method\b/.test(text);
2586
+ }
2587
+ var HeaderAPI = class {
2588
+ constructor(client) {
2589
+ this.client = client;
2590
+ }
2591
+ /**
2592
+ * Replace the header with `description`. Resolves `true` when the host applied it, and `false`
2593
+ * when the host has no header (haex-vault 2.x); the extension keeps running either way. Every
2594
+ * other error rejects, such as `3001` for a description the host refuses (the previous header
2595
+ * stays).
2596
+ */
2597
+ async set(description) {
2598
+ try {
2599
+ await this.client.request(EXTENSION_COMMANDS.headerSet, { ...description });
2600
+ return true;
2601
+ } catch (error) {
2602
+ if (isUnknownMethod(error)) return false;
2603
+ throw error;
2604
+ }
2605
+ }
2606
+ /** Listen for the user using a control of this extension's header. Returns an unsubscribe function. */
2607
+ onEvent(handler) {
2608
+ const wrapped = (event) => {
2609
+ const data = event.data;
2610
+ if (data) handler(data);
2611
+ };
2612
+ this.client.on(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
2613
+ return () => this.client.off(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
2614
+ }
2615
+ };
2616
+
2564
2617
  // src/api/dialog.ts
2565
2618
  init_cjs_shims();
2566
2619
  var DialogAPI = class {
@@ -3511,6 +3564,7 @@ var HaexVaultSdk = class {
3511
3564
  this.mail = new MailAPI(this);
3512
3565
  this.notifications = new NotificationsAPI(this);
3513
3566
  this.tab = new TabAPI(this);
3567
+ this.header = new HeaderAPI(this);
3514
3568
  this.dialog = new DialogAPI(this);
3515
3569
  this.openers = new OpenersAPI(this);
3516
3570
  this.tools = new ToolsAPI({