@hellolynk-ai/trae-work-mcp 0.4.99 → 0.4.101
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/hellolynk-client-pack-manifest.json +19 -19
- package/hellolynk-client-pack-pin.json +1 -1
- package/integrations/trae-work/package.json +1 -1
- package/package.json +1 -1
- package/runtime/bootstrap/core/hellolynk-client-core.mjs +64 -14
- package/runtime/bootstrap/core/hellolynk-platform-credential-store.mjs +32 -0
- package/runtime/core/hellolynk-client-core.mjs +64 -14
- package/runtime/core/hellolynk-neutral-host-assembly.mjs +8 -18
- package/runtime/core/hellolynk-neutral-host-process.mjs +102 -26
- package/runtime/core/hellolynk-platform-credential-store.mjs +32 -0
- package/runtime/neutral-host-release-manifest.json +7 -7
- package/runtime/neutral-host-release-pin.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"contract": "hellolynk-client-npm-pack-manifest-v1",
|
|
3
3
|
"client": "trae-work",
|
|
4
4
|
"packageName": "@hellolynk-ai/trae-work-mcp",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.101",
|
|
6
6
|
"workbench": {
|
|
7
7
|
"path": "runtime/workbench/hellolynk-workbench-build.json",
|
|
8
8
|
"contract": "hellolynk-shared-workbench-build-v1",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"path": "integrations/trae-work/package.json",
|
|
25
|
-
"bytes":
|
|
26
|
-
"sha256": "
|
|
25
|
+
"bytes": 496,
|
|
26
|
+
"sha256": "2eb6935f4e8faf49d6010c810eac516b5887f8aee4d534a486d486cac60235b2"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "integrations/trae-work/runtime/neutral-host-bootstrap.mjs",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"path": "package.json",
|
|
105
|
-
"bytes":
|
|
106
|
-
"sha256": "
|
|
105
|
+
"bytes": 1851,
|
|
106
|
+
"sha256": "9d932e4a6de05ea4db57fa083e3c5bc8cc27c170376393fdb05ea8d40fad33a0"
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
"path": "README.md",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"path": "runtime/bootstrap/core/hellolynk-client-core.mjs",
|
|
120
|
-
"bytes":
|
|
121
|
-
"sha256": "
|
|
120
|
+
"bytes": 36628,
|
|
121
|
+
"sha256": "5d2190c2354ede169b2053864674c7ae5b80985970dc13609d6818c5a6d16940"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
"path": "runtime/bootstrap/core/hellolynk-client-profile.mjs",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
"path": "runtime/bootstrap/core/hellolynk-platform-credential-store.mjs",
|
|
160
|
-
"bytes":
|
|
161
|
-
"sha256": "
|
|
160
|
+
"bytes": 40982,
|
|
161
|
+
"sha256": "4a4f073c3a5398d0d51be5a28c1b86b06e6f3b0b613e833928d8437c030cf65f"
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
164
|
"path": "runtime/bootstrap/core/hellolynk-runtime-safety.cjs",
|
|
@@ -187,8 +187,8 @@
|
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
"path": "runtime/core/hellolynk-client-core.mjs",
|
|
190
|
-
"bytes":
|
|
191
|
-
"sha256": "
|
|
190
|
+
"bytes": 36628,
|
|
191
|
+
"sha256": "5d2190c2354ede169b2053864674c7ae5b80985970dc13609d6818c5a6d16940"
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
"path": "runtime/core/hellolynk-client-profile.mjs",
|
|
@@ -372,8 +372,8 @@
|
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
"path": "runtime/core/hellolynk-neutral-host-assembly.mjs",
|
|
375
|
-
"bytes":
|
|
376
|
-
"sha256": "
|
|
375
|
+
"bytes": 47470,
|
|
376
|
+
"sha256": "5a09b332a869c3863ac92c798a1a5df5901607987a2427a20b06154e41e17cb8"
|
|
377
377
|
},
|
|
378
378
|
{
|
|
379
379
|
"path": "runtime/core/hellolynk-neutral-host-installation-store.mjs",
|
|
@@ -387,8 +387,8 @@
|
|
|
387
387
|
},
|
|
388
388
|
{
|
|
389
389
|
"path": "runtime/core/hellolynk-neutral-host-process.mjs",
|
|
390
|
-
"bytes":
|
|
391
|
-
"sha256": "
|
|
390
|
+
"bytes": 234159,
|
|
391
|
+
"sha256": "0a66fca2b862fde9269722f026fc67e9d1c79435f0d410809aee669be9f9f497"
|
|
392
392
|
},
|
|
393
393
|
{
|
|
394
394
|
"path": "runtime/core/hellolynk-neutral-host-store-adapters.mjs",
|
|
@@ -402,8 +402,8 @@
|
|
|
402
402
|
},
|
|
403
403
|
{
|
|
404
404
|
"path": "runtime/core/hellolynk-platform-credential-store.mjs",
|
|
405
|
-
"bytes":
|
|
406
|
-
"sha256": "
|
|
405
|
+
"bytes": 40982,
|
|
406
|
+
"sha256": "4a4f073c3a5398d0d51be5a28c1b86b06e6f3b0b613e833928d8437c030cf65f"
|
|
407
407
|
},
|
|
408
408
|
{
|
|
409
409
|
"path": "runtime/core/hellolynk-relay-client-cli.mjs",
|
|
@@ -448,12 +448,12 @@
|
|
|
448
448
|
{
|
|
449
449
|
"path": "runtime/neutral-host-release-manifest.json",
|
|
450
450
|
"bytes": 15630,
|
|
451
|
-
"sha256": "
|
|
451
|
+
"sha256": "8561015215e14fe8f8b5f1a18ecccefa717cdff05c40f8eee8d21af328bc3174"
|
|
452
452
|
},
|
|
453
453
|
{
|
|
454
454
|
"path": "runtime/neutral-host-release-pin.json",
|
|
455
455
|
"bytes": 146,
|
|
456
|
-
"sha256": "
|
|
456
|
+
"sha256": "e68717f720a3f92c3af036dc99556ff188c6b3249f65c55bbbef675d92235176"
|
|
457
457
|
},
|
|
458
458
|
{
|
|
459
459
|
"path": "runtime/platform/windows/configure-agent.ps1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hellolynk-ai/trae-work-mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.101",
|
|
4
4
|
"description": "HelloLynk Messaging for TRAE Work: open conversations and let your AI message other people's AI assistants.",
|
|
5
5
|
"homepage": "https://hellolynk.com",
|
|
6
6
|
"repository": {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
import runtimeSafety from "./hellolynk-runtime-safety.cjs";
|
|
2
3
|
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
3
4
|
const MAX_JSON_RESPONSE_BYTES = 256 * 1024;
|
|
4
5
|
const LOOPBACK_HOSTS = new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
5
6
|
const DEVICE_RUNTIME_TTL_MS = 20 * 60 * 1000;
|
|
6
7
|
const DEVICE_RUNTIME_RECOVERY_WINDOW_MS = 120_000;
|
|
8
|
+
const DEVICE_CREDENTIAL_RECHECK_MS = 60 * 60_000;
|
|
7
9
|
const DEVICE_RUNTIME_SCOPES = Object.freeze([
|
|
8
10
|
"relay.text.receive",
|
|
9
11
|
"relay.text.send",
|
|
@@ -567,6 +569,7 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
567
569
|
const issue = options.issue || issueDeviceRuntimeSession;
|
|
568
570
|
const now = options.now || (() => Date.now());
|
|
569
571
|
const sessionStore = options.sessionStore || null;
|
|
572
|
+
const credentialRejections = sessionStore?.credentialRejections;
|
|
570
573
|
const sessionKey = options.sessionKey == null ? null : String(options.sessionKey);
|
|
571
574
|
if (sessionStore && (
|
|
572
575
|
!sessionKey ||
|
|
@@ -580,6 +583,8 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
580
583
|
5 * 60 * 1000,
|
|
581
584
|
);
|
|
582
585
|
let current = null;
|
|
586
|
+
let rejectedCredential = null;
|
|
587
|
+
let localIssueTail = Promise.resolve();
|
|
583
588
|
|
|
584
589
|
const routeMatches = (session, input) => {
|
|
585
590
|
const expectedValues = [
|
|
@@ -652,22 +657,67 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
652
657
|
return proof;
|
|
653
658
|
};
|
|
654
659
|
|
|
660
|
+
const issueSession = async (input, previousSession) => {
|
|
661
|
+
const request = { ...input, previousSession };
|
|
662
|
+
if (options.loadDeviceCredential) request.deviceCredential = await options.loadDeviceCredential();
|
|
663
|
+
const fingerprint = request.deviceCredential && request.baseUrl
|
|
664
|
+
? createHash("sha256").update(JSON.stringify([
|
|
665
|
+
normalizeHelloLynkBaseUrl(request.baseUrl, { allowLoopbackHttp: request.allowLoopbackHttp === true }),
|
|
666
|
+
request.deviceCredential,
|
|
667
|
+
])).digest("hex")
|
|
668
|
+
: null;
|
|
669
|
+
// The production caller holds the existing session lock, including across
|
|
670
|
+
// Host processes. An authority denial may drain the current Host.
|
|
671
|
+
if (fingerprint) {
|
|
672
|
+
const isCoolingDown = (rejection) => {
|
|
673
|
+
if (rejection?.fingerprint !== fingerprint) return false;
|
|
674
|
+
const age = now() - rejection.rejectedAtMs;
|
|
675
|
+
return age >= 0 && age < DEVICE_CREDENTIAL_RECHECK_MS;
|
|
676
|
+
};
|
|
677
|
+
// A generic denial may clear after a server-side repair, without a new
|
|
678
|
+
// credential. The lock permits one recheck once the cooldown ends.
|
|
679
|
+
if (isCoolingDown(rejectedCredential)
|
|
680
|
+
|| isCoolingDown(await credentialRejections?.load(sessionKey).catch(() => null))) {
|
|
681
|
+
throw new HelloLynkClientError("device_credential_invalid", { httpStatus: 401 });
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
let session;
|
|
685
|
+
try {
|
|
686
|
+
session = reusable(await issue(request), input);
|
|
687
|
+
} catch (error) {
|
|
688
|
+
if (fingerprint && error?.httpStatus === 401 && error.code === "device_credential_invalid") {
|
|
689
|
+
rejectedCredential = { fingerprint, rejectedAtMs: now() };
|
|
690
|
+
// Preserve the authority denial even if local storage is unavailable.
|
|
691
|
+
await credentialRejections?.save(sessionKey, rejectedCredential).catch(() => {});
|
|
692
|
+
}
|
|
693
|
+
throw error;
|
|
694
|
+
}
|
|
695
|
+
if (session && fingerprint) {
|
|
696
|
+
rejectedCredential = null;
|
|
697
|
+
await credentialRejections?.remove(sessionKey).catch(() => {});
|
|
698
|
+
}
|
|
699
|
+
return session;
|
|
700
|
+
};
|
|
701
|
+
|
|
655
702
|
return {
|
|
656
703
|
async get(input) {
|
|
657
704
|
if (!sessionStore) {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
705
|
+
const result = localIssueTail.then(async () => {
|
|
706
|
+
if (
|
|
707
|
+
current && current.expiresAtMs - now() > minimumRemainingMs
|
|
708
|
+
&& routeMatches(current, input)
|
|
709
|
+
&& scopesMatch(current, input)
|
|
710
|
+
&& (input?.expectedAgentId == null || input.expectedAgentId === current.agentId)
|
|
711
|
+
&& (input?.expectedPrincipalId == null || input.expectedPrincipalId === current.principalId)
|
|
712
|
+
) return current;
|
|
713
|
+
const reusableCurrent = reusable(current, input);
|
|
714
|
+
if (reusableCurrent) return reusableCurrent;
|
|
715
|
+
current = await issueSession(input, recoveryProof(current, input));
|
|
716
|
+
if (!current) throw new HelloLynkClientError("invalid_runtime_session_handle");
|
|
717
|
+
return current;
|
|
718
|
+
});
|
|
719
|
+
localIssueTail = result.catch(() => {});
|
|
720
|
+
return result;
|
|
671
721
|
}
|
|
672
722
|
const inMemory = reusable(current, input);
|
|
673
723
|
if (inMemory) return inMemory;
|
|
@@ -678,7 +728,7 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
678
728
|
current = persisted;
|
|
679
729
|
return current;
|
|
680
730
|
}
|
|
681
|
-
const issued =
|
|
731
|
+
const issued = await issueSession(input, persisted);
|
|
682
732
|
if (!issued) throw new HelloLynkClientError("invalid_runtime_session_handle");
|
|
683
733
|
await sessionStore.save(sessionKey, issued);
|
|
684
734
|
current = issued;
|
|
@@ -297,6 +297,36 @@ export async function secureWindowsClientReleaseTree(clientRoot, releaseId, opti
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
// Accessed under the same cross-process lock as the corresponding session.
|
|
301
|
+
function createCredentialRejectionStore(root) {
|
|
302
|
+
const fileFor = (profile) => join(root, `runtime-session-rejection-${assertCredentialProfileId(profile)}.json`);
|
|
303
|
+
const isRejection = (value) => typeof value?.fingerprint === "string" && /^[a-f0-9]{64}$/.test(value.fingerprint)
|
|
304
|
+
&& Number.isSafeInteger(value.rejectedAtMs) && value.rejectedAtMs >= 0;
|
|
305
|
+
return {
|
|
306
|
+
async load(profile) {
|
|
307
|
+
let value;
|
|
308
|
+
try { value = JSON.parse(await readFile(fileFor(profile), "utf8")); }
|
|
309
|
+
catch (error) { if (error?.code === "ENOENT" || error instanceof SyntaxError) return null; throw error; }
|
|
310
|
+
return isRejection(value) ? value : null;
|
|
311
|
+
},
|
|
312
|
+
async save(profile, rejection) {
|
|
313
|
+
if (!isRejection(rejection)) throw new HelloLynkCredentialStoreError("invalid_credential_rejection");
|
|
314
|
+
const { fingerprint, rejectedAtMs } = rejection;
|
|
315
|
+
const file = fileFor(profile);
|
|
316
|
+
const temporary = `${file}.${randomBytes(12).toString("hex")}.tmp`;
|
|
317
|
+
try {
|
|
318
|
+
await writeFile(temporary, `${JSON.stringify({ fingerprint, rejectedAtMs })}\n`, { encoding: "utf8", flag: "wx", mode: 0o600 });
|
|
319
|
+
await rename(temporary, file);
|
|
320
|
+
} finally {
|
|
321
|
+
await rm(temporary, { force: true }).catch(() => {});
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
async remove(profile) {
|
|
325
|
+
await rm(fileFor(profile), { force: true });
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
300
330
|
export function createPlatformCredentialStore(options = {}) {
|
|
301
331
|
const platform = options.platform || process.platform;
|
|
302
332
|
const run = options.runHelper || runCredentialHelper;
|
|
@@ -370,6 +400,7 @@ export function createPlatformCredentialStore(options = {}) {
|
|
|
370
400
|
await invoke("Remove", assertCredentialProfileId(profile), "");
|
|
371
401
|
},
|
|
372
402
|
runtimeSessions: {
|
|
403
|
+
credentialRejections: createCredentialRejectionStore(runtimeStoreRoot),
|
|
373
404
|
async save(profile, session) {
|
|
374
405
|
const body = JSON.stringify({ schemaVersion: 1, ...assertRuntimeSession(session) });
|
|
375
406
|
await invoke("StoreRuntimeSession", assertCredentialProfileId(profile), body);
|
|
@@ -504,6 +535,7 @@ export function createPlatformCredentialStore(options = {}) {
|
|
|
504
535
|
},
|
|
505
536
|
async remove(profile) { await entry(root, "device", profile, "remove"); },
|
|
506
537
|
runtimeSessions: {
|
|
538
|
+
credentialRejections: createCredentialRejectionStore(root),
|
|
507
539
|
async save(profile, session) { await entry(root, "session", profile, "save", assertRuntimeSession(session)); },
|
|
508
540
|
async load(profile) {
|
|
509
541
|
const value = await entry(root, "session", profile, "load");
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
import runtimeSafety from "./hellolynk-runtime-safety.cjs";
|
|
2
3
|
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
3
4
|
const MAX_JSON_RESPONSE_BYTES = 256 * 1024;
|
|
4
5
|
const LOOPBACK_HOSTS = new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
5
6
|
const DEVICE_RUNTIME_TTL_MS = 20 * 60 * 1000;
|
|
6
7
|
const DEVICE_RUNTIME_RECOVERY_WINDOW_MS = 120_000;
|
|
8
|
+
const DEVICE_CREDENTIAL_RECHECK_MS = 60 * 60_000;
|
|
7
9
|
const DEVICE_RUNTIME_SCOPES = Object.freeze([
|
|
8
10
|
"relay.text.receive",
|
|
9
11
|
"relay.text.send",
|
|
@@ -567,6 +569,7 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
567
569
|
const issue = options.issue || issueDeviceRuntimeSession;
|
|
568
570
|
const now = options.now || (() => Date.now());
|
|
569
571
|
const sessionStore = options.sessionStore || null;
|
|
572
|
+
const credentialRejections = sessionStore?.credentialRejections;
|
|
570
573
|
const sessionKey = options.sessionKey == null ? null : String(options.sessionKey);
|
|
571
574
|
if (sessionStore && (
|
|
572
575
|
!sessionKey ||
|
|
@@ -580,6 +583,8 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
580
583
|
5 * 60 * 1000,
|
|
581
584
|
);
|
|
582
585
|
let current = null;
|
|
586
|
+
let rejectedCredential = null;
|
|
587
|
+
let localIssueTail = Promise.resolve();
|
|
583
588
|
|
|
584
589
|
const routeMatches = (session, input) => {
|
|
585
590
|
const expectedValues = [
|
|
@@ -652,22 +657,67 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
652
657
|
return proof;
|
|
653
658
|
};
|
|
654
659
|
|
|
660
|
+
const issueSession = async (input, previousSession) => {
|
|
661
|
+
const request = { ...input, previousSession };
|
|
662
|
+
if (options.loadDeviceCredential) request.deviceCredential = await options.loadDeviceCredential();
|
|
663
|
+
const fingerprint = request.deviceCredential && request.baseUrl
|
|
664
|
+
? createHash("sha256").update(JSON.stringify([
|
|
665
|
+
normalizeHelloLynkBaseUrl(request.baseUrl, { allowLoopbackHttp: request.allowLoopbackHttp === true }),
|
|
666
|
+
request.deviceCredential,
|
|
667
|
+
])).digest("hex")
|
|
668
|
+
: null;
|
|
669
|
+
// The production caller holds the existing session lock, including across
|
|
670
|
+
// Host processes. An authority denial may drain the current Host.
|
|
671
|
+
if (fingerprint) {
|
|
672
|
+
const isCoolingDown = (rejection) => {
|
|
673
|
+
if (rejection?.fingerprint !== fingerprint) return false;
|
|
674
|
+
const age = now() - rejection.rejectedAtMs;
|
|
675
|
+
return age >= 0 && age < DEVICE_CREDENTIAL_RECHECK_MS;
|
|
676
|
+
};
|
|
677
|
+
// A generic denial may clear after a server-side repair, without a new
|
|
678
|
+
// credential. The lock permits one recheck once the cooldown ends.
|
|
679
|
+
if (isCoolingDown(rejectedCredential)
|
|
680
|
+
|| isCoolingDown(await credentialRejections?.load(sessionKey).catch(() => null))) {
|
|
681
|
+
throw new HelloLynkClientError("device_credential_invalid", { httpStatus: 401 });
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
let session;
|
|
685
|
+
try {
|
|
686
|
+
session = reusable(await issue(request), input);
|
|
687
|
+
} catch (error) {
|
|
688
|
+
if (fingerprint && error?.httpStatus === 401 && error.code === "device_credential_invalid") {
|
|
689
|
+
rejectedCredential = { fingerprint, rejectedAtMs: now() };
|
|
690
|
+
// Preserve the authority denial even if local storage is unavailable.
|
|
691
|
+
await credentialRejections?.save(sessionKey, rejectedCredential).catch(() => {});
|
|
692
|
+
}
|
|
693
|
+
throw error;
|
|
694
|
+
}
|
|
695
|
+
if (session && fingerprint) {
|
|
696
|
+
rejectedCredential = null;
|
|
697
|
+
await credentialRejections?.remove(sessionKey).catch(() => {});
|
|
698
|
+
}
|
|
699
|
+
return session;
|
|
700
|
+
};
|
|
701
|
+
|
|
655
702
|
return {
|
|
656
703
|
async get(input) {
|
|
657
704
|
if (!sessionStore) {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
705
|
+
const result = localIssueTail.then(async () => {
|
|
706
|
+
if (
|
|
707
|
+
current && current.expiresAtMs - now() > minimumRemainingMs
|
|
708
|
+
&& routeMatches(current, input)
|
|
709
|
+
&& scopesMatch(current, input)
|
|
710
|
+
&& (input?.expectedAgentId == null || input.expectedAgentId === current.agentId)
|
|
711
|
+
&& (input?.expectedPrincipalId == null || input.expectedPrincipalId === current.principalId)
|
|
712
|
+
) return current;
|
|
713
|
+
const reusableCurrent = reusable(current, input);
|
|
714
|
+
if (reusableCurrent) return reusableCurrent;
|
|
715
|
+
current = await issueSession(input, recoveryProof(current, input));
|
|
716
|
+
if (!current) throw new HelloLynkClientError("invalid_runtime_session_handle");
|
|
717
|
+
return current;
|
|
718
|
+
});
|
|
719
|
+
localIssueTail = result.catch(() => {});
|
|
720
|
+
return result;
|
|
671
721
|
}
|
|
672
722
|
const inMemory = reusable(current, input);
|
|
673
723
|
if (inMemory) return inMemory;
|
|
@@ -678,7 +728,7 @@ export function createDeviceRuntimeSessionManager(options = {}) {
|
|
|
678
728
|
current = persisted;
|
|
679
729
|
return current;
|
|
680
730
|
}
|
|
681
|
-
const issued =
|
|
731
|
+
const issued = await issueSession(input, persisted);
|
|
682
732
|
if (!issued) throw new HelloLynkClientError("invalid_runtime_session_handle");
|
|
683
733
|
await sessionStore.save(sessionKey, issued);
|
|
684
734
|
current = issued;
|
|
@@ -7,7 +7,6 @@ import path from "node:path";
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
createDeviceRuntimeSessionManager,
|
|
10
|
-
issueDeviceRuntimeSession,
|
|
11
10
|
normalizeHelloLynkBaseUrl,
|
|
12
11
|
} from "./hellolynk-client-core.mjs";
|
|
13
12
|
import { readClientProfile } from "./hellolynk-client-profile.mjs";
|
|
@@ -243,31 +242,19 @@ export async function startHelloLynkNeutralHostAssembly(options = {}, dependenci
|
|
|
243
242
|
const manager = (dependencies.createRuntimeSessionManager || createDeviceRuntimeSessionManager)({
|
|
244
243
|
sessionStore: credentialStore.runtimeSessions,
|
|
245
244
|
sessionKey,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
try {
|
|
249
|
-
return await (dependencies.issueRuntimeSession || issueDeviceRuntimeSession)({
|
|
250
|
-
baseUrl: profile.baseUrl,
|
|
251
|
-
allowLoopbackHttp: profile.allowLoopbackHttp,
|
|
252
|
-
deviceCredential,
|
|
253
|
-
expectedPrincipalId: profile.principalId,
|
|
254
|
-
expectedAgentId: profile.agentId,
|
|
255
|
-
expectedDelegateId: profile.delegateId,
|
|
256
|
-
expectedHostId: profile.hostId,
|
|
257
|
-
expectedAuthorizationVersion: profile.authorizationVersion,
|
|
258
|
-
previousSession,
|
|
259
|
-
fetchImpl: dependencies.fetchImpl,
|
|
260
|
-
});
|
|
261
|
-
} finally { deviceCredential = null; }
|
|
262
|
-
},
|
|
245
|
+
loadDeviceCredential: () => credentialStore.load(profile.profileId),
|
|
246
|
+
issue: dependencies.issueRuntimeSession,
|
|
263
247
|
});
|
|
264
248
|
const sessionProvider = Object.freeze({
|
|
265
249
|
get: () => manager.get({
|
|
250
|
+
baseUrl: profile.baseUrl,
|
|
251
|
+
allowLoopbackHttp: profile.allowLoopbackHttp,
|
|
266
252
|
expectedPrincipalId: profile.principalId,
|
|
267
253
|
expectedAgentId: profile.agentId,
|
|
268
254
|
expectedDelegateId: profile.delegateId,
|
|
269
255
|
expectedHostId: profile.hostId,
|
|
270
256
|
expectedAuthorizationVersion: profile.authorizationVersion,
|
|
257
|
+
fetchImpl: dependencies.fetchImpl,
|
|
271
258
|
}),
|
|
272
259
|
clear: (error) => manager.clear(error),
|
|
273
260
|
status: () => manager.status(),
|
|
@@ -347,6 +334,9 @@ export async function startHelloLynkNeutralHostAssembly(options = {}, dependenci
|
|
|
347
334
|
authorizationVersion: profile.authorizationVersion,
|
|
348
335
|
identityKeyId: e2ee.identityKeyId,
|
|
349
336
|
runtimeHeaders: () => runtimeHeaders(sessionProvider),
|
|
337
|
+
// Drops only this instance's cached runtime session, and only for a stale
|
|
338
|
+
// session, so the Host can verify it once more with the device credential.
|
|
339
|
+
clearRuntimeSession: (error) => sessionProvider.clear(error),
|
|
350
340
|
e2ee,
|
|
351
341
|
contactE2ee,
|
|
352
342
|
}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { nativeConversationId, nativeConversationQuery, nativeDirectoryResult, queryLocalNativeConversations } from "./hellolynk-native-conversations.mjs";
|
|
2
2
|
import { DIRECT_TEXT_E2EE_MAX_TTL_MS } from "./hellolynk-direct-text-e2ee.mjs";
|
|
3
3
|
import { runModelInbox } from "./hellolynk-model-inbox.mjs";
|
|
4
|
+
import { shouldInvalidateDeviceRuntimeSession } from "./hellolynk-client-core.mjs";
|
|
4
5
|
import crypto from "node:crypto";
|
|
5
6
|
import fs from "node:fs/promises";
|
|
6
7
|
import http from "node:http";
|
|
@@ -34,7 +35,7 @@ export const HELLOLYNK_NEUTRAL_HOST_PROCESS_CONTRACT = "hellolynk-neutral-host-p
|
|
|
34
35
|
export const HELLOLYNK_NEUTRAL_HOST_DISCOVERY_CONTRACT = "hellolynk-neutral-host-discovery-v1";
|
|
35
36
|
// Raised with every release batch, together with the six client versions. A Host reports it
|
|
36
37
|
// in its health; the higher release stays and the lower one makes room.
|
|
37
|
-
export const HELLOLYNK_HOST_RELEASE_ORDINAL =
|
|
38
|
+
export const HELLOLYNK_HOST_RELEASE_ORDINAL = 18;
|
|
38
39
|
|
|
39
40
|
const INSTALLATION_LOCK_CONTRACT = "hellolynk-neutral-host-installation-lock-v2";
|
|
40
41
|
const INSTALLATION_LOCK_MAX_BYTES = 4 * 1024;
|
|
@@ -97,9 +98,16 @@ const PREKEY_REFILL_RETRY_MIN_MS = 1_000;
|
|
|
97
98
|
const PREKEY_REFILL_RETRY_MAX_MS = 60_000;
|
|
98
99
|
const RELAY_RETRY_MIN_MS = 1_000;
|
|
99
100
|
const RELAY_RETRY_MAX_MS = 60_000;
|
|
100
|
-
|
|
101
|
+
// Revocation of this Host or its transport credential fences the whole Host.
|
|
102
|
+
const HOST_AUTHORITY_DENIAL_CODES = new Set([
|
|
101
103
|
"host_transport_host_revoked", "host_transport_credential_revoked", "host_transport_credential_inactive",
|
|
104
|
+
]);
|
|
105
|
+
// A refusal of one instance's own device credential or delegate stops only that
|
|
106
|
+
// instance. The Host and its other instances keep receiving and sending. The
|
|
107
|
+
// server reports these when issuing or using that instance's runtime session.
|
|
108
|
+
const ENDPOINT_AUTHORITY_DENIAL_CODES = new Set([
|
|
102
109
|
"device_credential_invalid", "device_credential_revoked", "delegate_revoked", "delegate_inactive",
|
|
110
|
+
"device_credential_identity_inactive", "device_credential_inactive", "runtime_identity_inactive",
|
|
103
111
|
]);
|
|
104
112
|
const MESSAGE_LOCAL_CAPACITY_CODES = new Set(["local_message_store_too_large"]);
|
|
105
113
|
const CONTACT_REQUEST_LOCAL_CAPACITY_CODES = new Set([
|
|
@@ -247,6 +255,9 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
247
255
|
let receiverState = null;
|
|
248
256
|
const relayAbortController = new AbortController();
|
|
249
257
|
const relayProvisionedEndpoints = new Set();
|
|
258
|
+
// Refused instances and their refusal code. Only a later successful registration
|
|
259
|
+
// (the next relay connection or session rotation) readmits one.
|
|
260
|
+
const rejectedEndpoints = new Map();
|
|
250
261
|
const relayState = { status: "connecting", failureCount: 0, nextAttemptAtMs: 0, errorCode: null };
|
|
251
262
|
const rejectedInboundTimes = new WeakSet();
|
|
252
263
|
let lastRejectedInbound = null;
|
|
@@ -600,6 +611,20 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
600
611
|
lastRejectedInbound = { errorCode: error.code };
|
|
601
612
|
continue;
|
|
602
613
|
}
|
|
614
|
+
// The frame's own instance was refused (for example at ACK). Stop only that
|
|
615
|
+
// instance and skip the frame; the relay expires or redelivers it.
|
|
616
|
+
const refused = ENDPOINT_AUTHORITY_DENIAL_CODES.has(error?.code)
|
|
617
|
+
&& endpoints.get(String(item.data?.recipientDelegateId || ""));
|
|
618
|
+
if (refused) {
|
|
619
|
+
rejectedEndpoints.set(refused.delegateId, error.code);
|
|
620
|
+
relayState.errorCode = error.code;
|
|
621
|
+
lastRejectedInbound = { errorCode: error.code };
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
// A stale runtime session (such as a revocation landing between persist and
|
|
625
|
+
// ACK) is not a local failure. Reconnect: registration verifies that instance
|
|
626
|
+
// again and isolates it if refused. The durable record stays; the relay redelivers.
|
|
627
|
+
if (shouldInvalidateDeviceRuntimeSession(error)) throw error;
|
|
603
628
|
if (!isInboundLocalCapacityError(error)) {
|
|
604
629
|
inboundFailed = true;
|
|
605
630
|
throw error;
|
|
@@ -612,7 +637,7 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
612
637
|
} catch (error) {
|
|
613
638
|
if (lifecycle !== "running") return;
|
|
614
639
|
// Preserve fail-closed persistence/ACK and other malformed-inbound errors.
|
|
615
|
-
if (inboundFailed ||
|
|
640
|
+
if (inboundFailed || HOST_AUTHORITY_DENIAL_CODES.has(error?.code)) throw error;
|
|
616
641
|
await stream?.close?.().catch(() => {});
|
|
617
642
|
stream = null;
|
|
618
643
|
scheduleRelayRetry(error);
|
|
@@ -638,31 +663,63 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
638
663
|
const task = (async () => {
|
|
639
664
|
let connected = null;
|
|
640
665
|
try {
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
666
|
+
const attempted = [...endpoints.values()];
|
|
667
|
+
const registrations = await Promise.allSettled(attempted.map(async (endpoint) => {
|
|
668
|
+
const register = async () => {
|
|
669
|
+
if (endpoint.e2ee?.preKeyInventoryStatus?.status === "deferred"
|
|
670
|
+
&& !relayProvisionedEndpoints.has(endpoint.delegateId)) {
|
|
671
|
+
try {
|
|
672
|
+
await endpoint.e2ee.ensurePreKeyInventory({ signal });
|
|
673
|
+
} catch (error) {
|
|
674
|
+
if (error?.code !== "e2ee_local_prekey_capacity_exceeded") throw error;
|
|
675
|
+
const state = preKeyRefillState(endpoint.delegateId);
|
|
676
|
+
state.failureCount = 1;
|
|
677
|
+
state.nextAttemptAtMs = Math.max(nowMs(clock) + PREKEY_REFILL_RETRY_MIN_MS, retryAtTimestamp(error.retryAt) || 0);
|
|
678
|
+
state.errorCode = error.code;
|
|
679
|
+
}
|
|
680
|
+
relayProvisionedEndpoints.add(endpoint.delegateId);
|
|
652
681
|
}
|
|
653
|
-
|
|
682
|
+
if (signal.aborted || lifecycle !== "running") return;
|
|
683
|
+
await options.transport.registerEndpoint({
|
|
684
|
+
delegateId: endpoint.delegateId, identityKeyId: endpoint.identityKeyId,
|
|
685
|
+
runtimeHeaders: endpoint.runtimeHeaders, signal,
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
try {
|
|
689
|
+
await register();
|
|
690
|
+
} catch (error) {
|
|
691
|
+
// Revoking an instance also drops its runtime session, so its cached session
|
|
692
|
+
// fails first. Clear only that stale cache and verify once more: a device
|
|
693
|
+
// refusal then isolates the instance; any other failure keeps the usual path.
|
|
694
|
+
const cleared = !shouldInvalidateDeviceRuntimeSession(error) || signal.aborted || lifecycle !== "running"
|
|
695
|
+
|| typeof endpoint.clearRuntimeSession !== "function" ? false
|
|
696
|
+
: await Promise.resolve().then(() => endpoint.clearRuntimeSession(error)).catch(() => false);
|
|
697
|
+
if (cleared !== true) throw error;
|
|
698
|
+
await register();
|
|
654
699
|
}
|
|
655
|
-
if (signal.aborted || lifecycle !== "running") return;
|
|
656
|
-
await options.transport.registerEndpoint({
|
|
657
|
-
delegateId: endpoint.delegateId, identityKeyId: endpoint.identityKeyId,
|
|
658
|
-
runtimeHeaders: endpoint.runtimeHeaders, signal,
|
|
659
|
-
});
|
|
660
700
|
}));
|
|
661
701
|
if (signal.aborted || lifecycle !== "running") return;
|
|
662
|
-
const
|
|
663
|
-
&&
|
|
664
|
-
|
|
702
|
+
const hostDenial = registrations.find((result) => result.status === "rejected"
|
|
703
|
+
&& HOST_AUTHORITY_DENIAL_CODES.has(result.reason?.code));
|
|
704
|
+
if (hostDenial) throw hostDenial.reason;
|
|
705
|
+
// A refused instance stays out of the relay while the others connect. Each
|
|
706
|
+
// later connection, including session rotation, registers it again.
|
|
707
|
+
registrations.forEach((result, index) => {
|
|
708
|
+
if (result.status === "fulfilled") rejectedEndpoints.delete(attempted[index].delegateId);
|
|
709
|
+
else if (ENDPOINT_AUTHORITY_DENIAL_CODES.has(result.reason?.code)) {
|
|
710
|
+
rejectedEndpoints.set(attempted[index].delegateId, result.reason.code);
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
// A refused instance whose re-verification fails for another reason (such as
|
|
714
|
+
// its dropped runtime session) stays refused and does not hold back the others.
|
|
715
|
+
const failed = registrations.find((result, index) => result.status === "rejected"
|
|
716
|
+
&& !rejectedEndpoints.has(attempted[index].delegateId));
|
|
665
717
|
if (failed) throw failed.reason;
|
|
718
|
+
// With every instance refused there is nothing to receive: keep the Host and
|
|
719
|
+
// retry with the usual backoff. The session manager bounds cloud rechecks.
|
|
720
|
+
if (rejectedEndpoints.size === endpoints.size) {
|
|
721
|
+
throw registrations.find((result) => result.status === "rejected").reason;
|
|
722
|
+
}
|
|
666
723
|
connected = await openRelayStream(signal);
|
|
667
724
|
if (!connected?.events || typeof connected.events[Symbol.asyncIterator] !== "function") {
|
|
668
725
|
throw failure("neutral_host_transport_stream_invalid");
|
|
@@ -672,14 +729,15 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
672
729
|
return;
|
|
673
730
|
}
|
|
674
731
|
stream = connected;
|
|
675
|
-
Object.assign(relayState, { status: "ready", failureCount: 0, nextAttemptAtMs: 0,
|
|
732
|
+
Object.assign(relayState, { status: "ready", failureCount: 0, nextAttemptAtMs: 0,
|
|
733
|
+
errorCode: rejectedEndpoints.values().next().value ?? null });
|
|
676
734
|
startReceiveTask();
|
|
677
735
|
} catch (error) {
|
|
678
736
|
await connected?.close?.().catch(() => {});
|
|
679
737
|
if (signal.aborted || lifecycle !== "running") return;
|
|
680
738
|
// An explicit revocation of this Host still fences local access. A
|
|
681
739
|
// timeout/expired cloud session alone is not a local revocation.
|
|
682
|
-
if (
|
|
740
|
+
if (HOST_AUTHORITY_DENIAL_CODES.has(error?.code)) {
|
|
683
741
|
// Failure is exposed as host.status/failureCode to the release entry.
|
|
684
742
|
void beginDrain(error.code).catch(() => {});
|
|
685
743
|
return;
|
|
@@ -733,6 +791,14 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
733
791
|
}
|
|
734
792
|
const endpoint = endpoints.get(safeId(event.recipientDelegateId, "neutral_host_inbound_delegate_invalid"));
|
|
735
793
|
if (!endpoint) throw failure("neutral_host_inbound_endpoint_unknown");
|
|
794
|
+
if (rejectedEndpoints.has(endpoint.delegateId)) {
|
|
795
|
+
// A refused instance receives nothing, also not from its Host's siblings.
|
|
796
|
+
// Relay frames are skipped unacknowledged; a local sender sees the failure.
|
|
797
|
+
const refused = failure(item.localDelivery === true
|
|
798
|
+
? "neutral_host_same_host_recipient_unavailable" : rejectedEndpoints.get(endpoint.delegateId));
|
|
799
|
+
rejectedInboundTimes.add(refused);
|
|
800
|
+
throw refused;
|
|
801
|
+
}
|
|
736
802
|
const isContactRequest = item.event === "contact_request";
|
|
737
803
|
if (!isContactRequest && item.event !== "message") throw failure("neutral_host_inbound_kind_invalid");
|
|
738
804
|
const decryptor = isContactRequest ? endpoint.contactE2ee : endpoint.e2ee;
|
|
@@ -1015,7 +1081,14 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
1015
1081
|
return inboundResumeTask;
|
|
1016
1082
|
}
|
|
1017
1083
|
|
|
1084
|
+
// A refused instance does not send, including over local routes that skip the relay.
|
|
1085
|
+
function assertEndpointAccepted(delegateId) {
|
|
1086
|
+
const code = rejectedEndpoints.get(delegateId);
|
|
1087
|
+
if (code) throw hostApplicationFailure(code);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1018
1090
|
async function sendOutboundOnce({ endpoint, delegateId, clientMessageId, input }) {
|
|
1091
|
+
assertEndpointAccepted(endpoint.delegateId);
|
|
1019
1092
|
try {
|
|
1020
1093
|
const result = await endpoint.outbound.send(input);
|
|
1021
1094
|
if (result?.message?.lastErrorCode === "reply_target_deleted" || result?.relay?.status === "reply_target_deleted") {
|
|
@@ -1529,6 +1602,7 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
1529
1602
|
async function queryPeerNativeDirectory(delegateId, authorization, request) {
|
|
1530
1603
|
const sender = endpoints.get(delegateId);
|
|
1531
1604
|
if (!sender?.outbound?.sendDirectory) throw hostApplicationFailure("native_directory_unavailable");
|
|
1605
|
+
assertEndpointAccepted(delegateId);
|
|
1532
1606
|
const friend = request.kind === "friend_target_request";
|
|
1533
1607
|
const unavailable = friend ? null : nativeDirectoryResult({ conversations: [], coverage: "unavailable",
|
|
1534
1608
|
available: false, exactTargetSupported: false, reason: "native_directory_unavailable" });
|
|
@@ -2274,6 +2348,7 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
2274
2348
|
|| current.senderDelegateId !== context.delegateId) {
|
|
2275
2349
|
throw hostApplicationFailure("host_app_record_not_found");
|
|
2276
2350
|
}
|
|
2351
|
+
assertEndpointAccepted(context.delegateId);
|
|
2277
2352
|
if (!MANUAL_RETRYABLE_STATUSES.has(current.status) || current.lastErrorCode === "reply_target_deleted") {
|
|
2278
2353
|
throw hostApplicationFailure("host_app_state_conflict");
|
|
2279
2354
|
}
|
|
@@ -3120,7 +3195,8 @@ export async function startHelloLynkNeutralHostProcess(options = {}) {
|
|
|
3120
3195
|
return {
|
|
3121
3196
|
status: inboundPaused
|
|
3122
3197
|
? "paused"
|
|
3123
|
-
: preKeyInventory.status === "ready" && relayState.status === "ready" && !lastRejectedInbound
|
|
3198
|
+
: preKeyInventory.status === "ready" && relayState.status === "ready" && !lastRejectedInbound
|
|
3199
|
+
&& rejectedEndpoints.size === 0 ? "ready" : "degraded",
|
|
3124
3200
|
...(lastRejectedInbound ? { lastRejectedInbound } : {}),
|
|
3125
3201
|
preKeyInventory,
|
|
3126
3202
|
relay: {
|
|
@@ -297,6 +297,36 @@ export async function secureWindowsClientReleaseTree(clientRoot, releaseId, opti
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
// Accessed under the same cross-process lock as the corresponding session.
|
|
301
|
+
function createCredentialRejectionStore(root) {
|
|
302
|
+
const fileFor = (profile) => join(root, `runtime-session-rejection-${assertCredentialProfileId(profile)}.json`);
|
|
303
|
+
const isRejection = (value) => typeof value?.fingerprint === "string" && /^[a-f0-9]{64}$/.test(value.fingerprint)
|
|
304
|
+
&& Number.isSafeInteger(value.rejectedAtMs) && value.rejectedAtMs >= 0;
|
|
305
|
+
return {
|
|
306
|
+
async load(profile) {
|
|
307
|
+
let value;
|
|
308
|
+
try { value = JSON.parse(await readFile(fileFor(profile), "utf8")); }
|
|
309
|
+
catch (error) { if (error?.code === "ENOENT" || error instanceof SyntaxError) return null; throw error; }
|
|
310
|
+
return isRejection(value) ? value : null;
|
|
311
|
+
},
|
|
312
|
+
async save(profile, rejection) {
|
|
313
|
+
if (!isRejection(rejection)) throw new HelloLynkCredentialStoreError("invalid_credential_rejection");
|
|
314
|
+
const { fingerprint, rejectedAtMs } = rejection;
|
|
315
|
+
const file = fileFor(profile);
|
|
316
|
+
const temporary = `${file}.${randomBytes(12).toString("hex")}.tmp`;
|
|
317
|
+
try {
|
|
318
|
+
await writeFile(temporary, `${JSON.stringify({ fingerprint, rejectedAtMs })}\n`, { encoding: "utf8", flag: "wx", mode: 0o600 });
|
|
319
|
+
await rename(temporary, file);
|
|
320
|
+
} finally {
|
|
321
|
+
await rm(temporary, { force: true }).catch(() => {});
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
async remove(profile) {
|
|
325
|
+
await rm(fileFor(profile), { force: true });
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
300
330
|
export function createPlatformCredentialStore(options = {}) {
|
|
301
331
|
const platform = options.platform || process.platform;
|
|
302
332
|
const run = options.runHelper || runCredentialHelper;
|
|
@@ -370,6 +400,7 @@ export function createPlatformCredentialStore(options = {}) {
|
|
|
370
400
|
await invoke("Remove", assertCredentialProfileId(profile), "");
|
|
371
401
|
},
|
|
372
402
|
runtimeSessions: {
|
|
403
|
+
credentialRejections: createCredentialRejectionStore(runtimeStoreRoot),
|
|
373
404
|
async save(profile, session) {
|
|
374
405
|
const body = JSON.stringify({ schemaVersion: 1, ...assertRuntimeSession(session) });
|
|
375
406
|
await invoke("StoreRuntimeSession", assertCredentialProfileId(profile), body);
|
|
@@ -504,6 +535,7 @@ export function createPlatformCredentialStore(options = {}) {
|
|
|
504
535
|
},
|
|
505
536
|
async remove(profile) { await entry(root, "device", profile, "remove"); },
|
|
506
537
|
runtimeSessions: {
|
|
538
|
+
credentialRejections: createCredentialRejectionStore(root),
|
|
507
539
|
async save(profile, session) { await entry(root, "session", profile, "save", assertRuntimeSession(session)); },
|
|
508
540
|
async load(profile) {
|
|
509
541
|
const value = await entry(root, "session", profile, "load");
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
6
|
"path": "release/integrations/trae-work/package.json",
|
|
7
|
-
"sha256": "
|
|
7
|
+
"sha256": "2eb6935f4e8faf49d6010c810eac516b5887f8aee4d534a486d486cac60235b2"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"path": "connect-activate.mjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"path": "core/hellolynk-client-core.mjs",
|
|
39
|
-
"sha256": "
|
|
39
|
+
"sha256": "5d2190c2354ede169b2053864674c7ae5b80985970dc13609d6818c5a6d16940"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": "core/hellolynk-client-profile.mjs",
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
190
|
"path": "core/hellolynk-neutral-host-assembly.mjs",
|
|
191
|
-
"sha256": "
|
|
191
|
+
"sha256": "5a09b332a869c3863ac92c798a1a5df5901607987a2427a20b06154e41e17cb8"
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
"path": "core/hellolynk-neutral-host-installation-store.mjs",
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
"path": "core/hellolynk-neutral-host-process.mjs",
|
|
203
|
-
"sha256": "
|
|
203
|
+
"sha256": "0a66fca2b862fde9269722f026fc67e9d1c79435f0d410809aee669be9f9f497"
|
|
204
204
|
},
|
|
205
205
|
{
|
|
206
206
|
"path": "core/hellolynk-neutral-host-store-adapters.mjs",
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
"path": "core/hellolynk-platform-credential-store.mjs",
|
|
215
|
-
"sha256": "
|
|
215
|
+
"sha256": "4a4f073c3a5398d0d51be5a28c1b86b06e6f3b0b613e833928d8437c030cf65f"
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
218
|
"path": "core/hellolynk-relay-client-cli.mjs",
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
330
|
"path": "bootstrap/core/hellolynk-client-core.mjs",
|
|
331
|
-
"sha256": "
|
|
331
|
+
"sha256": "5d2190c2354ede169b2053864674c7ae5b80985970dc13609d6818c5a6d16940"
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
334
|
"path": "bootstrap/core/hellolynk-client-profile.mjs",
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
},
|
|
353
353
|
{
|
|
354
354
|
"path": "bootstrap/core/hellolynk-platform-credential-store.mjs",
|
|
355
|
-
"sha256": "
|
|
355
|
+
"sha256": "4a4f073c3a5398d0d51be5a28c1b86b06e6f3b0b613e833928d8437c030cf65f"
|
|
356
356
|
},
|
|
357
357
|
{
|
|
358
358
|
"path": "bootstrap/core/hellolynk-runtime-safety.cjs",
|