Token导航 LogoToken导航

Agent Skill · 前端设计

wps-events(WPS 事件)

wps-events 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

wps-events 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 6,472。

总安装 499周安装 21GitHub Stars 19,406下载 175核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:wps-events(WPS 事件)
来源仓库:https://github.com/wavetermdev/waveterm
仓库路径:skills/wps-events
安装命令:
npx skills add https://github.com/wavetermdev/waveterm --skill wps-events
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wavetermdev/waveterm --skill wps-events

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

该技能用于处理 WPS 事件相关的 GitHub 协作信息。适用于 Codex、Claude、Cursor、Gemini CLI 中围绕代码变更与 Issue 管理。支持 Pull Request 状态跟踪与团队协作事项整理。通过 GitHub 仓库安装,注意权限与文件操作风险。建议结合原始文档确认具体功能与使用限制。

来源仓库内路径:skills/wps-events

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/wavetermdev/waveterm --skill wps-events;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

wps-events 怎么安装?

在终端执行 npx skills add https://github.com/wavetermdev/waveterm --skill wps-events。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

wps-events 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

wps-events 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

wps-events 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

wps-events 用的人多吗?

公开数据是累计安装 499 次,近一周安装 21 次,下载 175 次,GitHub 19,406 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

wps-events 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 19,406 星,维护活跃度相对可查。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
wps-events

WPS 事件 · 本页

49919,406操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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:

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:

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:

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:

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:

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:

// 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:

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:

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:

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 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:

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:

const (
    // ... other events ...
    Event_WaveAIRateLimit  = "waveai:ratelimit"
)

2. Publish the Event

In pkg/aiusechat/usechat.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:

// Subscribe to rate limit updates
const subscription = {
  event: "waveai:ratelimit",
  allscopes: true, // Receive all rate limit events
};

Subscribing to Events

From Go Code

// Subscribe to all events of a type
wps.Broker.Subscribe(routeId, wps.SubscriptionRequest{
    Event:     wps.Event_YourNewEvent,
    AllScopes: true,
})

// Subscribe to specific scopes
wps.Broker.Subscribe(routeId, wps.SubscriptionRequest{
    Event:  wps.Event_WaveObjUpdate,
    Scopes: []string{"workspace:123"},
})

// Unsubscribe
wps.Broker.Unsubscribe(routeId, wps.Event_YourNewEvent)

Scope Matching

Scopes support wildcard matching:

  • * matches a single scope segment
  • ** matches multiple scope segments
// Subscribe to all workspace events
wps.Broker.Subscribe(routeId, wps.SubscriptionRequest{
    Event:  wps.Event_WaveObjUpdate,
    Scopes: []string{"workspace:*"},
})

Best Practices

  1. Use Namespaces: Prefix event names with a namespace (e.g., waveai:, workspace:, block:)
  2. Don't Block: Use goroutines when publishing from performance-critical code or while holding locks
  3. Type-Safe Data: Define struct types for event data rather than using maps
  4. Scope Wisely: Use scopes to limit event delivery and reduce unnecessary processing
  5. Document Events: Add comments explaining when events are fired and what data they carry
  6. Consider Persistence: Use Persist for events that late subscribers might need (like status updates). This is normally not used. We normally do a live RPC call to get the current value and then subscribe for updates.

Common Event Patterns

Status Updates

wps.Broker.Publish(wps.WaveEvent{
    Event:   wps.Event_ControllerStatus,
    Scopes:  []string{blockId},
    Persist: 1,  // Keep only latest status
    Data:    statusData,
})

Object Updates

wps.Broker.Publish(wps.WaveEvent{
    Event:  wps.Event_WaveObjUpdate,
    Scopes: []string{oref.String()},
    Data: waveobj.WaveObjUpdate{
        UpdateType: waveobj.UpdateType_Update,
        OType:      obj.GetOType(),
        OID:        waveobj.GetOID(obj),
        Obj:        obj,
    },
})

Batch Updates

// Helper function for multiple updates
func (b *BrokerType) SendUpdateEvents(updates waveobj.UpdatesRtnType) {
    for _, update := range updates {
        b.Publish(WaveEvent{
            Event:  Event_WaveObjUpdate,
            Scopes: []string{waveobj.MakeORef(update.OType, update.OID).String()},
            Data:   update,
        })
    }
}

Debugging

To debug event flow:

  1. Check broker subscription map: wps.Broker.SubMap
  2. View persisted events: wps.Broker.ReadEventHistory(eventType, scope, maxItems)
  3. Add logging in publish/subscribe methods
  4. Monitor WebSocket traffic in browser dev tools

Quick Reference

When adding a new event:

  • Add event constant to pkg/wps/wpstypes.go with a // type: <TypeName> comment (use none if no data)
  • Add the constant to AllEvents in pkg/wps/wpstypes.go
  • REQUIRED: Add an entry to WaveEventDataTypes in pkg/tsgen/tsgenevent.go — use nil for events with no data
  • Define event data structure (if needed)
  • Add data type to pkg/tsgen/tsgen.go for frontend use (if not already exposed via RPC)
  • Run task generate to update TypeScript types
  • Publish events using wps.Broker.Publish()
  • Use goroutines for non-blocking publish when appropriate
  • Subscribe to events in relevant components

平台分布

Codex

34.3%
按下载量换算60

Claude

32.86%
按下载量换算58

Cursor

20.2%
按下载量换算35

Gemini CLI

9.45%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills