@agentvault/agentvault 0.23.52 → 0.23.53
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/dist/channel.d.ts +18 -0
- package/dist/channel.d.ts.map +1 -1
- package/dist/cli.js +285 -30
- package/dist/cli.js.map +4 -4
- package/dist/index.js +283 -28
- package/dist/index.js.map +4 -4
- package/dist/welcome-kp-backoff.d.ts +83 -0
- package/dist/welcome-kp-backoff.d.ts.map +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1428 — stop asking for KeyPackages a device does not have.
|
|
3
|
+
*
|
|
4
|
+
* Every delivery pull walks each group's pending Welcome requests and calls
|
|
5
|
+
* `GET /mls/key-packages/batch` for the requesting devices. Measured on loopita
|
|
6
|
+
* 2026-10-24: four owner browsers had been closed for a day with EMPTY pools,
|
|
7
|
+
* so every pull (~15 s) asked the batch for all four, got nothing, and logged
|
|
8
|
+
*
|
|
9
|
+
* [SecureChannel] 4 pending Welcome requests for shared group 10440bf7 (stdout)
|
|
10
|
+
* [SecureChannel] No KeyPackage for a7f7eada, skipping (stderr, x4)
|
|
11
|
+
*
|
|
12
|
+
* — 50,760 lines in one log. Nothing was lost: a Welcome is sealed to a
|
|
13
|
+
* KeyPackage, so nobody can admit a device until it comes back online and
|
|
14
|
+
* republishes. The asking just has to stop until then.
|
|
15
|
+
*
|
|
16
|
+
* Per (group, device):
|
|
17
|
+
* - a batch that returns no KeyPackage starts a backoff: 10 min, doubling to
|
|
18
|
+
* a 1 h cap. One warn when it starts; silent while it runs.
|
|
19
|
+
* - a KeyPackage that appears ends it, with one info line ("admitting").
|
|
20
|
+
* - the request disappearing (served elsewhere, expired) ends it silently.
|
|
21
|
+
*
|
|
22
|
+
* Coming back must not wait out the backoff. A reopened browser republishes and
|
|
23
|
+
* re-requests, but its re-request dedups onto the SAME pending row server-side,
|
|
24
|
+
* so the pending list alone cannot show it. The server now says per request
|
|
25
|
+
* whether the batch would serve a KeyPackage (`key_package_available`, #1428
|
|
26
|
+
* backend). `false` means "do not ask" outright; a flip to `true` means "ask on
|
|
27
|
+
* this pull", whatever the backoff says. When the field is absent (an older
|
|
28
|
+
* backend) the time-based backoff is the whole rule.
|
|
29
|
+
*
|
|
30
|
+
* Also: "N pending Welcome requests" is logged only when the pending SET
|
|
31
|
+
* changes, and a non-OK fetch is logged once (and once on recovery) instead of
|
|
32
|
+
* being a silent `continue`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const KP_BACKOFF_INITIAL_MS: number;
|
|
35
|
+
export declare const KP_BACKOFF_MAX_MS: number;
|
|
36
|
+
/**
|
|
37
|
+
* #1429 review: the server said `key_package_available: true` and the batch
|
|
38
|
+
* still came back empty — a race (another fulfiller claimed the last one, or
|
|
39
|
+
* the pool expired between the two reads). That is not "the device is gone", so
|
|
40
|
+
* it gets a short fixed retry, not the 10 -> 60 min ladder. Bounded: after
|
|
41
|
+
* KP_RACE_RETRY_LIMIT such retries in a row the ordinary backoff takes over, so
|
|
42
|
+
* a server that persistently disagrees with itself costs one call per ladder
|
|
43
|
+
* step, not one a minute forever.
|
|
44
|
+
*/
|
|
45
|
+
export declare const KP_RACE_RETRY_MS = 60000;
|
|
46
|
+
export declare const KP_RACE_RETRY_LIMIT = 3;
|
|
47
|
+
export interface PendingWelcomeRow {
|
|
48
|
+
id: string;
|
|
49
|
+
requesting_device_id: string;
|
|
50
|
+
/** #1428 backend: would the batch serve this caller a KeyPackage for it? */
|
|
51
|
+
key_package_available?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface BackoffLogger {
|
|
54
|
+
warn(msg: string): void;
|
|
55
|
+
info(msg: string): void;
|
|
56
|
+
}
|
|
57
|
+
export declare class WelcomeKeyPackageBackoff {
|
|
58
|
+
private readonly log;
|
|
59
|
+
private readonly entries;
|
|
60
|
+
private readonly pendingSig;
|
|
61
|
+
private readonly failing;
|
|
62
|
+
constructor(log?: BackoffLogger);
|
|
63
|
+
private key;
|
|
64
|
+
/**
|
|
65
|
+
* Record this pull's pending list for a group. Returns true when the set of
|
|
66
|
+
* requests differs from the previous pull's — the caller logs its "N pending"
|
|
67
|
+
* line only then. Backoffs for devices whose request is gone are dropped.
|
|
68
|
+
*/
|
|
69
|
+
observePending(groupId: string, pending: PendingWelcomeRow[]): boolean;
|
|
70
|
+
/** Should this pull ask the batch for this device's KeyPackage? */
|
|
71
|
+
shouldAsk(groupId: string, deviceId: string, available: boolean | undefined, label: string, now?: number): boolean;
|
|
72
|
+
/** The outcome of an ask. `found` = the batch returned a KeyPackage. */
|
|
73
|
+
recordKeyPackage(groupId: string, deviceId: string, found: boolean, available: boolean | undefined, label: string, now?: number): void;
|
|
74
|
+
/** A non-OK response for `scope`: warn once until it recovers. */
|
|
75
|
+
noteFetchFailure(scope: string, status: number | string): void;
|
|
76
|
+
noteFetchOk(scope: string): void;
|
|
77
|
+
/** Test/diagnostic view. */
|
|
78
|
+
backoffFor(groupId: string, deviceId: string): {
|
|
79
|
+
untilMs: number;
|
|
80
|
+
delayMs: number;
|
|
81
|
+
} | undefined;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=welcome-kp-backoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"welcome-kp-backoff.d.ts","sourceRoot":"","sources":["../src/welcome-kp-backoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,eAAO,MAAM,qBAAqB,QAAc,CAAC;AACjD,eAAO,MAAM,iBAAiB,QAAc,CAAC;AAC7C;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAAS,CAAC;AACvC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,qBAAq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package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentvault/agentvault",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.53",
|
|
4
4
|
"description": "End-to-end encrypted messaging for AI agents: connects an agent to its owner, rooms and other agents on AgentVault.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|