Graphorin API reference v0.12.1
Graphorin API reference / @graphorin/memory / / Consolidator
Interface: Consolidator
Defined in: packages/memory/src/consolidator/runtime.ts:95
Consolidator runtime surface returned by createConsolidator. Compatible with the placeholder shape so the facade can swap the implementation without breaking consumers.
Stable
Methods
config()
config(): ConsolidatorConfig;Defined in: packages/memory/src/consolidator/runtime.ts:120
Active config - frozen snapshot.
Returns
drainDlq()
drainDlq(scope): Promise<number>;Defined in: packages/memory/src/consolidator/runtime.ts:133
Drain DLQ rows whose nextRetryAt <= now.
Parameters
| Parameter | Type |
|---|---|
scope | SessionScope |
Returns
Promise<number>
fireNow()
fireNow(phase, scope?): Promise<
| PhaseOutcome
| null>;Defined in: packages/memory/src/consolidator/runtime.ts:104
Manual trigger for the requested phase. Skips phase gating + the idle/cron scheduler so admins can flush the queue on demand.
Parameters
| Parameter | Type |
|---|---|
phase | ConsolidatorPhase |
scope? | SessionScope |
Returns
Promise< | PhaseOutcome | null>
isFree()
isFree(): boolean;Defined in: packages/memory/src/consolidator/runtime.ts:131
True when tier === 'free'.
Returns
boolean
notifyActivity()
notifyActivity(scope?): Promise<
| PhaseOutcome
| null>;Defined in: packages/memory/src/consolidator/runtime.ts:149
Activity signal from the embedding runtime (item 7, A2): a turn finished / the transcript grew. Re-evaluates the buffer:N trigger - when the unconsolidated transcript tail (from the standard-phase cursor) reaches the configured token threshold (chars/4 proxy, the same measure as the W-081 transcript budget), the light+standard chain fires with reason { kind: 'buffer' }. The documented contract is "buffer:N OR idle:T": whichever comes first consolidates the settled segment, and the MCON-8 cooldown still applies so message bursts cannot storm the pipeline. No-op when no buffer:N trigger is configured, when the consolidator is stopped/paused, or when no scope is resolvable. The server calls this from its run tracker; library-mode callers invoke it from their own loop next to scheduler.recordActivity().
Parameters
| Parameter | Type |
|---|---|
scope? | SessionScope |
Returns
Promise< | PhaseOutcome | null>
onPhaseFinished()
onPhaseFinished(listener): () => void;Defined in: packages/memory/src/consolidator/runtime.ts:112
Subscribe to phase-finished notifications. Returns an unsubscribe.
Parameters
| Parameter | Type |
|---|---|
listener | PhaseListener |
Returns
() => void
pause()
pause(): Promise<void>;Defined in: packages/memory/src/consolidator/runtime.ts:108
Pause the consolidator until the next budget reset.
Returns
Promise<void>
recordExternalSpend()
recordExternalSpend(tokens, costUsd?): void;Defined in: packages/memory/src/consolidator/runtime.ts:118
Record memory-pipeline LLM spend that happened OUTSIDE a phase run (MCON-15 - e.g. workflow induction) so the daily ceilings cover it. Counted under the deep-phase bucket.
Parameters
| Parameter | Type |
|---|---|
tokens | number |
costUsd? | number |
Returns
void
registerWithScheduler()
registerWithScheduler(scheduler): Promise<RegisterTriggersResult>;Defined in: packages/memory/src/consolidator/runtime.ts:129
Register this consolidator's cron / idle triggers with a @graphorin/triggers scheduler so they fire trigger(...) automatically (the daemon ↔ triggers bridge - MCON-4). Uses the configured defaultScope; throws if none was set. Turn / event triggers are skipped (consumer-emitted). The standalone server calls this in beforeStart.
Parameters
| Parameter | Type |
|---|---|
scheduler | SchedulerLike |
Returns
Promise<RegisterTriggersResult>
resume()
resume(): Promise<void>;Defined in: packages/memory/src/consolidator/runtime.ts:110
Resume after pause().
Returns
Promise<void>
setTier()
setTier(tier): Promise<void>;Defined in: packages/memory/src/consolidator/runtime.ts:106
Replace the active tier - recomputes ceilings + phase set.
Parameters
| Parameter | Type |
|---|---|
tier | ConsolidatorTier |
Returns
Promise<void>
start()
start(): Promise<void>;Defined in: packages/memory/src/consolidator/runtime.ts:96
Returns
Promise<void>
status()
status(): Promise<ConsolidatorStatus>;Defined in: packages/memory/src/consolidator/runtime.ts:99
Returns
Promise<ConsolidatorStatus>
stop()
stop(): Promise<void>;Defined in: packages/memory/src/consolidator/runtime.ts:97
Returns
Promise<void>
trigger()
trigger(reason, scope): Promise<
| PhaseOutcome
| null>;Defined in: packages/memory/src/consolidator/runtime.ts:98
Parameters
| Parameter | Type |
|---|---|
reason | ConsolidatorTriggerReason |
scope | SessionScope |
Returns
Promise< | PhaseOutcome | null>