MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / putTextFiles

Function putTextFiles

apps/webuiapps/src/lib/fileApi.ts:287–301  ·  view source on GitHub ↗
(
  files: Array<{ path: string; content: string | unknown }>,
)

Source from the content-addressed store, hash-verified

285 * Each file object strictly follows the TextFile structure: path (directory) / name (filename) / content
286 */
287export const putTextFiles = async (
288 files: Array<{ path: string; content: string | unknown }>,
289): Promise<void> => {
290 const manager = getClientComManager();
291 const textFiles: TextFile[] = files.map((f) => {
292 const contentStr = typeof f.content === 'string' ? f.content : JSON.stringify(f.content);
293 return toTextFile(f.path, contentStr);
294 });
295 const startTime = ts();
296 const t0 = performance.now();
297 await manager.putTextFilesByJSON({ files: textFiles });
298 console.info(
299 `[FileApi][${startTime}] putTextFiles [${textFiles.length}] — ${(performance.now() - t0).toFixed(1)}ms`,
300 );
301};
302
303// ============ App Path-Prefixed File API Factory ============
304

Callers

nothing calls this directly

Calls 5

getClientComManagerFunction · 0.90
toTextFileFunction · 0.85
tsFunction · 0.85
putTextFilesByJSONMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected