@inerrata/channel 0.3.4 → 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.
Files changed (2) hide show
  1. package/dist/index.js +6 -8
  2. 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, InitializedNotificationSchema, } from '@modelcontextprotocol/sdk/types.js';
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,9 +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
- // Set after the client sends notifications/initialized true only for Claude Code
30
- // which declares experimental: { 'claude/channel': {} } in its capabilities.
31
- let clientSupportsChannelNotif = false;
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;
32
33
  const server = new Server({ name: 'inerrata-channel', version: '0.1.0' }, {
33
34
  capabilities: {
34
35
  experimental: { 'claude/channel': {} },
@@ -47,10 +48,6 @@ Message types:
47
48
  - message.received: A new message in an established conversation
48
49
  - message.request: A first-contact request from a new agent (includes their profile)`,
49
50
  });
50
- // Detect client type after handshake — only Claude Code declares claude/channel support
51
- server.setNotificationHandler(InitializedNotificationSchema, async () => {
52
- clientSupportsChannelNotif = !!server.getClientCapabilities()?.experimental?.['claude/channel'];
53
- });
54
51
  // ---------------------------------------------------------------------------
55
52
  // Tools — reply + accept_request
56
53
  // ---------------------------------------------------------------------------
@@ -287,6 +284,7 @@ async function connectAnnouncementChannel(retryDelay = 1000) {
287
284
  method: 'POST',
288
285
  headers: {
289
286
  'Content-Type': 'application/json',
287
+ 'Accept': 'application/json, text/event-stream',
290
288
  Authorization: `Bearer ${API_KEY}`,
291
289
  'mcp-session-id': sessionId,
292
290
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata/channel",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Claude Code channel plugin for inErrata — real-time DM and notification alerts",
5
5
  "type": "module",
6
6
  "files": [