happy-mcp-server 0.3.0 → 0.3.1
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.
|
@@ -3,7 +3,7 @@ import { randomUUID } from 'crypto';
|
|
|
3
3
|
import { encryptToBase64 } from '../auth/crypto.js';
|
|
4
4
|
const PERMISSION_MODES = ['default', 'acceptEdits', 'bypassPermissions', 'plan', 'read-only', 'safe-yolo', 'yolo'];
|
|
5
5
|
export function registerSendMessage(server, api, sessionManager) {
|
|
6
|
-
return server.tool('send_message', 'Send a message to a Happy Coder session. The message will appear as a user message in the session. Can optionally change the permission mode.', {
|
|
6
|
+
return server.tool('send_message', 'Send a message to a Happy Coder session. The message will appear as a user message in the session. If the session is actively generating, the message will be queued and processed when the session is ready. Can optionally change the permission mode.', {
|
|
7
7
|
sessionId: z.string().describe('The session ID to send the message to'),
|
|
8
8
|
message: z.string().describe('The message text to send'),
|
|
9
9
|
meta: z.object({
|
|
@@ -17,10 +17,6 @@ export function registerSendMessage(server, api, sessionManager) {
|
|
|
17
17
|
if (!session) {
|
|
18
18
|
return { isError: true, content: [{ type: 'text', text: JSON.stringify({ error: 'SessionNotFound', message: `Session ${sessionId} not found` }) }] };
|
|
19
19
|
}
|
|
20
|
-
const status = sessionManager.getSessionStatus(sessionId);
|
|
21
|
-
if (status === 'active') {
|
|
22
|
-
return { isError: true, content: [{ type: 'text', text: JSON.stringify({ error: 'SessionNotIdle', message: 'Cannot send message while session is actively generating' }) }] };
|
|
23
|
-
}
|
|
24
20
|
// Build message in legacy format (verified against upstream)
|
|
25
21
|
const content = {
|
|
26
22
|
role: 'user',
|