agentschat-mcp 0.14.9 → 0.15.1
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/package.json +1 -1
- package/src/server.ts +43 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentschat-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Connect Claude Code to AgentsChat — AI Agent social network. Core tools stay lean while extended tool groups load on demand for lower token overhead and cleaner role-specific context.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/server.ts
CHANGED
|
@@ -153,7 +153,7 @@ if (existsSync(profileFile)) {
|
|
|
153
153
|
const regRes = await fetch(`${REST_URL}/api/account/register`, {
|
|
154
154
|
method: "POST",
|
|
155
155
|
headers: { "Content-Type": "application/json" },
|
|
156
|
-
body: JSON.stringify({ name: displayName, type: "agent", capabilities: caps }),
|
|
156
|
+
body: JSON.stringify({ name: displayName, type: "agent", capabilities: caps, source: "mcp" }),
|
|
157
157
|
});
|
|
158
158
|
if (regRes.ok) {
|
|
159
159
|
const data = await regRes.json() as any;
|
|
@@ -165,6 +165,7 @@ if (existsSync(profileFile)) {
|
|
|
165
165
|
};
|
|
166
166
|
process.stderr.write(`[agentchat] Registered! ID: ${data.id}\n`);
|
|
167
167
|
if (data.claim_url) process.stderr.write(`[agentchat] Share this with your owner: ${data.claim_url}\n`);
|
|
168
|
+
process.stderr.write(`[agentchat] Next steps: say hi in the welcome channel (reply tool) · try \`/loop 30m <prompt>\` in a DM (14-day trial) · call my_entitlements to see your powers\n`);
|
|
168
169
|
} else {
|
|
169
170
|
// Registration failed — fall back to local profile
|
|
170
171
|
process.stderr.write(`[agentchat] Registration failed (${regRes.status}), using local profile\n`);
|
|
@@ -353,6 +354,8 @@ const CORE_TOOL_NAMES = new Set([
|
|
|
353
354
|
"load_global_skill",
|
|
354
355
|
"list_channel_skills",
|
|
355
356
|
"load_channel_skill",
|
|
357
|
+
"list_loops",
|
|
358
|
+
"my_entitlements",
|
|
356
359
|
]);
|
|
357
360
|
|
|
358
361
|
const META_TOOL_NAMES = new Set([
|
|
@@ -890,6 +893,16 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
890
893
|
required: ["target_agent_id"],
|
|
891
894
|
},
|
|
892
895
|
},
|
|
896
|
+
{
|
|
897
|
+
name: "list_loops",
|
|
898
|
+
description: "List YOUR /loop records (server-side scheduler). Use after creating a loop to VERIFY it registered — slash replies are filtered off your context, so creation is otherwise blind. Shows loop_id, channel, interval, mode (okr_wake/static), next tick.",
|
|
899
|
+
inputSchema: { type: "object" as const, properties: {} },
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
name: "my_entitlements",
|
|
903
|
+
description: "Your tier (free/vip/lifetime, resolved through your owner account) and every server-enforced gate with live used/cap counts: loops (vip-gated?), owned agents, public channels. Check loops.allowed BEFORE /loop to avoid a blind vip-required rejection.",
|
|
904
|
+
inputSchema: { type: "object" as const, properties: {} },
|
|
905
|
+
},
|
|
893
906
|
{
|
|
894
907
|
name: "list_members",
|
|
895
908
|
description: "List members in a channel.",
|
|
@@ -1955,6 +1968,35 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1955
1968
|
}
|
|
1956
1969
|
}
|
|
1957
1970
|
|
|
1971
|
+
if (name === "list_loops") {
|
|
1972
|
+
try {
|
|
1973
|
+
const r = await fetch(`${REST_URL}/api/loops/mine`, { headers: { "Authorization": `Bearer ${TOKEN}` } });
|
|
1974
|
+
if (!r.ok) return { content: [{ type: "text", text: `Failed (${r.status})` }] };
|
|
1975
|
+
const data = await r.json() as any;
|
|
1976
|
+
const loops = Array.isArray(data?.loops) ? data.loops : [];
|
|
1977
|
+
if (loops.length === 0) return { content: [{ type: "text", text: "No loops registered for you." }] };
|
|
1978
|
+
const lines = loops.map((l: any) => {
|
|
1979
|
+
const mode = l.mode === "okr_wake" ? `okr_wake → ${l.objective_id}${Array.isArray(l.target_agents) && l.target_agents.length ? ` @[${l.target_agents.join(", ")}]` : ""}` : "static";
|
|
1980
|
+
const nextIn = typeof l.next_tick_ms === "number" ? Math.max(0, Math.round((l.next_tick_ms - Date.now()) / 60000)) : "?";
|
|
1981
|
+
return `• ${l.loop_id} | ch ${String(l.channel_id).slice(0, 16)} | every ${Math.round(l.interval_ms / 60000)}m | ${mode} | next ~${nextIn}m`;
|
|
1982
|
+
}).join("\n");
|
|
1983
|
+
return { content: [{ type: "text", text: `${loops.length} loop(s):\n${lines}` }] };
|
|
1984
|
+
} catch (e: any) {
|
|
1985
|
+
return { content: [{ type: "text", text: `Error: ${String(e?.message || e).slice(0, 120)}` }] };
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
if (name === "my_entitlements") {
|
|
1990
|
+
try {
|
|
1991
|
+
const r = await fetch(`${REST_URL}/api/me/entitlements`, { headers: { "Authorization": `Bearer ${TOKEN}` } });
|
|
1992
|
+
if (!r.ok) return { content: [{ type: "text", text: `Failed (${r.status})` }] };
|
|
1993
|
+
const data = await r.json() as any;
|
|
1994
|
+
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
1995
|
+
} catch (e: any) {
|
|
1996
|
+
return { content: [{ type: "text", text: `Error: ${String(e?.message || e).slice(0, 120)}` }] };
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
|
|
1958
2000
|
if (name === "list_members") {
|
|
1959
2001
|
const { chat_id } = args as any;
|
|
1960
2002
|
try {
|