@haex-space/vault-sdk 4.5.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 (49) hide show
  1. package/README.md +40 -0
  2. package/dist/cli/index.mjs.map +1 -1
  3. package/dist/{client-Dw2uH1EM.d.ts → client-CcNhK76M.d.mts} +131 -2
  4. package/dist/{client-D4VYF0bP.d.mts → client-DIvNHfx-.d.ts} +131 -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/index.d.mts +32 -7
  8. package/dist/index.d.ts +32 -7
  9. package/dist/index.js +98 -5
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +95 -5
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/node.d.mts +4 -3
  14. package/dist/node.d.ts +4 -3
  15. package/dist/node.mjs +1 -1
  16. package/dist/node.mjs.map +1 -1
  17. package/dist/nuxt.d.mts +2 -1
  18. package/dist/nuxt.d.ts +2 -1
  19. package/dist/nuxt.js +1 -1
  20. package/dist/nuxt.js.map +1 -1
  21. package/dist/react.d.mts +3 -2
  22. package/dist/react.d.ts +3 -2
  23. package/dist/react.js +94 -5
  24. package/dist/react.js.map +1 -1
  25. package/dist/react.mjs +93 -4
  26. package/dist/react.mjs.map +1 -1
  27. package/dist/runtime/nuxt.plugin.client.d.mts +4 -3
  28. package/dist/runtime/nuxt.plugin.client.d.ts +4 -3
  29. package/dist/runtime/nuxt.plugin.client.js +83 -1
  30. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  31. package/dist/runtime/nuxt.plugin.client.mjs +83 -1
  32. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  33. package/dist/svelte.d.mts +3 -2
  34. package/dist/svelte.d.ts +3 -2
  35. package/dist/svelte.js +94 -5
  36. package/dist/svelte.js.map +1 -1
  37. package/dist/svelte.mjs +93 -4
  38. package/dist/svelte.mjs.map +1 -1
  39. package/dist/{types-CYuW3glJ.d.mts → types-snPkjDCj.d.mts} +10 -1
  40. package/dist/{types-CYuW3glJ.d.ts → types-snPkjDCj.d.ts} +10 -1
  41. package/dist/vite.d.mts +2 -1
  42. package/dist/vite.d.ts +2 -1
  43. package/dist/vue.d.mts +3 -2
  44. package/dist/vue.d.ts +3 -2
  45. package/dist/vue.js +94 -5
  46. package/dist/vue.js.map +1 -1
  47. package/dist/vue.mjs +93 -4
  48. package/dist/vue.mjs.map +1 -1
  49. package/package.json +3 -3
@@ -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, a as ExtensionManifest, H as HaexHubConfig, E as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, R as RequestOptions } from './types-CYuW3glJ.mjs';
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, a as ExtensionManifest, H as HaexHubConfig, E as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, R as RequestOptions } from './types-snPkjDCj.js';
2
2
  import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
3
3
 
4
4
  /**
@@ -1676,6 +1676,133 @@ declare class ContactsAPI {
1676
1676
  photoAsync(hash: string): Promise<Uint8Array>;
1677
1677
  }
1678
1678
 
1679
+ /**
1680
+ * Types of model jobs (holzi spec 055, `contracts/job-format.md` and `contracts/bridge.md`).
1681
+ */
1682
+ /** Where a model runs. Outside this device the user consents before anything is sent. */
1683
+ type ModelPlace = "this_device" | "network" | "cloud";
1684
+ /** The effort a step wishes for; the host caps it at what the user allowed. */
1685
+ type ModelEffort = "none" | "low" | "medium" | "high";
1686
+ /** A model the user allowed to this extension. */
1687
+ interface ExtensionModel {
1688
+ /** The host's model id, only to show and recognise it. */
1689
+ id: string;
1690
+ name: string;
1691
+ /** The display name of the provider. */
1692
+ provider: string;
1693
+ place: ModelPlace;
1694
+ capabilities: {
1695
+ image: boolean;
1696
+ /** `levels`: low, medium and high take effect; `managed`: the model decides itself. */
1697
+ effort: "none" | "managed" | "levels";
1698
+ };
1699
+ /** The highest effort the user allowed. */
1700
+ maxEffort: ModelEffort;
1701
+ }
1702
+ /** An image as Base64, at most 25 MiB raw; at most 8 per job. */
1703
+ interface ModelJobImage {
1704
+ mimeType: "image/jpeg" | "image/png" | "image/webp";
1705
+ data: string;
1706
+ }
1707
+ /** The format a step's answer must have; `schema` is the host's JSON Schema subset. */
1708
+ interface ModelJobFormat {
1709
+ name: string;
1710
+ version: number;
1711
+ schema: Record<string, unknown>;
1712
+ }
1713
+ interface ModelJobStep {
1714
+ /** `[a-z][a-z0-9_-]{0,31}`, unique in the job. */
1715
+ id: string;
1716
+ /** Always `text`; `image` exactly when the step has images. */
1717
+ needs: ("text" | "image")[];
1718
+ /** The extension's instruction to the model, at most 16 KiB. */
1719
+ instruction: string;
1720
+ input: {
1721
+ text?: string;
1722
+ images?: ModelJobImage[];
1723
+ /** A part of an earlier step's result, by JSON Pointer (RFC 6901); empty means all of it. */
1724
+ from?: {
1725
+ step: string;
1726
+ pointer: string;
1727
+ };
1728
+ };
1729
+ format: ModelJobFormat;
1730
+ effort?: ModelEffort;
1731
+ /** Up to the host's limit (default 4096, at most 16384). */
1732
+ maxOutputTokens?: number;
1733
+ }
1734
+ /** One to four steps; a later step can build on an earlier one with `from`. */
1735
+ interface ModelJob {
1736
+ steps: ModelJobStep[];
1737
+ }
1738
+ /** One model the host tried for a step. */
1739
+ interface ModelJobAttempt {
1740
+ model: string;
1741
+ place: ModelPlace;
1742
+ effort: ModelEffort | "managed";
1743
+ outcome: "used" | "unusable" | "unavailable" | "timeout";
1744
+ reason?: string;
1745
+ }
1746
+ /** What produced a step's result. */
1747
+ interface ModelJobProvenance {
1748
+ stepId: string;
1749
+ formatName: string;
1750
+ formatVersion: number;
1751
+ attempts: ModelJobAttempt[];
1752
+ }
1753
+ type ModelJobErrorCode = "unusable" | "unavailable" | "timeout" | "cancelled" | "consent_denied" | "no_capable_model";
1754
+ /** The end of a job, as the event `haextension:model-job:completed` carries it. */
1755
+ interface ModelJobCompletion {
1756
+ jobId: string;
1757
+ status: "completed" | "failed" | "cancelled";
1758
+ /** Each step's checked result, and the last one's as `final`. */
1759
+ result?: {
1760
+ steps: {
1761
+ id: string;
1762
+ result: unknown;
1763
+ }[];
1764
+ final: unknown;
1765
+ };
1766
+ provenance: ModelJobProvenance[];
1767
+ error?: {
1768
+ code: ModelJobErrorCode;
1769
+ message: string;
1770
+ stepId?: string;
1771
+ };
1772
+ }
1773
+
1774
+ /**
1775
+ * Jobs on the host's language and vision models (holzi spec 055), instead of bringing own access
1776
+ * and keys. The extension describes each step with its instruction, input and the format of the
1777
+ * answer; the host picks a model the user allowed for this extension, caps the effort, drops
1778
+ * broken output and returns only a result that fits the format.
1779
+ *
1780
+ * The user decides at run time: the first job asks which model the extension may use and up to
1781
+ * which effort, and before data goes to a destination outside this device it asks for consent.
1782
+ * The SDK waits for these answers and starts the job again, like for every other permission.
1783
+ */
1784
+ declare class ModelsAPI {
1785
+ private client;
1786
+ constructor(client: HaexVaultSdk);
1787
+ /** The models the user allowed to this extension; empty without any. */
1788
+ listAsync(): Promise<ExtensionModel[]>;
1789
+ /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
1790
+ startAsync(job: ModelJob): Promise<{
1791
+ jobId: string;
1792
+ }>;
1793
+ /** Cancels a running job of this frame; `false` when it is unknown or already ended. */
1794
+ cancelAsync(jobId: string): Promise<boolean>;
1795
+ /** Listens for the end of this frame's jobs. Returns an unsubscribe function. */
1796
+ onCompleted(handler: (completion: ModelJobCompletion) => void): () => void;
1797
+ /**
1798
+ * Starts a job and resolves with its end: `completed` with the result, or `failed` or
1799
+ * `cancelled` with the error. Errors of the start itself (an invalid job, a refused model or
1800
+ * consent, no fitting model) reject. The end can arrive before the start answers; it is kept
1801
+ * until then.
1802
+ */
1803
+ runAsync(job: ModelJob): Promise<ModelJobCompletion>;
1804
+ }
1805
+
1679
1806
  /**
1680
1807
  * Mail types — IMAP fetch + SMTP send.
1681
1808
  *
@@ -2106,6 +2233,7 @@ declare class HaexVaultSdk {
2106
2233
  readonly shell: ShellAPI;
2107
2234
  readonly passwords: PasswordsAPI;
2108
2235
  readonly contacts: ContactsAPI;
2236
+ readonly models: ModelsAPI;
2109
2237
  readonly mail: MailAPI;
2110
2238
  readonly notifications: NotificationsAPI;
2111
2239
  readonly tab: TabAPI;
@@ -2162,4 +2290,5 @@ declare class HaexVaultSdk {
2162
2290
  private log;
2163
2291
  }
2164
2292
 
2165
- export { type MailboxInfo as $, type AuthorizedClient as A, type BlockedClient as B, type ConfirmOptions as C, DatabaseAPI as D, type EncryptedFolderAccess as E, type ExternalRequestHandler as F, type ExternalRequestPayload as G, HaexVaultSdk as H, type ExternalResponse as I, type FileStat as J, FilesystemAPI as K, type ImapConfig as L, KnownPath as M, type KnownPaths as N, LOCALSEND_EVENTS as O, LocalSendAPI as P, type LocalSendEvent as Q, type FileInfo as R, StorageAPI as S, type LocalSendSettings as T, MailAPI as U, type MailAccount as V, type MailAddress as W, type Attachment as X, type FetchRange as Y, type MailMessage as Z, type MailNewMessagesEvent as _, type ConnectionSecurity as a, type MessageEnvelope as a0, type NotificationAction as a1, type NotificationClickEvent as a2, type NotificationOptions as a3, NotificationsAPI as a4, type OutgoingAttachment as a5, type OutgoingMessage as a6, type PasswordInput as a7, type PasswordItemFull as a8, type PasswordItemSummary as a9, ShellAPI as aA, type ShellCreateOptions as aB, type ShellCreateResponse as aC, type ShellExitEvent as aD, type ShellOutputEvent as aE, type SmtpConfig as aF, type SpaceAccessTokenInfo as aG, type SpaceAssignment as aH, type SpaceInvite as aI, type SpaceKeyGrantInfo as aJ, type SpaceMember as aK, type SpaceMemberInfo as aL, SpacesAPI as aM, type SyncBackendInfo as aN, TabAPI as aO, type ToolContext as aP, type ToolHandler as aQ, ToolsAPI as aR, type TransferDirection as aS, type TransferProgress as aT, type TransferState as aU, WebAPI as aV, canExternalClientSendRequests as aW, isExternalClientConnected as aX, type PasswordKeyValue as aa, type PasswordKeyValueInput as ab, PasswordsAPI as ac, type PendingAuthorization as ad, type PendingTransfer as ae, PermissionsAPI as af, type AddBackendRequest as ag, type FolderBackendInfo as ah, type S3BackendInfo as ai, type S3Config as aj, type S3Proposal as ak, type S3PublicConfig as al, type SftpProposal as am, RemoteStorageAPI as an, type StorageBackendInfo as ao, type StorageBackendType as ap, type StorageObjectInfo as aq, type UpdateBackendRequest as ar, type WebDavProposal as as, type RequestedExtension as at, type SelectFileOptions as au, type SelectFolderOptions as av, type ServerInfo as aw, type ServerStatus as ax, type SessionAuthorization as ay, type SharedSpace as az, type ContactDetail as b, type ContactHolziAddresses as c, type ContactHolziDevice as d, type ContactList as e, type ContactListOptions as f, type ContactSummary as g, type ContactValue as h, ContactsAPI as i, type DecryptedSpace as j, type DeepLink as k, type Device as l, type DeviceInfo as m, type DeviceType as n, DialogAPI as o, type DirEntry as p, type EncryptedFolderChoice as q, type EncryptedFolderEntry as r, type EncryptedFolderProviderErrorKind as s, EncryptedFoldersAPI as t, type ExternalAuthDecision as u, type ExternalConnection as v, ExternalConnectionErrorCode as w, ExternalConnectionState as x, type ExternalRequest as y, type ExternalRequestEvent as z };
2293
+ export { DatabaseAPI as D, HaexVaultSdk as H, FilesystemAPI as L, KnownPath as N, LOCALSEND_EVENTS as P, LocalSendAPI as Q, StorageAPI as S, MailAPI as V, ShellAPI as aM, SpacesAPI as aY, TabAPI as a_, ModelsAPI as ac, NotificationsAPI as ag, PasswordsAPI as ao, PermissionsAPI as ar, RemoteStorageAPI as az, ToolsAPI as b1, WebAPI as b5, canExternalClientSendRequests as b6, isExternalClientConnected as b7, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2294
+ export type { MailNewMessagesEvent as $, AuthorizedClient as A, BlockedClient as B, ConfirmOptions as C, EncryptedFolderAccess as E, ExternalRequestEvent as F, ExternalRequestHandler as G, ExternalRequestPayload as I, ExternalResponse as J, FileStat as K, ImapConfig as M, KnownPaths as O, LocalSendEvent as R, FileInfo as T, LocalSendSettings as U, MailAccount as W, MailAddress as X, Attachment as Y, FetchRange as Z, MailMessage as _, ConnectionSecurity as a, ToolContext as a$, MailboxInfo as a0, MessageEnvelope as a1, ModelEffort as a2, ModelJob as a3, ModelJobAttempt as a4, ModelJobCompletion as a5, ModelJobErrorCode as a6, ModelJobFormat as a7, ModelJobImage as a8, ModelJobProvenance as a9, StorageBackendInfo as aA, StorageBackendType as aB, StorageObjectInfo as aC, UpdateBackendRequest as aD, WebDavProposal as aE, RequestedExtension as aF, SelectFileOptions as aG, SelectFolderOptions as aH, ServerInfo as aI, ServerStatus as aJ, SessionAuthorization as aK, SharedSpace as aL, ShellCreateOptions as aN, ShellCreateResponse as aO, ShellExitEvent as aP, ShellOutputEvent as aQ, SmtpConfig as aR, SpaceAccessTokenInfo as aS, SpaceAssignment as aT, SpaceInvite as aU, SpaceKeyGrantInfo as aV, SpaceMember as aW, SpaceMemberInfo as aX, SyncBackendInfo as aZ, ModelJobStep as aa, ModelPlace as ab, NotificationAction as ad, NotificationClickEvent as ae, NotificationOptions as af, OutgoingAttachment as ah, OutgoingMessage as ai, PasswordInput as aj, PasswordItemFull as ak, PasswordItemSummary as al, PasswordKeyValue as am, PasswordKeyValueInput as an, PendingAuthorization as ap, PendingTransfer as aq, AddBackendRequest as as, FolderBackendInfo as at, S3BackendInfo as au, S3Config as av, S3Proposal as aw, S3PublicConfig as ax, SftpProposal as ay, ContactDetail as b, ToolHandler as b0, TransferDirection as b2, TransferProgress as b3, TransferState as b4, ContactHolziAddresses as c, ContactHolziDevice as d, ContactList as e, ContactListOptions as f, ContactSummary as g, ContactValue as h, DecryptedSpace as j, DeepLink as k, Device as l, DeviceInfo as m, DeviceType as n, DirEntry as p, EncryptedFolderChoice as q, EncryptedFolderEntry as r, EncryptedFolderProviderErrorKind as s, ExtensionModel as u, ExternalAuthDecision as v, ExternalConnection as w, ExternalRequest as z };
@@ -30,4 +30,5 @@ declare function readHaextensionConfig(rootDir?: string): HaextensionConfig | nu
30
30
  */
31
31
  declare function getExtensionDir(rootDir?: string): string;
32
32
 
33
- export { type HaextensionConfig as H, getExtensionDir as g, readHaextensionConfig as r };
33
+ export { getExtensionDir as g, readHaextensionConfig as r };
34
+ export type { HaextensionConfig as H };
@@ -30,4 +30,5 @@ declare function readHaextensionConfig(rootDir?: string): HaextensionConfig | nu
30
30
  */
31
31
  declare function getExtensionDir(rootDir?: string): string;
32
32
 
33
- export { type HaextensionConfig as H, getExtensionDir as g, readHaextensionConfig as r };
33
+ export { getExtensionDir as g, readHaextensionConfig as r };
34
+ export type { HaextensionConfig as H };
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { H as HaexVaultSdk } from './client-D4VYF0bP.mjs';
2
- export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExternalAuthDecision, v as ExternalConnection, w as ExternalConnectionErrorCode, x as ExternalConnectionState, y as ExternalRequest, z as ExternalRequestEvent, F as ExternalRequestHandler, G as ExternalRequestPayload, I as ExternalResponse, J as FileStat, K as FilesystemAPI, L as ImapConfig, M as KnownPath, N as KnownPaths, O as LOCALSEND_EVENTS, P as LocalSendAPI, Q as LocalSendEvent, R as LocalSendFileInfo, T as LocalSendSettings, U as MailAPI, V as MailAccount, W as MailAddress, X as MailAttachment, Y as MailFetchRange, Z as MailMessage, _ as MailNewMessagesEvent, $ as MailboxInfo, a0 as MessageEnvelope, a1 as NotificationAction, a2 as NotificationClickEvent, a3 as NotificationOptions, a4 as NotificationsAPI, a5 as OutgoingAttachment, a6 as OutgoingMessage, a7 as PasswordInput, a8 as PasswordItemFull, a9 as PasswordItemSummary, aa as PasswordKeyValue, ab as PasswordKeyValueInput, ac as PasswordsAPI, ad as PendingAuthorization, ae as PendingTransfer, af as PermissionsAPI, ag as RemoteAddBackendRequest, ah as RemoteFolderBackendInfo, ai as RemoteS3BackendInfo, aj as RemoteS3Config, ak as RemoteS3Proposal, al as RemoteS3PublicConfig, am as RemoteSftpProposal, an as RemoteStorageAPI, ao as RemoteStorageBackendInfo, ap as RemoteStorageBackendType, aq as RemoteStorageObjectInfo, ar as RemoteUpdateBackendRequest, as as RemoteWebDavProposal, at as RequestedExtension, au as SelectFileOptions, av as SelectFolderOptions, aw as ServerInfo, ax as ServerStatus, ay as SessionAuthorization, az as SharedSpace, aA as ShellAPI, aB as ShellCreateOptions, aC as ShellCreateResponse, aD as ShellExitEvent, aE as ShellOutputEvent, aF as SmtpConfig, aG as SpaceAccessTokenInfo, aH as SpaceAssignment, aI as SpaceInvite, aJ as SpaceKeyGrantInfo, aK as SpaceMember, aL as SpaceMemberInfo, aM as SpacesAPI, aN as SyncBackendInfo, aO as TabAPI, aP as ToolContext, aQ as ToolHandler, aR as ToolsAPI, aS as TransferDirection, aT as TransferProgress, aU as TransferState, aV as WebAPI, aW as canExternalClientSendRequests, aX as isExternalClientConnected } from './client-D4VYF0bP.mjs';
3
- import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-CYuW3glJ.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, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MailEvent, K as ManifestI18nEntry, L as ManifestTool, N as ManifestToolEffect, O as NOTIFICATION_EVENTS, Q as NotificationEvent, T as PermissionDeniedError, U as PermissionErrorBase, V as PermissionErrorCode, X as PermissionPromptError, P as PermissionResponse, Y as PermissionStatus, R as RequestOptions, Z as SHELL_EVENTS, _ as SearchQuery, $ as SearchRequestEvent, S as SearchResult, a0 as ShellEvent, a1 as SyncTablesUpdatedEvent, a2 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a3 as getTableName, a4 as isPermissionDeniedError, a5 as isPermissionError, a6 as isPermissionPromptError } from './types-CYuW3glJ.mjs';
5
- export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
1
+ import { H as HaexVaultSdk } from './client-CcNhK76M.mjs';
2
+ export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailboxInfo, a1 as MessageEnvelope, a2 as ModelEffort, a3 as ModelJob, a4 as ModelJobAttempt, a5 as ModelJobCompletion, a6 as ModelJobErrorCode, a7 as ModelJobFormat, a8 as ModelJobImage, a9 as ModelJobProvenance, aa as ModelJobStep, ab as ModelPlace, ac as ModelsAPI, ad as NotificationAction, ae as NotificationClickEvent, af as NotificationOptions, ag as NotificationsAPI, ah as OutgoingAttachment, ai as OutgoingMessage, aj as PasswordInput, ak as PasswordItemFull, al as PasswordItemSummary, am as PasswordKeyValue, an as PasswordKeyValueInput, ao as PasswordsAPI, ap as PendingAuthorization, aq as PendingTransfer, ar as PermissionsAPI, as as RemoteAddBackendRequest, at as RemoteFolderBackendInfo, au as RemoteS3BackendInfo, av as RemoteS3Config, aw as RemoteS3Proposal, ax as RemoteS3PublicConfig, ay as RemoteSftpProposal, az as RemoteStorageAPI, aA as RemoteStorageBackendInfo, aB as RemoteStorageBackendType, aC as RemoteStorageObjectInfo, aD as RemoteUpdateBackendRequest, aE as RemoteWebDavProposal, aF as RequestedExtension, aG as SelectFileOptions, aH as SelectFolderOptions, aI as ServerInfo, aJ as ServerStatus, aK as SessionAuthorization, aL as SharedSpace, aM as ShellAPI, aN as ShellCreateOptions, aO as ShellCreateResponse, aP as ShellExitEvent, aQ as ShellOutputEvent, aR as SmtpConfig, aS as SpaceAccessTokenInfo, aT as SpaceAssignment, aU as SpaceInvite, aV as SpaceKeyGrantInfo, aW as SpaceMember, aX as SpaceMemberInfo, aY as SpacesAPI, aZ as SyncBackendInfo, a_ as TabAPI, a$ as ToolContext, b0 as ToolHandler, b1 as ToolsAPI, b2 as TransferDirection, b3 as TransferProgress, b4 as TransferState, b5 as WebAPI, b6 as canExternalClientSendRequests, b7 as isExternalClientConnected } from './client-CcNhK76M.mjs';
3
+ import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-snPkjDCj.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, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as PermissionDeniedError, X as PermissionErrorBase, Y as PermissionErrorCode, Z as PermissionPromptError, P as PermissionResponse, _ as PermissionStatus, R as RequestOptions, $ as SHELL_EVENTS, a0 as SearchQuery, a1 as SearchRequestEvent, S as SearchResult, a2 as ShellEvent, a3 as SyncTablesUpdatedEvent, a4 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a5 as getTableName, a6 as isPermissionDeniedError, a7 as isPermissionError, a8 as isPermissionPromptError } from './types-snPkjDCj.mjs';
5
+ export { H as HaextensionConfig } from './config-P_6DqTHl.mjs';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
8
8
  /**
@@ -150,6 +150,25 @@ declare const CONTACT_COMMANDS: {
150
150
  };
151
151
  type ContactCommand = (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS];
152
152
 
153
+ /**
154
+ * Model Commands
155
+ *
156
+ * Commands for jobs on the host's language and vision models (holzi spec 055). The extension
157
+ * describes the job; the host picks a model the user allowed, checks the answer against the
158
+ * job's format and sends the result as `haextension:model-job:completed`.
159
+ *
160
+ * Naming convention: `extension_model_<action>`
161
+ */
162
+ declare const MODEL_COMMANDS: {
163
+ /** The models the user allowed to this extension, without addresses or keys */
164
+ readonly list: "extension_model_list";
165
+ /** Starts a job; the result follows as an event */
166
+ readonly start: "extension_model_job_start";
167
+ /** Cancels a running job of this frame */
168
+ readonly cancel: "extension_model_job_cancel";
169
+ };
170
+ type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
171
+
153
172
  /**
154
173
  * Mail Commands (IMAP fetch + SMTP send).
155
174
  *
@@ -866,6 +885,11 @@ declare const TAURI_COMMANDS: {
866
885
  readonly search: "extension_contacts_search";
867
886
  readonly photo: "extension_contacts_photo";
868
887
  };
888
+ readonly models: {
889
+ readonly list: "extension_model_list";
890
+ readonly start: "extension_model_job_start";
891
+ readonly cancel: "extension_model_job_cancel";
892
+ };
869
893
  readonly mail: {
870
894
  readonly listMailboxes: "extension_mail_list_mailboxes";
871
895
  readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
@@ -884,7 +908,7 @@ declare const TAURI_COMMANDS: {
884
908
  readonly dismiss: "extension_notifications_dismiss";
885
909
  };
886
910
  };
887
- type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
911
+ type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
888
912
 
889
913
  /**
890
914
  * Crypto utilities for Vault Key Management
@@ -1151,4 +1175,5 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
1151
1175
 
1152
1176
  declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
1153
1177
 
1154
- export { type AuthUser, CONTACT_COMMANDS, COSE_ALGORITHM, type ContactCommand, type CoseAlgorithm, type CreateSpaceRequest, ENCRYPTED_FOLDER_COMMANDS, type EncryptedFolderCommand, type ExportedPasskeyKeyPair, type ExportedUserKeypair, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, type MailCommand, NOTIFICATION_COMMANDS, type NotificationCommand, PASSWORD_COMMANDS, type PasskeyKeyPair, type PasswordCommand, type RegisterKeypairRequest, SIGNING_ALGO, SPACE_COMMANDS, type SealedData, type SignableRecord, SignedClaimPresentation, type SpaceCommand, type StorageConfig, type ErrorResponse as SyncServerErrorResponse, type ServerInfo as SyncServerInfo, type LoginRequest as SyncServerLoginRequest, type LoginResponse as SyncServerLoginResponse, type RefreshRequest as SyncServerRefreshRequest, TAURI_COMMANDS, type TauriCommand, type UserKeypair, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
1178
+ export { CONTACT_COMMANDS, COSE_ALGORITHM, ENCRYPTED_FOLDER_COMMANDS, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, MODEL_COMMANDS, NOTIFICATION_COMMANDS, PASSWORD_COMMANDS, SIGNING_ALGO, SPACE_COMMANDS, SignedClaimPresentation, TAURI_COMMANDS, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
1179
+ export type { AuthUser, ContactCommand, CoseAlgorithm, CreateSpaceRequest, EncryptedFolderCommand, ExportedPasskeyKeyPair, ExportedUserKeypair, HaexspaceMessageType, InviteMemberRequest, MailCommand, ModelCommand, NotificationCommand, PasskeyKeyPair, PasswordCommand, RegisterKeypairRequest, SealedData, SignableRecord, SpaceCommand, StorageConfig, ErrorResponse as SyncServerErrorResponse, ServerInfo as SyncServerInfo, LoginRequest as SyncServerLoginRequest, LoginResponse as SyncServerLoginResponse, RefreshRequest as SyncServerRefreshRequest, TauriCommand, UserKeypair };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { H as HaexVaultSdk } from './client-Dw2uH1EM.js';
2
- export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExternalAuthDecision, v as ExternalConnection, w as ExternalConnectionErrorCode, x as ExternalConnectionState, y as ExternalRequest, z as ExternalRequestEvent, F as ExternalRequestHandler, G as ExternalRequestPayload, I as ExternalResponse, J as FileStat, K as FilesystemAPI, L as ImapConfig, M as KnownPath, N as KnownPaths, O as LOCALSEND_EVENTS, P as LocalSendAPI, Q as LocalSendEvent, R as LocalSendFileInfo, T as LocalSendSettings, U as MailAPI, V as MailAccount, W as MailAddress, X as MailAttachment, Y as MailFetchRange, Z as MailMessage, _ as MailNewMessagesEvent, $ as MailboxInfo, a0 as MessageEnvelope, a1 as NotificationAction, a2 as NotificationClickEvent, a3 as NotificationOptions, a4 as NotificationsAPI, a5 as OutgoingAttachment, a6 as OutgoingMessage, a7 as PasswordInput, a8 as PasswordItemFull, a9 as PasswordItemSummary, aa as PasswordKeyValue, ab as PasswordKeyValueInput, ac as PasswordsAPI, ad as PendingAuthorization, ae as PendingTransfer, af as PermissionsAPI, ag as RemoteAddBackendRequest, ah as RemoteFolderBackendInfo, ai as RemoteS3BackendInfo, aj as RemoteS3Config, ak as RemoteS3Proposal, al as RemoteS3PublicConfig, am as RemoteSftpProposal, an as RemoteStorageAPI, ao as RemoteStorageBackendInfo, ap as RemoteStorageBackendType, aq as RemoteStorageObjectInfo, ar as RemoteUpdateBackendRequest, as as RemoteWebDavProposal, at as RequestedExtension, au as SelectFileOptions, av as SelectFolderOptions, aw as ServerInfo, ax as ServerStatus, ay as SessionAuthorization, az as SharedSpace, aA as ShellAPI, aB as ShellCreateOptions, aC as ShellCreateResponse, aD as ShellExitEvent, aE as ShellOutputEvent, aF as SmtpConfig, aG as SpaceAccessTokenInfo, aH as SpaceAssignment, aI as SpaceInvite, aJ as SpaceKeyGrantInfo, aK as SpaceMember, aL as SpaceMemberInfo, aM as SpacesAPI, aN as SyncBackendInfo, aO as TabAPI, aP as ToolContext, aQ as ToolHandler, aR as ToolsAPI, aS as TransferDirection, aT as TransferProgress, aU as TransferState, aV as WebAPI, aW as canExternalClientSendRequests, aX as isExternalClientConnected } from './client-Dw2uH1EM.js';
3
- import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-CYuW3glJ.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, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MailEvent, K as ManifestI18nEntry, L as ManifestTool, N as ManifestToolEffect, O as NOTIFICATION_EVENTS, Q as NotificationEvent, T as PermissionDeniedError, U as PermissionErrorBase, V as PermissionErrorCode, X as PermissionPromptError, P as PermissionResponse, Y as PermissionStatus, R as RequestOptions, Z as SHELL_EVENTS, _ as SearchQuery, $ as SearchRequestEvent, S as SearchResult, a0 as ShellEvent, a1 as SyncTablesUpdatedEvent, a2 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a3 as getTableName, a4 as isPermissionDeniedError, a5 as isPermissionError, a6 as isPermissionPromptError } from './types-CYuW3glJ.js';
5
- export { H as HaextensionConfig } from './config-D_HXjsEV.js';
1
+ import { H as HaexVaultSdk } from './client-DIvNHfx-.js';
2
+ export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailboxInfo, a1 as MessageEnvelope, a2 as ModelEffort, a3 as ModelJob, a4 as ModelJobAttempt, a5 as ModelJobCompletion, a6 as ModelJobErrorCode, a7 as ModelJobFormat, a8 as ModelJobImage, a9 as ModelJobProvenance, aa as ModelJobStep, ab as ModelPlace, ac as ModelsAPI, ad as NotificationAction, ae as NotificationClickEvent, af as NotificationOptions, ag as NotificationsAPI, ah as OutgoingAttachment, ai as OutgoingMessage, aj as PasswordInput, ak as PasswordItemFull, al as PasswordItemSummary, am as PasswordKeyValue, an as PasswordKeyValueInput, ao as PasswordsAPI, ap as PendingAuthorization, aq as PendingTransfer, ar as PermissionsAPI, as as RemoteAddBackendRequest, at as RemoteFolderBackendInfo, au as RemoteS3BackendInfo, av as RemoteS3Config, aw as RemoteS3Proposal, ax as RemoteS3PublicConfig, ay as RemoteSftpProposal, az as RemoteStorageAPI, aA as RemoteStorageBackendInfo, aB as RemoteStorageBackendType, aC as RemoteStorageObjectInfo, aD as RemoteUpdateBackendRequest, aE as RemoteWebDavProposal, aF as RequestedExtension, aG as SelectFileOptions, aH as SelectFolderOptions, aI as ServerInfo, aJ as ServerStatus, aK as SessionAuthorization, aL as SharedSpace, aM as ShellAPI, aN as ShellCreateOptions, aO as ShellCreateResponse, aP as ShellExitEvent, aQ as ShellOutputEvent, aR as SmtpConfig, aS as SpaceAccessTokenInfo, aT as SpaceAssignment, aU as SpaceInvite, aV as SpaceKeyGrantInfo, aW as SpaceMember, aX as SpaceMemberInfo, aY as SpacesAPI, aZ as SyncBackendInfo, a_ as TabAPI, a$ as ToolContext, b0 as ToolHandler, b1 as ToolsAPI, b2 as TransferDirection, b3 as TransferProgress, b4 as TransferState, b5 as WebAPI, b6 as canExternalClientSendRequests, b7 as isExternalClientConnected } from './client-DIvNHfx-.js';
3
+ import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-snPkjDCj.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, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as PermissionDeniedError, X as PermissionErrorBase, Y as PermissionErrorCode, Z as PermissionPromptError, P as PermissionResponse, _ as PermissionStatus, R as RequestOptions, $ as SHELL_EVENTS, a0 as SearchQuery, a1 as SearchRequestEvent, S as SearchResult, a2 as ShellEvent, a3 as SyncTablesUpdatedEvent, a4 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a5 as getTableName, a6 as isPermissionDeniedError, a7 as isPermissionError, a8 as isPermissionPromptError } from './types-snPkjDCj.js';
5
+ export { H as HaextensionConfig } from './config-P_6DqTHl.js';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
8
8
  /**
@@ -150,6 +150,25 @@ declare const CONTACT_COMMANDS: {
150
150
  };
151
151
  type ContactCommand = (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS];
152
152
 
153
+ /**
154
+ * Model Commands
155
+ *
156
+ * Commands for jobs on the host's language and vision models (holzi spec 055). The extension
157
+ * describes the job; the host picks a model the user allowed, checks the answer against the
158
+ * job's format and sends the result as `haextension:model-job:completed`.
159
+ *
160
+ * Naming convention: `extension_model_<action>`
161
+ */
162
+ declare const MODEL_COMMANDS: {
163
+ /** The models the user allowed to this extension, without addresses or keys */
164
+ readonly list: "extension_model_list";
165
+ /** Starts a job; the result follows as an event */
166
+ readonly start: "extension_model_job_start";
167
+ /** Cancels a running job of this frame */
168
+ readonly cancel: "extension_model_job_cancel";
169
+ };
170
+ type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
171
+
153
172
  /**
154
173
  * Mail Commands (IMAP fetch + SMTP send).
155
174
  *
@@ -866,6 +885,11 @@ declare const TAURI_COMMANDS: {
866
885
  readonly search: "extension_contacts_search";
867
886
  readonly photo: "extension_contacts_photo";
868
887
  };
888
+ readonly models: {
889
+ readonly list: "extension_model_list";
890
+ readonly start: "extension_model_job_start";
891
+ readonly cancel: "extension_model_job_cancel";
892
+ };
869
893
  readonly mail: {
870
894
  readonly listMailboxes: "extension_mail_list_mailboxes";
871
895
  readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
@@ -884,7 +908,7 @@ declare const TAURI_COMMANDS: {
884
908
  readonly dismiss: "extension_notifications_dismiss";
885
909
  };
886
910
  };
887
- type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
911
+ type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
888
912
 
889
913
  /**
890
914
  * Crypto utilities for Vault Key Management
@@ -1151,4 +1175,5 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
1151
1175
 
1152
1176
  declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
1153
1177
 
1154
- export { type AuthUser, CONTACT_COMMANDS, COSE_ALGORITHM, type ContactCommand, type CoseAlgorithm, type CreateSpaceRequest, ENCRYPTED_FOLDER_COMMANDS, type EncryptedFolderCommand, type ExportedPasskeyKeyPair, type ExportedUserKeypair, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, type MailCommand, NOTIFICATION_COMMANDS, type NotificationCommand, PASSWORD_COMMANDS, type PasskeyKeyPair, type PasswordCommand, type RegisterKeypairRequest, SIGNING_ALGO, SPACE_COMMANDS, type SealedData, type SignableRecord, SignedClaimPresentation, type SpaceCommand, type StorageConfig, type ErrorResponse as SyncServerErrorResponse, type ServerInfo as SyncServerInfo, type LoginRequest as SyncServerLoginRequest, type LoginResponse as SyncServerLoginResponse, type RefreshRequest as SyncServerRefreshRequest, TAURI_COMMANDS, type TauriCommand, type UserKeypair, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
1178
+ export { CONTACT_COMMANDS, COSE_ALGORITHM, ENCRYPTED_FOLDER_COMMANDS, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, MODEL_COMMANDS, NOTIFICATION_COMMANDS, PASSWORD_COMMANDS, SIGNING_ALGO, SPACE_COMMANDS, SignedClaimPresentation, TAURI_COMMANDS, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
1179
+ export type { AuthUser, ContactCommand, CoseAlgorithm, CreateSpaceRequest, EncryptedFolderCommand, ExportedPasskeyKeyPair, ExportedUserKeypair, HaexspaceMessageType, InviteMemberRequest, MailCommand, ModelCommand, NotificationCommand, PasskeyKeyPair, PasswordCommand, RegisterKeypairRequest, SealedData, SignableRecord, SpaceCommand, StorageConfig, ErrorResponse as SyncServerErrorResponse, ServerInfo as SyncServerInfo, LoginRequest as SyncServerLoginRequest, LoginResponse as SyncServerLoginResponse, RefreshRequest as SyncServerRefreshRequest, TauriCommand, UserKeypair };
package/dist/index.js CHANGED
@@ -4,17 +4,22 @@ var sqliteProxy = require('drizzle-orm/sqlite-proxy');
4
4
 
5
5
  var __defProp = Object.defineProperty;
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
  var __export = (target, all) => {
11
16
  for (var name in all)
12
17
  __defProp(target, name, { get: all[name], enumerable: true });
13
18
  };
14
19
 
15
- // node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.30_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
20
+ // 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
16
21
  var init_cjs_shims = __esm({
17
- "node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.30_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
22
+ "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"() {
18
23
  }
19
24
  });
20
25
 
@@ -758,6 +763,10 @@ var NOTIFICATION_EVENTS = {
758
763
  /** A click on one of this extension's notifications (body or action button). */
759
764
  CLICK: "haextension:notification:click"
760
765
  };
766
+ var MODEL_JOB_EVENTS = {
767
+ /** A job of this frame ended: completed, failed or cancelled. */
768
+ COMPLETED: "haextension:model-job:completed"
769
+ };
761
770
  var EXTERNAL_EVENTS = {
762
771
  /** External request from authorized client */
763
772
  REQUEST: "haextension:external:request",
@@ -1188,6 +1197,17 @@ var CONTACT_COMMANDS = {
1188
1197
  photo: "extension_contacts_photo"
1189
1198
  };
1190
1199
 
1200
+ // src/commands/models.ts
1201
+ init_cjs_shims();
1202
+ var MODEL_COMMANDS = {
1203
+ /** The models the user allowed to this extension, without addresses or keys */
1204
+ list: "extension_model_list",
1205
+ /** Starts a job; the result follows as an event */
1206
+ start: "extension_model_job_start",
1207
+ /** Cancels a running job of this frame */
1208
+ cancel: "extension_model_job_cancel"
1209
+ };
1210
+
1191
1211
  // src/commands/mail.ts
1192
1212
  init_cjs_shims();
1193
1213
  var MAIL_COMMANDS = {
@@ -1240,6 +1260,7 @@ var TAURI_COMMANDS = {
1240
1260
  shell: SHELL_COMMANDS,
1241
1261
  passwords: PASSWORD_COMMANDS,
1242
1262
  contacts: CONTACT_COMMANDS,
1263
+ models: MODEL_COMMANDS,
1243
1264
  mail: MAIL_COMMANDS,
1244
1265
  notifications: NOTIFICATION_COMMANDS
1245
1266
  };
@@ -2416,6 +2437,69 @@ var ContactsAPI = class {
2416
2437
  }
2417
2438
  };
2418
2439
 
2440
+ // src/api/models.ts
2441
+ init_cjs_shims();
2442
+ var ModelsAPI = class {
2443
+ constructor(client) {
2444
+ this.client = client;
2445
+ }
2446
+ /** The models the user allowed to this extension; empty without any. */
2447
+ async listAsync() {
2448
+ const answer = await this.client.request(
2449
+ MODEL_COMMANDS.list,
2450
+ {}
2451
+ );
2452
+ return answer.models;
2453
+ }
2454
+ /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
2455
+ async startAsync(job) {
2456
+ const answer = await this.client.request(MODEL_COMMANDS.start, {
2457
+ job
2458
+ });
2459
+ return { jobId: answer.jobId };
2460
+ }
2461
+ /** Cancels a running job of this frame; `false` when it is unknown or already ended. */
2462
+ async cancelAsync(jobId) {
2463
+ const answer = await this.client.request(MODEL_COMMANDS.cancel, {
2464
+ jobId
2465
+ });
2466
+ return answer.cancelled;
2467
+ }
2468
+ /** Listens for the end of this frame's jobs. Returns an unsubscribe function. */
2469
+ onCompleted(handler) {
2470
+ const wrapped = (event) => {
2471
+ const data = event.data;
2472
+ if (data) handler(data);
2473
+ };
2474
+ this.client.on(MODEL_JOB_EVENTS.COMPLETED, wrapped);
2475
+ return () => this.client.off(MODEL_JOB_EVENTS.COMPLETED, wrapped);
2476
+ }
2477
+ /**
2478
+ * Starts a job and resolves with its end: `completed` with the result, or `failed` or
2479
+ * `cancelled` with the error. Errors of the start itself (an invalid job, a refused model or
2480
+ * consent, no fitting model) reject. The end can arrive before the start answers; it is kept
2481
+ * until then.
2482
+ */
2483
+ async runAsync(job) {
2484
+ const ended = /* @__PURE__ */ new Map();
2485
+ let waiting = null;
2486
+ const unsubscribe = this.onCompleted((completion) => {
2487
+ if (waiting && completion.jobId === waiting.jobId) waiting.resolve(completion);
2488
+ else ended.set(completion.jobId, completion);
2489
+ });
2490
+ try {
2491
+ const { jobId } = await this.startAsync(job);
2492
+ return await new Promise((resolve) => {
2493
+ const early = ended.get(jobId);
2494
+ if (early) resolve(early);
2495
+ else waiting = { jobId, resolve };
2496
+ });
2497
+ } finally {
2498
+ unsubscribe();
2499
+ }
2500
+ }
2501
+ };
2502
+
2419
2503
  // src/api/mail.ts
2420
2504
  init_cjs_shims();
2421
2505
  var MailAPI = class {
@@ -3372,6 +3456,7 @@ var AI_COMMANDS = {
3372
3456
  init_cjs_shims();
3373
3457
  var PERMISSION_DECISION_TIMEOUT_MS = 5 * 60 * 1e3;
3374
3458
  var MAX_PERMISSION_RETRIES = 3;
3459
+ var MAX_PERMISSION_PROMPTS = 8;
3375
3460
  function permissionKey(resourceType, action, target) {
3376
3461
  return `${resourceType}:${action}:${target}`;
3377
3462
  }
@@ -3407,14 +3492,18 @@ function toDeniedError(error) {
3407
3492
  return { ...error, code: 1002 /* DENIED */ };
3408
3493
  }
3409
3494
  async function withPermissionRetry(send, registry, log, timeoutMs = PERMISSION_DECISION_TIMEOUT_MS) {
3495
+ const asked = /* @__PURE__ */ new Map();
3410
3496
  for (let attempt = 0; ; attempt++) {
3411
3497
  try {
3412
3498
  return await send();
3413
3499
  } catch (error) {
3414
- if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_RETRIES) {
3500
+ if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_PROMPTS) {
3415
3501
  throw error;
3416
3502
  }
3417
3503
  const key = permissionKey(error.resourceType, error.action, error.target);
3504
+ const times = asked.get(key) ?? 0;
3505
+ if (times >= MAX_PERMISSION_RETRIES) throw error;
3506
+ asked.set(key, times + 1);
3418
3507
  log(`Permission prompt required for ${key} \u2014 waiting for user decision`);
3419
3508
  const outcome = await registry.wait(key, timeoutMs);
3420
3509
  if (outcome === "granted") {
@@ -3483,6 +3572,7 @@ var HaexVaultSdk = class {
3483
3572
  this.shell = new ShellAPI(this);
3484
3573
  this.passwords = new PasswordsAPI(this);
3485
3574
  this.contacts = new ContactsAPI(this);
3575
+ this.models = new ModelsAPI(this);
3486
3576
  this.mail = new MailAPI(this);
3487
3577
  this.notifications = new NotificationsAPI(this);
3488
3578
  this.tab = new TabAPI(this);
@@ -4375,7 +4465,10 @@ exports.LOCALSEND_EVENTS = LOCALSEND_EVENTS;
4375
4465
  exports.LocalSendAPI = LocalSendAPI;
4376
4466
  exports.MAIL_COMMANDS = MAIL_COMMANDS;
4377
4467
  exports.MAIL_EVENTS = MAIL_EVENTS;
4468
+ exports.MODEL_COMMANDS = MODEL_COMMANDS;
4469
+ exports.MODEL_JOB_EVENTS = MODEL_JOB_EVENTS;
4378
4470
  exports.MailAPI = MailAPI;
4471
+ exports.ModelsAPI = ModelsAPI;
4379
4472
  exports.NOTIFICATION_COMMANDS = NOTIFICATION_COMMANDS;
4380
4473
  exports.NOTIFICATION_EVENTS = NOTIFICATION_EVENTS;
4381
4474
  exports.NotificationsAPI = NotificationsAPI;