Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/sessions / / SessionReplayer

Interface: SessionReplayer

Defined in: packages/sessions/src/replay/replayer.ts:61

Convenience surface returned by createSessionReplayer. The replayer is async-iterable; the agent runtime drives it under for await.

Stable

Methods

run()

ts
run(options): AsyncIterable<SessionReplayEvent>;

Defined in: packages/sessions/src/replay/replayer.ts:73

Run the replay engine. The caller threads in:

  • traceSource: an iterable of SpanRecords (from the observability trace log).
  • target: e.g. 'session:<id>'.
  • liveInvocation(record): a callback the engine invokes for every cassette tool-call record so the runtime can supply the live args + the idempotencyKey callback output. The callback returns the live invocation surface; when omitted, the engine treats the recorded args as the live args.

Parameters

ParameterType
optionsSessionReplayOptions & { liveInvocation?: (record) => Promise&lt;{ args: unknown; idempotencyKey?: string; validateRecordedOutput?: (output) => string | null; }>; target: string; traceSource?: | AsyncIterable<SpanRecord&lt;SpanType&gt;, any, any> | Iterable<SpanRecord&lt;SpanType&gt;, any, any>; }

Returns

AsyncIterable&lt;SessionReplayEvent&gt;