agent-comms 8.6.2 → 8.8.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +34 -3
- package/dist/account-cli.d.ts +34 -0
- package/dist/account-cli.d.ts.map +1 -0
- package/dist/account-cli.js +140 -0
- package/dist/account-cli.js.map +1 -0
- package/dist/account-join-cli.d.ts +17 -0
- package/dist/account-join-cli.d.ts.map +1 -0
- package/dist/account-join-cli.js +144 -0
- package/dist/account-join-cli.js.map +1 -0
- package/dist/bridges/mcp/server.d.ts +1 -4
- package/dist/bridges/mcp/server.d.ts.map +1 -1
- package/dist/bridges/mcp/server.js +1 -1
- package/dist/bridges/mcp/server.js.map +1 -1
- package/dist/bridges/user/web/dist/mesh-worker.js +1 -1
- package/dist/bridges/user/web/dist/sw.js +1 -1
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +24 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/account-bundle.d.ts +27 -0
- package/dist/core/account-bundle.d.ts.map +1 -0
- package/dist/core/account-bundle.js +173 -0
- package/dist/core/account-bundle.js.map +1 -0
- package/dist/core/account-join.d.ts +70 -0
- package/dist/core/account-join.d.ts.map +1 -0
- package/dist/core/account-join.js +183 -0
- package/dist/core/account-join.js.map +1 -0
- package/dist/core/account-ledger-crypto.d.ts +28 -0
- package/dist/core/account-ledger-crypto.d.ts.map +1 -0
- package/dist/core/account-ledger-crypto.js +101 -0
- package/dist/core/account-ledger-crypto.js.map +1 -0
- package/dist/core/account-ledger-store.d.ts +21 -0
- package/dist/core/account-ledger-store.d.ts.map +1 -0
- package/dist/core/account-ledger-store.js +34 -0
- package/dist/core/account-ledger-store.js.map +1 -0
- package/dist/core/account-ledger.d.ts +80 -0
- package/dist/core/account-ledger.d.ts.map +1 -0
- package/dist/core/account-ledger.js +247 -0
- package/dist/core/account-ledger.js.map +1 -0
- package/dist/core/agent-registry.d.ts.map +1 -1
- package/dist/core/agent-registry.js +2 -0
- package/dist/core/agent-registry.js.map +1 -1
- package/dist/core/bridge-mesh.d.ts.map +1 -1
- package/dist/core/bridge-mesh.js +12 -1
- package/dist/core/bridge-mesh.js.map +1 -1
- package/dist/core/bridge.d.ts +1 -0
- package/dist/core/bridge.d.ts.map +1 -1
- package/dist/core/bridge.js +6 -0
- package/dist/core/bridge.js.map +1 -1
- package/dist/core/data-frame-routing.d.ts +50 -3
- package/dist/core/data-frame-routing.d.ts.map +1 -1
- package/dist/core/data-frame-routing.js +112 -5
- package/dist/core/data-frame-routing.js.map +1 -1
- package/dist/core/device-membership.d.ts +8 -8
- package/dist/core/device-membership.d.ts.map +1 -1
- package/dist/core/device-membership.js +17 -16
- package/dist/core/device-membership.js.map +1 -1
- package/dist/core/dm-send-delegation.d.ts +4 -4
- package/dist/core/dm-send-delegation.d.ts.map +1 -1
- package/dist/core/dm-send-delegation.js +2 -3
- package/dist/core/dm-send-delegation.js.map +1 -1
- package/dist/core/gossip-directory.d.ts +4 -2
- package/dist/core/gossip-directory.d.ts.map +1 -1
- package/dist/core/gossip-directory.js +4 -5
- package/dist/core/gossip-directory.js.map +1 -1
- package/dist/core/gossip-extensions.d.ts +2 -0
- package/dist/core/gossip-extensions.d.ts.map +1 -1
- package/dist/core/gossip-extensions.js +3 -0
- package/dist/core/gossip-extensions.js.map +1 -1
- package/dist/core/group-proofs.d.ts +15 -6
- package/dist/core/group-proofs.d.ts.map +1 -1
- package/dist/core/group-proofs.js +73 -18
- package/dist/core/group-proofs.js.map +1 -1
- package/dist/core/identity-store.d.ts.map +1 -1
- package/dist/core/identity-store.js +2 -62
- package/dist/core/identity-store.js.map +1 -1
- package/dist/core/issuer-grouping.d.ts +52 -0
- package/dist/core/issuer-grouping.d.ts.map +1 -0
- package/dist/core/{machine-grouping.js → issuer-grouping.js} +33 -33
- package/dist/core/issuer-grouping.js.map +1 -0
- package/dist/core/issuer-identity-file.d.ts +4 -0
- package/dist/core/issuer-identity-file.d.ts.map +1 -1
- package/dist/core/issuer-identity-file.js +7 -5
- package/dist/core/issuer-identity-file.js.map +1 -1
- package/dist/core/ledger-lock.d.ts +12 -0
- package/dist/core/ledger-lock.d.ts.map +1 -0
- package/dist/core/ledger-lock.js +62 -0
- package/dist/core/ledger-lock.js.map +1 -0
- package/dist/core/membership-proofs.d.ts +7 -0
- package/dist/core/membership-proofs.d.ts.map +1 -1
- package/dist/core/membership-proofs.js +26 -1
- package/dist/core/membership-proofs.js.map +1 -1
- package/dist/core/mesh-store-shared.d.ts +4 -1
- package/dist/core/mesh-store-shared.d.ts.map +1 -1
- package/dist/core/mesh-store-shared.js.map +1 -1
- package/dist/core/mesh-store.d.ts +17 -8
- package/dist/core/mesh-store.d.ts.map +1 -1
- package/dist/core/mesh-store.js +44 -42
- package/dist/core/mesh-store.js.map +1 -1
- package/dist/core/naming-actions.d.ts +5 -1
- package/dist/core/naming-actions.d.ts.map +1 -1
- package/dist/core/naming-actions.js +13 -1
- package/dist/core/naming-actions.js.map +1 -1
- package/dist/core/naming.d.ts +9 -5
- package/dist/core/naming.d.ts.map +1 -1
- package/dist/core/naming.js +14 -4
- package/dist/core/naming.js.map +1 -1
- package/dist/core/peer-versions.d.ts +11 -0
- package/dist/core/peer-versions.d.ts.map +1 -1
- package/dist/core/peer-versions.js +9 -0
- package/dist/core/peer-versions.js.map +1 -1
- package/dist/core/pid-lock-file.d.ts +20 -0
- package/dist/core/pid-lock-file.d.ts.map +1 -0
- package/dist/core/pid-lock-file.js +115 -0
- package/dist/core/pid-lock-file.js.map +1 -0
- package/dist/core/room-lifecycle.d.ts +2 -2
- package/dist/core/room-lifecycle.d.ts.map +1 -1
- package/dist/core/room-lifecycle.js +18 -19
- package/dist/core/room-lifecycle.js.map +1 -1
- package/dist/core/self-name-claim.d.ts +27 -0
- package/dist/core/self-name-claim.d.ts.map +1 -0
- package/dist/core/{machine-name-claim.js → self-name-claim.js} +7 -8
- package/dist/core/self-name-claim.js.map +1 -0
- package/dist/core/tool.d.ts.map +1 -1
- package/dist/core/tool.js +11 -7
- package/dist/core/tool.js.map +1 -1
- package/dist/core/transport-queries.d.ts +11 -0
- package/dist/core/transport-queries.d.ts.map +1 -0
- package/dist/core/transport-queries.js +30 -0
- package/dist/core/transport-queries.js.map +1 -0
- package/dist/core/types.d.ts +6 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-identity.d.ts +28 -18
- package/dist/core/user-identity.d.ts.map +1 -1
- package/dist/core/user-identity.js +126 -59
- package/dist/core/user-identity.js.map +1 -1
- package/dist/core/wire-mesh-transport-options.d.ts +11 -2
- package/dist/core/wire-mesh-transport-options.d.ts.map +1 -1
- package/dist/core/wire-mesh-transport-options.js.map +1 -1
- package/dist/core/wire-mesh-transport.d.ts +4 -6
- package/dist/core/wire-mesh-transport.d.ts.map +1 -1
- package/dist/core/wire-mesh-transport.js +16 -20
- package/dist/core/wire-mesh-transport.js.map +1 -1
- package/dist/test/account-join.integration.test.d.ts +5 -0
- package/dist/test/account-join.integration.test.d.ts.map +1 -0
- package/dist/test/account-join.integration.test.js +280 -0
- package/dist/test/account-join.integration.test.js.map +1 -0
- package/dist/test/account-ledger-lock-worker.d.ts +9 -0
- package/dist/test/account-ledger-lock-worker.d.ts.map +1 -0
- package/dist/test/account-ledger-lock-worker.js +34 -0
- package/dist/test/account-ledger-lock-worker.js.map +1 -0
- package/dist/test/account-ledger-lock.integration.test.d.ts +5 -0
- package/dist/test/account-ledger-lock.integration.test.d.ts.map +1 -0
- package/dist/test/account-ledger-lock.integration.test.js +71 -0
- package/dist/test/account-ledger-lock.integration.test.js.map +1 -0
- package/dist/test/account-ledger-replication.integration.test.d.ts +5 -0
- package/dist/test/account-ledger-replication.integration.test.d.ts.map +1 -0
- package/dist/test/account-ledger-replication.integration.test.js +145 -0
- package/dist/test/account-ledger-replication.integration.test.js.map +1 -0
- package/dist/test/account-ledger.unit.test.d.ts +5 -0
- package/dist/test/account-ledger.unit.test.d.ts.map +1 -0
- package/dist/test/account-ledger.unit.test.js +317 -0
- package/dist/test/account-ledger.unit.test.js.map +1 -0
- package/dist/test/account-transfer.unit.test.d.ts +5 -0
- package/dist/test/account-transfer.unit.test.d.ts.map +1 -0
- package/dist/test/account-transfer.unit.test.js +232 -0
- package/dist/test/account-transfer.unit.test.js.map +1 -0
- package/dist/test/delivery-engine-delivery.unit.test.js +1 -0
- package/dist/test/delivery-engine-delivery.unit.test.js.map +1 -1
- package/dist/test/delivery-engine-directed-notify.unit.test.js +1 -0
- package/dist/test/delivery-engine-directed-notify.unit.test.js.map +1 -1
- package/dist/test/delivery-engine-own-agent.unit.test.js +1 -0
- package/dist/test/delivery-engine-own-agent.unit.test.js.map +1 -1
- package/dist/test/delivery-engine.unit.test.js +1 -0
- package/dist/test/delivery-engine.unit.test.js.map +1 -1
- package/dist/test/device-membership.unit.test.js +81 -30
- package/dist/test/device-membership.unit.test.js.map +1 -1
- package/dist/test/dm-send-delegation.unit.test.js +25 -14
- package/dist/test/dm-send-delegation.unit.test.js.map +1 -1
- package/dist/test/dm-send-principal-delegation.integration.test.js +9 -2
- package/dist/test/dm-send-principal-delegation.integration.test.js.map +1 -1
- package/dist/test/hidden-line.unit.test.d.ts +5 -0
- package/dist/test/hidden-line.unit.test.d.ts.map +1 -0
- package/dist/test/hidden-line.unit.test.js +40 -0
- package/dist/test/hidden-line.unit.test.js.map +1 -0
- package/dist/test/identity-restart.integration.test.js +8 -1
- package/dist/test/identity-restart.integration.test.js.map +1 -1
- package/dist/test/issuer-grouping.unit.test.d.ts +2 -0
- package/dist/test/issuer-grouping.unit.test.d.ts.map +1 -0
- package/dist/test/issuer-grouping.unit.test.js +137 -0
- package/dist/test/issuer-grouping.unit.test.js.map +1 -0
- package/dist/test/mcp-stdout-channel.integration.test.js +2 -2
- package/dist/test/mcp-stdout-channel.integration.test.js.map +1 -1
- package/dist/test/mesh-smoke.runner.js +2 -1
- package/dist/test/mesh-smoke.runner.js.map +1 -1
- package/dist/test/naming.integration.test.d.ts +1 -1
- package/dist/test/naming.integration.test.js +45 -1
- package/dist/test/naming.integration.test.js.map +1 -1
- package/dist/test/room-join-admission.integration.test.js +8 -1
- package/dist/test/room-join-admission.integration.test.js.map +1 -1
- package/dist/test/room-lifecycle-bare-name.unit.test.js +1 -0
- package/dist/test/room-lifecycle-bare-name.unit.test.js.map +1 -1
- package/dist/test/room-lifecycle-membership.unit.test.js +1 -0
- package/dist/test/room-lifecycle-membership.unit.test.js.map +1 -1
- package/dist/test/room-lifecycle-remote.unit.test.js +1 -0
- package/dist/test/room-lifecycle-remote.unit.test.js.map +1 -1
- package/dist/test/room-lifecycle.unit.test.js +1 -0
- package/dist/test/room-lifecycle.unit.test.js.map +1 -1
- package/dist/test/room-messaging-durable-send.unit.test.js +1 -0
- package/dist/test/room-messaging-durable-send.unit.test.js.map +1 -1
- package/dist/test/room-messaging.unit.test.js +1 -0
- package/dist/test/room-messaging.unit.test.js.map +1 -1
- package/dist/test/room-protocol-notify.unit.test.js +1 -0
- package/dist/test/room-protocol-notify.unit.test.js.map +1 -1
- package/dist/test/room-protocol.helper.d.ts.map +1 -1
- package/dist/test/room-protocol.helper.js +1 -0
- package/dist/test/room-protocol.helper.js.map +1 -1
- package/dist/test/room-send-retry.integration.test.js +8 -1
- package/dist/test/room-send-retry.integration.test.js.map +1 -1
- package/dist/test/test-transport.d.ts +9 -0
- package/dist/test/test-transport.d.ts.map +1 -1
- package/dist/test/test-transport.js +14 -5
- package/dist/test/test-transport.js.map +1 -1
- package/dist/test/user-identity.unit.test.js +92 -99
- package/dist/test/user-identity.unit.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/machine-grouping.d.ts +0 -47
- package/dist/core/machine-grouping.d.ts.map +0 -1
- package/dist/core/machine-grouping.js.map +0 -1
- package/dist/core/machine-name-claim.d.ts +0 -22
- package/dist/core/machine-name-claim.d.ts.map +0 -1
- package/dist/core/machine-name-claim.js.map +0 -1
- package/dist/test/machine-grouping.unit.test.d.ts +0 -2
- package/dist/test/machine-grouping.unit.test.d.ts.map +0 -1
- package/dist/test/machine-grouping.unit.test.js +0 -68
- package/dist/test/machine-grouping.unit.test.js.map +0 -1
|
@@ -71,7 +71,8 @@ function serializeRecord(stored) {
|
|
|
71
71
|
export function writeIssuerRecord(file, record) {
|
|
72
72
|
writeFileAtomic(file, serializeRecord(record), IDENTITY_FILE_MODE);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
/** The identity a stored key record describes: the key, its certificate, and the fingerprint and device-id derived from them. */
|
|
75
|
+
export function issuerPeerIdentity(stored) {
|
|
75
76
|
return {
|
|
76
77
|
privateKey: stored.privateKey,
|
|
77
78
|
certificate: stored.certificate,
|
|
@@ -79,7 +80,8 @@ function toPeerIdentity(stored) {
|
|
|
79
80
|
deviceId: deriveDeviceId(stored.privateKey),
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
/** The key record that persists identity, with a fresh expiry stamp. */
|
|
84
|
+
export function issuerKeyRecord(identity) {
|
|
83
85
|
return {
|
|
84
86
|
privateKey: identity.privateKey,
|
|
85
87
|
certificate: identity.certificate,
|
|
@@ -91,15 +93,15 @@ function renewIfNeeded(file, stored) {
|
|
|
91
93
|
const expiresAt = Date.parse(stored.expiresAt);
|
|
92
94
|
const needsRenewal = Number.isNaN(expiresAt) || Date.now() > expiresAt - RENEWAL_MARGIN_MS;
|
|
93
95
|
if (!needsRenewal)
|
|
94
|
-
return
|
|
96
|
+
return issuerPeerIdentity(stored);
|
|
95
97
|
const renewed = certifyKeyPair(stored.privateKey);
|
|
96
|
-
writeIssuerRecord(file, { ...stored, ...
|
|
98
|
+
writeIssuerRecord(file, { ...stored, ...issuerKeyRecord(renewed) });
|
|
97
99
|
return renewed;
|
|
98
100
|
}
|
|
99
101
|
/** Generates a fresh identity and persists it at file, which does not exist yet. The create is exclusive, so when a concurrent caller creates the file first this caller keeps the winner's key and returns that instead of overwriting it, judging the winner's record with the owning module's guard. */
|
|
100
102
|
function createIssuerIdentity(file, guard) {
|
|
101
103
|
const identity = generateIdentity();
|
|
102
|
-
if (createFileExclusive(file, serializeRecord(
|
|
104
|
+
if (createFileExclusive(file, serializeRecord(issuerKeyRecord(identity)), IDENTITY_FILE_MODE)) {
|
|
103
105
|
return identity;
|
|
104
106
|
}
|
|
105
107
|
const winner = readIssuerRecord(file, guard);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issuer-identity-file.js","sourceRoot":"","sources":["../../src/core/issuer-identity-file.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAGvB,iLAAiL;AACjL,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,uBAAuB,CAAC;AAE5E,+DAA+D;AAC/D,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,6EAA6E;AAC7E,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAShC,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,IACE,CAAC,CAAC,YAAY,IAAI,KAAK,CAAC;QACxB,CAAC,CAAC,aAAa,IAAI,KAAK,CAAC;QACzB,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,OAAO,CACL,OAAO,KAAK,CAAC,UAAU,K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I,EAAE,KAAK,CAAC,CAAC;IACnE,OAAO,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutual exclusion for appending to one machine's writer log of the account ledger (agent-comms#344). A data-domain log is single-writer: two appends reading the same head would both write the next sequence number and fork the log. Every bridge on a machine shares that machine's writer log, and several stores can live in one process (the cc-peer front fronts many sessions), so appends are serialised both within this process (a promise chain per lock) and across processes (a PID lock file, pid-lock-file.ts, the same claim identity-store.ts uses for a bridge slot).
|
|
3
|
+
*/
|
|
4
|
+
/** Runs `critical` with exclusive access to whatever this lock guards. */
|
|
5
|
+
export interface LedgerLock {
|
|
6
|
+
run: <T>(critical: () => Promise<T>) => Promise<T>;
|
|
7
|
+
}
|
|
8
|
+
/** A lock shared by every process on this machine that names the same lock file. */
|
|
9
|
+
export declare function createFileLedgerLock(lockFile: string): LedgerLock;
|
|
10
|
+
/** A lock with no file behind it, for a ledger whose storage lives only in this process's memory. */
|
|
11
|
+
export declare function createInProcessLedgerLock(): LedgerLock;
|
|
12
|
+
//# sourceMappingURL=ledger-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-lock.d.ts","sourceRoot":"","sources":["../../src/core/ledger-lock.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CACpD;AAiDD,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAYjE;AAID,qGAAqG;AACrG,wBAAgB,yBAAyB,IAAI,UAAU,CAItD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutual exclusion for appending to one machine's writer log of the account ledger (agent-comms#344). A data-domain log is single-writer: two appends reading the same head would both write the next sequence number and fork the log. Every bridge on a machine shares that machine's writer log, and several stores can live in one process (the cc-peer front fronts many sessions), so appends are serialised both within this process (a promise chain per lock) and across processes (a PID lock file, pid-lock-file.ts, the same claim identity-store.ts uses for a bridge slot).
|
|
3
|
+
*/
|
|
4
|
+
import { releaseLockFile, tryAcquireLock } from "./pid-lock-file.js";
|
|
5
|
+
const MS_PER_SECOND = 1000;
|
|
6
|
+
/** How long an append waits for another process's append to finish. An append is one small file write, so a holder still busy after this long has hung or is wedged, and failing loudly beats waiting forever. */
|
|
7
|
+
const LOCK_WAIT_SECONDS = 10;
|
|
8
|
+
const LOCK_WAIT_MS = LOCK_WAIT_SECONDS * MS_PER_SECOND;
|
|
9
|
+
/** Between attempts to claim a lock another live process holds: short against an append's own cost, long enough not to spin. */
|
|
10
|
+
const LOCK_RETRY_MS = 20;
|
|
11
|
+
const sleep = async (ms) => new Promise((resolve) => {
|
|
12
|
+
setTimeout(resolve, ms);
|
|
13
|
+
});
|
|
14
|
+
/** The tail of each lock's queue in this process, keyed by what the lock guards. */
|
|
15
|
+
const tails = new Map();
|
|
16
|
+
async function serialised(key, critical) {
|
|
17
|
+
const previous = tails.get(key) ?? Promise.resolve();
|
|
18
|
+
const next = previous.then(critical, critical);
|
|
19
|
+
const tail = next.then(() => undefined, () => undefined);
|
|
20
|
+
tails.set(key, tail);
|
|
21
|
+
try {
|
|
22
|
+
return await next;
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
if (tails.get(key) === tail)
|
|
26
|
+
tails.delete(key);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function claimFile(lockFile) {
|
|
30
|
+
const deadline = Date.now() + LOCK_WAIT_MS;
|
|
31
|
+
for (;;) {
|
|
32
|
+
const claim = tryAcquireLock(lockFile);
|
|
33
|
+
if (claim.acquired)
|
|
34
|
+
return;
|
|
35
|
+
if (Date.now() >= deadline) {
|
|
36
|
+
throw new Error(`account ledger lock ${lockFile} is still held by pid ${String(claim.heldBy)} after ${String(LOCK_WAIT_SECONDS)}s`);
|
|
37
|
+
}
|
|
38
|
+
await sleep(LOCK_RETRY_MS);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** A lock shared by every process on this machine that names the same lock file. */
|
|
42
|
+
export function createFileLedgerLock(lockFile) {
|
|
43
|
+
return {
|
|
44
|
+
run: async (critical) => serialised(lockFile, async () => {
|
|
45
|
+
await claimFile(lockFile);
|
|
46
|
+
try {
|
|
47
|
+
return await critical();
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
releaseLockFile(lockFile);
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
let nextInProcessLock = 0;
|
|
56
|
+
/** A lock with no file behind it, for a ledger whose storage lives only in this process's memory. */
|
|
57
|
+
export function createInProcessLedgerLock() {
|
|
58
|
+
nextInProcessLock += 1;
|
|
59
|
+
const key = `in-process:${String(nextInProcessLock)}`;
|
|
60
|
+
return { run: async (critical) => serialised(key, critical) };
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=ledger-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-lock.js","sourceRoot":"","sources":["../../src/core/ledger-lock.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOrE,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,kNAAkN;AAClN,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,YAAY,GAAG,iBAAiB,GAAG,aAAa,CAAC;AACvD,gIAAgI;AAChI,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,KAAK,GAAG,KAAK,EAAE,EAAU,EAAiB,EAAE,CAChD,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;IAC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CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO;QACL,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CACtB,UAAU,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;YAC9B,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC1B,IAAI,CAAC;gBACH,OAAO,MAAM,QAAQ,EAAE,CAAC;YAC1B,CAAC;oBAAS,CAAC;gBACT,eAAe,CAAC,QAAQ,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC;KACL,CAAC;AACJ,CAAC;AAED,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B,qGAAqG;AACrG,MAAM,UAAU,yBAAyB;IACvC,iBAAiB,IAAI,CAAC,CAAC;IACvB,MAAM,GAAG,GAAG,cAAc,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC;IACtD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -20,6 +20,8 @@ export declare class MembershipProofs {
|
|
|
20
20
|
private proof;
|
|
21
21
|
private minting;
|
|
22
22
|
private timer;
|
|
23
|
+
/** Keyed by device-id hex. One entry per device this side has checked, replaced whenever that device's proof or this side's principal changes. */
|
|
24
|
+
private readonly accountVerdicts;
|
|
23
25
|
constructor(deps: Readonly<MembershipProofsDeps>);
|
|
24
26
|
/** This device's current proof, undefined until the first has been minted. */
|
|
25
27
|
current(): string | undefined;
|
|
@@ -32,6 +34,11 @@ export declare class MembershipProofs {
|
|
|
32
34
|
deviceHex: string;
|
|
33
35
|
issuerHex: string;
|
|
34
36
|
}>): Promise<MembershipProofVerdict>;
|
|
37
|
+
/** Whether a gossiped proof shows that deviceHex belongs to the account this store holds: the proof verifies against this store's own user principal. A verdict is remembered per device, so a device re-gossiping the same proof is not re-verified on every advert; a positive one is trusted only until its proof expires, a negative one for as long as the proof and this side's principal are unchanged. */
|
|
38
|
+
isAccountMember(claim: Readonly<{
|
|
39
|
+
proof: string;
|
|
40
|
+
deviceHex: string;
|
|
41
|
+
}>): Promise<boolean>;
|
|
35
42
|
/** Which issuer a gossiped proof shows vouching for deviceHex, as this node sees it. */
|
|
36
43
|
identify(claim: Readonly<{
|
|
37
44
|
proof: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"membership-proofs.d.ts","sourceRoot":"","sources":["../../src/core/membership-proofs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"membership-proofs.d.ts","sourceRoot":"","sources":["../../src/core/membership-proofs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAKlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAKL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAI/B,qFAAqF;AACrF,eAAO,MAAM,yBAAyB,QACiB,CAAC;AAExD,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,WAAW,EAAE,MAAM,iBAAiB,CAAC;IACrC,mHAAmH;IACnH,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,KAAK,YAAY,CAAC;IAClE,kCAAkC;IAClC,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACjC;AAUD,qBAAa,gBAAgB;IAOf,OAAO,CAAC,QAAQ,CAAC,IAAI;IANjC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAA6C;IAC1D,kJAAkJ;IAClJ,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA2C;gBAE9C,IAAI,EAAE,QAAQ,CAAC,oBAAoB,CAAC;IAEjE,8EAA8E;IAC9E,OAAO,IAAI,MAAM,GAAG,SAAS;IAI7B,oJAAoJ;IACpJ,KAAK,IAAI,IAAI;IASb,IAAI,IAAI,IAAI;IAKZ,8IAA8I;IACxI,MAAM,CACV,KAAK,EAAE,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,GACvE,OAAO,CAAC,sBAAsB,CAAC;IAYlC,kZAAkZ;IAC5Y,eAAe,CACnB,KAAK,EAAE,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,GACpD,OAAO,CAAC,OAAO,CAAC;IAqBnB,wFAAwF;IAClF,QAAQ,CACZ,KAAK,EAAE,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,GACpD,OAAO,CAAC,yBAAyB,CAAC;IAWrC,OAAO,CAAC,OAAO;CAuBhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A device's own membership proof under one grouping issuer, kept fresh, and the checks for other devices' proofs (agent-comms#266, agent-comms#343). MeshStore holds one instance per issuer, its user principal and its machine, and hands each its identity, peer id and error sink. The checks do not depend on which issuer an instance mints under, so either instance can verify or identify any proof.
|
|
3
3
|
*/
|
|
4
|
-
import { deviceIdFromHex } from "wire-mesh-core/domain/device-id";
|
|
4
|
+
import { deviceIdFromHex, deviceIdToHex, } from "wire-mesh-core/domain/device-id";
|
|
5
5
|
import { MEMBERSHIP_PROOF_LIFETIME_MS, identifyMembershipProofIssuer, mintMembershipProof, verifyMembershipProof, } from "./membership-proof.js";
|
|
6
6
|
/** How many times per proof lifetime the proof is re-minted, so a missed tick or two never lets the advertised proof lapse. */
|
|
7
7
|
const REFRESHES_PER_LIFETIME = 3;
|
|
@@ -12,6 +12,8 @@ export class MembershipProofs {
|
|
|
12
12
|
proof;
|
|
13
13
|
minting = false;
|
|
14
14
|
timer;
|
|
15
|
+
/** Keyed by device-id hex. One entry per device this side has checked, replaced whenever that device's proof or this side's principal changes. */
|
|
16
|
+
accountVerdicts = new Map();
|
|
15
17
|
constructor(deps) {
|
|
16
18
|
this.deps = deps;
|
|
17
19
|
}
|
|
@@ -44,6 +46,29 @@ export class MembershipProofs {
|
|
|
44
46
|
revocation,
|
|
45
47
|
});
|
|
46
48
|
}
|
|
49
|
+
/** Whether a gossiped proof shows that deviceHex belongs to the account this store holds: the proof verifies against this store's own user principal. A verdict is remembered per device, so a device re-gossiping the same proof is not re-verified on every advert; a positive one is trusted only until its proof expires, a negative one for as long as the proof and this side's principal are unchanged. */
|
|
50
|
+
async isAccountMember(claim) {
|
|
51
|
+
const { userIdentity, clock } = this.deps.getIdentity();
|
|
52
|
+
const principal = deviceIdToHex(userIdentity.deviceId);
|
|
53
|
+
const known = this.accountVerdicts.get(claim.deviceHex);
|
|
54
|
+
if (known?.proof === claim.proof && known.principal === principal) {
|
|
55
|
+
if (known.until === undefined)
|
|
56
|
+
return false;
|
|
57
|
+
if (known.until > clock.now())
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
const verdict = await this.verify({
|
|
61
|
+
proof: claim.proof,
|
|
62
|
+
deviceHex: claim.deviceHex,
|
|
63
|
+
issuerHex: principal,
|
|
64
|
+
});
|
|
65
|
+
this.accountVerdicts.set(claim.deviceHex, {
|
|
66
|
+
proof: claim.proof,
|
|
67
|
+
principal,
|
|
68
|
+
until: verdict.ok ? verdict.expires : undefined,
|
|
69
|
+
});
|
|
70
|
+
return verdict.ok;
|
|
71
|
+
}
|
|
47
72
|
/** Which issuer a gossiped proof shows vouching for deviceHex, as this node sees it. */
|
|
48
73
|
async identify(claim) {
|
|
49
74
|
const { identity, clock, revocation } = this.deps.getIdentity();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"membership-proofs.js","sourceRoot":"","sources":["../../src/core/membership-proofs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"membership-proofs.js","sourceRoot":"","sources":["../../src/core/membership-proofs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,eAAe,EACf,aAAa,GACd,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,uBAAuB,CAAC;AAE/B,+HAA+H;AAC/H,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,qFAAqF;AACrF,MAAM,CAAC,MAAM,yBAAyB,GACpC,4BAA4B,GAAG,sBAAsB,CAAC;AAoBxD,MAAM,OAAO,gBAAgB;IAOE;IANrB,KAAK,CAAqB;IAC1B,OAAO,GAAG,KAAK,CAAC;IAChB,KAAK,CAA6C;IAC1D,kJAAkJ;IACjI,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;IAE3E,YAA6B,IAAoC;QAApC,SAAI,GAAJ,IAAI,CAAgC;IAAG,CAAC;IAErE,8EAA8E;IAC9E,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,oJAAoJ;IACpJ,KAAK;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC,EAAE,yBAAyB,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,IAAI;QACF,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC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AC,CACF;aACA,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;CACF"}
|
|
@@ -6,9 +6,10 @@ import type { IdentityPort } from "wire-mesh-core/ports/identity";
|
|
|
6
6
|
import type { RevocationView } from "wire-mesh-core/domain/revocation-view";
|
|
7
7
|
import type { KeyValueStorage } from "wire-mesh-core/ports/storage";
|
|
8
8
|
import type { IdentitySlot } from "./identity-store.js";
|
|
9
|
+
import type { AccountLedger } from "./account-ledger.js";
|
|
9
10
|
import type { UserIdentityOptions } from "./user-identity.js";
|
|
10
11
|
import type { MachineIdentityOptions } from "./machine-identity.js";
|
|
11
|
-
/** The identity/clock/persistence collaborators MeshStore mints and persists room-membership grants against. Set via setIdentity(), mirroring the transport's own setTransport() contract. dataStorage backs this device's own room-notice oplog (P5, agent-comms#50): the same KeyValueStorage instance WireMeshTransport's own dataStorage constructor parameter is wired with, so a durable sendRoomMessage and the transport's own data-domain responder read and write the identical log. userIdentity/userIdentityOptions are the user-principal identity (user-identity.ts, agent-comms#160) this store's own bridge slot shares with every other bridge of this account, distinct from `identity`, which is this specific bridge's own per-slot device identity; userIdentity is what a dm:send grant (agent-comms#162) is minted and verified against.
|
|
12
|
+
/** The identity/clock/persistence collaborators MeshStore mints and persists room-membership grants against. Set via setIdentity(), mirroring the transport's own setTransport() contract. dataStorage backs this device's own room-notice oplog (P5, agent-comms#50): the same KeyValueStorage instance WireMeshTransport's own dataStorage constructor parameter is wired with, so a durable sendRoomMessage and the transport's own data-domain responder read and write the identical log. userIdentity/userIdentityOptions are the user-principal identity (user-identity.ts, agent-comms#160) this store's own bridge slot shares with every other bridge of this account, distinct from `identity`, which is this specific bridge's own per-slot device identity; userIdentity is what a dm:send grant (agent-comms#162) is minted and verified against. accountLedger is the account's replicated, encrypted grant ledger (account-ledger.ts, agent-comms#344), where every grant this principal mints is recorded so any machine holding the account key can revoke it. userIdentityOptions locates the file userIdentity was loaded from, which the account's own join flow (account-join.ts) reads to seal the key for a joining machine and writes to import one it joins. machineIdentity is this account's machine identity for the host (machine-identity.ts, agent-comms#343), shared by every bridge the account runs there: the second grouping issuer this store's device is vouched for by. machineIdentityOptions locates the file it was loaded from, where the machine's self display name (agent-comms#345) is kept. */
|
|
12
13
|
export interface MeshStoreIdentity {
|
|
13
14
|
identity: IdentityPort;
|
|
14
15
|
clock: Clock;
|
|
@@ -16,6 +17,8 @@ export interface MeshStoreIdentity {
|
|
|
16
17
|
revocation: RevocationView;
|
|
17
18
|
dataStorage: KeyValueStorage;
|
|
18
19
|
userIdentity: IdentityPort;
|
|
20
|
+
accountLedger: AccountLedger;
|
|
21
|
+
/** Where userIdentity's key lives on this machine, for the account's own join flow (account-join.ts) to seal it for a joining machine and to import one it joins. */
|
|
19
22
|
userIdentityOptions: Readonly<UserIdentityOptions>;
|
|
20
23
|
machineIdentity: IdentityPort;
|
|
21
24
|
machineIdentityOptions: Readonly<MachineIdentityOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-store-shared.d.ts","sourceRoot":"","sources":["../../src/core/mesh-store-shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,
|
|
1
|
+
{"version":3,"file":"mesh-store-shared.d.ts","sourceRoot":"","sources":["../../src/core/mesh-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AAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD,2QAA2Q;AAC3Q,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAIxD,eAAO,MAAM,2BAA2B,QAIzB,CAAC;AAEhB,yPAAyP;AACzP,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C,4TAA4T;AAC5T,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAOvD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,EAC1C,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAgBlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-store-shared.js","sourceRoot":"","sources":["../../src/core/mesh-store-shared.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"mesh-store-shared.js","sourceRoot":"","sources":["../../src/core/mesh-store-shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0BH;;GAEG;AACH,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,CAAC,MAAM,sBAAsB,GACjC,wBAAwB;IACxB,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,aAAa,CAAC;AAEhB,iUAAiU;AACjU,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,yBAAyB,GACpC,2BAA2B;IAC3B,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,aAAa,CAAC;AAQhB;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AA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,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YAChC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -16,9 +16,11 @@ import { type GenerateConnectionCodeOptions, type RedeemConnectionCodeOptions, t
|
|
|
16
16
|
import type { MeshStoreOptions } from "./mesh-store-options.js";
|
|
17
17
|
import type { IncomingManageRequest } from "wire-mesh-core/domain/mesh-session";
|
|
18
18
|
import type { DeviceId } from "wire-mesh-core/generated/protocol";
|
|
19
|
+
import { type AccountLedgerReplica } from "./account-ledger.js";
|
|
19
20
|
import { type CoordinatorClaimView } from "./coordinator-role.js";
|
|
20
21
|
import type { RoomVerbHandler } from "./room-router.js";
|
|
21
22
|
import type { AgentSelfAdvert, HostedRoomAdvert } from "./gossip-extensions.js";
|
|
23
|
+
import { AccountJoin } from "./account-join.js";
|
|
22
24
|
import type { MeshStatePatch, SerialisedState } from "./wire-protocol.js";
|
|
23
25
|
import type { ListenerInfo, MeshGraph, MeshTraceResult, MeshTransport, TransportEvents } from "./transport.js";
|
|
24
26
|
import type { CommsStore, SendRoomMessageOptions, SentDm, SentRoomMessage } from "./comms-store.js";
|
|
@@ -57,6 +59,8 @@ export declare class MeshStore implements CommsStore {
|
|
|
57
59
|
readonly naming: Naming;
|
|
58
60
|
/** The connection-code generate/redeem pair (agent-comms#188) bootstrapping gatewayTrust above between two devices with no existing mesh connection. Persists across restarts per slot, from the slot passed to this store's own constructor, whereas gatewayTrust is shared by every slot in the slot's identity directory. generateConnectionCode/redeemConnectionCode below are the methods CommsTool actually calls through MeshOnlyFeatures; redeemConnectionCode is also where a successful redemption's deviceId gets fed into gatewayTrust.add, the actual point of this whole bootstrap. */
|
|
59
61
|
private readonly connectionCodes;
|
|
62
|
+
/** Issues and answers account invites, and joins this machine to an account (agent-comms#344). Public so `agent-comms account invite` and `agent-comms account join` (account-cli.ts) reach it; deliberately not on CommsTool's surface (see account-join.ts). */
|
|
63
|
+
readonly account: AccountJoin;
|
|
60
64
|
private readonly deliveryEngine;
|
|
61
65
|
private readonly roomProtocol;
|
|
62
66
|
private readonly roomMessaging;
|
|
@@ -115,8 +119,12 @@ export declare class MeshStore implements CommsStore {
|
|
|
115
119
|
setTransport(transport: Readonly<MeshTransport>): void;
|
|
116
120
|
/** The set transport, or throws if setTransport() hasn't been called yet -- the single place every transport-using method reads through, so the "must call setTransport() first" contract is enforced at one boundary rather than checked ad hoc at each call site. */
|
|
117
121
|
private requireTransport;
|
|
122
|
+
/** Stops feeding the current account ledger's replicated revocations into the RevocationView; undefined until an identity is attached. */
|
|
123
|
+
private stopFollowingLedger;
|
|
118
124
|
/** Sets the identity/clock/slot this store mints and persists room-membership grants against. Must be called before createRoom() or any other identity-using method, mirroring setTransport()'s own contract. */
|
|
119
125
|
setIdentity(identity: MeshStoreIdentity): void;
|
|
126
|
+
/** The account's replicated grant ledger (agent-comms#344) once an identity is attached, for the transport to replicate. */
|
|
127
|
+
get accountLedger(): AccountLedgerReplica | undefined;
|
|
120
128
|
/** Every device this side trusts only because a trusted principal or machine vouches for it, with that issuer. */
|
|
121
129
|
listVerifiedMembers(): VerifiedMember[];
|
|
122
130
|
/** The machine (hex) of each device this side can place on one, keyed by device id (agent-comms#343): this device's own, and every gossiped device carrying a valid machine proof. Empty before this store's identity is attached. */
|
|
@@ -264,14 +272,15 @@ export declare class MeshStore implements CommsStore {
|
|
|
264
272
|
/** Delegates to the transport's own meshTrace, same "throw if unsupported" contract as meshGraph above. */
|
|
265
273
|
meshTrace(target: string, timeoutMs?: number): Promise<MeshTraceResult>;
|
|
266
274
|
getNetworkInterfaces(): NetworkInterface[];
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
+
private readonly peerVersions;
|
|
276
|
+
/** deviceId's own gossiped agent-comms package version, if this side has heard it advertised. */
|
|
277
|
+
readonly getPeerAgentCommsVersion: (deviceId: string) => string | undefined;
|
|
278
|
+
/** deviceId's own gossiped cc-peer package version, present only while that device is fronting a cc-peer session or running `bridge cc-peer`. */
|
|
279
|
+
readonly getPeerCcPeerVersion: (deviceId: string) => string | undefined;
|
|
280
|
+
/** deviceId's own gossiped wire-mesh-core version (wire-mesh#179). */
|
|
281
|
+
readonly getPeerWireMeshCoreVersion: (deviceId: string) => string | undefined;
|
|
282
|
+
/** Asks deviceId for its own, currently-running wire-mesh-core version live rather than trusting whatever it last gossiped (the query_version action's backing call). */
|
|
283
|
+
readonly queryVersion: (deviceId: string) => Promise<{
|
|
275
284
|
version: string;
|
|
276
285
|
} | {
|
|
277
286
|
error: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-store.d.ts","sourceRoot":"","sources":["../../src/core/mesh-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAQhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAGl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jO,sBAAsB,CAC1B,OAAO,GAAE,QAAQ,CAAC,6BAA6B,CAAM,GACpD,OAAO,CAAC,cAAc,CAAC;IAI1B,0SAA0S;IACpS,oBAAoB,CACxB,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,EACnC,OAAO,GAAE,QAAQ,CAAC,2BAA2B,CAAM,GAClD,OAAO,CAAC,0BAA0B,CAAC;IAWhC,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC;IAQZ,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,aAAa,IAAI,YAAY,EAAE;IAI/B,mXAAmX;IACnX,SAAS,IAAI,SAAS;IAItB,2GAA2G;IACrG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC;IAI3B,oBAAoB,IAAI,gBAAgB,EAAE;IAQ1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAE3B;IAEF,iGAAiG;IACjG,QAAQ,CAAC,wBAAwB,2CAAgC;IAEjE,iJAAiJ;IACjJ,QAAQ,CAAC,oBAAoB,2CAA4B;IAEzD,sEAAsE;IACtE,QAAQ,CAAC,0BAA0B,2CAAkC;IAErE,yKAAyK;IACzK,QAAQ,CAAC,YAAY;;;;OAA2B;IAM1C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CA6BhC"}
|
package/dist/core/mesh-store.js
CHANGED
|
@@ -12,7 +12,6 @@ import { GroupProofs } from "./group-proofs.js";
|
|
|
12
12
|
import { Naming } from "./naming.js";
|
|
13
13
|
import { Petnames } from "./petnames.js";
|
|
14
14
|
import { ROOM_JOIN_APPROVAL_TIMEOUT_MS, ROOM_REQUEST_TIMEOUT_MS, } from "./request-timeouts.js";
|
|
15
|
-
import { CommsError } from "./store.js";
|
|
16
15
|
import { DiscoveryManager } from "./discovery.js";
|
|
17
16
|
import { MdnsDiscoveryBackend } from "./discovery-mdns.js";
|
|
18
17
|
import { TailscaleDiscoveryBackend } from "./discovery-tailscale.js";
|
|
@@ -26,12 +25,15 @@ import { RoomLifecycle } from "./room-lifecycle.js";
|
|
|
26
25
|
import { AgentRegistry } from "./agent-registry.js";
|
|
27
26
|
import { ConnectionApproval } from "./connection-approval.js";
|
|
28
27
|
import { CapabilityAskAdmission } from "./capability-ask.js";
|
|
28
|
+
import { followLedgerRevocations, } from "./account-ledger.js";
|
|
29
29
|
import { StaleAgentChecker } from "./stale-agent-checker.js";
|
|
30
30
|
import { PeerLifecycle } from "./peer-lifecycle.js";
|
|
31
31
|
import { CoordinatorRole, } from "./coordinator-role.js";
|
|
32
32
|
import { DEFAULT_PRESENCE_STALE_AFTER_MS } from "./gossip-extensions.js";
|
|
33
|
-
import {
|
|
33
|
+
import { peerVersionReaders } from "./peer-versions.js";
|
|
34
34
|
import { listNetworkInterfaces } from "./network-interfaces.js";
|
|
35
|
+
import { parseListenerPolicy, requireMeshGraph, requireMeshTrace, } from "./transport-queries.js";
|
|
36
|
+
import { ACCOUNT_JOIN_VERB, AccountJoin } from "./account-join.js";
|
|
35
37
|
import { createTransportEvents } from "./transport-events.js";
|
|
36
38
|
// ---------------------------------------------------------------------------
|
|
37
39
|
// Constants
|
|
@@ -83,6 +85,8 @@ export class MeshStore {
|
|
|
83
85
|
naming;
|
|
84
86
|
/** The connection-code generate/redeem pair (agent-comms#188) bootstrapping gatewayTrust above between two devices with no existing mesh connection. Persists across restarts per slot, from the slot passed to this store's own constructor, whereas gatewayTrust is shared by every slot in the slot's identity directory. generateConnectionCode/redeemConnectionCode below are the methods CommsTool actually calls through MeshOnlyFeatures; redeemConnectionCode is also where a successful redemption's deviceId gets fed into gatewayTrust.add, the actual point of this whole bootstrap. */
|
|
85
87
|
connectionCodes;
|
|
88
|
+
/** Issues and answers account invites, and joins this machine to an account (agent-comms#344). Public so `agent-comms account invite` and `agent-comms account join` (account-cli.ts) reach it; deliberately not on CommsTool's surface (see account-join.ts). */
|
|
89
|
+
account;
|
|
86
90
|
deliveryEngine;
|
|
87
91
|
roomProtocol;
|
|
88
92
|
roomMessaging;
|
|
@@ -203,11 +207,23 @@ export class MeshStore {
|
|
|
203
207
|
this.gatewayTrust = new GatewayTrust(slot);
|
|
204
208
|
this.naming = new Naming({
|
|
205
209
|
petnames: new Petnames(slot),
|
|
206
|
-
|
|
210
|
+
issuerNames: async () => this.membership.issuerNames(),
|
|
207
211
|
listAgents: async (requesterId) => this.listAgents(requesterId),
|
|
208
212
|
saveMachineName: async (name) => this.membership.saveMachineName(name),
|
|
213
|
+
saveUserName: async (name) => this.membership.saveUserName(name),
|
|
209
214
|
});
|
|
210
215
|
this.connectionCodes = new ConnectionCodeLedger(slot);
|
|
216
|
+
this.account = new AccountJoin({
|
|
217
|
+
requireIdentity: () => this.requireIdentity(),
|
|
218
|
+
requireTransport: () => this.requireTransport(),
|
|
219
|
+
getPeerId: () => this.peerId,
|
|
220
|
+
connectionCodes: this.connectionCodes,
|
|
221
|
+
gatewayTrust: this.gatewayTrust,
|
|
222
|
+
reconsiderHub: this.reconsiderHub.bind(this),
|
|
223
|
+
setPetname: (deviceHex, name) => this.naming.setPetname(deviceHex, name),
|
|
224
|
+
redeemConnectionCode: this.redeemConnectionCode.bind(this),
|
|
225
|
+
setIdentity: this.setIdentity.bind(this),
|
|
226
|
+
});
|
|
211
227
|
// Discovery manager — registers available backends
|
|
212
228
|
this.discovery = new DiscoveryManager();
|
|
213
229
|
this.discovery.registerBackend(new MdnsDiscoveryBackend());
|
|
@@ -343,10 +359,18 @@ export class MeshStore {
|
|
|
343
359
|
}
|
|
344
360
|
return this.transport;
|
|
345
361
|
}
|
|
362
|
+
/** Stops feeding the current account ledger's replicated revocations into the RevocationView; undefined until an identity is attached. */
|
|
363
|
+
stopFollowingLedger;
|
|
346
364
|
/** Sets the identity/clock/slot this store mints and persists room-membership grants against. Must be called before createRoom() or any other identity-using method, mirroring setTransport()'s own contract. */
|
|
347
365
|
setIdentity(identity) {
|
|
348
366
|
this.storeIdentity = identity;
|
|
349
367
|
this.membership.start();
|
|
368
|
+
this.stopFollowingLedger?.();
|
|
369
|
+
this.stopFollowingLedger = followLedgerRevocations(identity, this.reportError);
|
|
370
|
+
}
|
|
371
|
+
/** The account's replicated grant ledger (agent-comms#344) once an identity is attached, for the transport to replicate. */
|
|
372
|
+
get accountLedger() {
|
|
373
|
+
return this.storeIdentity?.accountLedger;
|
|
350
374
|
}
|
|
351
375
|
/** Every device this side trusts only because a trusted principal or machine vouches for it, with that issuer. */
|
|
352
376
|
listVerifiedMembers() {
|
|
@@ -403,7 +427,10 @@ export class MeshStore {
|
|
|
403
427
|
* Room verb handlers this store registers with its own WireMeshTransport, keyed by params.verb per room-router.ts's own dispatch discipline.
|
|
404
428
|
*/
|
|
405
429
|
get roomVerbHandlers() {
|
|
406
|
-
return
|
|
430
|
+
return {
|
|
431
|
+
...this.roomProtocol.roomVerbHandlers,
|
|
432
|
+
[ACCOUNT_JOIN_VERB]: this.account.handleJoinRequest,
|
|
433
|
+
};
|
|
407
434
|
}
|
|
408
435
|
// -----------------------------------------------------------------------
|
|
409
436
|
// CommsStore — Identity
|
|
@@ -670,13 +697,7 @@ export class MeshStore {
|
|
|
670
697
|
// Listener management (coordinator only)
|
|
671
698
|
// -----------------------------------------------------------------------
|
|
672
699
|
async addListener(host, port, policy) {
|
|
673
|
-
|
|
674
|
-
return (v === "full" || v === "observe" || v === "rooms-only" || v === "gateway");
|
|
675
|
-
}
|
|
676
|
-
if (!isListenerPolicy(policy)) {
|
|
677
|
-
throw new CommsError(`Invalid policy "${policy}"`, "INVALID_POLICY");
|
|
678
|
-
}
|
|
679
|
-
return this.requireTransport().addListener(host, port, policy);
|
|
700
|
+
return this.requireTransport().addListener(host, port, parseListenerPolicy(policy));
|
|
680
701
|
}
|
|
681
702
|
async removeListener(id) {
|
|
682
703
|
return this.requireTransport().removeListener(id);
|
|
@@ -686,46 +707,27 @@ export class MeshStore {
|
|
|
686
707
|
}
|
|
687
708
|
/** Delegates to the transport's own meshGraph, throwing if the current transport doesn't support it (agent-comms#199) -- CommsTool's own notMeshBacked distinguishes "no MeshStore at all" from this narrower "MeshStore, but a transport without this capability" case by catching the throw, the same way requireTransport's own "no transport set" throw is already handled. */
|
|
688
709
|
meshGraph() {
|
|
689
|
-
|
|
690
|
-
if (graph === undefined) {
|
|
691
|
-
throw new CommsError("mesh_graph requires a transport that supports it", "NOT_SUPPORTED");
|
|
692
|
-
}
|
|
693
|
-
return graph;
|
|
710
|
+
return requireMeshGraph(this.requireTransport());
|
|
694
711
|
}
|
|
695
712
|
/** Delegates to the transport's own meshTrace, same "throw if unsupported" contract as meshGraph above. */
|
|
696
713
|
async meshTrace(target, timeoutMs) {
|
|
697
|
-
|
|
698
|
-
if (transport.meshTrace === undefined) {
|
|
699
|
-
throw new CommsError("mesh_trace requires a transport that supports it", "NOT_SUPPORTED");
|
|
700
|
-
}
|
|
701
|
-
return transport.meshTrace(target, timeoutMs);
|
|
714
|
+
return requireMeshTrace(this.requireTransport(), target, timeoutMs);
|
|
702
715
|
}
|
|
703
716
|
getNetworkInterfaces() {
|
|
704
717
|
return listNetworkInterfaces();
|
|
705
718
|
}
|
|
706
719
|
// -----------------------------------------------------------------------
|
|
707
|
-
// Peer versions (agent-comms#198)
|
|
708
|
-
// -----------------------------------------------------------------------
|
|
709
|
-
/** deviceId's own gossiped agent-comms package version, if this side has heard it advertised -- undefined for a device this side has never heard gossip from, or one running a version of agent-comms that predates this feature. */
|
|
710
|
-
getPeerAgentCommsVersion(deviceId) {
|
|
711
|
-
return getPeerAgentCommsVersions(this.requireTransport(), deviceId)
|
|
712
|
-
?.agentComms;
|
|
713
|
-
}
|
|
714
|
-
/** deviceId's own gossiped cc-peer package version, present only while that device is actually fronting a cc-peer session or running the one-shot `bridge cc-peer` command -- undefined otherwise, or for a device this side has never heard gossip from. */
|
|
715
|
-
getPeerCcPeerVersion(deviceId) {
|
|
716
|
-
return getPeerAgentCommsVersions(this.requireTransport(), deviceId)?.ccPeer;
|
|
717
|
-
}
|
|
718
|
-
/** deviceId's own gossiped wire-mesh-core version, self-advertised automatically by wire-mesh-core itself (wire-mesh#179) -- undefined for a device this side has never heard gossip from, or one running a wire-mesh-core older than #179. */
|
|
719
|
-
getPeerWireMeshCoreVersion(deviceId) {
|
|
720
|
-
return getPeerWireMeshCoreVersion(this.requireTransport(), deviceId);
|
|
721
|
-
}
|
|
722
|
-
// -----------------------------------------------------------------------
|
|
723
|
-
// Peer versions (agent-comms#198) -- the live, cache-busting path
|
|
720
|
+
// Peer versions (agent-comms#198)
|
|
724
721
|
// -----------------------------------------------------------------------
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
722
|
+
peerVersions = peerVersionReaders(() => this.requireTransport());
|
|
723
|
+
/** deviceId's own gossiped agent-comms package version, if this side has heard it advertised. */
|
|
724
|
+
getPeerAgentCommsVersion = this.peerVersions.agentComms;
|
|
725
|
+
/** deviceId's own gossiped cc-peer package version, present only while that device is fronting a cc-peer session or running `bridge cc-peer`. */
|
|
726
|
+
getPeerCcPeerVersion = this.peerVersions.ccPeer;
|
|
727
|
+
/** deviceId's own gossiped wire-mesh-core version (wire-mesh#179). */
|
|
728
|
+
getPeerWireMeshCoreVersion = this.peerVersions.wireMeshCore;
|
|
729
|
+
/** Asks deviceId for its own, currently-running wire-mesh-core version live rather than trusting whatever it last gossiped (the query_version action's backing call). */
|
|
730
|
+
queryVersion = this.peerVersions.query;
|
|
729
731
|
// -----------------------------------------------------------------------
|
|
730
732
|
// Shutdown
|
|
731
733
|
// -----------------------------------------------------------------------
|