Skip to main content

Event Types Reference

Complete field-level documentation for all 10 Periscope event payload types

Each event payload includes a kind discriminator string, a data object with event-specific fields, and an optional context object with environmental metadata.

For an overview of how events flow through the system, see Event System Concepts.


text.selection

Fired when the user selects text on a web page.

Kind: "text.selection"

Data Fields

FieldTypeRequiredDescription
textstringYesThe selected text content
range.startnumberYesCharacter offset where the selection begins
range.endnumberYesCharacter offset where the selection ends
surroundingstringNoSurrounding paragraph or context around the selection

Context Fields

FieldTypeRequiredDescription
documentTitlestringNoTitle of the document where text was selected
filePathstringNoFile path if the selection is in a local file viewer
urlstringNoURL of the page where text was selected
languagestringNoDetected language of the selected text (ISO 639-1)
isMultilinebooleanNoWhether the selection spans multiple lines

Example

json
{
  "kind": "text.selection",
  "data": {
    "text": "Periscope captures browser context in real time",
    "range": { "start": 42, "end": 89 },
    "surrounding": "The extension works by... Periscope captures browser context in real time ...and syncs it to the cloud."
  },
  "context": {
    "documentTitle": "Periscope Overview",
    "url": "https://docs.uselovelace.com/periscope",
    "language": "en",
    "isMultiline": false
  }
}

page.navigation

Fired when the user navigates to a new page or the page URL changes.

Kind: "page.navigation"

Data Fields

FieldTypeRequiredDescription
urlstringYesThe URL the user navigated to
titlestringNoPage title of the destination
navigationTypeenumNoHow the navigation was triggered
previousUrlstringNoURL of the page the user navigated from
statusCodenumberNoHTTP status code of the navigation response

navigationType values: initial, link_click, form_submit, back_forward, reload, redirect, history, script

Context Fields

FieldTypeRequiredDescription
sameSitebooleanNoWhether the navigation stayed on the same origin
referrerstringNoThe referring URL
navigationTimenumberNoTime taken for the navigation in milliseconds

Example

json
{
  "kind": "page.navigation",
  "data": {
    "url": "https://github.com/lovelace-ai/lovelace/pulls",
    "title": "Pull requests - lovelace-ai/lovelace",
    "navigationType": "link_click",
    "previousUrl": "https://github.com/lovelace-ai/lovelace",
    "statusCode": 200
  },
  "context": {
    "sameSite": true,
    "referrer": "https://github.com/lovelace-ai/lovelace",
    "navigationTime": 340
  }
}

document.open

Fired when the user opens a document (PDF, spreadsheet, code file, etc.) in the browser.

Kind: "document.open"

Data Fields

FieldTypeRequiredDescription
documentTypeenumYesThe type of document opened
namestringYesDocument file name or title
urlstringNoURL where the document is hosted
mimeTypestringNoMIME type of the document
fileSizenumberNoFile size in bytes
isNewbooleanNoWhether this is a newly created document

documentType values: pdf, word, google_docs, google_sheets, spreadsheet, presentation, code, text, markdown, image, video, audio, other

Context Fields

FieldTypeRequiredDescription
applicationstringNoApplication used to open the document (e.g. "Google Docs")
ownerstringNoDocument owner or creator
isSharedbooleanNoWhether the document is shared with others
isReadOnlybooleanNoWhether the document is read-only for the current user
openedAtstringNoISO 8601 timestamp when the document was opened

Example

json
{
  "kind": "document.open",
  "data": {
    "documentType": "google_docs",
    "name": "Q4 Product Roadmap",
    "url": "https://docs.google.com/document/d/abc123/edit",
    "mimeType": "application/vnd.google-apps.document",
    "isNew": false
  },
  "context": {
    "application": "Google Docs",
    "isShared": true,
    "isReadOnly": false,
    "openedAt": "2026-03-02T14:30:00Z"
  }
}

code.selection

Fired when the user selects code in a browser-based editor or code viewer.

Kind: "code.selection"

Data Fields

FieldTypeRequiredDescription
codestringYesThe selected code content
languagestringYesProgramming language of the selected code
lineRange.startnumberYesStarting line number of the selection
lineRange.endnumberYesEnding line number of the selection
charRange.startnumberYesStarting character offset within the start line
charRange.endnumberYesEnding character offset within the end line
syntaxTypestringNoAST node type of the selection (e.g. "function_declaration")

Context Fields

FieldTypeRequiredDescription
filePathstringYesPath of the file containing the selected code
repositoryUrlstringNoURL of the repository
branchstringNoGit branch name
editorstringNoEditor or viewer name (e.g. "GitHub", "GitLab")
editorVersionstringNoVersion of the editor

Example

json
{
  "kind": "code.selection",
  "data": {
    "code": "export function createSyncClient(config: SyncConfig): SyncClient {",
    "language": "typescript",
    "lineRange": { "start": 15, "end": 15 },
    "charRange": { "start": 0, "end": 67 },
    "syntaxType": "function_declaration"
  },
  "context": {
    "filePath": "src/sync/client.ts",
    "repositoryUrl": "https://github.com/lovelace-ai/lovelace",
    "branch": "main",
    "editor": "GitHub"
  }
}

media.playback

Fired when media playback state changes in the browser.

Kind: "media.playback"

Data Fields

FieldTypeRequiredDescription
mediaTypeenumYesType of media being played
stateenumYesCurrent playback state
currentTimenumberNoCurrent playback position in seconds
durationnumberNoTotal duration in seconds
playbackRatenumberNoPlayback speed multiplier (1.0 = normal)
isMutedbooleanNoWhether audio is muted
volumenumberNoVolume level from 0.0 to 1.0

mediaType values: audio, video, podcast, stream

state values: playing, paused, stopped, buffering

Context Fields

FieldTypeRequiredDescription
titlestringNoTitle of the media
artiststringNoArtist or creator name
albumstringNoAlbum or collection name
servicestringNoStreaming service (e.g. "YouTube", "Spotify")
urlstringNoURL of the media page

Example

json
{
  "kind": "media.playback",
  "data": {
    "mediaType": "video",
    "state": "playing",
    "currentTime": 142.5,
    "duration": 3600,
    "playbackRate": 1.5,
    "isMuted": false,
    "volume": 0.8
  },
  "context": {
    "title": "Building AI Agents with Lovelace",
    "service": "YouTube",
    "url": "https://youtube.com/watch?v=abc123"
  }
}

image.capture

Fired when the user captures or extracts an image from the browser.

Kind: "image.capture"

Data Fields

FieldTypeRequiredDescription
captureTypeenumYesHow the image was captured
imageDatastringYesBase64-encoded image data or a reference URL
formatstringNoImage format (e.g. "png", "jpeg", "webp")
dimensions.widthnumberNoImage width in pixels
dimensions.heightnumberNoImage height in pixels
fileSizenumberNoImage file size in bytes

captureType values: screenshot, photo, webcam, clipboard, extraction

Context Fields

FieldTypeRequiredDescription
reasonstringNoUser-provided reason for capture
capturedBystringNoTool or method used for capture
urlstringNoURL of the page where the image was captured
selectedRegion.xnumberNoX coordinate of the capture region
selectedRegion.ynumberNoY coordinate of the capture region
selectedRegion.widthnumberNoWidth of the capture region in pixels
selectedRegion.heightnumberNoHeight of the capture region in pixels

Example

json
{
  "kind": "image.capture",
  "data": {
    "captureType": "screenshot",
    "imageData": "data:image/png;base64,iVBORw0KGgo...",
    "format": "png",
    "dimensions": { "width": 1920, "height": 1080 },
    "fileSize": 245760
  },
  "context": {
    "capturedBy": "Periscope Extension",
    "url": "https://dashboard.uselovelace.com/agents",
    "selectedRegion": { "x": 100, "y": 200, "width": 800, "height": 600 }
  }
}

focus.change

Fired when keyboard focus moves between interactive elements.

Kind: "focus.change"

Data Fields

FieldTypeRequiredDescription
elementTypeenumYesType of element that received or lost focus
elementIdstringNoDOM id attribute of the element
tagNamestringNoHTML tag name (e.g. "INPUT", "BUTTON")
actionenumYesWhether focus was gained or lost
previousElementstringNoDescriptor of the previously focused element

elementType values: input, button, link, select, checkbox, radio, contenteditable, searchbox, other

action values: focus, blur

Context Fields

FieldTypeRequiredDescription
labelstringNoAccessible label of the element
urlstringNoURL of the page
formIdstringNoDOM id of the parent form, if applicable

Example

json
{
  "kind": "focus.change",
  "data": {
    "elementType": "input",
    "elementId": "search-bar",
    "tagName": "INPUT",
    "action": "focus",
    "previousElement": "nav-link-docs"
  },
  "context": {
    "label": "Search documentation",
    "url": "https://docs.uselovelace.com",
    "formId": "search-form"
  }
}

scroll

Fired when the user scrolls a page or scrollable element.

Kind: "scroll"

Data Fields

FieldTypeRequiredDescription
xnumberYesCurrent horizontal scroll position in pixels
ynumberYesCurrent vertical scroll position in pixels
maxXnumberNoMaximum horizontal scroll position
maxYnumberNoMaximum vertical scroll position
directionenumNoDirection of the scroll
velocitynumberNoScroll velocity in pixels per second
scrollPercentagenumberNoVertical scroll progress from 0.0 to 1.0

direction values: up, down, left, right

Context Fields

FieldTypeRequiredDescription
urlstringNoURL of the page
elementIdstringNoDOM id of the scrollable element (if not the page)
isUserInitiatedbooleanNoWhether the scroll was triggered by the user (vs. script)
scrollableElementstringNoDescriptor of the scrollable container

Example

json
{
  "kind": "scroll",
  "data": {
    "x": 0,
    "y": 2400,
    "maxX": 0,
    "maxY": 8500,
    "direction": "down",
    "velocity": 450,
    "scrollPercentage": 0.28
  },
  "context": {
    "url": "https://docs.uselovelace.com/periscope/reference/event-types",
    "isUserInitiated": true
  }
}

cursor.move

Fired on significant cursor movement events (throttled to reduce volume).

Kind: "cursor.move"

Data Fields

FieldTypeRequiredDescription
xnumberYesCursor X coordinate in viewport pixels
ynumberYesCursor Y coordinate in viewport pixels
distancenumberNoDistance moved since last event in pixels
velocitynumberNoCursor velocity in pixels per second
hoveredElementstringNoDescriptor of the element under the cursor

Context Fields

FieldTypeRequiredDescription
urlstringNoURL of the page
isDraggingbooleanNoWhether the user is currently dragging
buttonenumNoMouse button being held during drag
modifiers.ctrlbooleanNoWhether the Ctrl key is held
modifiers.shiftbooleanNoWhether the Shift key is held
modifiers.altbooleanNoWhether the Alt key is held
modifiers.metabooleanNoWhether the Meta (Cmd/Win) key is held

button values: left, middle, right

Example

json
{
  "kind": "cursor.move",
  "data": {
    "x": 512,
    "y": 340,
    "distance": 85.2,
    "velocity": 620,
    "hoveredElement": "button#deploy-agent"
  },
  "context": {
    "url": "https://dashboard.uselovelace.com/agents/new",
    "isDragging": false,
    "modifiers": { "ctrl": false, "shift": false, "alt": false, "meta": false }
  }
}

form.input

Fired when the user interacts with a form field.

Kind: "form.input"

Data Fields

FieldTypeRequiredDescription
inputTypeenumYesType of the form input
fieldNamestringNoName attribute of the input field
valuestringNoSanitized value (sensitive fields are redacted)
interactionTypeenumYesType of interaction with the field
isRequiredbooleanNoWhether the field is marked as required
validationErrorstringNoCurrent validation error message, if any

inputType values: text, email, password, number, checkbox, radio, select, textarea, date, time, file, search, other

interactionType values: focus, change, blur, submit

Context Fields

FieldTypeRequiredDescription
formIdstringNoDOM id of the parent form
formActionstringNoAction URL of the form
urlstringNoURL of the page
labelstringNoAccessible label of the field
isSensitivebooleanNoWhether the field contains sensitive data (password, SSN, etc.)

Example

json
{
  "kind": "form.input",
  "data": {
    "inputType": "email",
    "fieldName": "user_email",
    "value": "dev@example.com",
    "interactionType": "change",
    "isRequired": true,
    "validationError": null
  },
  "context": {
    "formId": "signup-form",
    "formAction": "/api/auth/register",
    "url": "https://accounts.uselovelace.com/register",
    "label": "Email address",
    "isSensitive": false
  }
}

Note: When isSensitive is true, the value field is automatically redacted by the extension before transmission. Password fields are always treated as sensitive regardless of this flag.