@haex-space/vault-sdk 5.0.0 → 5.2.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 +29 -0
- package/dist/{client-DXHXxcgw.d.mts → client-CgngeKPm.d.ts} +42 -3
- package/dist/{client-EtzmMEnK.d.ts → client-HdPYJ_9t.d.mts} +42 -3
- package/dist/haex_bundle_bg.wasm +0 -0
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -2
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +51 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +51 -1
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +50 -1
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +50 -1
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +51 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +51 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-BZVkX0Wf.d.mts → types-CNxDNQgb.d.mts} +17 -2
- package/dist/{types-BZVkX0Wf.d.ts → types-CNxDNQgb.d.ts} +17 -2
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +51 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +51 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1051,6 +1051,35 @@ const sure = await client.dialog.confirm({
|
|
|
1051
1051
|
if (sure) await deleteNoteAsync(id);
|
|
1052
1052
|
```
|
|
1053
1053
|
|
|
1054
|
+
### Openers: Taking Over a Kind of Link
|
|
1055
|
+
|
|
1056
|
+
An extension can take over a kind of link from its host. Today there is one, `mail.compose`: where a
|
|
1057
|
+
person writes an e-mail (the mail button of an address, or a `mailto:` link from another app), the host
|
|
1058
|
+
offers the extension next to the system's mail program. Register in `haextension/manifest.json`; the
|
|
1059
|
+
bundle check rejects an `openers` block that is not an array of at most 8 distinct kinds of the form
|
|
1060
|
+
`word.word` (lower case, at most 32 characters). A kind a host does not know is ignored. Registering
|
|
1061
|
+
grants no access:
|
|
1062
|
+
|
|
1063
|
+
```json
|
|
1064
|
+
{ "openers": ["mail.compose"] }
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
The host reads the link and hands the extension only the fields, once, and only after the person chose the
|
|
1068
|
+
extension. Open your compose dialog with them and send nothing, the person has not written it yet:
|
|
1069
|
+
|
|
1070
|
+
```ts
|
|
1071
|
+
// Listen first so an event during startup cannot be missed. A frame that the choice itself opened
|
|
1072
|
+
// may have missed the event already, so also ask once at the start ...
|
|
1073
|
+
client.openers.onRequest((request) => {
|
|
1074
|
+
if (request.action === "mail.compose") openCompose(request.mail);
|
|
1075
|
+
});
|
|
1076
|
+
const first = await client.openers.take();
|
|
1077
|
+
if (first?.action === "mail.compose") openCompose(first.mail);
|
|
1078
|
+
// request.mail: { to: string[], cc: string[], bcc: string[], subject: string, body: string }
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
A request waits 15 seconds for the extension; `take()` gives `null` when none waits.
|
|
1082
|
+
|
|
1054
1083
|
### Tools for the Host's Agent
|
|
1055
1084
|
|
|
1056
1085
|
An extension can offer tools to the agent of its host, for example "count unread mails". Declare each
|
|
@@ -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-CNxDNQgb.js';
|
|
2
2
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -2376,6 +2376,44 @@ declare class DialogAPI {
|
|
|
2376
2376
|
confirm(options: ConfirmOptions): Promise<boolean>;
|
|
2377
2377
|
}
|
|
2378
2378
|
|
|
2379
|
+
/** The fields of the e-mail a person wants to write, as the host read them from a mail link or an address. */
|
|
2380
|
+
interface MailFields {
|
|
2381
|
+
to: string[];
|
|
2382
|
+
cc: string[];
|
|
2383
|
+
bcc: string[];
|
|
2384
|
+
subject: string;
|
|
2385
|
+
/** Plain text; line breaks are `\n`. */
|
|
2386
|
+
body: string;
|
|
2387
|
+
}
|
|
2388
|
+
/** The request a person gave this extension. The host never passes the link itself, only these fields. */
|
|
2389
|
+
type OpenRequest = {
|
|
2390
|
+
action: "mail.compose";
|
|
2391
|
+
mail: MailFields;
|
|
2392
|
+
};
|
|
2393
|
+
/**
|
|
2394
|
+
* Requests the host hands to an extension that registered as an opener (`openers` in its manifest,
|
|
2395
|
+
* holzi spec 063). A request exists only because the person chose this extension, and it is taken
|
|
2396
|
+
* exactly once.
|
|
2397
|
+
*
|
|
2398
|
+
* Open the dialog the request asks for, but do not send anything: the person has not written it yet.
|
|
2399
|
+
*/
|
|
2400
|
+
declare class OpenersAPI {
|
|
2401
|
+
private client;
|
|
2402
|
+
constructor(client: HaexVaultSdk);
|
|
2403
|
+
/**
|
|
2404
|
+
* Takes the request that waits for this extension, or `null` when none does (it expired after
|
|
2405
|
+
* 15 seconds, was taken already, or the extension did not register for the kind). Call it once when
|
|
2406
|
+
* the extension starts: a frame that the choice itself opened misses the event.
|
|
2407
|
+
*/
|
|
2408
|
+
take(): Promise<OpenRequest | null>;
|
|
2409
|
+
/**
|
|
2410
|
+
* Calls `handler` with each request that arrives while the extension is open; the SDK takes it
|
|
2411
|
+
* for you. Errors while taking a request go to `onError`, or to the SDK console log when omitted.
|
|
2412
|
+
* Returns an unsubscribe function.
|
|
2413
|
+
*/
|
|
2414
|
+
onRequest(handler: (request: OpenRequest) => void, onError?: (error: unknown) => void): () => void;
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2379
2417
|
/**
|
|
2380
2418
|
* A minimal MCP server for the tools an extension offers to the agent of its host (holzi spec 018,
|
|
2381
2419
|
* `contracts/mcp-port.md`). It speaks the part of MCP a host needs to list and call tools:
|
|
@@ -2486,6 +2524,7 @@ declare class HaexVaultSdk {
|
|
|
2486
2524
|
readonly notifications: NotificationsAPI;
|
|
2487
2525
|
readonly tab: TabAPI;
|
|
2488
2526
|
readonly dialog: DialogAPI;
|
|
2527
|
+
readonly openers: OpenersAPI;
|
|
2489
2528
|
/** Tools the extension offers to the agent of its host (holzi spec 018). */
|
|
2490
2529
|
readonly tools: ToolsAPI;
|
|
2491
2530
|
/** Unified action system - register handlers that work for both Bridge and AI requests */
|
|
@@ -2538,5 +2577,5 @@ declare class HaexVaultSdk {
|
|
|
2538
2577
|
private log;
|
|
2539
2578
|
}
|
|
2540
2579
|
|
|
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
|
|
2542
|
-
export type {
|
|
2580
|
+
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 aH, PermissionsAPI as aK, RemoteStorageAPI as aS, ModelsAPI as ag, NotificationsAPI as ak, OpenersAPI as am, PEER_ERROR_KINDS as ap, PasswordsAPI as av, PeerError as ay, ShellAPI as b3, SpacesAPI as bf, TabAPI as bh, ToolsAPI as bk, WebAPI as bo, canExternalClientSendRequests as bp, isExternalClientConnected as bq, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
|
|
2581
|
+
export type { MailMessage 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, MailFields as _, ConnectionSecurity as a, ServerInfo as a$, MailNewMessagesEvent as a0, MailSearchCriteria as a1, MailSearchResult as a2, MailboxInfo as a3, MessageEnvelope as a4, ModelAccessRequest as a5, ModelEffort as a6, ModelJob as a7, ModelJobAttempt as a8, ModelJobCompletion as a9, PeerErrorReason as aA, PeerEventMap as aB, PeerEventType as aC, PeerInviteStatus as aD, PeerJoined as aE, PeerMessage as aF, PeerVisibility as aG, PendingAuthorization as aI, PendingTransfer as aJ, AddBackendRequest as aL, FolderBackendInfo as aM, S3BackendInfo as aN, S3Config as aO, S3Proposal as aP, S3PublicConfig as aQ, SftpProposal as aR, StorageBackendInfo as aT, StorageBackendType as aU, StorageObjectInfo as aV, UpdateBackendRequest as aW, WebDavProposal as aX, RequestedExtension as aY, SelectFileOptions as aZ, SelectFolderOptions as a_, ModelJobErrorCode as aa, ModelJobFormat as ab, ModelJobImage as ac, ModelJobProvenance as ad, ModelJobStep as ae, ModelPlace as af, NotificationAction as ah, NotificationClickEvent as ai, NotificationOptions as aj, OpenRequest as al, OutgoingAttachment as an, OutgoingMessage as ao, PasswordInput as aq, PasswordItemFull as ar, PasswordItemSummary as as, PasswordKeyValue as at, PasswordKeyValueInput as au, PeerChannelClosed as aw, PeerChannelOpened as ax, PeerErrorKind as az, ContactDetail as b, ServerStatus as b0, SessionAuthorization as b1, SharedSpace as b2, ShellCreateOptions as b4, ShellCreateResponse as b5, ShellExitEvent as b6, ShellOutputEvent as b7, SmtpConfig as b8, SpaceAccessTokenInfo as b9, SpaceAssignment as ba, SpaceInvite as bb, SpaceKeyGrantInfo as bc, SpaceMember as bd, SpaceMemberInfo as be, SyncBackendInfo as bg, ToolContext as bi, ToolHandler as bj, TransferDirection as bl, TransferProgress as bm, TransferState as bn, 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 };
|
|
@@ -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-CNxDNQgb.mjs';
|
|
2
2
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -2376,6 +2376,44 @@ declare class DialogAPI {
|
|
|
2376
2376
|
confirm(options: ConfirmOptions): Promise<boolean>;
|
|
2377
2377
|
}
|
|
2378
2378
|
|
|
2379
|
+
/** The fields of the e-mail a person wants to write, as the host read them from a mail link or an address. */
|
|
2380
|
+
interface MailFields {
|
|
2381
|
+
to: string[];
|
|
2382
|
+
cc: string[];
|
|
2383
|
+
bcc: string[];
|
|
2384
|
+
subject: string;
|
|
2385
|
+
/** Plain text; line breaks are `\n`. */
|
|
2386
|
+
body: string;
|
|
2387
|
+
}
|
|
2388
|
+
/** The request a person gave this extension. The host never passes the link itself, only these fields. */
|
|
2389
|
+
type OpenRequest = {
|
|
2390
|
+
action: "mail.compose";
|
|
2391
|
+
mail: MailFields;
|
|
2392
|
+
};
|
|
2393
|
+
/**
|
|
2394
|
+
* Requests the host hands to an extension that registered as an opener (`openers` in its manifest,
|
|
2395
|
+
* holzi spec 063). A request exists only because the person chose this extension, and it is taken
|
|
2396
|
+
* exactly once.
|
|
2397
|
+
*
|
|
2398
|
+
* Open the dialog the request asks for, but do not send anything: the person has not written it yet.
|
|
2399
|
+
*/
|
|
2400
|
+
declare class OpenersAPI {
|
|
2401
|
+
private client;
|
|
2402
|
+
constructor(client: HaexVaultSdk);
|
|
2403
|
+
/**
|
|
2404
|
+
* Takes the request that waits for this extension, or `null` when none does (it expired after
|
|
2405
|
+
* 15 seconds, was taken already, or the extension did not register for the kind). Call it once when
|
|
2406
|
+
* the extension starts: a frame that the choice itself opened misses the event.
|
|
2407
|
+
*/
|
|
2408
|
+
take(): Promise<OpenRequest | null>;
|
|
2409
|
+
/**
|
|
2410
|
+
* Calls `handler` with each request that arrives while the extension is open; the SDK takes it
|
|
2411
|
+
* for you. Errors while taking a request go to `onError`, or to the SDK console log when omitted.
|
|
2412
|
+
* Returns an unsubscribe function.
|
|
2413
|
+
*/
|
|
2414
|
+
onRequest(handler: (request: OpenRequest) => void, onError?: (error: unknown) => void): () => void;
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2379
2417
|
/**
|
|
2380
2418
|
* A minimal MCP server for the tools an extension offers to the agent of its host (holzi spec 018,
|
|
2381
2419
|
* `contracts/mcp-port.md`). It speaks the part of MCP a host needs to list and call tools:
|
|
@@ -2486,6 +2524,7 @@ declare class HaexVaultSdk {
|
|
|
2486
2524
|
readonly notifications: NotificationsAPI;
|
|
2487
2525
|
readonly tab: TabAPI;
|
|
2488
2526
|
readonly dialog: DialogAPI;
|
|
2527
|
+
readonly openers: OpenersAPI;
|
|
2489
2528
|
/** Tools the extension offers to the agent of its host (holzi spec 018). */
|
|
2490
2529
|
readonly tools: ToolsAPI;
|
|
2491
2530
|
/** Unified action system - register handlers that work for both Bridge and AI requests */
|
|
@@ -2538,5 +2577,5 @@ declare class HaexVaultSdk {
|
|
|
2538
2577
|
private log;
|
|
2539
2578
|
}
|
|
2540
2579
|
|
|
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
|
|
2542
|
-
export type {
|
|
2580
|
+
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 aH, PermissionsAPI as aK, RemoteStorageAPI as aS, ModelsAPI as ag, NotificationsAPI as ak, OpenersAPI as am, PEER_ERROR_KINDS as ap, PasswordsAPI as av, PeerError as ay, ShellAPI as b3, SpacesAPI as bf, TabAPI as bh, ToolsAPI as bk, WebAPI as bo, canExternalClientSendRequests as bp, isExternalClientConnected as bq, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
|
|
2581
|
+
export type { MailMessage 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, MailFields as _, ConnectionSecurity as a, ServerInfo as a$, MailNewMessagesEvent as a0, MailSearchCriteria as a1, MailSearchResult as a2, MailboxInfo as a3, MessageEnvelope as a4, ModelAccessRequest as a5, ModelEffort as a6, ModelJob as a7, ModelJobAttempt as a8, ModelJobCompletion as a9, PeerErrorReason as aA, PeerEventMap as aB, PeerEventType as aC, PeerInviteStatus as aD, PeerJoined as aE, PeerMessage as aF, PeerVisibility as aG, PendingAuthorization as aI, PendingTransfer as aJ, AddBackendRequest as aL, FolderBackendInfo as aM, S3BackendInfo as aN, S3Config as aO, S3Proposal as aP, S3PublicConfig as aQ, SftpProposal as aR, StorageBackendInfo as aT, StorageBackendType as aU, StorageObjectInfo as aV, UpdateBackendRequest as aW, WebDavProposal as aX, RequestedExtension as aY, SelectFileOptions as aZ, SelectFolderOptions as a_, ModelJobErrorCode as aa, ModelJobFormat as ab, ModelJobImage as ac, ModelJobProvenance as ad, ModelJobStep as ae, ModelPlace as af, NotificationAction as ah, NotificationClickEvent as ai, NotificationOptions as aj, OpenRequest as al, OutgoingAttachment as an, OutgoingMessage as ao, PasswordInput as aq, PasswordItemFull as ar, PasswordItemSummary as as, PasswordKeyValue as at, PasswordKeyValueInput as au, PeerChannelClosed as aw, PeerChannelOpened as ax, PeerErrorKind as az, ContactDetail as b, ServerStatus as b0, SessionAuthorization as b1, SharedSpace as b2, ShellCreateOptions as b4, ShellCreateResponse as b5, ShellExitEvent as b6, ShellOutputEvent as b7, SmtpConfig as b8, SpaceAccessTokenInfo as b9, SpaceAssignment as ba, SpaceInvite as bb, SpaceKeyGrantInfo as bc, SpaceMember as bd, SpaceMemberInfo as be, SyncBackendInfo as bg, ToolContext as bi, ToolHandler as bj, TransferDirection as bl, TransferProgress as bm, TransferState as bn, 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/haex_bundle_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 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
|
|
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 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
|
|
1
|
+
import { H as HaexVaultSdk } from './client-HdPYJ_9t.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 MailFields, $ as MailMessage, a0 as MailNewMessagesEvent, a1 as MailSearchCriteria, a2 as MailSearchResult, a3 as MailboxInfo, a4 as MessageEnvelope, a5 as ModelAccessRequest, a6 as ModelEffort, a7 as ModelJob, a8 as ModelJobAttempt, a9 as ModelJobCompletion, aa as ModelJobErrorCode, ab as ModelJobFormat, ac as ModelJobImage, ad as ModelJobProvenance, ae as ModelJobStep, af as ModelPlace, ag as ModelsAPI, ah as NotificationAction, ai as NotificationClickEvent, aj as NotificationOptions, ak as NotificationsAPI, al as OpenRequest, am as OpenersAPI, an as OutgoingAttachment, ao as OutgoingMessage, ap as PEER_ERROR_KINDS, aq as PasswordInput, ar as PasswordItemFull, as as PasswordItemSummary, at as PasswordKeyValue, au as PasswordKeyValueInput, av as PasswordsAPI, aw as PeerChannelClosed, ax as PeerChannelOpened, ay as PeerError, az as PeerErrorKind, aA as PeerErrorReason, aB as PeerEventMap, aC as PeerEventType, aD as PeerInviteStatus, aE as PeerJoined, aF as PeerMessage, aG as PeerVisibility, aH as PeersAPI, aI as PendingAuthorization, aJ as PendingTransfer, aK as PermissionsAPI, aL as RemoteAddBackendRequest, aM as RemoteFolderBackendInfo, aN as RemoteS3BackendInfo, aO as RemoteS3Config, aP as RemoteS3Proposal, aQ as RemoteS3PublicConfig, aR as RemoteSftpProposal, aS as RemoteStorageAPI, aT as RemoteStorageBackendInfo, aU as RemoteStorageBackendType, aV as RemoteStorageObjectInfo, aW as RemoteUpdateBackendRequest, aX as RemoteWebDavProposal, aY as RequestedExtension, aZ as SelectFileOptions, a_ as SelectFolderOptions, a$ as ServerInfo, b0 as ServerStatus, b1 as SessionAuthorization, b2 as SharedSpace, b3 as ShellAPI, b4 as ShellCreateOptions, b5 as ShellCreateResponse, b6 as ShellExitEvent, b7 as ShellOutputEvent, b8 as SmtpConfig, b9 as SpaceAccessTokenInfo, ba as SpaceAssignment, bb as SpaceInvite, bc as SpaceKeyGrantInfo, bd as SpaceMember, be as SpaceMemberInfo, bf as SpacesAPI, bg as SyncBackendInfo, bh as TabAPI, bi as ToolContext, bj as ToolHandler, bk as ToolsAPI, bl as TransferDirection, bm as TransferProgress, bn as TransferState, bo as WebAPI, bp as canExternalClientSendRequests, bq as isExternalClientConnected } from './client-HdPYJ_9t.mjs';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-CNxDNQgb.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 OPENER_EVENTS, X as OpenerEvent, Y as PEERS_EVENTS, Z as PeersEvent, _ as PermissionDeniedError, $ as PermissionErrorBase, a0 as PermissionErrorCode, a1 as PermissionPromptError, P as PermissionResponse, a2 as PermissionStatus, R as RequestOptions, a3 as SHELL_EVENTS, a4 as SearchQuery, a5 as SearchRequestEvent, S as SearchResult, a6 as ShellEvent, a7 as SyncTablesUpdatedEvent, a8 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a9 as getTableName, aa as isPermissionDeniedError, ab as isPermissionError, ac as isPermissionPromptError } from './types-CNxDNQgb.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-P_6DqTHl.mjs';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -637,6 +637,8 @@ declare const EXTENSION_COMMANDS: {
|
|
|
637
637
|
readonly tabAttention: "extension_tab_attention";
|
|
638
638
|
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
639
639
|
readonly dialogConfirm: "extension_dialog_confirm";
|
|
640
|
+
/** Take the request the user gave this extension (holzi spec 063): `null` or `{ action, mail }` */
|
|
641
|
+
readonly openerTake: "extension_opener_take";
|
|
640
642
|
};
|
|
641
643
|
|
|
642
644
|
/**
|
|
@@ -857,6 +859,7 @@ declare const TAURI_COMMANDS: {
|
|
|
857
859
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
858
860
|
readonly tabAttention: "extension_tab_attention";
|
|
859
861
|
readonly dialogConfirm: "extension_dialog_confirm";
|
|
862
|
+
readonly openerTake: "extension_opener_take";
|
|
860
863
|
};
|
|
861
864
|
readonly remoteStorage: {
|
|
862
865
|
readonly listBackends: "extension_remote_storage_list_backends";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 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
|
|
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 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
|
|
1
|
+
import { H as HaexVaultSdk } from './client-CgngeKPm.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 MailFields, $ as MailMessage, a0 as MailNewMessagesEvent, a1 as MailSearchCriteria, a2 as MailSearchResult, a3 as MailboxInfo, a4 as MessageEnvelope, a5 as ModelAccessRequest, a6 as ModelEffort, a7 as ModelJob, a8 as ModelJobAttempt, a9 as ModelJobCompletion, aa as ModelJobErrorCode, ab as ModelJobFormat, ac as ModelJobImage, ad as ModelJobProvenance, ae as ModelJobStep, af as ModelPlace, ag as ModelsAPI, ah as NotificationAction, ai as NotificationClickEvent, aj as NotificationOptions, ak as NotificationsAPI, al as OpenRequest, am as OpenersAPI, an as OutgoingAttachment, ao as OutgoingMessage, ap as PEER_ERROR_KINDS, aq as PasswordInput, ar as PasswordItemFull, as as PasswordItemSummary, at as PasswordKeyValue, au as PasswordKeyValueInput, av as PasswordsAPI, aw as PeerChannelClosed, ax as PeerChannelOpened, ay as PeerError, az as PeerErrorKind, aA as PeerErrorReason, aB as PeerEventMap, aC as PeerEventType, aD as PeerInviteStatus, aE as PeerJoined, aF as PeerMessage, aG as PeerVisibility, aH as PeersAPI, aI as PendingAuthorization, aJ as PendingTransfer, aK as PermissionsAPI, aL as RemoteAddBackendRequest, aM as RemoteFolderBackendInfo, aN as RemoteS3BackendInfo, aO as RemoteS3Config, aP as RemoteS3Proposal, aQ as RemoteS3PublicConfig, aR as RemoteSftpProposal, aS as RemoteStorageAPI, aT as RemoteStorageBackendInfo, aU as RemoteStorageBackendType, aV as RemoteStorageObjectInfo, aW as RemoteUpdateBackendRequest, aX as RemoteWebDavProposal, aY as RequestedExtension, aZ as SelectFileOptions, a_ as SelectFolderOptions, a$ as ServerInfo, b0 as ServerStatus, b1 as SessionAuthorization, b2 as SharedSpace, b3 as ShellAPI, b4 as ShellCreateOptions, b5 as ShellCreateResponse, b6 as ShellExitEvent, b7 as ShellOutputEvent, b8 as SmtpConfig, b9 as SpaceAccessTokenInfo, ba as SpaceAssignment, bb as SpaceInvite, bc as SpaceKeyGrantInfo, bd as SpaceMember, be as SpaceMemberInfo, bf as SpacesAPI, bg as SyncBackendInfo, bh as TabAPI, bi as ToolContext, bj as ToolHandler, bk as ToolsAPI, bl as TransferDirection, bm as TransferProgress, bn as TransferState, bo as WebAPI, bp as canExternalClientSendRequests, bq as isExternalClientConnected } from './client-CgngeKPm.js';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-CNxDNQgb.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 OPENER_EVENTS, X as OpenerEvent, Y as PEERS_EVENTS, Z as PeersEvent, _ as PermissionDeniedError, $ as PermissionErrorBase, a0 as PermissionErrorCode, a1 as PermissionPromptError, P as PermissionResponse, a2 as PermissionStatus, R as RequestOptions, a3 as SHELL_EVENTS, a4 as SearchQuery, a5 as SearchRequestEvent, S as SearchResult, a6 as ShellEvent, a7 as SyncTablesUpdatedEvent, a8 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a9 as getTableName, aa as isPermissionDeniedError, ab as isPermissionError, ac as isPermissionPromptError } from './types-CNxDNQgb.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-P_6DqTHl.js';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -637,6 +637,8 @@ declare const EXTENSION_COMMANDS: {
|
|
|
637
637
|
readonly tabAttention: "extension_tab_attention";
|
|
638
638
|
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
639
639
|
readonly dialogConfirm: "extension_dialog_confirm";
|
|
640
|
+
/** Take the request the user gave this extension (holzi spec 063): `null` or `{ action, mail }` */
|
|
641
|
+
readonly openerTake: "extension_opener_take";
|
|
640
642
|
};
|
|
641
643
|
|
|
642
644
|
/**
|
|
@@ -857,6 +859,7 @@ declare const TAURI_COMMANDS: {
|
|
|
857
859
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
858
860
|
readonly tabAttention: "extension_tab_attention";
|
|
859
861
|
readonly dialogConfirm: "extension_dialog_confirm";
|
|
862
|
+
readonly openerTake: "extension_opener_take";
|
|
860
863
|
};
|
|
861
864
|
readonly remoteStorage: {
|
|
862
865
|
readonly listBackends: "extension_remote_storage_list_backends";
|
package/dist/index.js
CHANGED
|
@@ -763,6 +763,10 @@ var NOTIFICATION_EVENTS = {
|
|
|
763
763
|
/** A click on one of this extension's notifications (body or action button). */
|
|
764
764
|
CLICK: "haextension:notification:click"
|
|
765
765
|
};
|
|
766
|
+
var OPENER_EVENTS = {
|
|
767
|
+
/** A request waits for this extension: take it with `client.openers.take()`. The event carries no content. */
|
|
768
|
+
REQUEST: "opener-request"
|
|
769
|
+
};
|
|
766
770
|
var MODEL_JOB_EVENTS = {
|
|
767
771
|
/** A job of this frame ended: completed, failed or cancelled. */
|
|
768
772
|
COMPLETED: "haextension:model-job:completed"
|
|
@@ -1055,7 +1059,9 @@ var EXTENSION_COMMANDS = {
|
|
|
1055
1059
|
/** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
|
|
1056
1060
|
tabAttention: "extension_tab_attention",
|
|
1057
1061
|
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
1058
|
-
dialogConfirm: "extension_dialog_confirm"
|
|
1062
|
+
dialogConfirm: "extension_dialog_confirm",
|
|
1063
|
+
/** Take the request the user gave this extension (holzi spec 063): `null` or `{ action, mail }` */
|
|
1064
|
+
openerTake: "extension_opener_take"
|
|
1059
1065
|
};
|
|
1060
1066
|
|
|
1061
1067
|
// src/commands/remoteStorage.ts
|
|
@@ -2988,6 +2994,49 @@ var DialogAPI = class {
|
|
|
2988
2994
|
}
|
|
2989
2995
|
};
|
|
2990
2996
|
|
|
2997
|
+
// src/api/openers.ts
|
|
2998
|
+
init_cjs_shims();
|
|
2999
|
+
var OpenersAPI = class {
|
|
3000
|
+
constructor(client) {
|
|
3001
|
+
this.client = client;
|
|
3002
|
+
}
|
|
3003
|
+
/**
|
|
3004
|
+
* Takes the request that waits for this extension, or `null` when none does (it expired after
|
|
3005
|
+
* 15 seconds, was taken already, or the extension did not register for the kind). Call it once when
|
|
3006
|
+
* the extension starts: a frame that the choice itself opened misses the event.
|
|
3007
|
+
*/
|
|
3008
|
+
async take() {
|
|
3009
|
+
await this.client.ready();
|
|
3010
|
+
const request = await this.client.request(EXTENSION_COMMANDS.openerTake, {});
|
|
3011
|
+
return request ?? null;
|
|
3012
|
+
}
|
|
3013
|
+
/**
|
|
3014
|
+
* Calls `handler` with each request that arrives while the extension is open; the SDK takes it
|
|
3015
|
+
* for you. Errors while taking a request go to `onError`, or to the SDK console log when omitted.
|
|
3016
|
+
* Returns an unsubscribe function.
|
|
3017
|
+
*/
|
|
3018
|
+
onRequest(handler, onError) {
|
|
3019
|
+
let active = true;
|
|
3020
|
+
const wrapped = () => {
|
|
3021
|
+
void this.take().then(
|
|
3022
|
+
(request) => {
|
|
3023
|
+
if (active && request) handler(request);
|
|
3024
|
+
},
|
|
3025
|
+
(error) => {
|
|
3026
|
+
if (!active) return;
|
|
3027
|
+
if (onError) onError(error);
|
|
3028
|
+
else console.error("[HaexVault SDK] Failed to take opener request:", error);
|
|
3029
|
+
}
|
|
3030
|
+
);
|
|
3031
|
+
};
|
|
3032
|
+
this.client.on(OPENER_EVENTS.REQUEST, wrapped);
|
|
3033
|
+
return () => {
|
|
3034
|
+
active = false;
|
|
3035
|
+
this.client.off(OPENER_EVENTS.REQUEST, wrapped);
|
|
3036
|
+
};
|
|
3037
|
+
}
|
|
3038
|
+
};
|
|
3039
|
+
|
|
2991
3040
|
// src/api/tools/index.ts
|
|
2992
3041
|
init_cjs_shims();
|
|
2993
3042
|
|
|
@@ -3863,6 +3912,7 @@ var HaexVaultSdk = class {
|
|
|
3863
3912
|
this.notifications = new NotificationsAPI(this);
|
|
3864
3913
|
this.tab = new TabAPI(this);
|
|
3865
3914
|
this.dialog = new DialogAPI(this);
|
|
3915
|
+
this.openers = new OpenersAPI(this);
|
|
3866
3916
|
this.tools = new ToolsAPI({
|
|
3867
3917
|
manifest: () => this.config.manifest,
|
|
3868
3918
|
send: (message) => this.sendMcpMessage(message)
|
|
@@ -4758,6 +4808,8 @@ exports.ModelsAPI = ModelsAPI;
|
|
|
4758
4808
|
exports.NOTIFICATION_COMMANDS = NOTIFICATION_COMMANDS;
|
|
4759
4809
|
exports.NOTIFICATION_EVENTS = NOTIFICATION_EVENTS;
|
|
4760
4810
|
exports.NotificationsAPI = NotificationsAPI;
|
|
4811
|
+
exports.OPENER_EVENTS = OPENER_EVENTS;
|
|
4812
|
+
exports.OpenersAPI = OpenersAPI;
|
|
4761
4813
|
exports.PASSWORD_COMMANDS = PASSWORD_COMMANDS;
|
|
4762
4814
|
exports.PEERS_EVENTS = PEERS_EVENTS;
|
|
4763
4815
|
exports.PEER_COMMANDS = PEER_COMMANDS;
|