Skip to content

Graphorin API reference v0.8.0


Graphorin API reference / @graphorin/proactive / / CreateHeartbeatOptions

Interface: CreateHeartbeatOptions<TDeps>

Defined in: packages/proactive/src/heartbeat.ts:117

Options for createHeartbeat.

Stable

Type Parameters

Type ParameterDefault type
TDepsunknown

Properties

PropertyModifierTypeDescriptionDefined in
activeHours?readonlyActiveHoursDaily window in which beats may run. Absent = always.packages/proactive/src/heartbeat.ts:147
agentreadonlyAgent<TDeps, string>The agent every beat runs on. Dedicate an instance to the heartbeat: Agent.isBusy() guards THIS instance's in-flight run, and a shared instance would make beats and interactive turns collide on the one-run-per-instance invariant.packages/proactive/src/heartbeat.ts:124
checklistreadonly() => string | Promise<string | null> | nullThe beat's agenda. null / empty / whitespace skips the beat before any model call - an empty checklist must cost nothing.packages/proactive/src/heartbeat.ts:132
clearTimeout?readonly(handle) => void-packages/proactive/src/heartbeat.ts:176
deferMs?readonlynumberDeferral cadence while the gate is busy. Default 30s.packages/proactive/src/heartbeat.ts:169
id?readonlystringTrigger id + outcome taskId. Default 'heartbeat'.packages/proactive/src/heartbeat.ts:134
maxDefers?readonlynumberGive up after this many consecutive defers. Default 10.packages/proactive/src/heartbeat.ts:171
minOutcomeLength?readonlynumberReplies shorter than this (after sentinel stripping) are dropped as noise. Default 8 characters.packages/proactive/src/heartbeat.ts:144
now?readonly() => numberOverride the wall clock - used by tests.packages/proactive/src/heartbeat.ts:173
onOutcome?readonly(outcome) => void | Promise<void>Observer for delivered findings. Errors are caught + WARNed.packages/proactive/src/heartbeat.ts:158
onSkip?readonly(skip) => voidObserver for skipped fires. Errors are caught + WARNed.packages/proactive/src/heartbeat.ts:160
profile?readonlyHeartbeatProfile-packages/proactive/src/heartbeat.ts:145
runGate?readonly() => booleanExternal busy gate: true defers the beat. Default () => agent.isBusy(). A naive internal mutex would only defer against runs the heartbeat itself started - this gate exists so the composition root can point it at the real interactive runner.packages/proactive/src/heartbeat.ts:167
schedulereadonlyHeartbeatSchedule-packages/proactive/src/heartbeat.ts:127
schedulerreadonlySchedulerThe trigger scheduler the beat schedule registers on.packages/proactive/src/heartbeat.ts:126
sentinel?readonlystringThe all-quiet marker. A reply that carries nothing beyond the sentinel is suppressed, never delivered. Default 'HEARTBEAT_OK'.packages/proactive/src/heartbeat.ts:139
sessions?readonlySessionManagerSession manager for isolated beats: when present (and the profile is isolated), each beat creates a real session (tags: ['heartbeat']). Absent, beats still run isolated under fresh session IDS without session bookkeeping.packages/proactive/src/heartbeat.ts:154
setTimeout?readonly(cb, ms) => unknownOverride setTimeout / clearTimeout - used by tests.packages/proactive/src/heartbeat.ts:175
userId?readonlystringUser the created sessions belong to. Default 'heartbeat'.packages/proactive/src/heartbeat.ts:156
warn?readonly(message) => voidWARN sink. Default console.warn.packages/proactive/src/heartbeat.ts:178