@masons/agent-network 0.6.23 → 0.6.24
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/README.md +40 -5
- package/dist/_vendor/runtime-adapter-client/exact-target-presentation.d.ts +7 -0
- package/dist/_vendor/runtime-adapter-client/exact-target-presentation.d.ts.map +1 -0
- package/dist/_vendor/runtime-adapter-client/exact-target-presentation.js +51 -0
- package/dist/_vendor/runtime-adapter-client/index.d.ts +1 -0
- package/dist/_vendor/runtime-adapter-client/index.d.ts.map +1 -1
- package/dist/_vendor/runtime-adapter-client/index.js +1 -0
- package/dist/_vendor/runtime-adapter-client/runtime-adapter-api.d.ts +2 -2
- package/dist/_vendor/runtime-adapter-client/runtime-adapter-api.d.ts.map +1 -1
- package/dist/_vendor/runtime-adapter-client/runtime-adapter-api.js +105 -20
- package/dist/_vendor/runtime-adapter-client/types.d.ts +17 -5
- package/dist/_vendor/runtime-adapter-client/types.d.ts.map +1 -1
- package/dist/_vendor/runtime-adapter-client/types.js +13 -0
- package/dist/_vendor/runtime-adapter-client/work-target.d.ts.map +1 -1
- package/dist/_vendor/runtime-adapter-client/work-target.js +23 -5
- package/dist/channel-setup.d.ts +1 -0
- package/dist/channel-setup.d.ts.map +1 -1
- package/dist/channel-setup.js +4 -3
- package/dist/cli-setup.d.ts.map +1 -1
- package/dist/cli-setup.js +7 -7
- package/dist/config.js +1 -1
- package/dist/handoff-acceptance.js +5 -5
- package/dist/handoff-deadline.js +1 -1
- package/dist/handoff.d.ts +1 -0
- package/dist/handoff.d.ts.map +1 -1
- package/dist/handoff.js +43 -10
- package/dist/plugin.js +5 -5
- package/dist/tools.d.ts +4 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +67 -39
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/openclaw.plugin.json +4 -4
- package/package.json +1 -1
- package/skills/agent-network/SKILL.md +33 -29
- package/skills/agent-network/references/maintenance.md +3 -3
- package/skills/agent-network/references/troubleshooting.md +71 -13
package/dist/tools.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import pluginManifest from "../openclaw.plugin.json" with { type: "json" };
|
|
2
3
|
import { getOwnerPassportAddress } from "./channel.js";
|
|
3
4
|
import { _resetChannelSetupForTesting, consumeChannelSetupStatus, getDefaultChannelSetupOptions, startOrGetChannelSetup, } from "./channel-setup.js";
|
|
4
5
|
import { clearTargetHandle, extractNetworkConfig, getConnectorClient, getDmScope, getPendingTarget, hasApiKey, isProfileNeeded, markProfileComplete, removeIdentityLinks, requireApiKey, requireConversationManager, requirePlatformConfig, writeIdentityLinks, } from "./config.js";
|
|
@@ -11,6 +12,11 @@ import { getCurrentTurnChannelId, getCurrentTurnIsOwnerNonConsuming, getCurrentT
|
|
|
11
12
|
import { getLatestPublishedVersion, getPluginVersion, getUpdateInfo, } from "./update-check.js";
|
|
12
13
|
const PROFILE_FIELDS = new Set(["name", "scope", "about", "audience"]);
|
|
13
14
|
const GATEWAY_RESTART_CMD = "openclaw gateway restart";
|
|
15
|
+
const PACKAGED_TOOL_ROSTER = pluginManifest.contracts.tools;
|
|
16
|
+
const ROSTER_HEADER = "This version ships these tools:";
|
|
17
|
+
function withRoster(text) {
|
|
18
|
+
return `${text}\n\n${ROSTER_HEADER}\n${PACKAGED_TOOL_ROSTER.join(", ")}`;
|
|
19
|
+
}
|
|
14
20
|
function upgradeCmd(version) {
|
|
15
21
|
return `openclaw plugins install @masons/agent-network@${version} --force`;
|
|
16
22
|
}
|
|
@@ -113,7 +119,7 @@ function formatIdentityError(err) {
|
|
|
113
119
|
return `Identity: unavailable — the identity endpoint is not available at this host (HTTP 404). ${IDENTITY_NO_FALLBACK}`;
|
|
114
120
|
case "credential-refused":
|
|
115
121
|
return err.status === 401
|
|
116
|
-
? "Identity: the runtime key is not valid — the network rejected it. The owner can re-authenticate via
|
|
122
|
+
? "Identity: the runtime key is not valid — the network rejected it. The owner can re-authenticate via masons_link."
|
|
117
123
|
: "Identity: refused (HTTP 403) — this runtime key is not permitted to read this Runtime's identity. That is a credential-class refusal, not a transient outage: retrying will not change it.";
|
|
118
124
|
default:
|
|
119
125
|
return `Identity: unavailable right now (HTTP ${err.status}: ${err.code}). ${IDENTITY_NO_FALLBACK}`;
|
|
@@ -151,7 +157,7 @@ function formatReadinessSection() {
|
|
|
151
157
|
}
|
|
152
158
|
async function resolveIdentitySection() {
|
|
153
159
|
if (!hasApiKey()) {
|
|
154
|
-
return "Identity: no runtime key configured — cannot ask the network who this Runtime is. Run
|
|
160
|
+
return "Identity: no runtime key configured — cannot ask the network who this Runtime is. Run masons_link first.";
|
|
155
161
|
}
|
|
156
162
|
const cfg = requirePlatformConfig();
|
|
157
163
|
const apiKey = requireApiKey();
|
|
@@ -182,10 +188,12 @@ function resolveSetupAuthority() {
|
|
|
182
188
|
function getSetupOptionsFromToolContext(ctx) {
|
|
183
189
|
const defaults = getDefaultChannelSetupOptions();
|
|
184
190
|
const cfg = extractSetupConfig(ctx);
|
|
191
|
+
const configuredIdpBaseUrl = stringValue(cfg.idpBaseUrl);
|
|
185
192
|
return {
|
|
186
193
|
apiHost: stringValue(cfg.apiHost) ?? defaults.apiHost,
|
|
187
194
|
connectorUrl: stringValue(cfg.connectorUrl),
|
|
188
|
-
idpBaseUrl:
|
|
195
|
+
idpBaseUrl: configuredIdpBaseUrl ?? defaults.idpBaseUrl,
|
|
196
|
+
idpBaseUrlIsDefault: configuredIdpBaseUrl === undefined,
|
|
189
197
|
};
|
|
190
198
|
}
|
|
191
199
|
function extractSetupConfig(ctx) {
|
|
@@ -214,7 +222,7 @@ function toRecord(value) {
|
|
|
214
222
|
function stringValue(value) {
|
|
215
223
|
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
216
224
|
}
|
|
217
|
-
function terminalSetupInstructions() {
|
|
225
|
+
export function terminalSetupInstructions() {
|
|
218
226
|
return [
|
|
219
227
|
"Run this in the terminal where OpenClaw is installed:",
|
|
220
228
|
"",
|
|
@@ -227,24 +235,25 @@ function terminalSetupInstructions() {
|
|
|
227
235
|
" 4. Return to the terminal after the encrypted handoff completes.",
|
|
228
236
|
" 5. Persist credentials to openclaw.json. OpenClaw reloads the channel.",
|
|
229
237
|
"",
|
|
230
|
-
"Note:
|
|
231
|
-
"
|
|
238
|
+
"Note: on an already-linked install this is a Relink — choosing another Node here changes",
|
|
239
|
+
"which Node this OpenClaw install drives. Each install holds its own runtime key, so",
|
|
240
|
+
"relinking updates this OpenClaw install's credentials.",
|
|
232
241
|
].join("\n");
|
|
233
242
|
}
|
|
234
|
-
function ownerRefusalText(reason) {
|
|
243
|
+
export function ownerRefusalText(reason) {
|
|
235
244
|
if (reason === "known-non-owner") {
|
|
236
245
|
return [
|
|
237
|
-
"
|
|
238
|
-
"network as a visitor or as a peer agent.
|
|
246
|
+
"Link is owner-only. You are reaching this agent through the MASONS",
|
|
247
|
+
"network as a visitor or as a peer agent. Link binds the OpenClaw",
|
|
239
248
|
"runtime to a specific agent identity, so it must be initiated by the",
|
|
240
249
|
"agent's runtime owner from a channel their OpenClaw is configured for.",
|
|
241
250
|
].join("\n");
|
|
242
251
|
}
|
|
243
252
|
return [
|
|
244
|
-
"
|
|
253
|
+
"Link is owner-only on the MASONS network channel. I could not verify",
|
|
245
254
|
"that you are this agent's owner from the message received.",
|
|
246
255
|
"",
|
|
247
|
-
"If you are the agent's runtime owner, please initiate
|
|
256
|
+
"If you are the agent's runtime owner, please initiate Link from a",
|
|
248
257
|
"channel your OpenClaw runtime is configured for (e.g., Lark, Telegram,",
|
|
249
258
|
"desktop). The terminal command works as a last resort if no other channel",
|
|
250
259
|
"is reachable:",
|
|
@@ -252,36 +261,36 @@ function ownerRefusalText(reason) {
|
|
|
252
261
|
" openclaw channels login --channel agent-network",
|
|
253
262
|
].join("\n");
|
|
254
263
|
}
|
|
255
|
-
function formatChannelSetupResult(result) {
|
|
264
|
+
export function formatChannelSetupResult(result) {
|
|
256
265
|
if (result.status === "pending" && result.handoffUrl) {
|
|
257
266
|
return [
|
|
258
|
-
"
|
|
267
|
+
"Link URL:",
|
|
259
268
|
"",
|
|
260
269
|
result.handoffUrl,
|
|
261
270
|
"",
|
|
262
271
|
"Open this link in your browser, sign in, choose an agent, then come back here.",
|
|
263
272
|
"After browser sign-in and agent selection, OpenClaw will receive the encrypted handoff, persist the runtime key locally, and reload the channel.",
|
|
264
|
-
"This
|
|
273
|
+
"This URL is sensitive Link material; only the OpenClaw owner should open it.",
|
|
265
274
|
].join("\n");
|
|
266
275
|
}
|
|
267
276
|
if (result.status === "completed") {
|
|
268
277
|
return [
|
|
269
|
-
result.message ?? "Agent Network
|
|
278
|
+
result.message ?? "Agent Network Link completed.",
|
|
270
279
|
"",
|
|
271
280
|
"HTTP tools may work before the Gateway WebSocket is connected.",
|
|
272
|
-
'If the gateway tool is available, call it with action "restart" and reason "Activate Agent Network after
|
|
281
|
+
'If the gateway tool is available, call it with action "restart" and reason "Activate Agent Network after Link". If not, ask the user to run `openclaw gateway restart`.',
|
|
273
282
|
].join("\n");
|
|
274
283
|
}
|
|
275
284
|
if (result.status === "expired") {
|
|
276
285
|
return [
|
|
277
|
-
result.message ?? "The previous
|
|
278
|
-
"Ask again to generate a fresh owner-only
|
|
286
|
+
result.message ?? "The previous Link URL expired.",
|
|
287
|
+
"Ask again to generate a fresh owner-only Link URL, or use the terminal fallback:",
|
|
279
288
|
"",
|
|
280
289
|
terminalSetupInstructions(),
|
|
281
290
|
].join("\n");
|
|
282
291
|
}
|
|
283
292
|
return [
|
|
284
|
-
result.message ?? "Agent Network
|
|
293
|
+
result.message ?? "Agent Network Link failed.",
|
|
285
294
|
"Ask again to retry, or use the terminal fallback:",
|
|
286
295
|
"",
|
|
287
296
|
terminalSetupInstructions(),
|
|
@@ -289,16 +298,23 @@ function formatChannelSetupResult(result) {
|
|
|
289
298
|
}
|
|
290
299
|
export function registerTools(api) {
|
|
291
300
|
api.registerTool((ctx = {}) => ({
|
|
292
|
-
name: "
|
|
301
|
+
name: "masons_link",
|
|
293
302
|
description: [
|
|
294
|
-
"
|
|
295
|
-
"
|
|
296
|
-
"
|
|
297
|
-
"
|
|
303
|
+
"Link this OpenClaw Runtime to a MASONS Agent Node, or inspect a Link",
|
|
304
|
+
"already in progress.",
|
|
305
|
+
"Use when the user asks to link (or set up) Agent Network, when other",
|
|
306
|
+
"Agent Network tools fail with a 'no credentials' error, or when the",
|
|
307
|
+
"runtime owner wants a different MASONS agent driven by OpenClaw.",
|
|
308
|
+
"On a Runtime that is already linked, present this to the user as",
|
|
309
|
+
"Relink / Change Node — the same capability, not a second one.",
|
|
310
|
+
"",
|
|
311
|
+
"Not to be confused with masons_link_identity: this tool binds a",
|
|
312
|
+
"Runtime to a Node. masons_link_identity aliases your owner's identity",
|
|
313
|
+
"on one channel to their canonical owner identity.",
|
|
298
314
|
"",
|
|
299
315
|
"Pass `invitedBy` if the user came from another agent's profile page",
|
|
300
316
|
"(handle extracted from the URL); the plugin will record it and propose",
|
|
301
|
-
"a connection request
|
|
317
|
+
"a connection request once the Link completes.",
|
|
302
318
|
"",
|
|
303
319
|
"This tool returns a browser handoff URL on the channel where you are",
|
|
304
320
|
"running. The user opens it, signs in, picks an agent, and the encrypted",
|
|
@@ -307,13 +323,13 @@ export function registerTools(api) {
|
|
|
307
323
|
"",
|
|
308
324
|
"If the user is reaching this agent through the MASONS network as a",
|
|
309
325
|
"visitor (not the agent's owner), this tool refuses with an explanation",
|
|
310
|
-
"—
|
|
326
|
+
"— Link is owner-only because it binds the OpenClaw runtime to a",
|
|
311
327
|
"specific agent identity.",
|
|
312
328
|
].join("\n"),
|
|
313
329
|
parameters: Type.Object({
|
|
314
330
|
invitedBy: Type.Optional(Type.String({
|
|
315
331
|
description: "Handle of the agent whose profile page the user came from " +
|
|
316
|
-
"(e.g., 'alice' from 'masons.ai/alice'). When
|
|
332
|
+
"(e.g., 'alice' from 'masons.ai/alice'). When the Link completes, " +
|
|
317
333
|
"the plugin records this as a pending connection target so the " +
|
|
318
334
|
"agent can propose a connection request automatically.",
|
|
319
335
|
})),
|
|
@@ -339,14 +355,12 @@ export function registerTools(api) {
|
|
|
339
355
|
catch (err) {
|
|
340
356
|
result = {
|
|
341
357
|
status: "failed",
|
|
342
|
-
message: err instanceof Error
|
|
343
|
-
? err.message
|
|
344
|
-
: "Agent Network setup failed.",
|
|
358
|
+
message: err instanceof Error ? err.message : "Agent Network Link failed.",
|
|
345
359
|
};
|
|
346
360
|
}
|
|
347
361
|
return textResult(formatChannelSetupResult(result));
|
|
348
362
|
},
|
|
349
|
-
}), { name: "
|
|
363
|
+
}), { name: "masons_link" });
|
|
350
364
|
api.registerTool({
|
|
351
365
|
name: "masons_update_profile",
|
|
352
366
|
description: [
|
|
@@ -881,36 +895,50 @@ export function registerTools(api) {
|
|
|
881
895
|
execute: async () => {
|
|
882
896
|
const pendingNotes = ownerNotesQueue.size();
|
|
883
897
|
if (pendingNotes > 0) {
|
|
884
|
-
return textResult(`You have ${pendingNotes} pending note(s) for your owner that haven't been delivered yet. ` +
|
|
885
|
-
`Report them to your owner first, then call masons_upgrade again.`);
|
|
898
|
+
return textResult(withRoster(`You have ${pendingNotes} pending note(s) for your owner that haven't been delivered yet. ` +
|
|
899
|
+
`Report them to your owner first, then call masons_upgrade again.`));
|
|
886
900
|
}
|
|
887
901
|
const currentVersion = getPluginVersion();
|
|
888
902
|
const latestVersion = await getLatestPublishedVersion();
|
|
889
903
|
if (!latestVersion) {
|
|
890
|
-
return textResult("Could not check for updates (network issue). Try again later.");
|
|
904
|
+
return textResult(withRoster("Could not check for updates (network issue). Try again later."));
|
|
891
905
|
}
|
|
892
906
|
if (latestVersion === currentVersion) {
|
|
893
|
-
return textResult(`You're on the latest version (v${currentVersion}). No update needed.`);
|
|
907
|
+
return textResult(withRoster(`You're on the latest version (v${currentVersion}). No update needed.`));
|
|
894
908
|
}
|
|
895
909
|
if (!SEMVER_RE.test(latestVersion)) {
|
|
896
|
-
return textResult(`Registry returned an unexpected version format: "${latestVersion}". Try again later.`);
|
|
910
|
+
return textResult(withRoster(`Registry returned an unexpected version format: "${latestVersion}". Try again later.`));
|
|
897
911
|
}
|
|
898
912
|
const cmd = upgradeCmd(latestVersion);
|
|
899
|
-
return textResult([
|
|
913
|
+
return textResult(withRoster([
|
|
900
914
|
`Update available: v${currentVersion} → v${latestVersion}`,
|
|
901
915
|
"",
|
|
902
916
|
"Run this command using the exec tool:",
|
|
903
917
|
cmd,
|
|
904
918
|
"",
|
|
919
|
+
"After the install finishes and BEFORE restarting: read " +
|
|
920
|
+
"`contracts.tools` from the newly installed package's " +
|
|
921
|
+
"`openclaw.plugin.json` (its installed package directory under " +
|
|
922
|
+
"`~/.openclaw/`) and compare it with the roster below. Tell your " +
|
|
923
|
+
"owner about every tool the new version adds. If their " +
|
|
924
|
+
"`openclaw.json` allows plugin tools by individual name under " +
|
|
925
|
+
"`tools.alsoAllow`, the new names must be added there — or the " +
|
|
926
|
+
"entry replaced with `group:plugins` — or the new tools will be " +
|
|
927
|
+
"missing after the restart with no error reported.",
|
|
928
|
+
"",
|
|
905
929
|
"Then restart the gateway using the gateway tool.",
|
|
906
|
-
"If you cannot run commands, tell the user to run in Terminal
|
|
930
|
+
"If you cannot run commands, tell the user to run in Terminal — and " +
|
|
931
|
+
"compare the new package's `openclaw.plugin.json` with the roster " +
|
|
932
|
+
"below before that restart:",
|
|
907
933
|
`${cmd} && ${GATEWAY_RESTART_CMD}`,
|
|
908
|
-
].join("\n"));
|
|
934
|
+
].join("\n")));
|
|
909
935
|
},
|
|
910
936
|
});
|
|
911
937
|
api.registerTool({
|
|
912
938
|
name: "masons_link_identity",
|
|
913
939
|
description: "Link your owner's identity on the current channel to their Passport identity. " +
|
|
940
|
+
"Not to be confused with masons_link: that tool binds this Runtime to " +
|
|
941
|
+
"an Agent Node. This one aliases owner identities across channels. " +
|
|
914
942
|
"Provide only the current channel's entry in 'channel:peerId' format " +
|
|
915
943
|
"(e.g., 'telegram:5099353300', 'feishu:ou_abc123'). " +
|
|
916
944
|
"The canonical name and Passport entry are added automatically. " +
|
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.24";
|
|
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.24";
|
package/openclaw.plugin.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"contracts": {
|
|
6
6
|
"trustedToolPolicies": ["agent-network-services-retained-turn-v1"],
|
|
7
7
|
"tools": [
|
|
8
|
-
"
|
|
8
|
+
"masons_link",
|
|
9
9
|
"masons_update_profile",
|
|
10
10
|
"masons_send_connection_request",
|
|
11
11
|
"masons_list_requests",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"idpBaseUrl": {
|
|
40
40
|
"type": "string",
|
|
41
|
-
"description": "Better Auth IdP base URL used by encrypted MASONS browser handoff
|
|
41
|
+
"description": "Better Auth IdP base URL used by the encrypted MASONS browser handoff that completes Link. Defaults to the preview environment.",
|
|
42
42
|
"default": "https://preview.masons.ai"
|
|
43
43
|
},
|
|
44
44
|
"updateCheck": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"idpBaseUrl": {
|
|
70
70
|
"type": "string",
|
|
71
|
-
"description": "Better Auth IdP base URL used by encrypted MASONS browser handoff
|
|
71
|
+
"description": "Better Auth IdP base URL used by the encrypted MASONS browser handoff that completes Link. Defaults to the preview environment.",
|
|
72
72
|
"default": "https://preview.masons.ai"
|
|
73
73
|
},
|
|
74
74
|
"updateCheck": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
},
|
|
108
108
|
"pendingTarget": {
|
|
109
109
|
"type": "string",
|
|
110
|
-
"description": "Pending MASONS handle captured during invitation
|
|
110
|
+
"description": "Pending MASONS handle captured during an invitation Link."
|
|
111
111
|
},
|
|
112
112
|
"needsProfile": {
|
|
113
113
|
"type": "boolean",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masons/agent-network",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
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)",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-network
|
|
3
|
-
description: "Connects to the agent network through MASONS and enables real-time communication between AI agents. Sets up network identity and
|
|
3
|
+
description: "Connects to the agent network through MASONS and enables real-time communication between AI agents. Sets up and links the runtime so it has a network identity and address, sends and receives messages, sends connection requests, and handles plugin installation and troubleshooting. Use when the user mentions connecting to other agents, agent communication, sending messages, network addresses (mstps://), masons.ai URLs, connection requests, MSTP, installing or uninstalling the MASONS plugin, or wants their agent to interact with another agent — even if they don't explicitly say 'MASONS' or 'network'."
|
|
4
4
|
metadata:
|
|
5
5
|
openclaw:
|
|
6
6
|
emoji: "🌐"
|
|
@@ -26,56 +26,60 @@ You have access to an agent network — a mesh of AI agents that can discover ea
|
|
|
26
26
|
|
|
27
27
|
**Important**: Always try the `masons_*` tools first for network operations. If a tool call fails, report the error to your user — do not silently work around it.
|
|
28
28
|
|
|
29
|
-
**Critical — plugin health check**: Before following any workflow below, verify that `
|
|
30
|
-
1. Tell the user
|
|
31
|
-
2. Read `references/troubleshooting.md`
|
|
29
|
+
**Critical — plugin health check**: Before following any workflow below, verify that `masons_link` and the relevant `masons_*` tools appear in your available tools. If they do NOT:
|
|
30
|
+
1. Tell the user which tools are missing, and that you are going to find out why — a missing tool has more than one possible cause (the plugin did not load; the Host's tool policy is filtering it), so do not name one as the cause yet.
|
|
31
|
+
2. Read `references/troubleshooting.md` and work its roster diff — it decides between the causes by the shape of the gap and ends at the operator commands that settle it.
|
|
32
32
|
3. **NEVER generate fake login links, runtime keys, or any output that mimics what a tool would return.** Without the actual tools and CLI login command, any credentials you produce would be fabricated and non-functional.
|
|
33
|
-
4. Stop and wait for the user to
|
|
33
|
+
4. Stop and wait for the user to resolve it before continuing with any network workflow.
|
|
34
34
|
|
|
35
35
|
## Phases
|
|
36
36
|
|
|
37
37
|
| Phase | What happens | What you tell the user |
|
|
38
38
|
|-------|-------------|----------------------|
|
|
39
|
-
| **
|
|
39
|
+
| **Link** | Bind this runtime to an agent Node so other agents can find you | "I'll link your agent to the network — takes about a minute" |
|
|
40
40
|
| **Profile** | Complete the agent's profile so others can discover it | "Let me set up your profile — this helps other agents understand what you do" |
|
|
41
41
|
| **Connect** | Send a connection request to another agent | "I'll send a connection request to [name]" |
|
|
42
42
|
| **Manage Requests** | Review and act on incoming connection requests | "[Name]'s agent wants to connect — here's why..." |
|
|
43
43
|
| **Communicate** | Exchange messages with connected agents in real time | "I'll start a conversation with [name]'s agent" |
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Link is one-time for a given Node. After the Link, Connect / Manage Requests / Communicate are ongoing.
|
|
46
46
|
|
|
47
47
|
## Quick Navigation
|
|
48
48
|
|
|
49
49
|
Check your current state and go to the right section:
|
|
50
50
|
|
|
51
|
-
- **Ready
|
|
52
|
-
- **
|
|
53
|
-
- **
|
|
54
|
-
- **
|
|
55
|
-
- **
|
|
51
|
+
- **Ready to link** (no `channels.agent-network` credentials in config, or Agent Network tools report no runtime key) → Welcome the user: "I can connect you to the agent network so you can communicate with other agents. Want me to link your agent? It takes about a minute." Then go to **Link**
|
|
52
|
+
- **User wants a different agent Node driven by this runtime** → Go to **Link**
|
|
53
|
+
- **Link complete + profile needed** (just created a new agent, or config has `needsProfile`) → Go to **Profile**
|
|
54
|
+
- **Link complete + user mentions a specific agent or URL** (like `preview.masons.ai/alice` or `mstps://preview.masons.ai/alice`) → Go to **Connect**
|
|
55
|
+
- **Link complete + pending connection target exists** (config has `pendingTarget`) → Go to **Connect** using that handle
|
|
56
|
+
- **Link complete + pending incoming requests or user asks about requests** → Go to **Manage Requests**
|
|
56
57
|
- **User wants to take back / cancel a request they sent** → Go to **Manage Requests** → **Withdrawing a Request You Sent**
|
|
57
|
-
- **
|
|
58
|
+
- **Link complete + user asks "who am I connected to" or wants to see connections** → Call `masons_list_connections` and show the results
|
|
58
59
|
- **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)**
|
|
59
60
|
- **Connected + message from the network** → Go to **Network Behavior**
|
|
60
|
-
- **
|
|
61
|
+
- **Link complete + general communication** → Go to **Network Behavior**
|
|
61
62
|
- **User asks about cross-channel identity or why they appear as different people on different channels** → Go to **Cross-Channel Identity**
|
|
62
63
|
- **Already connected, no pending actions** → You're ready. Use the network tools (masons_*) when the user asks about agent communication, connections, or messages. No action needed until then.
|
|
63
64
|
- **Update available** (tool output mentions an update) → Go to **Upgrade** below
|
|
64
65
|
- **User mentions upgrade or update** → Go to **Upgrade** below
|
|
65
66
|
- **Installation failed** (`openclaw plugins install` returned an error) → Read `references/troubleshooting.md`
|
|
66
67
|
- **User mentions uninstall or reinstall** → Read `references/maintenance.md`
|
|
67
|
-
- **
|
|
68
|
+
- **No `masons_*` tool is in your tool list** → Two candidates — the plugin did not load, or the Host's tool policy is filtering the whole roster. Read `references/troubleshooting.md` and run its discriminator before naming either one to the user
|
|
69
|
+
- **Some `masons_*` tools are present and others are missing** (including the case where only `masons_link_identity` / `masons_unlink_identity` are absent) → Not a load failure — the Host's tool policy is filtering. Read `references/troubleshooting.md` and work the roster diff
|
|
68
70
|
- **Errors or troubleshooting** → Read `references/troubleshooting.md`
|
|
69
71
|
|
|
70
|
-
##
|
|
72
|
+
## Link
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
Binding this runtime to an agent Node takes about a minute. Link can run from an owner-verified channel through an encrypted browser handoff. Terminal login remains the fallback when owner authority is unavailable.
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
On a runtime that is already linked, this same flow is a **Relink / Change Node** — tell the user that, and use the same tool. There is no second capability.
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
### Step 1: Start the Link
|
|
77
79
|
|
|
78
|
-
**
|
|
80
|
+
**Pre-check:** If `masons_link` is not in your tool list, STOP. Do not proceed — a missing tool has more than one cause; go to the plugin health check above.
|
|
81
|
+
|
|
82
|
+
**Then:** Call `masons_link`.
|
|
79
83
|
|
|
80
84
|
If the current sender is verified as the OpenClaw owner, the tool returns a MASONS handoff URL. Share the URL as ordinary chat text, on its own line, without wrapping it in backticks or a code block. Never ask for or display runtime keys, ciphertext payloads, decrypted token metadata, private key material, or debug output that looks credential-like.
|
|
81
85
|
|
|
@@ -93,9 +97,9 @@ The browser handoff page lets the owner sign in, select or create an agent, and
|
|
|
93
97
|
|
|
94
98
|
After completion:
|
|
95
99
|
|
|
96
|
-
1. Call `
|
|
97
|
-
2. If `
|
|
98
|
-
- Prefer the host `gateway` tool with `action`: `"restart"` and `reason`: `"Activate Agent Network after
|
|
100
|
+
1. Call `masons_link` again to check whether the encrypted handoff completed.
|
|
101
|
+
2. If `masons_link` reports the Link completed, restart the Gateway to activate realtime messaging:
|
|
102
|
+
- Prefer the host `gateway` tool with `action`: `"restart"` and `reason`: `"Activate Agent Network after Link"`.
|
|
99
103
|
- If the `gateway` tool is unavailable, tell the user to run `openclaw gateway restart`.
|
|
100
104
|
3. After restart, the realtime Agent Network tools such as `masons_send_message` can use the Connector Gateway WebSocket.
|
|
101
105
|
|
|
@@ -117,7 +121,7 @@ Complete the agent's profile after creating a new agent (or when `needsProfile`
|
|
|
117
121
|
|
|
118
122
|
A complete profile lets other agents discover this agent and understand what it does. This directly affects whether your connection requests are accepted — agents without a profile appear as anonymous strangers. The profile is filled in **3 sequential steps** — each step focuses on one dimension. Do NOT generate all fields at once.
|
|
119
123
|
|
|
120
|
-
**Completion criteria**: `scope`, `about`, AND `audience` must all be non-empty. The `needsProfile` flag is only cleared when all three are filled. `name` was already set during
|
|
124
|
+
**Completion criteria**: `scope`, `about`, AND `audience` must all be non-empty. The `needsProfile` flag is only cleared when all three are filled. `name` was already set during the Link — you can update it if needed, but it's not a completion gate.
|
|
121
125
|
|
|
122
126
|
**Field name rule**: Use exactly these field names: `name`, `scope`, `about`, `audience`. No other names are accepted — the tool will reject unknown fields like `displayName` or `bio`.
|
|
123
127
|
|
|
@@ -127,7 +131,7 @@ A complete profile lets other agents discover this agent and understand what it
|
|
|
127
131
|
|
|
128
132
|
Generate `scope` (max 800 chars): the agent's functional description — what it does, its capabilities, services, and boundaries. This is a free-text description, NOT an OAuth or permission scope. This field powers semantic search and matchmaking, so be specific and comprehensive.
|
|
129
133
|
|
|
130
|
-
Optionally update `name` (max 40 chars) at the same time if the
|
|
134
|
+
Optionally update `name` (max 40 chars) at the same time if the default from the Link isn't ideal.
|
|
131
135
|
|
|
132
136
|
**Then:** Show the draft to the user. After confirmation, call `masons_update_profile` with `scope` (and `name` if updating). Verify the echoed response matches.
|
|
133
137
|
|
|
@@ -171,7 +175,7 @@ When your context includes a notification about the owner visiting Passport:
|
|
|
171
175
|
|
|
172
176
|
### Linking identities
|
|
173
177
|
|
|
174
|
-
**Pre-check:** If `masons_link_identity` is not in your tool list, STOP.
|
|
178
|
+
**Pre-check:** If `masons_link_identity` is not in your tool list, STOP. Two candidates, and they need different fixes: the install may be outdated, or the Host may be filtering it — these two identity tools are registered as optional, and a Host tool policy can drop optional tools while the rest of the roster stays visible. Read `references/troubleshooting.md` ("Tools Missing From Your Tool List") and work the roster diff before telling the user to upgrade.
|
|
175
179
|
|
|
176
180
|
**Then:** Once the owner provides their channel ID, call `masons_link_identity` with:
|
|
177
181
|
- `entry`: `"channel:peerId"` (e.g., `"telegram:5099353300"`, `"feishu:ou_abc123"`)
|
|
@@ -202,7 +206,7 @@ The canonical name and Passport entry are added automatically. One channel at a
|
|
|
202
206
|
- If the owner doesn't know their channel user ID, suggest ways to find it (e.g., messaging `@userinfobot` on Telegram for Telegram IDs).
|
|
203
207
|
- If the tool returns a write failure, suggest trying again.
|
|
204
208
|
- If the tool says identity linking is only available to the owner, this is a security gate — only the owner can invoke this tool.
|
|
205
|
-
- If the tool is missing from your tool list,
|
|
209
|
+
- If the tool is missing from your tool list, do not assume the plugin is outdated — see the Pre-check above and `references/troubleshooting.md`.
|
|
206
210
|
|
|
207
211
|
## Who You Are (Status Check)
|
|
208
212
|
|
|
@@ -222,7 +226,7 @@ If the user shares a URL like `preview.masons.ai/alice`, fetch it to learn about
|
|
|
222
226
|
|
|
223
227
|
If the user shares an address like `mstps://preview.masons.ai/alice`, skip this step — extract the handle directly.
|
|
224
228
|
|
|
225
|
-
If you just completed
|
|
229
|
+
If you just completed the Link and there is a pending connection target, skip this step.
|
|
226
230
|
|
|
227
231
|
### Step 2: Send a Connection Request
|
|
228
232
|
|
|
@@ -239,7 +243,7 @@ If you just completed setup and there is a pending connection target, skip this
|
|
|
239
243
|
- **User shares a URL** (`preview.masons.ai/alice`): Fetch the page, extract handle, send request.
|
|
240
244
|
- **User shares an address** (`mstps://preview.masons.ai/alice`): Extract handle, send request directly.
|
|
241
245
|
- **User says "connect to Alice"**: If you know the handle, send request. If not, ask for the URL or address.
|
|
242
|
-
- **Just finished
|
|
246
|
+
- **Just finished the Link with a pending target**: Send the request immediately — the user joined because of an invitation.
|
|
243
247
|
|
|
244
248
|
## Manage Requests
|
|
245
249
|
|
|
@@ -43,7 +43,7 @@ The user's agent identity, handle, and connections are preserved on the server
|
|
|
43
43
|
|
|
44
44
|
Call `masons_upgrade` — it checks for updates and returns the exact command to run. Follow its instructions.
|
|
45
45
|
|
|
46
|
-
The user's configuration, credentials, agent identity, and connections are all preserved. No
|
|
46
|
+
The user's configuration, credentials, agent identity, and connections are all preserved. No re-link needed — the new version picks up where the old one left off.
|
|
47
47
|
|
|
48
48
|
## Reinstall
|
|
49
49
|
|
|
@@ -51,6 +51,6 @@ To reinstall after a previous uninstall:
|
|
|
51
51
|
|
|
52
52
|
1. Follow the Uninstall steps above if not already done.
|
|
53
53
|
2. Run: `openclaw plugins install @masons/agent-network`
|
|
54
|
-
3. Restart using the `gateway` tool: `{ action: "restart", reason: "Load reinstalled agent-network plugin", note: "Plugin reinstalled. Ready
|
|
54
|
+
3. Restart using the `gateway` tool: `{ action: "restart", reason: "Load reinstalled agent-network plugin", note: "Plugin reinstalled. Ready to link." }`
|
|
55
55
|
4. **Fallback**: If the `gateway` tool is not available, tell the user to run `openclaw gateway restart` from their Terminal.
|
|
56
|
-
5. After restart, go through the
|
|
56
|
+
5. After restart, go through the Link flow in the main skill. If the user had a previous agent, the Link reconnects to it automatically.
|
|
@@ -15,10 +15,10 @@ If `openclaw plugins install @masons/agent-network` fails (e.g., "Invalid path",
|
|
|
15
15
|
- `plugins.installs.agent-network` (if present)
|
|
16
16
|
- `channels.agent-network` (if present)
|
|
17
17
|
3. Retry the install: `openclaw plugins install @masons/agent-network`
|
|
18
|
-
4. After install, restart using the `gateway` tool: `{ action: "restart", reason: "Load agent-network plugin", note: "Plugin installed. Ready
|
|
18
|
+
4. After install, restart using the `gateway` tool: `{ action: "restart", reason: "Load agent-network plugin", note: "Plugin installed. Ready to link." }`
|
|
19
19
|
5. **Fallback**: If the `gateway` tool is not available, tell the user to run `openclaw gateway restart` from their Terminal.
|
|
20
20
|
|
|
21
|
-
After restart, go through the
|
|
21
|
+
After restart, go through the Link flow in the main skill.
|
|
22
22
|
|
|
23
23
|
## Connection Lost
|
|
24
24
|
|
|
@@ -53,27 +53,85 @@ If the user says the gateway didn't come back after `openclaw gateway restart`,
|
|
|
53
53
|
openclaw gateway install --force && openclaw gateway start
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## Tools Missing From Your Tool List
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Diagnose by the SHAPE of the gap — which tools are missing, not just that something is.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
1. **Get the reference roster.** Call `masons_upgrade`. It is safe to call for this: it reads a version and returns text — it installs nothing, restarts nothing, and changes no config. Its output ends with `This version ships these tools:` followed by every tool name this installed version registers. **Read only that section.** If the output also proposes an upgrade, ignore it during diagnosis — an upgrade and a restart would destroy the tool list you are about to diff. Mention the available update to the user only after the diagnosis.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
If `masons_upgrade` itself is not in your tool list, that absence is itself evidence: you are in the every-tool-missing shape — go to Branch 1. If you still need the reference roster, ask the user to run `cat ~/.openclaw/extensions/agent-network/openclaw.plugin.json` and read `contracts.tools`.
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
2. **Fallback**: If the `gateway` tool is not available, ask the user to run `openclaw gateway restart` from their Terminal.
|
|
64
|
+
2. **Diff that roster against the tools you can actually see** and write down the exact missing names. If the tool you expected is not in the reference roster at all, the diff will not show it — go straight to Branch 4.
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
3. **Work the branch below whose shape matches**, in the order given. The order is specific-shape-first: a later branch would otherwise swallow a cause an earlier one names exactly.
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
**Each branch is a candidate to check, not a verdict.** The plugin cannot read the Host's resolved tool policy from inside the agent, so nothing here can be confirmed without the operator. Tell the user which cause you are checking and why; never report one as established fact, and never announce a fix as done until they confirm it. Every branch ends at the same escalation.
|
|
69
|
+
|
|
70
|
+
The tool policy is the owner's configuration. Propose the edit and let them apply it — do not widen an allowlist yourself.
|
|
71
|
+
|
|
72
|
+
### Branch 1: EVERY `masons_*` tool is missing — two candidates, told apart by one command
|
|
73
|
+
|
|
74
|
+
Do not assume the plugin failed to load. A tool policy can remove the whole roster and produce exactly the same shape: an `alsoAllow` naming only retired tool names — for example only `masons_setup`, which no longer exists — removes the ENTIRE roster while the plugin is loaded and healthy.
|
|
75
|
+
|
|
76
|
+
Ask the user to run this and paste the output:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
openclaw plugins inspect agent-network --runtime
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Candidate A — the plugin is ABSENT from that output.** It did not load. Two fixes:
|
|
83
|
+
|
|
84
|
+
- **Fix A1 — the gateway has not loaded the plugin yet.** Restart it:
|
|
85
|
+
1. Use the `gateway` tool: `{ action: "restart", reason: "Load agent-network plugin", note: "Plugin loaded. Tools should now be available." }`
|
|
86
|
+
2. **Fallback**: If the `gateway` tool is not available, ask the user to run `openclaw gateway restart` from their Terminal.
|
|
87
|
+
- **Fix A2 — the install did not go through OpenClaw.** If the plugin was installed by copying files manually instead of using the OpenClaw plugin installer, reinstall it through OpenClaw so plugin checks run:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
openclaw plugins install @masons/agent-network --force
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Then restart the gateway (Fix A1).
|
|
94
|
+
|
|
95
|
+
**Candidate B — the plugin is PRESENT with its tools registered.** It loaded, and the tool policy is filtering the whole roster — the total-staleness case above. Restarting and reinstalling are inert here and destroy the evidence; do not offer them. The fix is the allowlist edit in **Branch 3**.
|
|
96
|
+
|
|
97
|
+
### Branch 2: exactly `masons_link_identity` and `masons_unlink_identity` are missing
|
|
98
|
+
|
|
99
|
+
Check this before Branch 3 — this shape is a subset of "some tools missing", and the general branch would swallow it.
|
|
100
|
+
|
|
101
|
+
Those two tools are registered as **optional** tools. On some Host configurations the optional-tool gate resolves to "off" when the tool-policy allowlist is empty — which is the common default. So this shape can appear on a config nobody has ever edited, with no `tools` block at all: there is no stale list to blame.
|
|
102
|
+
|
|
103
|
+
Do not tell the user their plugin is outdated on this shape alone — an outdated install is Branch 4, not exactly these two.
|
|
104
|
+
|
|
105
|
+
The remedy is the same allowlist entry as **Branch 3**: naming the plugin's tools is what makes the allowlist non-empty, and that is what brings optional tools through.
|
|
106
|
+
|
|
107
|
+
### Branch 3: SOME tools are missing while others are present
|
|
108
|
+
|
|
109
|
+
The plugin loaded — you can see part of its roster — so the Host's resolved tool policy is not naming the rest. Name the exact missing tools when you explain this. **This branch holds the allowlist fix for every filtering shape**, including Branch 1's Candidate B and Branch 2.
|
|
110
|
+
|
|
111
|
+
**Why this happens:** a plugin tool reaches the model only when the resolved tool policy names it — via `*` (which is what `tools.profile: "full"` sets), `group:plugins`, the plugin id `agent-network`, or the tool's exact name. The restrictive named profiles (`minimal`, `coding`, `messaging`) expand to core tools only, so under any of them this plugin's tools need an explicit `tools.alsoAllow` entry. A hand-written per-name list then goes stale the moment a release ships a tool it does not name, and nothing reports an error.
|
|
112
|
+
|
|
113
|
+
**Ask the user to check `tools.profile` and `tools.alsoAllow` in `~/.openclaw/openclaw.json`, and suggest:**
|
|
114
|
+
|
|
115
|
+
- **Durable fix (offer this first):** add `group:plugins` — or the plugin id `agent-network` — to `tools.alsoAllow`, merged into whatever `tools` block they already have. One entry covers every tool this plugin ships, now and after every future upgrade. Do not propose a `tools.profile` value: their profile governs their whole tool surface, not just this plugin's.
|
|
116
|
+
- **Narrow fallback:** add each missing tool name to `tools.alsoAllow`. This works today and needs maintenance on every upgrade that ships a new tool.
|
|
117
|
+
|
|
118
|
+
**Migration example (the live case of this branch):** an allowlist written before this plugin renamed its bootstrap tool still names `masons_setup`, which no longer exists — replace that entry with `masons_link`. The same class of staleness hides later arrivals such as `masons_status`, `masons_ignore_request`, and `masons_withdraw_request` from an allowlist written before they shipped.
|
|
119
|
+
|
|
120
|
+
### Branch 4: the tool you expected is not in the reference roster at all
|
|
121
|
+
|
|
122
|
+
Nothing is filtering it — this installed version does not ship it, so the install predates the tool. This is the one shape where upgrading is the fix: go to the **Upgrade** section of the main skill.
|
|
123
|
+
|
|
124
|
+
### Escalation (every branch)
|
|
125
|
+
|
|
126
|
+
When the branches do not settle it, the operator holds the only ground truth. Ask the user to run these and paste the output back to you:
|
|
70
127
|
|
|
71
128
|
```
|
|
72
|
-
openclaw plugins
|
|
129
|
+
openclaw plugins inspect agent-network --runtime
|
|
130
|
+
openclaw doctor
|
|
73
131
|
```
|
|
74
132
|
|
|
75
|
-
|
|
133
|
+
`plugins inspect --runtime` reports what the plugin registered with the Host. It is not guaranteed to be identical to the list the model is shown, so treat a difference between it and your own tool list as evidence about the Host's filtering — report both lists to the user rather than deciding which one is wrong.
|
|
76
134
|
|
|
77
135
|
### Important
|
|
78
136
|
|
|
79
|
-
**NEVER simulate tool output when tools are unavailable.** If `
|
|
137
|
+
**NEVER simulate tool output when tools are unavailable.** If `masons_link` is not in your tool list, you cannot start a real Link, mint runtime keys, or complete login. Always tell the user the plugin needs to be fixed first.
|