MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / liveSessionsFor

Method liveSessionsFor

src/workspaces/session-pool.ts:145–164  ·  view source on GitHub ↗

All live sessions belonging to a workspace, oldest-spawned first.

(wsId: string)

Source from the content-addressed store, hash-verified

143
144 /** All live sessions belonging to a workspace, oldest-spawned first. */
145 liveSessionsFor(wsId: string): LiveSessionInfo[] {
146 const ids = this.byWs.get(wsId);
147 if (!ids || ids.size === 0) return [];
148 const out: LiveSessionInfo[] = [];
149 for (const id of ids) {
150 const s = this.sessions.get(id);
151 if (!s) continue;
152 const adapter = this.adapterFor.get(id);
153 out.push({
154 id,
155 wsId: s.wsId,
156 name: s.name,
157 pid: s.pid,
158 startedAt: s.startedAt,
159 agent: adapter?.id ?? 'unknown',
160 agentSessionId: s.agentSessionId,
161 });
162 }
163 return out;
164 }
165
166 liveSessionCount(wsId: string): number {
167 return this.byWs.get(wsId)?.size ?? 0;

Callers 2

publicMetaFunction · 0.80
createWorkspaceRoutesFunction · 0.80

Calls 2

getMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected