@haex-space/vault-sdk 4.9.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1125,7 +1125,8 @@ bundle. A damaged entry fails with `HostErrorCode.ENCRYPTED_DATA_DAMAGED` (3010)
1125
1125
  Jobs on the host's language and vision models, instead of bringing your own access and keys. You
1126
1126
  describe each step with its instruction, its input (text, images, or a part of an earlier step's
1127
1127
  result) and the format of its answer as a JSON Schema; the host picks a model the user allowed for
1128
- your extension, caps the effort and returns only a result that fits the format. Broken output (empty,
1128
+ your extension, runs it with the effort the user chose for that model and returns only a result that
1129
+ fits the format. Broken output (empty,
1129
1130
  a loop, a script switch, invalid JSON) is dropped, and the host tries the next allowed model.
1130
1131
 
1131
1132
  ```ts
@@ -1145,7 +1146,6 @@ const end = await client.models.runAsync({
1145
1146
  properties: { text: { type: "string" } },
1146
1147
  },
1147
1148
  },
1148
- effort: "low",
1149
1149
  },
1150
1150
  ],
1151
1151
  });
@@ -1153,7 +1153,8 @@ if (end.status === "completed") console.log(end.result?.final, end.provenance);
1153
1153
  else console.warn(end.error?.code, end.error?.message);
1154
1154
  ```
1155
1155
 
1156
- The user decides at run time which model your extension may use and up to which effort, and gives
1156
+ The user decides at run time which model your extension may use and with which effort (from the
1157
+ levels the model has; your extension names none, and the host refuses a step that does), and gives
1157
1158
  consent before anything goes to a destination outside the device; the SDK waits for these answers
1158
1159
  and starts the job again. `models.listAsync()` names the allowed models with their place and
1159
1160
  capabilities, never an address or a key. To let the user stop a job, pass a signal:
@@ -1164,6 +1165,14 @@ unknown job rejects it with an error.
1164
1165
  `models.startAsync`, `models.onCompleted` and `models.cancelAsync` give you the job's id and its end
1165
1166
  separately. A job has no tools and sees only the input you send.
1166
1167
 
1168
+ The choice of models stays with the user in the host; your extension shows no model picker of its
1169
+ own. To ask before the first job, for example when your extension opens for the first time, call
1170
+ `models.requestAccessAsync({ needs: ["text", "image"] })`: it resolves with the
1171
+ allowed models that fit, or the host asks the user as it would for a job. It rejects with
1172
+ `no_capable_model` when no model of the host fits; offer `models.openSettingsAsync()` then, which
1173
+ opens the host's page of your extension's models. Nothing is sent to a model, and consent for a
1174
+ destination outside the device comes with the first job that sends data.
1175
+
1167
1176
  ### Peers
1168
1177
 
1169
1178
  Channels between frames of your extension on devices of different vaults, for example a multiplayer
@@ -1682,8 +1682,12 @@ declare class ContactsAPI {
1682
1682
  */
1683
1683
  /** Where a model runs. Outside this device the user consents before anything is sent. */
1684
1684
  type ModelPlace = "this_device" | "network" | "cloud";
1685
- /** The effort a step wishes for; the host caps it at what the user allowed. */
1686
- type ModelEffort = "none" | "low" | "medium" | "high";
1685
+ /**
1686
+ * The effort a model runs with. The user chooses it per model in the host, from the levels the model
1687
+ * has; an extension names none and the host refuses a step that does. The provenance names the one
1688
+ * that was used.
1689
+ */
1690
+ type ModelEffort = "none" | "low" | "medium" | "high" | "xhigh" | "max";
1687
1691
  /** A model the user allowed to this extension. */
1688
1692
  interface ExtensionModel {
1689
1693
  /** The host's model id, only to show and recognise it. */
@@ -1694,12 +1698,16 @@ interface ExtensionModel {
1694
1698
  place: ModelPlace;
1695
1699
  capabilities: {
1696
1700
  image: boolean;
1697
- /** `levels`: low, medium and high take effect; `managed`: the model decides itself. */
1701
+ /** `none`: no choice; `managed`: the model decides; `levels`: the model offers named levels. */
1698
1702
  effort: "none" | "managed" | "levels";
1699
1703
  };
1700
- /** The highest effort the user allowed. */
1704
+ /** The effort the user chose for this model (the name is from an earlier version). */
1701
1705
  maxEffort: ModelEffort;
1702
1706
  }
1707
+ /** What a job of the extension will need, to ask for a grant before it (holzi spec 055 US9). */
1708
+ interface ModelAccessRequest {
1709
+ needs: ("text" | "image")[];
1710
+ }
1703
1711
  /** An image as Base64, at most 25 MiB raw; at most 8 per job. */
1704
1712
  interface ModelJobImage {
1705
1713
  mimeType: "image/jpeg" | "image/png" | "image/webp";
@@ -1728,7 +1736,6 @@ interface ModelJobStep {
1728
1736
  };
1729
1737
  };
1730
1738
  format: ModelJobFormat;
1731
- effort?: ModelEffort;
1732
1739
  /** Up to the host's limit (default 4096, at most 16384). */
1733
1740
  maxOutputTokens?: number;
1734
1741
  }
@@ -1775,18 +1782,31 @@ interface ModelJobCompletion {
1775
1782
  /**
1776
1783
  * Jobs on the host's language and vision models (holzi spec 055), instead of bringing own access
1777
1784
  * and keys. The extension describes each step with its instruction, input and the format of the
1778
- * answer; the host picks a model the user allowed for this extension, caps the effort, drops
1779
- * broken output and returns only a result that fits the format.
1785
+ * answer; the host picks a model the user allowed for this extension, runs it with the effort the
1786
+ * user chose for it (an extension names none), drops broken output and returns only a result that
1787
+ * fits the format.
1780
1788
  *
1781
- * The user decides at run time: the first job asks which model the extension may use and up to
1789
+ * The user decides at run time: the first job asks which model the extension may use and with
1782
1790
  * 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.
1791
+ * The SDK waits for these answers and starts the job again, like for every other permission. The
1792
+ * choice stays with the host: {@link requestAccessAsync} asks before the first job, and
1793
+ * {@link openSettingsAsync} leads the user to the host's page of this extension's models.
1784
1794
  */
1785
1795
  declare class ModelsAPI {
1786
1796
  private client;
1787
1797
  constructor(client: HaexVaultSdk);
1788
1798
  /** The models the user allowed to this extension; empty without any. */
1789
1799
  listAsync(): Promise<ExtensionModel[]>;
1800
+ /**
1801
+ * Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
1802
+ * models that fit `needs`. Without one, the host asks the user as it would for a job, and the
1803
+ * SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
1804
+ * fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
1805
+ * for a destination outside this device is asked with the first job that sends data.
1806
+ */
1807
+ requestAccessAsync(request: ModelAccessRequest): Promise<ExtensionModel[]>;
1808
+ /** Opens the host's page of this extension's models, where the user chooses models and effort. */
1809
+ openSettingsAsync(): Promise<void>;
1790
1810
  /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
1791
1811
  startAsync(job: ModelJob): Promise<{
1792
1812
  jobId: string;
@@ -2518,5 +2538,5 @@ declare class HaexVaultSdk {
2518
2538
  private log;
2519
2539
  }
2520
2540
 
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 };
2541
+ 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 };
2542
+ 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 };
@@ -1682,8 +1682,12 @@ declare class ContactsAPI {
1682
1682
  */
1683
1683
  /** Where a model runs. Outside this device the user consents before anything is sent. */
1684
1684
  type ModelPlace = "this_device" | "network" | "cloud";
1685
- /** The effort a step wishes for; the host caps it at what the user allowed. */
1686
- type ModelEffort = "none" | "low" | "medium" | "high";
1685
+ /**
1686
+ * The effort a model runs with. The user chooses it per model in the host, from the levels the model
1687
+ * has; an extension names none and the host refuses a step that does. The provenance names the one
1688
+ * that was used.
1689
+ */
1690
+ type ModelEffort = "none" | "low" | "medium" | "high" | "xhigh" | "max";
1687
1691
  /** A model the user allowed to this extension. */
1688
1692
  interface ExtensionModel {
1689
1693
  /** The host's model id, only to show and recognise it. */
@@ -1694,12 +1698,16 @@ interface ExtensionModel {
1694
1698
  place: ModelPlace;
1695
1699
  capabilities: {
1696
1700
  image: boolean;
1697
- /** `levels`: low, medium and high take effect; `managed`: the model decides itself. */
1701
+ /** `none`: no choice; `managed`: the model decides; `levels`: the model offers named levels. */
1698
1702
  effort: "none" | "managed" | "levels";
1699
1703
  };
1700
- /** The highest effort the user allowed. */
1704
+ /** The effort the user chose for this model (the name is from an earlier version). */
1701
1705
  maxEffort: ModelEffort;
1702
1706
  }
1707
+ /** What a job of the extension will need, to ask for a grant before it (holzi spec 055 US9). */
1708
+ interface ModelAccessRequest {
1709
+ needs: ("text" | "image")[];
1710
+ }
1703
1711
  /** An image as Base64, at most 25 MiB raw; at most 8 per job. */
1704
1712
  interface ModelJobImage {
1705
1713
  mimeType: "image/jpeg" | "image/png" | "image/webp";
@@ -1728,7 +1736,6 @@ interface ModelJobStep {
1728
1736
  };
1729
1737
  };
1730
1738
  format: ModelJobFormat;
1731
- effort?: ModelEffort;
1732
1739
  /** Up to the host's limit (default 4096, at most 16384). */
1733
1740
  maxOutputTokens?: number;
1734
1741
  }
@@ -1775,18 +1782,31 @@ interface ModelJobCompletion {
1775
1782
  /**
1776
1783
  * Jobs on the host's language and vision models (holzi spec 055), instead of bringing own access
1777
1784
  * and keys. The extension describes each step with its instruction, input and the format of the
1778
- * answer; the host picks a model the user allowed for this extension, caps the effort, drops
1779
- * broken output and returns only a result that fits the format.
1785
+ * answer; the host picks a model the user allowed for this extension, runs it with the effort the
1786
+ * user chose for it (an extension names none), drops broken output and returns only a result that
1787
+ * fits the format.
1780
1788
  *
1781
- * The user decides at run time: the first job asks which model the extension may use and up to
1789
+ * The user decides at run time: the first job asks which model the extension may use and with
1782
1790
  * 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.
1791
+ * The SDK waits for these answers and starts the job again, like for every other permission. The
1792
+ * choice stays with the host: {@link requestAccessAsync} asks before the first job, and
1793
+ * {@link openSettingsAsync} leads the user to the host's page of this extension's models.
1784
1794
  */
1785
1795
  declare class ModelsAPI {
1786
1796
  private client;
1787
1797
  constructor(client: HaexVaultSdk);
1788
1798
  /** The models the user allowed to this extension; empty without any. */
1789
1799
  listAsync(): Promise<ExtensionModel[]>;
1800
+ /**
1801
+ * Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
1802
+ * models that fit `needs`. Without one, the host asks the user as it would for a job, and the
1803
+ * SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
1804
+ * fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
1805
+ * for a destination outside this device is asked with the first job that sends data.
1806
+ */
1807
+ requestAccessAsync(request: ModelAccessRequest): Promise<ExtensionModel[]>;
1808
+ /** Opens the host's page of this extension's models, where the user chooses models and effort. */
1809
+ openSettingsAsync(): Promise<void>;
1790
1810
  /** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
1791
1811
  startAsync(job: ModelJob): Promise<{
1792
1812
  jobId: string;
@@ -2518,5 +2538,5 @@ declare class HaexVaultSdk {
2518
2538
  private log;
2519
2539
  }
2520
2540
 
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 };
2541
+ 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 };
2542
+ 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-DXHXxcgw.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-DXHXxcgw.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-EtzmMEnK.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-EtzmMEnK.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, {