Agent skill

Eventa

by moeru-ai in moeru-ai/airi

Guide for using @moeru/eventa — a transport-aware event library powering ergonomic RPC and streaming flows.

MITAuto-check passedBackend & APIs

Install Eventa

skills CLI
$ npx skills add moeru-ai/airi --skill eventa -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install moeru-ai/airi eventa --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/moeru-ai/airi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/eventa .claude/skills/eventa && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
eventa
GitHub stars
50k
Token cost
~2.4k tokens
SKILL.md length
458 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Guide for using @moeru/eventa — a transport-aware event library powering ergonomic RPC and streaming flows.

  • Works in 3 steps: Events are first-class — define typed… → Transports are swappable — the same… → RPC is just events — invoke/stream…
  • The user imports from @moeru/eventa
  • SKILL.md covers Core Concepts, API Quick Reference, Adapters and Advanced Features, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Eventa is an agent skill from moeru-ai/airi. Guide for using @moeru/eventa — a transport-aware event library powering ergonomic RPC and streaming flows. Use this skill whenever the user imports from '@moeru/eventa', mentions eventa, needs cross-process/cross-thread event communication (Electron IPC, Web Workers, WebSocket, BroadcastChannel, EventEmitter, EventTarget, Worker Threads), wants to define type-safe events with RPC invoke patterns, needs streaming RPC (server-streaming, client-streaming, or bidirectional), or asks about transport-agnostic event…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Realtime and WebSockets and Type safety. The repository describes itself as: 💖🧸 Self hosted, you-owned Grok Companion, a container of souls of waifu, cyber livings to bring them into our worlds, wishing to achieve Neuro-sama's altitude. Capable of… The licence is MIT.

When your agent uses it

  • The user imports from @moeru/eventa
  • Mentions eventa
  • Needs cross-process/cross-thread event communication (Electron IPC
  • BroadcastChannel

Example prompts

  • “@moeru/eventa”
  • “/eventa”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Events are first-class — define typed events once, use them everywhere
  2. Transports are swappable — the same event definitions work across Electron IPC, WebSocket, Web Workers, BroadcastChannel, EventEmitter…
  3. RPC is just events — invoke/stream patterns are composed from the same event primitives

What it can do on your machine

Read from SKILL.md and the folder at commit 0327dc8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Eventa loads about 2.4k tokens when it runs. Until then it costs about 153 tokens; SKILL.md has 458 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~153
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from moeru-ai/airi at commit 0327dc8, republished under its MIT licence (© moeru-ai). 458 words, ~2,354 tokens.

Download SKILL.mdSave it as .claude/skills/eventa/SKILL.md (or your agent's skills folder).
name
eventa
description
Guide for using @moeru/eventa — a transport-aware event library powering ergonomic RPC and streaming flows. Use this skill whenever the user imports from '@moeru/eventa', mentions eventa, needs cross-process/cross-thread event communication (Electron IPC, Web Workers, WebSocket, BroadcastChannel, EventEmitter, EventTarget, Worker Threads), wants to define type-safe events with RPC invoke patterns, needs streaming RPC (server-streaming, client-streaming, or bidirectional), or asks about transport-agnostic event abstractions. Also use when the user discusses alternatives to birpc or async-call-rpc.
license
MIT
metadata.author
moeru-ai
metadata.version
1.0.0

@moeru/eventa

Transport-aware events powering ergonomic RPC and streaming flows.

Core Concepts

Eventa is built around three ideas:

  1. Events are first-class — define typed events once, use them everywhere
  2. Transports are swappable — the same event definitions work across Electron IPC, WebSocket, Web Workers, BroadcastChannel, EventEmitter, EventTarget, and Worker Threads
  3. RPC is just events — invoke/stream patterns are composed from the same event primitives

API Quick Reference

Event Definition & Context
ts
import { createContext, defineEventa } from '@moeru/eventa'

// Define a typed event (the generic is the payload type)
const move = defineEventa<{ x: number, y: number }>()

// Create a base context (in-memory, useful for same-process communication)
const ctx = createContext()

// Emit and listen
ctx.emit(move, { x: 100, y: 200 })
ctx.on(move, ({ body }) => console.log(body.x, body.y))
Unary RPC (Invoke)
ts
import { createContext, defineInvoke, defineInvokeEventa, defineInvokeHandler } from '@moeru/eventa'

const ctx = createContext()

// defineInvokeEventa<ResponseType, RequestType>(optionalName)
const echo = defineInvokeEventa<{ output: string }, { input: string }>('rpc:echo')

// Register handler (server side)
defineInvokeHandler(ctx, echo, ({ input }) => ({ output: input.toUpperCase() }))

// Create invoke function (client side)
const invokeEcho = defineInvoke(ctx, echo)
const result = await invokeEcho({ input: 'hello' }) // { output: 'HELLO' }
Streaming RPC (Server-Streaming)
ts
import { createContext, defineInvokeEventa, defineStreamInvoke, defineStreamInvokeHandler, toStreamHandler } from '@moeru/eventa'

const ctx = createContext()
const sync = defineInvokeEventa<
  { type: 'progress' | 'result', value: number },
  { jobId: string }
>('rpc:sync')

// Generator-style handler
defineStreamInvokeHandler(ctx, sync, async function* ({ jobId }) {
  for (let i = 1; i <= 5; i++) {
    yield { type: 'progress' as const, value: i * 20 }
  }
  yield { type: 'result' as const, value: 100 }
})

// Or imperative style with toStreamHandler
defineStreamInvokeHandler(ctx, sync, toStreamHandler(async ({ payload, emit }) => {
  emit({ type: 'progress', value: 0 })
  emit({ type: 'result', value: 100 })
}))

// Consume as async iterator
const stream = defineStreamInvoke(ctx, sync)
for await (const update of stream({ jobId: 'import' })) {
  console.log(update.type, update.value)
}
Client-Streaming (Stream Input, Unary Output)
ts
const recordRoute = defineInvokeEventa<
  { distance: number, points: number },
  ReadableStream<{ lat: number, lng: number }>
>('rpc:record-route')

defineInvokeHandler(ctx, recordRoute, async (stream) => {
  let points = 0
  for await (const _ of stream) points += 1
  return { distance: points * 10, points }
})

const invoke = defineInvoke(ctx, recordRoute)
const input = new ReadableStream({
  start(c) { c.enqueue({ lat: 0, lng: 0 }); c.enqueue({ lat: 1, lng: 1 }); c.close() },
})
await invoke(input)
Bidirectional Streaming
ts
const routeChat = defineInvokeEventa<
  { message: string },
  ReadableStream<{ message: string }>
>('rpc:route-chat')

defineStreamInvokeHandler(ctx, routeChat, async function* (incoming) {
  for await (const note of incoming) {
    yield { message: `echo: ${note.message}` }
  }
})

const stream = defineStreamInvoke(ctx, routeChat)
for await (const note of stream(outgoing)) {
  console.log(note.message)
}
Abort/Cancel
ts
// Client-side cancellation
const controller = new AbortController()
const promise = invokeMethod({ input: 'work' }, { signal: controller.signal })
controller.abort('user cancelled')

// Server-side abort awareness
defineInvokeHandler(ctx, event, async ({ input }, options) => {
  const signal = options?.abortController?.signal
  if (signal?.aborted) return { output: 'aborted' }
  signal?.addEventListener('abort', () => { /* cleanup */ }, { once: true })
  return { output: `done: ${input}` }
})
Multi-hop Channels

Channels form ordered routing chains. They carry events, unary invokes, every stream frame, and invocation cancellation through intermediate contexts.

ts
import { linkChannel, pipeChannel } from '@moeru/eventa'

pipeChannel(a, b, c) // a -> b -> c
linkChannel(a, b, c) // a <-> b <-> c

There is no direct a to c edge. Use multiple explicit pipes for fan-out. Disposing a channel removes its edges only; context abort never cascades across a link. One connected graph must have one effective handler for each invoke definition.

Each local emit creates an EventaInner whose deliveryId survives channel hops and transport serialization. Contexts suppress recently seen delivery IDs and stop forwarding when hopsRemaining reaches zero. Plugins may inspect the read-only inner value and transform or drop its Eventa, but may not replace routing identity or hop state.

For iframe-to-server routing, connect the EventTarget-side context to the plugin's BroadcastChannel context, then connect the gateway's BroadcastChannel context to its WebSocket context. The adapters carry the inner value across the runtime boundaries; no directional forwarding markers are needed.

Contexts do not serialize concurrent emit() calls. Request and response stream pumps await each frame only to preserve per-invocation stream order; cancellation is routed independently and may arrive before request frames.

Bulk Registration (Shorthands)
ts
const events = {
  double: defineInvokeEventa<number, number>(),
  append: defineInvokeEventa<string, string>(),
}

defineInvokeHandlers(ctx, events, {
  double: input => input * 2,
  append: input => `${input}!`,
})

const { double, append } = defineInvokes(ctx, events)

Adapters

Each adapter wraps a specific transport into an eventa context. The pattern is always:

ts
import { createContext } from '@moeru/eventa/adapters/<adapter-name>'
const { context } = createContext(transportInstance)
Show full SKILL.md (178 more words)Show less
Available Adapters
AdapterImport PathTransport
Electron Main@moeru/eventa/adapters/electron/mainipcMain + webContents
Electron Renderer@moeru/eventa/adapters/electron/rendereripcRenderer
Web Worker (main)@moeru/eventa/adapters/webworkersWorker instance
Web Worker (worker)@moeru/eventa/adapters/webworkers/workerself (worker global)
Worker Threads (main)@moeru/eventa/adapters/worker-threadsNode.js Worker
Worker Threads (worker)@moeru/eventa/adapters/worker-threads/workerparentPort
WebSocket Client@moeru/eventa/adapters/websocket/nativeWebSocket
WebSocket Server (H3)@moeru/eventa/adapters/websocket/h3H3 WebSocket hooks
BroadcastChannel@moeru/eventa/adapters/broadcast-channelBroadcastChannel
EventTarget@moeru/eventa/adapters/event-targetEventTarget
EventEmitter@moeru/eventa/adapters/event-emitterNode.js EventEmitter
Adapter Usage Pattern (Electron Example)
ts
// shared/events.ts — define events once
import { defineInvokeEventa } from '@moeru/eventa'
export const readdir = defineInvokeEventa<{ dirs: string[] }, { path: string }>('fs:readdir')

// main.ts — register handler
import { createContext } from '@moeru/eventa/adapters/electron/main'
const { context } = createContext(ipcMain, mainWindow.webContents)
defineInvokeHandler(context, readdir, async ({ path }) => ({ dirs: await fs.readdir(path) }))

// renderer.ts (preload) — call it
import { createContext } from '@moeru/eventa/adapters/electron/renderer'
const { context } = createContext(ipcRenderer)
const invokeReaddir = defineInvoke(context, readdir)
const result = await invokeReaddir({ path: '/usr' })

Advanced Features

  • Delivery routing: EventaInner<T> preserves delivery identity and hop budget across channels and adapters
  • Match expressions: matchBy(glob), matchBy(regex), and(...), or(...) for event filtering
  • WebSocket lifecycle: wsConnectedEvent and wsDisconnectedEvent from the native adapter

Key Rules

  1. Always define events in a shared module — both sides import the same event definition for type safety
  2. defineInvokeEventa<Res, Req>() — Response type comes first, Request type second
  3. Handlers can throw errors safely — eventa propagates them to the caller
  4. Validate data at the edges — eventa forwards whatever payload you emit
  5. Install only the peer dependencies you need (electron, h3, web-worker are all optional)

Documentation

For the latest API reference, use context7 to query @moeru/eventa documentation.

© moeru-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/eventa of moeru-ai/airi.

Open the folder on GitHubat commit 0327dc8

Compare with similar skills

Eventa next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Eventa compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Eventa this skillmoeru-ai/airi50k—~2.4kAutomated safety check: PassMIT
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT
GraphQL Operations with CodegenChrisWiles/claude-code-showcase6.1k3 repos~1.5kAutomated safety check: PassNone
Gemini Live API Devgoogle-gemini/gemini-skills4.3k—~4.6kAutomated safety check: PassApache-2.0
Broker Integrationmarketcalls/openalgo2.8k—~4.7kAutomated safety check: NotesAGPL-3.0

Similar skills

  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • GraphQL Operations with Codegen

    ChrisWiles/claude-code-showcase

    Sets the rules for writing GraphQL queries and mutations in .gql files, running codegen, and using generated Apollo hooks with proper error and loading handling.

    6.1k GitHub starsUsed in 3 repos~1.5k tokens
    Backend & APIsAuto-check passed
  • Gemini Live API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.

    4.3k GitHub stars~4.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Broker Integration

    marketcalls/openalgo

    Integrate a new Indian broker into OpenAlgo, or modify an existing broker plugin.

    2.8k GitHub stars~4.7k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Trigger.dev Realtime

    papermark/papermark

    Shows how to subscribe to Trigger.dev task runs from the backend and from React for progress indicators, live dashboards, AI response streams and approval waits.

    9.2k GitHub stars~1.7k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed

More from moeru-ai/airi

All 24 skills in this repo
  • Simple English

    moeru-ai/airi

    Write or rewrite technical text with the rules of ASD-STE100 Simplified Technical English so it is clear, unambiguous, and free of AI slop.

    50k GitHub starsUsed in 2 repos~4.6k tokens
    Auto-check passed
  • Review pending AIRI translations on Crowdin in a batch, then sync them into the repository.

    50k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Upload a local image or file to GitHub's user-attachments storage and return a URL suitable for issue, pull request, discussion, or comment Markdown.

    50k GitHub stars~554 tokensUpdated today
    Auto-check passed
  • Create PR

    moeru-ai/airi

    Prepare and create an AIRI pull request with verifiable change context, architecture evidence, and required visual evidence.

    50k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Test AIRI display-model imports with agent-browser across stage-tamagotchi Electron, stage-web, and stage-pocket mobile web layouts.

    50k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when Codex needs to inspect, debug, or automate an Electron app through agent-browser and Chrome DevTools Protocol, especially when the app has multiple BrowserWindow…

    50k GitHub stars~3.1k tokensUpdated today
    Auto-check passed

Categories

Questions about Eventa

What does Eventa do?

Guide for using @moeru/eventa — a transport-aware event library powering ergonomic RPC and streaming flows. Eventa is an agent skill from moeru-ai/airi. Guide for using @moeru/eventa — a transport-aware event library powering ergonomic RPC and streaming flows.

When should I use Eventa?

Eventa fits situations like: the user imports from @moeru/eventa; mentions eventa; needs cross-process/cross-thread event communication (Electron IPC; broadcastChannel.

How do I install Eventa in Claude Code?

Run `npx skills add moeru-ai/airi --skill eventa -a claude-code`. Or copy the skill folder (.agents/skills/eventa in moeru-ai/airi) into .claude/skills/eventa in your project. Claude Code loads it when a task matches its description.

How do I install Eventa in Codex?

Run `npx skills add moeru-ai/airi --skill eventa -a codex`. Or copy the skill folder (.agents/skills/eventa in moeru-ai/airi) into .agents/skills/eventa in your project. Codex loads it when a task matches its description.

Can I use Eventa in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add moeru-ai/airi --skill eventa -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/eventa, .gemini/skills/eventa, .github/skills/eventa and .opencode/skills/eventa in your project.

What does Eventa need to run?

SKILL.md names no scripts, command-line tools or credentials: Eventa is instructions for the agent only. Our summary lists: Node.js.

Does Eventa access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Eventa safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Eventa use?

Eventa is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Eventa use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Eventa?

Skills that share tags, products or a category with Eventa: Supabase Development and Debugging (supabase/agent-skills, 2.7k stars), Use Yaak (mountain-loop/yaak, 19k stars), GraphQL Operations with Codegen (ChrisWiles/claude-code-showcase, 6.1k stars) and Gemini Live API Dev (google-gemini/gemini-skills, 4.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Eventa?

moeru-ai (a GitHub organization) maintains it in moeru-ai/airi, which has 50,204 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 9, 2026.

Source: moeru-ai/airi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.