Files
orca/src/main/daemon/terminal-host-session-listing.ts
T
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

33 lines
1.0 KiB
TypeScript

import type { ClaimedAgentPtyOwnerRegistry } from '../../shared/claimed-agent-pty-owner'
import type { Session } from './session'
import type { SessionInfo } from './types'
export function listLiveTerminalHostSessions(
sessions: ReadonlyMap<string, Session>,
agentSessionOwners: ClaimedAgentPtyOwnerRegistry
): SessionInfo[] {
const result: SessionInfo[] = []
for (const session of sessions.values()) {
if (!session.isAlive) {
continue
}
const size = session.getAppliedSize()
result.push({
sessionId: session.sessionId,
incarnationId: session.incarnationId,
state: session.state,
shellState: session.shellState,
isAlive: true,
...(session.terminalHandle ? { terminalHandle: session.terminalHandle } : {}),
wslDistro: session.wslDistro,
pid: session.pid,
cwd: session.getCwd(),
cols: size?.cols ?? 0,
rows: size?.rows ?? 0,
createdAt: 0,
agentSessionOwners: agentSessionOwners.listForPty(session.sessionId)
})
}
return result
}