@haex-space/vault-sdk 4.9.0 → 4.10.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 +8 -0
- package/dist/{client-CS0AdXto.d.mts → client-DTxLSJrk.d.mts} +21 -3
- package/dist/{client-BzgCo_Ch.d.ts → client-s0eCQoWA.d.ts} +21 -3
- 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
|
@@ -349,7 +349,11 @@ var MODEL_COMMANDS = {
|
|
|
349
349
|
/** Starts a job; the result follows as an event */
|
|
350
350
|
start: "extension_model_job_start",
|
|
351
351
|
/** Cancels a running job of this frame */
|
|
352
|
-
cancel: "extension_model_job_cancel"
|
|
352
|
+
cancel: "extension_model_job_cancel",
|
|
353
|
+
/** Asks for a grant before the first job; nothing goes to a model */
|
|
354
|
+
requestAccess: "extension_model_access_request",
|
|
355
|
+
/** Opens the host's page of this extension's models */
|
|
356
|
+
openSettings: "extension_model_settings_open"
|
|
353
357
|
};
|
|
354
358
|
|
|
355
359
|
// src/commands/peers.ts
|
|
@@ -1604,6 +1608,24 @@ var ModelsAPI = class {
|
|
|
1604
1608
|
);
|
|
1605
1609
|
return answer.models;
|
|
1606
1610
|
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
|
|
1613
|
+
* models that fit `needs`. Without one, the host asks the user as it would for a job, and the
|
|
1614
|
+
* SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
|
|
1615
|
+
* fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
|
|
1616
|
+
* for a destination outside this device is asked with the first job that sends data.
|
|
1617
|
+
*/
|
|
1618
|
+
async requestAccessAsync(request) {
|
|
1619
|
+
const answer = await this.client.request(
|
|
1620
|
+
MODEL_COMMANDS.requestAccess,
|
|
1621
|
+
{ ...request }
|
|
1622
|
+
);
|
|
1623
|
+
return answer.models;
|
|
1624
|
+
}
|
|
1625
|
+
/** Opens the host's page of this extension's models, where the user chooses models and effort. */
|
|
1626
|
+
async openSettingsAsync() {
|
|
1627
|
+
await this.client.request(MODEL_COMMANDS.openSettings, {});
|
|
1628
|
+
}
|
|
1607
1629
|
/** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
|
|
1608
1630
|
async startAsync(job) {
|
|
1609
1631
|
const answer = await this.client.request(MODEL_COMMANDS.start, {
|