@masons/agent-network 0.2.4 → 0.2.5
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/plugin.d.ts.map +1 -1
- package/dist/plugin.js +13 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +33 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/agent-network/SKILL.md +1 -0
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAWA,UAAU,iBAAiB;IACzB,eAAe,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,IAAI,CAAC;CACnE;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;kBA4BI,iBAAiB;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAWA,UAAU,iBAAiB;IACzB,eAAe,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,IAAI,CAAC;CACnE;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;kBA4BI,iBAAiB;CAmGhC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -99,6 +99,19 @@ const plugin = {
|
|
|
99
99
|
// Setup complete but pending connection — guide to connect
|
|
100
100
|
context = `[Context: Agent Network] You are set up on the agent network. You have a pending connection — call the mstp_send_connection_request tool with targetHandle "${state.pendingTarget}" to send a connection request.`;
|
|
101
101
|
}
|
|
102
|
+
else {
|
|
103
|
+
// Connected and ready — remind LLM that network tools are available
|
|
104
|
+
context =
|
|
105
|
+
"[Context: Agent Network] You are connected to the agent network. " +
|
|
106
|
+
"Your network tools are loaded: " +
|
|
107
|
+
"mstp_list_requests (check incoming connection requests), " +
|
|
108
|
+
"mstp_send_connection_request (connect to another agent), " +
|
|
109
|
+
"mstp_accept_request (accept an incoming connection request), " +
|
|
110
|
+
"mstp_decline_request (decline an incoming connection request), " +
|
|
111
|
+
"mstp_create_session (start a conversation), " +
|
|
112
|
+
"mstp_send_message (send a message in a session), mstp_end_session (end a conversation). " +
|
|
113
|
+
"Use these when the user asks about agent communication, connections, or messages.";
|
|
114
|
+
}
|
|
102
115
|
if (context) {
|
|
103
116
|
return { prependContext: context };
|
|
104
117
|
}
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAmCH,UAAU,WAAW;IACnB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,CACP,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7D;AAuID;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CA4nBpD"}
|
package/dist/tools.js
CHANGED
|
@@ -102,7 +102,7 @@ function formatOnboardResult(handle, address, isReconnect) {
|
|
|
102
102
|
}
|
|
103
103
|
function formatConnectionResult(requestIds, status) {
|
|
104
104
|
if (requestIds.length === 0) {
|
|
105
|
-
return
|
|
105
|
+
return "Already connected or request already pending — no new request needed.";
|
|
106
106
|
}
|
|
107
107
|
return `Connection request sent. Status: ${status}. The other agent's owner will be notified.`;
|
|
108
108
|
}
|
|
@@ -408,10 +408,25 @@ export function registerMstpTools(api) {
|
|
|
408
408
|
const cfg = requirePlatformConfig();
|
|
409
409
|
const apiKey = requireApiKey();
|
|
410
410
|
const targetHandle = params.targetHandle;
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
411
|
+
let result;
|
|
412
|
+
try {
|
|
413
|
+
result = await requestConnection(cfg, apiKey, {
|
|
414
|
+
targetHandle,
|
|
415
|
+
variants: ["distribute", "receive"],
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
catch (err) {
|
|
419
|
+
if (err instanceof PlatformApiError) {
|
|
420
|
+
if (err.status === 404) {
|
|
421
|
+
return textResult(`Agent @${targetHandle} not found. Check the handle and try again.`);
|
|
422
|
+
}
|
|
423
|
+
if (err.status === 401) {
|
|
424
|
+
return textResult("Authentication failed. The API key may be invalid. Try running mstp_setup_init to reconnect.");
|
|
425
|
+
}
|
|
426
|
+
return textResult(`Connection request failed: ${err.message}`);
|
|
427
|
+
}
|
|
428
|
+
throw err;
|
|
429
|
+
}
|
|
415
430
|
// Clear pending target if one was set
|
|
416
431
|
if (getPendingTarget()) {
|
|
417
432
|
await clearTargetHandle();
|
|
@@ -432,7 +447,19 @@ export function registerMstpTools(api) {
|
|
|
432
447
|
const cfg = requirePlatformConfig();
|
|
433
448
|
const apiKey = requireApiKey();
|
|
434
449
|
const status = params.status ?? "pending";
|
|
435
|
-
|
|
450
|
+
let result;
|
|
451
|
+
try {
|
|
452
|
+
result = await listRequests(cfg, apiKey, { status, limit: 100 });
|
|
453
|
+
}
|
|
454
|
+
catch (err) {
|
|
455
|
+
if (err instanceof PlatformApiError) {
|
|
456
|
+
if (err.status === 401) {
|
|
457
|
+
return textResult("Authentication failed. The API key may be invalid. Try running mstp_setup_init to reconnect.");
|
|
458
|
+
}
|
|
459
|
+
return textResult(`Failed to list requests: ${err.message}`);
|
|
460
|
+
}
|
|
461
|
+
throw err;
|
|
462
|
+
}
|
|
436
463
|
if (result.total === 0) {
|
|
437
464
|
return textResult(`No ${status === "all" ? "" : `${status} `}connection requests.`);
|
|
438
465
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Plugin version — must match package.json. Validated by prepublishOnly. */
|
|
2
|
-
export const PLUGIN_VERSION = "0.2.
|
|
2
|
+
export const PLUGIN_VERSION = "0.2.5";
|
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ Check your current state and go to the right section:
|
|
|
40
40
|
- **Setup complete + pending connection target exists** (config has `pendingTarget`) → Go to **Connect** using that handle
|
|
41
41
|
- **Setup complete + pending incoming requests or user asks about requests** → Go to **Manage Requests**
|
|
42
42
|
- **Setup complete + general communication** → Go to **Communicate**
|
|
43
|
+
- **Already connected, no pending actions** → You're ready. Use the network tools (mstp_*) when the user asks about agent communication, connections, or messages. No action needed until then.
|
|
43
44
|
- **Update available** (tool output mentions an update) → Tell the user a newer version is available and offer to update, then read `references/maintenance.md` (Upgrade section)
|
|
44
45
|
- **User mentions upgrade or update** → Read `references/maintenance.md` (Upgrade section)
|
|
45
46
|
- **User mentions uninstall or reinstall** → Read `references/maintenance.md`
|