@agentvault/muse-bridge 0.1.24 → 0.1.25
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/index.js +41 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11787,11 +11787,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
|
|
|
11787
11787
|
return null;
|
|
11788
11788
|
}
|
|
11789
11789
|
function ownIdentity() {
|
|
11790
|
-
const v2 = true ? "0.23.
|
|
11790
|
+
const v2 = true ? "0.23.50" : FALLBACK;
|
|
11791
11791
|
return `${PACKAGE}@${v2}`;
|
|
11792
11792
|
}
|
|
11793
11793
|
function buildSha() {
|
|
11794
|
-
const raw = true ? "
|
|
11794
|
+
const raw = true ? "c8f1371" : "";
|
|
11795
11795
|
const cleaned = (raw ?? "").trim();
|
|
11796
11796
|
return !cleaned || cleaned === "unknown" ? null : cleaned;
|
|
11797
11797
|
}
|
|
@@ -70301,6 +70301,34 @@ var init_dist = __esm({
|
|
|
70301
70301
|
}
|
|
70302
70302
|
return null;
|
|
70303
70303
|
}
|
|
70304
|
+
/**
|
|
70305
|
+
* Every occupied leaf of the ratchet tree, with its basic-credential
|
|
70306
|
+
* identity — READ-ONLY (#470 phase 1).
|
|
70307
|
+
*
|
|
70308
|
+
* Stale-leaf detection compares the tree with the server's eligible set, so
|
|
70309
|
+
* it must see EVERY leaf. `memberLeafIndex` cannot: it stops at the first
|
|
70310
|
+
* match, so a device holding two leaves (the duplicate-add shape observed
|
|
70311
|
+
* live 2026-06-18) would show one. Blank leaves (removed members) are
|
|
70312
|
+
* skipped; duplicates are returned once per leaf. Leaves whose credential is
|
|
70313
|
+
* not `basic` carry no comparable identity and are skipped too — the web
|
|
70314
|
+
* client only ever mints basic credentials.
|
|
70315
|
+
*
|
|
70316
|
+
* Identities are COPIES: a caller mutating one cannot reach the tree.
|
|
70317
|
+
*/
|
|
70318
|
+
leafIdentities() {
|
|
70319
|
+
const tree = this._requireState().ratchetTree;
|
|
70320
|
+
const out = [];
|
|
70321
|
+
for (let nodeIndex = 0; nodeIndex < tree.length; nodeIndex += 2) {
|
|
70322
|
+
const node2 = tree[nodeIndex];
|
|
70323
|
+
if (node2 && node2.nodeType === "leaf") {
|
|
70324
|
+
const cred = node2.leaf.credential;
|
|
70325
|
+
if (cred.credentialType === "basic") {
|
|
70326
|
+
out.push({ leafIndex: nodeIndex / 2, identity: new Uint8Array(cred.identity) });
|
|
70327
|
+
}
|
|
70328
|
+
}
|
|
70329
|
+
}
|
|
70330
|
+
return out;
|
|
70331
|
+
}
|
|
70304
70332
|
// -------------------------------------------------------------------------
|
|
70305
70333
|
// Encrypt / Decrypt
|
|
70306
70334
|
// -------------------------------------------------------------------------
|
|
@@ -71307,6 +71335,7 @@ var init_dist = __esm({
|
|
|
71307
71335
|
_trustTier = null;
|
|
71308
71336
|
_trustTokenExpiresAt = null;
|
|
71309
71337
|
_trustTokenInterval = null;
|
|
71338
|
+
_trustTokenUnavailableUntil = 0;
|
|
71310
71339
|
_pendingPollTimer = null;
|
|
71311
71340
|
_syncMessageIds = null;
|
|
71312
71341
|
_deliveryHeartbeat = null;
|
|
@@ -71522,6 +71551,7 @@ ${text}`;
|
|
|
71522
71551
|
static SILENCE_TIMEOUT_MS = 9e4;
|
|
71523
71552
|
static POLL_FALLBACK_INTERVAL_MS = 3e4;
|
|
71524
71553
|
// 30s when messages found
|
|
71554
|
+
static TRUST_TOKEN_UNAVAILABLE_BACKOFF_MS = 6 * 60 * 60 * 1e3;
|
|
71525
71555
|
static POLL_FALLBACK_IDLE_MS = 6e4;
|
|
71526
71556
|
// 60s when idle
|
|
71527
71557
|
/**
|
|
@@ -72919,7 +72949,7 @@ ${text}`;
|
|
|
72919
72949
|
*/
|
|
72920
72950
|
sendActivitySpan(spanData) {
|
|
72921
72951
|
if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
|
|
72922
|
-
const pluginVersion = true ? "0.23.
|
|
72952
|
+
const pluginVersion = true ? "0.23.50" : "0.0.0-dev";
|
|
72923
72953
|
const agentName = this.config.agentName ?? "Agent";
|
|
72924
72954
|
const resource = {
|
|
72925
72955
|
"service.name": "agentvault-agent",
|
|
@@ -73952,6 +73982,7 @@ ${text}`;
|
|
|
73952
73982
|
return this._trustTokenExpiresAt;
|
|
73953
73983
|
}
|
|
73954
73984
|
async refreshTrustToken() {
|
|
73985
|
+
if (Date.now() < this._trustTokenUnavailableUntil) return;
|
|
73955
73986
|
try {
|
|
73956
73987
|
const res = await fetch(`${this.config.apiUrl}/api/v1/gate/token`, {
|
|
73957
73988
|
method: "POST",
|
|
@@ -73965,12 +73996,15 @@ ${text}`;
|
|
|
73965
73996
|
this._trustToken = data.token;
|
|
73966
73997
|
this._trustTier = data.tier;
|
|
73967
73998
|
this._trustTokenExpiresAt = data.expires_at;
|
|
73999
|
+
} else if (res.status === 503 || res.status === 404 || res.status === 403) {
|
|
74000
|
+
this._trustTokenUnavailableUntil = Date.now() + _SecureChannel.TRUST_TOKEN_UNAVAILABLE_BACKOFF_MS;
|
|
73968
74001
|
}
|
|
73969
74002
|
} catch (err) {
|
|
73970
74003
|
console.warn("[AgentVault] Trust token refresh failed:", err);
|
|
73971
74004
|
}
|
|
73972
74005
|
}
|
|
73973
74006
|
startTrustTokenRefresh() {
|
|
74007
|
+
this.stopTrustTokenRefresh();
|
|
73974
74008
|
this.refreshTrustToken();
|
|
73975
74009
|
this._trustTokenInterval = setInterval(
|
|
73976
74010
|
() => this.refreshTrustToken(),
|
|
@@ -74915,7 +74949,7 @@ ${text}`;
|
|
|
74915
74949
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
74916
74950
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
74917
74951
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
74918
|
-
pluginVersion: true ? "0.23.
|
|
74952
|
+
pluginVersion: true ? "0.23.50" : "0.0.0-dev"
|
|
74919
74953
|
});
|
|
74920
74954
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
74921
74955
|
}
|
|
@@ -75243,7 +75277,7 @@ ${text}`;
|
|
|
75243
75277
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
75244
75278
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
75245
75279
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
75246
|
-
pluginVersion: true ? "0.23.
|
|
75280
|
+
pluginVersion: true ? "0.23.50" : "0.0.0-dev"
|
|
75247
75281
|
});
|
|
75248
75282
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
75249
75283
|
}
|
|
@@ -101399,7 +101433,7 @@ data:
|
|
|
101399
101433
|
await init_skill_telemetry();
|
|
101400
101434
|
await init_policy_enforcer();
|
|
101401
101435
|
init_room_protocol();
|
|
101402
|
-
VERSION = true ? "0.23.
|
|
101436
|
+
VERSION = true ? "0.23.50" : "0.0.0-dev";
|
|
101403
101437
|
}
|
|
101404
101438
|
});
|
|
101405
101439
|
await init_index();
|
|
@@ -103344,7 +103378,7 @@ function mkdir700(path2) {
|
|
|
103344
103378
|
chmodSync5(path2, 448);
|
|
103345
103379
|
}
|
|
103346
103380
|
function packageVersion() {
|
|
103347
|
-
return true ? "0.1.
|
|
103381
|
+
return true ? "0.1.25" : void 0;
|
|
103348
103382
|
}
|
|
103349
103383
|
function helpText(version2) {
|
|
103350
103384
|
return [
|
package/package.json
CHANGED