@molecule/api-agent-transcript-autodetect 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-09-24T11:13:33.139Z
6
+ Generated: 2026-09-29T16:49:56.713Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-agent-transcript-autodetect
@@ -15,10 +15,23 @@ Generated: 2026-09-24T11:13:33.139Z
15
15
  The transcript reader to bond when files can come from more than one harness.
16
16
 
17
17
  Implements `@molecule/api-agent-transcript` by trying each bundled reader's
18
- `detect()` and delegating to the first that recognizes the file: Claude Code
19
- (`/export` text, session `.jsonl`), Codex CLI (Markdown export, rollout
20
- `.jsonl`) and the Molecule IDE (stored conversation JSON). `createReader()`
21
- composes any other list, including readers of your own. The example is the
18
+ `detect()` and delegating to the first that recognizes the file:
19
+
20
+ | Harness | Files |
21
+ | ------------------- | ---------------------------------------------------------------------------------- |
22
+ | Claude Code | `/export` text, session `.jsonl` |
23
+ | Codex CLI | Markdown export, rollout `.jsonl` |
24
+ | Molecule IDE | stored conversation JSON |
25
+ | Gemini CLI | session `.jsonl` / `.json`, `/chat save` checkpoint |
26
+ | Cline / Roo Code | a task's `ui_messages.json` |
27
+ | OpenCode | `opencode export` JSON |
28
+ | GitHub Copilot Chat | VS Code's "Export Chat…" `chat.json` |
29
+ | Cursor | "Export Chat" Markdown |
30
+ | Aider | `.aider.chat.history.md` |
31
+ | anything else | a Markdown / text chat with `## User`, `**User:**` or `User:` markers (tried last) |
32
+
33
+ `createReader()` composes any other list, including readers of your own;
34
+ `harnessReaders` is the list without the generic Markdown chat reader. The example is the
22
35
  usual job: read a post's folder of transcript exports at build time and
23
36
  attribute its paragraphs with `@molecule/api-text-provenance`, writing
24
37
  `provenance.json`.
@@ -39,7 +52,7 @@ import { provider as anyTranscript } from '@molecule/api-agent-transcript-autode
39
52
  import { attributeText, setProvider as setAttribution } from '@molecule/api-text-provenance'
40
53
  import { provider as wordOverlap } from '@molecule/api-text-provenance-overlap'
41
54
 
42
- setTranscriptReader(anyTranscript) // reads Claude Code, Codex and Molecule IDE exports
55
+ setTranscriptReader(anyTranscript) // reads every supported harness, plus plain Markdown chats
43
56
  setAttribution(wordOverlap)
44
57
 
45
58
  // One block of the post, in page order. `prompt` and `model` are on every ai span.
@@ -124,7 +137,7 @@ export function writeProvenance(outFile: string, provenance: Provenance): void {
124
137
  ## Installation
125
138
 
126
139
  ```bash
127
- npm install @molecule/api-agent-transcript-autodetect @molecule/api-agent-transcript @molecule/api-agent-transcript-claude-code @molecule/api-agent-transcript-codex @molecule/api-agent-transcript-molecule-ide
140
+ npm install @molecule/api-agent-transcript-autodetect @molecule/api-agent-transcript @molecule/api-agent-transcript-aider @molecule/api-agent-transcript-claude-code @molecule/api-agent-transcript-cline @molecule/api-agent-transcript-codex @molecule/api-agent-transcript-copilot-chat @molecule/api-agent-transcript-cursor @molecule/api-agent-transcript-gemini-cli @molecule/api-agent-transcript-markdown-chat @molecule/api-agent-transcript-molecule-ide @molecule/api-agent-transcript-opencode
128
141
  ```
129
142
 
130
143
  ## API
@@ -145,9 +158,24 @@ function createReader(readers: readonly AgentTranscriptReader[]): AgentTranscrip
145
158
 
146
159
  ### Constants
147
160
 
161
+ #### `harnessReaders`
162
+
163
+ Every harness-specific reader, in the order they are tried. Each accepts
164
+ only its own harness's files, so the order only matters for the generic
165
+ Markdown chat reader, which is not in this list. Compose
166
+ `createReader(harnessReaders)` when only a real harness's own file should
167
+ be read.
168
+
169
+ ```typescript
170
+ const harnessReaders: readonly AgentTranscriptReader[]
171
+ ```
172
+
148
173
  #### `provider`
149
174
 
150
- Reads any Claude Code, Codex CLI or Molecule IDE transcript.
175
+ Reads a transcript from any supported harness — Claude Code, Codex CLI,
176
+ the Molecule IDE, Gemini CLI, Cline / Roo Code, OpenCode, GitHub Copilot
177
+ Chat, Cursor and Aider — and, last, any plain Markdown / text chat with
178
+ User / Assistant speaker markers.
151
179
 
152
180
  ```typescript
153
181
  const provider: AgentTranscriptReader
@@ -181,20 +209,32 @@ Peer dependencies:
181
209
  ### Runtime Dependencies
182
210
 
183
211
  - `@molecule/api-agent-transcript`
212
+ - `@molecule/api-agent-transcript-aider`
184
213
  - `@molecule/api-agent-transcript-claude-code`
214
+ - `@molecule/api-agent-transcript-cline`
185
215
  - `@molecule/api-agent-transcript-codex`
216
+ - `@molecule/api-agent-transcript-copilot-chat`
217
+ - `@molecule/api-agent-transcript-cursor`
218
+ - `@molecule/api-agent-transcript-gemini-cli`
219
+ - `@molecule/api-agent-transcript-markdown-chat`
186
220
  - `@molecule/api-agent-transcript-molecule-ide`
221
+ - `@molecule/api-agent-transcript-opencode`
187
222
 
188
223
  - **Do NOT call `readTranscript` on every file in a folder.** A file no
189
224
  reader recognizes throws, naming the file and the readers tried — it is
190
225
  never read as an empty session. Filter with `canReadTranscript()` first,
191
226
  as the example does.
192
227
  - **Do NOT parse an export yourself or bond a single-format reader "to be
193
- safe".** This bond reads all three formats; a user turn is already only
228
+ safe".** This bond reads every format above; a user turn is already only
194
229
  what the person typed.
230
+ - **A plain chat with speaker markers is read too — as `markdown-chat`,
231
+ never as a harness.** When only a real harness's own file may count
232
+ (attributing text to a model, say), check `session.format !==
233
+ 'markdown-chat'`, or bond `createReader(harnessReaders)` instead.
195
234
  - **Do NOT import this from page or client code** — it is server-only and
196
235
  throws in a browser bundle.
197
236
  - Install all four packages the example uses:
198
237
  `npm install @molecule/api-agent-transcript @molecule/api-agent-transcript-autodetect @molecule/api-text-provenance @molecule/api-text-provenance-overlap`.
199
- - Order matters only for a file two readers would both accept; the bundled
200
- readers accept disjoint formats.
238
+ - Order matters only for a file two readers would both accept. The harness
239
+ readers accept disjoint formats; the generic Markdown chat reader is
240
+ tried last, so it never claims a harness's own file.
package/dist/index.d.ts CHANGED
@@ -2,10 +2,23 @@
2
2
  * The transcript reader to bond when files can come from more than one harness.
3
3
  *
4
4
  * Implements `@molecule/api-agent-transcript` by trying each bundled reader's
5
- * `detect()` and delegating to the first that recognizes the file: Claude Code
6
- * (`/export` text, session `.jsonl`), Codex CLI (Markdown export, rollout
7
- * `.jsonl`) and the Molecule IDE (stored conversation JSON). `createReader()`
8
- * composes any other list, including readers of your own. The example is the
5
+ * `detect()` and delegating to the first that recognizes the file:
6
+ *
7
+ * | Harness | Files |
8
+ * |---|---|
9
+ * | Claude Code | `/export` text, session `.jsonl` |
10
+ * | Codex CLI | Markdown export, rollout `.jsonl` |
11
+ * | Molecule IDE | stored conversation JSON |
12
+ * | Gemini CLI | session `.jsonl` / `.json`, `/chat save` checkpoint |
13
+ * | Cline / Roo Code | a task's `ui_messages.json` |
14
+ * | OpenCode | `opencode export` JSON |
15
+ * | GitHub Copilot Chat | VS Code's "Export Chat…" `chat.json` |
16
+ * | Cursor | "Export Chat" Markdown |
17
+ * | Aider | `.aider.chat.history.md` |
18
+ * | anything else | a Markdown / text chat with `## User`, `**User:**` or `User:` markers (tried last) |
19
+ *
20
+ * `createReader()` composes any other list, including readers of your own;
21
+ * `harnessReaders` is the list without the generic Markdown chat reader. The example is the
9
22
  * usual job: read a post's folder of transcript exports at build time and
10
23
  * attribute its paragraphs with `@molecule/api-text-provenance`, writing
11
24
  * `provenance.json`.
@@ -25,7 +38,7 @@
25
38
  * import { attributeText, setProvider as setAttribution } from '@molecule/api-text-provenance'
26
39
  * import { provider as wordOverlap } from '@molecule/api-text-provenance-overlap'
27
40
  *
28
- * setTranscriptReader(anyTranscript) // reads Claude Code, Codex and Molecule IDE exports
41
+ * setTranscriptReader(anyTranscript) // reads every supported harness, plus plain Markdown chats
29
42
  * setAttribution(wordOverlap)
30
43
  *
31
44
  * // One block of the post, in page order. `prompt` and `model` are on every ai span.
@@ -109,14 +122,19 @@
109
122
  * never read as an empty session. Filter with `canReadTranscript()` first,
110
123
  * as the example does.
111
124
  * - **Do NOT parse an export yourself or bond a single-format reader "to be
112
- * safe".** This bond reads all three formats; a user turn is already only
125
+ * safe".** This bond reads every format above; a user turn is already only
113
126
  * what the person typed.
127
+ * - **A plain chat with speaker markers is read too — as `markdown-chat`,
128
+ * never as a harness.** When only a real harness's own file may count
129
+ * (attributing text to a model, say), check `session.format !==
130
+ * 'markdown-chat'`, or bond `createReader(harnessReaders)` instead.
114
131
  * - **Do NOT import this from page or client code** — it is server-only and
115
132
  * throws in a browser bundle.
116
133
  * - Install all four packages the example uses:
117
134
  * `npm install @molecule/api-agent-transcript @molecule/api-agent-transcript-autodetect @molecule/api-text-provenance @molecule/api-text-provenance-overlap`.
118
- * - Order matters only for a file two readers would both accept; the bundled
119
- * readers accept disjoint formats.
135
+ * - Order matters only for a file two readers would both accept. The harness
136
+ * readers accept disjoint formats; the generic Markdown chat reader is
137
+ * tried last, so it never claims a harness's own file.
120
138
  *
121
139
  * @module
122
140
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyHG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2IG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
package/dist/index.js CHANGED
@@ -2,10 +2,23 @@
2
2
  * The transcript reader to bond when files can come from more than one harness.
3
3
  *
4
4
  * Implements `@molecule/api-agent-transcript` by trying each bundled reader's
5
- * `detect()` and delegating to the first that recognizes the file: Claude Code
6
- * (`/export` text, session `.jsonl`), Codex CLI (Markdown export, rollout
7
- * `.jsonl`) and the Molecule IDE (stored conversation JSON). `createReader()`
8
- * composes any other list, including readers of your own. The example is the
5
+ * `detect()` and delegating to the first that recognizes the file:
6
+ *
7
+ * | Harness | Files |
8
+ * |---|---|
9
+ * | Claude Code | `/export` text, session `.jsonl` |
10
+ * | Codex CLI | Markdown export, rollout `.jsonl` |
11
+ * | Molecule IDE | stored conversation JSON |
12
+ * | Gemini CLI | session `.jsonl` / `.json`, `/chat save` checkpoint |
13
+ * | Cline / Roo Code | a task's `ui_messages.json` |
14
+ * | OpenCode | `opencode export` JSON |
15
+ * | GitHub Copilot Chat | VS Code's "Export Chat…" `chat.json` |
16
+ * | Cursor | "Export Chat" Markdown |
17
+ * | Aider | `.aider.chat.history.md` |
18
+ * | anything else | a Markdown / text chat with `## User`, `**User:**` or `User:` markers (tried last) |
19
+ *
20
+ * `createReader()` composes any other list, including readers of your own;
21
+ * `harnessReaders` is the list without the generic Markdown chat reader. The example is the
9
22
  * usual job: read a post's folder of transcript exports at build time and
10
23
  * attribute its paragraphs with `@molecule/api-text-provenance`, writing
11
24
  * `provenance.json`.
@@ -25,7 +38,7 @@
25
38
  * import { attributeText, setProvider as setAttribution } from '@molecule/api-text-provenance'
26
39
  * import { provider as wordOverlap } from '@molecule/api-text-provenance-overlap'
27
40
  *
28
- * setTranscriptReader(anyTranscript) // reads Claude Code, Codex and Molecule IDE exports
41
+ * setTranscriptReader(anyTranscript) // reads every supported harness, plus plain Markdown chats
29
42
  * setAttribution(wordOverlap)
30
43
  *
31
44
  * // One block of the post, in page order. `prompt` and `model` are on every ai span.
@@ -109,14 +122,19 @@
109
122
  * never read as an empty session. Filter with `canReadTranscript()` first,
110
123
  * as the example does.
111
124
  * - **Do NOT parse an export yourself or bond a single-format reader "to be
112
- * safe".** This bond reads all three formats; a user turn is already only
125
+ * safe".** This bond reads every format above; a user turn is already only
113
126
  * what the person typed.
127
+ * - **A plain chat with speaker markers is read too — as `markdown-chat`,
128
+ * never as a harness.** When only a real harness's own file may count
129
+ * (attributing text to a model, say), check `session.format !==
130
+ * 'markdown-chat'`, or bond `createReader(harnessReaders)` instead.
114
131
  * - **Do NOT import this from page or client code** — it is server-only and
115
132
  * throws in a browser bundle.
116
133
  * - Install all four packages the example uses:
117
134
  * `npm install @molecule/api-agent-transcript @molecule/api-agent-transcript-autodetect @molecule/api-text-provenance @molecule/api-text-provenance-overlap`.
118
- * - Order matters only for a file two readers would both accept; the bundled
119
- * readers accept disjoint formats.
135
+ * - Order matters only for a file two readers would both accept. The harness
136
+ * readers accept disjoint formats; the generic Markdown chat reader is
137
+ * tried last, so it never claims a harness's own file.
120
138
  *
121
139
  * @module
122
140
  */
@@ -12,7 +12,18 @@ import type { AgentTranscriptReader } from '@molecule/api-agent-transcript';
12
12
  */
13
13
  export declare function createReader(readers: readonly AgentTranscriptReader[]): AgentTranscriptReader;
14
14
  /**
15
- * Reads any Claude Code, Codex CLI or Molecule IDE transcript.
15
+ * Every harness-specific reader, in the order they are tried. Each accepts
16
+ * only its own harness's files, so the order only matters for the generic
17
+ * Markdown chat reader, which is not in this list. Compose
18
+ * `createReader(harnessReaders)` when only a real harness's own file should
19
+ * be read.
20
+ */
21
+ export declare const harnessReaders: readonly AgentTranscriptReader[];
22
+ /**
23
+ * Reads a transcript from any supported harness — Claude Code, Codex CLI,
24
+ * the Molecule IDE, Gemini CLI, Cline / Roo Code, OpenCode, GitHub Copilot
25
+ * Chat, Cursor and Aider — and, last, any plain Markdown / text chat with
26
+ * User / Assistant speaker markers.
16
27
  */
17
28
  export declare const provider: AgentTranscriptReader;
18
29
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,gCAAgC,CAAA;AAKvC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,GAAG,qBAAqB,CAmB7F;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,qBAAsE,CAAA"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,gCAAgC,CAAA;AAYvC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,GAAG,qBAAqB,CAmB7F;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,qBAAqB,EAU1D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,qBAAuE,CAAA"}
package/dist/provider.js CHANGED
@@ -3,9 +3,16 @@
3
3
  *
4
4
  * @module
5
5
  */
6
+ import { provider as aider } from '@molecule/api-agent-transcript-aider';
6
7
  import { provider as claudeCode } from '@molecule/api-agent-transcript-claude-code';
8
+ import { provider as cline } from '@molecule/api-agent-transcript-cline';
7
9
  import { provider as codex } from '@molecule/api-agent-transcript-codex';
10
+ import { provider as copilotChat } from '@molecule/api-agent-transcript-copilot-chat';
11
+ import { provider as cursor } from '@molecule/api-agent-transcript-cursor';
12
+ import { provider as geminiCli } from '@molecule/api-agent-transcript-gemini-cli';
13
+ import { provider as markdownChat } from '@molecule/api-agent-transcript-markdown-chat';
8
14
  import { provider as moleculeIde } from '@molecule/api-agent-transcript-molecule-ide';
15
+ import { provider as opencode } from '@molecule/api-agent-transcript-opencode';
9
16
  /**
10
17
  * Compose readers: the first whose `detect()` accepts the input reads it.
11
18
  *
@@ -30,6 +37,27 @@ export function createReader(readers) {
30
37
  };
31
38
  }
32
39
  /**
33
- * Reads any Claude Code, Codex CLI or Molecule IDE transcript.
40
+ * Every harness-specific reader, in the order they are tried. Each accepts
41
+ * only its own harness's files, so the order only matters for the generic
42
+ * Markdown chat reader, which is not in this list. Compose
43
+ * `createReader(harnessReaders)` when only a real harness's own file should
44
+ * be read.
34
45
  */
35
- export const provider = createReader([claudeCode, codex, moleculeIde]);
46
+ export const harnessReaders = [
47
+ claudeCode,
48
+ codex,
49
+ moleculeIde,
50
+ geminiCli,
51
+ cline,
52
+ opencode,
53
+ copilotChat,
54
+ cursor,
55
+ aider,
56
+ ];
57
+ /**
58
+ * Reads a transcript from any supported harness — Claude Code, Codex CLI,
59
+ * the Molecule IDE, Gemini CLI, Cline / Roo Code, OpenCode, GitHub Copilot
60
+ * Chat, Cursor and Aider — and, last, any plain Markdown / text chat with
61
+ * User / Assistant speaker markers.
62
+ */
63
+ export const provider = createReader([...harnessReaders, markdownChat]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@molecule/api-agent-transcript-autodetect",
3
- "version": "1.0.1",
4
- "description": "Picks the reader that recognizes a transcript and delegates to it; bundles the Claude Code, Codex and Molecule IDE readers",
3
+ "version": "1.1.0",
4
+ "description": "Picks the reader that recognizes a transcript and delegates to it; bundles readers for Claude Code, Codex CLI, the Molecule IDE, Gemini CLI, Cline / Roo Code, OpenCode, GitHub Copilot Chat, Cursor and Aider, plus a generic Markdown chat reader",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -26,14 +26,27 @@
26
26
  "transcript",
27
27
  "detect",
28
28
  "claude-code",
29
- "codex"
29
+ "codex",
30
+ "gemini-cli",
31
+ "aider",
32
+ "cursor",
33
+ "cline",
34
+ "opencode",
35
+ "copilot"
30
36
  ],
31
37
  "license": "Apache-2.0",
32
38
  "author": "Molecule Dev, Inc. (https://molecule.dev)",
33
39
  "dependencies": {
40
+ "@molecule/api-agent-transcript-aider": "1.0.0",
34
41
  "@molecule/api-agent-transcript-claude-code": "1.0.0",
42
+ "@molecule/api-agent-transcript-cline": "1.0.0",
35
43
  "@molecule/api-agent-transcript-codex": "1.0.0",
36
- "@molecule/api-agent-transcript-molecule-ide": "1.0.0"
44
+ "@molecule/api-agent-transcript-copilot-chat": "1.0.0",
45
+ "@molecule/api-agent-transcript-cursor": "1.0.0",
46
+ "@molecule/api-agent-transcript-gemini-cli": "1.0.0",
47
+ "@molecule/api-agent-transcript-markdown-chat": "1.0.0",
48
+ "@molecule/api-agent-transcript-molecule-ide": "1.0.0",
49
+ "@molecule/api-agent-transcript-opencode": "1.0.0"
37
50
  },
38
51
  "peerDependencies": {
39
52
  "@molecule/api-agent-transcript": "^1.0.0"