Agent Skillsiii-hq/iii › iii-bridge

iii-bridge

GitHub

iii-bridge用于在两个iii引擎间建立持久WebSocket连接,通过forward/expose配置或invoke函数实现跨边界函数调用。

engine/src/workers/bridge_client/skills/SKILL.md iii-hq/iii

Trigger Scenarios

多引擎间需要稳定长连接通信 远程函数ID动态或需探测连通性

Install

npx skills add iii-hq/iii --skill iii-bridge -g -y
More Options

Non-standard path

npx skills add https://github.com/iii-hq/iii/tree/main/engine/src/workers/bridge_client/skills -g -y

Use without installing

npx skills use iii-hq/iii@iii-bridge

指定 Agent (Claude Code)

npx skills add iii-hq/iii --skill iii-bridge -a claude-code -g -y

安装 repo 全部 skill

npx skills add iii-hq/iii --all -g -y

预览 repo 内 skill

npx skills add iii-hq/iii --list

SKILL.md

Frontmatter
{
    "name": "iii-bridge",
    "description": "Connect this engine to another iii engine over a long-lived WebSocket so functions call across the boundary. Wire stable ids with `forward:`\/`expose:`; `bridge.invoke` is the ad-hoc escape hatch."
}

iii-bridge

The iii-bridge worker connects this iii engine to another iii instance over iii-sdk so functions on either side can call across the boundary. It opens a single outbound WebSocket to the configured url, registers with the remote using service_id, and stays open for the engine's lifetime — bridging is request/response over that long-lived connection. There are no trigger types.

The worker is configuration-driven. The primary surface is two list-shaped config fields (forward: and expose:) that wire stable function ids on both sides; once configured, callers reach across the bridge by invoking those stable ids with the normal iii.trigger({ function_id, payload }) — no bridge-specific call shape. Two functions (bridge.invoke, bridge.invoke_async) are also registered as ad-hoc escape hatches for the rare case where the remote function id is dynamic at runtime.

When to Use

  • Two iii engines need to call each other's functions over a stable, long-lived connection.
  • You want a remote function to appear as a local id (forward:) so the bridge is invisible at the call site.
  • You want to expose specific local functions to a remote engine (expose:).
  • The remote function id is dynamic, or you are prototyping / probing connectivity — reach for the ad-hoc bridge.invoke functions.

Boundaries

  • Prefer forward: / expose: aliases over bridge.invoke; the escape hatches are for dynamic ids and one-offs, not the default path.
  • bridge.invoke_async is fire-and-forget — it ignores timeout_ms, returns no value, and a later remote rejection is logged but never surfaced to the caller.
  • Forward aliases and exposed ids are operator-wired per deployment in iii-config.yaml; they are not stable across deployments and are documented alongside the worker config, not here.
  • Failures return a FunctionResult::Failure with a stable code (deserialization_error or bridge_error); a successful async return only means the message was queued, not that the remote ran.

Functions

  • bridge.invoke — call a remote function_id and wait for its return value (returned directly, no envelope); honors an optional timeout_ms (default 30000).
  • bridge.invoke_async — hand a remote call to the WebSocket send queue and return immediately; timeout_ms is ignored and no remote response is surfaced.

Both take { function_id, data?, timeout_ms? }. Reach for them only when a forward: alias is wrong or impossible; for repeated calls to the same (local, remote) pair, configure a forward: alias and call the local id instead.

Configuration

  • url — WebSocket URL of the remote iii instance (default ${III_URL:ws://0.0.0.0:49134}).
  • service_id / service_name — identifier (and human-readable name) registered with the remote.
  • expose: [{ local_function, remote_function? }] — functions on this engine the remote may call; remote_function is the path the remote invokes (defaults to local_function). Registered with the remote at initialize time.
  • forward: [{ local_function, remote_function, timeout_ms? }] — local aliases that proxy outbound to a remote function. The worker registers local_function on this engine so any caller reaches the remote's remote_function; timeout_ms overrides the per-call deadline (default 30000).

Version History

  • c6f6fde Current 2026-08-20 17:17

Same Skill Collection

crates/iii-worker/src/sandbox_daemon/skills/SKILL.md
engine/src/workers/configuration/skills/SKILL.md
engine/src/workers/cron/skills/SKILL.md
engine/src/workers/engine_fn/skills/SKILL.md
engine/src/workers/observability/skills/SKILL.md
engine/src/workers/pubsub/skills/SKILL.md
engine/src/workers/queue/skills/SKILL.md
engine/src/workers/rest_api/skills/SKILL.md
engine/src/workers/shell/skills/SKILL.md
engine/src/workers/state/skills/SKILL.md
engine/src/workers/stream/skills/SKILL.md
engine/src/workers/worker/skills/SKILL.md
skills/iii-architecture-patterns/SKILL.md
skills/iii-core-primitives/SKILL.md
skills/iii-engine-config/SKILL.md
skills/iii-error-handling/SKILL.md
skills/iii-sdk-reference/SKILL.md
skills/presentation/SKILL.md
skills/iii-getting-started/SKILL.md

Metadata

Files
0
Version
c6f6fde
Hash
216e8450
Indexed
2026-08-20 17:17

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 06:28
浙ICP备14020137号-1 $Гость$