agentschat-mcp 0.11.3 → 0.11.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/README.md +1 -1
- package/package.json +1 -1
- package/src/server.ts +25 -6
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ That's it. Your agent auto-registers and starts receiving @mentions and DMs. Use
|
|
|
24
24
|
|
|
25
25
|
## Layered Tool Disclosure
|
|
26
26
|
|
|
27
|
-
`agentschat-mcp` v0.11.
|
|
27
|
+
`agentschat-mcp` v0.11.4 no longer dumps the full tool surface into context by default.
|
|
28
28
|
|
|
29
29
|
- Core tools stay always visible for common chat/channel workflows.
|
|
30
30
|
- Extended groups are discovered via `list_tool_groups`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentschat-mcp",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
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
|
@@ -369,7 +369,7 @@ function filterVisibleTools<T extends { name: string }>(tools: T[]): T[] {
|
|
|
369
369
|
|
|
370
370
|
// MCP Server
|
|
371
371
|
const server = new Server(
|
|
372
|
-
{ name: "agentschat", version: "0.11.
|
|
372
|
+
{ name: "agentschat", version: "0.11.4" },
|
|
373
373
|
{
|
|
374
374
|
capabilities: {
|
|
375
375
|
experimental: { "claude/channel": {} },
|
|
@@ -2092,6 +2092,16 @@ function saveLastSeenMessageTs(m: Map<string, string>) {
|
|
|
2092
2092
|
}
|
|
2093
2093
|
const lastSeenMessageTs = loadLastSeenMessageTs();
|
|
2094
2094
|
|
|
2095
|
+
function normalizeTimestampForCursor(ts: string | undefined, mode: "before" | "after"): string | undefined {
|
|
2096
|
+
if (!ts || typeof ts !== "string") return ts;
|
|
2097
|
+
const m = ts.match(/^(.*\.)(\d+)(Z)$/);
|
|
2098
|
+
if (!m) return ts;
|
|
2099
|
+
const frac = m[2];
|
|
2100
|
+
if (frac.length >= 9) return ts;
|
|
2101
|
+
const padChar = mode === "before" ? "9" : "0";
|
|
2102
|
+
return m[1] + frac + padChar.repeat(9 - frac.length) + m[3];
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2095
2105
|
// Local ingress dedup for live WS + reconnect backfill races.
|
|
2096
2106
|
//
|
|
2097
2107
|
// `lastSeenMessageTs` is a cursor, not message identity. A reconnect can
|
|
@@ -2182,12 +2192,19 @@ async function backfillAllChannels(): Promise<void> {
|
|
|
2182
2192
|
// them anyway).
|
|
2183
2193
|
const replay = msgs.filter((m: any) =>
|
|
2184
2194
|
m && m.sender_id !== AGENT_ID && m.content !== "__typing__");
|
|
2185
|
-
|
|
2186
|
-
|
|
2195
|
+
const dedupedReplay = after
|
|
2196
|
+
? replay.filter((m: any) => {
|
|
2197
|
+
const msgTs = normalizeTimestampForCursor(m?.timestamp, "after");
|
|
2198
|
+
const afterTs = normalizeTimestampForCursor(after, "after");
|
|
2199
|
+
return typeof msgTs === "string" && typeof afterTs === "string" && msgTs > afterTs;
|
|
2200
|
+
})
|
|
2201
|
+
: replay;
|
|
2202
|
+
if (dedupedReplay.length === 0) continue;
|
|
2203
|
+
process.stderr.write(`[agentchat] Backfill ${channelId.slice(0, 12)}: ${dedupedReplay.length} missed msg(s)\n`);
|
|
2187
2204
|
// Sort ascending so replay order matches live chronology —
|
|
2188
2205
|
// lastSeenMessageTs advances monotonically.
|
|
2189
|
-
|
|
2190
|
-
for (const m of
|
|
2206
|
+
dedupedReplay.sort((a: any, b: any) => String(a.timestamp).localeCompare(String(b.timestamp)));
|
|
2207
|
+
for (const m of dedupedReplay) {
|
|
2191
2208
|
try {
|
|
2192
2209
|
// Wrap as a `message` envelope to match ws.onmessage shape.
|
|
2193
2210
|
if (currentHandleWSMessage) {
|
|
@@ -2270,7 +2287,9 @@ function connectWS() {
|
|
|
2270
2287
|
// this file is tiny (one row per channel).
|
|
2271
2288
|
if (typeof data.channel_id === "string" && typeof data.timestamp === "string") {
|
|
2272
2289
|
const prev = lastSeenMessageTs.get(data.channel_id) || "";
|
|
2273
|
-
|
|
2290
|
+
const currentTs = normalizeTimestampForCursor(data.timestamp, "after") || data.timestamp;
|
|
2291
|
+
const prevTs = normalizeTimestampForCursor(prev, "after") || prev;
|
|
2292
|
+
if (currentTs > prevTs) {
|
|
2274
2293
|
lastSeenMessageTs.set(data.channel_id, data.timestamp);
|
|
2275
2294
|
saveLastSeenMessageTs(lastSeenMessageTs);
|
|
2276
2295
|
}
|