Security v0.2.0

a2a-market-websocket-realtime

Deliver real-time websocket updates for intent, quote, negotiation, order, and payment events. Use when implementing...

luoqianchenguni 更新于 2026-03-19 1 浏览
下载 SKILL

技能说明

Deliver real-time websocket updates for intent, quote, negotiation, order, and payment events. Use when implementing push channels, subscription authorization, and connection/session lifecycle for market clients.

使用场景

Set up realtime delivery skeleton for buyer and operator clients.

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

帮我下载并安装这个SKILL:https://skillhub.cstcloud.cn/download/a2a-market-websocket-realtime
  1. 点击上方「下载 SKILL」按钮,获取技能压缩包。
  2. 将压缩包解压到你的 Agent 技能目录。
  3. 重启客户端后即可在技能列表中选择该技能。

技能文件内容

4 个文件 · 20 kB
SKILL.md text/markdown
---
name: a2a-market-websocket-realtime
description: Deliver real-time websocket updates for intent, quote, negotiation, order, and payment events. Use when implementing push channels, subscription authorization, and connection/session lifecycle for market clients.
---

# a2a-Market WebSocket Realtime

Set up realtime delivery skeleton for buyer and operator clients.

Current status: publishable framework with stable event contracts, not full scale tuning.

## Scope
- Define channel naming and auth guard for buyer, node, and admin roles.
- Push canonical domain events with predictable payload shape.
- Manage reconnect semantics and last-event cursor replay.

## Suggested Project Layout
- `app/interfaces/ws/socket_gateway.py`
- `app/application/services/realtime_service.py`
- `app/infrastructure/ws/connection_registry.py`
- `app/infrastructure/cache/replay_cursor_store.py`

## Minimum Contracts (MVP P0)
1. `subscribe(channel, cursor)` validates permission and registers stream.
2. `publish_event(channel, event)` fans out to online subscribers.
3. `resume(channel, cursor)` replays missed events within retention window.
4. `heartbeat(connection_id)` updates liveness and cleanup scheduling.

## Required Event Coverage
- `INTENT_CREATED`
- `QUOTE_RECEIVED`
- `NEGOTIATION_STARTED`
- `ORDER_CREATED`
- `PAYMENT_SUCCEEDED`

## Guardrails
- Keep payloads versioned and backward compatible.
- Limit per-connection queue to prevent memory blowups.
- Drop unauthorized subscription attempts with structured error codes.

## Implementation Backlog
- Add presence channels and typing/status hints for negotiation UI.
- Add regional relay nodes for cross-region latency reduction.

## Runtime Implementation
- Status: implemented in local runtime package.
- Primary code paths:
- `runtime/src/interfaces/ws/event-bus.js`
- Validation: covered by `runtime/tests` and `npm test` in `runtime/`.

文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。