agent-comms 3.8.0 → 3.10.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 +5 -1
- package/dist/bridges/cc-peer/default-front.d.ts +20 -0
- package/dist/bridges/cc-peer/default-front.d.ts.map +1 -0
- package/dist/bridges/cc-peer/default-front.js +28 -0
- package/dist/bridges/cc-peer/default-front.js.map +1 -0
- package/dist/bridges/cc-peer/front-controller.d.ts +50 -0
- package/dist/bridges/cc-peer/front-controller.d.ts.map +1 -0
- package/dist/bridges/cc-peer/front-controller.js +84 -0
- package/dist/bridges/cc-peer/front-controller.js.map +1 -0
- package/dist/bridges/cc-peer/front-relay.d.ts +42 -0
- package/dist/bridges/cc-peer/front-relay.d.ts.map +1 -0
- package/dist/bridges/cc-peer/front-relay.js +43 -0
- package/dist/bridges/cc-peer/front-relay.js.map +1 -0
- package/dist/bridges/cc-peer/front-runtime.d.ts +18 -0
- package/dist/bridges/cc-peer/front-runtime.d.ts.map +1 -0
- package/dist/bridges/cc-peer/front-runtime.js +76 -0
- package/dist/bridges/cc-peer/front-runtime.js.map +1 -0
- package/dist/bridges/cc-peer/front.d.ts +32 -0
- package/dist/bridges/cc-peer/front.d.ts.map +1 -0
- package/dist/bridges/cc-peer/front.js +37 -0
- package/dist/bridges/cc-peer/front.js.map +1 -0
- package/dist/bridges/cc-peer/run.d.ts.map +1 -1
- package/dist/bridges/cc-peer/run.js +2 -0
- package/dist/bridges/cc-peer/run.js.map +1 -1
- package/dist/bridges/claude-code/channel.d.ts.map +1 -1
- package/dist/bridges/claude-code/channel.js +2 -0
- package/dist/bridges/claude-code/channel.js.map +1 -1
- package/dist/bridges/codex/tool.d.ts.map +1 -1
- package/dist/bridges/codex/tool.js +2 -0
- package/dist/bridges/codex/tool.js.map +1 -1
- package/dist/bridges/mcp/server.d.ts.map +1 -1
- package/dist/bridges/mcp/server.js +2 -0
- package/dist/bridges/mcp/server.js.map +1 -1
- package/dist/bridges/opencode/plugin.d.ts.map +1 -1
- package/dist/bridges/opencode/plugin.js +2 -0
- package/dist/bridges/opencode/plugin.js.map +1 -1
- package/dist/bridges/pi/extension.d.ts.map +1 -1
- package/dist/bridges/pi/extension.js +2 -0
- package/dist/bridges/pi/extension.js.map +1 -1
- package/dist/bridges/user/controller.d.ts.map +1 -1
- package/dist/bridges/user/controller.js +4 -0
- package/dist/bridges/user/controller.js.map +1 -1
- package/dist/core/agent-registry.d.ts +3 -0
- package/dist/core/agent-registry.d.ts.map +1 -1
- package/dist/core/agent-registry.js +25 -14
- package/dist/core/agent-registry.js.map +1 -1
- package/dist/core/bind-retry.d.ts +10 -0
- package/dist/core/bind-retry.d.ts.map +1 -0
- package/dist/core/bind-retry.js +24 -0
- package/dist/core/bind-retry.js.map +1 -0
- package/dist/core/bridge-mesh.d.ts +9 -0
- package/dist/core/bridge-mesh.d.ts.map +1 -1
- package/dist/core/bridge-mesh.js +20 -1
- package/dist/core/bridge-mesh.js.map +1 -1
- package/dist/core/dm-token-verification.d.ts +28 -0
- package/dist/core/dm-token-verification.d.ts.map +1 -0
- package/dist/core/dm-token-verification.js +38 -0
- package/dist/core/dm-token-verification.js.map +1 -0
- package/dist/core/gossip-directory.d.ts +4 -1
- package/dist/core/gossip-directory.d.ts.map +1 -1
- package/dist/core/gossip-directory.js +11 -1
- package/dist/core/gossip-directory.js.map +1 -1
- package/dist/core/hub-forwarding.d.ts +13 -0
- package/dist/core/hub-forwarding.d.ts.map +1 -0
- package/dist/core/hub-forwarding.js +30 -0
- package/dist/core/hub-forwarding.js.map +1 -0
- package/dist/core/hub-session.d.ts +14 -4
- package/dist/core/hub-session.d.ts.map +1 -1
- package/dist/core/hub-session.js +44 -12
- package/dist/core/hub-session.js.map +1 -1
- package/dist/core/identity-store.d.ts +8 -0
- package/dist/core/identity-store.d.ts.map +1 -1
- package/dist/core/identity-store.js +18 -0
- package/dist/core/identity-store.js.map +1 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/mesh-store-shared.d.ts +5 -1
- package/dist/core/mesh-store-shared.d.ts.map +1 -1
- package/dist/core/mesh-store-shared.js +7 -0
- package/dist/core/mesh-store-shared.js.map +1 -1
- package/dist/core/mesh-store.d.ts +11 -2
- package/dist/core/mesh-store.d.ts.map +1 -1
- package/dist/core/mesh-store.js +24 -4
- package/dist/core/mesh-store.js.map +1 -1
- package/dist/core/peer-lifecycle.d.ts +4 -0
- package/dist/core/peer-lifecycle.d.ts.map +1 -1
- package/dist/core/peer-lifecycle.js +18 -0
- package/dist/core/peer-lifecycle.js.map +1 -1
- package/dist/core/room-lifecycle.d.ts +12 -1
- package/dist/core/room-lifecycle.d.ts.map +1 -1
- package/dist/core/room-lifecycle.js +47 -3
- package/dist/core/room-lifecycle.js.map +1 -1
- package/dist/core/room-messaging.d.ts +2 -2
- package/dist/core/room-messaging.d.ts.map +1 -1
- package/dist/core/room-messaging.js +1 -1
- package/dist/core/room-messaging.js.map +1 -1
- package/dist/core/room-protocol.d.ts +1 -1
- package/dist/core/room-protocol.d.ts.map +1 -1
- package/dist/core/room-protocol.js +17 -1
- package/dist/core/room-protocol.js.map +1 -1
- package/dist/core/user-identity.d.ts +10 -0
- package/dist/core/user-identity.d.ts.map +1 -1
- package/dist/core/user-identity.js +47 -9
- package/dist/core/user-identity.js.map +1 -1
- package/dist/core/wire-mesh-transport.d.ts +5 -3
- package/dist/core/wire-mesh-transport.d.ts.map +1 -1
- package/dist/core/wire-mesh-transport.js +25 -24
- package/dist/core/wire-mesh-transport.js.map +1 -1
- package/dist/test/agent-registry.test.js +56 -0
- package/dist/test/agent-registry.test.js.map +1 -1
- package/dist/test/bind-retry.test.d.ts +2 -0
- package/dist/test/bind-retry.test.d.ts.map +1 -0
- package/dist/test/bind-retry.test.js +42 -0
- package/dist/test/bind-retry.test.js.map +1 -0
- package/dist/test/bridge-mesh.test.js +16 -2
- package/dist/test/bridge-mesh.test.js.map +1 -1
- package/dist/test/cc-peer-default-front.test.d.ts +2 -0
- package/dist/test/cc-peer-default-front.test.d.ts.map +1 -0
- package/dist/test/cc-peer-default-front.test.js +71 -0
- package/dist/test/cc-peer-default-front.test.js.map +1 -0
- package/dist/test/cc-peer-front-controller.test.d.ts +2 -0
- package/dist/test/cc-peer-front-controller.test.d.ts.map +1 -0
- package/dist/test/cc-peer-front-controller.test.js +206 -0
- package/dist/test/cc-peer-front-controller.test.js.map +1 -0
- package/dist/test/cc-peer-front-relay.test.d.ts +2 -0
- package/dist/test/cc-peer-front-relay.test.d.ts.map +1 -0
- package/dist/test/cc-peer-front-relay.test.js +177 -0
- package/dist/test/cc-peer-front-relay.test.js.map +1 -0
- package/dist/test/cc-peer-front.test.d.ts +2 -0
- package/dist/test/cc-peer-front.test.d.ts.map +1 -0
- package/dist/test/cc-peer-front.test.js +109 -0
- package/dist/test/cc-peer-front.test.js.map +1 -0
- package/dist/test/delivery-engine-delivery.test.js +2 -0
- package/dist/test/delivery-engine-delivery.test.js.map +1 -1
- package/dist/test/delivery-engine-directed-notify.test.js +2 -0
- package/dist/test/delivery-engine-directed-notify.test.js.map +1 -1
- package/dist/test/delivery-engine.test.js +2 -0
- package/dist/test/delivery-engine.test.js.map +1 -1
- package/dist/test/dm-send-capability-admission.integration.test.d.ts +5 -0
- package/dist/test/dm-send-capability-admission.integration.test.d.ts.map +1 -0
- package/dist/test/dm-send-capability-admission.integration.test.js +90 -0
- package/dist/test/dm-send-capability-admission.integration.test.js.map +1 -0
- package/dist/test/dm-token-verification.test.d.ts +5 -0
- package/dist/test/dm-token-verification.test.d.ts.map +1 -0
- package/dist/test/dm-token-verification.test.js +164 -0
- package/dist/test/dm-token-verification.test.js.map +1 -0
- package/dist/test/gateway-forwarding.integration.test.d.ts +7 -0
- package/dist/test/gateway-forwarding.integration.test.d.ts.map +1 -0
- package/dist/test/gateway-forwarding.integration.test.js +185 -0
- package/dist/test/gateway-forwarding.integration.test.js.map +1 -0
- package/dist/test/identity-restart.integration.test.js +6 -0
- package/dist/test/identity-restart.integration.test.js.map +1 -1
- package/dist/test/identity-store.test.js +45 -1
- package/dist/test/identity-store.test.js.map +1 -1
- package/dist/test/mesh-e2e.integration.test.js +7 -1
- package/dist/test/mesh-e2e.integration.test.js.map +1 -1
- package/dist/test/mesh-smoke.runner.js +4 -1
- package/dist/test/mesh-smoke.runner.js.map +1 -1
- package/dist/test/mesh-store-orchestration.test.js +73 -2
- package/dist/test/mesh-store-orchestration.test.js.map +1 -1
- package/dist/test/peer-lifecycle.test.js +61 -2
- package/dist/test/peer-lifecycle.test.js.map +1 -1
- package/dist/test/room-join-admission.test.js +6 -0
- package/dist/test/room-join-admission.test.js.map +1 -1
- package/dist/test/room-lifecycle-membership.test.js +2 -0
- package/dist/test/room-lifecycle-membership.test.js.map +1 -1
- package/dist/test/room-lifecycle-remote.test.js +2 -0
- package/dist/test/room-lifecycle-remote.test.js.map +1 -1
- package/dist/test/room-lifecycle.test.js +2 -0
- package/dist/test/room-lifecycle.test.js.map +1 -1
- package/dist/test/room-messaging-durable-send.test.js +3 -1
- package/dist/test/room-messaging-durable-send.test.js.map +1 -1
- package/dist/test/room-messaging.test.js +25 -6
- package/dist/test/room-messaging.test.js.map +1 -1
- package/dist/test/room-protocol-admission.test.js +2 -0
- package/dist/test/room-protocol-admission.test.js.map +1 -1
- package/dist/test/room-protocol-notify.test.js +2 -0
- package/dist/test/room-protocol-notify.test.js.map +1 -1
- package/dist/test/room-protocol.test.js +2 -0
- package/dist/test/room-protocol.test.js.map +1 -1
- package/dist/test/room-send-retry.integration.test.js +6 -0
- package/dist/test/room-send-retry.integration.test.js.map +1 -1
- package/dist/test/test-transport.d.ts +1 -1
- package/dist/test/test-transport.d.ts.map +1 -1
- package/dist/test/test-transport.js +10 -2
- package/dist/test/test-transport.js.map +1 -1
- package/dist/test/user-identity.test.js +62 -1
- package/dist/test/user-identity.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Receiver-side verification of a `dm:send` capability token (agent-comms#162): the receiver-controlled admission list a user principal issues, parallel to room-token-verification.ts's own `room:member` obligations but rooted at the user principal's device-id (user-identity.ts) rather than a room's own owner -- a `dm:send` grant admits a bearer device into THIS user's communication scope across every bridge slot sharing that principal, not into one specific room path. Layered on verifyCapabilityToken the same way verifyRoomToken is: obligations 2/4/5 (bearer match, ordinary token-claims checks, delegations-remaining narrowing) live there already; this module adds the dm:send-specific obligations -- the presented token must actually carry the dm:send capability (not merely happen to share a scope shape), its scope must name this exact user principal, and its delegation chain must root at that same user principal (never at the bearer itself, or self-issued authority would let any sender simply mint its own admission).
|
|
3
|
+
*/
|
|
4
|
+
import { type TokenVerdictReason, type VerifyCapabilityTokenOptions } from "wire-mesh-core/domain/tokens";
|
|
5
|
+
import type { CapabilityToken, DeviceId, TokenClaims } from "wire-mesh-core/generated/protocol";
|
|
6
|
+
/** The one capability a user principal issues to admit a device into its own DM-communication scope (agent-comms#162) -- checked receiver-side wherever an unsolicited DM contact is admitted, the way room-token-verification.ts's ROOM_MEMBER_CAPABILITY gates every ordinary room-membership verb. */
|
|
7
|
+
export declare const DM_SEND_CAPABILITY = "dm:send";
|
|
8
|
+
/** The scope kind a dm:send grant's own scope always carries -- the resource being granted is "communication with this user principal", named by that principal's own device-id, never a specific bridge slot's peer-id, since a dm:send grant admits a bearer into the user's whole communication scope rather than one particular device. */
|
|
9
|
+
export declare const DM_SEND_SCOPE_KIND = "user";
|
|
10
|
+
export type DmSendTokenVerdictReason = TokenVerdictReason | "wrong_capability" | "wrong_scope_kind" | "wrong_scope_path" | "wrong_chain_root";
|
|
11
|
+
export type DmSendTokenVerdict = {
|
|
12
|
+
ok: true;
|
|
13
|
+
claims: TokenClaims;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
reason: DmSendTokenVerdictReason;
|
|
17
|
+
};
|
|
18
|
+
export interface VerifyDmSendTokenOptions extends Omit<VerifyCapabilityTokenOptions, "expectedBearer"> {
|
|
19
|
+
/** The peer identity actually authenticated on the arriving connection -- the requester presenting this token as its own authority to contact userPrincipalDeviceId, never a relay-asserted or gossip-derived value. Mandatory here, matching verifyRoomToken's own mandatory expectedBearer: every dm:send check gates a specific counterparty, unlike verifyCapabilityToken's own optional field for a caller presenting a token to authorise itself. */
|
|
20
|
+
expectedBearer: DeviceId;
|
|
21
|
+
/** This receiving node's own user-principal device-id (user-identity.ts's loadOrCreateUserIdentity), the only issuer a dm:send grant may validly root at. */
|
|
22
|
+
userPrincipalDeviceId: DeviceId;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Verifies a `dm:send` capability token against the receiver's own user-principal identity: the token must carry the dm:send capability, its scope must be kind "user" with path equal to userPrincipalDeviceId exactly, and its delegation chain must root at userPrincipalDeviceId itself -- a self-issued or third-party-issued token naming the right scope by coincidence still fails here, since rootIssuer is checked independently of scope.path.
|
|
26
|
+
*/
|
|
27
|
+
export declare function verifyDmSendToken(token: CapabilityToken, options: Readonly<VerifyDmSendTokenOptions>): Promise<DmSendTokenVerdict>;
|
|
28
|
+
//# sourceMappingURL=dm-token-verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dm-token-verification.d.ts","sourceRoot":"","sources":["../../src/core/dm-token-verification.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EAClC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,mCAAmC,CAAC;AAE3C,ySAAyS;AACzS,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,+UAA+U;AAC/U,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC,MAAM,MAAM,wBAAwB,GAChC,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACjC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,wBAAwB,CAAA;CAAE,CAAC;AAEpD,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,4BAA4B,EAC5B,gBAAgB,CACjB;IACC,2bAA2b;IAC3b,cAAc,EAAE,QAAQ,CAAC;IACzB,6JAA6J;IAC7J,qBAAqB,EAAE,QAAQ,CAAC;CACjC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,GAC1C,OAAO,CAAC,kBAAkB,CAAC,CA0B7B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Receiver-side verification of a `dm:send` capability token (agent-comms#162): the receiver-controlled admission list a user principal issues, parallel to room-token-verification.ts's own `room:member` obligations but rooted at the user principal's device-id (user-identity.ts) rather than a room's own owner -- a `dm:send` grant admits a bearer device into THIS user's communication scope across every bridge slot sharing that principal, not into one specific room path. Layered on verifyCapabilityToken the same way verifyRoomToken is: obligations 2/4/5 (bearer match, ordinary token-claims checks, delegations-remaining narrowing) live there already; this module adds the dm:send-specific obligations -- the presented token must actually carry the dm:send capability (not merely happen to share a scope shape), its scope must name this exact user principal, and its delegation chain must root at that same user principal (never at the bearer itself, or self-issued authority would let any sender simply mint its own admission).
|
|
3
|
+
*/
|
|
4
|
+
import { verifyCapabilityToken, } from "wire-mesh-core/domain/tokens";
|
|
5
|
+
import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
|
|
6
|
+
/** The one capability a user principal issues to admit a device into its own DM-communication scope (agent-comms#162) -- checked receiver-side wherever an unsolicited DM contact is admitted, the way room-token-verification.ts's ROOM_MEMBER_CAPABILITY gates every ordinary room-membership verb. */
|
|
7
|
+
export const DM_SEND_CAPABILITY = "dm:send";
|
|
8
|
+
/** The scope kind a dm:send grant's own scope always carries -- the resource being granted is "communication with this user principal", named by that principal's own device-id, never a specific bridge slot's peer-id, since a dm:send grant admits a bearer into the user's whole communication scope rather than one particular device. */
|
|
9
|
+
export const DM_SEND_SCOPE_KIND = "user";
|
|
10
|
+
/**
|
|
11
|
+
* Verifies a `dm:send` capability token against the receiver's own user-principal identity: the token must carry the dm:send capability, its scope must be kind "user" with path equal to userPrincipalDeviceId exactly, and its delegation chain must root at userPrincipalDeviceId itself -- a self-issued or third-party-issued token naming the right scope by coincidence still fails here, since rootIssuer is checked independently of scope.path.
|
|
12
|
+
*/
|
|
13
|
+
export async function verifyDmSendToken(token, options) {
|
|
14
|
+
const verdict = await verifyCapabilityToken(token, {
|
|
15
|
+
identity: options.identity,
|
|
16
|
+
clock: options.clock,
|
|
17
|
+
revocation: options.revocation,
|
|
18
|
+
expectedBearer: options.expectedBearer,
|
|
19
|
+
});
|
|
20
|
+
if (!verdict.ok) {
|
|
21
|
+
return verdict;
|
|
22
|
+
}
|
|
23
|
+
if (verdict.claims.capability !== DM_SEND_CAPABILITY) {
|
|
24
|
+
return { ok: false, reason: "wrong_capability" };
|
|
25
|
+
}
|
|
26
|
+
if (verdict.claims.scope.kind !== DM_SEND_SCOPE_KIND) {
|
|
27
|
+
return { ok: false, reason: "wrong_scope_kind" };
|
|
28
|
+
}
|
|
29
|
+
const expectedPath = deviceIdToHex(options.userPrincipalDeviceId);
|
|
30
|
+
if (verdict.claims.scope.path !== expectedPath) {
|
|
31
|
+
return { ok: false, reason: "wrong_scope_path" };
|
|
32
|
+
}
|
|
33
|
+
if (deviceIdToHex(verdict.rootIssuer) !== expectedPath) {
|
|
34
|
+
return { ok: false, reason: "wrong_chain_root" };
|
|
35
|
+
}
|
|
36
|
+
return { ok: true, claims: verdict.claims };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=dm-token-verification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dm-token-verification.js","sourceRoot":"","sources":["../../src/core/dm-token-verification.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,qBAAqB,GAGtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAOhE,ySAAyS;AACzS,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,+UAA+U;AAC/U,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAuBzC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAsB,EACtB,OAA2C;IAE3C,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,KAAK,EAAE;QACjD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QAChB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,KAAK,kBAAkB,EAAE,CAAC;QACrD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACrD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IACD,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClE,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAC/C,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,YAAY,EAAE,CAAC;QACvD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACnD,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* gossip-directory — the mesh-wide gossip-directory aggregation WireMeshTransport's own listKnownDevices reads from, plus per-event directory lookups (a specific peer's presence advert). Split out purely to keep wire-mesh-transport.ts under the repo's max-lines cap, the same reason connection-approval.ts, room-router.ts, hub-session.ts, and peer-lifecycle.ts were each split from their own owning file.
|
|
3
3
|
*/
|
|
4
4
|
import type { DirectoryEntry } from "wire-mesh-core/domain/mesh-session";
|
|
5
5
|
import type { PeerAdvert } from "wire-mesh-core/generated/protocol";
|
|
6
|
+
import { AgentStatus } from "./types.js";
|
|
6
7
|
/** Merges one session event's own directory into the mesh-wide knownDevices view (mutated in place), keeping the newer advert (by snapshot-seconds) whenever a device-id is already known from an earlier event or a different session. */
|
|
7
8
|
export declare function mergeKnownDevices(knownDevices: Map<string, PeerAdvert>, directory: readonly DirectoryEntry[]): void;
|
|
9
|
+
/** Reads a presence extension from one specific device's own gossiped self-advert, if this event's directory carries a fresh one for exactly that device-id -- never for any other device-id a multi-hop directory might mention, since only the session's own authenticated peer's advert is that session's business to report. Returns undefined for a missing presence/status key, or a value that isn't a recognised AgentStatus -- an advert simply not participating in this convention, not an error (the same verifier obligation peer-advert's own open extension tail is documented under). */
|
|
10
|
+
export declare function findPresenceAdvert(deviceIdHex: string, directory: readonly DirectoryEntry[]): AgentStatus | undefined;
|
|
8
11
|
//# sourceMappingURL=gossip-directory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gossip-directory.d.ts","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"gossip-directory.d.ts","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,2OAA2O;AAC3O,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACrC,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,IAAI,CAWN;AAED,ykBAAykB;AACzkB,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,WAAW,GAAG,SAAS,CAOzB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* gossip-directory — the mesh-wide gossip-directory aggregation WireMeshTransport's own listKnownDevices reads from, plus per-event directory lookups (a specific peer's presence advert). Split out purely to keep wire-mesh-transport.ts under the repo's max-lines cap, the same reason connection-approval.ts, room-router.ts, hub-session.ts, and peer-lifecycle.ts were each split from their own owning file.
|
|
3
3
|
*/
|
|
4
4
|
import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
|
|
5
|
+
import { AgentStatus } from "./types.js";
|
|
6
|
+
import { PRESENCE_GOSSIP_KEY } from "./wire-mesh-transport.js";
|
|
5
7
|
/** Merges one session event's own directory into the mesh-wide knownDevices view (mutated in place), keeping the newer advert (by snapshot-seconds) whenever a device-id is already known from an earlier event or a different session. */
|
|
6
8
|
export function mergeKnownDevices(knownDevices, directory) {
|
|
7
9
|
for (const entry of directory) {
|
|
@@ -13,4 +15,12 @@ export function mergeKnownDevices(knownDevices, directory) {
|
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
}
|
|
18
|
+
/** Reads a presence extension from one specific device's own gossiped self-advert, if this event's directory carries a fresh one for exactly that device-id -- never for any other device-id a multi-hop directory might mention, since only the session's own authenticated peer's advert is that session's business to report. Returns undefined for a missing presence/status key, or a value that isn't a recognised AgentStatus -- an advert simply not participating in this convention, not an error (the same verifier obligation peer-advert's own open extension tail is documented under). */
|
|
19
|
+
export function findPresenceAdvert(deviceIdHex, directory) {
|
|
20
|
+
const entry = directory.find((candidate) => deviceIdToHex(candidate.device) === deviceIdHex);
|
|
21
|
+
if (entry === undefined)
|
|
22
|
+
return undefined;
|
|
23
|
+
const status = entry.advert[PRESENCE_GOSSIP_KEY];
|
|
24
|
+
return AgentStatus.is(status) ? status : undefined;
|
|
25
|
+
}
|
|
16
26
|
//# sourceMappingURL=gossip-directory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gossip-directory.js","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"gossip-directory.js","sourceRoot":"","sources":["../../src/core/gossip-directory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,2OAA2O;AAC3O,MAAM,UAAU,iBAAiB,CAC/B,YAAqC,EACrC,SAAoC;IAEpC,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC/C,IACE,QAAQ,KAAK,SAAS;YACtB,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,QAAQ,CAAC,kBAAkB,CAAC,EAChE,CAAC;YACD,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;AACH,CAAC;AAED,ykBAAykB;AACzkB,MAAM,UAAU,kBAAkB,CAChC,WAAmB,EACnB,SAAoC;IAEpC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAC1B,CAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,WAAW,CAC/D,CAAC;IACF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,MAAM,GAAY,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1D,OAAO,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hub-forwarding -- agent-comms#155's gateway forwarding, split from wire-mesh-transport.ts under the repo's max-lines cap. Outbound: filters a directory of gossiped local devices down to the ones eligible for cross-machine advertisement (an agent/self-bearing entry, meaning only ever a "visible" agent -- see AGENT_SELF_GOSSIP_KEY's own doc for why no separate visibility check is needed here) and pushes them onto a connected HubSession, best-effort. Local-to-remote routing: falls a room-domain request back through the hub's own relay-connect/relay-data pairing when its target isn't a local peer session.
|
|
3
|
+
*/
|
|
4
|
+
import type { CapabilityScope, CapabilityToken, ManageCommand, PeerAdvert } from "wire-mesh-core/generated/protocol";
|
|
5
|
+
import type { DirectoryEntry, ManageOutcome } from "wire-mesh-core/domain/mesh-session";
|
|
6
|
+
import type { HubSession } from "./hub-session.js";
|
|
7
|
+
/** Forwards every directory entry carrying an agent/self extension onto hub, if hub currently holds a live connection -- a no-op otherwise, which is every local peer except whichever one is currently the gateway. Called both from WireMeshTransport's own watchForDisconnect (as each local peer session's directory changes) and from connectHub's own initial catch-up push, so this side's already-known local devices reach the hub immediately on taking over the gateway role rather than waiting for their own next periodic gossip tick. Forwards unconditionally on every call (no caching or dedup against a previous call), mirroring relay-hub.ts's own "forward every gossip frame, as received" philosophy: an advert's own snapshot-seconds/addresses are meant to keep propagating as a liveness heartbeat, so suppressing a "duplicate" would silently stop legitimate freshness updates from reaching remote gateways. A forward that fails is reported via onError and swallowed, matching every other best-effort gossip send in this codebase. */
|
|
8
|
+
export declare function forwardAdvertsToHub(hub: Readonly<Pick<HubSession, "isConnected" | "advertiseDevices">>, directory: readonly DirectoryEntry[], onError: ((error: Error) => void) | undefined): void;
|
|
9
|
+
/** Catches the hub up with every local device already known at the moment this side becomes the gateway (connectHub's own trailing call, right after hub.connect resolves) -- without this, a device whose own last gossip arrived before this coordinator took over the gateway role would never be (re-)advertised until its own next periodic gossip tick (hub-side state is rebuilt from scratch on every takeover, per coordinator-gateway.ts's own class doc). Reuses forwardAdvertsToHub's own eligibility filter, so only ever a visible, agent/self-bearing device is pushed, exactly as an ordinary directory-change forward would. */
|
|
10
|
+
export declare function pushHubCatchUp(hub: Readonly<Pick<HubSession, "isConnected" | "advertiseDevices">>, knownDevices: ReadonlyMap<string, Readonly<PeerAdvert>>, onError: ((error: Error) => void) | undefined): void;
|
|
11
|
+
/** Routes a room-domain request through the hub's relay-connect/relay-data pairing when memberId isn't a local peer session -- WireMeshTransport.sendRoomRequest's own fallback, since the member may be a remote agent reachable only via this machine's gateway connection (agent-comms#155's local-to-remote leg). Resolves the same not_connected outcome sendRoomRequest already returned before the hub existed at all when this side isn't currently the gateway. */
|
|
12
|
+
export declare function routeRoomRequestViaHub(hub: Readonly<Pick<HubSession, "isConnected" | "sendRoomRequest">>, memberId: string, command: ManageCommand, scope: Readonly<CapabilityScope>, token?: CapabilityToken): Promise<ManageOutcome>;
|
|
13
|
+
//# sourceMappingURL=hub-forwarding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub-forwarding.d.ts","sourceRoot":"","sources":["../../src/core/hub-forwarding.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,2gCAA2gC;AAC3gC,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,kBAAkB,CAAC,CAAC,EACnE,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,GAC5C,IAAI,CASN;AAED,inBAAinB;AACjnB,wBAAgB,cAAc,CAC5B,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,kBAAkB,CAAC,CAAC,EACnE,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EACvD,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,GAC5C,IAAI,CAMN;AAED,4cAA4c;AAC5c,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,iBAAiB,CAAC,CAAC,EAClE,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,EAChC,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,aAAa,CAAC,CAGxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hub-forwarding -- agent-comms#155's gateway forwarding, split from wire-mesh-transport.ts under the repo's max-lines cap. Outbound: filters a directory of gossiped local devices down to the ones eligible for cross-machine advertisement (an agent/self-bearing entry, meaning only ever a "visible" agent -- see AGENT_SELF_GOSSIP_KEY's own doc for why no separate visibility check is needed here) and pushes them onto a connected HubSession, best-effort. Local-to-remote routing: falls a room-domain request back through the hub's own relay-connect/relay-data pairing when its target isn't a local peer session.
|
|
3
|
+
*/
|
|
4
|
+
import { AGENT_SELF_GOSSIP_KEY } from "./wire-mesh-transport.js";
|
|
5
|
+
/** Forwards every directory entry carrying an agent/self extension onto hub, if hub currently holds a live connection -- a no-op otherwise, which is every local peer except whichever one is currently the gateway. Called both from WireMeshTransport's own watchForDisconnect (as each local peer session's directory changes) and from connectHub's own initial catch-up push, so this side's already-known local devices reach the hub immediately on taking over the gateway role rather than waiting for their own next periodic gossip tick. Forwards unconditionally on every call (no caching or dedup against a previous call), mirroring relay-hub.ts's own "forward every gossip frame, as received" philosophy: an advert's own snapshot-seconds/addresses are meant to keep propagating as a liveness heartbeat, so suppressing a "duplicate" would silently stop legitimate freshness updates from reaching remote gateways. A forward that fails is reported via onError and swallowed, matching every other best-effort gossip send in this codebase. */
|
|
6
|
+
export function forwardAdvertsToHub(hub, directory, onError) {
|
|
7
|
+
if (!hub.isConnected)
|
|
8
|
+
return;
|
|
9
|
+
const eligible = directory.filter((entry) => entry.advert[AGENT_SELF_GOSSIP_KEY] !== undefined);
|
|
10
|
+
if (eligible.length === 0)
|
|
11
|
+
return;
|
|
12
|
+
hub.advertiseDevices(eligible).catch((error) => {
|
|
13
|
+
onError?.(error instanceof Error ? error : new Error(String(error)));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** Catches the hub up with every local device already known at the moment this side becomes the gateway (connectHub's own trailing call, right after hub.connect resolves) -- without this, a device whose own last gossip arrived before this coordinator took over the gateway role would never be (re-)advertised until its own next periodic gossip tick (hub-side state is rebuilt from scratch on every takeover, per coordinator-gateway.ts's own class doc). Reuses forwardAdvertsToHub's own eligibility filter, so only ever a visible, agent/self-bearing device is pushed, exactly as an ordinary directory-change forward would. */
|
|
17
|
+
export function pushHubCatchUp(hub, knownDevices, onError) {
|
|
18
|
+
const catchUp = [...knownDevices.values()].map((advert) => ({
|
|
19
|
+
device: advert.device,
|
|
20
|
+
advert,
|
|
21
|
+
}));
|
|
22
|
+
forwardAdvertsToHub(hub, catchUp, onError);
|
|
23
|
+
}
|
|
24
|
+
/** Routes a room-domain request through the hub's relay-connect/relay-data pairing when memberId isn't a local peer session -- WireMeshTransport.sendRoomRequest's own fallback, since the member may be a remote agent reachable only via this machine's gateway connection (agent-comms#155's local-to-remote leg). Resolves the same not_connected outcome sendRoomRequest already returned before the hub existed at all when this side isn't currently the gateway. */
|
|
25
|
+
export async function routeRoomRequestViaHub(hub, memberId, command, scope, token) {
|
|
26
|
+
if (!hub.isConnected)
|
|
27
|
+
return { result: "error", code: "not_connected" };
|
|
28
|
+
return hub.sendRoomRequest(memberId, command, scope, token);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=hub-forwarding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub-forwarding.js","sourceRoot":"","sources":["../../src/core/hub-forwarding.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,2gCAA2gC;AAC3gC,MAAM,UAAU,mBAAmB,CACjC,GAAmE,EACnE,SAAoC,EACpC,OAA6C;IAE7C,IAAI,CAAC,GA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|
* HubSession -- the relay-hub connection mode (agent-comms#151), split from wire-mesh-transport.ts under the max-lines cap the same way connection-approval.ts and its siblings were. A hub connection (wss://mesh.exadev.io/) is a RELAY, not a coordinator: no connect_request/introduce approval applies. The session's own self-advert is forwarded by the hub to every other connected agent and the hub answers with a catch-up of everyone already there, so peers discover each other purely through gossip. Messages ride relay-connect pairings -- sendManageRequest's own targetDevice routing, which the session layer wraps as relay-data to exactly that device.
|
|
3
3
|
*/
|
|
4
|
-
import { type AcceptedMeshSession } from "wire-mesh-core/domain/mesh-session";
|
|
5
|
-
import type { Frame } from "wire-mesh-core/generated/protocol";
|
|
4
|
+
import { type AcceptedMeshSession, type DirectoryEntry, type IncomingManageRequest, type ManageOutcome } from "wire-mesh-core/domain/mesh-session";
|
|
5
|
+
import type { CapabilityScope, CapabilityToken, Frame, ManageCommand } from "wire-mesh-core/generated/protocol";
|
|
6
6
|
import type { IdentityPort } from "wire-mesh-core/ports/identity";
|
|
7
7
|
import type { Connection } from "wire-mesh-core/ports/transport";
|
|
8
|
-
import type { TransportEvents } from "./transport.js";
|
|
8
|
+
import type { ConnectionHandle, TransportEvents } from "./transport.js";
|
|
9
9
|
import type { MeshMessage } from "./wire-protocol.js";
|
|
10
10
|
export interface HubSessionDeps {
|
|
11
11
|
/** Resolves this node's own identity port once ready. */
|
|
@@ -19,10 +19,16 @@ export interface HubSessionDeps {
|
|
|
19
19
|
onFrame: (connection: Readonly<Connection>, frame: Readonly<Frame>) => void | Promise<void>;
|
|
20
20
|
/** Tracks the session for shutdown -- every session the transport ever creates, always. */
|
|
21
21
|
trackForShutdown: (session: AcceptedMeshSession) => void;
|
|
22
|
+
/** Fires with every remote (non-self) directory entry the hub's own gossip/catch-up surfaces, every time the session's directory changes (agent-comms#155's own remote-directory-merge leg) -- the transport merges these into its own mesh-wide knownDevices the same way it already merges a local peer session's directory, so a hub-learned agent surfaces in listAgents/getAgent with no separate lookup path. */
|
|
23
|
+
onDirectory: (entries: readonly DirectoryEntry[]) => void;
|
|
24
|
+
/** Dispatches an already-received, non-legacy-frame request (a real core/room verb: room.send, room.notify, room.join, ...) to WireMeshTransport's own roomRouter, the identical dispatch a local peer session's own drainSession already uses -- the outbound half of agent-comms#155's "remote to local" routing leg. Deferred the same lazy-`this`-capture way DeliveryEngine's own sendRoomRequestToMember closure is, since roomRouter is constructed after this class's own instance in WireMeshTransport's constructor. */
|
|
25
|
+
handleRoomRequest: (request: IncomingManageRequest, handle: Readonly<ConnectionHandle>) => Promise<void>;
|
|
22
26
|
}
|
|
23
27
|
export declare class HubSession {
|
|
24
28
|
private readonly deps;
|
|
25
29
|
private session;
|
|
30
|
+
/** The raw connection underlying `session` -- MeshSession's own sendGossipUpdate only ever advertises this side's own single device, so advertising OTHER (local mesh) devices onto the hub (agent-comms#155's outbound leg) needs a raw gossip frame sent directly, bypassing that per-session single-self-advert limit. */
|
|
31
|
+
private connection;
|
|
26
32
|
private readonly hubPeersKnown;
|
|
27
33
|
constructor(deps: Readonly<HubSessionDeps>);
|
|
28
34
|
/** This node's own device-id, hex-encoded -- the identifier hub peers address it by. */
|
|
@@ -35,10 +41,14 @@ export declare class HubSession {
|
|
|
35
41
|
peers(): readonly string[];
|
|
36
42
|
/** Dials the hub and participates as a peer (see the class doc for the discovery and routing model). */
|
|
37
43
|
connect(url: string): Promise<void>;
|
|
38
|
-
/** Dispatches inbound relayed manage-requests: each is handled with a handle keyed by the SENDING device (request.fromDevice names it on relay-routed requests), so
|
|
44
|
+
/** Dispatches inbound relayed manage-requests: each is handled with a handle keyed by the SENDING device (request.fromDevice names it on relay-routed requests), so every downstream consumer sees the true origin, never the hub -- the same discipline extends to a real room-domain verb (agent-comms#155's "remote to local" leg) as it already applied to the legacy opaque-frame path. A legacy FRAME_VERB carrying state_sync/state_update is dropped before ever reaching onMessage/applyPatch -- see isStateMutatingMessage's own doc for why: the hub has no per-peer admission control yet (that lands in agent-comms#156), so accepting one from an arbitrary hub peer would let it directly patch this side's mesh state (a security review finding on agent-comms#169). A real room-domain verb (room.send, room.join, room.notify, ...) carries no equivalent risk -- it is independently gated by its own room:member capability token, verified regardless of which transport path it arrived over -- so it is dispatched to the same roomVerbHandlers a local peer session's own drainSession uses, via handleRoomRequest, against THIS side's own local mesh state. Known limitation, inherited from wire-mesh-core's own session layer rather than something agent-comms can fix here: a session tracks at most one active relay pairing per remote device (mesh-session.ts's own single relayPeerDevice slot), so a request relayed here is dispatched as "addressed to this gateway's own agent" unconditionally -- there is no target-device disambiguation available to route it on to a DIFFERENT local peer this gateway also advertises. Forwarding this gateway's own agent's traffic is therefore correct; a remote request genuinely meant for another local peer behind this same gateway is not yet distinguishable from one meant for this gateway's own agent. */
|
|
39
45
|
private consume;
|
|
40
46
|
private watchDisconnect;
|
|
41
47
|
/** Sends one message to a hub-discovered peer through the hub's relay pairing. */
|
|
42
48
|
sendToPeer(peerDeviceHex: string, message: MeshMessage): Promise<void>;
|
|
49
|
+
/** Gossips a raw `gossip` frame carrying every given entry's own advert onto the hub, over the raw connection rather than sendGossipUpdate (which can only ever advertise this side's own single device) -- the outbound leg of agent-comms#155's gateway forwarding. relay-hub.ts registers each advert's own `device` field against the CONNECTION it arrives on, so every entry passed here becomes reachable, cross-machine, as "via this gateway" -- callers are responsible for only ever passing entries that are actually meant to be advertised (WireMeshTransport filters to local, visible-agent-bearing entries before calling this). Throws if this side isn't currently connected to a hub, matching sendToPeer's own contract -- callers gate on isConnected first. */
|
|
50
|
+
advertiseDevices(entries: readonly DirectoryEntry[]): Promise<void>;
|
|
51
|
+
/** Sends a real core/room manage-request to a specific hub-reachable peer, through the hub's relay-connect/relay-data pairing -- the local-to-remote leg of agent-comms#155's routing, mirroring MeshTransport.sendRoomRequest's own not_connected/outcome contract so WireMeshTransport can fall back to this uniformly when memberId isn't a local peer session. Bounded by HUB_ROOM_REQUEST_TIMEOUT_MS (see its own doc) since an unreachable target-device is silently dropped by the hub with no error frame, unlike a local session's own connection-level failure. */
|
|
52
|
+
sendRoomRequest(peerDeviceHex: string, command: ManageCommand, scope: Readonly<CapabilityScope>, token?: CapabilityToken): Promise<ManageOutcome>;
|
|
43
53
|
}
|
|
44
54
|
//# sourceMappingURL=hub-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-session.d.ts","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"hub-session.d.ts","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,KAAK,EACL,aAAa,EACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAatD,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAClC,yHAAyH;IACzH,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,wEAAwE;IACxE,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,sIAAsI;IACtI,OAAO,EAAE,CACP,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAChC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KACnB,IAAI,GAAG,OAAO,CAAC,IAAI,C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AAC,eAAe,CAAC,EAChC,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,aAAa,CAAC;CAa1B"}
|
package/dist/core/hub-session.js
CHANGED
|
@@ -5,10 +5,14 @@ import { acceptMeshSession, } from "wire-mesh-core/domain/mesh-session";
|
|
|
5
5
|
import { deviceIdToHex } from "wire-mesh-core/domain/device-id";
|
|
6
6
|
import { extractMessage } from "./room-router.js";
|
|
7
7
|
import { connectWsUrl } from "./ws-dial.js";
|
|
8
|
-
import { buildCommand, DOMAIN, FRAME_SCOPE } from "./wire-mesh-transport.js";
|
|
8
|
+
import { buildCommand, DOMAIN, FRAME_SCOPE, FRAME_VERB, } from "./wire-mesh-transport.js";
|
|
9
|
+
/** How long a room-domain request routed through the hub's relay-connect/relay-data pairing waits for a response before giving up. Unlike an ordinary local peer session, a relay-connect naming an unknown target-device is silently dropped by the hub (spec/relay-hub's own documented behaviour -- no error frame exists for "no such device"), so a request to a device that turns out not to be reachable via any gateway would otherwise hang forever rather than surfacing as a normal "not reachable" outcome. */
|
|
10
|
+
const HUB_ROOM_REQUEST_TIMEOUT_MS = 15_000;
|
|
9
11
|
export class HubSession {
|
|
10
12
|
deps;
|
|
11
13
|
session;
|
|
14
|
+
/** The raw connection underlying `session` -- MeshSession's own sendGossipUpdate only ever advertises this side's own single device, so advertising OTHER (local mesh) devices onto the hub (agent-comms#155's outbound leg) needs a raw gossip frame sent directly, bypassing that per-session single-self-advert limit. */
|
|
15
|
+
connection;
|
|
12
16
|
hubPeersKnown = new Set();
|
|
13
17
|
constructor(deps) {
|
|
14
18
|
this.deps = deps;
|
|
@@ -28,6 +32,7 @@ export class HubSession {
|
|
|
28
32
|
if (session === undefined)
|
|
29
33
|
return;
|
|
30
34
|
this.session = undefined;
|
|
35
|
+
this.connection = undefined;
|
|
31
36
|
await session.close();
|
|
32
37
|
}
|
|
33
38
|
/** The device ids (hex) of peers discovered through the hub's gossiped directory. */
|
|
@@ -51,18 +56,20 @@ export class HubSession {
|
|
|
51
56
|
return;
|
|
52
57
|
}
|
|
53
58
|
this.session = session;
|
|
59
|
+
this.connection = connection;
|
|
54
60
|
this.deps.trackForShutdown(session);
|
|
55
|
-
// Merge the hub's directory (its catch-up arrives as the first session events) and keep refreshing it on every subsequent one.
|
|
61
|
+
// Merge the hub's directory (its catch-up arrives as the first session events) and keep refreshing it on every subsequent one. Every remote entry is also surfaced via onDirectory, so the transport can merge it into its own mesh-wide knownDevices (agent-comms#155's remote-directory-merge leg).
|
|
56
62
|
void (async () => {
|
|
63
|
+
const ownHex = deviceIdToHex(identity.deviceId);
|
|
57
64
|
for await (const event of session.events) {
|
|
58
65
|
if (this.deps.isShuttingDown())
|
|
59
66
|
break;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.hubPeersKnown.add(hex);
|
|
64
|
-
}
|
|
67
|
+
const remoteEntries = event.directory.filter((entry) => deviceIdToHex(entry.device) !== ownHex);
|
|
68
|
+
for (const entry of remoteEntries) {
|
|
69
|
+
this.hubPeersKnown.add(deviceIdToHex(entry.device));
|
|
65
70
|
}
|
|
71
|
+
if (remoteEntries.length > 0)
|
|
72
|
+
this.deps.onDirectory(remoteEntries);
|
|
66
73
|
if (event.state.status === "closed")
|
|
67
74
|
break;
|
|
68
75
|
}
|
|
@@ -72,7 +79,7 @@ export class HubSession {
|
|
|
72
79
|
await this.watchDisconnect(session);
|
|
73
80
|
})();
|
|
74
81
|
}
|
|
75
|
-
/** Dispatches inbound relayed manage-requests: each is handled with a handle keyed by the SENDING device (request.fromDevice names it on relay-routed requests), so
|
|
82
|
+
/** Dispatches inbound relayed manage-requests: each is handled with a handle keyed by the SENDING device (request.fromDevice names it on relay-routed requests), so every downstream consumer sees the true origin, never the hub -- the same discipline extends to a real room-domain verb (agent-comms#155's "remote to local" leg) as it already applied to the legacy opaque-frame path. A legacy FRAME_VERB carrying state_sync/state_update is dropped before ever reaching onMessage/applyPatch -- see isStateMutatingMessage's own doc for why: the hub has no per-peer admission control yet (that lands in agent-comms#156), so accepting one from an arbitrary hub peer would let it directly patch this side's mesh state (a security review finding on agent-comms#169). A real room-domain verb (room.send, room.join, room.notify, ...) carries no equivalent risk -- it is independently gated by its own room:member capability token, verified regardless of which transport path it arrived over -- so it is dispatched to the same roomVerbHandlers a local peer session's own drainSession uses, via handleRoomRequest, against THIS side's own local mesh state. Known limitation, inherited from wire-mesh-core's own session layer rather than something agent-comms can fix here: a session tracks at most one active relay pairing per remote device (mesh-session.ts's own single relayPeerDevice slot), so a request relayed here is dispatched as "addressed to this gateway's own agent" unconditionally -- there is no target-device disambiguation available to route it on to a DIFFERENT local peer this gateway also advertises. Forwarding this gateway's own agent's traffic is therefore correct; a remote request genuinely meant for another local peer behind this same gateway is not yet distinguishable from one meant for this gateway's own agent. */
|
|
76
83
|
consume(session) {
|
|
77
84
|
void (async () => {
|
|
78
85
|
for await (const request of session.incomingManageRequests) {
|
|
@@ -82,11 +89,16 @@ export class HubSession {
|
|
|
82
89
|
? deviceIdToHex(request.fromDevice)
|
|
83
90
|
: "hub-peer";
|
|
84
91
|
this.hubPeersKnown.add(senderHex);
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
|
|
92
|
+
const handle = { id: senderHex };
|
|
93
|
+
if (request.command.verb === FRAME_VERB) {
|
|
94
|
+
const message = extractMessage(request.command);
|
|
95
|
+
if (message !== undefined && !isStateMutatingMessage(message)) {
|
|
96
|
+
this.deps.events.onMessage(handle, message);
|
|
97
|
+
}
|
|
98
|
+
await request.respond({ result: "ok" }).catch(() => undefined);
|
|
99
|
+
continue;
|
|
88
100
|
}
|
|
89
|
-
await
|
|
101
|
+
await this.deps.handleRoomRequest(request, handle);
|
|
90
102
|
}
|
|
91
103
|
})();
|
|
92
104
|
}
|
|
@@ -97,6 +109,7 @@ export class HubSession {
|
|
|
97
109
|
}
|
|
98
110
|
if (this.session === session) {
|
|
99
111
|
this.session = undefined;
|
|
112
|
+
this.connection = undefined;
|
|
100
113
|
}
|
|
101
114
|
}
|
|
102
115
|
/** Sends one message to a hub-discovered peer through the hub's relay pairing. */
|
|
@@ -107,6 +120,25 @@ export class HubSession {
|
|
|
107
120
|
}
|
|
108
121
|
await session.sendManageRequest(buildCommand(message), FRAME_SCOPE, hexToBytes(peerDeviceHex));
|
|
109
122
|
}
|
|
123
|
+
/** Gossips a raw `gossip` frame carrying every given entry's own advert onto the hub, over the raw connection rather than sendGossipUpdate (which can only ever advertise this side's own single device) -- the outbound leg of agent-comms#155's gateway forwarding. relay-hub.ts registers each advert's own `device` field against the CONNECTION it arrives on, so every entry passed here becomes reachable, cross-machine, as "via this gateway" -- callers are responsible for only ever passing entries that are actually meant to be advertised (WireMeshTransport filters to local, visible-agent-bearing entries before calling this). Throws if this side isn't currently connected to a hub, matching sendToPeer's own contract -- callers gate on isConnected first. */
|
|
124
|
+
async advertiseDevices(entries) {
|
|
125
|
+
const connection = this.connection;
|
|
126
|
+
if (connection === undefined) {
|
|
127
|
+
throw new Error("not connected to a hub");
|
|
128
|
+
}
|
|
129
|
+
await connection.send({
|
|
130
|
+
type: "gossip",
|
|
131
|
+
peers: entries.map((entry) => entry.advert),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/** Sends a real core/room manage-request to a specific hub-reachable peer, through the hub's relay-connect/relay-data pairing -- the local-to-remote leg of agent-comms#155's routing, mirroring MeshTransport.sendRoomRequest's own not_connected/outcome contract so WireMeshTransport can fall back to this uniformly when memberId isn't a local peer session. Bounded by HUB_ROOM_REQUEST_TIMEOUT_MS (see its own doc) since an unreachable target-device is silently dropped by the hub with no error frame, unlike a local session's own connection-level failure. */
|
|
135
|
+
async sendRoomRequest(peerDeviceHex, command, scope, token) {
|
|
136
|
+
const session = this.session;
|
|
137
|
+
if (session === undefined) {
|
|
138
|
+
return { result: "error", code: "not_connected" };
|
|
139
|
+
}
|
|
140
|
+
return session.sendManageRequest(command, scope, hexToBytes(peerDeviceHex), token, HUB_ROOM_REQUEST_TIMEOUT_MS);
|
|
141
|
+
}
|
|
110
142
|
}
|
|
111
143
|
function hexToBytes(hex) {
|
|
112
144
|
const bytes = new Uint8Array(new ArrayBuffer(hex.length / 2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-session.js","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"hub-session.js","sourceRoot":"","sources":["../../src/core/hub-session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,GAKlB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAWhE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,MAAM,EACN,WAAW,EACX,UAAU,GACX,MAAM,0BAA0B,CAAC;AAElC,2fAA2f;AAC3f,MAAM,2BAA2B,GAAG,MAAM,CAAC;AA0B3C,MAAM,OAAO,UAAU;IAMQ;IALrB,OAAO,CAAkC;IACjD,6TAA6T;IACrT,UAAU,CAAyB;IAC1B,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnD,YAA6B,IAA8B;QAA9B,SAAI,GAAJ,IAAI,CAA0B;IAAG,CAAC;IAE/D,wFAAwF;IACxF,KAAK,CAAC,YAAY;QAChB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;QAC/C,OAAO,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,kOAAkO;IAClO,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC;IACpC,CAAC;IAED,mKAAmK;IACnK,KAAK,CAAC,UAAU;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI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AAC,EAAE,CAAC;QACzC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,45BAA45B;AAC55B,SAAS,sBAAsB,CAAC,OAAoB;IAClD,OAAO,OAAO,CAAC,MAAM,KAAK,YAAY,IAAI,OAAO,CAAC,MAAM,KAAK,cAAc,CAAC;AAC9E,CAAC"}
|
|
@@ -20,6 +20,14 @@ export declare function oplogDirFor(slot: Readonly<IdentitySlot>): string;
|
|
|
20
20
|
* Load the persisted identity for the slot, creating it on first use, and take the slot lock. Returns an ephemeral identity when the slot is already held by another live process.
|
|
21
21
|
*/
|
|
22
22
|
export declare function loadOrCreateIdentity(slot: Readonly<IdentitySlot>): PeerIdentity;
|
|
23
|
+
/**
|
|
24
|
+
* Probes a slot's current lock holder without taking it -- the cc-peer front (agent-comms#157) uses this read-only check to decide whether a local Claude Code session already fronts itself (a live agent-comms bridge already holds the slot) before attaching, and to notice a session's own bridge taking the slot over later so the front can yield. Returns the live PID currently holding the slot's lock, or undefined when the slot is unlocked or its recorded holder is no longer alive.
|
|
25
|
+
*/
|
|
26
|
+
export declare function probeSlotOwner(slot: Readonly<IdentitySlot>): number | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Loads (creating on first use) the persisted identity for a slot without taking its exclusivity lock. The cc-peer front (agent-comms#157) uses this to assume a not-yet-live session's own future identity, so the device-id -- and with it every agent id, room membership, and pending delivery already addressed to it -- carries over unchanged the moment that session's own bridge starts and claims the slot for real. Callers must have already confirmed via probeSlotOwner that no live bridge currently holds the slot; re-probing atomically against a concurrent acquisition isn't possible across the two separate files (identity vs lock) this store keeps, so it's the front's own periodic re-probe, not this function, that detects and reacts to a real bridge taking over afterwards.
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadIdentityForFront(slot: Readonly<IdentitySlot>): PeerIdentity;
|
|
23
31
|
/**
|
|
24
32
|
* Release the slot lock on graceful shutdown. A lock held by another PID (taken over after this process crashed and restarted) is left alone.
|
|
25
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-store.d.ts","sourceRoot":"","sources":["../../src/core/identity-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAQzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA2ID,4UAA4U;AAC5U,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,MAAM,CAIhE;AAuCD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,GAC3B,YAAY,CAgBd;AAkDD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI,CAKtE;AAuBD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,GAC3B,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CASjC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,eAAe,GACrB,IAAI,CAaN;AAED,sGAAsG;AACtG,wBAAgB,eAAe,CAC7B,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,QAAQ,EAAE,MAAM,GACf,IAAI,CA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,CAC9B,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,SAAS,EAAE,MAAM,GAChB,IAAI,CAUN;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,UAAU,CAAC,WAAW,CAAC,GAAG,SAAS,CAQrC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,UAAU,GAClB,IAAI,CAcN;AAED,4PAA4P;AAC5P,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,EAC5B,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,IAAI,CASN"}
|
|
@@ -213,6 +213,24 @@ function createIdentity(identityFile) {
|
|
|
213
213
|
persistIdentity(identityFile, identity);
|
|
214
214
|
return identity;
|
|
215
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Probes a slot's current lock holder without taking it -- the cc-peer front (agent-comms#157) uses this read-only check to decide whether a local Claude Code session already fronts itself (a live agent-comms bridge already holds the slot) before attaching, and to notice a session's own bridge taking the slot over later so the front can yield. Returns the live PID currently holding the slot's lock, or undefined when the slot is unlocked or its recorded holder is no longer alive.
|
|
218
|
+
*/
|
|
219
|
+
export function probeSlotOwner(slot) {
|
|
220
|
+
const { lockFile } = slotPaths(slot);
|
|
221
|
+
const heldBy = readLockPid(lockFile);
|
|
222
|
+
if (heldBy === undefined)
|
|
223
|
+
return undefined;
|
|
224
|
+
return isPidAlive(heldBy) ? heldBy : undefined;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Loads (creating on first use) the persisted identity for a slot without taking its exclusivity lock. The cc-peer front (agent-comms#157) uses this to assume a not-yet-live session's own future identity, so the device-id -- and with it every agent id, room membership, and pending delivery already addressed to it -- carries over unchanged the moment that session's own bridge starts and claims the slot for real. Callers must have already confirmed via probeSlotOwner that no live bridge currently holds the slot; re-probing atomically against a concurrent acquisition isn't possible across the two separate files (identity vs lock) this store keeps, so it's the front's own periodic re-probe, not this function, that detects and reacts to a real bridge taking over afterwards.
|
|
228
|
+
*/
|
|
229
|
+
export function loadIdentityForFront(slot) {
|
|
230
|
+
const { dir, identityFile } = slotPaths(slot);
|
|
231
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
232
|
+
return loadStoredIdentity(identityFile) ?? createIdentity(identityFile);
|
|
233
|
+
}
|
|
216
234
|
/**
|
|
217
235
|
* Release the slot lock on graceful shutdown. A lock held by another PID (taken over after this process crashed and restarted) is left alone.
|
|
218
236
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-store.js","sourceRoot":"","sources":["../../src/core/identity-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAWvB,gFAAgF;AAChF,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,oEAAoE;AACpE,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,uBAAuB,CAAC;AAqB5E,kHAAkH;AAClH,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,SAAS,2BAA2B,CAClC,KAAc;IAEd,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,uBAAuB;QACnE,OAAO,KAAK,CAAC;IACf,MAAM,eAAe,GAAY,KAAK,CAAC,CAAC,CA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IACD,MAAM,YAAY,GAAG;QACnB,GAAG,MAAM,CAAC,YAAY;QACtB,CAAC,cAAc,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,EACzC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;KAC1C,CAAC;IACF,mBAAmB,CAAC,YAAY,EAAE,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,4PAA4P;AAC5P,MAAM,UAAU,qBAAqB,CACnC,IAA4B,EAC5B,QAAgB,EAChB,eAAuB;IAEvB,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAChD,IAAI,MAAM,EAAE,YAAY,KAAK,SAAS;QAAE,OAAO;IAC/C,MAAM,GAAG,GAAG,cAAc,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IACtD,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CACrC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAC/D,CAAC;IACF,mBAAmB,CAAC,YAAY,EAAE,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;AACjE,CAAC"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -8,8 +8,10 @@ export type { CommsStore } from "./comms-store.js";
|
|
|
8
8
|
export { FileStore, CommsError } from "./store.js";
|
|
9
9
|
export { MeshStore } from "./mesh-store.js";
|
|
10
10
|
export { CommsTool } from "./tool.js";
|
|
11
|
-
export { createBridgeMesh, createBridgeMeshSync } from "./bridge-mesh.js";
|
|
11
|
+
export { createBridgeMesh, createBridgeMeshSync, createBridgeMeshFromIdentity, createBridgeMeshSyncFromIdentity, } from "./bridge-mesh.js";
|
|
12
12
|
export type { BridgeMesh, BridgeMeshSync } from "./bridge-mesh.js";
|
|
13
|
+
export { loadIdentityForFront, probeSlotOwner, releaseIdentityLock, } from "./identity-store.js";
|
|
14
|
+
export type { IdentitySlot } from "./identity-store.js";
|
|
13
15
|
export type { CommsContext, CommsResult } from "./tool.js";
|
|
14
16
|
export { buildAction, formatDeliveryEvent, extractStreamingBehavior, isActionableEvent, ensureRegistered, ensureProjectRoom, drainAndFormat, MCP_TOOL_PARAMS, } from "./bridge.js";
|
|
15
17
|
export type { RegistrationResult } from "./bridge.js";
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,YAAY,CAAC;AAC3B,YAAY,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
export { FileStore, CommsError } from "./store.js";
|
|
8
8
|
export { MeshStore } from "./mesh-store.js";
|
|
9
9
|
export { CommsTool } from "./tool.js";
|
|
10
|
-
export { createBridgeMesh, createBridgeMeshSync } from "./bridge-mesh.js";
|
|
10
|
+
export { createBridgeMesh, createBridgeMeshSync, createBridgeMeshFromIdentity, createBridgeMeshSyncFromIdentity, } from "./bridge-mesh.js";
|
|
11
|
+
export { loadIdentityForFront, probeSlotOwner, releaseIdentityLock, } from "./identity-store.js";
|
|
11
12
|
export { buildAction, formatDeliveryEvent, extractStreamingBehavior, isActionableEvent, ensureRegistered, ensureProjectRoom, drainAndFormat, MCP_TOOL_PARAMS, } from "./bridge.js";
|
|
12
13
|
export { generateVapidKeys } from "./vapid.js";
|
|
13
14
|
export { PushManager } from "./push-manager.js";
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,YAAY,CAAC"}
|