Add Pi package extension

This commit is contained in:
Federico Jaramillo Martinez
2026-05-09 20:30:40 +02:00
parent fc24e06324
commit 8b41a2ac12
9 changed files with 211 additions and 14 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export function applyTranscriptEvent(messages: ChatLine[], event: SessionUiEvent
function applyMessageEndMeta(messages: ChatLine[], rawMessage: unknown): ChatLine[] | undefined {
const ended = normalizeMessage(rawMessage)[0];
if (ended === undefined || ended.meta === undefined) return undefined;
if (ended?.meta === undefined) return undefined;
const index = findLastMatchingRole(messages, ended.role);
if (index < 0) return undefined;
return messages.map((message, i) => i === index ? withMessageMeta(message, rawMessage) : message);
@@ -77,7 +77,7 @@ export class SessionController {
const [page, status] = await Promise.all([api.messages(session.id, { limit: MESSAGE_PAGE_SIZE }), api.status(session.id)]);
if (seq !== this.selectionSeq || this.getState().selectedSession?.id !== session.id) return;
const history = this.mergeAndCacheHistory(session.id, page);
const isReceivingPartialStream = status.isStreaming === true;
const isReceivingPartialStream = status.isStreaming;
this.catchupStreamSessionId = isReceivingPartialStream ? session.id : undefined;
this.setState({ messages: normalizeMessages(history.messages), messagePageStart: history.start, messagePageTotal: history.total, isLoadingEarlierMessages: false, isReceivingPartialStream, status, activity: this.getState().sessionActivities[session.id] });
this.applyStatus(status);