@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.
- package/README.md +40 -0
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-Dw2uH1EM.d.ts → client-CcNhK76M.d.mts} +131 -2
- package/dist/{client-D4VYF0bP.d.mts → client-DIvNHfx-.d.ts} +131 -2
- package/dist/{config-D_HXjsEV.d.mts → config-P_6DqTHl.d.mts} +2 -1
- package/dist/{config-D_HXjsEV.d.ts → config-P_6DqTHl.d.ts} +2 -1
- package/dist/index.d.mts +32 -7
- package/dist/index.d.ts +32 -7
- package/dist/index.js +98 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +95 -5
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +4 -3
- package/dist/node.d.ts +4 -3
- package/dist/node.mjs +1 -1
- package/dist/node.mjs.map +1 -1
- package/dist/nuxt.d.mts +2 -1
- package/dist/nuxt.d.ts +2 -1
- package/dist/nuxt.js +1 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/react.d.mts +3 -2
- package/dist/react.d.ts +3 -2
- package/dist/react.js +94 -5
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +93 -4
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +4 -3
- package/dist/runtime/nuxt.plugin.client.d.ts +4 -3
- package/dist/runtime/nuxt.plugin.client.js +83 -1
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +83 -1
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +3 -2
- package/dist/svelte.d.ts +3 -2
- package/dist/svelte.js +94 -5
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +93 -4
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-CYuW3glJ.d.mts → types-snPkjDCj.d.mts} +10 -1
- package/dist/{types-CYuW3glJ.d.ts → types-snPkjDCj.d.ts} +10 -1
- package/dist/vite.d.mts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vue.d.mts +3 -2
- package/dist/vue.d.ts +3 -2
- package/dist/vue.js +94 -5
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +93 -4
- package/dist/vue.mjs.map +1 -1
- 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-
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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-
|
|
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
|
|
3
|
-
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
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
|
|
5
|
-
export { H as HaextensionConfig } from './config-
|
|
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 {
|
|
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-
|
|
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
|
|
3
|
-
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
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
|
|
5
|
-
export { H as HaextensionConfig } from './config-
|
|
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 {
|
|
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
|
-
|
|
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@
|
|
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@
|
|
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 >=
|
|
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;
|