@nestor-home/satellite 0.2.0 → 0.3.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 +1 -1
- package/dist/codes.d.ts +2 -2
- package/dist/codes.js +1 -1
- package/dist/node/cli.d.ts +2 -2
- package/dist/node/cli.js +3 -3
- package/dist/node/env.d.ts +1 -1
- package/dist/node/env.js +1 -1
- package/dist/node/tokens.js +1 -1
- package/dist/node/tokens.js.map +1 -1
- package/dist/pairing.d.ts +1 -1
- package/dist/satellite.d.ts +2 -2
- package/dist/satellite.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/codes.ts +2 -2
- package/src/node/cli.ts +3 -3
- package/src/node/env.ts +1 -1
- package/src/node/tokens.ts +1 -1
- package/src/pairing.ts +1 -1
- package/src/satellite.ts +2 -2
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ button.onclick = () => satellite.run(); // a click: browsers only play sound aft
|
|
|
54
54
|
In Node, the machine's microphone and speaker, with nothing to write:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
NESTOR_PAIRING_URI='nestor+http://nestor.local:
|
|
57
|
+
NESTOR_PAIRING_URI='nestor+http://nestor.local:8471/?code=K7QF2M9X' npx nestor-satellite run --room salon
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
The recorded voice that says device codes is shared under CC BY 4.0: see
|
package/dist/codes.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the device (configured, typed or scanned). Reading one back forgives case, dashes, spaces and the
|
|
9
9
|
* letters Crockford maps to digits (O → 0, I and L → 1).
|
|
10
10
|
*
|
|
11
|
-
* Pairing URI: `nestor+http://nestor.local:
|
|
11
|
+
* Pairing URI: `nestor+http://nestor.local:8471/?code=K7QF2M9X`, the core's base URL prefixed with
|
|
12
12
|
* `nestor+`, and the enrollment code.
|
|
13
13
|
*/
|
|
14
14
|
/** Crockford's base32: no I, L, O, U. */
|
|
@@ -20,7 +20,7 @@ export declare function normalizeEnrollmentCode(text: string): string | null;
|
|
|
20
20
|
/** How an enrollment code is shown to people: `K7QF-2M9X`. */
|
|
21
21
|
export declare function groupEnrollmentCode(code: string): string;
|
|
22
22
|
export interface PairingUri {
|
|
23
|
-
/** The core's base URL, e.g. `http://nestor.local:
|
|
23
|
+
/** The core's base URL, e.g. `http://nestor.local:8471`. */
|
|
24
24
|
readonly core: string;
|
|
25
25
|
/** The enrollment code, canonical form. */
|
|
26
26
|
readonly code: string;
|
package/dist/codes.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the device (configured, typed or scanned). Reading one back forgives case, dashes, spaces and the
|
|
9
9
|
* letters Crockford maps to digits (O → 0, I and L → 1).
|
|
10
10
|
*
|
|
11
|
-
* Pairing URI: `nestor+http://nestor.local:
|
|
11
|
+
* Pairing URI: `nestor+http://nestor.local:8471/?code=K7QF2M9X`, the core's base URL prefixed with
|
|
12
12
|
* `nestor+`, and the enrollment code.
|
|
13
13
|
*/
|
|
14
14
|
import { ProtocolError } from "./protocol.js";
|
package/dist/node/cli.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `nestor-satellite run`: this machine's microphone and speaker as a satellite of a Nestor core.
|
|
3
3
|
*
|
|
4
|
-
* nestor-satellite run --core http://nestor.local:
|
|
5
|
-
* NESTOR_PAIRING_URI=nestor+http://nestor.local:
|
|
4
|
+
* nestor-satellite run --core http://nestor.local:8471 --room salon
|
|
5
|
+
* NESTOR_PAIRING_URI=nestor+http://nestor.local:8471/?code=K7QF2M9X nestor-satellite run --room salon
|
|
6
6
|
*
|
|
7
7
|
* With an enrollment code (`--pairing-uri`, `--pairing-code`, or the same in `NESTOR_PAIRING_URI`,
|
|
8
8
|
* `NESTOR_PAIRING_CODE`), the first run pairs at once; without one, it says a device code to type in
|
package/dist/node/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `nestor-satellite run`: this machine's microphone and speaker as a satellite of a Nestor core.
|
|
3
3
|
*
|
|
4
|
-
* nestor-satellite run --core http://nestor.local:
|
|
5
|
-
* NESTOR_PAIRING_URI=nestor+http://nestor.local:
|
|
4
|
+
* nestor-satellite run --core http://nestor.local:8471 --room salon
|
|
5
|
+
* NESTOR_PAIRING_URI=nestor+http://nestor.local:8471/?code=K7QF2M9X nestor-satellite run --room salon
|
|
6
6
|
*
|
|
7
7
|
* With an enrollment code (`--pairing-uri`, `--pairing-code`, or the same in `NESTOR_PAIRING_URI`,
|
|
8
8
|
* `NESTOR_PAIRING_CODE`), the first run pairs at once; without one, it says a device code to type in
|
|
@@ -27,7 +27,7 @@ const USAGE = `Usage: nestor-satellite run --core <url> --room <room> [options]
|
|
|
27
27
|
Run this machine's microphone and speaker as a Nestor satellite.
|
|
28
28
|
|
|
29
29
|
Options:
|
|
30
|
-
--core <url> the core's voice server, e.g. http://nestor.local:
|
|
30
|
+
--core <url> the core's voice server, e.g. http://nestor.local:8471
|
|
31
31
|
(required unless a pairing URI gives it)
|
|
32
32
|
--room <slug> the room the satellite is in: salon, cuisine… (required)
|
|
33
33
|
--pairing-uri <uri> pair with this pairing URI, made in Nestor when adding a satellite:
|
package/dist/node/env.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* What a headless device reads from its environment (P1): the pairing URI or the enrollment code a
|
|
3
3
|
* person configured, and the language to speak to people in.
|
|
4
4
|
*
|
|
5
|
-
* NESTOR_PAIRING_URI=nestor+http://nestor.local:
|
|
5
|
+
* NESTOR_PAIRING_URI=nestor+http://nestor.local:8471/?code=K7QF2M9X the core and the code
|
|
6
6
|
* NESTOR_PAIRING_CODE=K7QF-2M9X the code (the core given apart)
|
|
7
7
|
*/
|
|
8
8
|
export declare const PAIRING_URI_ENV = "NESTOR_PAIRING_URI";
|
package/dist/node/env.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* What a headless device reads from its environment (P1): the pairing URI or the enrollment code a
|
|
3
3
|
* person configured, and the language to speak to people in.
|
|
4
4
|
*
|
|
5
|
-
* NESTOR_PAIRING_URI=nestor+http://nestor.local:
|
|
5
|
+
* NESTOR_PAIRING_URI=nestor+http://nestor.local:8471/?code=K7QF2M9X the core and the code
|
|
6
6
|
* NESTOR_PAIRING_CODE=K7QF-2M9X the code (the core given apart)
|
|
7
7
|
*/
|
|
8
8
|
import { normalizeEnrollmentCode, parsePairingUri } from "../codes.js";
|
package/dist/node/tokens.js
CHANGED
|
@@ -44,7 +44,7 @@ export class FileTokenStore {
|
|
|
44
44
|
}
|
|
45
45
|
await mkdir(dirname(this.path), { recursive: true, mode: 0o700 });
|
|
46
46
|
await writeFile(this.path, text, { mode: 0o600 });
|
|
47
|
-
await chmod(this.path, 0o600); //
|
|
47
|
+
await chmod(this.path, 0o600); // whoever made the file, only its owner reads it
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
//# sourceMappingURL=tokens.js.map
|
package/dist/node/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/node/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAoB,SAAS,EAAqB,SAAS,EAAmB,UAAU,EAAE,MAAM,cAAc,CAAC;AAGtH;;;GAGG;AACH,MAAM,OAAO,cAAc;IAChB,IAAI,CAAS;IAEtB,YAAY,IAAY;QACtB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,C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AAC,CAAC;IAC9G,CAAC;IAEO,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,QAAgB,EAAE,MAA2C;QAC9F,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;IAEO,KAAK,CAAC,IAAI;QAChB,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,KAAK,CAAC,IAAmB;QACrC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,OAAO;QACT,CAAC;QACD,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAClE,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAClD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,iDAAiD;IAClF,CAAC;CACF"}
|
package/dist/pairing.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export type EnrollOutcome =
|
|
|
84
84
|
readonly status: "invalid";
|
|
85
85
|
};
|
|
86
86
|
export interface PairingOptions {
|
|
87
|
-
/** The core's base URL, e.g. `http://nestor.local:
|
|
87
|
+
/** The core's base URL, e.g. `http://nestor.local:8471`. */
|
|
88
88
|
readonly core: string;
|
|
89
89
|
/** Sent with each request; its `pairing_methods` must match what this pairing can do. */
|
|
90
90
|
readonly manifest: Manifest;
|
package/dist/satellite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A satellite's life: pair once, then stay connected to the core, reconnecting when the link drops.
|
|
3
3
|
*
|
|
4
|
-
* const satellite = new Satellite({ core: "http://nestor.local:
|
|
4
|
+
* const satellite = new Satellite({ core: "http://nestor.local:8471", manifest, tokens, webrtc, body });
|
|
5
5
|
* await satellite.run(signal); // until the signal aborts
|
|
6
6
|
*
|
|
7
7
|
* Pairing (`./pairing.ts`) uses the enrollment code it was configured with, else presents its device
|
|
@@ -61,7 +61,7 @@ export interface PairingSetup extends Omit<PairingOutputs, "voice"> {
|
|
|
61
61
|
readonly pollMs?: number;
|
|
62
62
|
}
|
|
63
63
|
export interface SatelliteOptions {
|
|
64
|
-
/** The core's voice server, e.g. `http://nestor.local:
|
|
64
|
+
/** The core's voice server, e.g. `http://nestor.local:8471`. */
|
|
65
65
|
readonly core: string;
|
|
66
66
|
/** What the device is and can do; its `pairing_methods` are set from `pairing`. */
|
|
67
67
|
readonly manifest: Manifest;
|
package/dist/satellite.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A satellite's life: pair once, then stay connected to the core, reconnecting when the link drops.
|
|
3
3
|
*
|
|
4
|
-
* const satellite = new Satellite({ core: "http://nestor.local:
|
|
4
|
+
* const satellite = new Satellite({ core: "http://nestor.local:8471", manifest, tokens, webrtc, body });
|
|
5
5
|
* await satellite.run(signal); // until the signal aborts
|
|
6
6
|
*
|
|
7
7
|
* Pairing (`./pairing.ts`) uses the enrollment code it was configured with, else presents its device
|
package/dist/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Sent in the manifest (`sdk`). release-please keeps the version equal to `package.json`. */
|
|
2
2
|
export declare const SDK_NAME = "@nestor-home/satellite";
|
|
3
|
-
export declare const SDK_VERSION = "0.
|
|
3
|
+
export declare const SDK_VERSION = "0.3.0";
|
|
4
4
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Sent in the manifest (`sdk`). release-please keeps the version equal to `package.json`. */
|
|
2
2
|
export const SDK_NAME = "@nestor-home/satellite";
|
|
3
|
-
export const SDK_VERSION = "0.
|
|
3
|
+
export const SDK_VERSION = "0.3.0"; // x-release-please-version
|
|
4
4
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestor-home/satellite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "TypeScript SDK to write Nestor satellites, in browsers and in Node: pairing, WebRTC audio and the nestor data channel.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nestor",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"./package.json": "./package.json"
|
|
42
42
|
},
|
|
43
43
|
"bin": {
|
|
44
|
-
"nestor-satellite": "
|
|
44
|
+
"nestor-satellite": "dist/node/bin.js"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|
package/src/codes.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the device (configured, typed or scanned). Reading one back forgives case, dashes, spaces and the
|
|
9
9
|
* letters Crockford maps to digits (O → 0, I and L → 1).
|
|
10
10
|
*
|
|
11
|
-
* Pairing URI: `nestor+http://nestor.local:
|
|
11
|
+
* Pairing URI: `nestor+http://nestor.local:8471/?code=K7QF2M9X`, the core's base URL prefixed with
|
|
12
12
|
* `nestor+`, and the enrollment code.
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -37,7 +37,7 @@ export function groupEnrollmentCode(code: string): string {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export interface PairingUri {
|
|
40
|
-
/** The core's base URL, e.g. `http://nestor.local:
|
|
40
|
+
/** The core's base URL, e.g. `http://nestor.local:8471`. */
|
|
41
41
|
readonly core: string;
|
|
42
42
|
/** The enrollment code, canonical form. */
|
|
43
43
|
readonly code: string;
|
package/src/node/cli.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `nestor-satellite run`: this machine's microphone and speaker as a satellite of a Nestor core.
|
|
3
3
|
*
|
|
4
|
-
* nestor-satellite run --core http://nestor.local:
|
|
5
|
-
* NESTOR_PAIRING_URI=nestor+http://nestor.local:
|
|
4
|
+
* nestor-satellite run --core http://nestor.local:8471 --room salon
|
|
5
|
+
* NESTOR_PAIRING_URI=nestor+http://nestor.local:8471/?code=K7QF2M9X nestor-satellite run --room salon
|
|
6
6
|
*
|
|
7
7
|
* With an enrollment code (`--pairing-uri`, `--pairing-code`, or the same in `NESTOR_PAIRING_URI`,
|
|
8
8
|
* `NESTOR_PAIRING_CODE`), the first run pairs at once; without one, it says a device code to type in
|
|
@@ -33,7 +33,7 @@ const USAGE = `Usage: nestor-satellite run --core <url> --room <room> [options]
|
|
|
33
33
|
Run this machine's microphone and speaker as a Nestor satellite.
|
|
34
34
|
|
|
35
35
|
Options:
|
|
36
|
-
--core <url> the core's voice server, e.g. http://nestor.local:
|
|
36
|
+
--core <url> the core's voice server, e.g. http://nestor.local:8471
|
|
37
37
|
(required unless a pairing URI gives it)
|
|
38
38
|
--room <slug> the room the satellite is in: salon, cuisine… (required)
|
|
39
39
|
--pairing-uri <uri> pair with this pairing URI, made in Nestor when adding a satellite:
|
package/src/node/env.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* What a headless device reads from its environment (P1): the pairing URI or the enrollment code a
|
|
3
3
|
* person configured, and the language to speak to people in.
|
|
4
4
|
*
|
|
5
|
-
* NESTOR_PAIRING_URI=nestor+http://nestor.local:
|
|
5
|
+
* NESTOR_PAIRING_URI=nestor+http://nestor.local:8471/?code=K7QF2M9X the core and the code
|
|
6
6
|
* NESTOR_PAIRING_CODE=K7QF-2M9X the code (the core given apart)
|
|
7
7
|
*/
|
|
8
8
|
|
package/src/node/tokens.ts
CHANGED
|
@@ -54,6 +54,6 @@ export class FileTokenStore implements TokenStore {
|
|
|
54
54
|
}
|
|
55
55
|
await mkdir(dirname(this.path), { recursive: true, mode: 0o700 });
|
|
56
56
|
await writeFile(this.path, text, { mode: 0o600 });
|
|
57
|
-
await chmod(this.path, 0o600); //
|
|
57
|
+
await chmod(this.path, 0o600); // whoever made the file, only its owner reads it
|
|
58
58
|
}
|
|
59
59
|
}
|
package/src/pairing.ts
CHANGED
|
@@ -102,7 +102,7 @@ export type EnrollOutcome =
|
|
|
102
102
|
| { readonly status: "invalid" };
|
|
103
103
|
|
|
104
104
|
export interface PairingOptions {
|
|
105
|
-
/** The core's base URL, e.g. `http://nestor.local:
|
|
105
|
+
/** The core's base URL, e.g. `http://nestor.local:8471`. */
|
|
106
106
|
readonly core: string;
|
|
107
107
|
/** Sent with each request; its `pairing_methods` must match what this pairing can do. */
|
|
108
108
|
readonly manifest: Manifest;
|
package/src/satellite.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A satellite's life: pair once, then stay connected to the core, reconnecting when the link drops.
|
|
3
3
|
*
|
|
4
|
-
* const satellite = new Satellite({ core: "http://nestor.local:
|
|
4
|
+
* const satellite = new Satellite({ core: "http://nestor.local:8471", manifest, tokens, webrtc, body });
|
|
5
5
|
* await satellite.run(signal); // until the signal aborts
|
|
6
6
|
*
|
|
7
7
|
* Pairing (`./pairing.ts`) uses the enrollment code it was configured with, else presents its device
|
|
@@ -91,7 +91,7 @@ export interface PairingSetup extends Omit<PairingOutputs, "voice"> {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
export interface SatelliteOptions {
|
|
94
|
-
/** The core's voice server, e.g. `http://nestor.local:
|
|
94
|
+
/** The core's voice server, e.g. `http://nestor.local:8471`. */
|
|
95
95
|
readonly core: string;
|
|
96
96
|
/** What the device is and can do; its `pairing_methods` are set from `pairing`. */
|
|
97
97
|
readonly manifest: Manifest;
|
package/src/version.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Sent in the manifest (`sdk`). release-please keeps the version equal to `package.json`. */
|
|
2
2
|
export const SDK_NAME = "@nestor-home/satellite";
|
|
3
|
-
export const SDK_VERSION = "0.
|
|
3
|
+
export const SDK_VERSION = "0.3.0"; // x-release-please-version
|