@haex-space/vault-sdk 5.4.1 → 5.5.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/dist/{client-HdPYJ_9t.d.mts → client-BFDgj2tC.d.mts} +15 -0
- package/dist/{client-CgngeKPm.d.ts → client-CtUpYUH7.d.ts} +15 -0
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +45 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +45 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +45 -2
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +45 -2
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +45 -2
- 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 +45 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +45 -2
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +45 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +45 -2
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/vue.mjs
CHANGED
|
@@ -852,6 +852,10 @@ var MAIL_COMMANDS = {
|
|
|
852
852
|
search: "extension_mail_search",
|
|
853
853
|
/** CREATE a mailbox (reports whether it was already there) */
|
|
854
854
|
createMailbox: "extension_mail_create_mailbox",
|
|
855
|
+
/** DELETE a mailbox (never INBOX) */
|
|
856
|
+
deleteMailbox: "extension_mail_delete_mailbox",
|
|
857
|
+
/** RENAME a mailbox (never INBOX) */
|
|
858
|
+
renameMailbox: "extension_mail_rename_mailbox",
|
|
855
859
|
/** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
|
|
856
860
|
deleteMessages: "extension_mail_delete_messages",
|
|
857
861
|
/** Set or unset IMAP flags on a UID set */
|
|
@@ -2376,6 +2380,25 @@ var MailAPI = class {
|
|
|
2376
2380
|
);
|
|
2377
2381
|
return created;
|
|
2378
2382
|
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Delete a mailbox. `mailbox` is the IMAP-encoded name (modified UTF-7), like in every other
|
|
2385
|
+
* call. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether the mailbox's
|
|
2386
|
+
* messages and child mailboxes go with it, and whether a missing mailbox is an error, is up to
|
|
2387
|
+
* the server. Needs the same `fetch` permission as the other IMAP calls.
|
|
2388
|
+
*/
|
|
2389
|
+
async deleteMailboxAsync(imap, mailbox) {
|
|
2390
|
+
return this.client.request(MAIL_COMMANDS.deleteMailbox, { imap, mailbox });
|
|
2391
|
+
}
|
|
2392
|
+
/**
|
|
2393
|
+
* Rename a mailbox from `from` to `to`, both IMAP-encoded names (modified UTF-7). `to` may
|
|
2394
|
+
* contain the server's hierarchy delimiter to move the mailbox in the tree; `*` and `%` are not
|
|
2395
|
+
* allowed. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether child
|
|
2396
|
+
* mailboxes follow and whether an existing `to` is an error is up to the server. Needs the same
|
|
2397
|
+
* `fetch` permission as the other IMAP calls.
|
|
2398
|
+
*/
|
|
2399
|
+
async renameMailboxAsync(imap, from, to) {
|
|
2400
|
+
return this.client.request(MAIL_COMMANDS.renameMailbox, { imap, from, to });
|
|
2401
|
+
}
|
|
2379
2402
|
/**
|
|
2380
2403
|
* Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
|
|
2381
2404
|
* other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
|
|
@@ -2661,6 +2684,7 @@ function validateInput(schema, value) {
|
|
|
2661
2684
|
var PROTOCOL_VERSION = "2025-11-25";
|
|
2662
2685
|
var METHOD_NOT_FOUND = -32601;
|
|
2663
2686
|
var INVALID_PARAMS = -32602;
|
|
2687
|
+
var INTERNAL_ERROR = -32603;
|
|
2664
2688
|
function textResult(text, isError) {
|
|
2665
2689
|
return { content: [{ type: "text", text }], isError };
|
|
2666
2690
|
}
|
|
@@ -2746,11 +2770,30 @@ var ToolsServer = class {
|
|
|
2746
2770
|
}
|
|
2747
2771
|
if (!controller.signal.aborted) this.reply(id, result);
|
|
2748
2772
|
}
|
|
2773
|
+
/**
|
|
2774
|
+
* Answers `id`. An answer that cannot be sent gets an error instead, so the host never waits for
|
|
2775
|
+
* an answer that will not come.
|
|
2776
|
+
*/
|
|
2749
2777
|
reply(id, result) {
|
|
2750
|
-
|
|
2778
|
+
try {
|
|
2779
|
+
this.send({ jsonrpc: "2.0", id, result });
|
|
2780
|
+
} catch (error) {
|
|
2781
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
2782
|
+
console.warn(`[vault-sdk] tools: answer ${String(id)} could not be sent: ${reason}`);
|
|
2783
|
+
this.error(id, INTERNAL_ERROR, `the answer could not be sent: ${reason}`);
|
|
2784
|
+
}
|
|
2751
2785
|
}
|
|
2752
2786
|
error(id, code, message) {
|
|
2753
|
-
this.
|
|
2787
|
+
this.send({ jsonrpc: "2.0", id, error: { code, message } });
|
|
2788
|
+
}
|
|
2789
|
+
/**
|
|
2790
|
+
* Sends a JSON copy. The manifest of a Nuxt extension comes from its runtime config, a Vue
|
|
2791
|
+
* reactive proxy, and `postMessage` cannot clone a proxy: the input schemas of `tools/list`
|
|
2792
|
+
* would throw a `DataCloneError` and the host would never get the list. JSON-RPC is JSON, so the
|
|
2793
|
+
* copy loses nothing.
|
|
2794
|
+
*/
|
|
2795
|
+
send(message) {
|
|
2796
|
+
this.options.send(JSON.parse(JSON.stringify(message)));
|
|
2754
2797
|
}
|
|
2755
2798
|
};
|
|
2756
2799
|
|