@kenkaiiii/ggcoder 5.26.2 → 5.27.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/dist/app-sidecar.js +81 -47
- package/dist/app-sidecar.js.map +1 -1
- package/dist/core/agent-session-marker-anchors.test.js +181 -2
- package/dist/core/agent-session-marker-anchors.test.js.map +1 -1
- package/dist/core/agent-session-process-gate.test.d.ts +2 -0
- package/dist/core/agent-session-process-gate.test.d.ts.map +1 -0
- package/dist/core/agent-session-process-gate.test.js +88 -0
- package/dist/core/agent-session-process-gate.test.js.map +1 -0
- package/dist/core/agent-session-slash-restore.test.d.ts +2 -0
- package/dist/core/agent-session-slash-restore.test.d.ts.map +1 -0
- package/dist/core/agent-session-slash-restore.test.js +121 -0
- package/dist/core/agent-session-slash-restore.test.js.map +1 -0
- package/dist/core/agent-session.d.ts +66 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +304 -35
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compactor.d.ts +21 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +16 -0
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.js +91 -0
- package/dist/core/compaction/compactor.test.js.map +1 -1
- package/dist/core/foreign-session-import.d.ts +120 -0
- package/dist/core/foreign-session-import.d.ts.map +1 -0
- package/dist/core/foreign-session-import.js +594 -0
- package/dist/core/foreign-session-import.js.map +1 -0
- package/dist/core/foreign-session-import.test.d.ts +2 -0
- package/dist/core/foreign-session-import.test.d.ts.map +1 -0
- package/dist/core/foreign-session-import.test.js +220 -0
- package/dist/core/foreign-session-import.test.js.map +1 -0
- package/dist/core/foreign-transcript-blocks.d.ts +51 -0
- package/dist/core/foreign-transcript-blocks.d.ts.map +1 -0
- package/dist/core/foreign-transcript-blocks.js +151 -0
- package/dist/core/foreign-transcript-blocks.js.map +1 -0
- package/dist/core/mcp/catalog-cache.d.ts +63 -0
- package/dist/core/mcp/catalog-cache.d.ts.map +1 -0
- package/dist/core/mcp/catalog-cache.js +163 -0
- package/dist/core/mcp/catalog-cache.js.map +1 -0
- package/dist/core/mcp/catalog-cache.test.d.ts +2 -0
- package/dist/core/mcp/catalog-cache.test.d.ts.map +1 -0
- package/dist/core/mcp/catalog-cache.test.js +99 -0
- package/dist/core/mcp/catalog-cache.test.js.map +1 -0
- package/dist/core/mcp/client.d.ts +61 -0
- package/dist/core/mcp/client.d.ts.map +1 -1
- package/dist/core/mcp/client.js +216 -31
- package/dist/core/mcp/client.js.map +1 -1
- package/dist/core/mcp/legacy-negotiation.test.d.ts +2 -0
- package/dist/core/mcp/legacy-negotiation.test.d.ts.map +1 -0
- package/dist/core/mcp/legacy-negotiation.test.js +80 -0
- package/dist/core/mcp/legacy-negotiation.test.js.map +1 -0
- package/dist/core/mcp/oauth-provider.d.ts +1 -2
- package/dist/core/mcp/oauth-provider.d.ts.map +1 -1
- package/dist/core/mcp/oauth-provider.js +5 -1
- package/dist/core/mcp/oauth-provider.js.map +1 -1
- package/dist/core/mcp/oauth-store.d.ts +1 -1
- package/dist/core/mcp/oauth-store.d.ts.map +1 -1
- package/dist/core/mcp/oauth-store.js.map +1 -1
- package/dist/core/mcp/when-connected.test.d.ts +2 -0
- package/dist/core/mcp/when-connected.test.d.ts.map +1 -0
- package/dist/core/mcp/when-connected.test.js +46 -0
- package/dist/core/mcp/when-connected.test.js.map +1 -0
- package/dist/core/process-gate.d.ts +45 -0
- package/dist/core/process-gate.d.ts.map +1 -0
- package/dist/core/process-gate.js +71 -0
- package/dist/core/process-gate.js.map +1 -0
- package/dist/core/process-gate.test.d.ts +2 -0
- package/dist/core/process-gate.test.d.ts.map +1 -0
- package/dist/core/process-gate.test.js +87 -0
- package/dist/core/process-gate.test.js.map +1 -0
- package/dist/core/process-manager.d.ts +9 -0
- package/dist/core/process-manager.d.ts.map +1 -1
- package/dist/core/process-manager.js +17 -15
- package/dist/core/process-manager.js.map +1 -1
- package/dist/core/session-history.d.ts +61 -4
- package/dist/core/session-history.d.ts.map +1 -1
- package/dist/core/session-history.js +144 -15
- package/dist/core/session-history.js.map +1 -1
- package/dist/core/session-history.test.js +50 -1
- package/dist/core/session-history.test.js.map +1 -1
- package/dist/core/session-manager.d.ts +35 -6
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +39 -10
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-manager.test.js +14 -2
- package/dist/core/session-manager.test.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +6 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +17 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/slash-commands.test.js +1 -0
- package/dist/core/slash-commands.test.js.map +1 -1
- package/dist/tools/tool-search.d.ts +12 -1
- package/dist/tools/tool-search.d.ts.map +1 -1
- package/dist/tools/tool-search.js +22 -3
- package/dist/tools/tool-search.js.map +1 -1
- package/dist/tools/tool-search.test.d.ts +2 -0
- package/dist/tools/tool-search.test.d.ts.map +1 -0
- package/dist/tools/tool-search.test.js +69 -0
- package/dist/tools/tool-search.test.js.map +1 -0
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +27 -1
- package/dist/ui/App.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { APP_MARKER_CUSTOM_KIND, } from "./session-manager.js";
|
|
5
|
+
import { asString, compactParts, extractCursorUserQuery, isRecord, joinText, normalizeTimestamp, parseJsonLine, textPart, toolCallPart, toolResultText, } from "./foreign-transcript-blocks.js";
|
|
6
|
+
const EMPTY_DROPPED = () => ({ toolResults: 0, messages: 0, records: 0 });
|
|
7
|
+
/** Human-readable summary of what an import discarded. */
|
|
8
|
+
export function describeDropped(dropped) {
|
|
9
|
+
const parts = [];
|
|
10
|
+
if (dropped.toolResults > 0)
|
|
11
|
+
parts.push(`${dropped.toolResults} unmappable tool result(s)`);
|
|
12
|
+
if (dropped.messages > 0)
|
|
13
|
+
parts.push(`${dropped.messages} empty message record(s)`);
|
|
14
|
+
if (dropped.records > 0)
|
|
15
|
+
parts.push(`${dropped.records} unreadable line(s)`);
|
|
16
|
+
return parts.length > 0 ? parts.join(", ") : "nothing";
|
|
17
|
+
}
|
|
18
|
+
// ── Format detection ───────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* Identify a transcript from its records. Detection is shape-based, not
|
|
21
|
+
* filename-based, so a transcript copied out of its home directory still
|
|
22
|
+
* imports correctly.
|
|
23
|
+
*/
|
|
24
|
+
export function detectForeignFormat(text) {
|
|
25
|
+
for (const line of text.split("\n").slice(0, 60)) {
|
|
26
|
+
const record = parseJsonLine(line);
|
|
27
|
+
if (!record)
|
|
28
|
+
continue;
|
|
29
|
+
const type = asString(record.type);
|
|
30
|
+
// Codex rollout lines wrap everything in `payload`, and its own record
|
|
31
|
+
// types (session_meta / response_item / event_msg / turn_context) are
|
|
32
|
+
// unambiguous.
|
|
33
|
+
if (type === "session_meta" ||
|
|
34
|
+
type === "response_item" ||
|
|
35
|
+
type === "event_msg" ||
|
|
36
|
+
type === "turn_context") {
|
|
37
|
+
return "codex";
|
|
38
|
+
}
|
|
39
|
+
// Pre-late-2025 Codex rollouts have no wrapper: the payload sits at the top
|
|
40
|
+
// level, opening with a `{ id, timestamp, git }` header.
|
|
41
|
+
if (type === undefined &&
|
|
42
|
+
typeof record.id === "string" &&
|
|
43
|
+
"timestamp" in record &&
|
|
44
|
+
"git" in record) {
|
|
45
|
+
return "codex";
|
|
46
|
+
}
|
|
47
|
+
if ((type === "function_call" || type === "function_call_output" || type === "reasoning") &&
|
|
48
|
+
!("uuid" in record)) {
|
|
49
|
+
return "codex";
|
|
50
|
+
}
|
|
51
|
+
// Claude Code records carry a uuid/parentUuid DAG alongside `message`.
|
|
52
|
+
if ((type === "user" || type === "assistant") && "uuid" in record && "message" in record) {
|
|
53
|
+
return "claude";
|
|
54
|
+
}
|
|
55
|
+
if (asString(record.source) === "cursor" || asString(record.client) === "cursor") {
|
|
56
|
+
return "cursor";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
// ── Public entry point ─────────────────────────────────────
|
|
62
|
+
export function parseForeignTranscript(text, format) {
|
|
63
|
+
const resolved = format ?? detectForeignFormat(text);
|
|
64
|
+
if (!resolved) {
|
|
65
|
+
throw new Error("Unrecognized transcript format. Supported: Claude Code, Codex and Cursor JSONL sessions.");
|
|
66
|
+
}
|
|
67
|
+
switch (resolved) {
|
|
68
|
+
case "claude":
|
|
69
|
+
return parseClaudeTranscript(text);
|
|
70
|
+
case "codex":
|
|
71
|
+
return parseCodexTranscript(text);
|
|
72
|
+
case "cursor":
|
|
73
|
+
return parseCursorTranscript(text);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// ── Shared accumulator ─────────────────────────────────────
|
|
77
|
+
/**
|
|
78
|
+
* Collects parsed parts into well-formed `Message[]`.
|
|
79
|
+
*
|
|
80
|
+
* Every format interleaves assistant text, tool calls and tool results across
|
|
81
|
+
* separate records, so parsers push fragments and this class decides where a
|
|
82
|
+
* message boundary falls: consecutive assistant parts merge into one assistant
|
|
83
|
+
* message, and tool results batch into one `role:"tool"` message.
|
|
84
|
+
*/
|
|
85
|
+
class TranscriptBuilder {
|
|
86
|
+
messages = [];
|
|
87
|
+
dropped = EMPTY_DROPPED();
|
|
88
|
+
pendingAssistant = [];
|
|
89
|
+
pendingToolResults = [];
|
|
90
|
+
/** Tool-call ids seen so far, so an orphan result is dropped, not invented. */
|
|
91
|
+
knownCallIds = new Set();
|
|
92
|
+
preview;
|
|
93
|
+
cwd;
|
|
94
|
+
startedAt;
|
|
95
|
+
noteTimestamp(value) {
|
|
96
|
+
const ms = normalizeTimestamp(value);
|
|
97
|
+
if (ms !== undefined && (this.startedAt === undefined || ms < this.startedAt)) {
|
|
98
|
+
this.startedAt = ms;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
noteCwd(value) {
|
|
102
|
+
const cwd = asString(value);
|
|
103
|
+
if (cwd && !this.cwd)
|
|
104
|
+
this.cwd = cwd;
|
|
105
|
+
}
|
|
106
|
+
pushUser(text) {
|
|
107
|
+
const trimmed = text.trim();
|
|
108
|
+
if (!trimmed) {
|
|
109
|
+
this.dropped.messages += 1;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.flush();
|
|
113
|
+
if (!this.preview)
|
|
114
|
+
this.preview = trimmed;
|
|
115
|
+
this.messages.push({ role: "user", content: trimmed });
|
|
116
|
+
}
|
|
117
|
+
pushAssistant(parts) {
|
|
118
|
+
const usable = compactParts(parts);
|
|
119
|
+
if (usable.length === 0)
|
|
120
|
+
return;
|
|
121
|
+
// A tool result must not be reordered before the call it answers.
|
|
122
|
+
this.flushToolResults();
|
|
123
|
+
for (const part of usable) {
|
|
124
|
+
if (part.type === "tool_call")
|
|
125
|
+
this.knownCallIds.add(part.id);
|
|
126
|
+
}
|
|
127
|
+
this.pendingAssistant.push(...usable);
|
|
128
|
+
}
|
|
129
|
+
pushToolResult(callId, content, isError) {
|
|
130
|
+
if (!this.knownCallIds.has(callId)) {
|
|
131
|
+
// No matching call in this transcript: emitting it would invent a pairing
|
|
132
|
+
// the provider will reject on resume.
|
|
133
|
+
this.dropped.toolResults += 1;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
this.flushAssistant();
|
|
137
|
+
this.pendingToolResults.push({
|
|
138
|
+
type: "tool_result",
|
|
139
|
+
toolCallId: callId,
|
|
140
|
+
content,
|
|
141
|
+
...(isError ? { isError: true } : {}),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
flushAssistant() {
|
|
145
|
+
if (this.pendingAssistant.length === 0)
|
|
146
|
+
return;
|
|
147
|
+
this.messages.push({ role: "assistant", content: this.pendingAssistant });
|
|
148
|
+
this.pendingAssistant = [];
|
|
149
|
+
}
|
|
150
|
+
flushToolResults() {
|
|
151
|
+
if (this.pendingToolResults.length === 0)
|
|
152
|
+
return;
|
|
153
|
+
this.messages.push({ role: "tool", content: this.pendingToolResults });
|
|
154
|
+
this.pendingToolResults = [];
|
|
155
|
+
}
|
|
156
|
+
flush() {
|
|
157
|
+
this.flushAssistant();
|
|
158
|
+
this.flushToolResults();
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Finish the transcript. A trailing assistant message whose last act was an
|
|
162
|
+
* unanswered tool call cannot be resumed (providers reject a dangling call),
|
|
163
|
+
* so those trailing calls are dropped.
|
|
164
|
+
*/
|
|
165
|
+
finish(format) {
|
|
166
|
+
this.flush();
|
|
167
|
+
this.dropTrailingUnansweredCalls();
|
|
168
|
+
return {
|
|
169
|
+
format,
|
|
170
|
+
messages: this.messages,
|
|
171
|
+
...(this.cwd ? { cwd: this.cwd } : {}),
|
|
172
|
+
...(this.preview ? { preview: this.preview } : {}),
|
|
173
|
+
...(this.startedAt !== undefined ? { startedAt: this.startedAt } : {}),
|
|
174
|
+
dropped: this.dropped,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
dropTrailingUnansweredCalls() {
|
|
178
|
+
const last = this.messages[this.messages.length - 1];
|
|
179
|
+
if (!last || last.role !== "assistant" || typeof last.content === "string")
|
|
180
|
+
return;
|
|
181
|
+
const answered = new Set();
|
|
182
|
+
for (const message of this.messages) {
|
|
183
|
+
if (message.role !== "tool")
|
|
184
|
+
continue;
|
|
185
|
+
for (const result of message.content)
|
|
186
|
+
answered.add(result.toolCallId);
|
|
187
|
+
}
|
|
188
|
+
const kept = last.content.filter((part) => part.type !== "tool_call" || answered.has(part.id));
|
|
189
|
+
if (kept.length === last.content.length)
|
|
190
|
+
return;
|
|
191
|
+
this.dropped.toolResults += last.content.length - kept.length;
|
|
192
|
+
if (kept.length === 0)
|
|
193
|
+
this.messages.pop();
|
|
194
|
+
else
|
|
195
|
+
last.content = kept;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// ── Claude Code ────────────────────────────────────────────
|
|
199
|
+
/**
|
|
200
|
+
* Claude Code writes one JSONL record per DAG node under
|
|
201
|
+
* `~/.claude/projects/<encoded-cwd>/<session>.jsonl`. Message records are
|
|
202
|
+
* `{ type: "user"|"assistant", message: { role, content }, uuid, cwd, timestamp }`
|
|
203
|
+
* where `content` is a string or an Anthropic content-block array. Non-message
|
|
204
|
+
* record types (system, file-history-snapshot, mode, …) are UI state, not
|
|
205
|
+
* conversation, and are skipped without counting as data loss.
|
|
206
|
+
*/
|
|
207
|
+
export function parseClaudeTranscript(text) {
|
|
208
|
+
const builder = new TranscriptBuilder();
|
|
209
|
+
const CONVERSATION_TYPES = new Set(["user", "assistant"]);
|
|
210
|
+
const SKIPPED_TYPES = new Set([
|
|
211
|
+
"system",
|
|
212
|
+
"summary",
|
|
213
|
+
"mode",
|
|
214
|
+
"permission-mode",
|
|
215
|
+
"last-prompt",
|
|
216
|
+
"file-history-snapshot",
|
|
217
|
+
]);
|
|
218
|
+
for (const line of text.split("\n")) {
|
|
219
|
+
const record = parseJsonLine(line);
|
|
220
|
+
if (!record) {
|
|
221
|
+
if (line.trim())
|
|
222
|
+
builder.dropped.records += 1;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
const type = asString(record.type);
|
|
226
|
+
if (!type || SKIPPED_TYPES.has(type))
|
|
227
|
+
continue;
|
|
228
|
+
if (!CONVERSATION_TYPES.has(type))
|
|
229
|
+
continue;
|
|
230
|
+
// Sidechain records are a subagent's private thread, not this conversation.
|
|
231
|
+
if (record.isSidechain === true)
|
|
232
|
+
continue;
|
|
233
|
+
builder.noteCwd(record.cwd);
|
|
234
|
+
builder.noteTimestamp(record.timestamp);
|
|
235
|
+
const message = isRecord(record.message) ? record.message : undefined;
|
|
236
|
+
if (!message)
|
|
237
|
+
continue;
|
|
238
|
+
const content = message.content;
|
|
239
|
+
if (type === "user") {
|
|
240
|
+
const direct = asString(content);
|
|
241
|
+
if (direct !== undefined) {
|
|
242
|
+
builder.pushUser(direct);
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
if (!Array.isArray(content))
|
|
246
|
+
continue;
|
|
247
|
+
// A "user" record is also how Claude records tool_result blocks.
|
|
248
|
+
const userText = [];
|
|
249
|
+
for (const block of content) {
|
|
250
|
+
if (!isRecord(block))
|
|
251
|
+
continue;
|
|
252
|
+
if (block.type === "tool_result") {
|
|
253
|
+
const callId = asString(block.tool_use_id);
|
|
254
|
+
if (!callId) {
|
|
255
|
+
builder.dropped.toolResults += 1;
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
builder.pushToolResult(callId, toolResultText(block.content), block.is_error === true);
|
|
259
|
+
}
|
|
260
|
+
else if (block.type === "text") {
|
|
261
|
+
const blockText = asString(block.text);
|
|
262
|
+
if (blockText)
|
|
263
|
+
userText.push(blockText);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (userText.length > 0)
|
|
267
|
+
builder.pushUser(joinText(userText));
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
const parts = [];
|
|
271
|
+
const direct = asString(content);
|
|
272
|
+
if (direct !== undefined) {
|
|
273
|
+
parts.push(textPart(direct));
|
|
274
|
+
}
|
|
275
|
+
else if (Array.isArray(content)) {
|
|
276
|
+
for (const block of content) {
|
|
277
|
+
if (!isRecord(block))
|
|
278
|
+
continue;
|
|
279
|
+
switch (block.type) {
|
|
280
|
+
case "text": {
|
|
281
|
+
const blockText = asString(block.text);
|
|
282
|
+
if (blockText)
|
|
283
|
+
parts.push(textPart(blockText));
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
case "thinking": {
|
|
287
|
+
const thinking = asString(block.thinking);
|
|
288
|
+
if (thinking)
|
|
289
|
+
parts.push({ type: "thinking", text: thinking });
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
case "tool_use": {
|
|
293
|
+
const id = asString(block.id);
|
|
294
|
+
const name = asString(block.name);
|
|
295
|
+
if (id && name)
|
|
296
|
+
parts.push(toolCallPart(id, name, block.input));
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
default:
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
builder.pushAssistant(parts);
|
|
305
|
+
}
|
|
306
|
+
return builder.finish("claude");
|
|
307
|
+
}
|
|
308
|
+
// ── Codex ──────────────────────────────────────────────────
|
|
309
|
+
/**
|
|
310
|
+
* Codex rollouts live at `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl`.
|
|
311
|
+
* Current records are `{ timestamp, type, payload }` where `type` is
|
|
312
|
+
* `session_meta` / `response_item` / `event_msg` / `turn_context`; older
|
|
313
|
+
* rollouts wrote the payload at the top level with no wrapper.
|
|
314
|
+
*
|
|
315
|
+
* Only `response_item` carries the model conversation. `event_msg` duplicates
|
|
316
|
+
* it for the UI, so importing both would double every turn.
|
|
317
|
+
*/
|
|
318
|
+
export function parseCodexTranscript(text) {
|
|
319
|
+
const builder = new TranscriptBuilder();
|
|
320
|
+
for (const line of text.split("\n")) {
|
|
321
|
+
const record = parseJsonLine(line);
|
|
322
|
+
if (!record) {
|
|
323
|
+
if (line.trim())
|
|
324
|
+
builder.dropped.records += 1;
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
const wrapperType = asString(record.type);
|
|
328
|
+
const payload = isRecord(record.payload) ? record.payload : record;
|
|
329
|
+
builder.noteTimestamp(record.timestamp ?? payload.timestamp);
|
|
330
|
+
if (wrapperType === "session_meta" || wrapperType === "turn_context") {
|
|
331
|
+
builder.noteCwd(payload.cwd);
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
// event_msg mirrors response_item for the TUI; taking both duplicates turns.
|
|
335
|
+
if (wrapperType === "event_msg")
|
|
336
|
+
continue;
|
|
337
|
+
switch (asString(payload.type)) {
|
|
338
|
+
case "message": {
|
|
339
|
+
const role = asString(payload.role);
|
|
340
|
+
const body = codexMessageText(payload.content);
|
|
341
|
+
if (role === "user") {
|
|
342
|
+
// Legacy rollouts record the cwd only inside <environment_context>,
|
|
343
|
+
// so read it before deciding to skip that harness turn.
|
|
344
|
+
builder.noteCwd(codexCwdFrom(body));
|
|
345
|
+
// Codex injects environment/permission context as synthetic user and
|
|
346
|
+
// developer turns; those are its harness, not the user's words.
|
|
347
|
+
if (isCodexHarnessContext(body))
|
|
348
|
+
continue;
|
|
349
|
+
builder.pushUser(body);
|
|
350
|
+
}
|
|
351
|
+
else if (role === "assistant") {
|
|
352
|
+
builder.pushAssistant([textPart(body)]);
|
|
353
|
+
}
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
case "reasoning": {
|
|
357
|
+
const summary = codexReasoningText(payload.summary);
|
|
358
|
+
if (summary)
|
|
359
|
+
builder.pushAssistant([{ type: "thinking", text: summary }]);
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
case "function_call": {
|
|
363
|
+
const callId = asString(payload.call_id) ?? asString(payload.id);
|
|
364
|
+
const name = asString(payload.name);
|
|
365
|
+
if (callId && name)
|
|
366
|
+
builder.pushAssistant([toolCallPart(callId, name, payload.arguments)]);
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
case "function_call_output": {
|
|
370
|
+
const callId = asString(payload.call_id);
|
|
371
|
+
if (!callId) {
|
|
372
|
+
builder.dropped.toolResults += 1;
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
builder.pushToolResult(callId, toolResultText(payload.output));
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
default:
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return builder.finish("codex");
|
|
383
|
+
}
|
|
384
|
+
const CODEX_CWD_RE = /<cwd>([^<]+)<\/cwd>/;
|
|
385
|
+
function codexCwdFrom(body) {
|
|
386
|
+
return CODEX_CWD_RE.exec(body)?.[1];
|
|
387
|
+
}
|
|
388
|
+
/** Codex's own injected context turns, which are harness text, not user input. */
|
|
389
|
+
function isCodexHarnessContext(body) {
|
|
390
|
+
const head = body.trimStart();
|
|
391
|
+
return (head.startsWith("<environment_context>") ||
|
|
392
|
+
head.startsWith("<permissions instructions>") ||
|
|
393
|
+
head.startsWith("<user_instructions>"));
|
|
394
|
+
}
|
|
395
|
+
function codexMessageText(content) {
|
|
396
|
+
const direct = asString(content);
|
|
397
|
+
if (direct !== undefined)
|
|
398
|
+
return direct;
|
|
399
|
+
if (!Array.isArray(content))
|
|
400
|
+
return "";
|
|
401
|
+
const parts = [];
|
|
402
|
+
for (const block of content) {
|
|
403
|
+
if (!isRecord(block))
|
|
404
|
+
continue;
|
|
405
|
+
const blockText = asString(block.text);
|
|
406
|
+
if (blockText)
|
|
407
|
+
parts.push(blockText);
|
|
408
|
+
}
|
|
409
|
+
return joinText(parts);
|
|
410
|
+
}
|
|
411
|
+
function codexReasoningText(summary) {
|
|
412
|
+
if (!Array.isArray(summary))
|
|
413
|
+
return "";
|
|
414
|
+
const parts = [];
|
|
415
|
+
for (const block of summary) {
|
|
416
|
+
if (!isRecord(block))
|
|
417
|
+
continue;
|
|
418
|
+
const blockText = asString(block.text);
|
|
419
|
+
if (blockText)
|
|
420
|
+
parts.push(blockText);
|
|
421
|
+
}
|
|
422
|
+
return joinText(parts);
|
|
423
|
+
}
|
|
424
|
+
// ── Cursor ─────────────────────────────────────────────────
|
|
425
|
+
/**
|
|
426
|
+
* Cursor exports a flat JSONL chat log: one record per turn, carrying a role
|
|
427
|
+
* and either a plain `text`/`content` string or a content-block array.
|
|
428
|
+
*
|
|
429
|
+
* The part that actually matters on import is the wrapping: Cursor sends the
|
|
430
|
+
* typed prompt inside `<user_query>`, preceded by context blocks such as
|
|
431
|
+
* `<cursor_commands>` and `<timestamp>`. Importing that verbatim leaks harness
|
|
432
|
+
* scaffolding into the session title and preview, so a recognized wrapper is
|
|
433
|
+
* stripped while a message with UNRECOGNIZED leading context is kept intact —
|
|
434
|
+
* that text may be something the user genuinely wrote.
|
|
435
|
+
*/
|
|
436
|
+
export function parseCursorTranscript(text) {
|
|
437
|
+
const builder = new TranscriptBuilder();
|
|
438
|
+
for (const line of text.split("\n")) {
|
|
439
|
+
const record = parseJsonLine(line);
|
|
440
|
+
if (!record) {
|
|
441
|
+
if (line.trim())
|
|
442
|
+
builder.dropped.records += 1;
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
builder.noteTimestamp(record.timestamp ?? record.createdAt ?? record.time);
|
|
446
|
+
builder.noteCwd(record.cwd ?? record.workspacePath);
|
|
447
|
+
const role = asString(record.role) ?? asString(record.type);
|
|
448
|
+
const body = cursorBody(record);
|
|
449
|
+
if (role === "user" || role === "human") {
|
|
450
|
+
builder.pushUser(extractCursorUserQuery(body));
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
if (role !== "assistant" && role !== "ai")
|
|
454
|
+
continue;
|
|
455
|
+
const parts = [];
|
|
456
|
+
if (body)
|
|
457
|
+
parts.push(textPart(body));
|
|
458
|
+
for (const call of cursorToolCalls(record))
|
|
459
|
+
parts.push(call);
|
|
460
|
+
builder.pushAssistant(parts);
|
|
461
|
+
for (const result of cursorToolResults(record)) {
|
|
462
|
+
builder.pushToolResult(result.callId, result.text, result.isError);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return builder.finish("cursor");
|
|
466
|
+
}
|
|
467
|
+
function cursorBody(record) {
|
|
468
|
+
const direct = asString(record.text) ?? asString(record.content) ?? asString(record.message);
|
|
469
|
+
if (direct !== undefined)
|
|
470
|
+
return direct;
|
|
471
|
+
const content = record.content;
|
|
472
|
+
if (!Array.isArray(content))
|
|
473
|
+
return "";
|
|
474
|
+
const parts = [];
|
|
475
|
+
for (const block of content) {
|
|
476
|
+
if (!isRecord(block))
|
|
477
|
+
continue;
|
|
478
|
+
if (block.type === "text" || block.type === undefined) {
|
|
479
|
+
const blockText = asString(block.text);
|
|
480
|
+
if (blockText)
|
|
481
|
+
parts.push(blockText);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return joinText(parts);
|
|
485
|
+
}
|
|
486
|
+
function cursorToolCalls(record) {
|
|
487
|
+
const raw = record.toolCalls ?? record.tool_calls;
|
|
488
|
+
if (!Array.isArray(raw))
|
|
489
|
+
return [];
|
|
490
|
+
const calls = [];
|
|
491
|
+
for (const item of raw) {
|
|
492
|
+
if (!isRecord(item))
|
|
493
|
+
continue;
|
|
494
|
+
const id = asString(item.id) ?? asString(item.callId);
|
|
495
|
+
const name = asString(item.name) ?? asString(item.tool);
|
|
496
|
+
if (!id || !name)
|
|
497
|
+
continue;
|
|
498
|
+
calls.push(toolCallPart(id, name, item.args ?? item.arguments ?? item.input));
|
|
499
|
+
}
|
|
500
|
+
return calls;
|
|
501
|
+
}
|
|
502
|
+
function cursorToolResults(record) {
|
|
503
|
+
const raw = record.toolResults ?? record.tool_results;
|
|
504
|
+
if (!Array.isArray(raw))
|
|
505
|
+
return [];
|
|
506
|
+
const results = [];
|
|
507
|
+
for (const item of raw) {
|
|
508
|
+
if (!isRecord(item))
|
|
509
|
+
continue;
|
|
510
|
+
const callId = asString(item.callId) ?? asString(item.toolCallId) ?? asString(item.id);
|
|
511
|
+
if (!callId)
|
|
512
|
+
continue;
|
|
513
|
+
results.push({
|
|
514
|
+
callId,
|
|
515
|
+
text: toolResultText(item.result ?? item.output ?? item.content),
|
|
516
|
+
...(item.isError === true ? { isError: true } : {}),
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
return results;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Read a foreign transcript and write it out as a real GG Coder session, so it
|
|
523
|
+
* resumes through the existing loader with no reader changes: a v2
|
|
524
|
+
* `SessionHeader` from `SessionManager.create()`, one `MessageEntry` per
|
|
525
|
+
* message chained through `parentId`, and a final leaf pointer.
|
|
526
|
+
*
|
|
527
|
+
* An `import` app marker records the source and everything the import dropped —
|
|
528
|
+
* import is lossy by definition, and a silent loss is worse than a noted one.
|
|
529
|
+
*/
|
|
530
|
+
export async function importForeignSession(opts) {
|
|
531
|
+
let text;
|
|
532
|
+
try {
|
|
533
|
+
text = await fs.readFile(opts.filePath, "utf-8");
|
|
534
|
+
}
|
|
535
|
+
catch (err) {
|
|
536
|
+
throw new Error(`Could not read transcript at ${opts.filePath}: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
537
|
+
}
|
|
538
|
+
const parsed = parseForeignTranscript(text, opts.format);
|
|
539
|
+
if (parsed.messages.length === 0) {
|
|
540
|
+
throw new Error(`No conversation found in ${path.basename(opts.filePath)}.`);
|
|
541
|
+
}
|
|
542
|
+
const cwd = opts.cwd ?? parsed.cwd ?? process.cwd();
|
|
543
|
+
const created = await opts.sessionManager.create(cwd, opts.provider, opts.model, {
|
|
544
|
+
...(parsed.preview ? { preview: parsed.preview } : {}),
|
|
545
|
+
});
|
|
546
|
+
let parentId = null;
|
|
547
|
+
for (const message of parsed.messages) {
|
|
548
|
+
const id = crypto.randomUUID();
|
|
549
|
+
const entry = {
|
|
550
|
+
type: "message",
|
|
551
|
+
id,
|
|
552
|
+
parentId,
|
|
553
|
+
timestamp: new Date().toISOString(),
|
|
554
|
+
message,
|
|
555
|
+
};
|
|
556
|
+
await opts.sessionManager.appendEntry(created.path, entry);
|
|
557
|
+
parentId = id;
|
|
558
|
+
}
|
|
559
|
+
const marker = {
|
|
560
|
+
version: 1,
|
|
561
|
+
kind: "import",
|
|
562
|
+
afterMessageCount: parsed.messages.length,
|
|
563
|
+
data: {
|
|
564
|
+
source: parsed.format,
|
|
565
|
+
sourcePath: opts.filePath,
|
|
566
|
+
messageCount: parsed.messages.length,
|
|
567
|
+
dropped: describeDropped(parsed.dropped),
|
|
568
|
+
droppedCounts: { ...parsed.dropped },
|
|
569
|
+
},
|
|
570
|
+
};
|
|
571
|
+
const markerEntry = {
|
|
572
|
+
type: "custom",
|
|
573
|
+
kind: APP_MARKER_CUSTOM_KIND,
|
|
574
|
+
id: crypto.randomUUID(),
|
|
575
|
+
// parentId null keeps the marker off the message DAG, so the model never
|
|
576
|
+
// sees it while the host can still interleave it back into the transcript.
|
|
577
|
+
parentId: null,
|
|
578
|
+
timestamp: new Date().toISOString(),
|
|
579
|
+
data: marker,
|
|
580
|
+
};
|
|
581
|
+
await opts.sessionManager.appendEntry(created.path, markerEntry);
|
|
582
|
+
if (parentId)
|
|
583
|
+
await opts.sessionManager.updateLeaf(created.path, parentId);
|
|
584
|
+
return {
|
|
585
|
+
sessionId: created.id,
|
|
586
|
+
sessionPath: created.path,
|
|
587
|
+
cwd,
|
|
588
|
+
messageCount: parsed.messages.length,
|
|
589
|
+
format: parsed.format,
|
|
590
|
+
dropped: parsed.dropped,
|
|
591
|
+
...(parsed.preview ? { preview: parsed.preview } : {}),
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
//# sourceMappingURL=foreign-session-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foreign-session-import.js","sourceRoot":"","sources":["../../src/core/foreign-session-import.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,sBAAsB,GAKvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,sBAAsB,EACtB,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,MAAM,gCAAgC,CAAC;AAsCxC,MAAM,aAAa,GAAG,GAAyB,EAAE,CAAC,CAAC,EAAE,WAAW,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