Agent skill · Audited from source
Wps Events
skill · wavetermdev/wavetermApache-2.0 licenceAudited 5 Oct 2026 · source 63907843412f
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 63907843412f and found no filesystem, network or shell access and no hard-coded secrets. What it does: Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components.
Cite
Cite this page
ModelsAtlas. “Wps Events (wavetermdev/waveterm)”. Retrieved 5 Oct 2026. https://modelsatlas.com/skills/wavetermdev/wps-events
Trust audit
Audit 0.4.1 · source read 5 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha 63907843412f · 5 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherwavetermdev GitHub organizationOwner of the repository this skill is read from
- Source folderwavetermdev/waveterm/.kilocode/skills/wps-eventsThe exact folder we audited
- LicenceApache-2.0As the repository states it
- Commit pinned for this verdict63907843412fA new audit runs when the source changes
- Repository statusNot archivedLast push 2 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components.
---
name: wps-events
description: Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components.
---
# WPS Events Guide
## 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:
```go
type WaveEvent struct {
Event string `json:"event"` // Event type constant
Scopes []string `json:"scopes,omitempty"` // Optional scopes for targeted delivery
Sender string `json:"sender,omitempty"` // Optional sender identifier
Persist int `json:"persist,omitempty"` // Number of events to persist in history
Data any `json:"data,omitempty"` // Event payload
}
```
## Adding a New Event Type
### Step 1: Define the Event Constant
Add your event type constant to `pkg/wps/wpstypes.go`:
```go
const (
Event_BlockClose = "blockclose"
Event_ConnChange = "connchange"
// ... other events ...
Event_YourNewEvent = "your:newevent" // type: YourEventData (or "none" if no data)
)
```
**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
- Always add a `// type: <TypeName>` comment; use `// type: none` if no data is sent
### Step 2: Add to AllEvents
Add your new constant to the `AllEvents` slice in `pkg/wps/wpstypes.go`:
```go
var AllEvents []string = []string{
// ... existing events ...
Event_YourNewEvent,
}
```
### Step 3: Register in WaveEventDataTypes (REQUIRED)
You **must** add an entry to `WaveEventDataTypes` in `pkg/tsgen/tsgenevent.go`. This drives TypeScript type generation for the event's `data` field:
```go
var WaveEventDataTypes = map[string]reflect.Type{
// ... existing entries ...
wps.Event_YourNewEvent: reflect.TypeOf(YourEventData{}), // value type
// wps.Event_YourNewEvent: reflect.TypeOf((*YourEventData)(nil)), // pointer type
// wps.Event_YourNewEvent: nil, // no data (type: none)
}
```
- Use `reflect.TypeOf(YourType{})` for value types
- Use `reflect.TypeOf((*YourType)(nil))` for pointer types
- Use `nil` if no data is sent for the event
### Step 4: Define Event Data Structure (Optional)
If your event carries structured data, define a type for it:
```go
type YourEventData struct {
Field1 string `json:"field1"`
Field2 int `json:"field2"`
}
```
### Step 5: Expose Type to Frontend (If Needed)
If your event data type isn't already exposed via an RPC call, you need to add it to `pkg/tsgen/tsgen.go` so TypeScript types are generated:
```go
// add extra types to generate here
var ExtraTypes = []any{
waveobj.ORef{},
// ... other types ...
uctypes.RateLimitInfo{}, // Example: already added
YourEventData{}, // Add your new type here
}
```
Then run code generation:
```bash
task generate
```
This will update `frontend/types/gotypes.d.ts` with TypeScript definitions for your type, ensuring type safety in the frontend when handling these events.
## Publishing Events
### Basic Publishing
To publish an event, use the global broker:
```go
import "github.com/wavetermdev/waveterm/pkg/wps"
wps.Broker.Publish(wps.WaveEvent{
Event: wps.Event_YourNewEvent,
Data: yourData,
})
```
### Publishing with Scopes
Scopes allow targeted event delivery. Subscribers can filter events by scope:
```go
wps.Broker.Publish(wps.WaveEvent{
Event: wps.Event_WaveObjUpdate,
Scopes: []string{oref.String()}, // Target specific object
Data: updateData,
})
```
### Publishing in a Goroutine
To avoid blocking the caller, publish events asynchronously:
```go
go func() {
wps.Broker.Publish(wps.WaveEvent{
Event: wps.Event_YourNewEvent,
Data: data,
})
}()
```
**When to use goroutines:**
- When publishing from performance-critical code paths
- When the event is informational and doesn't need immediate delivery
- When publishing from code that holds locks (to prevent deadlocks)
### Event Persistence
Events can be persisted in memory for late subscribers:
```go
wps.Broker.Publish(wps.WaveEvent{
Event: wps.Event_YourNewEvent,
Persist: 100, // Keep last 100 events
Data: data,
})
```
## Complete Example: Rate Limit Updates
This example shows how rate limit information is published when AI chat responses include rate limit headers.
### 1. Define the Event Type
In `pkg/wps/wpstypes.go`:
```go
const (
// ... other events ...
Event_WaveAIRateLimit = "waveai:ratelimit"
)
```
### 2. Publish the Event
In `pkg/aiusechat/usechat.go`:
```go
import "github.com/wavetermdev/waveterm/pkg/wps"
func updateRateLimit(info *uctypes.RateLimitInfo) {
if info == nil {
return
}
rateLimitLock.Lock()
defer rateLimitLock.Unlock()
globalRateLimitInfo = info
// Publish event in goroutine to avoid blocking
go func() {
wps.Broker.Publish(wps.WaveEvent{
Event: wps.Event_WaveAIRateLimit,
Data: info, // RateLimitInfo struct
})
}()
}
```
### 3. Subscribe to the Event (Frontend)
In the frontend, subscribe to events via WebSocket:
```typescript
// Subscribe to rate limit updates
const subscription = {
event: "waveai:ratelimit",
allscopes: true, // Receive all rate limit events
};
```
## Subscribing to Events
### From Go Code
```go
Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 6390784
git clone https://github.com/wavetermdev/waveterm git -C waveterm checkout 63907843412f
The author documents no install command, so this uses the repository directly. Our verdict covers commit 63907843412f only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
63907843412f
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/wavetermdev/wps-events/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →wavetermdev/waveterm
Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC.
wavetermdev/waveterm
Guide for creating WaveEnv narrowings in Wave Terminal. Use when writing a named subset type of WaveEnv for a component tree, documenting environmental dependencies, or enabling mock environments for preview/test server…
wavetermdev/waveterm
Guide for adding new configuration settings to Wave Terminal. Use when adding a new setting to the configuration system, implementing a new config key, or adding user-customizable settings.
wavetermdev/waveterm
Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality.
wavetermdev/waveterm
Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface.
wavetermdev/waveterm
Guide for creating and displaying context menus in Wave Terminal. Use when implementing right-click menus, adding context menu items, creating submenus, or handling menu interactions with checkboxes and separators.
Add this badge to your README
[](https://modelsatlas.com/skills/wavetermdev/wps-events/)
<a href="https://modelsatlas.com/skills/wavetermdev/wps-events/"><img src="https://modelsatlas.com/skills/wavetermdev/wps-events/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Wps Events
What does the Wps Events skill do?
Is Wps Events safe to install?
What can Wps Events access on my machine?
How current is this page?
Sources
- github.com/wavetermdev/waveterm/tree/main/.kilocode/skills/wps-e — the audited source at commit 63907843412f and every finding aboveObserved · 5 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Wps Events skill do?
- Is Wps Events safe to install?
- What can Wps Events access on my machine?