@scp-dev/mcp 0.1.3 → 0.1.4
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.d.ts +5 -1
- package/dist/index.js +11 -4
- package/package.json +3 -3
- package/src/server.ts +11 -4
package/dist/index.d.ts
CHANGED
|
@@ -289,7 +289,7 @@ declare const TOOLS: readonly [{
|
|
|
289
289
|
};
|
|
290
290
|
}, {
|
|
291
291
|
readonly name: "relay_join";
|
|
292
|
-
readonly description: "Put this session on the relay, so peers can message it and new messages reach you after your tool calls; name sets your handle once (renaming you in place when you already joined).";
|
|
292
|
+
readonly description: "Put this session on the relay, so peers can message it and new messages reach you after your tool calls; name sets your handle once (renaming you in place when you already joined); under links you below that agent, as if it had spawned you: you show as its child and reach only what a worker of it reaches.";
|
|
293
293
|
readonly inputSchema: {
|
|
294
294
|
readonly type: "object";
|
|
295
295
|
readonly properties: {
|
|
@@ -297,6 +297,10 @@ declare const TOOLS: readonly [{
|
|
|
297
297
|
readonly type: "string";
|
|
298
298
|
readonly maxLength: 63;
|
|
299
299
|
};
|
|
300
|
+
readonly under: {
|
|
301
|
+
readonly type: "string";
|
|
302
|
+
readonly maxLength: 128;
|
|
303
|
+
};
|
|
300
304
|
};
|
|
301
305
|
readonly additionalProperties: false;
|
|
302
306
|
};
|
package/dist/index.js
CHANGED
|
@@ -160,8 +160,12 @@ var TOOLS = [
|
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
name: "relay_join",
|
|
163
|
-
description: "Put this session on the relay, so peers can message it and new messages reach you after your tool calls; name sets your handle once (renaming you in place when you already joined).",
|
|
164
|
-
inputSchema: {
|
|
163
|
+
description: "Put this session on the relay, so peers can message it and new messages reach you after your tool calls; name sets your handle once (renaming you in place when you already joined); under links you below that agent, as if it had spawned you: you show as its child and reach only what a worker of it reaches.",
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: { name: { type: "string", maxLength: 63 }, under: { type: "string", maxLength: 128 } },
|
|
167
|
+
additionalProperties: false
|
|
168
|
+
}
|
|
165
169
|
},
|
|
166
170
|
{
|
|
167
171
|
name: "relay_leave",
|
|
@@ -634,17 +638,20 @@ async function runRelayMcp(options) {
|
|
|
634
638
|
}
|
|
635
639
|
case "relay_join": {
|
|
636
640
|
const name2 = str(args, "name");
|
|
641
|
+
const under = str(args, "under");
|
|
637
642
|
const joined = options.membership?.() ?? {};
|
|
638
643
|
const claim = "handle" in joined && joined.handle ? { ...options.claim, handle: joined.handle } : options.claim;
|
|
639
644
|
const next = await options.connect();
|
|
640
645
|
try {
|
|
641
|
-
const hello = await next.hello({ transient: true, claim, join: name2 ? { handle: name2 } : {} });
|
|
646
|
+
const hello = await next.hello({ transient: true, claim, join: { ...name2 ? { handle: name2 } : {}, ...under ? { under } : {} } });
|
|
642
647
|
me = hello.endpoint;
|
|
643
648
|
} finally {
|
|
644
649
|
next.close();
|
|
645
650
|
}
|
|
646
651
|
await ensure();
|
|
647
|
-
return text(
|
|
652
|
+
return text(
|
|
653
|
+
`joined the relay as ${me?.address}${me?.parent ? ` under ${me.parent}` : ""}: peers can message you, and new messages reach you after your tool calls`
|
|
654
|
+
);
|
|
648
655
|
}
|
|
649
656
|
case "relay_leave": {
|
|
650
657
|
const view = await call("leave");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scp-dev/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "The SCP stdio MCP server: gives an agent session the relay's tools.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://scp.dev",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"typecheck": "tsc -p ."
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@scp-dev/broker": "0.1.
|
|
33
|
-
"@scp-dev/core": "0.1.
|
|
32
|
+
"@scp-dev/broker": "0.1.4",
|
|
33
|
+
"@scp-dev/core": "0.1.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"tsup": "^8.5.1"
|
package/src/server.ts
CHANGED
|
@@ -232,8 +232,12 @@ export const TOOLS = [
|
|
|
232
232
|
{
|
|
233
233
|
name: "relay_join",
|
|
234
234
|
description:
|
|
235
|
-
"Put this session on the relay, so peers can message it and new messages reach you after your tool calls; name sets your handle once (renaming you in place when you already joined).",
|
|
236
|
-
inputSchema: {
|
|
235
|
+
"Put this session on the relay, so peers can message it and new messages reach you after your tool calls; name sets your handle once (renaming you in place when you already joined); under links you below that agent, as if it had spawned you: you show as its child and reach only what a worker of it reaches.",
|
|
236
|
+
inputSchema: {
|
|
237
|
+
type: "object",
|
|
238
|
+
properties: { name: { type: "string", maxLength: 63 }, under: { type: "string", maxLength: 128 } },
|
|
239
|
+
additionalProperties: false,
|
|
240
|
+
},
|
|
237
241
|
},
|
|
238
242
|
{
|
|
239
243
|
name: "relay_leave",
|
|
@@ -777,17 +781,20 @@ export async function runRelayMcp(options: RelayMcpOptions): Promise<void> {
|
|
|
777
781
|
}
|
|
778
782
|
case "relay_join": {
|
|
779
783
|
const name = str(args, "name")
|
|
784
|
+
const under = str(args, "under")
|
|
780
785
|
const joined = options.membership?.() ?? {}
|
|
781
786
|
const claim = "handle" in joined && joined.handle ? { ...options.claim, handle: joined.handle } : options.claim
|
|
782
787
|
const next = await options.connect()
|
|
783
788
|
try {
|
|
784
|
-
const hello = await next.hello({ transient: true, claim, join: name ? { handle: name } : {} })
|
|
789
|
+
const hello = await next.hello({ transient: true, claim, join: { ...(name ? { handle: name } : {}), ...(under ? { under } : {}) } })
|
|
785
790
|
me = hello.endpoint
|
|
786
791
|
} finally {
|
|
787
792
|
next.close()
|
|
788
793
|
}
|
|
789
794
|
await ensure()
|
|
790
|
-
return text(
|
|
795
|
+
return text(
|
|
796
|
+
`joined the relay as ${me?.address}${me?.parent ? ` under ${me.parent}` : ""}: peers can message you, and new messages reach you after your tool calls`,
|
|
797
|
+
)
|
|
791
798
|
}
|
|
792
799
|
case "relay_leave": {
|
|
793
800
|
const view = await call<EndpointView>("leave")
|