본문으로 건너뛰기
cccskills
무료GitHub에 공개

iii-stream

Build live backends that store data, broadcast changes, and run handlers automatically. Covers subscription authorization, connection events, and atomic updates, which apply changes safely when multiple writers act at once.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Durable real-time streams with a CRUD function surface plus reactive triggers that fire on item changes and WebSocket subscriber lifecycle — reach for it to build live backends without polling.

설치 방법 보기

이럴 때 유용합니다

  • Broadcasting live data changes to subscribers
  • Checking permissions before a subscription starts
  • Tracking connections and disconnections
  • Applying concurrent updates safely

포함된 파일(1)

  • SKILL.md5.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

iii-stream

The iii-stream worker stores real-time data as a three-level hierarchy (stream_name -> group_id -> item_id) in the configured adapter and exposes two surfaces: a CRUD-shaped stream::* function namespace for reading and writing items, and reactive trigger types (stream, stream:join, stream:leave) that fire on data changes and on WebSocket subscriber connect/disconnect. Reactive backends are built by binding handlers to those triggers rather than by polling.

A write persists the new value, dispatches matching stream triggers on a spawned task (fire-and-forget, so the originating call returns before handlers finish), and broadcasts the change to every WebSocket client subscribed to that (stream_name, group_id). The stream:join trigger doubles as an authorization gate: returning { unauthorized: true } from its handler rejects the subscription before any data flows. Pair it with the worker's auth_function config, which runs once per WebSocket handshake and stamps a context value into every join/leave event.

Adapters: kv (default; in-memory or file-backed; single-instance only, no cross-process fan-out) or redis (required for multi-instance fleets that need real-time fan-out). Browser and client subscriptions use the Browser SDK (iii-browser-sdk), which subscribes to stream changes over a single engine WebSocket. Connecting directly to the stream port (ws://host:{port}/stream/{stream_name}/{group_id}) is deprecated in favor of the Browser SDK.

When to Use

  • A stream change should kick off side effects elsewhere (derived projections, audit logs, notifications) without polling stream::list.
  • You need to gate WebSocket subscriptions server-side instead of trusting client-side filtering.
  • You want server-side reactions to subscriber connect/disconnect for presence counters, per-subscription rate buckets, or audit trails.
  • An item needs atomic partial updates that concurrent writers would otherwise race on.

Boundaries

  • Not a general key/value store — data is stream-shaped (stream_name/group_id/item_id). Use the standalone state worker for scope/key values.
  • The default kv adapter does not fan out across processes; multi-instance fleets that need real-time broadcast must use redis.
  • stream:leave is not an authorization gate — the subscription is already gone by the time it fires, and its return value is ignored.
  • Trigger handlers run after the originating write returns; a handler failure neither rolls back the write nor surfaces to the caller.

Functions

  • stream::set — persist an item and broadcast a create/update event; returns the previous value alongside the new one.
  • stream::update — atomically apply ordered set/merge/increment/decrement/append/remove ops to an existing item.
  • stream::delete — remove an item and broadcast a delete event carrying the removed value.
  • stream::send — broadcast a transient event to a group's subscribers without persisting it (typing indicators, cursor positions).
  • stream::get — read one item by its full (stream, group, item) triple.
  • stream::list — enumerate items in a group.
  • stream::list_groups — enumerate groups in a stream.
  • stream::list_all — enumerate every stream's metadata.

Reactive triggers

Bind a stream-family trigger when a function should run automatically on stream activity — without polling stream::list. Three types cover two concerns: stream reacts to data changes, while stream:join / stream:leave react to WebSocket subscriber lifecycle.

Reach for them when:

  • A set/update/delete/send should drive a projection, audit log, or downstream notification.
  • Subscriptions need server-side authorization (stream:join) or paired setup/teardown (stream:join + stream:leave).

If you only need the current value on demand, call stream::get instead of binding a trigger.

How to bind

  1. Register a handler: iii.registerFunction('presence::on-change', handler).
  2. Register the trigger:
iii.registerTrigger({
  type: 'stream',
  function_id: 'presence::on-change',
  config: {
    stream_name: 'presence',  // required for `stream`; the worker indexes triggers by it.
    group_id: 'room-1',       // optional. Empty/omitted = match every group.
    item_id: 'user-123',      // optional. Empty/omitted = match every item.
    // condition_function_id is also supported.
  },
})

stream requires a non-empty stream_name; group_id / item_id use empty-as-wildcard, exact-match-otherwise semantics. stream:join and stream:leave take no config fields — branch inside the handler on the event. A stream:join handler returning { unauthorized: true } rejects the subscription; any other return allows it. Mutations that fire stream: stream::set, stream::update, stream::delete, stream::send. Reads do not.

For the event payload shape, call iii get function info on the trigger type or handler function id.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Manage shared iii configuration with JSON Schema, a definition of allowed value structures. Covers validated settings, automatic change notifications, YAML edits, temporary overrides, and default initialization that preserves existing values.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Sharing validated settings between workers
  • Reacting to manual YAML configuration edits
  • Initializing defaults while preserving existing values
iii-hq/iii1.9만2026년 10월 18일 업데이트

iii

무료

Helps extend an iii system by checking live functions, searching the public worker registry, and writing a worker when needed. Covers TypeScript SDK calls, event triggers, error handling, and worker operation through Compose.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Finding and calling functions already available in iii
  • Searching for and adding a published worker
  • Building a custom worker with the TypeScript SDK
iii-hq/iii1.9만2026년 10월 18일 업데이트

Design iii backends by combining functions, queues, and shared state. Choose patterns for workflows with retries, live updates, cooperating AI agents, and event-driven processing, with examples showing how the pieces connect.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Designing order workflows with retries and step tracking
  • Updating screens or caches when stored data changes
  • Passing tasks between specialized AI agents
iii-hq/iii1.9만2026년 10월 18일 업데이트

Guides development of iii functions, event triggers, and workers, the processes that execute functions. Helps choose result-returning calls, one-way calls, or queued work, inspect live registrations, and connect existing HTTP services.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Running a function on an HTTP request or schedule
  • Choosing between direct calls and queued work
  • Inspecting registered workers and functions
iii-hq/iii1.9만2026년 10월 18일 업데이트

Helps configure an iii engine for Compose management or direct supervision by tools such as systemd. Covers configuration file structure, ports, storage, and role-based access control through rbac-proxy, including requirements for public connections.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Configuring an engine managed by Compose
  • Configuring an engine supervised by systemd or Kubernetes
  • Setting authentication and access rules for public connections
iii-hq/iii1.9만2026년 10월 18일 업데이트

Diagnose iii invocation failures using error codes across Node, Python, Rust, and browser workers. Distinguish permission denials, timeouts, and handler failures, then choose appropriate exception handling and decide whether retrying is suitable.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Diagnosing failed function calls by error code
  • Deciding whether a timed-out operation should be retried
  • Handling permission denials without blind retries
iii-hq/iii1.9만2026년 10월 18일 업데이트

iii-hq의 스킬 모두 보기

이 스킬의 문제 신고