@haex-space/vault-sdk 4.9.0 → 4.10.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.
package/README.md CHANGED
@@ -1164,6 +1164,14 @@ unknown job rejects it with an error.
1164
1164
  `models.startAsync`, `models.onCompleted` and `models.cancelAsync` give you the job's id and its end
1165
1165
  separately. A job has no tools and sees only the input you send.
1166
1166
 
1167
+ The choice of models stays with the user in the host; your extension shows no model picker of its
1168
+ own. To ask before the first job, for example when your extension opens for the first time, call
1169
+ `models.requestAccessAsync({ needs: ["text", "image"], effort: "low" })`: it resolves with the
1170
+ allowed models that fit, or the host asks the user as it would for a job. It rejects with
1171
+ `no_capable_model` when no model of the host fits; offer `models.openSettingsAsync()` then, which
1172
+ opens the host's page of your extension's models. Nothing is sent to a model, and consent for a
1173
+ destination outside the device comes with the first job that sends data.
1174
+
1167
1175
  ### Peers
1168
1176
 
1169
1177
  Channels between frames of your extension on devices of different vaults, for example a multiplayer
@@ -1700,6 +1700,12 @@ interface ExtensionModel {
1700
1700
  /** The highest effort the user allowed. */
1701
1701
  maxEffort: ModelEffort;
1702
1702
  }
1703
+ /** What a job of the extension will need, to ask for a grant before it (holzi spec 055 US9). */
1704
+ interface ModelAccessRequest {
1705
+ needs: ("text" | "image")[];
1706
+ /** The effort the extension wishes for; the user chooses the ceiling. */
1707
+ effort?: ModelEffort;
1708
+ }
1703
1709
  /** An image as Base64, at most 25 MiB raw; at most 8 per job. */
1704
1710
  interface ModelJobImage {
1705
1711
  mimeType: "image/jpeg" | "image/png" | "image/webp";
@@ -1780,13 +1786,25 @@ interface ModelJobCompletion {
1780
1786
  *
1781
1787
  * The user decides at run time: the first job asks which model the extension may use and up to
1782
1788
  * which effort, and before data goes to a destination outside this device it asks for consent.
1783
- * The SDK waits for these answers and starts the job again, like for every other permission.
1789
+ * The SDK waits for these answers and starts the job again, like for every other permission. The
1790
+ * choice stays with the host: {@link requestAccessAsync} asks before the first job, and
1791
+ * {@link openSettingsAsync} leads the user to the host's page of this extension's models.
1784
1792
  */
1785
1793
  declare class ModelsAPI {
1786
1794
  private client;
1787
1795
  constructor(client: HaexVaultSdk);
1788
1796
  /** The models the user allowed to this extension; empty without any. */
1789
1797
  listAsync(): Promise<ExtensionModel[]>;
1798
+ /**
1799
+ * Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
1800
+ * models that fit `needs`. Without one, the host asks the user as it would for a job, and the
1801
+ * SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
1802
+ * fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
1803
+ * for a destination outside this device is asked with the first job that sends data.
1804
+ */
1805
+ requestAccessAsync(request: ModelAccessRequest): Promise<ExtensionModel[]>;
1806
+ /** Opens the host's page of this extension's models, where the user chooses models and effort. */
1807
+ openSettingsAsync(): Promise<void>;
1790
1808
  /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
1791
1809
  startAsync(job: ModelJob): Promise<{
1792
1810
  jobId: string;
@@ -2518,5 +2536,5 @@ declare class HaexVaultSdk {
2518
2536
  private log;
2519
2537
  }
2520
2538
 
2521
- 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 a$, PeersAPI as aD, PermissionsAPI as aG, RemoteStorageAPI as aO, ModelsAPI as ae, NotificationsAPI as ai, PEER_ERROR_KINDS as al, PasswordsAPI as ar, PeerError as au, SpacesAPI as bb, TabAPI as bd, ToolsAPI as bg, WebAPI as bk, canExternalClientSendRequests as bl, isExternalClientConnected as bm, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2522
- 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, MailSearchCriteria as a0, MailSearchResult as a1, MailboxInfo as a2, MessageEnvelope as a3, ModelEffort as a4, ModelJob as a5, ModelJobAttempt as a6, ModelJobCompletion as a7, ModelJobErrorCode as a8, ModelJobFormat as a9, PeerJoined as aA, PeerMessage as aB, PeerVisibility as aC, PendingAuthorization as aE, PendingTransfer as aF, AddBackendRequest as aH, FolderBackendInfo as aI, S3BackendInfo as aJ, S3Config as aK, S3Proposal as aL, S3PublicConfig as aM, SftpProposal as aN, StorageBackendInfo as aP, StorageBackendType as aQ, StorageObjectInfo as aR, UpdateBackendRequest as aS, WebDavProposal as aT, RequestedExtension as aU, SelectFileOptions as aV, SelectFolderOptions as aW, ServerInfo as aX, ServerStatus as aY, SessionAuthorization as aZ, SharedSpace as a_, ModelJobImage as aa, ModelJobProvenance as ab, ModelJobStep as ac, ModelPlace as ad, NotificationAction as af, NotificationClickEvent as ag, NotificationOptions as ah, OutgoingAttachment as aj, OutgoingMessage as ak, PasswordInput as am, PasswordItemFull as an, PasswordItemSummary as ao, PasswordKeyValue as ap, PasswordKeyValueInput as aq, PeerChannelClosed as as, PeerChannelOpened as at, PeerErrorKind as av, PeerErrorReason as aw, PeerEventMap as ax, PeerEventType as ay, PeerInviteStatus as az, ContactDetail as b, ShellCreateOptions as b0, ShellCreateResponse as b1, ShellExitEvent as b2, ShellOutputEvent as b3, SmtpConfig as b4, SpaceAccessTokenInfo as b5, SpaceAssignment as b6, SpaceInvite as b7, SpaceKeyGrantInfo as b8, SpaceMember as b9, SpaceMemberInfo as ba, SyncBackendInfo as bc, ToolContext as be, ToolHandler as bf, TransferDirection as bh, TransferProgress as bi, TransferState as bj, 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 };
2539
+ 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, PeersAPI as aE, PermissionsAPI as aH, RemoteStorageAPI as aP, ModelsAPI as af, NotificationsAPI as aj, PEER_ERROR_KINDS as am, PasswordsAPI as as, PeerError as av, ShellAPI as b0, SpacesAPI as bc, TabAPI as be, ToolsAPI as bh, WebAPI as bl, canExternalClientSendRequests as bm, isExternalClientConnected as bn, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2540
+ 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, SharedSpace as a$, MailSearchCriteria as a0, MailSearchResult as a1, MailboxInfo as a2, MessageEnvelope as a3, ModelAccessRequest as a4, ModelEffort as a5, ModelJob as a6, ModelJobAttempt as a7, ModelJobCompletion as a8, ModelJobErrorCode as a9, PeerInviteStatus as aA, PeerJoined as aB, PeerMessage as aC, PeerVisibility as aD, PendingAuthorization as aF, PendingTransfer as aG, AddBackendRequest as aI, FolderBackendInfo as aJ, S3BackendInfo as aK, S3Config as aL, S3Proposal as aM, S3PublicConfig as aN, SftpProposal as aO, StorageBackendInfo as aQ, StorageBackendType as aR, StorageObjectInfo as aS, UpdateBackendRequest as aT, WebDavProposal as aU, RequestedExtension as aV, SelectFileOptions as aW, SelectFolderOptions as aX, ServerInfo as aY, ServerStatus as aZ, SessionAuthorization as a_, ModelJobFormat as aa, ModelJobImage as ab, ModelJobProvenance as ac, ModelJobStep as ad, ModelPlace as ae, NotificationAction as ag, NotificationClickEvent as ah, NotificationOptions as ai, OutgoingAttachment as ak, OutgoingMessage as al, PasswordInput as an, PasswordItemFull as ao, PasswordItemSummary as ap, PasswordKeyValue as aq, PasswordKeyValueInput as ar, PeerChannelClosed as at, PeerChannelOpened as au, PeerErrorKind as aw, PeerErrorReason as ax, PeerEventMap as ay, PeerEventType as az, ContactDetail as b, ShellCreateOptions as b1, ShellCreateResponse as b2, ShellExitEvent as b3, ShellOutputEvent as b4, SmtpConfig as b5, SpaceAccessTokenInfo as b6, SpaceAssignment as b7, SpaceInvite as b8, SpaceKeyGrantInfo as b9, SpaceMember as ba, SpaceMemberInfo as bb, SyncBackendInfo as bd, ToolContext as bf, ToolHandler as bg, TransferDirection as bi, TransferProgress as bj, TransferState as bk, 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 };
@@ -1700,6 +1700,12 @@ interface ExtensionModel {
1700
1700
  /** The highest effort the user allowed. */
1701
1701
  maxEffort: ModelEffort;
1702
1702
  }
1703
+ /** What a job of the extension will need, to ask for a grant before it (holzi spec 055 US9). */
1704
+ interface ModelAccessRequest {
1705
+ needs: ("text" | "image")[];
1706
+ /** The effort the extension wishes for; the user chooses the ceiling. */
1707
+ effort?: ModelEffort;
1708
+ }
1703
1709
  /** An image as Base64, at most 25 MiB raw; at most 8 per job. */
1704
1710
  interface ModelJobImage {
1705
1711
  mimeType: "image/jpeg" | "image/png" | "image/webp";
@@ -1780,13 +1786,25 @@ interface ModelJobCompletion {
1780
1786
  *
1781
1787
  * The user decides at run time: the first job asks which model the extension may use and up to
1782
1788
  * which effort, and before data goes to a destination outside this device it asks for consent.
1783
- * The SDK waits for these answers and starts the job again, like for every other permission.
1789
+ * The SDK waits for these answers and starts the job again, like for every other permission. The
1790
+ * choice stays with the host: {@link requestAccessAsync} asks before the first job, and
1791
+ * {@link openSettingsAsync} leads the user to the host's page of this extension's models.
1784
1792
  */
1785
1793
  declare class ModelsAPI {
1786
1794
  private client;
1787
1795
  constructor(client: HaexVaultSdk);
1788
1796
  /** The models the user allowed to this extension; empty without any. */
1789
1797
  listAsync(): Promise<ExtensionModel[]>;
1798
+ /**
1799
+ * Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
1800
+ * models that fit `needs`. Without one, the host asks the user as it would for a job, and the
1801
+ * SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
1802
+ * fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
1803
+ * for a destination outside this device is asked with the first job that sends data.
1804
+ */
1805
+ requestAccessAsync(request: ModelAccessRequest): Promise<ExtensionModel[]>;
1806
+ /** Opens the host's page of this extension's models, where the user chooses models and effort. */
1807
+ openSettingsAsync(): Promise<void>;
1790
1808
  /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
1791
1809
  startAsync(job: ModelJob): Promise<{
1792
1810
  jobId: string;
@@ -2518,5 +2536,5 @@ declare class HaexVaultSdk {
2518
2536
  private log;
2519
2537
  }
2520
2538
 
2521
- 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 a$, PeersAPI as aD, PermissionsAPI as aG, RemoteStorageAPI as aO, ModelsAPI as ae, NotificationsAPI as ai, PEER_ERROR_KINDS as al, PasswordsAPI as ar, PeerError as au, SpacesAPI as bb, TabAPI as bd, ToolsAPI as bg, WebAPI as bk, canExternalClientSendRequests as bl, isExternalClientConnected as bm, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2522
- 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, MailSearchCriteria as a0, MailSearchResult as a1, MailboxInfo as a2, MessageEnvelope as a3, ModelEffort as a4, ModelJob as a5, ModelJobAttempt as a6, ModelJobCompletion as a7, ModelJobErrorCode as a8, ModelJobFormat as a9, PeerJoined as aA, PeerMessage as aB, PeerVisibility as aC, PendingAuthorization as aE, PendingTransfer as aF, AddBackendRequest as aH, FolderBackendInfo as aI, S3BackendInfo as aJ, S3Config as aK, S3Proposal as aL, S3PublicConfig as aM, SftpProposal as aN, StorageBackendInfo as aP, StorageBackendType as aQ, StorageObjectInfo as aR, UpdateBackendRequest as aS, WebDavProposal as aT, RequestedExtension as aU, SelectFileOptions as aV, SelectFolderOptions as aW, ServerInfo as aX, ServerStatus as aY, SessionAuthorization as aZ, SharedSpace as a_, ModelJobImage as aa, ModelJobProvenance as ab, ModelJobStep as ac, ModelPlace as ad, NotificationAction as af, NotificationClickEvent as ag, NotificationOptions as ah, OutgoingAttachment as aj, OutgoingMessage as ak, PasswordInput as am, PasswordItemFull as an, PasswordItemSummary as ao, PasswordKeyValue as ap, PasswordKeyValueInput as aq, PeerChannelClosed as as, PeerChannelOpened as at, PeerErrorKind as av, PeerErrorReason as aw, PeerEventMap as ax, PeerEventType as ay, PeerInviteStatus as az, ContactDetail as b, ShellCreateOptions as b0, ShellCreateResponse as b1, ShellExitEvent as b2, ShellOutputEvent as b3, SmtpConfig as b4, SpaceAccessTokenInfo as b5, SpaceAssignment as b6, SpaceInvite as b7, SpaceKeyGrantInfo as b8, SpaceMember as b9, SpaceMemberInfo as ba, SyncBackendInfo as bc, ToolContext as be, ToolHandler as bf, TransferDirection as bh, TransferProgress as bi, TransferState as bj, 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 };
2539
+ 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, PeersAPI as aE, PermissionsAPI as aH, RemoteStorageAPI as aP, ModelsAPI as af, NotificationsAPI as aj, PEER_ERROR_KINDS as am, PasswordsAPI as as, PeerError as av, ShellAPI as b0, SpacesAPI as bc, TabAPI as be, ToolsAPI as bh, WebAPI as bl, canExternalClientSendRequests as bm, isExternalClientConnected as bn, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2540
+ 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, SharedSpace as a$, MailSearchCriteria as a0, MailSearchResult as a1, MailboxInfo as a2, MessageEnvelope as a3, ModelAccessRequest as a4, ModelEffort as a5, ModelJob as a6, ModelJobAttempt as a7, ModelJobCompletion as a8, ModelJobErrorCode as a9, PeerInviteStatus as aA, PeerJoined as aB, PeerMessage as aC, PeerVisibility as aD, PendingAuthorization as aF, PendingTransfer as aG, AddBackendRequest as aI, FolderBackendInfo as aJ, S3BackendInfo as aK, S3Config as aL, S3Proposal as aM, S3PublicConfig as aN, SftpProposal as aO, StorageBackendInfo as aQ, StorageBackendType as aR, StorageObjectInfo as aS, UpdateBackendRequest as aT, WebDavProposal as aU, RequestedExtension as aV, SelectFileOptions as aW, SelectFolderOptions as aX, ServerInfo as aY, ServerStatus as aZ, SessionAuthorization as a_, ModelJobFormat as aa, ModelJobImage as ab, ModelJobProvenance as ac, ModelJobStep as ad, ModelPlace as ae, NotificationAction as ag, NotificationClickEvent as ah, NotificationOptions as ai, OutgoingAttachment as ak, OutgoingMessage as al, PasswordInput as an, PasswordItemFull as ao, PasswordItemSummary as ap, PasswordKeyValue as aq, PasswordKeyValueInput as ar, PeerChannelClosed as at, PeerChannelOpened as au, PeerErrorKind as aw, PeerErrorReason as ax, PeerEventMap as ay, PeerEventType as az, ContactDetail as b, ShellCreateOptions as b1, ShellCreateResponse as b2, ShellExitEvent as b3, ShellOutputEvent as b4, SmtpConfig as b5, SpaceAccessTokenInfo as b6, SpaceAssignment as b7, SpaceInvite as b8, SpaceKeyGrantInfo as b9, SpaceMember as ba, SpaceMemberInfo as bb, SyncBackendInfo as bd, ToolContext as bf, ToolHandler as bg, TransferDirection as bi, TransferProgress as bj, TransferState as bk, 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 };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-CS0AdXto.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 MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelEffort, a5 as ModelJob, a6 as ModelJobAttempt, a7 as ModelJobCompletion, a8 as ModelJobErrorCode, a9 as ModelJobFormat, aa as ModelJobImage, ab as ModelJobProvenance, ac as ModelJobStep, ad as ModelPlace, ae as ModelsAPI, af as NotificationAction, ag as NotificationClickEvent, ah as NotificationOptions, ai as NotificationsAPI, aj as OutgoingAttachment, ak as OutgoingMessage, al as PEER_ERROR_KINDS, am as PasswordInput, an as PasswordItemFull, ao as PasswordItemSummary, ap as PasswordKeyValue, aq as PasswordKeyValueInput, ar as PasswordsAPI, as as PeerChannelClosed, at as PeerChannelOpened, au as PeerError, av as PeerErrorKind, aw as PeerErrorReason, ax as PeerEventMap, ay as PeerEventType, az as PeerInviteStatus, aA as PeerJoined, aB as PeerMessage, aC as PeerVisibility, aD as PeersAPI, aE as PendingAuthorization, aF as PendingTransfer, aG as PermissionsAPI, aH as RemoteAddBackendRequest, aI as RemoteFolderBackendInfo, aJ as RemoteS3BackendInfo, aK as RemoteS3Config, aL as RemoteS3Proposal, aM as RemoteS3PublicConfig, aN as RemoteSftpProposal, aO as RemoteStorageAPI, aP as RemoteStorageBackendInfo, aQ as RemoteStorageBackendType, aR as RemoteStorageObjectInfo, aS as RemoteUpdateBackendRequest, aT as RemoteWebDavProposal, aU as RequestedExtension, aV as SelectFileOptions, aW as SelectFolderOptions, aX as ServerInfo, aY as ServerStatus, aZ as SessionAuthorization, a_ as SharedSpace, a$ as ShellAPI, b0 as ShellCreateOptions, b1 as ShellCreateResponse, b2 as ShellExitEvent, b3 as ShellOutputEvent, b4 as SmtpConfig, b5 as SpaceAccessTokenInfo, b6 as SpaceAssignment, b7 as SpaceInvite, b8 as SpaceKeyGrantInfo, b9 as SpaceMember, ba as SpaceMemberInfo, bb as SpacesAPI, bc as SyncBackendInfo, bd as TabAPI, be as ToolContext, bf as ToolHandler, bg as ToolsAPI, bh as TransferDirection, bi as TransferProgress, bj as TransferState, bk as WebAPI, bl as canExternalClientSendRequests, bm as isExternalClientConnected } from './client-CS0AdXto.mjs';
1
+ import { H as HaexVaultSdk } from './client-DTxLSJrk.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 MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelAccessRequest, a5 as ModelEffort, a6 as ModelJob, a7 as ModelJobAttempt, a8 as ModelJobCompletion, a9 as ModelJobErrorCode, aa as ModelJobFormat, ab as ModelJobImage, ac as ModelJobProvenance, ad as ModelJobStep, ae as ModelPlace, af as ModelsAPI, ag as NotificationAction, ah as NotificationClickEvent, ai as NotificationOptions, aj as NotificationsAPI, ak as OutgoingAttachment, al as OutgoingMessage, am as PEER_ERROR_KINDS, an as PasswordInput, ao as PasswordItemFull, ap as PasswordItemSummary, aq as PasswordKeyValue, ar as PasswordKeyValueInput, as as PasswordsAPI, at as PeerChannelClosed, au as PeerChannelOpened, av as PeerError, aw as PeerErrorKind, ax as PeerErrorReason, ay as PeerEventMap, az as PeerEventType, aA as PeerInviteStatus, aB as PeerJoined, aC as PeerMessage, aD as PeerVisibility, aE as PeersAPI, aF as PendingAuthorization, aG as PendingTransfer, aH as PermissionsAPI, aI as RemoteAddBackendRequest, aJ as RemoteFolderBackendInfo, aK as RemoteS3BackendInfo, aL as RemoteS3Config, aM as RemoteS3Proposal, aN as RemoteS3PublicConfig, aO as RemoteSftpProposal, aP as RemoteStorageAPI, aQ as RemoteStorageBackendInfo, aR as RemoteStorageBackendType, aS as RemoteStorageObjectInfo, aT as RemoteUpdateBackendRequest, aU as RemoteWebDavProposal, aV as RequestedExtension, aW as SelectFileOptions, aX as SelectFolderOptions, aY as ServerInfo, aZ as ServerStatus, a_ as SessionAuthorization, a$ as SharedSpace, b0 as ShellAPI, b1 as ShellCreateOptions, b2 as ShellCreateResponse, b3 as ShellExitEvent, b4 as ShellOutputEvent, b5 as SmtpConfig, b6 as SpaceAccessTokenInfo, b7 as SpaceAssignment, b8 as SpaceInvite, b9 as SpaceKeyGrantInfo, ba as SpaceMember, bb as SpaceMemberInfo, bc as SpacesAPI, bd as SyncBackendInfo, be as TabAPI, bf as ToolContext, bg as ToolHandler, bh as ToolsAPI, bi as TransferDirection, bj as TransferProgress, bk as TransferState, bl as WebAPI, bm as canExternalClientSendRequests, bn as isExternalClientConnected } from './client-DTxLSJrk.mjs';
3
3
  import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BZVkX0Wf.mjs';
4
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 PEERS_EVENTS, X as PeersEvent, Y as PermissionDeniedError, Z as PermissionErrorBase, _ as PermissionErrorCode, $ as PermissionPromptError, P as PermissionResponse, a0 as PermissionStatus, R as RequestOptions, a1 as SHELL_EVENTS, a2 as SearchQuery, a3 as SearchRequestEvent, S as SearchResult, a4 as ShellEvent, a5 as SyncTablesUpdatedEvent, a6 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a7 as getTableName, a8 as isPermissionDeniedError, a9 as isPermissionError, aa as isPermissionPromptError } from './types-BZVkX0Wf.mjs';
5
5
  export { H as HaextensionConfig } from './config-P_6DqTHl.mjs';
@@ -166,6 +166,10 @@ declare const MODEL_COMMANDS: {
166
166
  readonly start: "extension_model_job_start";
167
167
  /** Cancels a running job of this frame */
168
168
  readonly cancel: "extension_model_job_cancel";
169
+ /** Asks for a grant before the first job; nothing goes to a model */
170
+ readonly requestAccess: "extension_model_access_request";
171
+ /** Opens the host's page of this extension's models */
172
+ readonly openSettings: "extension_model_settings_open";
169
173
  };
170
174
  type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
171
175
 
@@ -926,6 +930,8 @@ declare const TAURI_COMMANDS: {
926
930
  readonly list: "extension_model_list";
927
931
  readonly start: "extension_model_job_start";
928
932
  readonly cancel: "extension_model_job_cancel";
933
+ readonly requestAccess: "extension_model_access_request";
934
+ readonly openSettings: "extension_model_settings_open";
929
935
  };
930
936
  readonly peers: {
931
937
  readonly invite: "extension_peers_invite";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-BzgCo_Ch.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 MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelEffort, a5 as ModelJob, a6 as ModelJobAttempt, a7 as ModelJobCompletion, a8 as ModelJobErrorCode, a9 as ModelJobFormat, aa as ModelJobImage, ab as ModelJobProvenance, ac as ModelJobStep, ad as ModelPlace, ae as ModelsAPI, af as NotificationAction, ag as NotificationClickEvent, ah as NotificationOptions, ai as NotificationsAPI, aj as OutgoingAttachment, ak as OutgoingMessage, al as PEER_ERROR_KINDS, am as PasswordInput, an as PasswordItemFull, ao as PasswordItemSummary, ap as PasswordKeyValue, aq as PasswordKeyValueInput, ar as PasswordsAPI, as as PeerChannelClosed, at as PeerChannelOpened, au as PeerError, av as PeerErrorKind, aw as PeerErrorReason, ax as PeerEventMap, ay as PeerEventType, az as PeerInviteStatus, aA as PeerJoined, aB as PeerMessage, aC as PeerVisibility, aD as PeersAPI, aE as PendingAuthorization, aF as PendingTransfer, aG as PermissionsAPI, aH as RemoteAddBackendRequest, aI as RemoteFolderBackendInfo, aJ as RemoteS3BackendInfo, aK as RemoteS3Config, aL as RemoteS3Proposal, aM as RemoteS3PublicConfig, aN as RemoteSftpProposal, aO as RemoteStorageAPI, aP as RemoteStorageBackendInfo, aQ as RemoteStorageBackendType, aR as RemoteStorageObjectInfo, aS as RemoteUpdateBackendRequest, aT as RemoteWebDavProposal, aU as RequestedExtension, aV as SelectFileOptions, aW as SelectFolderOptions, aX as ServerInfo, aY as ServerStatus, aZ as SessionAuthorization, a_ as SharedSpace, a$ as ShellAPI, b0 as ShellCreateOptions, b1 as ShellCreateResponse, b2 as ShellExitEvent, b3 as ShellOutputEvent, b4 as SmtpConfig, b5 as SpaceAccessTokenInfo, b6 as SpaceAssignment, b7 as SpaceInvite, b8 as SpaceKeyGrantInfo, b9 as SpaceMember, ba as SpaceMemberInfo, bb as SpacesAPI, bc as SyncBackendInfo, bd as TabAPI, be as ToolContext, bf as ToolHandler, bg as ToolsAPI, bh as TransferDirection, bi as TransferProgress, bj as TransferState, bk as WebAPI, bl as canExternalClientSendRequests, bm as isExternalClientConnected } from './client-BzgCo_Ch.js';
1
+ import { H as HaexVaultSdk } from './client-s0eCQoWA.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 MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelAccessRequest, a5 as ModelEffort, a6 as ModelJob, a7 as ModelJobAttempt, a8 as ModelJobCompletion, a9 as ModelJobErrorCode, aa as ModelJobFormat, ab as ModelJobImage, ac as ModelJobProvenance, ad as ModelJobStep, ae as ModelPlace, af as ModelsAPI, ag as NotificationAction, ah as NotificationClickEvent, ai as NotificationOptions, aj as NotificationsAPI, ak as OutgoingAttachment, al as OutgoingMessage, am as PEER_ERROR_KINDS, an as PasswordInput, ao as PasswordItemFull, ap as PasswordItemSummary, aq as PasswordKeyValue, ar as PasswordKeyValueInput, as as PasswordsAPI, at as PeerChannelClosed, au as PeerChannelOpened, av as PeerError, aw as PeerErrorKind, ax as PeerErrorReason, ay as PeerEventMap, az as PeerEventType, aA as PeerInviteStatus, aB as PeerJoined, aC as PeerMessage, aD as PeerVisibility, aE as PeersAPI, aF as PendingAuthorization, aG as PendingTransfer, aH as PermissionsAPI, aI as RemoteAddBackendRequest, aJ as RemoteFolderBackendInfo, aK as RemoteS3BackendInfo, aL as RemoteS3Config, aM as RemoteS3Proposal, aN as RemoteS3PublicConfig, aO as RemoteSftpProposal, aP as RemoteStorageAPI, aQ as RemoteStorageBackendInfo, aR as RemoteStorageBackendType, aS as RemoteStorageObjectInfo, aT as RemoteUpdateBackendRequest, aU as RemoteWebDavProposal, aV as RequestedExtension, aW as SelectFileOptions, aX as SelectFolderOptions, aY as ServerInfo, aZ as ServerStatus, a_ as SessionAuthorization, a$ as SharedSpace, b0 as ShellAPI, b1 as ShellCreateOptions, b2 as ShellCreateResponse, b3 as ShellExitEvent, b4 as ShellOutputEvent, b5 as SmtpConfig, b6 as SpaceAccessTokenInfo, b7 as SpaceAssignment, b8 as SpaceInvite, b9 as SpaceKeyGrantInfo, ba as SpaceMember, bb as SpaceMemberInfo, bc as SpacesAPI, bd as SyncBackendInfo, be as TabAPI, bf as ToolContext, bg as ToolHandler, bh as ToolsAPI, bi as TransferDirection, bj as TransferProgress, bk as TransferState, bl as WebAPI, bm as canExternalClientSendRequests, bn as isExternalClientConnected } from './client-s0eCQoWA.js';
3
3
  import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BZVkX0Wf.js';
4
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 PEERS_EVENTS, X as PeersEvent, Y as PermissionDeniedError, Z as PermissionErrorBase, _ as PermissionErrorCode, $ as PermissionPromptError, P as PermissionResponse, a0 as PermissionStatus, R as RequestOptions, a1 as SHELL_EVENTS, a2 as SearchQuery, a3 as SearchRequestEvent, S as SearchResult, a4 as ShellEvent, a5 as SyncTablesUpdatedEvent, a6 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a7 as getTableName, a8 as isPermissionDeniedError, a9 as isPermissionError, aa as isPermissionPromptError } from './types-BZVkX0Wf.js';
5
5
  export { H as HaextensionConfig } from './config-P_6DqTHl.js';
@@ -166,6 +166,10 @@ declare const MODEL_COMMANDS: {
166
166
  readonly start: "extension_model_job_start";
167
167
  /** Cancels a running job of this frame */
168
168
  readonly cancel: "extension_model_job_cancel";
169
+ /** Asks for a grant before the first job; nothing goes to a model */
170
+ readonly requestAccess: "extension_model_access_request";
171
+ /** Opens the host's page of this extension's models */
172
+ readonly openSettings: "extension_model_settings_open";
169
173
  };
170
174
  type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
171
175
 
@@ -926,6 +930,8 @@ declare const TAURI_COMMANDS: {
926
930
  readonly list: "extension_model_list";
927
931
  readonly start: "extension_model_job_start";
928
932
  readonly cancel: "extension_model_job_cancel";
933
+ readonly requestAccess: "extension_model_access_request";
934
+ readonly openSettings: "extension_model_settings_open";
929
935
  };
930
936
  readonly peers: {
931
937
  readonly invite: "extension_peers_invite";
package/dist/index.js CHANGED
@@ -1217,7 +1217,11 @@ var MODEL_COMMANDS = {
1217
1217
  /** Starts a job; the result follows as an event */
1218
1218
  start: "extension_model_job_start",
1219
1219
  /** Cancels a running job of this frame */
1220
- cancel: "extension_model_job_cancel"
1220
+ cancel: "extension_model_job_cancel",
1221
+ /** Asks for a grant before the first job; nothing goes to a model */
1222
+ requestAccess: "extension_model_access_request",
1223
+ /** Opens the host's page of this extension's models */
1224
+ openSettings: "extension_model_settings_open"
1221
1225
  };
1222
1226
 
1223
1227
  // src/commands/peers.ts
@@ -2495,6 +2499,24 @@ var ModelsAPI = class {
2495
2499
  );
2496
2500
  return answer.models;
2497
2501
  }
2502
+ /**
2503
+ * Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
2504
+ * models that fit `needs`. Without one, the host asks the user as it would for a job, and the
2505
+ * SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
2506
+ * fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
2507
+ * for a destination outside this device is asked with the first job that sends data.
2508
+ */
2509
+ async requestAccessAsync(request) {
2510
+ const answer = await this.client.request(
2511
+ MODEL_COMMANDS.requestAccess,
2512
+ { ...request }
2513
+ );
2514
+ return answer.models;
2515
+ }
2516
+ /** Opens the host's page of this extension's models, where the user chooses models and effort. */
2517
+ async openSettingsAsync() {
2518
+ await this.client.request(MODEL_COMMANDS.openSettings, {});
2519
+ }
2498
2520
  /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
2499
2521
  async startAsync(job) {
2500
2522
  const answer = await this.client.request(MODEL_COMMANDS.start, {