group-chat-mcp 0.1.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.
Files changed (135) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +170 -0
  3. package/dist/constants/env.d.ts +3 -0
  4. package/dist/constants/env.d.ts.map +1 -0
  5. package/dist/constants/env.js +6 -0
  6. package/dist/constants/env.js.map +1 -0
  7. package/dist/constants/settings-paths.d.ts +5 -0
  8. package/dist/constants/settings-paths.d.ts.map +1 -0
  9. package/dist/constants/settings-paths.js +11 -0
  10. package/dist/constants/settings-paths.js.map +1 -0
  11. package/dist/constants/storage.d.ts +6 -0
  12. package/dist/constants/storage.d.ts.map +1 -0
  13. package/dist/constants/storage.js +8 -0
  14. package/dist/constants/storage.js.map +1 -0
  15. package/dist/enums/conversation-type.d.ts +6 -0
  16. package/dist/enums/conversation-type.d.ts.map +1 -0
  17. package/dist/enums/conversation-type.js +7 -0
  18. package/dist/enums/conversation-type.js.map +1 -0
  19. package/dist/enums/ide.d.ts +5 -0
  20. package/dist/enums/ide.d.ts.map +1 -0
  21. package/dist/enums/ide.js +6 -0
  22. package/dist/enums/ide.js.map +1 -0
  23. package/dist/enums/index.d.ts +4 -0
  24. package/dist/enums/index.d.ts.map +1 -0
  25. package/dist/enums/index.js +4 -0
  26. package/dist/enums/index.js.map +1 -0
  27. package/dist/enums/message-type.d.ts +5 -0
  28. package/dist/enums/message-type.d.ts.map +1 -0
  29. package/dist/enums/message-type.js +6 -0
  30. package/dist/enums/message-type.js.map +1 -0
  31. package/dist/enums/notification-type.d.ts +9 -0
  32. package/dist/enums/notification-type.d.ts.map +1 -0
  33. package/dist/enums/notification-type.js +10 -0
  34. package/dist/enums/notification-type.js.map +1 -0
  35. package/dist/enums/scope.d.ts +5 -0
  36. package/dist/enums/scope.d.ts.map +1 -0
  37. package/dist/enums/scope.js +6 -0
  38. package/dist/enums/scope.js.map +1 -0
  39. package/dist/gchat.d.ts +4 -0
  40. package/dist/gchat.d.ts.map +1 -0
  41. package/dist/gchat.js +72 -0
  42. package/dist/gchat.js.map +1 -0
  43. package/dist/handlers/tool-handlers.d.ts +10 -0
  44. package/dist/handlers/tool-handlers.d.ts.map +1 -0
  45. package/dist/handlers/tool-handlers.js +198 -0
  46. package/dist/handlers/tool-handlers.js.map +1 -0
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +113 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/schemas/tool-schemas.d.ts +222 -0
  52. package/dist/schemas/tool-schemas.d.ts.map +1 -0
  53. package/dist/schemas/tool-schemas.js +132 -0
  54. package/dist/schemas/tool-schemas.js.map +1 -0
  55. package/dist/services/inbox-poller.d.ts +7 -0
  56. package/dist/services/inbox-poller.d.ts.map +1 -0
  57. package/dist/services/inbox-poller.js +65 -0
  58. package/dist/services/inbox-poller.js.map +1 -0
  59. package/dist/services/installer-service.d.ts +13 -0
  60. package/dist/services/installer-service.d.ts.map +1 -0
  61. package/dist/services/installer-service.js +98 -0
  62. package/dist/services/installer-service.js.map +1 -0
  63. package/dist/services/state-service.d.ts +40 -0
  64. package/dist/services/state-service.d.ts.map +1 -0
  65. package/dist/services/state-service.js +342 -0
  66. package/dist/services/state-service.js.map +1 -0
  67. package/dist/services/tool-handlers.d.ts +10 -0
  68. package/dist/services/tool-handlers.d.ts.map +1 -0
  69. package/dist/services/tool-handlers.js +198 -0
  70. package/dist/services/tool-handlers.js.map +1 -0
  71. package/dist/types/agent.d.ts +10 -0
  72. package/dist/types/agent.d.ts.map +1 -0
  73. package/dist/types/agent.js +2 -0
  74. package/dist/types/agent.js.map +1 -0
  75. package/dist/types/conversation.d.ts +12 -0
  76. package/dist/types/conversation.d.ts.map +1 -0
  77. package/dist/types/conversation.js +2 -0
  78. package/dist/types/conversation.js.map +1 -0
  79. package/dist/types/create-conversation-params.d.ts +9 -0
  80. package/dist/types/create-conversation-params.d.ts.map +1 -0
  81. package/dist/types/create-conversation-params.js +2 -0
  82. package/dist/types/create-conversation-params.js.map +1 -0
  83. package/dist/types/index.d.ts +11 -0
  84. package/dist/types/index.d.ts.map +1 -0
  85. package/dist/types/index.js +2 -0
  86. package/dist/types/index.js.map +1 -0
  87. package/dist/types/install-options.d.ts +7 -0
  88. package/dist/types/install-options.d.ts.map +1 -0
  89. package/dist/types/install-options.js +2 -0
  90. package/dist/types/install-options.js.map +1 -0
  91. package/dist/types/message.d.ts +10 -0
  92. package/dist/types/message.d.ts.map +1 -0
  93. package/dist/types/message.js +2 -0
  94. package/dist/types/message.js.map +1 -0
  95. package/dist/types/notification.d.ts +10 -0
  96. package/dist/types/notification.d.ts.map +1 -0
  97. package/dist/types/notification.js +2 -0
  98. package/dist/types/notification.js.map +1 -0
  99. package/dist/types/parse-result.d.ts +4 -0
  100. package/dist/types/parse-result.d.ts.map +1 -0
  101. package/dist/types/parse-result.js +2 -0
  102. package/dist/types/parse-result.js.map +1 -0
  103. package/dist/types/parsed-command.d.ts +4 -0
  104. package/dist/types/parsed-command.d.ts.map +1 -0
  105. package/dist/types/parsed-command.js +2 -0
  106. package/dist/types/parsed-command.js.map +1 -0
  107. package/dist/types/parsed-error.d.ts +4 -0
  108. package/dist/types/parsed-error.d.ts.map +1 -0
  109. package/dist/types/parsed-error.js +2 -0
  110. package/dist/types/parsed-error.js.map +1 -0
  111. package/dist/types/profile-update.d.ts +7 -0
  112. package/dist/types/profile-update.d.ts.map +1 -0
  113. package/dist/types/profile-update.js +2 -0
  114. package/dist/types/profile-update.js.map +1 -0
  115. package/dist/types/profile.d.ts +7 -0
  116. package/dist/types/profile.d.ts.map +1 -0
  117. package/dist/types/profile.js +2 -0
  118. package/dist/types/profile.js.map +1 -0
  119. package/dist/types/uninstall-options.d.ts +7 -0
  120. package/dist/types/uninstall-options.d.ts.map +1 -0
  121. package/dist/types/uninstall-options.js +2 -0
  122. package/dist/types/uninstall-options.js.map +1 -0
  123. package/dist/utils/file-lock.d.ts +3 -0
  124. package/dist/utils/file-lock.d.ts.map +1 -0
  125. package/dist/utils/file-lock.js +102 -0
  126. package/dist/utils/file-lock.js.map +1 -0
  127. package/dist/utils/file-utils.d.ts +4 -0
  128. package/dist/utils/file-utils.d.ts.map +1 -0
  129. package/dist/utils/file-utils.js +28 -0
  130. package/dist/utils/file-utils.js.map +1 -0
  131. package/dist/utils/prompt-utils.d.ts +11 -0
  132. package/dist/utils/prompt-utils.d.ts.map +1 -0
  133. package/dist/utils/prompt-utils.js +48 -0
  134. package/dist/utils/prompt-utils.js.map +1 -0
  135. package/package.json +25 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-03-21
9
+
10
+ ### Added
11
+
12
+ - MCP server with 8 tools: `list_conversations`, `list_participants`, `send_message`, `get_conversation`, `update_profile`, `create_conversation`, `join_conversation`, `leave_conversation`
13
+ - Self-registering server: generates a fresh UUID per startup, registers the agent, joins the project conversation, performs full cleanup on shutdown, and reaps stale agents
14
+ - `gchat install` and `gchat uninstall` CLI commands for configuring Claude Code and Cursor MCP server entries (global or local scope)
15
+ - File-based shared state with atomic locking via `withFileLock` and `withStateLock`
16
+ - Inbox polling service for channel-push notifications to connected agents
17
+ - UUID validation on file paths to prevent directory traversal
18
+ - Participant verification on `send_message` (agent must be in conversation)
19
+ - Signal handler cleanup (SIGTERM, SIGINT) with `process.once`
20
+ - TypeScript project scaffolding with `tsconfig.json`, build scripts, and Vitest
21
+ - 58 unit tests covering state service, tool handlers, installer service, and server lifecycle
22
+ - Type definitions for agents, conversations, messages, notifications, and profiles
23
+ - Enums for `ConversationType`, `MessageType`, `NotificationType`, `IDE`, and `Scope`
24
+ - Tool schemas (`src/schemas/tool-schemas.ts`) and handlers (`src/services/tool-handlers.ts`)
25
+ - Environment config with `GC_PROJECT_PATH` (optional) and `GC_POLL_INTERVAL_MS` (optional, 2000ms default)
package/README.md ADDED
@@ -0,0 +1,170 @@
1
+ # Group Chat MCP
2
+
3
+ Multi-agent communication server using the Model Context Protocol. Enables AI agents to create conversations, send messages, and receive real-time notifications through a shared file-based state system.
4
+
5
+ ## Features
6
+
7
+ - Real-time multi-agent messaging via MCP channel notifications
8
+ - Project-scoped and direct message conversations
9
+ - Automatic agent registration and cleanup per session
10
+ - File-based shared state with atomic locking
11
+ - Zero-config setup via `gchat install`
12
+
13
+ ## Installation
14
+
15
+ ### From npm
16
+
17
+ ```bash
18
+ npm install -g group-chat-mcp
19
+ ```
20
+
21
+ ### From source
22
+
23
+ ```bash
24
+ git clone https://github.com/appboypov/group-chat-mcp.git
25
+ cd group-chat-mcp
26
+ npm install
27
+ npm run build
28
+ npm install -g .
29
+ ```
30
+
31
+ ## Setup
32
+
33
+ Run the installer to configure your IDE:
34
+
35
+ ```bash
36
+ gchat install
37
+ ```
38
+
39
+ The installer prompts for:
40
+ - **IDE**: Claude Code, Cursor, or Both
41
+ - **Scope**: Global (all projects) or Local (current project only)
42
+
43
+ This writes the MCP server configuration to the appropriate settings file. No manual JSON editing required.
44
+
45
+ To remove the configuration:
46
+
47
+ ```bash
48
+ gchat uninstall
49
+ ```
50
+
51
+ ### Enable channel notifications
52
+
53
+ Channel notifications allow agents to receive messages in real-time as they arrive. For Claude Code, start your session with:
54
+
55
+ ```bash
56
+ claude --dangerously-load-development-channels server:group-chat-mcp
57
+ ```
58
+
59
+ Without this flag, agents can still read messages by calling `get_conversation`, but incoming messages will not be injected into the conversation automatically.
60
+
61
+ ## Usage
62
+
63
+ After setup, the MCP server starts automatically when your IDE launches a session. Each session:
64
+
65
+ 1. Generates a unique agent ID
66
+ 2. Registers the agent in the shared state
67
+ 3. Joins the project conversation (one per project directory)
68
+ 4. Polls for incoming notifications
69
+ 5. Cleans up on disconnect (leaves conversations, unregisters)
70
+
71
+ Multiple agents in the same project directory share a single project conversation.
72
+
73
+ ## Tools
74
+
75
+ ### list_conversations
76
+
77
+ List active conversations.
78
+
79
+ | Input | Type | Required | Description |
80
+ |-------|------|----------|-------------|
81
+ | scope | string | No | `"project"`, `"global"`, or `"all"` (default: `"all"`) |
82
+
83
+ Returns a list of active conversations with ID, name, type, topic, and participant count.
84
+
85
+ ### list_participants
86
+
87
+ List participants in a conversation or all registered agents.
88
+
89
+ | Input | Type | Required | Description |
90
+ |-------|------|----------|-------------|
91
+ | conversationId | string | No | If provided, lists participants in that conversation. Otherwise lists all agents. |
92
+
93
+ Returns agent details including ID, name, role, expertise, and status.
94
+
95
+ ### send_message
96
+
97
+ Send a message to a conversation or directly to another agent.
98
+
99
+ | Input | Type | Required | Description |
100
+ |-------|------|----------|-------------|
101
+ | content | string | Yes | Message content |
102
+ | conversationId | string | No | Target conversation ID |
103
+ | agentId | string | No | Target agent ID for direct message |
104
+
105
+ Either `conversationId` or `agentId` is required. Returns confirmation with message ID.
106
+
107
+ ### get_conversation
108
+
109
+ Get conversation details and message history.
110
+
111
+ | Input | Type | Required | Description |
112
+ |-------|------|----------|-------------|
113
+ | conversationId | string | Yes | Conversation ID |
114
+
115
+ Returns conversation metadata and full message history.
116
+
117
+ ### update_profile
118
+
119
+ Update the current agent's profile.
120
+
121
+ | Input | Type | Required | Description |
122
+ |-------|------|----------|-------------|
123
+ | name | string | No | Display name |
124
+ | role | string | No | Agent role |
125
+ | expertise | string | No | Areas of expertise |
126
+ | status | string | No | Current status |
127
+
128
+ Returns the updated profile.
129
+
130
+ ### create_conversation
131
+
132
+ Create a new group conversation.
133
+
134
+ | Input | Type | Required | Description |
135
+ |-------|------|----------|-------------|
136
+ | name | string | Yes | Conversation name |
137
+ | topic | string | No | Conversation topic |
138
+
139
+ Returns the created conversation details.
140
+
141
+ ### join_conversation
142
+
143
+ Join an existing conversation.
144
+
145
+ | Input | Type | Required | Description |
146
+ |-------|------|----------|-------------|
147
+ | conversationId | string | Yes | Conversation ID |
148
+
149
+ Returns confirmation. Notifies existing participants.
150
+
151
+ ### leave_conversation
152
+
153
+ Leave a conversation.
154
+
155
+ | Input | Type | Required | Description |
156
+ |-------|------|----------|-------------|
157
+ | conversationId | string | Yes | Conversation ID |
158
+
159
+ Returns confirmation. Notifies remaining participants.
160
+
161
+ ## Configuration
162
+
163
+ | Variable | Required | Default | Description |
164
+ |----------|----------|---------|-------------|
165
+ | GC_PROJECT_PATH | No | `process.cwd()` | Override the project directory path (must be an absolute path) |
166
+ | GC_POLL_INTERVAL_MS | No | `2000` | Inbox polling interval in milliseconds |
167
+
168
+ ## License
169
+
170
+ MIT
@@ -0,0 +1,3 @@
1
+ export declare const GC_PROJECT_PATH: string | undefined;
2
+ export declare const GC_POLL_INTERVAL_MS: number;
3
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/constants/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAE,MAAM,GAAG,SAAuC,CAAC;AAM/E,eAAO,MAAM,mBAAmB,EAAE,MAA8D,CAAC"}
@@ -0,0 +1,6 @@
1
+ export const GC_PROJECT_PATH = process.env.GC_PROJECT_PATH;
2
+ const parsedPollInterval = process.env.GC_POLL_INTERVAL_MS
3
+ ? parseInt(process.env.GC_POLL_INTERVAL_MS, 10)
4
+ : 2000;
5
+ export const GC_POLL_INTERVAL_MS = isNaN(parsedPollInterval) ? 2000 : parsedPollInterval;
6
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/constants/env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAuB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAE/E,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB;IACxD,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,EAAE,CAAC;IAC/C,CAAC,CAAC,IAAI,CAAC;AAET,MAAM,CAAC,MAAM,mBAAmB,GAAW,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const CLAUDE_CODE_GLOBAL: string;
2
+ export declare const CURSOR_GLOBAL: string;
3
+ export declare function CLAUDE_CODE_LOCAL(): string;
4
+ export declare function CURSOR_LOCAL(): string;
5
+ //# sourceMappingURL=settings-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-paths.d.ts","sourceRoot":"","sources":["../../src/constants/settings-paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,QAAsD,CAAC;AACtF,eAAO,MAAM,aAAa,QAAiD,CAAC;AAE5E,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC"}
@@ -0,0 +1,11 @@
1
+ import os from 'node:os';
2
+ import path from 'node:path';
3
+ export const CLAUDE_CODE_GLOBAL = path.join(os.homedir(), '.claude', 'settings.json');
4
+ export const CURSOR_GLOBAL = path.join(os.homedir(), '.cursor', 'mcp.json');
5
+ export function CLAUDE_CODE_LOCAL() {
6
+ return path.join(process.cwd(), '.mcp.json');
7
+ }
8
+ export function CURSOR_LOCAL() {
9
+ return path.join(process.cwd(), '.cursor', 'mcp.json');
10
+ }
11
+ //# sourceMappingURL=settings-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-paths.js","sourceRoot":"","sources":["../../src/constants/settings-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAE5E,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const BASE_DIR: string;
2
+ export declare const AGENTS_FILE = "agents.json";
3
+ export declare const CONVERSATIONS_FILE = "conversations.json";
4
+ export declare const MESSAGES_DIR = "messages";
5
+ export declare const INBOXES_DIR = "inboxes";
6
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/constants/storage.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAA6C,CAAC;AACnE,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,WAAW,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ import os from 'node:os';
2
+ import path from 'node:path';
3
+ export const BASE_DIR = path.join(os.homedir(), '.group-chat-mcp');
4
+ export const AGENTS_FILE = 'agents.json';
5
+ export const CONVERSATIONS_FILE = 'conversations.json';
6
+ export const MESSAGES_DIR = 'messages';
7
+ export const INBOXES_DIR = 'inboxes';
8
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/constants/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare enum ConversationType {
2
+ Project = "project",
3
+ Dm = "dm",
4
+ Group = "group"
5
+ }
6
+ //# sourceMappingURL=conversation-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-type.d.ts","sourceRoot":"","sources":["../../src/enums/conversation-type.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,EAAE,OAAO;IACT,KAAK,UAAU;CAChB"}
@@ -0,0 +1,7 @@
1
+ export var ConversationType;
2
+ (function (ConversationType) {
3
+ ConversationType["Project"] = "project";
4
+ ConversationType["Dm"] = "dm";
5
+ ConversationType["Group"] = "group";
6
+ })(ConversationType || (ConversationType = {}));
7
+ //# sourceMappingURL=conversation-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-type.js","sourceRoot":"","sources":["../../src/enums/conversation-type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6BAAS,CAAA;IACT,mCAAe,CAAA;AACjB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B"}
@@ -0,0 +1,5 @@
1
+ export declare enum IDE {
2
+ ClaudeCode = "claudeCode",
3
+ Cursor = "cursor"
4
+ }
5
+ //# sourceMappingURL=ide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ide.d.ts","sourceRoot":"","sources":["../../src/enums/ide.ts"],"names":[],"mappings":"AAAA,oBAAY,GAAG;IACb,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB"}
@@ -0,0 +1,6 @@
1
+ export var IDE;
2
+ (function (IDE) {
3
+ IDE["ClaudeCode"] = "claudeCode";
4
+ IDE["Cursor"] = "cursor";
5
+ })(IDE || (IDE = {}));
6
+ //# sourceMappingURL=ide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ide.js","sourceRoot":"","sources":["../../src/enums/ide.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,GAGX;AAHD,WAAY,GAAG;IACb,gCAAyB,CAAA;IACzB,wBAAiB,CAAA;AACnB,CAAC,EAHW,GAAG,KAAH,GAAG,QAGd"}
@@ -0,0 +1,4 @@
1
+ export { ConversationType } from './conversation-type.js';
2
+ export { MessageType } from './message-type.js';
3
+ export { NotificationType } from './notification-type.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { ConversationType } from './conversation-type.js';
2
+ export { MessageType } from './message-type.js';
3
+ export { NotificationType } from './notification-type.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare enum MessageType {
2
+ Message = "message",
3
+ System = "system"
4
+ }
5
+ //# sourceMappingURL=message-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-type.d.ts","sourceRoot":"","sources":["../../src/enums/message-type.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB"}
@@ -0,0 +1,6 @@
1
+ export var MessageType;
2
+ (function (MessageType) {
3
+ MessageType["Message"] = "message";
4
+ MessageType["System"] = "system";
5
+ })(MessageType || (MessageType = {}));
6
+ //# sourceMappingURL=message-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-type.js","sourceRoot":"","sources":["../../src/enums/message-type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
@@ -0,0 +1,9 @@
1
+ export declare enum NotificationType {
2
+ Message = "message",
3
+ Join = "join",
4
+ Leave = "leave",
5
+ ProfileUpdate = "profile_update",
6
+ ConversationCreated = "conversation_created",
7
+ ConversationUpdated = "conversation_updated"
8
+ }
9
+ //# sourceMappingURL=notification-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-type.d.ts","sourceRoot":"","sources":["../../src/enums/notification-type.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,aAAa,mBAAmB;IAChC,mBAAmB,yBAAyB;IAC5C,mBAAmB,yBAAyB;CAC7C"}
@@ -0,0 +1,10 @@
1
+ export var NotificationType;
2
+ (function (NotificationType) {
3
+ NotificationType["Message"] = "message";
4
+ NotificationType["Join"] = "join";
5
+ NotificationType["Leave"] = "leave";
6
+ NotificationType["ProfileUpdate"] = "profile_update";
7
+ NotificationType["ConversationCreated"] = "conversation_created";
8
+ NotificationType["ConversationUpdated"] = "conversation_updated";
9
+ })(NotificationType || (NotificationType = {}));
10
+ //# sourceMappingURL=notification-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-type.js","sourceRoot":"","sources":["../../src/enums/notification-type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,iCAAa,CAAA;IACb,mCAAe,CAAA;IACf,oDAAgC,CAAA;IAChC,gEAA4C,CAAA;IAC5C,gEAA4C,CAAA;AAC9C,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B"}
@@ -0,0 +1,5 @@
1
+ export declare enum Scope {
2
+ Global = "global",
3
+ Local = "local"
4
+ }
5
+ //# sourceMappingURL=scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/enums/scope.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB"}
@@ -0,0 +1,6 @@
1
+ export var Scope;
2
+ (function (Scope) {
3
+ Scope["Global"] = "global";
4
+ Scope["Local"] = "local";
5
+ })(Scope || (Scope = {}));
6
+ //# sourceMappingURL=scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/enums/scope.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,0BAAiB,CAAA;IACjB,wBAAe,CAAA;AACjB,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB"}
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import type { ParseResult } from './types/parse-result.js';
3
+ export declare function parseCommand(args: string[]): ParseResult;
4
+ //# sourceMappingURL=gchat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gchat.d.ts","sourceRoot":"","sources":["../src/gchat.ts"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,CASxD"}
package/dist/gchat.js ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env node
2
+ import { realpathSync } from 'node:fs';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { IDE } from './enums/ide.js';
5
+ import { Scope } from './enums/scope.js';
6
+ import { InstallerService } from './services/installer-service.js';
7
+ import { PromptUtils } from './utils/prompt-utils.js';
8
+ const installer = new InstallerService();
9
+ export function parseCommand(args) {
10
+ const command = args[0];
11
+ if (!command) {
12
+ return { error: 'no-command' };
13
+ }
14
+ if (command !== 'install' && command !== 'uninstall') {
15
+ return { error: 'unknown-command' };
16
+ }
17
+ return { command };
18
+ }
19
+ async function main() {
20
+ const args = process.argv.slice(2);
21
+ const result = parseCommand(args);
22
+ if ('error' in result) {
23
+ if (result.error === 'no-command') {
24
+ console.error('Usage: gchat <command>');
25
+ console.error('Commands:');
26
+ console.error(' install Install group-chat-mcp into your IDE');
27
+ console.error(' uninstall Remove group-chat-mcp from your IDE');
28
+ process.exit(1);
29
+ }
30
+ console.error(`Unknown command: ${args[0]}`);
31
+ console.error('Available commands: install, uninstall');
32
+ process.exit(1);
33
+ }
34
+ const prompt = new PromptUtils();
35
+ try {
36
+ const ides = await prompt.selectIDE();
37
+ const scope = await prompt.selectScope();
38
+ for (const ide of ides) {
39
+ const ideName = ide === IDE.ClaudeCode ? 'Claude Code' : 'Cursor';
40
+ const scopeName = scope === Scope.Global ? 'global' : 'local';
41
+ if (result.command === 'install') {
42
+ await installer.install({ ide, scope });
43
+ const settingsPath = installer.resolveSettingsPath(ide, scope);
44
+ console.log(`✓ Installed group-chat-mcp for ${ideName} (${scopeName}): ${settingsPath}`);
45
+ }
46
+ else {
47
+ await installer.uninstall({ ide, scope });
48
+ const settingsPath = installer.resolveSettingsPath(ide, scope);
49
+ console.log(`✓ Uninstalled group-chat-mcp from ${ideName} (${scopeName}): ${settingsPath}`);
50
+ }
51
+ }
52
+ }
53
+ finally {
54
+ prompt.close();
55
+ }
56
+ }
57
+ const currentFile = fileURLToPath(import.meta.url);
58
+ const isDirectExecution = (() => {
59
+ try {
60
+ return realpathSync(process.argv[1]) === currentFile;
61
+ }
62
+ catch {
63
+ return false;
64
+ }
65
+ })();
66
+ if (isDirectExecution) {
67
+ main().catch((err) => {
68
+ console.error(err instanceof Error ? err.message : String(err));
69
+ process.exit(1);
70
+ });
71
+ }
72
+ //# sourceMappingURL=gchat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gchat.js","sourceRoot":"","sources":["../src/gchat.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAEzC,MAAM,UAAU,YAAY,CAAC,IAAc;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IACjC,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QACrD,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,I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 import { NotificationType } from '../enums/notification-type.js';
2
+ import { StateService } from '../services/state-service.js';
3
+ export declare function writeNotificationToParticipants(stateService: StateService, conversationId: string, senderId: string, type: NotificationType, content: string, excludeAgentId?: string): Promise<void>;
4
+ export declare function handleToolCall(stateService: StateService, name: string, agentId: string, rawArgs: Record<string, unknown> | undefined): Promise<{
5
+ content: {
6
+ type: "text";
7
+ text: string;
8
+ }[];
9
+ }>;
10
+ //# sourceMappingURL=tool-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/tool-handlers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAWjE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAa5D,wBAAsB,+BAA+B,CACnD,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED,wBAAsB,cAAc,CAClC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;;;;GAuN7C"}