@interleave/recorder · v0.2.0

Instrument the race.
Keep your app in control.

Add an opt-in session recorder to an agent-callable application without changing its framework or surrendering its state model.

Dependency-free core Framework-independent MIT licensed
THREE STEPS

Make the interleaving observable.

Interleave records what your app can prove: tool calls, semantic human actions, and the state before and after each transition.

01

Describe relevant state

Give the recorder a small, serializable view of the application state that matters to the operation.

02

Wrap tools and human actions

Record the native WebMCP call and the semantic UI edits that can happen while that call remains pending.

03

Apply your application rule

Replay the captured sequence against the behavior your product promises, then export the failure as a regression.

MINIMAL INTEGRATIONTypeScript
import { SessionRecorder } from '@interleave/recorder';

const recorder = new SessionRecorder({
  adapter: { id: 'document-editor', version: 1 },
  readState: () => ({
    text: editor.text,
    revision: editor.revision,
  }),
  redact: redactForSharing,
});

document.modelContext.registerTool({
  name: 'save_document',
  description: 'Save the current document.',
  inputSchema: saveSchema,
  execute: (input, options) =>
    recorder.run('save_document', input, 'native', () =>
      editor.save(input, options?.signal),
    ),
});

function editText(text) {
  const before = readEditorState();
  editor.setText(text);
  recorder.stateChange(
    'edit_text', { text }, before, readEditorState(), 'manual'
  );
}

Your model stays yours.

The package supplies trustworthy receipts. Your adapter decides which state matters and what should happen during replay.

  • The recorder captures only values supplied by your integration.
  • Your application defines correctness rules and replay behavior.
  • Optional redaction runs before state enters the recording.
  • No browser patching, hidden reasoning, or cross-site inspection.
INSTALL THE PUBLIC BUILDnpm install https://interleave-webmcp-lab.asaborodaniel.chatgpt.site/interleave-recorder-0.2.0.tgz
Read the package source