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 Parameter | Default type |
|---|---|
TDeps | unknown |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
activeHours? | readonly | ActiveHours | Daily window in which beats may run. Absent = always. | packages/proactive/src/heartbeat.ts:147 |
agent | readonly | Agent<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 |
checklist | readonly | () => string | Promise<string | null> | null | The 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? | readonly | number | Deferral cadence while the gate is busy. Default 30s. | packages/proactive/src/heartbeat.ts:169 |
id? | readonly | string | Trigger id + outcome taskId. Default 'heartbeat'. | packages/proactive/src/heartbeat.ts:134 |
maxDefers? | readonly | number | Give up after this many consecutive defers. Default 10. | packages/proactive/src/heartbeat.ts:171 |
minOutcomeLength? | readonly | number | Replies shorter than this (after sentinel stripping) are dropped as noise. Default 8 characters. | packages/proactive/src/heartbeat.ts:144 |
now? | readonly | () => number | Override 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) => void | Observer for skipped fires. Errors are caught + WARNed. | packages/proactive/src/heartbeat.ts:160 |
profile? | readonly | HeartbeatProfile | - | packages/proactive/src/heartbeat.ts:145 |
runGate? | readonly | () => boolean | External 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 |
schedule | readonly | HeartbeatSchedule | - | packages/proactive/src/heartbeat.ts:127 |
scheduler | readonly | Scheduler | The trigger scheduler the beat schedule registers on. | packages/proactive/src/heartbeat.ts:126 |
sentinel? | readonly | string | The 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? | readonly | SessionManager | Session 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) => unknown | Override setTimeout / clearTimeout - used by tests. | packages/proactive/src/heartbeat.ts:175 |
userId? | readonly | string | User the created sessions belong to. Default 'heartbeat'. | packages/proactive/src/heartbeat.ts:156 |
warn? | readonly | (message) => void | WARN sink. Default console.warn. | packages/proactive/src/heartbeat.ts:178 |