agent-comms 9.0.11 → 9.0.13
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 +12 -6
- package/dist/account-cli.d.ts.map +1 -1
- package/dist/account-cli.js +4 -1
- package/dist/account-cli.js.map +1 -1
- package/dist/bridges/user/web/dist/bundle.js +1 -1
- package/dist/bridges/user/web/dist/index.html +1 -7
- package/dist/bridges/user/web/dist/mesh-worker.js +4 -4
- package/dist/bridges/user/web/dist/sw.js +1 -1
- package/dist/bridges/user/web/hosted-dashboard.d.ts +10 -0
- package/dist/bridges/user/web/hosted-dashboard.d.ts.map +1 -0
- package/dist/bridges/user/web/hosted-dashboard.js +10 -0
- package/dist/bridges/user/web/hosted-dashboard.js.map +1 -0
- package/dist/bridges/user/web/web-access.d.ts +0 -2
- package/dist/bridges/user/web/web-access.d.ts.map +1 -1
- package/dist/bridges/user/web/web-access.js +1 -2
- package/dist/bridges/user/web/web-access.js.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli-main.js +9 -12
- package/dist/cli-main.js.map +1 -1
- package/dist/core/account-bundle.d.ts +1 -1
- package/dist/core/account-bundle.d.ts.map +1 -1
- package/dist/core/account-bundle.js +26 -19
- package/dist/core/account-bundle.js.map +1 -1
- package/dist/core/account-join.d.ts.map +1 -1
- package/dist/core/account-join.js +5 -2
- package/dist/core/account-join.js.map +1 -1
- package/dist/core/account-ledger-crypto.d.ts.map +1 -1
- package/dist/core/account-ledger-crypto.js +4 -1
- package/dist/core/account-ledger-crypto.js.map +1 -1
- package/dist/core/account-ledger-store.d.ts +3 -1
- package/dist/core/account-ledger-store.d.ts.map +1 -1
- package/dist/core/account-ledger-store.js +6 -3
- package/dist/core/account-ledger-store.js.map +1 -1
- package/dist/core/account-ledger.d.ts +51 -4
- package/dist/core/account-ledger.d.ts.map +1 -1
- package/dist/core/account-ledger.js +102 -15
- package/dist/core/account-ledger.js.map +1 -1
- package/dist/core/bridge-mesh.d.ts.map +1 -1
- package/dist/core/bridge-mesh.js +3 -0
- package/dist/core/bridge-mesh.js.map +1 -1
- package/dist/core/bridge.d.ts.map +1 -1
- package/dist/core/bridge.js +16 -4
- package/dist/core/bridge.js.map +1 -1
- package/dist/core/capability-ask.d.ts.map +1 -1
- package/dist/core/capability-ask.js +10 -2
- package/dist/core/capability-ask.js.map +1 -1
- package/dist/core/connection-code-tool.d.ts +1 -1
- package/dist/core/connection-code-tool.js +2 -2
- package/dist/core/connection-code-tool.js.map +1 -1
- package/dist/core/connection-code.d.ts +5 -5
- package/dist/core/connection-code.d.ts.map +1 -1
- package/dist/core/connection-code.js +22 -6
- package/dist/core/connection-code.js.map +1 -1
- package/dist/core/device-membership.d.ts +8 -3
- package/dist/core/device-membership.d.ts.map +1 -1
- package/dist/core/device-membership.js +4 -4
- package/dist/core/device-membership.js.map +1 -1
- package/dist/core/dm-grant-actions.d.ts.map +1 -1
- package/dist/core/dm-grant-actions.js +7 -1
- package/dist/core/dm-grant-actions.js.map +1 -1
- package/dist/core/error-reporting.d.ts.map +1 -1
- package/dist/core/error-reporting.js +5 -0
- package/dist/core/error-reporting.js.map +1 -1
- package/dist/core/gateway-trust.d.ts +1 -1
- package/dist/core/gateway-trust.d.ts.map +1 -1
- package/dist/core/gateway-trust.js +4 -4
- package/dist/core/gateway-trust.js.map +1 -1
- package/dist/core/group-proofs.d.ts.map +1 -1
- package/dist/core/group-proofs.js +2 -2
- package/dist/core/group-proofs.js.map +1 -1
- package/dist/core/identity-store.d.ts +13 -9
- package/dist/core/identity-store.d.ts.map +1 -1
- package/dist/core/identity-store.js +122 -147
- package/dist/core/identity-store.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/iso-timestamp.d.ts +10 -0
- package/dist/core/iso-timestamp.d.ts.map +1 -0
- package/dist/core/iso-timestamp.js +19 -0
- package/dist/core/iso-timestamp.js.map +1 -0
- package/dist/core/issuer-identity-file.d.ts +15 -0
- package/dist/core/issuer-identity-file.d.ts.map +1 -1
- package/dist/core/issuer-identity-file.js +69 -20
- package/dist/core/issuer-identity-file.js.map +1 -1
- package/dist/core/machine-identity.d.ts +1 -1
- package/dist/core/machine-identity.d.ts.map +1 -1
- package/dist/core/machine-identity.js +14 -11
- package/dist/core/machine-identity.js.map +1 -1
- package/dist/core/mesh-store.d.ts +2 -2
- package/dist/core/mesh-store.d.ts.map +1 -1
- package/dist/core/mesh-store.js.map +1 -1
- package/dist/core/peer-lifecycle.d.ts.map +1 -1
- package/dist/core/peer-lifecycle.js +8 -2
- package/dist/core/peer-lifecycle.js.map +1 -1
- package/dist/core/pid-lock-file.d.ts +27 -4
- package/dist/core/pid-lock-file.d.ts.map +1 -1
- package/dist/core/pid-lock-file.js +120 -11
- package/dist/core/pid-lock-file.js.map +1 -1
- package/dist/core/process-start.d.ts +10 -0
- package/dist/core/process-start.d.ts.map +1 -0
- package/dist/core/process-start.js +43 -0
- package/dist/core/process-start.js.map +1 -0
- package/dist/core/room-lifecycle.d.ts +3 -2
- package/dist/core/room-lifecycle.d.ts.map +1 -1
- package/dist/core/room-lifecycle.js +9 -8
- package/dist/core/room-lifecycle.js.map +1 -1
- package/dist/core/room-protocol.d.ts.map +1 -1
- package/dist/core/room-protocol.js +25 -3
- package/dist/core/room-protocol.js.map +1 -1
- package/dist/core/stale-agent-checker.d.ts.map +1 -1
- package/dist/core/stale-agent-checker.js +3 -1
- package/dist/core/stale-agent-checker.js.map +1 -1
- package/dist/core/store.d.ts +3 -0
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/store.js +42 -20
- package/dist/core/store.js.map +1 -1
- package/dist/core/tool.d.ts +5 -1
- package/dist/core/tool.d.ts.map +1 -1
- package/dist/core/tool.js +7 -1
- package/dist/core/tool.js.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +8 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-identity.d.ts +5 -5
- package/dist/core/user-identity.d.ts.map +1 -1
- package/dist/core/user-identity.js +59 -45
- package/dist/core/user-identity.js.map +1 -1
- package/package.json +1 -1
- package/src/account-cli.ts +4 -1
- package/src/bridges/user/web/dist/bundle.js +1 -1
- package/src/bridges/user/web/dist/index.html +1 -7
- package/src/bridges/user/web/dist/mesh-worker.js +4 -4
- package/src/bridges/user/web/dist/sw.js +1 -1
- package/src/bridges/user/web/hosted-dashboard.ts +11 -0
- package/src/bridges/user/web/web-access.ts +1 -3
- package/src/cli-main.ts +10 -12
- package/src/core/account-bundle.ts +36 -25
- package/src/core/account-join.ts +5 -2
- package/src/core/account-ledger-crypto.ts +4 -1
- package/src/core/account-ledger-store.ts +11 -3
- package/src/core/account-ledger.ts +142 -20
- package/src/core/bridge-mesh.ts +4 -0
- package/src/core/bridge.ts +24 -4
- package/src/core/capability-ask.ts +16 -1
- package/src/core/connection-code-tool.ts +2 -2
- package/src/core/connection-code.ts +34 -8
- package/src/core/device-membership.ts +12 -8
- package/src/core/dm-grant-actions.ts +7 -1
- package/src/core/error-reporting.ts +5 -0
- package/src/core/gateway-trust.ts +4 -4
- package/src/core/group-proofs.ts +5 -2
- package/src/core/identity-store.ts +182 -191
- package/src/core/index.ts +1 -0
- package/src/core/iso-timestamp.ts +21 -0
- package/src/core/issuer-identity-file.ts +87 -23
- package/src/core/machine-identity.ts +15 -12
- package/src/core/mesh-store.ts +2 -1
- package/src/core/peer-lifecycle.ts +9 -4
- package/src/core/pid-lock-file.ts +139 -11
- package/src/core/process-start.ts +45 -0
- package/src/core/room-lifecycle.ts +12 -9
- package/src/core/room-protocol.ts +23 -3
- package/src/core/stale-agent-checker.ts +3 -1
- package/src/core/store.ts +48 -23
- package/src/core/tool.ts +14 -1
- package/src/core/types.ts +9 -3
- package/src/core/user-identity.ts +65 -51
|
@@ -5,7 +5,7 @@ import * as path from "node:path";
|
|
|
5
5
|
import { createNodeFsStorage } from "wire-mesh-core/adapters/node-fs-storage";
|
|
6
6
|
import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
|
|
7
7
|
import { generateWriterNonce } from "./account-ledger-crypto.js";
|
|
8
|
-
import { AccountLedger } from "./account-ledger.js";
|
|
8
|
+
import { AccountLedger, } from "./account-ledger.js";
|
|
9
9
|
import { createFileLedgerLock } from "./ledger-lock.js";
|
|
10
10
|
import { clearLegacyIssuedGrants, loadOrCreateLedgerWriterNonce, readLegacyIssuedGrants, userIdentityDir, } from "./user-identity.js";
|
|
11
11
|
/** The directory an account's ledger is stored in on this machine. Named by the account's device-id, so a machine that imports a different account starts that account's ledger afresh instead of mixing two accounts' logs. */
|
|
@@ -19,15 +19,18 @@ export async function openAccountLedger(options) {
|
|
|
19
19
|
const dir = accountLedgerDir(options.userIdentityOptions, options.userIdentity);
|
|
20
20
|
const ledger = new AccountLedger({
|
|
21
21
|
accountPrivateKey: options.userIdentity.privateKey,
|
|
22
|
-
writerNonce: loadOrCreateLedgerWriterNonce(options.userIdentityOptions, generateWriterNonce),
|
|
22
|
+
writerNonce: await loadOrCreateLedgerWriterNonce(options.userIdentityOptions, generateWriterNonce),
|
|
23
23
|
storage: createNodeFsStorage({ dir }),
|
|
24
24
|
lock: createFileLedgerLock(`${dir}.lock`),
|
|
25
25
|
clock: options.clock,
|
|
26
|
+
...(options.onDamagedEntry !== undefined && {
|
|
27
|
+
onDamagedEntry: options.onDamagedEntry,
|
|
28
|
+
}),
|
|
26
29
|
});
|
|
27
30
|
const legacy = readLegacyIssuedGrants(options.userIdentityOptions);
|
|
28
31
|
if (legacy.length > 0) {
|
|
29
32
|
await ledger.recordGrants(legacy);
|
|
30
|
-
clearLegacyIssuedGrants(options.userIdentityOptions, legacy);
|
|
33
|
+
await clearLegacyIssuedGrants(options.userIdentityOptions, legacy);
|
|
31
34
|
}
|
|
32
35
|
return ledger;
|
|
33
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-ledger-store.js","sourceRoot":"","sources":["../../src/core/account-ledger-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"account-ledger-store.js","sourceRoot":"","sources":["../../src/core/account-ledger-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACL,aAAa,GAEd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,sBAAsB,EACtB,eAAe,GAEhB,MAAM,oBAAoB,CAAC;AAY5B,gOAAgO;AAChO,MAAM,UAAU,gBAAgB,CAC9B,mBAAkD,EAClD,YAAoC;IAEpC,OAAO,IAAI,CAAC,IAAI,CACd,eAAe,CAAC,mBAAmB,CAAC,EACpC,kBAAkB,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAC1E,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAA2C;IAE3C,MAAM,GAAG,GAAG,gBAAgB,CAC1B,OAAO,CAAC,mBAAmB,EAC3B,OAAO,CAAC,YAAY,CACrB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC;QAC/B,iBAAiB,EAAE,OAAO,CAAC,YAAY,CAAC,UAAU;QAClD,WAAW,EAAE,MAAM,6BAA6B,CAC9C,OAAO,CAAC,mBAAmB,EAC3B,mBAAmB,CACpB;QACD,OAAO,EAAE,mBAAmB,CAAC,EAAE,GAAG,EAAE,CAAC;QACrC,IAAI,EAAE,oBAAoB,CAAC,GAAG,GAAG,OAAO,CAAC;QACzC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,GAAG,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS,IAAI;YAC1C,cAAc,EAAE,OAAO,CAAC,cAAc;SACvC,CAAC;KACH,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,uBAAuB,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Each machine appends to a writer log of its own rather than all of them sharing one: a data-domain log is single-writer, and two machines appending to one log while apart would both write the same sequence number and fork it, silently losing one side's grants. A writer log's id is self-authenticating (account-ledger-crypto.ts), so any account holder recognises every writer log it is offered without a roster, and the ledger is the union of all of them.
|
|
5
5
|
*
|
|
6
6
|
* Holding a replica grants no authority: an entry is sealed under a key derived from the account key, so a replica held by anyone else is ciphertext they can neither read nor forge, and minting or revoking still needs the account's private key.
|
|
7
|
+
*
|
|
8
|
+
* A single entry that cannot be read never blocks the rest of the ledger. Revoking is the operation the ledger exists for, and storage can lose or damage an entry, so an unreadable entry that stopped listing and revoking would turn one damaged file into a permanent inability to revoke anything for that account. Each unreadable entry is instead skipped, and a skipped entry is never silent: it is reported once per ledger as a LedgerEntryDamagedError (to `onDamagedEntry`, stderr by default), naming its log and position, listed by `unreadableEntries()` for `whoami`, and counted in the result of every read that met it (`outstandingGrantsChecked` and `revocations`), so a caller that revokes can tell its outcome is incomplete. An unreadable entry may hold a grant or a revocation: a grant recorded only in it is not listed, so it is not revoked, and a revocation recorded only in it is not applied by this machine, until the entry is repaired or replaced from another machine's replica. Revocations in the readable entries are still applied, and a revocation announced over the mesh still reaches the store.
|
|
7
9
|
*/
|
|
8
10
|
import { type DataEntriesFrame, type DataHaveFrame, type DataRequestFrame, type DeviceId, type RevocationEntry } from "wire-mesh-core/generated/protocol";
|
|
9
11
|
import type { RevocationView } from "wire-mesh-core/domain/revocation-view";
|
|
@@ -29,7 +31,29 @@ export interface AccountLedgerDeps {
|
|
|
29
31
|
/** Serialises every read and write of `storage` across every bridge sharing it: appends to this machine's writer log, replicated entries stored for another machine's, and every read of either. The store's writes are not atomic (a file is truncated, then written), so a read racing another bridge's write could see an empty head and treat a log as empty. */
|
|
30
32
|
lock: LedgerLock;
|
|
31
33
|
clock: Clock;
|
|
34
|
+
/** Called once for each ledger entry that could not be read. Defaults to a line on stderr. */
|
|
35
|
+
onDamagedEntry?: (error: LedgerEntryDamagedError) => void;
|
|
36
|
+
}
|
|
37
|
+
/** Why an entry that opened under the account key is unreadable. Fixed text: the decoder's own message can quote the entry's content, and the report is printed whole. */
|
|
38
|
+
export declare const UNDECODABLE_REASON = "its content is not a record this build can decode";
|
|
39
|
+
/** A ledger entry that is stored but cannot be read: it does not open under the account's key for its log and position, or what it holds is not a record this build can decode. */
|
|
40
|
+
export declare class LedgerEntryDamagedError extends Error {
|
|
41
|
+
/** The writer log the entry belongs to, as hex. */
|
|
42
|
+
readonly log: string;
|
|
43
|
+
/** The entry's position in that log, counting from one. */
|
|
44
|
+
readonly seq: number;
|
|
45
|
+
/** Why it could not be read. */
|
|
46
|
+
readonly reason: string;
|
|
47
|
+
constructor(
|
|
48
|
+
/** The writer log the entry belongs to, as hex. */
|
|
49
|
+
log: string,
|
|
50
|
+
/** The entry's position in that log, counting from one. */
|
|
51
|
+
seq: number,
|
|
52
|
+
/** Why it could not be read. */
|
|
53
|
+
reason: string);
|
|
32
54
|
}
|
|
55
|
+
/** The default place an unreadable ledger entry is reported: one line on stderr. */
|
|
56
|
+
export declare function reportDamagedEntryToStderr(error: Readonly<LedgerEntryDamagedError>): void;
|
|
33
57
|
/** Answers and stores the data-domain frames for the account's writer logs; what a transport needs of the ledger to replicate it. */
|
|
34
58
|
export interface AccountLedgerReplica {
|
|
35
59
|
/** Whether `peer` names one of this account's writer logs. */
|
|
@@ -38,12 +62,24 @@ export interface AccountLedgerReplica {
|
|
|
38
62
|
handleDataFrame: (frame: Readonly<DataHaveFrame | DataRequestFrame | DataEntriesFrame>) => Promise<DataHaveFrame | DataRequestFrame | DataEntriesFrame | null>;
|
|
39
63
|
/** A data-have for every account log this machine holds, to offer peers. */
|
|
40
64
|
announcements: () => Promise<DataHaveFrame[]>;
|
|
65
|
+
/** The stored entries that could not be read, as far as reads so far have found. */
|
|
66
|
+
unreadableEntries: () => readonly LedgerEntryDamagedError[];
|
|
67
|
+
}
|
|
68
|
+
/** What a read of the ledger could not read: the number of stored entries that were skipped because they cannot be opened or decoded. Zero means the read was complete. */
|
|
69
|
+
export interface LedgerGaps {
|
|
70
|
+
unreadable: number;
|
|
41
71
|
}
|
|
72
|
+
/** Where a store's unreadable ledger entries are reported: its own error handler once it has one, otherwise stderr, since a handler that is not assigned yet or not at all must not make an entry that can hide a grant go unreported. `getOnError` is read on every report. */
|
|
73
|
+
export declare function damagedEntryReporter(getOnError: () => ((error: Error) => void) | undefined): (error: LedgerEntryDamagedError) => void;
|
|
42
74
|
export declare class AccountLedger implements AccountLedgerReplica {
|
|
43
75
|
private readonly deps;
|
|
44
76
|
/** This machine's own writer log. */
|
|
45
77
|
readonly writerLog: DeviceId;
|
|
78
|
+
/** Where this ledger reports an entry it cannot read; also what a ledger opened for another account on the same machine is given, so the destination follows the store and not the account. */
|
|
79
|
+
readonly reportDamagedEntry: (error: LedgerEntryDamagedError) => void;
|
|
46
80
|
private readonly keys;
|
|
81
|
+
/** Every entry a read has found unreadable, keyed by log and position, each reported once. */
|
|
82
|
+
private readonly damaged;
|
|
47
83
|
private readonly revocationListeners;
|
|
48
84
|
constructor(deps: Readonly<AccountLedgerDeps>);
|
|
49
85
|
/** Records that the principal minted `tokenId` for `subjectHex`. */
|
|
@@ -56,10 +92,17 @@ export declare class AccountLedger implements AccountLedgerReplica {
|
|
|
56
92
|
}>[]): Promise<void>;
|
|
57
93
|
/** Records the revocation of `tokenId`, carrying the signed revocation entry itself so every replica can feed it into its own RevocationView. */
|
|
58
94
|
recordRevocation(kind: IssuedGrantKind, subjectHex: string, tokenId: Uint8Array<ArrayBuffer>, revocation: RevocationEntry): Promise<void>;
|
|
59
|
-
/** Every grant of `kind` for `subjectHex` that some machine of the account recorded and none has revoked, oldest first. */
|
|
95
|
+
/** Every grant of `kind` for `subjectHex` that some machine of the account recorded and none has revoked, oldest first, among the entries that can be read. A caller that goes on to revoke uses outstandingGrantsChecked, which also says whether entries were skipped. */
|
|
60
96
|
outstandingGrants(kind: IssuedGrantKind, subjectHex: string): Promise<OutstandingGrant[]>;
|
|
61
|
-
/**
|
|
62
|
-
|
|
97
|
+
/** outstandingGrants with the number of entries the read had to skip: when it is above zero, a grant recorded only in a skipped entry is not in `grants`, and revoking `grants` does not make the subject safe. */
|
|
98
|
+
outstandingGrantsChecked(kind: IssuedGrantKind, subjectHex: string): Promise<{
|
|
99
|
+
grants: OutstandingGrant[];
|
|
100
|
+
} & LedgerGaps>;
|
|
101
|
+
/** Every revocation entry the readable part of the ledger holds, from every machine, for a RevocationView to learn at start-up, and how many entries were skipped: a revocation recorded only in one of those is not in `entries`. */
|
|
102
|
+
revocations(): Promise<{
|
|
103
|
+
entries: RevocationEntry[];
|
|
104
|
+
} & LedgerGaps>;
|
|
105
|
+
unreadableEntries(): readonly LedgerEntryDamagedError[];
|
|
63
106
|
ownsLog(peer: DeviceId): boolean;
|
|
64
107
|
/** Calls `listener` with each revocation entry another machine's replicated log brings in, so a RevocationView learns it even if the gossiped revocation-announce never reached this node. Returns the unsubscribe. */
|
|
65
108
|
onReplicatedRevocation(listener: (entry: RevocationEntry) => void): () => void;
|
|
@@ -68,7 +111,11 @@ export declare class AccountLedger implements AccountLedgerReplica {
|
|
|
68
111
|
private append;
|
|
69
112
|
/** Every account writer log in storage, this machine's own included once it has written anything. Called only under the lock. */
|
|
70
113
|
private heldLogs;
|
|
71
|
-
/**
|
|
114
|
+
/** The record an entry holds, or undefined after noting why it cannot be read (or, silently, for a record of a later format version). */
|
|
115
|
+
private decodeOrReport;
|
|
116
|
+
/** Remembers an unreadable entry and reports it the first time it is met. */
|
|
117
|
+
private noteDamaged;
|
|
118
|
+
/** Every readable record in every held writer log, in the order stored, and how many entries were skipped. An entry that cannot be read is noted and skipped (see the module comment for why that is not a failure). handleDataFrame and append never store one, so it means the storage was damaged outside the ledger or a holder of the account key wrote one this build cannot decode. */
|
|
72
119
|
private records;
|
|
73
120
|
}
|
|
74
121
|
/** Feeds every revocation the account ledger holds, and each one another machine's log brings in later, into a store's RevocationView, so a grant any machine of the account revoked is refused there even if the gossiped revocation-announce never reached it. A revocation that fails to verify, or a ledger that cannot be read, is reported rather than recorded. Returns the unsubscribe, for a store that replaces its ledger on joining another account. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-ledger.d.ts","sourceRoot":"","sources":["../../src/core/account-ledger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"account-ledger.d.ts","sourceRoot":"","sources":["../../src/core/account-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,mCAAmC,CAAC;AA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gBAAgB,GAAG,gBAAgB,GAAG,IAAI,CAAC;YAmCxD,MAAM;IAoBpB,iIAAiI;YACnH,QAAQ;IAWtB,yIAAyI;IACzI,OAAO,CAAC,cAAc;IAatB,6EAA6E;IAC7E,OAAO,CAAC,WAAW;IASnB,8XAA8X;YAChX,OAAO;CAuCtB;AAUD,ocAAoc;AACpc,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC,EACF,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAC9B,MAAM,IAAI,CA6BZ"}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Each machine appends to a writer log of its own rather than all of them sharing one: a data-domain log is single-writer, and two machines appending to one log while apart would both write the same sequence number and fork it, silently losing one side's grants. A writer log's id is self-authenticating (account-ledger-crypto.ts), so any account holder recognises every writer log it is offered without a roster, and the ledger is the union of all of them.
|
|
5
5
|
*
|
|
6
6
|
* Holding a replica grants no authority: an entry is sealed under a key derived from the account key, so a replica held by anyone else is ciphertext they can neither read nor forge, and minting or revoking still needs the account's private key.
|
|
7
|
+
*
|
|
8
|
+
* A single entry that cannot be read never blocks the rest of the ledger. Revoking is the operation the ledger exists for, and storage can lose or damage an entry, so an unreadable entry that stopped listing and revoking would turn one damaged file into a permanent inability to revoke anything for that account. Each unreadable entry is instead skipped, and a skipped entry is never silent: it is reported once per ledger as a LedgerEntryDamagedError (to `onDamagedEntry`, stderr by default), naming its log and position, listed by `unreadableEntries()` for `whoami`, and counted in the result of every read that met it (`outstandingGrantsChecked` and `revocations`), so a caller that revokes can tell its outcome is incomplete. An unreadable entry may hold a grant or a revocation: a grant recorded only in it is not listed, so it is not revoked, and a revocation recorded only in it is not applied by this machine, until the entry is repaired or replaced from another machine's replica. Revocations in the readable entries are still applied, and a revocation announced over the mesh still reaches the store.
|
|
7
9
|
*/
|
|
8
10
|
import { decode as cborDecode, encode as cborEncode, cdeEncodeOptions, } from "cbor2";
|
|
9
11
|
import { z } from "zod";
|
|
@@ -40,18 +42,54 @@ const ledgerRecordSchema = z.discriminatedUnion("op", [
|
|
|
40
42
|
grantRecordSchema,
|
|
41
43
|
revokeRecordSchema,
|
|
42
44
|
]);
|
|
45
|
+
/** Why an entry that opened under the account key is unreadable. Fixed text: the decoder's own message can quote the entry's content, and the report is printed whole. */
|
|
46
|
+
export const UNDECODABLE_REASON = "its content is not a record this build can decode";
|
|
47
|
+
/** A ledger entry that is stored but cannot be read: it does not open under the account's key for its log and position, or what it holds is not a record this build can decode. */
|
|
48
|
+
export class LedgerEntryDamagedError extends Error {
|
|
49
|
+
log;
|
|
50
|
+
seq;
|
|
51
|
+
reason;
|
|
52
|
+
constructor(
|
|
53
|
+
/** The writer log the entry belongs to, as hex. */
|
|
54
|
+
log,
|
|
55
|
+
/** The entry's position in that log, counting from one. */
|
|
56
|
+
seq,
|
|
57
|
+
/** Why it could not be read. */
|
|
58
|
+
reason) {
|
|
59
|
+
super(`account ledger entry ${String(seq)} of writer log ${log} cannot be read (${reason}); it was skipped, so a grant or a revocation recorded only in it is not read: such a grant is not listed or revoked, and such a revocation is not applied here, until the entry is repaired or replaced from another machine's replica of this account`);
|
|
60
|
+
this.log = log;
|
|
61
|
+
this.seq = seq;
|
|
62
|
+
this.reason = reason;
|
|
63
|
+
this.name = "LedgerEntryDamagedError";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** The default place an unreadable ledger entry is reported: one line on stderr. */
|
|
67
|
+
export function reportDamagedEntryToStderr(error) {
|
|
68
|
+
process.stderr.write(`agent-comms: ${error.message}\n`);
|
|
69
|
+
}
|
|
43
70
|
const versionProbeSchema = z.object({ v: z.number() });
|
|
44
71
|
const HEAD_KEY_PATTERN = /^data\/([0-9a-f]+)\/head$/;
|
|
72
|
+
/** Where a store's unreadable ledger entries are reported: its own error handler once it has one, otherwise stderr, since a handler that is not assigned yet or not at all must not make an entry that can hide a grant go unreported. `getOnError` is read on every report. */
|
|
73
|
+
export function damagedEntryReporter(getOnError) {
|
|
74
|
+
return (error) => {
|
|
75
|
+
(getOnError() ?? reportDamagedEntryToStderr)(error);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
45
78
|
export class AccountLedger {
|
|
46
79
|
deps;
|
|
47
80
|
/** This machine's own writer log. */
|
|
48
81
|
writerLog;
|
|
82
|
+
/** Where this ledger reports an entry it cannot read; also what a ledger opened for another account on the same machine is given, so the destination follows the store and not the account. */
|
|
83
|
+
reportDamagedEntry;
|
|
49
84
|
keys;
|
|
85
|
+
/** Every entry a read has found unreadable, keyed by log and position, each reported once. */
|
|
86
|
+
damaged = new Map();
|
|
50
87
|
revocationListeners = new Set();
|
|
51
88
|
constructor(deps) {
|
|
52
89
|
this.deps = deps;
|
|
53
90
|
this.keys = deriveAccountLedgerKeys(deps.accountPrivateKey);
|
|
54
91
|
this.writerLog = writerLogId(this.keys, deps.writerNonce);
|
|
92
|
+
this.reportDamagedEntry = deps.onDamagedEntry ?? reportDamagedEntryToStderr;
|
|
55
93
|
}
|
|
56
94
|
/** Records that the principal minted `tokenId` for `subjectHex`. */
|
|
57
95
|
async recordGrant(kind, subjectHex, tokenId) {
|
|
@@ -92,11 +130,16 @@ export class AccountLedger {
|
|
|
92
130
|
},
|
|
93
131
|
]);
|
|
94
132
|
}
|
|
95
|
-
/** Every grant of `kind` for `subjectHex` that some machine of the account recorded and none has revoked, oldest first. */
|
|
133
|
+
/** Every grant of `kind` for `subjectHex` that some machine of the account recorded and none has revoked, oldest first, among the entries that can be read. A caller that goes on to revoke uses outstandingGrantsChecked, which also says whether entries were skipped. */
|
|
96
134
|
async outstandingGrants(kind, subjectHex) {
|
|
135
|
+
return (await this.outstandingGrantsChecked(kind, subjectHex)).grants;
|
|
136
|
+
}
|
|
137
|
+
/** outstandingGrants with the number of entries the read had to skip: when it is above zero, a grant recorded only in a skipped entry is not in `grants`, and revoking `grants` does not make the subject safe. */
|
|
138
|
+
async outstandingGrantsChecked(kind, subjectHex) {
|
|
97
139
|
const granted = new Map();
|
|
98
140
|
const revoked = new Set();
|
|
99
|
-
|
|
141
|
+
const { records, unreadable } = await this.records();
|
|
142
|
+
for (const record of records) {
|
|
100
143
|
if (record.kind !== kind || record.subject !== subjectHex)
|
|
101
144
|
continue;
|
|
102
145
|
const key = Buffer.from(record.tokenId).toString("hex");
|
|
@@ -110,14 +153,24 @@ export class AccountLedger {
|
|
|
110
153
|
});
|
|
111
154
|
}
|
|
112
155
|
}
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
156
|
+
return {
|
|
157
|
+
grants: [...granted]
|
|
158
|
+
.filter(([key]) => !revoked.has(key))
|
|
159
|
+
.map(([, grant]) => grant)
|
|
160
|
+
.sort((a, b) => a.at - b.at),
|
|
161
|
+
unreadable,
|
|
162
|
+
};
|
|
117
163
|
}
|
|
118
|
-
/** Every revocation entry the ledger holds, from every machine, for a RevocationView to learn at start-up
|
|
164
|
+
/** Every revocation entry the readable part of the ledger holds, from every machine, for a RevocationView to learn at start-up, and how many entries were skipped: a revocation recorded only in one of those is not in `entries`. */
|
|
119
165
|
async revocations() {
|
|
120
|
-
|
|
166
|
+
const { records, unreadable } = await this.records();
|
|
167
|
+
return {
|
|
168
|
+
entries: records.flatMap((record) => record.op === "revoke" ? [record.revocation] : []),
|
|
169
|
+
unreadable,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
unreadableEntries() {
|
|
173
|
+
return [...this.damaged.values()];
|
|
121
174
|
}
|
|
122
175
|
ownsLog(peer) {
|
|
123
176
|
return isWriterLogId(this.keys, peer);
|
|
@@ -159,8 +212,8 @@ export class AccountLedger {
|
|
|
159
212
|
const stored = await lock.run(async () => handleDataEntries(storage, frame));
|
|
160
213
|
if (!stored.ok)
|
|
161
214
|
return null;
|
|
162
|
-
for (const plaintext of plaintexts) {
|
|
163
|
-
const record =
|
|
215
|
+
for (const [index, plaintext] of plaintexts.entries()) {
|
|
216
|
+
const record = this.decodeOrReport(frame.peer, firstSeq + index, plaintext);
|
|
164
217
|
if (record?.op !== "revoke")
|
|
165
218
|
continue;
|
|
166
219
|
for (const listener of this.revocationListeners) {
|
|
@@ -194,26 +247,57 @@ export class AccountLedger {
|
|
|
194
247
|
}
|
|
195
248
|
return logs;
|
|
196
249
|
}
|
|
197
|
-
/**
|
|
250
|
+
/** The record an entry holds, or undefined after noting why it cannot be read (or, silently, for a record of a later format version). */
|
|
251
|
+
decodeOrReport(log, seq, plaintext) {
|
|
252
|
+
try {
|
|
253
|
+
return decodeRecord(plaintext);
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
this.noteDamaged(log, seq, UNDECODABLE_REASON);
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/** Remembers an unreadable entry and reports it the first time it is met. */
|
|
261
|
+
noteDamaged(log, seq, reason) {
|
|
262
|
+
const hex = deviceIdToHex(log);
|
|
263
|
+
const key = `${hex}:${String(seq)}`;
|
|
264
|
+
if (this.damaged.has(key))
|
|
265
|
+
return;
|
|
266
|
+
const error = new LedgerEntryDamagedError(hex, seq, reason);
|
|
267
|
+
this.damaged.set(key, error);
|
|
268
|
+
this.reportDamagedEntry(error);
|
|
269
|
+
}
|
|
270
|
+
/** Every readable record in every held writer log, in the order stored, and how many entries were skipped. An entry that cannot be read is noted and skipped (see the module comment for why that is not a failure). handleDataFrame and append never store one, so it means the storage was damaged outside the ledger or a holder of the account key wrote one this build cannot decode. */
|
|
198
271
|
async records() {
|
|
199
272
|
const held = await this.deps.lock.run(async () => Promise.all((await this.heldLogs()).map(async (log) => ({
|
|
200
273
|
log,
|
|
201
274
|
entries: await readEntries(this.deps.storage, log, 0),
|
|
202
275
|
}))));
|
|
203
276
|
const records = [];
|
|
277
|
+
let unreadable = 0;
|
|
204
278
|
for (const { log, entries } of held) {
|
|
205
279
|
entries.forEach((sealed, index) => {
|
|
206
280
|
const seq = index + 1;
|
|
207
281
|
const plaintext = openLedgerEntry(this.keys, log, seq, sealed);
|
|
208
282
|
if (plaintext === undefined) {
|
|
209
|
-
|
|
283
|
+
this.noteDamaged(log, seq, "it does not open under this account's key");
|
|
284
|
+
unreadable += 1;
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
let record;
|
|
288
|
+
try {
|
|
289
|
+
record = decodeRecord(plaintext);
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
this.noteDamaged(log, seq, UNDECODABLE_REASON);
|
|
293
|
+
unreadable += 1;
|
|
294
|
+
return;
|
|
210
295
|
}
|
|
211
|
-
const record = decodeRecord(plaintext);
|
|
212
296
|
if (record !== undefined)
|
|
213
297
|
records.push(record);
|
|
214
298
|
});
|
|
215
299
|
}
|
|
216
|
-
return records;
|
|
300
|
+
return { records, unreadable };
|
|
217
301
|
}
|
|
218
302
|
}
|
|
219
303
|
/** The record a sealed entry's plaintext holds, or undefined for a record of a later format version than this build knows, written by a newer build on another machine. A record claiming this build's version that does not match its schema throws: it can only be damage. */
|
|
@@ -239,8 +323,11 @@ export function followLedgerRevocations(identity, onError) {
|
|
|
239
323
|
}, report);
|
|
240
324
|
};
|
|
241
325
|
const unsubscribe = identity.accountLedger.onReplicatedRevocation(learn);
|
|
242
|
-
identity.accountLedger.revocations().then((entries) => {
|
|
326
|
+
identity.accountLedger.revocations().then(({ entries, unreadable }) => {
|
|
243
327
|
entries.forEach(learn);
|
|
328
|
+
if (unreadable > 0) {
|
|
329
|
+
report(new Error(`${String(unreadable)} account ledger entries cannot be read, so a revocation recorded only in them is not applied on this machine until they are repaired or replaced from another machine's replica`));
|
|
330
|
+
}
|
|
244
331
|
}, report);
|
|
245
332
|
return unsubscribe;
|
|
246
333
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-ledger.js","sourceRoot":"","sources":["../../src/core/account-ledger.ts"],"names":[],"mappings":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,CAAC;IACzE,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;QACpE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,CACJ,IAAI,KAAK,CACP,GAAG,MAAM,CAAC,UAAU,CAAC,iLAAiL,CACvM,CACF,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACX,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-mesh.d.ts","sourceRoot":"","sources":["../../src/core/bridge-mesh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge-mesh.d.ts","sourceRoot":"","sources":["../../src/core/bridge-mesh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAKtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAOlD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,iSAAiS;IACjS,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED,0uBAA0uB;AAC1uB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;IACrE,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;CAC/C;AAED,sGAAsG;AACtG,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACrC,sGAAsG;IACtG,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,+MAA+M;IAC/M,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,sSAAsS;AACtS,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,cAAc,CAMhB;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,cAAc,CAyEhB;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED,6JAA6J;AAC7J,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAQrB"}
|
package/dist/core/bridge-mesh.js
CHANGED
|
@@ -23,6 +23,7 @@ import { FIRST_CONTACT_PORT } from "./first-contact.js";
|
|
|
23
23
|
import { CommsTool } from "./tool.js";
|
|
24
24
|
import { WireMeshTransport } from "./wire-mesh-transport.js";
|
|
25
25
|
import { loadOrCreateIdentity, oplogDirFor } from "./identity-store.js";
|
|
26
|
+
import { damagedEntryReporter } from "./account-ledger.js";
|
|
26
27
|
import { openAccountLedger } from "./account-ledger-store.js";
|
|
27
28
|
import { toIdentityPort } from "./wire-mesh-identity.js";
|
|
28
29
|
import { VersionDriftChecker } from "./version-check.js";
|
|
@@ -77,6 +78,7 @@ export function createBridgeMeshSyncFromIdentity(identity, slot, options) {
|
|
|
77
78
|
discovery: store.discovery,
|
|
78
79
|
naming: store.naming,
|
|
79
80
|
getNewerVersionIfAny: () => versionChecker.getNewerVersionIfAny(),
|
|
81
|
+
getUnreadableLedgerEntries: () => store.accountLedger?.unreadableEntries().length ?? 0,
|
|
80
82
|
});
|
|
81
83
|
const revocation = createRevocationView();
|
|
82
84
|
return {
|
|
@@ -95,6 +97,7 @@ export function createBridgeMeshSyncFromIdentity(identity, slot, options) {
|
|
|
95
97
|
userIdentityOptions,
|
|
96
98
|
userIdentity,
|
|
97
99
|
clock,
|
|
100
|
+
onDamagedEntry: damagedEntryReporter(() => store.onError),
|
|
98
101
|
}),
|
|
99
102
|
userIdentityOptions,
|
|
100
103
|
machineIdentity: await toIdentityPort(machineIdentity),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-mesh.js","sourceRoot":"","sources":["../../src/core/bridge-mesh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kB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,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,gCAAgC,CACtE,QAAQ,EACR,IAAI,EACJ,OAAO,CACR,CAAC;IACF,MAAM,cAAc,EAAE,CAAC;IACvB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/core/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/core/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8H1B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAsBz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AO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAMD,wBAAsB,cAAc,CAClC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnB"}
|
package/dist/core/bridge.js
CHANGED
|
@@ -105,19 +105,31 @@ export const MCP_TOOL_PARAMS = z.object({
|
|
|
105
105
|
/** A remote gateway's own device-id (hex), for gateway_trust/gateway_untrust, for gateway_redeem_connection_code (the code's own embedded deviceId field), and the device-id petname_set/petname_clear label. */
|
|
106
106
|
device: z.string().optional(),
|
|
107
107
|
/** The connection code's own nonce (gateway_redeem_connection_code). */
|
|
108
|
-
code: z
|
|
108
|
+
code: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe("gateway_redeem_connection_code: the code's nonce. An unsigned connection code is a bearer hint, not authentication: redeeming it trusts whatever device-id its text names, whoever wrote it, so it is not a way to establish trust in a stranger. Supply publicKey or fingerprint to require a signature from a key you already trust."),
|
|
109
112
|
/** ISO-8601 expiry for gateway_generate_connection_code's ttlMs override, or the redeemed code's own expiresAt field for gateway_redeem_connection_code. */
|
|
110
113
|
expiresAt: z.string().optional(),
|
|
111
114
|
/** ttlMs override for gateway_generate_connection_code; defaults to DEFAULT_CONNECTION_CODE_TTL_MS when omitted. */
|
|
112
115
|
ttlMs: z.number().optional(),
|
|
113
116
|
/** Armored PGP private key to sign a generated code with (gateway_generate_connection_code), or armored PGP public key to verify a redeemed code's signature against (gateway_redeem_connection_code). Both are supplied per call -- agent-comms never generates, stores, or manages PGP key material itself. */
|
|
114
117
|
privateKey: z.string().optional(),
|
|
115
|
-
publicKey: z
|
|
118
|
+
publicKey: z
|
|
119
|
+
.string()
|
|
120
|
+
.optional()
|
|
121
|
+
.describe("gateway_redeem_connection_code: armored PGP public key to verify the code's signature against. Supplying it makes an unsigned code refused."),
|
|
116
122
|
/** Passphrase for privateKey, if it is passphrase-protected (gateway_generate_connection_code). */
|
|
117
123
|
passphrase: z.string().optional(),
|
|
118
124
|
/** The redeemed code's own signature field (gateway_redeem_connection_code), or a PGP fingerprint the caller already independently trusts, used either to pin a supplied publicKey or to fetch one from a keyserver when publicKey is omitted. */
|
|
119
|
-
signature: z
|
|
120
|
-
|
|
125
|
+
signature: z
|
|
126
|
+
.string()
|
|
127
|
+
.optional()
|
|
128
|
+
.describe("gateway_redeem_connection_code: the code's detached PGP signature, when it has one."),
|
|
129
|
+
fingerprint: z
|
|
130
|
+
.string()
|
|
131
|
+
.optional()
|
|
132
|
+
.describe("gateway_redeem_connection_code: a PGP fingerprint you already trust. Supplying it makes an unsigned code refused, and the signing key must match it."),
|
|
121
133
|
/** For gateway_trust/gateway_untrust (and dm_admit, where `target` names it): when true, the id names a user principal (agent-comms#187) rather than a bare remote device-id (agent-comms#193). */
|
|
122
134
|
principal: z.boolean().optional(),
|
|
123
135
|
/** For gateway_trust/gateway_untrust: when true, the id names a machine (agent-comms#343), whose devices (every bridge one OS account runs on that host) are trusted or revoked at once. */
|