agentschat-mcp 0.14.9 → 0.15.0
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 +41 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentschat-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
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
|
@@ -353,6 +353,8 @@ const CORE_TOOL_NAMES = new Set([
|
|
|
353
353
|
"load_global_skill",
|
|
354
354
|
"list_channel_skills",
|
|
355
355
|
"load_channel_skill",
|
|
356
|
+
"list_loops",
|
|
357
|
+
"my_entitlements",
|
|
356
358
|
]);
|
|
357
359
|
|
|
358
360
|
const META_TOOL_NAMES = new Set([
|
|
@@ -890,6 +892,16 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
890
892
|
required: ["target_agent_id"],
|
|
891
893
|
},
|
|
892
894
|
},
|
|
895
|
+
{
|
|
896
|
+
name: "list_loops",
|
|
897
|
+
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.",
|
|
898
|
+
inputSchema: { type: "object" as const, properties: {} },
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: "my_entitlements",
|
|
902
|
+
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.",
|
|
903
|
+
inputSchema: { type: "object" as const, properties: {} },
|
|
904
|
+
},
|
|
893
905
|
{
|
|
894
906
|
name: "list_members",
|
|
895
907
|
description: "List members in a channel.",
|
|
@@ -1955,6 +1967,35 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1955
1967
|
}
|
|
1956
1968
|
}
|
|
1957
1969
|
|
|
1970
|
+
if (name === "list_loops") {
|
|
1971
|
+
try {
|
|
1972
|
+
const r = await fetch(`${REST_URL}/api/loops/mine`, { headers: { "Authorization": `Bearer ${TOKEN}` } });
|
|
1973
|
+
if (!r.ok) return { content: [{ type: "text", text: `Failed (${r.status})` }] };
|
|
1974
|
+
const data = await r.json() as any;
|
|
1975
|
+
const loops = Array.isArray(data?.loops) ? data.loops : [];
|
|
1976
|
+
if (loops.length === 0) return { content: [{ type: "text", text: "No loops registered for you." }] };
|
|
1977
|
+
const lines = loops.map((l: any) => {
|
|
1978
|
+
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";
|
|
1979
|
+
const nextIn = typeof l.next_tick_ms === "number" ? Math.max(0, Math.round((l.next_tick_ms - Date.now()) / 60000)) : "?";
|
|
1980
|
+
return `• ${l.loop_id} | ch ${String(l.channel_id).slice(0, 16)} | every ${Math.round(l.interval_ms / 60000)}m | ${mode} | next ~${nextIn}m`;
|
|
1981
|
+
}).join("\n");
|
|
1982
|
+
return { content: [{ type: "text", text: `${loops.length} loop(s):\n${lines}` }] };
|
|
1983
|
+
} catch (e: any) {
|
|
1984
|
+
return { content: [{ type: "text", text: `Error: ${String(e?.message || e).slice(0, 120)}` }] };
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
if (name === "my_entitlements") {
|
|
1989
|
+
try {
|
|
1990
|
+
const r = await fetch(`${REST_URL}/api/me/entitlements`, { headers: { "Authorization": `Bearer ${TOKEN}` } });
|
|
1991
|
+
if (!r.ok) return { content: [{ type: "text", text: `Failed (${r.status})` }] };
|
|
1992
|
+
const data = await r.json() as any;
|
|
1993
|
+
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
1994
|
+
} catch (e: any) {
|
|
1995
|
+
return { content: [{ type: "text", text: `Error: ${String(e?.message || e).slice(0, 120)}` }] };
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1958
1999
|
if (name === "list_members") {
|
|
1959
2000
|
const { chat_id } = args as any;
|
|
1960
2001
|
try {
|