@agimon-ai/doompi-session 0.0.1-alpha.2 → 0.0.1-alpha.21
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/{src/schemas/apiContracts.cjs → apiContracts.cjs} +7 -3
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/{src/schemas/apiContracts.d.mts.map → apiContracts.d.mts.map} +1 -1
- package/dist/{src/schemas/apiContracts.mjs → apiContracts.mjs} +1 -1
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/{src/services/backgroundWorkService/index.cjs → backgroundWorkService-BC0743Nn.cjs} +17 -7
- package/dist/backgroundWorkService-BC0743Nn.cjs.map +1 -0
- package/dist/{src/services/backgroundWorkService/index.mjs → backgroundWorkService-ChVXCzxj.mjs} +3 -3
- package/dist/backgroundWorkService-ChVXCzxj.mjs.map +1 -0
- package/dist/extensions/pi.cjs +12 -6
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.mts +1 -1
- package/dist/extensions/pi.d.mts.map +1 -1
- package/dist/extensions/pi.mjs +9 -3
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/extensions/server.cjs +154 -10
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +1 -1
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +146 -4
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/index.cjs +24 -31
- package/dist/index.d.mts +295 -11
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -9
- package/dist/sessionDelivery-C_2qtUoE.cjs +954 -0
- package/dist/sessionDelivery-C_2qtUoE.cjs.map +1 -0
- package/dist/sessionDelivery-DNq4a8LB.mjs +799 -0
- package/dist/sessionDelivery-DNq4a8LB.mjs.map +1 -0
- package/package.json +16 -16
- package/dist/_virtual/_rolldown/runtime.cjs +0 -23
- package/dist/api-contracts.cjs +0 -7
- package/dist/api-contracts.d.cts +0 -2
- package/dist/api-contracts.d.mts +0 -2
- package/dist/api-contracts.mjs +0 -2
- package/dist/extensions/pi.d.cts +0 -5
- package/dist/extensions/pi.d.cts.map +0 -1
- package/dist/extensions/server.d.cts +0 -5
- package/dist/extensions/server.d.cts.map +0 -1
- package/dist/index.d.cts +0 -11
- package/dist/src/extensions/(backend)/api/session-peer/route.server.cjs +0 -7
- package/dist/src/extensions/(backend)/api/session-peer/route.server.cjs.map +0 -1
- package/dist/src/extensions/(backend)/api/session-peer/route.server.mjs +0 -8
- package/dist/src/extensions/(backend)/api/session-peer/route.server.mjs.map +0 -1
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs +0 -10
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs.map +0 -1
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs +0 -11
- package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs.map +0 -1
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs +0 -101
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs.map +0 -1
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs +0 -99
- package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs.map +0 -1
- package/dist/src/schemas/apiContracts.cjs.map +0 -1
- package/dist/src/schemas/apiContracts.d.cts +0 -52
- package/dist/src/schemas/apiContracts.d.cts.map +0 -1
- package/dist/src/schemas/apiContracts.mjs.map +0 -1
- package/dist/src/services/backgroundWorkService/index.cjs.map +0 -1
- package/dist/src/services/backgroundWorkService/index.d.cts +0 -9
- package/dist/src/services/backgroundWorkService/index.d.cts.map +0 -1
- package/dist/src/services/backgroundWorkService/index.d.mts +0 -9
- package/dist/src/services/backgroundWorkService/index.d.mts.map +0 -1
- package/dist/src/services/backgroundWorkService/index.mjs.map +0 -1
- package/dist/src/services/peerInbox/index.cjs +0 -18
- package/dist/src/services/peerInbox/index.cjs.map +0 -1
- package/dist/src/services/peerInbox/index.mjs +0 -17
- package/dist/src/services/peerInbox/index.mjs.map +0 -1
- package/dist/src/services/peerInboxApi/index.cjs +0 -48
- package/dist/src/services/peerInboxApi/index.cjs.map +0 -1
- package/dist/src/services/peerInboxApi/index.mjs +0 -48
- package/dist/src/services/peerInboxApi/index.mjs.map +0 -1
- package/dist/src/services/peerTransport/index.cjs +0 -206
- package/dist/src/services/peerTransport/index.cjs.map +0 -1
- package/dist/src/services/peerTransport/index.d.cts +0 -49
- package/dist/src/services/peerTransport/index.d.cts.map +0 -1
- package/dist/src/services/peerTransport/index.d.mts +0 -49
- package/dist/src/services/peerTransport/index.d.mts.map +0 -1
- package/dist/src/services/peerTransport/index.mjs +0 -195
- package/dist/src/services/peerTransport/index.mjs.map +0 -1
- package/dist/src/services/sessionDelivery/index.cjs +0 -277
- package/dist/src/services/sessionDelivery/index.cjs.map +0 -1
- package/dist/src/services/sessionDelivery/index.d.cts +0 -10
- package/dist/src/services/sessionDelivery/index.d.cts.map +0 -1
- package/dist/src/services/sessionDelivery/index.d.mts +0 -10
- package/dist/src/services/sessionDelivery/index.d.mts.map +0 -1
- package/dist/src/services/sessionDelivery/index.mjs +0 -274
- package/dist/src/services/sessionDelivery/index.mjs.map +0 -1
- package/dist/src/services/sessionDelivery/type.cjs +0 -11
- package/dist/src/services/sessionDelivery/type.cjs.map +0 -1
- package/dist/src/services/sessionDelivery/type.d.cts +0 -73
- package/dist/src/services/sessionDelivery/type.d.cts.map +0 -1
- package/dist/src/services/sessionDelivery/type.d.mts +0 -73
- package/dist/src/services/sessionDelivery/type.d.mts.map +0 -1
- package/dist/src/services/sessionDelivery/type.mjs +0 -10
- package/dist/src/services/sessionDelivery/type.mjs.map +0 -1
- package/dist/src/services/sessionDirectory/index.cjs +0 -120
- package/dist/src/services/sessionDirectory/index.cjs.map +0 -1
- package/dist/src/services/sessionDirectory/index.d.cts +0 -7
- package/dist/src/services/sessionDirectory/index.d.cts.map +0 -1
- package/dist/src/services/sessionDirectory/index.d.mts +0 -7
- package/dist/src/services/sessionDirectory/index.d.mts.map +0 -1
- package/dist/src/services/sessionDirectory/index.mjs +0 -120
- package/dist/src/services/sessionDirectory/index.mjs.map +0 -1
- package/dist/src/services/sessionDirectory/type.d.cts +0 -54
- package/dist/src/services/sessionDirectory/type.d.cts.map +0 -1
- package/dist/src/services/sessionDirectory/type.d.mts +0 -54
- package/dist/src/services/sessionDirectory/type.d.mts.map +0 -1
- package/dist/src/services/sessionGroups/index.cjs +0 -105
- package/dist/src/services/sessionGroups/index.cjs.map +0 -1
- package/dist/src/services/sessionGroups/index.d.cts +0 -7
- package/dist/src/services/sessionGroups/index.d.cts.map +0 -1
- package/dist/src/services/sessionGroups/index.d.mts +0 -7
- package/dist/src/services/sessionGroups/index.d.mts.map +0 -1
- package/dist/src/services/sessionGroups/index.mjs +0 -104
- package/dist/src/services/sessionGroups/index.mjs.map +0 -1
- package/dist/src/services/sessionGroups/type.cjs +0 -11
- package/dist/src/services/sessionGroups/type.cjs.map +0 -1
- package/dist/src/services/sessionGroups/type.d.cts +0 -32
- package/dist/src/services/sessionGroups/type.d.cts.map +0 -1
- package/dist/src/services/sessionGroups/type.d.mts +0 -32
- package/dist/src/services/sessionGroups/type.d.mts.map +0 -1
- package/dist/src/services/sessionGroups/type.mjs +0 -11
- package/dist/src/services/sessionGroups/type.mjs.map +0 -1
- package/dist/src/services/sessionIntercom/index.cjs +0 -89
- package/dist/src/services/sessionIntercom/index.cjs.map +0 -1
- package/dist/src/services/sessionIntercom/index.d.cts +0 -11
- package/dist/src/services/sessionIntercom/index.d.cts.map +0 -1
- package/dist/src/services/sessionIntercom/index.d.mts +0 -11
- package/dist/src/services/sessionIntercom/index.d.mts.map +0 -1
- package/dist/src/services/sessionIntercom/index.mjs +0 -85
- package/dist/src/services/sessionIntercom/index.mjs.map +0 -1
- package/dist/src/services/sessionIntercom/type.cjs +0 -16
- package/dist/src/services/sessionIntercom/type.cjs.map +0 -1
- package/dist/src/services/sessionIntercom/type.d.cts +0 -60
- package/dist/src/services/sessionIntercom/type.d.cts.map +0 -1
- package/dist/src/services/sessionIntercom/type.d.mts +0 -60
- package/dist/src/services/sessionIntercom/type.d.mts.map +0 -1
- package/dist/src/services/sessionIntercom/type.mjs +0 -14
- package/dist/src/services/sessionIntercom/type.mjs.map +0 -1
- /package/dist/{src/schemas/apiContracts.d.mts → apiContracts.d.mts} +0 -0
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
const require_index = require("../peerTransport/index.cjs");
|
|
2
|
-
//#region src/services/sessionDirectory/index.ts
|
|
3
|
-
const UNKNOWN_FACTS = Object.freeze({
|
|
4
|
-
reachability: "unknown",
|
|
5
|
-
runtime: "unknown",
|
|
6
|
-
activity: "unknown",
|
|
7
|
-
voice: Object.freeze({
|
|
8
|
-
eligible: "unknown",
|
|
9
|
-
readiness: "unknown"
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
function keyOf(observation) {
|
|
13
|
-
return require_index.peerSessionReference(observation.hostId, observation.sessionId);
|
|
14
|
-
}
|
|
15
|
-
function publicEntry(observation, now, label, capabilities) {
|
|
16
|
-
const freshUntil = observation.observedAt + observation.staleAfterMs;
|
|
17
|
-
const fresh = now <= freshUntil;
|
|
18
|
-
const facts = fresh ? observation : UNKNOWN_FACTS;
|
|
19
|
-
return Object.freeze({
|
|
20
|
-
reference: keyOf(observation),
|
|
21
|
-
...label === void 0 ? {} : { label },
|
|
22
|
-
capabilities: Object.freeze([...capabilities]),
|
|
23
|
-
hostIncarnation: observation.hostIncarnation,
|
|
24
|
-
sessionIncarnation: observation.sessionIncarnation,
|
|
25
|
-
sequence: observation.sequence,
|
|
26
|
-
observedAt: observation.observedAt,
|
|
27
|
-
freshUntil,
|
|
28
|
-
fresh,
|
|
29
|
-
reachability: facts.reachability,
|
|
30
|
-
runtime: facts.runtime,
|
|
31
|
-
activity: facts.activity,
|
|
32
|
-
voice: Object.freeze({ ...facts.voice })
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/** In-memory authenticated presence cache. Restart deliberately forgets every observation. */
|
|
36
|
-
function createSessionDirectory(options) {
|
|
37
|
-
const now = options.now ?? Date.now;
|
|
38
|
-
const observations = /* @__PURE__ */ new Map();
|
|
39
|
-
const snapshotRequired = /* @__PURE__ */ new Set();
|
|
40
|
-
const subscribers = /* @__PURE__ */ new Set();
|
|
41
|
-
const discover = (callerReference, allowedReferences) => {
|
|
42
|
-
const result = [];
|
|
43
|
-
for (const observation of observations.values()) {
|
|
44
|
-
const reference = keyOf(observation);
|
|
45
|
-
if (allowedReferences && !allowedReferences.has(reference)) continue;
|
|
46
|
-
const grant = options.authorizeDiscovery(callerReference, observation);
|
|
47
|
-
if (!grant) continue;
|
|
48
|
-
result.push(publicEntry(observation, now(), grant.label ?? observation.label, grant.capabilities));
|
|
49
|
-
}
|
|
50
|
-
return result.sort((left, right) => left.reference.localeCompare(right.reference));
|
|
51
|
-
};
|
|
52
|
-
const notify = () => {
|
|
53
|
-
for (const subscriber of subscribers) subscriber.listener(discover(subscriber.callerReference));
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
observe(observation) {
|
|
57
|
-
const key = keyOf(observation);
|
|
58
|
-
const current = observations.get(key);
|
|
59
|
-
if (snapshotRequired.has(observation.hostId)) return false;
|
|
60
|
-
if (current?.hostIncarnation === observation.hostIncarnation) {
|
|
61
|
-
if (current.sessionIncarnation === observation.sessionIncarnation && observation.sequence <= current.sequence) return false;
|
|
62
|
-
if (observation.sequence !== current.sequence + 1) {
|
|
63
|
-
snapshotRequired.add(observation.hostId);
|
|
64
|
-
for (const [reference, candidate] of observations) if (candidate.hostId === observation.hostId) observations.set(reference, {
|
|
65
|
-
...candidate,
|
|
66
|
-
...UNKNOWN_FACTS,
|
|
67
|
-
observedAt: now(),
|
|
68
|
-
staleAfterMs: 0
|
|
69
|
-
});
|
|
70
|
-
notify();
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
observations.set(key, Object.freeze({
|
|
75
|
-
...observation,
|
|
76
|
-
voice: Object.freeze({ ...observation.voice })
|
|
77
|
-
}));
|
|
78
|
-
notify();
|
|
79
|
-
return true;
|
|
80
|
-
},
|
|
81
|
-
replaceHostSnapshot(hostId, hostIncarnation, replacements) {
|
|
82
|
-
if (replacements.some((observation) => observation.hostId !== hostId || observation.hostIncarnation !== hostIncarnation)) throw new TypeError("A presence snapshot must contain only the declared host incarnation.");
|
|
83
|
-
for (const [reference, observation] of observations) if (observation.hostId === hostId) observations.delete(reference);
|
|
84
|
-
for (const observation of replacements) observations.set(keyOf(observation), Object.freeze({
|
|
85
|
-
...observation,
|
|
86
|
-
voice: Object.freeze({ ...observation.voice })
|
|
87
|
-
}));
|
|
88
|
-
snapshotRequired.delete(hostId);
|
|
89
|
-
notify();
|
|
90
|
-
},
|
|
91
|
-
hostDisconnected(hostId) {
|
|
92
|
-
for (const [reference, observation] of observations) {
|
|
93
|
-
if (observation.hostId !== hostId) continue;
|
|
94
|
-
observations.set(reference, {
|
|
95
|
-
...observation,
|
|
96
|
-
reachability: "unreachable"
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
notify();
|
|
100
|
-
},
|
|
101
|
-
discover,
|
|
102
|
-
resolveDeliveryTarget(callerReference, reference) {
|
|
103
|
-
const observation = observations.get(reference);
|
|
104
|
-
return observation && options.authorizeDiscovery(callerReference, observation) ? observation.deliveryTarget : void 0;
|
|
105
|
-
},
|
|
106
|
-
subscribe(callerReference, listener) {
|
|
107
|
-
const subscriber = {
|
|
108
|
-
callerReference,
|
|
109
|
-
listener
|
|
110
|
-
};
|
|
111
|
-
subscribers.add(subscriber);
|
|
112
|
-
listener(discover(callerReference));
|
|
113
|
-
return () => subscribers.delete(subscriber);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
//#endregion
|
|
118
|
-
exports.createSessionDirectory = createSessionDirectory;
|
|
119
|
-
|
|
120
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["peerSessionReference"],"sources":["../../../../src/services/sessionDirectory/index.ts"],"sourcesContent":["import { peerSessionReference } from '../peerTransport';\nimport type {\n DiscoveredSession,\n SessionDirectory,\n SessionDirectoryOptions,\n SessionPresenceFacts,\n SessionPresenceObservation,\n} from './type';\n\nconst UNKNOWN_FACTS: SessionPresenceFacts = Object.freeze({\n reachability: 'unknown',\n runtime: 'unknown',\n activity: 'unknown',\n voice: Object.freeze({ eligible: 'unknown', readiness: 'unknown' }),\n});\n\nfunction keyOf(observation: Pick<SessionPresenceObservation, 'hostId' | 'sessionId'>): string {\n return peerSessionReference(observation.hostId, observation.sessionId);\n}\n\nfunction publicEntry(\n observation: SessionPresenceObservation,\n now: number,\n label: string | undefined,\n capabilities: readonly string[],\n): DiscoveredSession {\n const freshUntil = observation.observedAt + observation.staleAfterMs;\n const fresh = now <= freshUntil;\n const facts: SessionPresenceFacts = fresh ? observation : UNKNOWN_FACTS;\n return Object.freeze({\n reference: keyOf(observation),\n ...(label === undefined ? {} : { label }),\n capabilities: Object.freeze([...capabilities]),\n hostIncarnation: observation.hostIncarnation,\n sessionIncarnation: observation.sessionIncarnation,\n sequence: observation.sequence,\n observedAt: observation.observedAt,\n freshUntil,\n fresh,\n reachability: facts.reachability,\n runtime: facts.runtime,\n activity: facts.activity,\n voice: Object.freeze({ ...facts.voice }),\n });\n}\n\n/** In-memory authenticated presence cache. Restart deliberately forgets every observation. */\nexport function createSessionDirectory(options: SessionDirectoryOptions): SessionDirectory {\n const now = options.now ?? Date.now;\n const observations = new Map<string, SessionPresenceObservation>();\n const snapshotRequired = new Set<string>();\n const subscribers = new Set<{\n callerReference: string;\n listener: (sessions: readonly DiscoveredSession[]) => void;\n }>();\n\n const discover = (callerReference: string, allowedReferences?: ReadonlySet<string>): readonly DiscoveredSession[] => {\n const result: DiscoveredSession[] = [];\n for (const observation of observations.values()) {\n const reference = keyOf(observation);\n if (allowedReferences && !allowedReferences.has(reference)) continue;\n const grant = options.authorizeDiscovery(callerReference, observation);\n if (!grant) continue;\n result.push(publicEntry(observation, now(), grant.label ?? observation.label, grant.capabilities));\n }\n return result.sort((left, right) => left.reference.localeCompare(right.reference));\n };\n const notify = (): void => {\n for (const subscriber of subscribers) subscriber.listener(discover(subscriber.callerReference));\n };\n\n return {\n observe(observation) {\n const key = keyOf(observation);\n const current = observations.get(key);\n if (snapshotRequired.has(observation.hostId)) return false;\n if (current?.hostIncarnation === observation.hostIncarnation) {\n if (current.sessionIncarnation === observation.sessionIncarnation && observation.sequence <= current.sequence)\n return false;\n if (observation.sequence !== current.sequence + 1) {\n snapshotRequired.add(observation.hostId);\n for (const [reference, candidate] of observations)\n if (candidate.hostId === observation.hostId)\n observations.set(reference, { ...candidate, ...UNKNOWN_FACTS, observedAt: now(), staleAfterMs: 0 });\n notify();\n return false;\n }\n }\n observations.set(key, Object.freeze({ ...observation, voice: Object.freeze({ ...observation.voice }) }));\n notify();\n return true;\n },\n replaceHostSnapshot(hostId, hostIncarnation, replacements) {\n if (\n replacements.some(\n (observation) => observation.hostId !== hostId || observation.hostIncarnation !== hostIncarnation,\n )\n ) {\n throw new TypeError('A presence snapshot must contain only the declared host incarnation.');\n }\n for (const [reference, observation] of observations)\n if (observation.hostId === hostId) observations.delete(reference);\n for (const observation of replacements)\n observations.set(\n keyOf(observation),\n Object.freeze({ ...observation, voice: Object.freeze({ ...observation.voice }) }),\n );\n snapshotRequired.delete(hostId);\n notify();\n },\n hostDisconnected(hostId) {\n for (const [reference, observation] of observations) {\n if (observation.hostId !== hostId) continue;\n observations.set(reference, { ...observation, reachability: 'unreachable' });\n }\n notify();\n },\n discover,\n resolveDeliveryTarget(callerReference, reference) {\n const observation = observations.get(reference);\n return observation && options.authorizeDiscovery(callerReference, observation)\n ? observation.deliveryTarget\n : undefined;\n },\n subscribe(callerReference, listener) {\n const subscriber = { callerReference, listener };\n subscribers.add(subscriber);\n listener(discover(callerReference));\n return () => subscribers.delete(subscriber);\n },\n };\n}\n\nexport type {\n DiscoveredSession,\n SessionActivityState,\n SessionDirectory,\n SessionDirectoryOptions,\n SessionDiscoveryGrant,\n SessionHostReachability,\n SessionPresenceFacts,\n SessionPresenceObservation,\n SessionRuntimeState,\n SessionVoiceReadiness,\n} from './type';\n"],"mappings":";;AASA,MAAM,gBAAsC,OAAO,OAAO;CACxD,cAAc;CACd,SAAS;CACT,UAAU;CACV,OAAO,OAAO,OAAO;EAAE,UAAU;EAAW,WAAW;CAAU,CAAC;AACpE,CAAC;AAED,SAAS,MAAM,aAA+E;CAC5F,OAAOA,cAAAA,qBAAqB,YAAY,QAAQ,YAAY,SAAS;AACvE;AAEA,SAAS,YACP,aACA,KACA,OACA,cACmB;CACnB,MAAM,aAAa,YAAY,aAAa,YAAY;CACxD,MAAM,QAAQ,OAAO;CACrB,MAAM,QAA8B,QAAQ,cAAc;CAC1D,OAAO,OAAO,OAAO;EACnB,WAAW,MAAM,WAAW;EAC5B,GAAI,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM;EACvC,cAAc,OAAO,OAAO,CAAC,GAAG,YAAY,CAAC;EAC7C,iBAAiB,YAAY;EAC7B,oBAAoB,YAAY;EAChC,UAAU,YAAY;EACtB,YAAY,YAAY;EACxB;EACA;EACA,cAAc,MAAM;EACpB,SAAS,MAAM;EACf,UAAU,MAAM;EAChB,OAAO,OAAO,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC;CACzC,CAAC;AACH;;AAGA,SAAgB,uBAAuB,SAAoD;CACzF,MAAM,MAAM,QAAQ,OAAO,KAAK;CAChC,MAAM,+BAAe,IAAI,IAAwC;CACjE,MAAM,mCAAmB,IAAI,IAAY;CACzC,MAAM,8BAAc,IAAI,IAGrB;CAEH,MAAM,YAAY,iBAAyB,sBAA0E;EACnH,MAAM,SAA8B,CAAC;EACrC,KAAK,MAAM,eAAe,aAAa,OAAO,GAAG;GAC/C,MAAM,YAAY,MAAM,WAAW;GACnC,IAAI,qBAAqB,CAAC,kBAAkB,IAAI,SA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O,SAAS;GAClE,KAAK,MAAM,eAAe,cACxB,aAAa,IACX,MAAM,WAAW,GACjB,OAAO,OAAO;IAAE,GAAG;IAAa,OAAO,OAAO,OAAO,EAAE,GAAG,YAAY,MAAM,CAAC;GAAE,CAAC,CAClF;GACF,iBAAiB,OAAO,MAAM;GAC9B,OAAO;EACT;EACA,iBAAiB,QAAQ;GACvB,KAAK,MAAM,CAAC,WAAW,gBAAgB,cAAc;IACnD,IAAI,YAAY,WAAW,QAAQ;IACnC,aAAa,IAAI,WAAW;KAAE,GAAG;KAAa,cAAc;IAAc,CAAC;GAC7E;GACA,OAAO;EACT;EACA;EACA,sBAAsB,iBAAiB,WAAW;GAChD,MAAM,cAAc,aAAa,IAAI,SAAS;GAC9C,OAAO,eAAe,QAAQ,mBAAmB,iBAAiB,WAAW,IACzE,YAAY,iBACZ,KAAA;EACN;EACA,UAAU,iBAAiB,UAAU;GACnC,MAAM,aAAa;IAAE;IAAiB;GAAS;GAC/C,YAAY,IAAI,UAAU;GAC1B,SAAS,SAAS,eAAe,CAAC;GAClC,aAAa,YAAY,OAAO,UAAU;EAC5C;CACF;AACF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DiscoveredSession, SessionActivityState, SessionDirectory, SessionDirectoryOptions, SessionDiscoveryGrant, SessionHostReachability, SessionPresenceFacts, SessionPresenceObservation, SessionRuntimeState, SessionVoiceReadiness } from "./type.cjs";
|
|
2
|
-
//#region src/services/sessionDirectory/index.d.ts
|
|
3
|
-
/** In-memory authenticated presence cache. Restart deliberately forgets every observation. */
|
|
4
|
-
export declare function createSessionDirectory(options: SessionDirectoryOptions): SessionDirectory;
|
|
5
|
-
//#endregion
|
|
6
|
-
export type { DiscoveredSession, SessionActivityState, SessionDirectory, SessionDirectoryOptions, SessionDiscoveryGrant, SessionHostReachability, SessionPresenceFacts, SessionPresenceObservation, SessionRuntimeState, SessionVoiceReadiness };
|
|
7
|
-
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../../../src/services/sessionDirectory/index.ts"],"mappings":";;;wBA+CgB,uBAAuB,SAAS,0BAA0B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DiscoveredSession, SessionActivityState, SessionDirectory, SessionDirectoryOptions, SessionDiscoveryGrant, SessionHostReachability, SessionPresenceFacts, SessionPresenceObservation, SessionRuntimeState, SessionVoiceReadiness } from "./type.mjs";
|
|
2
|
-
//#region src/services/sessionDirectory/index.d.ts
|
|
3
|
-
/** In-memory authenticated presence cache. Restart deliberately forgets every observation. */
|
|
4
|
-
export declare function createSessionDirectory(options: SessionDirectoryOptions): SessionDirectory;
|
|
5
|
-
//#endregion
|
|
6
|
-
export type { DiscoveredSession, SessionActivityState, SessionDirectory, SessionDirectoryOptions, SessionDiscoveryGrant, SessionHostReachability, SessionPresenceFacts, SessionPresenceObservation, SessionRuntimeState, SessionVoiceReadiness };
|
|
7
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/services/sessionDirectory/index.ts"],"mappings":";;;wBA+CgB,uBAAuB,SAAS,0BAA0B"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { peerSessionReference } from "../peerTransport/index.mjs";
|
|
2
|
-
//#region src/services/sessionDirectory/index.ts
|
|
3
|
-
const UNKNOWN_FACTS = Object.freeze({
|
|
4
|
-
reachability: "unknown",
|
|
5
|
-
runtime: "unknown",
|
|
6
|
-
activity: "unknown",
|
|
7
|
-
voice: Object.freeze({
|
|
8
|
-
eligible: "unknown",
|
|
9
|
-
readiness: "unknown"
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
function keyOf(observation) {
|
|
13
|
-
return peerSessionReference(observation.hostId, observation.sessionId);
|
|
14
|
-
}
|
|
15
|
-
function publicEntry(observation, now, label, capabilities) {
|
|
16
|
-
const freshUntil = observation.observedAt + observation.staleAfterMs;
|
|
17
|
-
const fresh = now <= freshUntil;
|
|
18
|
-
const facts = fresh ? observation : UNKNOWN_FACTS;
|
|
19
|
-
return Object.freeze({
|
|
20
|
-
reference: keyOf(observation),
|
|
21
|
-
...label === void 0 ? {} : { label },
|
|
22
|
-
capabilities: Object.freeze([...capabilities]),
|
|
23
|
-
hostIncarnation: observation.hostIncarnation,
|
|
24
|
-
sessionIncarnation: observation.sessionIncarnation,
|
|
25
|
-
sequence: observation.sequence,
|
|
26
|
-
observedAt: observation.observedAt,
|
|
27
|
-
freshUntil,
|
|
28
|
-
fresh,
|
|
29
|
-
reachability: facts.reachability,
|
|
30
|
-
runtime: facts.runtime,
|
|
31
|
-
activity: facts.activity,
|
|
32
|
-
voice: Object.freeze({ ...facts.voice })
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/** In-memory authenticated presence cache. Restart deliberately forgets every observation. */
|
|
36
|
-
function createSessionDirectory(options) {
|
|
37
|
-
const now = options.now ?? Date.now;
|
|
38
|
-
const observations = /* @__PURE__ */ new Map();
|
|
39
|
-
const snapshotRequired = /* @__PURE__ */ new Set();
|
|
40
|
-
const subscribers = /* @__PURE__ */ new Set();
|
|
41
|
-
const discover = (callerReference, allowedReferences) => {
|
|
42
|
-
const result = [];
|
|
43
|
-
for (const observation of observations.values()) {
|
|
44
|
-
const reference = keyOf(observation);
|
|
45
|
-
if (allowedReferences && !allowedReferences.has(reference)) continue;
|
|
46
|
-
const grant = options.authorizeDiscovery(callerReference, observation);
|
|
47
|
-
if (!grant) continue;
|
|
48
|
-
result.push(publicEntry(observation, now(), grant.label ?? observation.label, grant.capabilities));
|
|
49
|
-
}
|
|
50
|
-
return result.sort((left, right) => left.reference.localeCompare(right.reference));
|
|
51
|
-
};
|
|
52
|
-
const notify = () => {
|
|
53
|
-
for (const subscriber of subscribers) subscriber.listener(discover(subscriber.callerReference));
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
observe(observation) {
|
|
57
|
-
const key = keyOf(observation);
|
|
58
|
-
const current = observations.get(key);
|
|
59
|
-
if (snapshotRequired.has(observation.hostId)) return false;
|
|
60
|
-
if (current?.hostIncarnation === observation.hostIncarnation) {
|
|
61
|
-
if (current.sessionIncarnation === observation.sessionIncarnation && observation.sequence <= current.sequence) return false;
|
|
62
|
-
if (observation.sequence !== current.sequence + 1) {
|
|
63
|
-
snapshotRequired.add(observation.hostId);
|
|
64
|
-
for (const [reference, candidate] of observations) if (candidate.hostId === observation.hostId) observations.set(reference, {
|
|
65
|
-
...candidate,
|
|
66
|
-
...UNKNOWN_FACTS,
|
|
67
|
-
observedAt: now(),
|
|
68
|
-
staleAfterMs: 0
|
|
69
|
-
});
|
|
70
|
-
notify();
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
observations.set(key, Object.freeze({
|
|
75
|
-
...observation,
|
|
76
|
-
voice: Object.freeze({ ...observation.voice })
|
|
77
|
-
}));
|
|
78
|
-
notify();
|
|
79
|
-
return true;
|
|
80
|
-
},
|
|
81
|
-
replaceHostSnapshot(hostId, hostIncarnation, replacements) {
|
|
82
|
-
if (replacements.some((observation) => observation.hostId !== hostId || observation.hostIncarnation !== hostIncarnation)) throw new TypeError("A presence snapshot must contain only the declared host incarnation.");
|
|
83
|
-
for (const [reference, observation] of observations) if (observation.hostId === hostId) observations.delete(reference);
|
|
84
|
-
for (const observation of replacements) observations.set(keyOf(observation), Object.freeze({
|
|
85
|
-
...observation,
|
|
86
|
-
voice: Object.freeze({ ...observation.voice })
|
|
87
|
-
}));
|
|
88
|
-
snapshotRequired.delete(hostId);
|
|
89
|
-
notify();
|
|
90
|
-
},
|
|
91
|
-
hostDisconnected(hostId) {
|
|
92
|
-
for (const [reference, observation] of observations) {
|
|
93
|
-
if (observation.hostId !== hostId) continue;
|
|
94
|
-
observations.set(reference, {
|
|
95
|
-
...observation,
|
|
96
|
-
reachability: "unreachable"
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
notify();
|
|
100
|
-
},
|
|
101
|
-
discover,
|
|
102
|
-
resolveDeliveryTarget(callerReference, reference) {
|
|
103
|
-
const observation = observations.get(reference);
|
|
104
|
-
return observation && options.authorizeDiscovery(callerReference, observation) ? observation.deliveryTarget : void 0;
|
|
105
|
-
},
|
|
106
|
-
subscribe(callerReference, listener) {
|
|
107
|
-
const subscriber = {
|
|
108
|
-
callerReference,
|
|
109
|
-
listener
|
|
110
|
-
};
|
|
111
|
-
subscribers.add(subscriber);
|
|
112
|
-
listener(discover(callerReference));
|
|
113
|
-
return () => subscribers.delete(subscriber);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
//#endregion
|
|
118
|
-
export { createSessionDirectory };
|
|
119
|
-
|
|
120
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/services/sessionDirectory/index.ts"],"sourcesContent":["import { peerSessionReference } from '../peerTransport';\nimport type {\n DiscoveredSession,\n SessionDirectory,\n SessionDirectoryOptions,\n SessionPresenceFacts,\n SessionPresenceObservation,\n} from './type';\n\nconst UNKNOWN_FACTS: SessionPresenceFacts = Object.freeze({\n reachability: 'unknown',\n runtime: 'unknown',\n activity: 'unknown',\n voice: Object.freeze({ eligible: 'unknown', readiness: 'unknown' }),\n});\n\nfunction keyOf(observation: Pick<SessionPresenceObservation, 'hostId' | 'sessionId'>): string {\n return peerSessionReference(observation.hostId, observation.sessionId);\n}\n\nfunction publicEntry(\n observation: SessionPresenceObservation,\n now: number,\n label: string | undefined,\n capabilities: readonly string[],\n): DiscoveredSession {\n const freshUntil = observation.observedAt + observation.staleAfterMs;\n const fresh = now <= freshUntil;\n const facts: SessionPresenceFacts = fresh ? observation : UNKNOWN_FACTS;\n return Object.freeze({\n reference: keyOf(observation),\n ...(label === undefined ? {} : { label }),\n capabilities: Object.freeze([...capabilities]),\n hostIncarnation: observation.hostIncarnation,\n sessionIncarnation: observation.sessionIncarnation,\n sequence: observation.sequence,\n observedAt: observation.observedAt,\n freshUntil,\n fresh,\n reachability: facts.reachability,\n runtime: facts.runtime,\n activity: facts.activity,\n voice: Object.freeze({ ...facts.voice }),\n });\n}\n\n/** In-memory authenticated presence cache. Restart deliberately forgets every observation. */\nexport function createSessionDirectory(options: SessionDirectoryOptions): SessionDirectory {\n const now = options.now ?? Date.now;\n const observations = new Map<string, SessionPresenceObservation>();\n const snapshotRequired = new Set<string>();\n const subscribers = new Set<{\n callerReference: string;\n listener: (sessions: readonly DiscoveredSession[]) => void;\n }>();\n\n const discover = (callerReference: string, allowedReferences?: ReadonlySet<string>): readonly DiscoveredSession[] => {\n const result: DiscoveredSession[] = [];\n for (const observation of observations.values()) {\n const reference = keyOf(observation);\n if (allowedReferences && !allowedReferences.has(reference)) continue;\n const grant = options.authorizeDiscovery(callerReference, observation);\n if (!grant) continue;\n result.push(publicEntry(observation, now(), grant.label ?? observation.label, grant.capabilities));\n }\n return result.sort((left, right) => left.reference.localeCompare(right.reference));\n };\n const notify = (): void => {\n for (const subscriber of subscribers) subscriber.listener(discover(subscriber.callerReference));\n };\n\n return {\n observe(observation) {\n const key = keyOf(observation);\n const current = observations.get(key);\n if (snapshotRequired.has(observation.hostId)) return false;\n if (current?.hostIncarnation === observation.hostIncarnation) {\n if (current.sessionIncarnation === observation.sessionIncarnation && observation.sequence <= current.sequence)\n return false;\n if (observation.sequence !== current.sequence + 1) {\n snapshotRequired.add(observation.hostId);\n for (const [reference, candidate] of observations)\n if (candidate.hostId === observation.hostId)\n observations.set(reference, { ...candidate, ...UNKNOWN_FACTS, observedAt: now(), staleAfterMs: 0 });\n notify();\n return false;\n }\n }\n observations.set(key, Object.freeze({ ...observation, voice: Object.freeze({ ...observation.voice }) }));\n notify();\n return true;\n },\n replaceHostSnapshot(hostId, hostIncarnation, replacements) {\n if (\n replacements.some(\n (observation) => observation.hostId !== hostId || observation.hostIncarnation !== hostIncarnation,\n )\n ) {\n throw new TypeError('A presence snapshot must contain only the declared host incarnation.');\n }\n for (const [reference, observation] of observations)\n if (observation.hostId === hostId) observations.delete(reference);\n for (const observation of replacements)\n observations.set(\n keyOf(observation),\n Object.freeze({ ...observation, voice: Object.freeze({ ...observation.voice }) }),\n );\n snapshotRequired.delete(hostId);\n notify();\n },\n hostDisconnected(hostId) {\n for (const [reference, observation] of observations) {\n if (observation.hostId !== hostId) continue;\n observations.set(reference, { ...observation, reachability: 'unreachable' });\n }\n notify();\n },\n discover,\n resolveDeliveryTarget(callerReference, reference) {\n const observation = observations.get(reference);\n return observation && options.authorizeDiscovery(callerReference, observation)\n ? observation.deliveryTarget\n : undefined;\n },\n subscribe(callerReference, listener) {\n const subscriber = { callerReference, listener };\n subscribers.add(subscriber);\n listener(discover(callerReference));\n return () => subscribers.delete(subscriber);\n },\n };\n}\n\nexport type {\n DiscoveredSession,\n SessionActivityState,\n SessionDirectory,\n SessionDirectoryOptions,\n SessionDiscoveryGrant,\n SessionHostReachability,\n SessionPresenceFacts,\n SessionPresenceObservation,\n SessionRuntimeState,\n SessionVoiceReadiness,\n} from './type';\n"],"mappings":";;AASA,MAAM,gBAAsC,OAAO,OAAO;CACxD,cAAc;CACd,SAAS;CACT,UAAU;CACV,OAAO,OAAO,OAAO;EAAE,UAAU;EAAW,WAAW;CAAU,CAAC;AACpE,CAAC;AAED,SAAS,MAAM,aAA+E;CAC5F,OAAO,qBAAqB,YAAY,QAAQ,YAAY,SAAS;AACvE;AAEA,SAAS,YACP,aACA,KACA,OACA,cACmB;CACnB,MAAM,aAAa,YAAY,aAAa,YAAY;CACxD,MAAM,QAAQ,OAAO;CACrB,MAAM,QAA8B,QAAQ,cAAc;CAC1D,OAAO,OAAO,OAAO;EACnB,WAAW,MAAM,WAAW;EAC5B,GAAI,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM;EACvC,cAAc,OAAO,OAAO,CAAC,GAAG,YAAY,CAAC;EAC7C,iBAAiB,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F;AACF"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//#region src/services/sessionDirectory/type.d.ts
|
|
2
|
-
export type SessionHostReachability = 'reachable' | 'unreachable' | 'unknown';
|
|
3
|
-
export type SessionRuntimeState = 'starting' | 'ready' | 'dormant' | 'closing' | 'closed' | 'unknown';
|
|
4
|
-
export type SessionActivityState = 'busy' | 'awaiting_input' | 'fully_idle' | 'unknown';
|
|
5
|
-
export type SessionVoiceReadiness = 'ready' | 'not_ready' | 'unknown';
|
|
6
|
-
export interface SessionPresenceFacts {
|
|
7
|
-
readonly reachability: SessionHostReachability;
|
|
8
|
-
readonly runtime: SessionRuntimeState;
|
|
9
|
-
readonly activity: SessionActivityState;
|
|
10
|
-
readonly voice: {
|
|
11
|
-
readonly eligible: boolean | 'unknown';
|
|
12
|
-
readonly readiness: SessionVoiceReadiness;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface SessionPresenceObservation extends SessionPresenceFacts {
|
|
16
|
-
readonly hostId: string;
|
|
17
|
-
readonly sessionId: string;
|
|
18
|
-
readonly hostIncarnation: string;
|
|
19
|
-
readonly sessionIncarnation: string;
|
|
20
|
-
readonly sequence: number;
|
|
21
|
-
readonly observedAt: number;
|
|
22
|
-
readonly staleAfterMs: number;
|
|
23
|
-
readonly label?: string;
|
|
24
|
-
readonly deliveryTarget: string;
|
|
25
|
-
}
|
|
26
|
-
export interface SessionDiscoveryGrant {
|
|
27
|
-
readonly label?: string;
|
|
28
|
-
readonly capabilities: readonly string[];
|
|
29
|
-
}
|
|
30
|
-
export interface DiscoveredSession extends SessionPresenceFacts {
|
|
31
|
-
readonly reference: string;
|
|
32
|
-
readonly label?: string;
|
|
33
|
-
readonly capabilities: readonly string[];
|
|
34
|
-
readonly hostIncarnation: string;
|
|
35
|
-
readonly sessionIncarnation: string;
|
|
36
|
-
readonly sequence: number;
|
|
37
|
-
readonly observedAt: number;
|
|
38
|
-
readonly freshUntil: number;
|
|
39
|
-
readonly fresh: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface SessionDirectoryOptions {
|
|
42
|
-
readonly now?: () => number;
|
|
43
|
-
readonly authorizeDiscovery: (callerReference: string, subject: Readonly<Pick<SessionPresenceObservation, 'hostId' | 'sessionId' | 'label'>>) => SessionDiscoveryGrant | undefined;
|
|
44
|
-
}
|
|
45
|
-
export interface SessionDirectory {
|
|
46
|
-
observe(observation: SessionPresenceObservation): boolean;
|
|
47
|
-
replaceHostSnapshot(hostId: string, hostIncarnation: string, observations: readonly SessionPresenceObservation[]): void;
|
|
48
|
-
hostDisconnected(hostId: string): void;
|
|
49
|
-
discover(callerReference: string, allowedReferences?: ReadonlySet<string>): readonly DiscoveredSession[];
|
|
50
|
-
resolveDeliveryTarget(callerReference: string, reference: string): string | undefined;
|
|
51
|
-
subscribe(callerReference: string, listener: (sessions: readonly DiscoveredSession[]) => void): () => void;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//# sourceMappingURL=type.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.cts","names":[],"sources":["../../../../src/services/sessionDirectory/type.ts"],"mappings":";YAAY;YACA;YACA;YACA;iBAEK;WACN,cAAc;WACd,SAAS;WACT,UAAU;WACV;aACE;aACA,WAAW;;;iBAIP,mCAAmC;WACzC;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;iBAGM;WACN;WACA;;iBAGM,0BAA0B;WAChC;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;iBAGM;WACN;WACA,qBACP,yBACA,SAAS,SAAS,KAAK,mEACpB;;iBAGU;EACf,QAAQ,aAAa;EACrB,oBACE,gBACA,yBACA,uBAAuB;EAEzB,iBAAiB;EACjB,SAAS,yBAAyB,oBAAoB,+BAA+B;EACrF,sBAAsB,yBAAyB;EAC/C,UAAU,yBAAyB,WAAW,mBAAmB"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//#region src/services/sessionDirectory/type.d.ts
|
|
2
|
-
export type SessionHostReachability = 'reachable' | 'unreachable' | 'unknown';
|
|
3
|
-
export type SessionRuntimeState = 'starting' | 'ready' | 'dormant' | 'closing' | 'closed' | 'unknown';
|
|
4
|
-
export type SessionActivityState = 'busy' | 'awaiting_input' | 'fully_idle' | 'unknown';
|
|
5
|
-
export type SessionVoiceReadiness = 'ready' | 'not_ready' | 'unknown';
|
|
6
|
-
export interface SessionPresenceFacts {
|
|
7
|
-
readonly reachability: SessionHostReachability;
|
|
8
|
-
readonly runtime: SessionRuntimeState;
|
|
9
|
-
readonly activity: SessionActivityState;
|
|
10
|
-
readonly voice: {
|
|
11
|
-
readonly eligible: boolean | 'unknown';
|
|
12
|
-
readonly readiness: SessionVoiceReadiness;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface SessionPresenceObservation extends SessionPresenceFacts {
|
|
16
|
-
readonly hostId: string;
|
|
17
|
-
readonly sessionId: string;
|
|
18
|
-
readonly hostIncarnation: string;
|
|
19
|
-
readonly sessionIncarnation: string;
|
|
20
|
-
readonly sequence: number;
|
|
21
|
-
readonly observedAt: number;
|
|
22
|
-
readonly staleAfterMs: number;
|
|
23
|
-
readonly label?: string;
|
|
24
|
-
readonly deliveryTarget: string;
|
|
25
|
-
}
|
|
26
|
-
export interface SessionDiscoveryGrant {
|
|
27
|
-
readonly label?: string;
|
|
28
|
-
readonly capabilities: readonly string[];
|
|
29
|
-
}
|
|
30
|
-
export interface DiscoveredSession extends SessionPresenceFacts {
|
|
31
|
-
readonly reference: string;
|
|
32
|
-
readonly label?: string;
|
|
33
|
-
readonly capabilities: readonly string[];
|
|
34
|
-
readonly hostIncarnation: string;
|
|
35
|
-
readonly sessionIncarnation: string;
|
|
36
|
-
readonly sequence: number;
|
|
37
|
-
readonly observedAt: number;
|
|
38
|
-
readonly freshUntil: number;
|
|
39
|
-
readonly fresh: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface SessionDirectoryOptions {
|
|
42
|
-
readonly now?: () => number;
|
|
43
|
-
readonly authorizeDiscovery: (callerReference: string, subject: Readonly<Pick<SessionPresenceObservation, 'hostId' | 'sessionId' | 'label'>>) => SessionDiscoveryGrant | undefined;
|
|
44
|
-
}
|
|
45
|
-
export interface SessionDirectory {
|
|
46
|
-
observe(observation: SessionPresenceObservation): boolean;
|
|
47
|
-
replaceHostSnapshot(hostId: string, hostIncarnation: string, observations: readonly SessionPresenceObservation[]): void;
|
|
48
|
-
hostDisconnected(hostId: string): void;
|
|
49
|
-
discover(callerReference: string, allowedReferences?: ReadonlySet<string>): readonly DiscoveredSession[];
|
|
50
|
-
resolveDeliveryTarget(callerReference: string, reference: string): string | undefined;
|
|
51
|
-
subscribe(callerReference: string, listener: (sessions: readonly DiscoveredSession[]) => void): () => void;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//# sourceMappingURL=type.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.mts","names":[],"sources":["../../../../src/services/sessionDirectory/type.ts"],"mappings":";YAAY;YACA;YACA;YACA;iBAEK;WACN,cAAc;WACd,SAAS;WACT,UAAU;WACV;aACE;aACA,WAAW;;;iBAIP,mCAAmC;WACzC;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;iBAGM;WACN;WACA;;iBAGM,0BAA0B;WAChC;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;iBAGM;WACN;WACA,qBACP,yBACA,SAAS,SAAS,KAAK,mEACpB;;iBAGU;EACf,QAAQ,aAAa;EACrB,oBACE,gBACA,yBACA,uBAAuB;EAEzB,iBAAiB;EACjB,SAAS,yBAAyB,oBAAoB,+BAA+B;EACrF,sBAAsB,yBAAyB;EAC/C,UAAU,yBAAyB,WAAW,mBAAmB"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
const require_type = require("./type.cjs");
|
|
2
|
-
let node_sqlite = require("node:sqlite");
|
|
3
|
-
//#region src/services/sessionGroups/index.ts
|
|
4
|
-
const ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
|
|
5
|
-
const REFERENCE_PATTERN = /^peer\/[A-Za-z0-9][A-Za-z0-9._-]{0,127}\/[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
|
|
6
|
-
function validateGroupId(value) {
|
|
7
|
-
if (!ID_PATTERN.test(value)) throw new TypeError("Session group IDs must be safe opaque IDs.");
|
|
8
|
-
}
|
|
9
|
-
function validateReference(value) {
|
|
10
|
-
if (!REFERENCE_PATTERN.test(value)) throw new TypeError(`Session group member '${value}' is not a qualified reference.`);
|
|
11
|
-
}
|
|
12
|
-
/** Opens a revisioned SQLite registry for communication-only group membership. */
|
|
13
|
-
function createSessionGroupStore(options) {
|
|
14
|
-
const database = new node_sqlite.DatabaseSync(options.databasePath);
|
|
15
|
-
database.exec(`
|
|
16
|
-
PRAGMA journal_mode = WAL;
|
|
17
|
-
PRAGMA foreign_keys = ON;
|
|
18
|
-
CREATE TABLE IF NOT EXISTS session_groups (
|
|
19
|
-
group_id TEXT PRIMARY KEY,
|
|
20
|
-
owner_authority TEXT NOT NULL,
|
|
21
|
-
revision INTEGER NOT NULL
|
|
22
|
-
);
|
|
23
|
-
CREATE TABLE IF NOT EXISTS session_group_members (
|
|
24
|
-
group_id TEXT NOT NULL REFERENCES session_groups(group_id) ON DELETE CASCADE,
|
|
25
|
-
member_reference TEXT NOT NULL,
|
|
26
|
-
PRIMARY KEY (group_id, member_reference)
|
|
27
|
-
);
|
|
28
|
-
`);
|
|
29
|
-
const read = (groupId) => {
|
|
30
|
-
const row = database.prepare("SELECT * FROM session_groups WHERE group_id = ?").get(groupId);
|
|
31
|
-
if (!row) return void 0;
|
|
32
|
-
const members = database.prepare("SELECT member_reference FROM session_group_members WHERE group_id = ? ORDER BY member_reference").all(groupId);
|
|
33
|
-
return Object.freeze({
|
|
34
|
-
id: row.group_id,
|
|
35
|
-
ownerAuthority: row.owner_authority,
|
|
36
|
-
revision: row.revision,
|
|
37
|
-
members: Object.freeze(members.map((member) => member.member_reference))
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
const enroll = (groupId, members) => {
|
|
41
|
-
const insert = database.prepare("INSERT OR IGNORE INTO session_group_members (group_id, member_reference) VALUES (?, ?)");
|
|
42
|
-
for (const member of new Set(members)) {
|
|
43
|
-
validateReference(member);
|
|
44
|
-
if (options.validateEnrollment?.(groupId, member) === false) throw new Error(`Session group enrollment policy rejected '${member}'.`);
|
|
45
|
-
insert.run(groupId, member);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return {
|
|
49
|
-
create(groupId, ownerAuthority, members) {
|
|
50
|
-
validateGroupId(groupId);
|
|
51
|
-
if (!ownerAuthority.trim()) throw new TypeError("Session group owner authority is required.");
|
|
52
|
-
database.exec("BEGIN IMMEDIATE");
|
|
53
|
-
try {
|
|
54
|
-
database.prepare("INSERT INTO session_groups (group_id, owner_authority, revision) VALUES (?, ?, 1)").run(groupId, ownerAuthority);
|
|
55
|
-
enroll(groupId, members);
|
|
56
|
-
database.exec("COMMIT");
|
|
57
|
-
} catch (cause) {
|
|
58
|
-
database.exec("ROLLBACK");
|
|
59
|
-
throw cause;
|
|
60
|
-
}
|
|
61
|
-
return read(groupId);
|
|
62
|
-
},
|
|
63
|
-
mutate(mutation) {
|
|
64
|
-
database.exec("BEGIN IMMEDIATE");
|
|
65
|
-
try {
|
|
66
|
-
const current = read(mutation.groupId);
|
|
67
|
-
if (!current) throw new Error(`Session group '${mutation.groupId}' does not exist.`);
|
|
68
|
-
if (mutation.authority !== current.ownerAuthority && options.authorizeManagement?.(mutation.authority, current) !== true) throw new Error(`Authority '${mutation.authority}' cannot manage Session group '${mutation.groupId}'.`);
|
|
69
|
-
if (mutation.expectedRevision !== current.revision) throw new require_type.SessionGroupRevisionError(mutation.groupId, mutation.expectedRevision, current.revision);
|
|
70
|
-
enroll(mutation.groupId, mutation.add ?? []);
|
|
71
|
-
const remove = database.prepare("DELETE FROM session_group_members WHERE group_id = ? AND member_reference = ?");
|
|
72
|
-
for (const member of new Set(mutation.remove ?? [])) {
|
|
73
|
-
validateReference(member);
|
|
74
|
-
remove.run(mutation.groupId, member);
|
|
75
|
-
}
|
|
76
|
-
database.prepare("UPDATE session_groups SET revision = revision + 1 WHERE group_id = ? AND revision = ?").run(mutation.groupId, current.revision);
|
|
77
|
-
database.exec("COMMIT");
|
|
78
|
-
} catch (cause) {
|
|
79
|
-
database.exec("ROLLBACK");
|
|
80
|
-
throw cause;
|
|
81
|
-
}
|
|
82
|
-
return read(mutation.groupId);
|
|
83
|
-
},
|
|
84
|
-
get: read,
|
|
85
|
-
groupsFor(memberReference) {
|
|
86
|
-
validateReference(memberReference);
|
|
87
|
-
return database.prepare(`SELECT g.group_id FROM session_groups g
|
|
88
|
-
INNER JOIN session_group_members m ON m.group_id = g.group_id
|
|
89
|
-
WHERE m.member_reference = ? ORDER BY g.group_id`).all(memberReference).map((row) => read(row.group_id));
|
|
90
|
-
},
|
|
91
|
-
canMessage(groupId, sourceReference, targetReference) {
|
|
92
|
-
validateReference(sourceReference);
|
|
93
|
-
validateReference(targetReference);
|
|
94
|
-
const row = database.prepare(`SELECT COUNT(*) AS count FROM session_group_members
|
|
95
|
-
WHERE group_id = ? AND member_reference IN (?, ?)`).get(groupId, sourceReference, targetReference);
|
|
96
|
-
return Number(row.count) === (sourceReference === targetReference ? 1 : 2);
|
|
97
|
-
},
|
|
98
|
-
close: () => database.close()
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
exports.SessionGroupRevisionError = require_type.SessionGroupRevisionError;
|
|
103
|
-
exports.createSessionGroupStore = createSessionGroupStore;
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DatabaseSync","SessionGroupRevisionError"],"sources":["../../../../src/services/sessionGroups/index.ts"],"sourcesContent":["import { DatabaseSync } from 'node:sqlite';\n\nimport {\n SessionGroupRevisionError,\n type SessionCommunicationGroup,\n type SessionGroupMutation,\n type SessionGroupStore,\n type SessionGroupStoreOptions,\n} from './type';\n\ninterface GroupRow {\n group_id: string;\n owner_authority: string;\n revision: number;\n}\n\nconst ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;\nconst REFERENCE_PATTERN = /^peer\\/[A-Za-z0-9][A-Za-z0-9._-]{0,127}\\/[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;\n\nfunction validateGroupId(value: string): void {\n if (!ID_PATTERN.test(value)) throw new TypeError('Session group IDs must be safe opaque IDs.');\n}\n\nfunction validateReference(value: string): void {\n if (!REFERENCE_PATTERN.test(value))\n throw new TypeError(`Session group member '${value}' is not a qualified reference.`);\n}\n\n/** Opens a revisioned SQLite registry for communication-only group membership. */\nexport function createSessionGroupStore(options: SessionGroupStoreOptions): SessionGroupStore {\n const database = new DatabaseSync(options.databasePath);\n database.exec(`\n PRAGMA journal_mode = WAL;\n PRAGMA foreign_keys = ON;\n CREATE TABLE IF NOT EXISTS session_groups (\n group_id TEXT PRIMARY KEY,\n owner_authority TEXT NOT NULL,\n revision INTEGER NOT NULL\n );\n CREATE TABLE IF NOT EXISTS session_group_members (\n group_id TEXT NOT NULL REFERENCES session_groups(group_id) ON DELETE CASCADE,\n member_reference TEXT NOT NULL,\n PRIMARY KEY (group_id, member_reference)\n );\n `);\n\n const read = (groupId: string): SessionCommunicationGroup | undefined => {\n const row = database.prepare('SELECT * FROM session_groups WHERE group_id = ?').get(groupId) as\n | GroupRow\n | undefined;\n if (!row) return undefined;\n const members = database\n .prepare('SELECT member_reference FROM session_group_members WHERE group_id = ? ORDER BY member_reference')\n .all(groupId) as { member_reference: string }[];\n return Object.freeze({\n id: row.group_id,\n ownerAuthority: row.owner_authority,\n revision: row.revision,\n members: Object.freeze(members.map((member) => member.member_reference)),\n });\n };\n\n const enroll = (groupId: string, members: readonly string[]): void => {\n const insert = database.prepare(\n 'INSERT OR IGNORE INTO session_group_members (group_id, member_reference) VALUES (?, ?)',\n );\n for (const member of new Set(members)) {\n validateReference(member);\n if (options.validateEnrollment?.(groupId, member) === false)\n throw new Error(`Session group enrollment policy rejected '${member}'.`);\n insert.run(groupId, member);\n }\n };\n\n return {\n create(groupId, ownerAuthority, members) {\n validateGroupId(groupId);\n if (!ownerAuthority.trim()) throw new TypeError('Session group owner authority is required.');\n database.exec('BEGIN IMMEDIATE');\n try {\n database\n .prepare('INSERT INTO session_groups (group_id, owner_authority, revision) VALUES (?, ?, 1)')\n .run(groupId, ownerAuthority);\n enroll(groupId, members);\n database.exec('COMMIT');\n } catch (cause) {\n database.exec('ROLLBACK');\n throw cause;\n }\n return read(groupId)!;\n },\n mutate(mutation: SessionGroupMutation) {\n database.exec('BEGIN IMMEDIATE');\n try {\n const current = read(mutation.groupId);\n if (!current) throw new Error(`Session group '${mutation.groupId}' does not exist.`);\n if (\n mutation.authority !== current.ownerAuthority &&\n options.authorizeManagement?.(mutation.authority, current) !== true\n ) {\n throw new Error(`Authority '${mutation.authority}' cannot manage Session group '${mutation.groupId}'.`);\n }\n if (mutation.expectedRevision !== current.revision)\n throw new SessionGroupRevisionError(mutation.groupId, mutation.expectedRevision, current.revision);\n enroll(mutation.groupId, mutation.add ?? []);\n const remove = database.prepare(\n 'DELETE FROM session_group_members WHERE group_id = ? AND member_reference = ?',\n );\n for (const member of new Set(mutation.remove ?? [])) {\n validateReference(member);\n remove.run(mutation.groupId, member);\n }\n database\n .prepare('UPDATE session_groups SET revision = revision + 1 WHERE group_id = ? AND revision = ?')\n .run(mutation.groupId, current.revision);\n database.exec('COMMIT');\n } catch (cause) {\n database.exec('ROLLBACK');\n throw cause;\n }\n return read(mutation.groupId)!;\n },\n get: read,\n groupsFor(memberReference) {\n validateReference(memberReference);\n const rows = database\n .prepare(\n `SELECT g.group_id FROM session_groups g\n INNER JOIN session_group_members m ON m.group_id = g.group_id\n WHERE m.member_reference = ? ORDER BY g.group_id`,\n )\n .all(memberReference) as { group_id: string }[];\n return rows.map((row) => read(row.group_id)!);\n },\n canMessage(groupId, sourceReference, targetReference) {\n validateReference(sourceReference);\n validateReference(targetReference);\n const row = database\n .prepare(\n `SELECT COUNT(*) AS count FROM session_group_members\n WHERE group_id = ? AND member_reference IN (?, ?)`,\n )\n .get(groupId, sourceReference, targetReference) as { count: number | bigint };\n return Number(row.count) === (sourceReference === targetReference ? 1 : 2);\n },\n close: () => database.close(),\n };\n}\n\nexport {\n SessionGroupRevisionError,\n type SessionCommunicationGroup,\n type SessionGroupMutation,\n type SessionGroupStore,\n type SessionGroupStoreOptions,\n} from './type';\n"],"mappings":";;;AAgBA,MAAM,aAAa;AACnB,MAAM,oBAAoB;AAE1B,SAAS,gBAAgB,OAAqB;CAC5C,IAAI,CAAC,WAAW,KAAK,KAAK,GAAG,MAAM,IAAI,UAAU,4CAA4C;AAC/F;AAEA,SAAS,kBAAkB,OAAqB;CAC9C,IAAI,CAAC,kBAAkB,KAAK,KAAK,GAC/B,MAAM,IAAI,UAAU,yBAAyB,MAAM,gCAAgC;AACvF;;AAGA,SAAgB,wBAAwB,SAAsD;CAC5F,MAAM,WAAW,IAAIA,YAAAA,aAAa,QAAQ,YAAY;CACtD,SAAS,KAAK;;;;;;;;;;;;;GAab;CAED,MAAM,QAAQ,YAA2D;EACvE,MAAM,MAAM,SAAS,QAAQ,iDAAiD,CAAC,CAAC,IAAI,OAAO;EAG3F,IAAI,CAAC,KAAK,OAAO,KAAA;EACjB,MAAM,UAAU,SACb,QAAQ,iGAAiG,CAAC,CAC1G,IAAI,OAAO;EACd,OAAO,OAAO,OAAO;GACnB,IAAI,IAAI;GACR,gBAAgB,IAAI;GACpB,UAAU,IAAI;GACd,SAAS,OAAO,OAAO,QAAQ,KAAK,WAAW,OAAO,gBAAgB,CAAC;EACzE,CAAC;CACH;CAEA,MAAM,UAAU,SAAiB,YAAqC;EACpE,MAAM,SAAS,SAAS,QACtB,wFACF;EACA,KAAK,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AS,SAAS,QAAQ,QAAQ;IACzC,SAAS,KAAK,QAAQ;GACxB,SAAS,OAAO;IACd,SAAS,KAAK,UAAU;IACxB,MAAM;GACR;GACA,OAAO,KAAK,SAAS,OAAO;EAC9B;EACA,KAAK;EACL,UAAU,iBAAiB;GACzB,kBAAkB,eAAe;GAQjC,OAPa,SACV,QACC;;4DAGF,CAAC,CACA,IAAI,eACG,CAAC,CAAC,KAAK,QAAQ,KAAK,IAAI,QAAQ,CAAE;EAC9C;EACA,WAAW,SAAS,iBAAiB,iBAAiB;GACpD,kBAAkB,eAAe;GACjC,kBAAkB,eAAe;GACjC,MAAM,MAAM,SACT,QACC;6DAEF,CAAC,CACA,IAAI,SAAS,iBAAiB,eAAe;GAChD,OAAO,OAAO,IAAI,KAAK,OAAO,oBAAoB,kBAAkB,IAAI;EAC1E;EACA,aAAa,SAAS,MAAM;CAC9B;AACF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SessionCommunicationGroup, SessionGroupMutation, SessionGroupRevisionError, SessionGroupStore, SessionGroupStoreOptions } from "./type.cjs";
|
|
2
|
-
//#region src/services/sessionGroups/index.d.ts
|
|
3
|
-
/** Opens a revisioned SQLite registry for communication-only group membership. */
|
|
4
|
-
export declare function createSessionGroupStore(options: SessionGroupStoreOptions): SessionGroupStore;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { type SessionCommunicationGroup, type SessionGroupMutation, SessionGroupRevisionError, type SessionGroupStore, type SessionGroupStoreOptions };
|
|
7
|
-
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../../../src/services/sessionGroups/index.ts"],"mappings":";;;wBA6BgB,wBAAwB,SAAS,2BAA2B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SessionCommunicationGroup, SessionGroupMutation, SessionGroupRevisionError, SessionGroupStore, SessionGroupStoreOptions } from "./type.mjs";
|
|
2
|
-
//#region src/services/sessionGroups/index.d.ts
|
|
3
|
-
/** Opens a revisioned SQLite registry for communication-only group membership. */
|
|
4
|
-
export declare function createSessionGroupStore(options: SessionGroupStoreOptions): SessionGroupStore;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { type SessionCommunicationGroup, type SessionGroupMutation, SessionGroupRevisionError, type SessionGroupStore, type SessionGroupStoreOptions };
|
|
7
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/services/sessionGroups/index.ts"],"mappings":";;;wBA6BgB,wBAAwB,SAAS,2BAA2B"}
|