@adhdev/mesh-shared 1.0.58-rc.30 → 1.0.58-rc.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/dist/ws-protocol.d.ts +17 -2
- package/package.json +1 -1
- package/src/ws-protocol.ts +19 -2
package/dist/ws-protocol.d.ts
CHANGED
|
@@ -18,9 +18,24 @@
|
|
|
18
18
|
* or matches.
|
|
19
19
|
*/
|
|
20
20
|
/** Messages the daemon sends UP to the Workers server over the WS bridge. */
|
|
21
|
-
export type DaemonToServerWsMsg = 'auth' | 'status_report' | 'status_heartbeat' | 'status_event' | 'command_result' | 'error' | 'agent_event' | 'log'
|
|
21
|
+
export type DaemonToServerWsMsg = 'auth' | 'status_report' | 'status_heartbeat' | 'status_event' | 'command_result' | 'error' | 'agent_event' | 'log'
|
|
22
|
+
/**
|
|
23
|
+
* seqscribe Beacon vectors (design §7.1). ONE daemon-initiated frame carries
|
|
24
|
+
* both directions — `op: 'put'` stores this node's content-free vector
|
|
25
|
+
* report, `op: 'get'` asks for the board — because the server has no way to
|
|
26
|
+
* wake itself: `DaemonConnectionDO` has neither an alarm nor a timer, and
|
|
27
|
+
* adding one would hit the most request-quota-pressured axis in the system.
|
|
28
|
+
*/
|
|
29
|
+
| 'beacon_vectors';
|
|
22
30
|
/** Server→daemon control messages the OSS engine reacts to. */
|
|
23
|
-
export type ServerToDaemonWsMsg = 'auth_ok' | 'auth_error' | 'machine_evicted' | 'force_disconnect' | 'token_revoked' | 'version_mismatch' | 'force_update_required' | 'command' | 'agent_command' | 'resolve_action'
|
|
31
|
+
export type ServerToDaemonWsMsg = 'auth_ok' | 'auth_error' | 'machine_evicted' | 'force_disconnect' | 'token_revoked' | 'version_mismatch' | 'force_update_required' | 'command' | 'agent_command' | 'resolve_action'
|
|
32
|
+
/**
|
|
33
|
+
* Reply to a `beacon_vectors` GET, correlated by `requestId`. A PUT is
|
|
34
|
+
* fire-and-forget and gets no reply at all — the beacon is advisory, so a
|
|
35
|
+
* lost report costs one debounce cycle of prediction accuracy and nothing
|
|
36
|
+
* else, which is not worth an ack round trip.
|
|
37
|
+
*/
|
|
38
|
+
| 'beacon_vectors_result';
|
|
24
39
|
/** P2P signaling relayed through the server WS. */
|
|
25
40
|
export type P2PSignalingWsMsg = 'p2p_ready' | 'offer' | 'answer' | 'ice' | 'mesh_p2p_ready' | 'mesh_p2p_offer' | 'mesh_p2p_answer' | 'mesh_p2p_ice';
|
|
26
41
|
/**
|
package/package.json
CHANGED
package/src/ws-protocol.ts
CHANGED
|
@@ -27,7 +27,15 @@ export type DaemonToServerWsMsg =
|
|
|
27
27
|
| 'command_result'
|
|
28
28
|
| 'error'
|
|
29
29
|
| 'agent_event'
|
|
30
|
-
| 'log'
|
|
30
|
+
| 'log'
|
|
31
|
+
/**
|
|
32
|
+
* seqscribe Beacon vectors (design §7.1). ONE daemon-initiated frame carries
|
|
33
|
+
* both directions — `op: 'put'` stores this node's content-free vector
|
|
34
|
+
* report, `op: 'get'` asks for the board — because the server has no way to
|
|
35
|
+
* wake itself: `DaemonConnectionDO` has neither an alarm nor a timer, and
|
|
36
|
+
* adding one would hit the most request-quota-pressured axis in the system.
|
|
37
|
+
*/
|
|
38
|
+
| 'beacon_vectors';
|
|
31
39
|
|
|
32
40
|
/** Server→daemon control messages the OSS engine reacts to. */
|
|
33
41
|
export type ServerToDaemonWsMsg =
|
|
@@ -40,7 +48,14 @@ export type ServerToDaemonWsMsg =
|
|
|
40
48
|
| 'force_update_required'
|
|
41
49
|
| 'command'
|
|
42
50
|
| 'agent_command'
|
|
43
|
-
| 'resolve_action'
|
|
51
|
+
| 'resolve_action'
|
|
52
|
+
/**
|
|
53
|
+
* Reply to a `beacon_vectors` GET, correlated by `requestId`. A PUT is
|
|
54
|
+
* fire-and-forget and gets no reply at all — the beacon is advisory, so a
|
|
55
|
+
* lost report costs one debounce cycle of prediction accuracy and nothing
|
|
56
|
+
* else, which is not worth an ack round trip.
|
|
57
|
+
*/
|
|
58
|
+
| 'beacon_vectors_result';
|
|
44
59
|
|
|
45
60
|
/** P2P signaling relayed through the server WS. */
|
|
46
61
|
export type P2PSignalingWsMsg =
|
|
@@ -74,11 +89,13 @@ export type DashboardP2PMessageKind =
|
|
|
74
89
|
|
|
75
90
|
export const DAEMON_TO_SERVER_WS_MSGS: readonly DaemonToServerWsMsg[] = [
|
|
76
91
|
'auth', 'status_report', 'status_heartbeat', 'status_event', 'command_result', 'error', 'agent_event', 'log',
|
|
92
|
+
'beacon_vectors',
|
|
77
93
|
];
|
|
78
94
|
|
|
79
95
|
export const SERVER_TO_DAEMON_WS_MSGS: readonly ServerToDaemonWsMsg[] = [
|
|
80
96
|
'auth_ok', 'auth_error', 'machine_evicted', 'force_disconnect', 'token_revoked',
|
|
81
97
|
'version_mismatch', 'force_update_required', 'command', 'agent_command', 'resolve_action',
|
|
98
|
+
'beacon_vectors_result',
|
|
82
99
|
];
|
|
83
100
|
|
|
84
101
|
export function isDaemonToServerWsMsg(value: unknown): value is DaemonToServerWsMsg {
|