MCPcopy Create free account
hub / github.com/tiann/hapi / constructor

Method constructor

cli/src/agent/sessionBase.ts:55–80  ·  view source on GitHub ↗
(opts: AgentSessionBaseOptions<Mode>)

Source from the content-addressed store, hash-verified

53 protected collaborationMode?: SessionCollaborationMode;
54
55 constructor(opts: AgentSessionBaseOptions<Mode>) {
56 this.path = opts.path;
57 this.api = opts.api;
58 this.client = opts.client;
59 this.logPath = opts.logPath;
60 this.sessionId = opts.sessionId;
61 this.queue = opts.messageQueue;
62 this._onModeChange = opts.onModeChange;
63 this.applySessionIdToMetadata = opts.applySessionIdToMetadata;
64 this.sessionLabel = opts.sessionLabel;
65 this.sessionIdLabel = opts.sessionIdLabel;
66 this.mode = opts.mode ?? 'local';
67 this.permissionMode = opts.permissionMode;
68 this.model = opts.model;
69 this.modelReasoningEffort = opts.modelReasoningEffort;
70 this.effort = opts.effort;
71 this.collaborationMode = opts.collaborationMode;
72
73 this.queue.onBatchConsumed = (localIds) => this.client.emitMessagesConsumed(localIds);
74
75 this.client.keepAlive(this.thinking, this.mode, this.getKeepAliveRuntime());
76 this.keepAliveInterval = setInterval(() => {
77 this.client.keepAlive(this.thinking, this.mode, this.getKeepAliveRuntime());
78 }, 2000);
79
80 }
81
82 onThinkingChange = (thinking: boolean) => {
83 this.thinking = thinking;

Callers

nothing calls this directly

Calls 3

getKeepAliveRuntimeMethod · 0.95
emitMessagesConsumedMethod · 0.80
keepAliveMethod · 0.80

Tested by

no test coverage detected