← All @molecule/* packages · App templates
@molecule/api-agent-transcript-molecule-ideProvider bond · agent-transcript · API (Node) · v1.0.0 · Apache-2.0
Reads a Molecule IDE conversation (its stored JSON) into a normalized agent session
npm install @molecule/api-agent-transcript-molecule-idenpm · Source on GitHub · Implements @molecule/api-agent-transcript
@molecule/api-agent-transcript-molecule-ide is a provider bond on the API (Node) side: it implements the agent-transcript core interface (@molecule/api-agent-transcript) with a concrete vendor or library behind it.
Your code calls the core; you wire this provider once at startup. Swapping vendors later is one line in that wiring, not a rewrite.
import { readFileSync } from 'node:fs'
import { readTranscript, setProvider } from '@molecule/api-agent-transcript'
import { provider } from '@molecule/api-agent-transcript-molecule-ide'
setProvider(provider)
const session = readTranscript({
text: readFileSync('conversation.json', 'utf8'),
fileName: 'conversation.json',
})Works with: @molecule/api-agent-transcript
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Molecule IDE transcript reader for @molecule/api-agent-transcript.
Reads a Molecule IDE conversation — the JSON molecule.dev stores for a
project's chat ({ messages: [{ role, content, model, timestamp, hidden, toolCalls }] }, or the bare messages array) — into a normalized
AgentSession: the person's messages, Synthase's replies with the model of
each, and every file its write_file / edit_file calls wrote.
import { readFileSync } from 'node:fs'
import { readTranscript, setProvider } from '@molecule/api-agent-transcript'
import { provider } from '@molecule/api-agent-transcript-molecule-ide'
setProvider(provider)
const session = readTranscript({
text: readFileSync('conversation.json', 'utf8'),
fileName: 'conversation.json',
})
provider
npm install @molecule/api-agent-transcript-molecule-ide @molecule/api-agent-transcript
looksLikeConversation(text)Whether a text is a stored Molecule IDE conversation.
function looksLikeConversation(text: string): boolean
text — The file's text.Returns: True when it parses as one.
readConversation(text)Read a stored Molecule IDE conversation.
function readConversation(text: string): AgentSession
text — The conversation's JSON.Returns: The normalized session.
providerReads a Molecule IDE conversation (its stored JSON).
const provider: AgentTranscriptReader
Implements @molecule/api-agent-transcript interface.
Setup function to register this provider with the core interface:
import { setProvider } from '@molecule/api-agent-transcript'
import { provider } from '@molecule/api-agent-transcript-molecule-ide'
export function setupAgentTranscriptMoleculeIde(): void {
setProvider(provider)
}
Peer dependencies:
@molecule/api-agent-transcript ^1.0.0@molecule/api-agent-transcript
Dropped: messages the platform sends on its own (hidden: true,
[auto-continue], [project-context]) and system rows (cards shown to
the user). A user turn is only what a person typed.
A stored row may elide a long file's content ([elided N chars; the file is on disk]); that write is kept with text: '' and complete: false.
detect() claims only JSON with Molecule's own markers (tool calls with a
name and input, content blocks, or the row's projectId / aiContext),
so it never mistakes a generic chat log for one.