@byokit/pair 0.10.3 → 0.10.4
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/CHANGELOG.md +4 -0
- package/README.md +2 -1
- package/dist/host.d.ts +2 -1
- package/dist/host.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.10.4 (2026-10-18)
|
|
6
|
+
|
|
7
|
+
- FIX: A code that ran out while the person was saying yes now tells the computer too. When the yes landed after the offer's own expiry but inside the answer time, the device was refused `expired` while `confirm`'s `signal` never aborted, so the computer said nothing; it now aborts once, the same way a run-out during the question does, and still no grant is written.
|
|
8
|
+
|
|
5
9
|
## 0.10.3 (2026-10-17)
|
|
6
10
|
|
|
7
11
|
- FIX: A pairing code that runs out while the computer's person has not answered now tells the device "That pairing code has run out" instead of "Your computer said no to this device". `confirm` gets a second argument, `{ signal }`, that aborts when the code runs out so the computer's prompt can close; a yes that comes later grants nothing.
|
package/README.md
CHANGED
|
@@ -500,7 +500,8 @@ the real host, so **both screens still show the same two words and host approval
|
|
|
500
500
|
Only an explicit affirmative response after matching words should return `true` from `confirm`.
|
|
501
501
|
The kit has no approval UI; exceptions decline. A confirmation still pending when the code runs out is refused as
|
|
502
502
|
`expired` (the device says the code ran out), and `confirm`'s `signal` aborts then so the prompt can close; a yes
|
|
503
|
-
that arrives later grants nothing.
|
|
503
|
+
that arrives later grants nothing. A yes that lands after the code ran out but before that answer time is up is refused
|
|
504
|
+
the same way: the device hears `expired` and the `signal` aborts, so the computer can say so too.
|
|
504
505
|
|
|
505
506
|
For relay discovery, display the separate six-character `RelayClient.code()` lookup alongside
|
|
506
507
|
the full `host.shortCode()` pairing code. The device calls `findHost(relay, lookup)` from
|
package/dist/host.d.ts
CHANGED
|
@@ -65,7 +65,8 @@ export type HostOptions = {
|
|
|
65
65
|
/** Answers a device's request. Runs on the host, with the host's credentials; the device only gets the answer. */
|
|
66
66
|
handle: (req: LinkRequest, device: Grant) => unknown;
|
|
67
67
|
/** Asks the person at the host whether this device may join; nothing is stored until it says yes. `signal` aborts
|
|
68
|
-
* when the pairing code runs out, so the app can close its prompt
|
|
68
|
+
* when the pairing code runs out, so the app can close its prompt, and also when a yes lands after it ran out;
|
|
69
|
+
* a yes that comes later grants nothing. */
|
|
69
70
|
confirm: (p: PairRequest, o: {
|
|
70
71
|
signal: AbortSignal;
|
|
71
72
|
}) => boolean | Promise<boolean>;
|
package/dist/host.js
CHANGED
|
@@ -465,6 +465,8 @@ export class Host {
|
|
|
465
465
|
refuse('full');
|
|
466
466
|
}
|
|
467
467
|
catch (e) {
|
|
468
|
+
if (e instanceof PairExpired)
|
|
469
|
+
ask.abort(); // the offer ran out during the yes: tell the computer too
|
|
468
470
|
if (!gone)
|
|
469
471
|
refuse(e instanceof PairExpired ? 'expired' : 'failed');
|
|
470
472
|
}
|
package/package.json
CHANGED