@assistkick/create 1.22.0 → 1.23.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.
package/package.json
CHANGED
package/templates/assistkick-product-system/packages/backend/src/services/chat_cli_bridge.ts
CHANGED
|
@@ -33,8 +33,8 @@ export interface SpawnOptions {
|
|
|
33
33
|
allowedTools?: string[];
|
|
34
34
|
/** Compacted conversation context to prepend to the system prompt */
|
|
35
35
|
continuationContext?: string;
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/** Path to a temporary MCP config JSON file to pass via --mcp-config */
|
|
37
|
+
mcpConfigPath?: string;
|
|
38
38
|
onEvent: (event: Record<string, unknown>) => void;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -92,9 +92,9 @@ export class ChatCliBridge {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
// MCP server configuration (
|
|
96
|
-
if (options.
|
|
97
|
-
args.push('--mcp-config', options.
|
|
95
|
+
// MCP server configuration (temp file path)
|
|
96
|
+
if (options.mcpConfigPath) {
|
|
97
|
+
args.push('--mcp-config', options.mcpConfigPath);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
// Prompt via stdin
|
package/templates/assistkick-product-system/packages/backend/src/services/chat_ws_handler.ts
CHANGED
|
@@ -30,6 +30,9 @@ import type { ChatMessageRepository } from './chat_message_repository.js';
|
|
|
30
30
|
import type { ChatSessionService } from './chat_session_service.js';
|
|
31
31
|
import type { TitleGeneratorService } from './title_generator_service.js';
|
|
32
32
|
import type { McpConfigService } from './mcp_config_service.js';
|
|
33
|
+
import { writeFileSync, unlinkSync } from 'node:fs';
|
|
34
|
+
import { tmpdir } from 'node:os';
|
|
35
|
+
import { join } from 'node:path';
|
|
33
36
|
|
|
34
37
|
export interface ChatWsHandlerDeps {
|
|
35
38
|
wss: WebSocketServer;
|
|
@@ -425,15 +428,18 @@ export class ChatWsHandler {
|
|
|
425
428
|
}
|
|
426
429
|
}
|
|
427
430
|
|
|
428
|
-
// Build
|
|
429
|
-
let
|
|
431
|
+
// Build MCP config temp file for this spawn (if user has MCP servers configured)
|
|
432
|
+
let mcpConfigPath: string | undefined;
|
|
433
|
+
let mcpConfigContent: string | undefined;
|
|
430
434
|
const userId = this.wsUserIds.get(ws);
|
|
431
435
|
if (userId && this.mcpConfigService) {
|
|
432
436
|
try {
|
|
433
437
|
const mergedServers = await this.mcpConfigService.buildMergedConfig(userId, projectId);
|
|
434
438
|
if (mergedServers) {
|
|
435
|
-
|
|
436
|
-
|
|
439
|
+
mcpConfigContent = JSON.stringify({ mcpServers: mergedServers }, null, 2);
|
|
440
|
+
mcpConfigPath = join(tmpdir(), `mcp-${claudeSessionId}.json`);
|
|
441
|
+
writeFileSync(mcpConfigPath, mcpConfigContent, 'utf-8');
|
|
442
|
+
this.log('CHAT_WS', `MCP config for user ${userId}: ${mcpConfigContent}`);
|
|
437
443
|
}
|
|
438
444
|
} catch (err: any) {
|
|
439
445
|
this.log('CHAT_WS', `Failed to build MCP config: ${err.message}`);
|
|
@@ -449,7 +455,7 @@ export class ChatWsHandler {
|
|
|
449
455
|
permissionMode,
|
|
450
456
|
allowedTools: msg.allowedTools,
|
|
451
457
|
continuationContext,
|
|
452
|
-
|
|
458
|
+
mcpConfigPath,
|
|
453
459
|
onEvent: (event) => {
|
|
454
460
|
// Forward to current WS (may have been re-attached after disconnect)
|
|
455
461
|
const currentWs = this.sessionToWs.get(claudeSessionId);
|
|
@@ -542,6 +548,11 @@ export class ChatWsHandler {
|
|
|
542
548
|
|
|
543
549
|
completion
|
|
544
550
|
.then((result) => {
|
|
551
|
+
// Clean up MCP config temp file
|
|
552
|
+
if (mcpConfigPath) {
|
|
553
|
+
try { unlinkSync(mcpConfigPath); } catch { /* already deleted */ }
|
|
554
|
+
}
|
|
555
|
+
|
|
545
556
|
// Look up the current WS — may differ from the original if client reconnected
|
|
546
557
|
const currentWs = this.sessionToWs.get(claudeSessionId);
|
|
547
558
|
if (currentWs) {
|
|
@@ -581,6 +592,7 @@ export class ChatWsHandler {
|
|
|
581
592
|
const parts: string[] = [];
|
|
582
593
|
if (result.stderr) parts.push(result.stderr);
|
|
583
594
|
if (result.stdoutNonJsonLines) parts.push(result.stdoutNonJsonLines);
|
|
595
|
+
if (mcpConfigContent) parts.push(`MCP config passed: ${mcpConfigContent}`);
|
|
584
596
|
errorDetail = parts.length > 0
|
|
585
597
|
? parts.join('\n')
|
|
586
598
|
: `CLI exited with code ${result.exitCode}`;
|