@molecule/api-agent-transcript-copilot-chat

Provider bond · agent-transcript · API (Node) · v1.0.1 · Apache-2.0

Reads VS Code GitHub Copilot Chat exports (Chat: Export Chat…) into a normalized agent session

npm install @molecule/api-agent-transcript-copilot-chat

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

How it works

@molecule/api-agent-transcript-copilot-chat 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-copilot-chat'

setProvider(provider)
const file = 'chat.json'
const session = readTranscript({ text: readFileSync(file, 'utf8'), fileName: file })
console.log(session.harness, session.model) // 'GitHub Copilot Chat', 'copilot/…'

Works with: @molecule/api-agent-transcript

Reference

GitHub Copilot Chat transcript reader for @molecule/api-agent-transcript.

Reads the chat.json VS Code saves from "Chat: Export Chat…" (Command Palette, or the chat view's ⋯ menu) into a normalized AgentSession: each request as you typed it, each response's markdown, the model that answered, and the files the response edited.

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.

Quick Start

import { readFileSync } from 'node:fs'
import { readTranscript, setProvider } from '@molecule/api-agent-transcript'
import { provider } from '@molecule/api-agent-transcript-copilot-chat'

setProvider(provider)
const file = 'chat.json'
const session = readTranscript({ text: readFileSync(file, 'utf8'), fileName: file })
console.log(session.harness, session.model) // 'GitHub Copilot Chat', 'copilot/…'

Type

provider

Installation

npm install @molecule/api-agent-transcript-copilot-chat @molecule/api-agent-transcript

API

Functions

looksLikeChatExport(text)

Whether a text is a VS Code chat export.

function looksLikeChatExport(text: string): boolean
  • text — The file's text.

Returns: True on a positive match.

readChatExport(text)

Read a VS Code chat export.

function readChatExport(text: string): AgentSession
  • text — The export's text.

Returns: The normalized session.

Constants

provider

Reads the JSON VS Code's "Chat: Export Chat…" saves.

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-copilot-chat'

export function setupAgentTranscriptCopilotChat(): void {
  setProvider(provider)
}

Injection Notes

Requirements

Peer dependencies:

  • @molecule/api-agent-transcript ^1.0.0

Runtime Dependencies

  • @molecule/api-agent-transcript

  • The export is VS Code's, not Copilot's, so any chat participant's export reads the same way. harness is GitHub Copilot Chat when the responder is Copilot, otherwise VS Code Chat (<responder>).

  • model on each reply is the request's modelId as VS Code records it (e.g. copilot/gpt-5.3); the session's model is set when every reply used the same one.

  • Reply text is the response's markdown with inline file references written as `name`; thinking, tool-invocation and progress parts are not prose.

  • Files: each textEditGroup part is an edit, its text the inserted text of every edit in the group. Requests VS Code started itself (isSystemInitiated) contribute their reply but no user turn; requests hidden from the transcript are skipped.

  • Format verified 2026-09-29 against the VS Code source (chatImportExport.ts, chatModel.ts toExport()).