MCPcopy
hub / github.com/benjitaylor/agentation / addAnnotation

Function addAnnotation

mcp/src/server/store.ts:129–150  ·  view source on GitHub ↗
(
      sessionId: string,
      data: Omit<Annotation, "id" | "sessionId" | "status" | "createdAt">
    )

Source from the content-addressed store, hash-verified

127 },
128
129 addAnnotation(
130 sessionId: string,
131 data: Omit<Annotation, "id" | "sessionId" | "status" | "createdAt">
132 ): Annotation | undefined {
133 const session = sessions.get(sessionId);
134 if (!session) return undefined;
135
136 const annotation: Annotation = {
137 ...data,
138 id: generateId(),
139 sessionId,
140 status: "pending",
141 createdAt: new Date().toISOString(),
142 };
143
144 annotations.set(annotation.id, annotation);
145
146 const event = eventBus.emit("annotation.created", sessionId, annotation);
147 events.push(event);
148
149 return annotation;
150 },
151
152 getAnnotation(id: string): Annotation | undefined {
153 return annotations.get(id);

Callers 1

addAnnotationHandlerFunction · 0.70

Calls 4

getStoreFunction · 0.85
emitMethod · 0.80
addAnnotationMethod · 0.80
generateIdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…