MCPcopy Create free account
hub / github.com/ConsortiumAI/Consortium / constructor

Method constructor

packages/consortium-cli/src/claude/session.ts:30–60  ·  view source on GitHub ↗
(opts: {
        api: ApiClient,
        client: ApiSessionClient,
        path: string,
        logPath: string,
        sessionId: string | null,
        claudeEnvVars?: Record<string, string>,
        claudeArgs?: string[],
        mcpServers: Record<string, any>,
        messageQueue: MessageQueue2<EnhancedMode>,
        onModeChange: (mode: 'local' | 'remote') => void,
        allowedTools?: string[],
    })

Source from the content-addressed store, hash-verified

28 private keepAliveInterval: NodeJS.Timeout;
29
30 constructor(opts: {
31 api: ApiClient,
32 client: ApiSessionClient,
33 path: string,
34 logPath: string,
35 sessionId: string | null,
36 claudeEnvVars?: Record<string, string>,
37 claudeArgs?: string[],
38 mcpServers: Record<string, any>,
39 messageQueue: MessageQueue2<EnhancedMode>,
40 onModeChange: (mode: 'local' | 'remote') => void,
41 allowedTools?: string[],
42 }) {
43 this.path = opts.path;
44 this.api = opts.api;
45 this.client = opts.client;
46 this.logPath = opts.logPath;
47 this.sessionId = opts.sessionId;
48 this.queue = opts.messageQueue;
49 this.claudeEnvVars = opts.claudeEnvVars;
50 this.claudeArgs = opts.claudeArgs;
51 this.mcpServers = opts.mcpServers;
52 this.allowedTools = opts.allowedTools;
53 this._onModeChange = opts.onModeChange;
54
55 // Start keep alive
56 this.client.keepAlive(this.thinking, this.mode);
57 this.keepAliveInterval = setInterval(() => {
58 this.client.keepAlive(this.thinking, this.mode);
59 }, 2000);
60 }
61
62 cleanup = (): void => {
63 clearInterval(this.keepAliveInterval);

Callers

nothing calls this directly

Calls 1

keepAliveMethod · 0.80

Tested by

no test coverage detected