MCPcopy
hub / github.com/RedPlanetHQ/core / toNode

Function toNode

apps/webapp/app/services/aspectStore.server.ts:19–43  ·  view source on GitHub ↗

Map a Prisma VoiceAspect record to VoiceAspectNode

(r: {
  id: string;
  fact: string;
  aspect: string;
  userId: string;
  workspaceId: string | null;
  episodeUuids: string[];
  createdAt: Date;
  validAt: Date;
  invalidAt: Date | null;
  invalidatedBy: string | null;
})

Source from the content-addressed store, hash-verified

17
18/** Map a Prisma VoiceAspect record to VoiceAspectNode */
19function toNode(r: {
20 id: string;
21 fact: string;
22 aspect: string;
23 userId: string;
24 workspaceId: string | null;
25 episodeUuids: string[];
26 createdAt: Date;
27 validAt: Date;
28 invalidAt: Date | null;
29 invalidatedBy: string | null;
30}): VoiceAspectNode {
31 return {
32 uuid: r.id,
33 fact: r.fact,
34 aspect: r.aspect as VoiceAspect,
35 userId: r.userId,
36 workspaceId: r.workspaceId ?? undefined,
37 episodeUuids: r.episodeUuids,
38 createdAt: r.createdAt,
39 validAt: r.validAt,
40 invalidAt: r.invalidAt,
41 invalidatedBy: r.invalidatedBy ?? undefined,
42 };
43}
44
45/**
46 * Save voice aspects from extraction and store their embeddings

Callers 3

saveVoiceAspectsFunction · 0.85
findSimilarVoiceAspectsFunction · 0.85
searchVoiceAspectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected