@prismshadow/penguin-server · packages/server/src/runtime/session-activity.ts:9

SessionActivity

interface

SessionActivity: the session runtime's in-use answers.

API

@Interface()
export abstract class SessionActivity {
  abstract sessionInUse(sessionId: string): boolean;
  abstract agentInUse(projectId: string, agentId: string): boolean;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use
@Moduleexported by
@Provideprovided by
@Useconsumed by (1)

Members (2)

sessionInUse

sessionInUse(sessionId: string): boolean

A Task or a compaction under way, input queued behind one, a background process or subagent still running, or the Session being deleted. A subagent child runs inside its root's runtime, so it is in use while its root is. A Session that is not loaded is not in use, and nothing loads it without a Task starting through the Session's lock — so a caller that asks this and acts in the same synchronous step cannot be overtaken by a Task.

@paramsessionIdstring
@returnsboolean

agentInUse

agentInUse(projectId: string, agentId: string): boolean

Any Session of the Agent in use — one of its own, or a subagent child of another Agent's Session that runs as this Agent — or the Agent being deleted. What the Agent's shared folders (its tool environments) wait on.

@paramprojectIdstring
@paramagentIdstring
@returnsboolean