Coframe Annotations@coframe-gtm/annotations v1.2.0 AFS 1.1

JS API — window.__annotations #

The vendor-neutral global bridge. Available the moment the library is injected.

MemberReturnsDescription
versionstringLibrary version.
schema"afs-1.1"Schema identifier.
addAnnotation(input)stringCreate an annotation; returns its id.
replyToAnnotation(id, msg)string | nullAppend a thread message ({ role, content }).
updateAnnotation(id, patch)booleanPatch any annotation fields.
acknowledgeAnnotation(id)booleanMark acknowledged.
resolveAnnotation(id, by?)booleanMark resolved (by = human / agent).
dismissAnnotation(id)booleanMark dismissed.
removeAnnotation(id)booleanDelete one annotation.
clearAnnotations()numberErase the board; returns count removed.
focusAnnotation(id)booleanOpen that annotation's thread panel.
closeThread()voidClose any open thread panel.
setCursor(cursor)voidUpsert one actor's presence cursor by id.
setCursors(list)voidReplace all presence cursors.
removeCursor(id)booleanRemove one actor's cursor.
clearCursors()voidRemove all cursors.
setMode(mode)voidSet view / feedback / layout.
getMode()ModeRead the current mode (for a headless parent frame).
subscribeMode(fn)() => voidSubscribe to mode changes; returns an unsubscribe.
setTheme(theme)voiddark / light / auto.
getAnnotations()Annotation[]Snapshot of the current board.

Session init

initSession({ webhookUrl?: string; sessionId?: string }): void;

Webhook events #

Each state change emits one envelope to webhookUrl. sequence is monotonic per session, so the host can detect a gap and request replay.

interface AgentationEvent<P> {
  type: AgentationEventType;
  timestamp: string;   // ISO 8601
  sessionId: string;
  sequence: number;    // monotonic per session
  payload: P;
}
EventFires when
session.created / session.updated / session.closedSession lifecycle.
annotation.created / annotation.updated / annotation.deletedAn annotation changes.
thread.messageA reply is appended to a thread.
action.requestedThe UI requests a host action.
presence.cursorAn actor's cursor moves (throttled).

Versioning #

SemVer on the package; the schema carries its own version so consumers can branch on it.

Value
Package@coframe-gtm/annotations
Version1.1.0
Schemaafs-1.1
Entry/v1, /v1/inject, /v1/server
1.2.0 — overlay polish: liquid-glass popups (composer / thread / preview), multi-element markers now outline every selected element and stay pinned through scroll, one popup open at a time, and the comment box auto-focuses on open.
The /v1 path is the stability contract. A breaking schema change ships as /v2 alongside /v1, so injected pages never break under your feet.