@capybara-hq/plugin-device-local 0.1.0-rc.10 → 0.1.0-rc.11
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/.capybara-plugin/plugin.json +2 -2
- package/dist/index.mjs +11 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "device-local",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.11",
|
|
5
5
|
"publisher": "Capybara",
|
|
6
6
|
"description": {
|
|
7
7
|
"en": "Devices on people's own computers: a machine connected with capybara-device serves the device over the dial-in channel, and its owner limits it there",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"entry": "./dist/index.mjs",
|
|
24
24
|
"manifest": {
|
|
25
25
|
"name": "device-local",
|
|
26
|
-
"version": "0.1.0-rc.
|
|
26
|
+
"version": "0.1.0-rc.11",
|
|
27
27
|
"sdk": "^0.1.0-rc.56",
|
|
28
28
|
"provides": [
|
|
29
29
|
"device-provider@1"
|
package/dist/index.mjs
CHANGED
|
@@ -4594,6 +4594,7 @@ function filesDigestOf(files) {
|
|
|
4594
4594
|
}
|
|
4595
4595
|
return `sha256:${h.digest("hex")}`;
|
|
4596
4596
|
}
|
|
4597
|
+
var OLD_SERVICE_NAME_REFUSAL = /Invalid device service name\b/;
|
|
4597
4598
|
function serviceFailure(error, op) {
|
|
4598
4599
|
const message = typeof error.message === "string" ? error.message : "no message";
|
|
4599
4600
|
switch (error.kind) {
|
|
@@ -4609,6 +4610,10 @@ function serviceFailure(error, op) {
|
|
|
4609
4610
|
"files_needed"
|
|
4610
4611
|
);
|
|
4611
4612
|
case "invalid":
|
|
4613
|
+
if (OLD_SERVICE_NAME_REFUSAL.test(message))
|
|
4614
|
+
return new SandboxPermissionUnsupportedError(
|
|
4615
|
+
"The connected machine runs a capybara-device that predates device service ids; update capybara-device on that machine, then retry"
|
|
4616
|
+
);
|
|
4612
4617
|
return new ServiceOpRefusedError(
|
|
4613
4618
|
`The connected machine refused the ${op} request: ${message} (check the request and retry)`,
|
|
4614
4619
|
"invalid"
|
|
@@ -5070,8 +5075,10 @@ function createDeviceLocalProvider(ctx, store, opts = {}) {
|
|
|
5070
5075
|
/**
|
|
5071
5076
|
* Needs the machine online. Ends any background work a suspension could not reach (the machine
|
|
5072
5077
|
* was offline then), then re-verifies the generation's binding. `gone` (the kernel recreates the
|
|
5073
|
-
* instance) when the handle is not this provider's, the
|
|
5074
|
-
*
|
|
5078
|
+
* instance) when the handle is not this provider's, the machine's hello did not attest the
|
|
5079
|
+
* generation (unattested: answered at once, with no round trip), the device directory's roots
|
|
5080
|
+
* changed (a new login into another directory or mode), or the generation can never be bound
|
|
5081
|
+
* again.
|
|
5075
5082
|
*/
|
|
5076
5083
|
async resume(h, signal) {
|
|
5077
5084
|
signal.throwIfAborted();
|
|
@@ -5080,6 +5087,7 @@ function createDeviceLocalProvider(ctx, store, opts = {}) {
|
|
|
5080
5087
|
if (!await ctx.dialIn.online(l.id)) throw new DeviceOfflineError(l.id);
|
|
5081
5088
|
const current = await store.binding(l.id);
|
|
5082
5089
|
if (current?.generation !== l.generation) return "gone";
|
|
5090
|
+
if (current.unattested) return "gone";
|
|
5083
5091
|
const roots = await machineCreate(l.id, current.limits ?? l.limits, signal);
|
|
5084
5092
|
if (!sameRoots2(roots, l.roots)) return "gone";
|
|
5085
5093
|
return await bindings.rebind(l.id, l.generation, signal) === "bound" ? "resumed" : "gone";
|
|
@@ -5216,7 +5224,7 @@ function createDeviceLocalProvider(ctx, store, opts = {}) {
|
|
|
5216
5224
|
// src/index.ts
|
|
5217
5225
|
var plugin = defineExtension({
|
|
5218
5226
|
name: "device-local",
|
|
5219
|
-
version: "0.1.0-rc.
|
|
5227
|
+
version: "0.1.0-rc.11",
|
|
5220
5228
|
// ctx.dialIn.capacity and the handlers' connection argument are the rc.56 SDK's
|
|
5221
5229
|
sdk: "^0.1.0-rc.56",
|
|
5222
5230
|
provides: [DEVICE_PROVIDER_EXTENSION_POINT],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/plugin-device-local",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Devices on people's own computers: a machine connected with capybara-device serves the device over the dial-in channel, and its owner limits it there",
|