@inerrata/channel 0.3.5 → 0.3.6
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.js +6 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
16
16
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
17
|
-
import { ListToolsRequestSchema, CallToolRequestSchema,
|
|
17
|
+
import { ListToolsRequestSchema, CallToolRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
18
18
|
const MCP_BASE = (process.env.ERRATA_API_URL ?? 'https://inerrata.fly.dev').replace('/api/v1', '');
|
|
19
19
|
const API_BASE = MCP_BASE + '/api/v1';
|
|
20
20
|
const API_KEY = process.env.ERRATA_API_KEY ?? '';
|
|
@@ -26,10 +26,10 @@ if (!API_KEY) {
|
|
|
26
26
|
// MCP Server — low-level Server class (McpServer does NOT propagate
|
|
27
27
|
// the claude/channel experimental capability)
|
|
28
28
|
// ---------------------------------------------------------------------------
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
|
|
29
|
+
// Always true — the channel plugin is a Claude Code stdio server, and
|
|
30
|
+
// notifications/claude/channel is what renders <channel> tags in the conversation.
|
|
31
|
+
// Claude Code doesn't declare the capability back, but it renders them fine.
|
|
32
|
+
const clientSupportsChannelNotif = true;
|
|
33
33
|
const server = new Server({ name: 'inerrata-channel', version: '0.1.0' }, {
|
|
34
34
|
capabilities: {
|
|
35
35
|
experimental: { 'claude/channel': {} },
|
|
@@ -48,10 +48,6 @@ Message types:
|
|
|
48
48
|
- message.received: A new message in an established conversation
|
|
49
49
|
- message.request: A first-contact request from a new agent (includes their profile)`,
|
|
50
50
|
});
|
|
51
|
-
// Detect client type after handshake — only Claude Code declares claude/channel support
|
|
52
|
-
server.setNotificationHandler(InitializedNotificationSchema, async () => {
|
|
53
|
-
clientSupportsChannelNotif = !!server.getClientCapabilities()?.experimental?.['claude/channel'];
|
|
54
|
-
});
|
|
55
51
|
// ---------------------------------------------------------------------------
|
|
56
52
|
// Tools — reply + accept_request
|
|
57
53
|
// ---------------------------------------------------------------------------
|
|
@@ -288,6 +284,7 @@ async function connectAnnouncementChannel(retryDelay = 1000) {
|
|
|
288
284
|
method: 'POST',
|
|
289
285
|
headers: {
|
|
290
286
|
'Content-Type': 'application/json',
|
|
287
|
+
'Accept': 'application/json, text/event-stream',
|
|
291
288
|
Authorization: `Bearer ${API_KEY}`,
|
|
292
289
|
'mcp-session-id': sessionId,
|
|
293
290
|
},
|