chore: rebuild CentOS7 release package
This commit is contained in:
@@ -18,15 +18,38 @@ function createCodexRolloutStore(deps) {
|
||||
turn.content = turn.content ? `${turn.content}\n\n${text}` : text;
|
||||
}
|
||||
|
||||
function extractCcwebSourceConversation(text) {
|
||||
const match = String(text || '').match(/^来自「([^」]+)」对话(ID:\s*([0-9a-fA-F-]{36}))的消息:/);
|
||||
if (!match) return null;
|
||||
return { title: match[1], id: match[2].toLowerCase() };
|
||||
}
|
||||
|
||||
function parseCodexRolloutLines(lines) {
|
||||
const messages = [];
|
||||
const pendingToolCalls = new Map();
|
||||
const meta = { threadId: null, cwd: null, title: '', updatedAt: null, cliVersion: null, source: null };
|
||||
const meta = {
|
||||
threadId: null,
|
||||
cwd: null,
|
||||
title: '',
|
||||
updatedAt: null,
|
||||
cliVersion: null,
|
||||
source: null,
|
||||
sourceConversationId: null,
|
||||
sourceConversationTitle: '',
|
||||
};
|
||||
const totalUsage = { inputTokens: 0, cachedInputTokens: 0, outputTokens: 0 };
|
||||
let currentAssistant = null;
|
||||
let sawRealUserMessage = false;
|
||||
const fallbackUserMessages = [];
|
||||
|
||||
function rememberSourceConversation(text) {
|
||||
if (meta.sourceConversationId) return;
|
||||
const sourceConversation = extractCcwebSourceConversation(text);
|
||||
if (!sourceConversation) return;
|
||||
meta.sourceConversationId = sourceConversation.id;
|
||||
meta.sourceConversationTitle = sourceConversation.title;
|
||||
}
|
||||
|
||||
function ensureAssistant(ts) {
|
||||
if (!currentAssistant) {
|
||||
currentAssistant = { role: 'assistant', content: '', toolCalls: [], timestamp: ts || null };
|
||||
@@ -81,6 +104,7 @@ function createCodexRolloutStore(deps) {
|
||||
if (text) {
|
||||
sawRealUserMessage = true;
|
||||
flushAssistant();
|
||||
rememberSourceConversation(text);
|
||||
if (!meta.title) meta.title = text.slice(0, 80).replace(/\n/g, ' ');
|
||||
messages.push({ role: 'user', content: text, timestamp: ts });
|
||||
}
|
||||
@@ -103,6 +127,7 @@ function createCodexRolloutStore(deps) {
|
||||
} else if (payload.role === 'user' && !sawRealUserMessage) {
|
||||
const text = extractCodexMessageText(payload.content);
|
||||
if (text.trim()) {
|
||||
rememberSourceConversation(text);
|
||||
fallbackUserMessages.push({ role: 'user', content: text, timestamp: ts });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user