@haex-space/vault-sdk 5.4.1 → 5.4.2
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/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.js +22 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +22 -2
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +22 -2
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +22 -2
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.js +22 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +22 -2
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.js +22 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +22 -2
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2203,6 +2203,7 @@ function validateInput(schema, value) {
|
|
|
2203
2203
|
var PROTOCOL_VERSION = "2025-11-25";
|
|
2204
2204
|
var METHOD_NOT_FOUND = -32601;
|
|
2205
2205
|
var INVALID_PARAMS = -32602;
|
|
2206
|
+
var INTERNAL_ERROR = -32603;
|
|
2206
2207
|
function textResult(text, isError) {
|
|
2207
2208
|
return { content: [{ type: "text", text }], isError };
|
|
2208
2209
|
}
|
|
@@ -2288,11 +2289,30 @@ var ToolsServer = class {
|
|
|
2288
2289
|
}
|
|
2289
2290
|
if (!controller.signal.aborted) this.reply(id, result);
|
|
2290
2291
|
}
|
|
2292
|
+
/**
|
|
2293
|
+
* Answers `id`. An answer that cannot be sent gets an error instead, so the host never waits for
|
|
2294
|
+
* an answer that will not come.
|
|
2295
|
+
*/
|
|
2291
2296
|
reply(id, result) {
|
|
2292
|
-
|
|
2297
|
+
try {
|
|
2298
|
+
this.send({ jsonrpc: "2.0", id, result });
|
|
2299
|
+
} catch (error) {
|
|
2300
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
2301
|
+
console.warn(`[vault-sdk] tools: answer ${String(id)} could not be sent: ${reason}`);
|
|
2302
|
+
this.error(id, INTERNAL_ERROR, `the answer could not be sent: ${reason}`);
|
|
2303
|
+
}
|
|
2293
2304
|
}
|
|
2294
2305
|
error(id, code, message) {
|
|
2295
|
-
this.
|
|
2306
|
+
this.send({ jsonrpc: "2.0", id, error: { code, message } });
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Sends a JSON copy. The manifest of a Nuxt extension comes from its runtime config, a Vue
|
|
2310
|
+
* reactive proxy, and `postMessage` cannot clone a proxy: the input schemas of `tools/list`
|
|
2311
|
+
* would throw a `DataCloneError` and the host would never get the list. JSON-RPC is JSON, so the
|
|
2312
|
+
* copy loses nothing.
|
|
2313
|
+
*/
|
|
2314
|
+
send(message) {
|
|
2315
|
+
this.options.send(JSON.parse(JSON.stringify(message)));
|
|
2296
2316
|
}
|
|
2297
2317
|
};
|
|
2298
2318
|
|