MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / upsertDesignFile

Function upsertDesignFile

apps/desktop/src/main/snapshots-db.ts:493–511  ·  view source on GitHub ↗
(
  _db: Database,
  designId: string,
  filePath: string,
  content: string,
)

Source from the content-addressed store, hash-verified

491}
492
493export function upsertDesignFile(
494 _db: Database,
495 designId: string,
496 filePath: string,
497 content: string,
498): DesignFile {
499 const normalizedPath = normalizeDesignFilePath(filePath);
500 const now = nowIso();
501 touchDesignActivity(_db, designId, now);
502 return {
503 schemaVersion: 1,
504 id: `${designId}:${normalizedPath}`,
505 designId,
506 path: normalizedPath,
507 content,
508 createdAt: now,
509 updatedAt: now,
510 };
511}
512
513function rowToDiagnosticEvent(row: DiagnosticEventRow): DiagnosticEventRow {
514 return {

Callers 4

registerWorkspaceIpcFunction · 0.90
persistMutationFunction · 0.90
createDesignFileFunction · 0.85

Calls 3

normalizeDesignFilePathFunction · 0.85
nowIsoFunction · 0.85
touchDesignActivityFunction · 0.85

Tested by

no test coverage detected