@masons/agent-network 0.6.19 → 0.6.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/channel-setup.d.ts.map +1 -1
- package/dist/channel-setup.js +2 -1
- package/dist/channel.d.ts.map +1 -1
- package/dist/channel.js +54 -44
- package/dist/cli-setup.d.ts.map +1 -1
- package/dist/cli-setup.js +18 -4
- package/dist/config-fs.d.ts +1 -1
- package/dist/config-fs.d.ts.map +1 -1
- package/dist/config-fs.js +2 -1
- package/dist/config.d.ts +3 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -2
- package/dist/connector-client.d.ts +35 -4
- package/dist/connector-client.d.ts.map +1 -1
- package/dist/connector-client.js +126 -19
- package/dist/conversation-manager-context.d.ts +4 -0
- package/dist/conversation-manager-context.d.ts.map +1 -0
- package/dist/conversation-manager-context.js +8 -0
- package/dist/conversation-manager.d.ts +29 -4
- package/dist/conversation-manager.d.ts.map +1 -1
- package/dist/conversation-manager.js +163 -14
- package/dist/handoff-deadline.d.ts +4 -0
- package/dist/handoff-deadline.d.ts.map +1 -0
- package/dist/handoff-deadline.js +7 -0
- package/dist/handoff.d.ts +1 -2
- package/dist/handoff.d.ts.map +1 -1
- package/dist/handoff.js +20 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/platform-client.d.ts +1 -0
- package/dist/platform-client.d.ts.map +1 -1
- package/dist/platform-client.js +12 -0
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +49 -30
- package/dist/sent-message-buffer.d.ts +2 -3
- package/dist/sent-message-buffer.d.ts.map +1 -1
- package/dist/sent-message-buffer.js +8 -11
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +101 -7
- package/dist/turn-context.d.ts +0 -4
- package/dist/turn-context.d.ts.map +1 -1
- package/dist/turn-context.js +0 -18
- package/dist/types.d.ts +10 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/ws-heartbeat.d.ts +23 -0
- package/dist/ws-heartbeat.d.ts.map +1 -0
- package/dist/ws-heartbeat.js +63 -0
- package/openclaw.plugin.json +2 -1
- package/package.json +1 -1
- package/skills/agent-network/SKILL.md +9 -0
package/dist/types.d.ts
CHANGED
|
@@ -52,7 +52,16 @@ export interface SendAckEvent {
|
|
|
52
52
|
messageId: string;
|
|
53
53
|
status: "delivered" | "stored";
|
|
54
54
|
messageRef?: string;
|
|
55
|
+
addressedTarget?: {
|
|
56
|
+
address: string;
|
|
57
|
+
basis: "resolved" | "forwarded";
|
|
58
|
+
};
|
|
55
59
|
}
|
|
60
|
+
export type ObservedSendAckEvent = Omit<SendAckEvent, "status" | "messageRef" | "addressedTarget"> & {
|
|
61
|
+
status: string;
|
|
62
|
+
messageRef?: unknown;
|
|
63
|
+
addressedTarget?: unknown;
|
|
64
|
+
};
|
|
56
65
|
export interface AddressedMessageEvent {
|
|
57
66
|
event: "MESSAGE_RECEIVED";
|
|
58
67
|
messageId?: string;
|
|
@@ -109,7 +118,7 @@ export interface DeliverySkipEvent {
|
|
|
109
118
|
export type PluginToConnectorEvent = RegisterEvent | AddressedSendEvent | AddressedTypingEvent | AddressedDeliveryAckEvent | RequestGapFillEvent;
|
|
110
119
|
export type ConnectorToPluginEvent = RegisterAckEvent | SendAckEvent | AddressedMessageEvent | CustodyPendingEvent | DeliveryPendingEvent | DeliveryStatusEvent | DeliveryCursorEvent | DeliverySkipEvent | StructuredErrorEvent;
|
|
111
120
|
export declare function isRegisterAck(data: unknown): data is RegisterAckEvent;
|
|
112
|
-
export declare function isSendAck(data: unknown): data is
|
|
121
|
+
export declare function isSendAck(data: unknown): data is ObservedSendAckEvent;
|
|
113
122
|
export declare function isAddressedMessage(data: unknown): data is AddressedMessageEvent;
|
|
114
123
|
export declare function isCustodyPending(data: unknown): data is CustodyPendingEvent;
|
|
115
124
|
export declare function isDeliveryPending(data: unknown): data is DeliveryPendingEvent;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAQ1C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAGD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,QAAQ,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;CACnB;AAGD,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,cAAc,CAAC;IAEtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,kBAAkB,CAAC;IAE1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EA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CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,oBAAoB,CAO7E"}
|
package/dist/types.js
CHANGED
|
@@ -15,7 +15,9 @@ export function isRegisterAck(data) {
|
|
|
15
15
|
export function isSendAck(data) {
|
|
16
16
|
return (isObject(data) &&
|
|
17
17
|
data.event === "SEND_ACK" &&
|
|
18
|
-
typeof data.messageId === "string"
|
|
18
|
+
typeof data.messageId === "string" &&
|
|
19
|
+
typeof data.status === "string" &&
|
|
20
|
+
data.status.length > 0);
|
|
19
21
|
}
|
|
20
22
|
export function isAddressedMessage(data) {
|
|
21
23
|
return (isObject(data) &&
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export declare const PLUGIN_VERSION = "0.6.21";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export const PLUGIN_VERSION = "0.6.21";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const WS_HEARTBEAT_INTERVAL_MS = 30000;
|
|
2
|
+
export declare const WS_HEARTBEAT_PROBE_TIMEOUT_MS = 5000;
|
|
3
|
+
export declare const WS_HEARTBEAT_MISSES_BEFORE_DISCONNECT = 2;
|
|
4
|
+
interface HeartbeatSocket {
|
|
5
|
+
ping(): void;
|
|
6
|
+
terminate(): void;
|
|
7
|
+
on(event: "pong", listener: () => void): unknown;
|
|
8
|
+
off(event: "pong", listener: () => void): unknown;
|
|
9
|
+
readyState?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface WsHeartbeatHandle {
|
|
12
|
+
stop(): void;
|
|
13
|
+
}
|
|
14
|
+
export interface WsHeartbeatOptions {
|
|
15
|
+
intervalMs?: number;
|
|
16
|
+
probeTimeoutMs?: number;
|
|
17
|
+
missesBeforeDisconnect?: number;
|
|
18
|
+
onDead?: () => void;
|
|
19
|
+
onPingError?: (error: Error) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function startWsHeartbeat(ws: HeartbeatSocket, options?: WsHeartbeatOptions): WsHeartbeatHandle;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=ws-heartbeat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-heartbeat.d.ts","sourceRoot":"","sources":["../src/ws-heartbeat.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,eAAO,MAAM,6BAA6B,OAAQ,CAAC;AACnD,eAAO,MAAM,qCAAqC,IAAI,CAAC;AAEvD,UAAU,eAAe;IACvB,IAAI,IAAI,IAAI,CAAC;IACb,SAAS,IAAI,IAAI,CAAC;IAClB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IACjD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,IAAI,IAAI,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACtC;AASD,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CA4DnB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const WS_HEARTBEAT_INTERVAL_MS = 30_000;
|
|
2
|
+
export const WS_HEARTBEAT_PROBE_TIMEOUT_MS = 5_000;
|
|
3
|
+
export const WS_HEARTBEAT_MISSES_BEFORE_DISCONNECT = 2;
|
|
4
|
+
const WS_OPEN = 1;
|
|
5
|
+
const NOOP_HANDLE = { stop() { } };
|
|
6
|
+
export function startWsHeartbeat(ws, options = {}) {
|
|
7
|
+
const intervalMs = options.intervalMs ?? WS_HEARTBEAT_INTERVAL_MS;
|
|
8
|
+
if (!Number.isFinite(intervalMs) || intervalMs <= 0)
|
|
9
|
+
return NOOP_HANDLE;
|
|
10
|
+
const probeTimeoutMs = options.probeTimeoutMs ?? WS_HEARTBEAT_PROBE_TIMEOUT_MS;
|
|
11
|
+
const missesBeforeDisconnect = options.missesBeforeDisconnect ?? WS_HEARTBEAT_MISSES_BEFORE_DISCONNECT;
|
|
12
|
+
let misses = 0;
|
|
13
|
+
let probeTimer = null;
|
|
14
|
+
let stopped = false;
|
|
15
|
+
const onPong = () => {
|
|
16
|
+
misses = 0;
|
|
17
|
+
if (probeTimer) {
|
|
18
|
+
clearTimeout(probeTimer);
|
|
19
|
+
probeTimer = null;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
ws.on("pong", onPong);
|
|
23
|
+
const stop = () => {
|
|
24
|
+
if (stopped)
|
|
25
|
+
return;
|
|
26
|
+
stopped = true;
|
|
27
|
+
clearInterval(intervalTimer);
|
|
28
|
+
if (probeTimer) {
|
|
29
|
+
clearTimeout(probeTimer);
|
|
30
|
+
probeTimer = null;
|
|
31
|
+
}
|
|
32
|
+
ws.off("pong", onPong);
|
|
33
|
+
};
|
|
34
|
+
const probe = () => {
|
|
35
|
+
if (stopped || probeTimer)
|
|
36
|
+
return;
|
|
37
|
+
if (ws.readyState !== undefined && ws.readyState !== WS_OPEN)
|
|
38
|
+
return;
|
|
39
|
+
try {
|
|
40
|
+
ws.ping();
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
options.onPingError?.(error instanceof Error ? error : new Error(String(error)));
|
|
44
|
+
stop();
|
|
45
|
+
ws.terminate();
|
|
46
|
+
options.onDead?.();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
probeTimer = setTimeout(() => {
|
|
50
|
+
probeTimer = null;
|
|
51
|
+
misses += 1;
|
|
52
|
+
if (misses < missesBeforeDisconnect)
|
|
53
|
+
return;
|
|
54
|
+
stop();
|
|
55
|
+
ws.terminate();
|
|
56
|
+
options.onDead?.();
|
|
57
|
+
}, probeTimeoutMs);
|
|
58
|
+
probeTimer.unref?.();
|
|
59
|
+
};
|
|
60
|
+
const intervalTimer = setInterval(probe, intervalMs);
|
|
61
|
+
intervalTimer.unref?.();
|
|
62
|
+
return { stop };
|
|
63
|
+
}
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masons/agent-network",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.21",
|
|
4
4
|
"description": "MASONS Agent Network — OpenClaw channel plugin for connecting agent runtimes to the Agent Network over MSTP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MASONS.ai <hello@masons.ai> (https://masons.ai)",
|
|
@@ -54,6 +54,7 @@ Check your current state and go to the right section:
|
|
|
54
54
|
- **Setup complete + pending connection target exists** (config has `pendingTarget`) → Go to **Connect** using that handle
|
|
55
55
|
- **Setup complete + pending incoming requests or user asks about requests** → Go to **Manage Requests**
|
|
56
56
|
- **Setup complete + user asks "who am I connected to" or wants to see connections** → Call `masons_list_connections` and show the results
|
|
57
|
+
- **User asks "who am I on the network", "what is my identity", "am I connected", or "what is my network status"** → Go to **Who You Are (Status Check)**
|
|
57
58
|
- **Connected + message from the network** → Go to **Network Behavior**
|
|
58
59
|
- **Setup complete + general communication** → Go to **Network Behavior**
|
|
59
60
|
- **User asks about cross-channel identity or why they appear as different people on different channels** → Go to **Cross-Channel Identity**
|
|
@@ -202,6 +203,14 @@ The canonical name and Passport entry are added automatically. One channel at a
|
|
|
202
203
|
- If the tool says identity linking is only available to the owner, this is a security gate — only the owner can invoke this tool.
|
|
203
204
|
- If the tool is missing from your tool list, suggest upgrading the plugin.
|
|
204
205
|
|
|
206
|
+
## Who You Are (Status Check)
|
|
207
|
+
|
|
208
|
+
When your owner asks "who are you on the network", "what's your identity", "are you connected", or "are you ready", call `masons_status`. It is the only source for this — the platform's own identity endpoint, read fresh every time.
|
|
209
|
+
|
|
210
|
+
**Never infer your own network identity from connection lists, interaction context, local config, or your owner's identity links** — those name OTHER parties or your owner, not you. A handle you've seen in a REGISTER_ACK, a pending connection target, or a peer you're talking to is not evidence of who you are.
|
|
211
|
+
|
|
212
|
+
If `masons_status` reports identity as unavailable (or reports no active Node), say so plainly — do not fall back to a locally-cached guess.
|
|
213
|
+
|
|
205
214
|
## Connect
|
|
206
215
|
|
|
207
216
|
Use this section whenever the user wants to connect to a specific agent.
|