wps events

Engineering Community

Skill notes

Overview

WPS (Wave PubSub) is Wave Terminal's publish-subscribe event system that enables different parts of the application to communicate asynchronously. The system uses a broker pattern to route events from publishers to subscribers based on event types and scopes.

Key Files

pkg/wps/wpstypes.go - Event type constants and data structures pkg/wps/wps.go - Broker implementation and core logic pkg/wcore/wcore.go - Example usage patterns

Event Structure

Events in WPS have the following structure:

Step 1: Define the Event Constant

Add your event type constant to pkg/wps/wpstypes.go: Naming Convention: Use descriptive PascalCase for the constant name with Event_ prefix Use lowercase with colons for the string value (e.g., "namespace:eventname") Group related events with the same namespace prefix

Step 2: Add to AllEvents

Add your new constant to the AllEvents slice in pkg/wps/wpstypes.go:

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Engineering
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@wavetermdev · no license declared
Token usage
Lean
Setup complexity
Plug-and-play
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
Network behavior
Local-only
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

Output preview wps-events.preview
# Complete Example: Rate Limit Updates

This example shows how rate limit information is published when AI chat responses include rate limit headers.

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.