feat: update Makelore modules and conversations
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-07-31 10:08:41 +08:00
parent b8ca3f8eea
commit 80e8386fa6
175 changed files with 8036 additions and 10581 deletions

View File

@@ -214,6 +214,51 @@ export function extractTextSegments(message: RawMessage | unknown): string[] {
.filter((segment) => segment.length > 0);
}
export interface CodexAssistantTextProjection {
finalText: string;
processSegments: string[];
}
/**
* Split assistant text around native executable blocks. Text before or between
* tool calls is execution narration; trailing text after the last executable
* block is the answer shown in the primary transcript column.
*/
export function projectAssistantTextForCodex(
message: RawMessage | unknown,
): CodexAssistantTextProjection {
if (!message || typeof message !== 'object') return { finalText: '', processSegments: [] };
const record = message as Record<string, unknown>;
if (record.role !== 'assistant' || !Array.isArray(record.content)) {
return { finalText: extractText(message), processSegments: [] };
}
const blocks = record.content as ContentBlock[];
const executableIndex = blocks.reduce((latest, block, index) => (
block.type === 'tool_use' || block.type === 'toolCall'
? index
: latest
), -1);
if (executableIndex < 0) {
return { finalText: extractText(message), processSegments: [] };
}
const textBlockMessage = (selected: ContentBlock[]): RawMessage => ({
...message as RawMessage,
content: selected,
});
const processBlocks = blocks
.slice(0, executableIndex + 1)
.filter((block) => block.type === 'text');
const finalBlocks = blocks
.slice(executableIndex + 1)
.filter((block) => block.type === 'text');
return {
finalText: extractText(textBlockMessage(finalBlocks)),
processSegments: extractTextSegments(textBlockMessage(processBlocks)),
};
}
/**
* Extract thinking/reasoning content from a message.
* Returns null if no thinking content found.