@web/sse
v1.0.0
MIT
.cap
✓ Verified by capdux.org
AI-First .d.cp
Official Server-Sent Events (SSE) plugin with Last-Event-ID replay buffer & AI streaming helpers for cap:web
Install with Cap
$ cap add @web/sse
AI Interface Stub .d.cp
// Type definitions for CP
import { App, AppMethod, Context, Response, Plugin, PluginScope } from "../../../../lib/web/app.cp";
export class SseConfig {
endpoint_path: string,
retry_ms: u32,
cors_allow_origin: string,
}
export class SseMessage {
id: u64,
event_name: string,
data: string,
}
export fn sseWriteRaw(dst: []u8, pos: &mut usize, s: string): bool;
export fn sseWriteU64(dst: []u8, pos: &mut usize, val: u64): bool;
export fn sseParseU64(s: string): u64;
export fn encodeSseEvent(id: u64, event_name: string, data: string, out_buf: []u8, pos: &mut usize): bool;
export fn encodeSseHeartbeat(out_buf: []u8, pos: &mut usize): bool;
export fn sseResetBroker();
export fn ssePublish(event_name: string, data: string): u64;
export fn buildSseReplayResponse(last_event_id: u64): Response;
export fn handleSseEndpoint(ctx: &mut Context): Response;
export fn createSsePlugin(cfg: SseConfig): Plugin;
export fn registerSse(app: &mut App, cfg: SseConfig): &mut App;
README
MarkdownNo README provided for this package version.
Version History
1 release| Version | Format / Size | Integrity (SHA-256) | Downloads | Published | Status |
|---|---|---|---|---|---|
| v1.0.0 | .cap · 2.8 KB | sha256-3d7b9a3b65264a64… | 0 | 2026-11-26 | latest |