iii
它能做什么
解释 iii 运行时的工作方式,以及如何编写提供函数和触发器的工作进程。它适用于希望向 iii 系统添加能力、并从检查已有内容开始的开发者。
适用场景
- ✓当你想为 iii 系统添加一项新能力的时候。
- ✓当你想在编写代码之前知道某个函数是否已注册的时候。
- ✓当你需要一个通过引擎调用或提供函数的工作进程的时候。
技能链接
https://github.com/iii-hq/iii/blob/main/engine/src/workers/engine_fn/skills/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我的 iii 系统中添加一个把两个数相加的函数,并告诉我如何从另一个工作进程调用它。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能会先检查引擎中是否已经存在该能力,然后搜索公共注册表,最后才构建新的工作进程。工作进程连接到引擎并注册其函数,其他工作进程通过引擎调用这些函数。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
iii
iii is a language-agnostic runtime where services, agents, and tools are composed of the same things: workers, triggers, and functions. One engine process (default port 49134) holds a live registry of every connected worker, every function those workers expose, and every trigger bound to them. Workers are independent OS processes that open a WebSocket to the engine and register Functions (service::name handlers) and Triggers (the events that invoke those Functions). There is no direct worker-to-worker traffic — every call routes through the engine, which makes the language, runtime, and physical location of any worker invisible to its callers.
When to Use
Use this skill to discover live iii capabilities, call functions, author SDK workers, bind trigger types, or operate project workers through Compose.
You extend yourself by writing iii workers. A few lines get you on the bus:
import { registerWorker } from 'iii-sdk'
const iii = registerWorker(process.env.III_ENGINE_URL!, { workerName: 'demo' })
iii.registerFunction('demo::add', async (payload: { a: number; b: number }) => {
return { c: payload.a + payload.b }
})
The instant the handshake completes, demo::add is callable from any worker (and the harness itself) via iii.trigger({ function_id: 'demo::add', payload: { a: 2, b: 3 } }). No restart, no registration with the harness — the engine routes it automatically.
The four primitives
| Primitive | What it is | Owned by |
|---|---|---|
| Engine | One coordinator process. Routes every invocation. | The operator |
| Worker | A process that opens a WebSocket to the engine. | Anyone who writes one |
| Function | A named handler inside a worker, id service::name. Stable across worker restarts. |
The registering worker |
| Trigger | A (type, config, function_id) triple. Causes a function to run when an event fires. |
A worker (the type-publisher) + a caller (the binding) |
Three consequences worth internalising:
- No worker-to-worker traffic. Every call is
worker → engine → worker. Workers never address each other directly. Location and language are invisible. - No restart coordination. Restarting a worker is invisible to callers as long as it re-registers the same function ids. Two workers registering the same function id = automatic load-balance.
- No polling unless you opt in. Triggers are the engine's push channel. The engine fans events out to bound functions when the underlying source fires.
The function id is the only contract between any two workers.
graph TD
Harness["harness (LLM worker)"] <-->|"WS"| Engine["iii engine :49134 (registry + router)"]
Engine <-->|"WS"| WorkerA["your authored worker my::fn"]
Engine <-->|"WS"| WorkerB["installed registry worker"]
Engine <-->|"WS"| Provider["trigger-type provider"]
External["external event (request, timer, queue, ...)"] -->|"native protocol"| Provider
Every edge to the engine is a WebSocket. A trigger-type provider terminates some native protocol — an inbound request, a timer, a queue message — and translates it into engine traffic.
Need a capability? Discover before you build — in this order
The most common harness mistake is reimplementing something that already exists, or hardwiring one worker out of habit. Work the steps in order; stop at the first that satisfies the need.
1. Look at what is already registered in the engine. The capability may be one call away.
// engine::functions::list — every function on this engine, across all workers.
// Filter with { prefix: 'svc::' } or { search: 'resize' }.
// engine::workers::list — every connected worker.
If a registered function fits, just call it: iii.trigger({ function_id, payload }).
2. Search the public registry. If nothing registered fits, look for a worker to install. This goes through the iii-directory worker:
// directory::registry::workers::list { search: 'image resize' }
// → published workers matching the query.
// directory::registry::workers::info { name: '<worker>' }
// → that worker's README, config keys, API reference, and skills.
When one fits, add it through the project's Compose daemon:
iii trigger -n <compose-namespace> compose::add worker=<worker>
iii-directory is itself a registry worker, so confirm it is connected before calling directory::*:
// engine::functions::list { prefix: 'directory::' }
// → empty? ad
常见问题
工作进程之间会直接调用彼此吗?
不会。每次调用都经过引擎,因此工作进程的语言和位置对调用方是隐藏的。
新函数需要重启吗?
不需要。新函数在其工作进程连接后即可被调用。
引擎默认使用哪个端口?
引擎通常监听 49134 端口。
详情
作者的原始描述
How iii works and the iii-sdk surface for authoring workers, triggers, and functions. Teaches the ordered way to gain a capability before writing code — (1) check functions already registered in the engine, (2) search the public registry via iii-directory, (3) build a worker. Single self-contained skill — meant for system-prompt injection; do not re-fetch.
repo: iii-hq/iii
热度
- GitHub 星标
- 19k
- 排名
- #10487
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
iii-sandbox
19k帮你的智能体在临时隔离的虚拟机中安全运行不可信或由 AI 生成的代码,完成后将其丢弃。
configuration
19k让你的智能体设置一个共享的命名配置值注册表,并按模式进行检查,使工作进程可以读取并响应变化。
iii-observability
19k帮你的智能体使用 OpenTelemetry 为 iii 引擎添加追踪、结构化日志、指标和告警,让你看清系统正在发生什么。
iii-stream
19k说明用于实时数据流的 iii-stream 工作进程。它已被弃用,并将在即将发布的版本中移除,因此请规划迁移。