@prismshadow/penguin-library-session · library/session/src/session.ts:203

SessionDrivers

interface

SessionDrivers: the human a Session acts for — the one who last started a run in it (a prompt in the app, the scheduler on its creator's behalf), else the owner of its Project. An agent's calls reach the server with the admin API token; this is how they are attributed to a person (whose own Chrome the agent then drives). The mechanism SessionDriverRegistry implements.

API

@Interface()
export abstract class SessionDrivers {
  abstract note(sessionId: string, userId: string): void;
  abstract driverOf(sessionId: string): string | null;
  abstract runDriverOf(sessionId: string): string | null;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use

Members (3)

note

note(sessionId: string, userId: string): void

userId started a run in sessionId.

@paramsessionIdstring
@paramuserIdstring
@returnsvoid

driverOf

driverOf(sessionId: string): string | null

The human sessionId acts for; null for a Session the server does not know.

@paramsessionIdstring
@returnsstring | null

runDriverOf

runDriverOf(sessionId: string): string | null

The person whose run is in progress in sessionId right now — the signed-in user who started it (RuntimeEntry.runDriver) — or, for a subagent's Session, in its root; null when no run is in progress, or the one in progress was started by nobody (the local API token, a schedule without a creator, the Agent API, company mode, a goal, a compaction) or was steered by someone else. Memory only: nothing is in progress after a restart. What a session-driver plugin command runs as for an Agent.

@paramsessionIdstring
@returnsstring | null