Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add stephansama/packages --skill typed-eventsgit clone --depth 1 https://github.com/stephansama/packagesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/stephansama/packages/typed-events)<a href="https://agentmods.dev/skills/stephansama/packages/typed-events"><img src="https://agentmods.dev/badge/skills/stephansama/packages/typed-events.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00080 | $0.01826 |
| Opus 5 | $0.00040 | $0.00913 |
| Sonnet 5 | $0.00016 | $0.00365 |
| Haiku 4.5 | $0.00008 | $0.00183 |
Grade A, and why
typed-events scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.
typed-events
Typed, schema-validated wrappers for native browser event APIs. Each factory returns an object with dispatch() and listen() — listen() returns a cleanup function.
Choosing the right factory
| Goal | Use |
|---|---|
| Fire an event on the current page | createEvent |
| Group related events under a namespace | createEventMap |
| Sync state across browser tabs | createBroadcastChannel |
| Fire locally AND across tabs simultaneously | createBroadcastEvent |
| Send a message to an iframe or cross-origin window | createMessage |
Setup
import * as z from "zod";
import { createEvent } from "@stephansama/typed-events";
export const animationEvent = createEvent(
"my-app:animation",
z.object({ x: z.number(), y: z.number() }),
);
Core Patterns
Single validated CustomEvent
import * as z from "zod";
import { createEvent } from "@stephansama/typed-events";
export const clickEvent = createEvent(
"my-app:click",
z.object({ id: z.string() }),
);
// dispatch
clickEvent.dispatch({ id: "btn-1" });
// listen — store cleanup and call it when done
const cleanup = clickEvent.listen(({ data }) => {
console.log(data.id);
});
// later:
cleanup();
Namespaced event map (group related events)
import * as z from "zod";
import { createEventMap } from "@stephansama/typed-events";
export const formEvents = createEventMap("form", {
submit: z.object({ values: z.record(z.string()) }),
reset: z.object({}),
});
formEvents.dispatch("submit", { values: { email: "[email protected]" } });
const cleanup = formEvents.listen("submit", ({ data }) => {
console.log(data.values);
});
Event names are scoped internally as form:submit and form:reset.
Cross-tab sync with BroadcastChannel
import * as z from "zod";
import { createBroadcastChannel } from "@stephansama/typed-events";
export const tabChannel = createBroadcastChannel("my-app", {
theme: z.object({ mode: z.enum(["light", "dark"]) }),
});
tabChannel.dispatch("theme", { mode: "dark" });
const cleanup = tabChannel.listen("theme", ({ data }) => {
document.documentElement.dataset.theme = data.mode;
});
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 256 lines · 80 tokens per session scan A 7126183bb83d
typed-events is a skill published in the GitHub repository stephansama/packages (5 stars, last pushed 1mo ago), licensed MIT. It adds 80 tokens to every session and 1,826 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
onejs-setup-and-overview
Use this skill whenever the user wants to build or set up user interface in a Unity project using OneJS, React, TypeScript, or JSX, e.g. 'add a main menu to my game', 'build a settings screen', 'make a HUD', 'set up OneJS', 'my OneJS panel is blank', 'the UI is not hot reloading'. Covers confirming OneJS is installed…
photo-sphere-viewer
Use when displaying 360-degree panoramic images (equirectangular/cubemap/dual-fisheye) in web applications, building virtual tours with markers and transitions, embedding interactive panoramas in Vue/React/vanilla JS, or creating 360-degree video players with gyroscope VR support. Photo-Sphere-Viewer v5: JavaScript…
javascript-expert
Expert-level JavaScript development with modern ES2024+ features, Node.js, npm ecosystem, and best practices. Use when the user mentions ECMAScript, ES2024, Node.js, npm, or web, or when the task involves Modern JavaScript, Node.js Development, Modern Tooling, or Functional Programming.
typescript-expert
Expert-level TypeScript development with modern tooling, advanced types, and best practices. Use this skill for TypeScript projects requiring type-safe code, modern bundling, and comprehensive testing.
javascript-development
JavaScript/TypeScript ES2024+, async/await, DOM manipulation, Node.js, and API integration. Use when writing vanilla JS/TS code, working with REST/fetch APIs, implementing frontend logic, or configuring JS build tools.
pixi-vn-getting-started
Use when setting up a new or existing project on @drincs/pixi-vn, wiring the main.ts entry point, or calling the top-level Game API (Game.init, Game.start, Game.onEnd, Game.addOnError, Game.onNavigate, Game.clear) — this is the entry point every Pixi'VN project needs before touching canvas, narration, sound, storage…