MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / saveApiMessages

Function saveApiMessages

src/core/task-persistence/apiMessages.ts:109–121  ·  view source on GitHub ↗
({
	messages,
	taskId,
	globalStoragePath,
}: {
	messages: ApiMessage[]
	taskId: string
	globalStoragePath: string
})

Source from the content-addressed store, hash-verified

107}
108
109export async function saveApiMessages({
110 messages,
111 taskId,
112 globalStoragePath,
113}: {
114 messages: ApiMessage[]
115 taskId: string
116 globalStoragePath: string
117}) {
118 const taskDir = await getTaskDirectoryPath(globalStoragePath, taskId)
119 const filePath = path.join(taskDir, GlobalFileNames.apiConversationHistory)
120 await safeWriteJson(filePath, messages)
121}

Callers 2

Calls 2

getTaskDirectoryPathFunction · 0.90
safeWriteJsonFunction · 0.90

Tested by

no test coverage detected