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

Schedules

interface

Schedules: the mechanism SchedulesRepo implements.

API

@Interface()
export abstract class Schedules {
  abstract find(projectId: string, agentId: string, name: string): ScheduleStateRow | null;
  abstract listByAgent(projectId: string, agentId: string): ScheduleStateRow[];
  abstract registerOrSync(args: {
      projectId: string;
      agentId: string;
      name: string;
      startAtMs: number;
      defHash: string;
      /** Who vouches for the file as it stands: a person's own save; null for the token or a file found on disk. */
      creatorUserId: string | null;
      /** A person's save through the schedules route: the creator is written even when nothing changed. */
      attested?: boolean;
    }): { row: ScheduleStateRow; fresh: boolean };
  abstract markSlot(projectId: string, agentId: string, name: string, slotMs: number): void;
  abstract markFired(
      projectId: string,
      agentId: string,
      name: string,
      firedAt: string,
      oneShot: boolean,
    ): void;
  abstract markMissed(projectId: string, agentId: string, name: string): void;
  abstract markInvalid(projectId: string, agentId: string, name: string, reason: string): void;
  abstract delete(projectId: string, agentId: string, name: string): void;
  abstract deleteMissing(projectId: string, agentId: string, presentNames: string[]): string[];
  abstract deleteByAgent(projectId: string, agentId: string): void;
  abstract deleteByProject(projectId: string): void;
}

Contract Topology

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

Members (11)

find

find(projectId: string, agentId: string, name: string): ScheduleStateRow | null
@paramprojectIdstring
@paramagentIdstring
@paramnamestring
@returnsScheduleStateRow | null

listByAgent

listByAgent(projectId: string, agentId: string): ScheduleStateRow[]
@paramprojectIdstring
@paramagentIdstring
@returnsScheduleStateRow[]

registerOrSync

registerOrSync(args: { projectId: string; agentId: string; name: string; startAtMs: number; defHash: string; creatorUserId: string | null; attested?: boolean; }): { row: ScheduleStateRow; fresh: boolean }
@paramargs{ projectId: string; agentId: string; name: string; startAtMs: number; defHash: string; creatorUserId: string | null; attested?: boolean; }
@returns{ row: ScheduleStateRow; fresh: boolean }

markSlot

markSlot(projectId: string, agentId: string, name: string, slotMs: number): void
@paramprojectIdstring
@paramagentIdstring
@paramnamestring
@paramslotMsnumber
@returnsvoid

markFired

markFired(projectId: string, agentId: string, name: string, firedAt: string, oneShot: boolean): void
@paramprojectIdstring
@paramagentIdstring
@paramnamestring
@paramfiredAtstring
@paramoneShotboolean
@returnsvoid

markMissed

markMissed(projectId: string, agentId: string, name: string): void
@paramprojectIdstring
@paramagentIdstring
@paramnamestring
@returnsvoid

markInvalid

markInvalid(projectId: string, agentId: string, name: string, reason: string): void
@paramprojectIdstring
@paramagentIdstring
@paramnamestring
@paramreasonstring
@returnsvoid

delete

delete(projectId: string, agentId: string, name: string): void
@paramprojectIdstring
@paramagentIdstring
@paramnamestring
@returnsvoid

deleteMissing

deleteMissing(projectId: string, agentId: string, presentNames: string[]): string[]
@paramprojectIdstring
@paramagentIdstring
@parampresentNamesstring[]
@returnsstring[]

deleteByAgent

deleteByAgent(projectId: string, agentId: string): void
@paramprojectIdstring
@paramagentIdstring
@returnsvoid

deleteByProject

deleteByProject(projectId: string): void
@paramprojectIdstring
@returnsvoid