OpenParable
Skip to content
← Back to skills

Callback Events

Development
callback-events

Callback Events is an Agent Skill for development published in the fossasia/visdom repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Implement and debug browser-to-Python callback routing for clicks, key presses, property updates, and close events

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/fossasia/visdom/blob/HEAD/.agents/skills/callback-events/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/callback-events, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Skill: Callback and Event Roundtrip

When to Use

Use this skill when changing event callbacks or pane interactivity.

Core Workflow

  1. Register callback handlers via register_event_handler() on the Python side.
  2. Ensure frontend emits correct event payloads (event_type, target, and event-specific fields).
  3. Route browser events through socket command forwarding (forward_to_vis).
  4. Keep server forwarding logic from browser socket to Python source sockets intact.
  5. Validate event names/fields against existing callback contracts.

Guardrails

  • Callback handlers run in a background socket thread; avoid unsafe shared state writes.
  • Do not rename event keys without coordinated client/server/docs updates.
  • Preserve existing event types (Click, KeyPress, PropertyUpdate, Close, etc.).

Documentation

  • Skill reference
  • py/visdom/__init__.py
  • py/visdom/server/handlers/socket_handlers.py
  • js/api/ApiProvider.js
  • js/EventSystem.js
  • AGENTS.md
  • CONTRIBUTING.md

Assets

  • See assets/README.md and store templates/resources in assets/.

Tests

  • Follow the default flow in references/TESTS.md.