(
annotationId: string,
role: "human" | "agent",
content: string
)
| 496 | }, |
| 497 | |
| 498 | addThreadMessage( |
| 499 | annotationId: string, |
| 500 | role: "human" | "agent", |
| 501 | content: string |
| 502 | ): Annotation | undefined { |
| 503 | const existing = this.getAnnotation(annotationId); |
| 504 | if (!existing) return undefined; |
| 505 | |
| 506 | const message: ThreadMessage = { |
| 507 | id: generateId(), |
| 508 | role, |
| 509 | content, |
| 510 | timestamp: Date.now(), |
| 511 | }; |
| 512 | |
| 513 | const thread = [...(existing.thread || []), message]; |
| 514 | const updated = this.updateAnnotation(annotationId, { thread }); |
| 515 | |
| 516 | if (updated && existing.sessionId) { |
| 517 | const event = eventBus.emit("thread.message", existing.sessionId, message); |
| 518 | persistEvent(event); |
| 519 | } |
| 520 | |
| 521 | return updated; |
| 522 | }, |
| 523 | |
| 524 | getPendingAnnotations(sessionId: string): Annotation[] { |
| 525 | const rows = stmts.getPendingAnnotations.all(sessionId) as Record<string, unknown>[]; |
nothing calls this directly
no test coverage detected
searching dependent graphs…