← All @molecule/* packages · App templates

@molecule/api-agent-transcript-molecule-ide

Provider 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-ide

npm · Source on GitHub · Implements @molecule/api-agent-transcript

How it works

@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

Reference

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.ts JSDoc, 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.

Quick Start

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',
})

Type

provider

Installation

npm install @molecule/api-agent-transcript-molecule-ide @molecule/api-agent-transcript

API

Functions

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.

Constants

provider

Reads a Molecule IDE conversation (its stored JSON).

const provider: AgentTranscriptReader

Core Interface

Implements @molecule/api-agent-transcript interface.

Bond Wiring

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)
}

Injection Notes

Requirements

Peer dependencies:

  • @molecule/api-agent-transcript ^1.0.0

Runtime Dependencies

  • @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.