relay-companion 0.1.620 → 0.1.622
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/package.json
CHANGED
package/skill/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "relay",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.81",
|
|
5
5
|
"consentVersion": 2,
|
|
6
6
|
"baseUrl": "https://sendrelays.com/skills/relay/v1.1.79",
|
|
7
7
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "scripts/relay-protocol.mjs",
|
|
24
|
-
"sha256": "
|
|
24
|
+
"sha256": "cb7c0417038ef7dca44d94e6b115ebbd5ee4eff4e5b33d00cc91b0eafb34313d"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "scripts/relay-local.mjs",
|
|
@@ -426,12 +426,19 @@ async function connectFinish() {
|
|
|
426
426
|
if (error?.code === "ENOENT") throw new Error("No Relay browser approval is waiting. Start the connection again.");
|
|
427
427
|
throw new Error("Relay's pending authorization could not be read.");
|
|
428
428
|
}
|
|
429
|
+
// The key this computer used until now is replaced by the new one, so the
|
|
430
|
+
// person's list of connected AIs keeps one row per computer.
|
|
431
|
+
let replacesToken;
|
|
432
|
+
try {
|
|
433
|
+
const existing = JSON.parse(fs.readFileSync(configPath(), "utf8"));
|
|
434
|
+
if (existing?.apiUrl === pending.apiUrl && /^web_[A-Za-z0-9_-]{16,250}$/.test(String(existing.accessToken || ""))) replacesToken = existing.accessToken;
|
|
435
|
+
} catch {}
|
|
429
436
|
let response;
|
|
430
437
|
try {
|
|
431
438
|
response = await publicRequest(
|
|
432
439
|
pending.apiUrl,
|
|
433
440
|
`/v1/agent/authorizations/${encodeURIComponent(pending.authorizationId)}/consume`,
|
|
434
|
-
{ clientSecret: pending.clientSecret, codeVerifier: pending.codeVerifier },
|
|
441
|
+
{ clientSecret: pending.clientSecret, codeVerifier: pending.codeVerifier, ...(replacesToken ? { replacesToken } : {}) },
|
|
435
442
|
);
|
|
436
443
|
} catch (error) {
|
|
437
444
|
if (Number(error?.status) === 409 && error?.code === "authorization_pending") {
|