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 / @UseMembers (11)
find
find(projectId: string, agentId: string, name: string): ScheduleStateRow | null@paramprojectId
string@paramagentId
string@paramname
string@returns
ScheduleStateRow | nulllistByAgent
listByAgent(projectId: string, agentId: string): ScheduleStateRow[]@paramprojectId
string@paramagentId
string@returns
ScheduleStateRow[]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@paramprojectId
string@paramagentId
string@paramname
string@paramslotMs
number@returns
voidmarkFired
markFired(projectId: string, agentId: string, name: string, firedAt: string, oneShot: boolean): void@paramprojectId
string@paramagentId
string@paramname
string@paramfiredAt
string@paramoneShot
boolean@returns
voidmarkMissed
markMissed(projectId: string, agentId: string, name: string): void@paramprojectId
string@paramagentId
string@paramname
string@returns
voidmarkInvalid
markInvalid(projectId: string, agentId: string, name: string, reason: string): void@paramprojectId
string@paramagentId
string@paramname
string@paramreason
string@returns
voiddelete
delete(projectId: string, agentId: string, name: string): void@paramprojectId
string@paramagentId
string@paramname
string@returns
voiddeleteMissing
deleteMissing(projectId: string, agentId: string, presentNames: string[]): string[]@paramprojectId
string@paramagentId
string@parampresentNames
string[]@returns
string[]deleteByAgent
deleteByAgent(projectId: string, agentId: string): void@paramprojectId
string@paramagentId
string@returns
voiddeleteByProject
deleteByProject(projectId: string): void@paramprojectId
string@returns
void