@haex-space/vault-sdk 4.9.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/dist/{client-CS0AdXto.d.mts → client-DXHXxcgw.d.mts} +31 -11
- package/dist/{client-BzgCo_Ch.d.ts → client-EtzmMEnK.d.ts} +31 -11
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -1
- 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 +23 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +23 -1
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +23 -1
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +23 -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 +23 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +23 -1
- 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 +23 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +23 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -351,7 +351,11 @@ var MODEL_COMMANDS = {
|
|
|
351
351
|
/** Starts a job; the result follows as an event */
|
|
352
352
|
start: "extension_model_job_start",
|
|
353
353
|
/** Cancels a running job of this frame */
|
|
354
|
-
cancel: "extension_model_job_cancel"
|
|
354
|
+
cancel: "extension_model_job_cancel",
|
|
355
|
+
/** Asks for a grant before the first job; nothing goes to a model */
|
|
356
|
+
requestAccess: "extension_model_access_request",
|
|
357
|
+
/** Opens the host's page of this extension's models */
|
|
358
|
+
openSettings: "extension_model_settings_open"
|
|
355
359
|
};
|
|
356
360
|
|
|
357
361
|
// src/commands/peers.ts
|
|
@@ -1606,6 +1610,24 @@ var ModelsAPI = class {
|
|
|
1606
1610
|
);
|
|
1607
1611
|
return answer.models;
|
|
1608
1612
|
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
|
|
1615
|
+
* models that fit `needs`. Without one, the host asks the user as it would for a job, and the
|
|
1616
|
+
* SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
|
|
1617
|
+
* fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
|
|
1618
|
+
* for a destination outside this device is asked with the first job that sends data.
|
|
1619
|
+
*/
|
|
1620
|
+
async requestAccessAsync(request) {
|
|
1621
|
+
const answer = await this.client.request(
|
|
1622
|
+
MODEL_COMMANDS.requestAccess,
|
|
1623
|
+
{ ...request }
|
|
1624
|
+
);
|
|
1625
|
+
return answer.models;
|
|
1626
|
+
}
|
|
1627
|
+
/** Opens the host's page of this extension's models, where the user chooses models and effort. */
|
|
1628
|
+
async openSettingsAsync() {
|
|
1629
|
+
await this.client.request(MODEL_COMMANDS.openSettings, {});
|
|
1630
|
+
}
|
|
1609
1631
|
/** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
|
|
1610
1632
|
async startAsync(job) {
|
|
1611
1633
|
const answer = await this.client.request(MODEL_COMMANDS.start, {
|