shitton of the ai changes

This commit is contained in:
2026-05-01 04:54:11 +03:00
parent d95c37a322
commit 8cff086a8e
194 changed files with 29409 additions and 8841 deletions
+28
View File
@@ -0,0 +1,28 @@
import type {StoredAttachment} from "../model/stored-attachment";
import type {ToolCallData} from "./unified-ai-runner.shared";
import {persistInternalJsonArtifactAttachment} from "./internal-artifact-store";
export async function persistToolResultArtifactAttachment(params: {
toolCall: ToolCallData;
resultText: string;
chatId: number;
messageId: number;
}): Promise<StoredAttachment> {
return await persistInternalJsonArtifactAttachment({
artifactKind: "tool_result",
fileNamePrefix: `tool-${params.toolCall.name}`,
chatId: params.chatId,
messageId: params.messageId,
payload: {
toolName: params.toolCall.name,
callId: params.toolCall.id,
argumentsText: params.toolCall.argumentsText,
resultText: params.resultText,
},
metadata: {
toolName: params.toolCall.name,
callId: params.toolCall.id,
resultChars: params.resultText.length,
},
});
}