New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

sv-agentation

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sv-agentation

Dev-mode Svelte inspector for annotating elements, text selections, groups, and areas in the browser.

latest
Source
npmnpm
Version
0.2.5
Version published
Weekly downloads
408
29.11%
Maintainers
1
Weekly downloads
 
Created
Source

sv-agentation

Svelte Agentation OG

npm version downloads

Live Preview: Svelte Agentation

Dev-mode Svelte inspector for source-aware element inspection and browser annotations.

Overview

sv-agentation helps developers inspect rendered DOM, jump to source, annotate UI directly in the browser, and copy structured output for developer or AI-assisted workflows.

Installation

npm install sv-agentation
pnpm add sv-agentation
yarn add sv-agentation
bun add sv-agentation

Usage

<script lang="ts">
	import { browser, dev } from '$app/environment';
	import { Agentation } from 'sv-agentation';

	const workspaceRoot = '/absolute/path/to/your/repo';
</script>

{#if browser && dev}
	<Agentation {workspaceRoot} />
{/if}

Mount the inspector only in development and only in the browser.

Architecture

Agentation
  -> element-source-inspector.svelte
  -> CopyOpenController
      -> internal/controller-state.svelte.ts
      -> internal/controller-selection.ts
      -> internal/controller-composer.ts
      -> internal/controller-browser.ts
  -> components/*
  -> utils/note-*.ts + utils/selection.ts + utils/source.ts

Interaction Flow

inspect / select
  -> open composer
  -> save note
  -> persist to localStorage
  -> render markers

Code Map

  • src/lib/element-source-inspector.svelte: public mount shell that syncs props into the controller.
  • src/lib/copy-open.svelte.ts: main orchestration class for runtime state and browser events.
  • src/lib/internal/*: controller-private helpers for state, selection flow, composer flow, and browser side effects.
  • src/lib/components/*: visible inspector UI.
  • src/lib/utils/note-*.ts: note storage, formatting, rendering, and layout helpers.
  • src/lib/utils/selection.ts: text/group/area anchor serialization and recovery.

Features

  • Inspect DOM elements and resolve source file location.
  • Jump to source with VS Code or VS Code Insiders URL schemes.
  • Annotate individual elements directly in the page.
  • Annotate selected text ranges.
  • Annotate grouped selections across multiple elements.
  • Annotate selected page areas.
  • Use a draggable floating toolbar.
  • Choose toolbar position presets.
  • Toggle the inspector theme inside the tool UI.
  • Copy notes in compact, standard, detailed, or forensic output modes.
  • Capture stable page metadata, selector paths, bounding boxes, nearby text, and component context for copied output.
  • Include computed-style snapshots for forensic exports.
  • Pause page animations while inspecting when needed.
  • Toggle marker visibility for notes.
  • Block normal page interactions while inspecting.
  • Use a delete-all flow with configurable delay.
  • Hook into annotation lifecycle and copy events with callbacks.
  • Mount the inspector only in dev mode with browser && dev.

Props

PropTypeDescription
workspaceRootstring | nullAbsolute project root for source lookup and editor links.
selectorstring | nullOptional selector to scope inspectable elements.
vscodeScheme'vscode' | 'vscode-insiders'Choose the VS Code URL scheme for open-in-editor actions.
openSourceOnClickbooleanOpen source directly on click instead of only showing metadata.
deleteAllDelayMsnumberConfirmation delay for delete-all notes.
toolbarPosition'top-left' | 'top-center' | 'top-right' | 'mid-right' | 'mid-left' | 'bottom-left' | 'bottom-center' | 'bottom-right'When provided, syncs the floating toolbar to this preset and stores it as the latest saved placement.
outputMode'compact' | 'standard' | 'detailed' | 'forensic'When provided, syncs the copy/export mode and stores it for later sessions.
pauseAnimationsbooleanWhen provided, syncs animation pausing while the inspector is active and stores it for later sessions.
clearOnCopybooleanWhen provided, syncs whether copied notes are cleared and stores it for later sessions.
includeComponentContextbooleanWhen provided, syncs component-context capture and stores it for later sessions.
includeComputedStylesbooleanWhen provided, syncs computed-style capture and stores it for later sessions.
copyToClipboardbooleanDisable direct clipboard writes and use callbacks only.
onAnnotationAdd(annotation) => voidCalled after a note is created.
onAnnotationUpdate(annotation) => voidCalled after a note is updated.
onAnnotationDelete(annotation) => voidCalled after a note is deleted.
onAnnotationsClear(annotations) => voidCalled after all notes are cleared.
onCopy(markdown, payload) => voidCalled after note export is prepared.

Shortcuts

ShortcutActionDescription
iToggle inspectorOpen or close the inspector toolbar and annotation mode.
cCopy all notesCopy notes as Markdown when at least one note exists.
rReset toolbar positionMove the floating toolbar back to the latest explicit prop value, saved placement, or default.
oOpen sourceOpen the currently hovered source location when the inspector is active.
escCancel current actionClear transient selections, close the composer, or close settings/delete state.
shift + ctrl/cmd + clickBuild a group selectionAdd or remove elements from a grouped annotation target before releasing the modifiers.

Public API

  • Agentation
  • AgentationInspector
  • ElementSourceInspector
  • AGENTATION_ACTIVE_CHANGE_EVENT
  • AGENTATION_BLOCKED_INTERACTION_EVENT
  • COPY_OPEN_ACTIVE_CHANGE_EVENT
  • COPY_OPEN_BLOCKED_INTERACTION_EVENT
  • INSPECTOR_ACTIVE_CHANGE_EVENT
  • INSPECTOR_BLOCKED_INTERACTION_EVENT
  • AgentationProps
  • InspectorProps
  • related exported Inspector* public types

Notes

  • Targets Svelte 5 consumers.
  • Intended for browser/dev-mode use, not production collaboration flows.
  • Highly inspired from Agentation.
  • Source-opening depends on element-source metadata and your workspaceRoot plus editor setup.
  • Internal state now uses a hybrid approach: *.svelte.ts for stateful controller helpers and plain .ts for pure transforms.

Credits

This project is highly inspired by Agentation.com.

Sponsor

GitHub Sponsors

Keywords

svelte

FAQs

Package last updated on 26 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts