fix(release): restore linux binary build

This commit is contained in:
Armin Ronacher
2026-05-07 18:53:29 +02:00
parent b38bd49be1
commit 206bd08572
2 changed files with 64 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
import "@mariozechner/mini-lit/dist/ThemeToggle.js";
import { Agent, type AgentMessage } from "@earendil-works/pi-agent-core";
import { getModel } from "@earendil-works/pi-ai";
import { getModel, type TextContent } from "@earendil-works/pi-ai";
import {
type AgentState,
ApiKeyPromptDialog,
@@ -70,8 +70,8 @@ let chatPanel: ChatPanel;
let agentUnsubscribe: (() => void) | undefined;
const generateTitle = (messages: AgentMessage[]): string => {
const firstUserMsg = messages.find((m) => m.role === "user" || m.role === "user-with-attachments");
if (!firstUserMsg || (firstUserMsg.role !== "user" && firstUserMsg.role !== "user-with-attachments")) return "";
const firstUserMsg = messages.find((m) => m.role === "user");
if (!firstUserMsg) return "";
let text = "";
const content = firstUserMsg.content;
@@ -79,8 +79,8 @@ const generateTitle = (messages: AgentMessage[]): string => {
if (typeof content === "string") {
text = content;
} else {
const textBlocks = content.filter((c: any) => c.type === "text");
text = textBlocks.map((c: any) => c.text || "").join(" ");
const textBlocks = content.filter((c): c is TextContent => c.type === "text");
text = textBlocks.map((c) => c.text || "").join(" ");
}
text = text.trim();
@@ -94,8 +94,8 @@ const generateTitle = (messages: AgentMessage[]): string => {
};
const shouldSaveSession = (messages: AgentMessage[]): boolean => {
const hasUserMsg = messages.some((m: any) => m.role === "user" || m.role === "user-with-attachments");
const hasAssistantMsg = messages.some((m: any) => m.role === "assistant");
const hasUserMsg = messages.some((m) => m.role === "user");
const hasAssistantMsg = messages.some((m) => m.role === "assistant");
return hasUserMsg && hasAssistantMsg;
};