iii-engine-config
它能做什么
讲解如何配置 iii 引擎,可以通过托管的项目文件,也可以通过直接运行的配置文件。适合运行自有 iii 引擎、需要正确设置端口和选项的开发者。
适用场景
- ✓当你需要更改引擎的端口或监听地址时。
- ✓当你想为引擎设置访问规则或流设置时。
- ✓当你不确定应该使用托管模式还是直接配置模式时。
技能链接
https://github.com/iii-hq/iii/blob/main/skills/iii-engine-config/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我设置 iii 引擎,使用端口 49134,并配置一个配置存储,同时在端口 3112 上设置流监听器。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能会解释两种配置模式,并提醒不要混用。在托管模式下,引擎设置位于项目文件的一个部分中,而该部分更改之后必须重新启动 Compose。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Engine Config
iii has two engine configuration modes. Do not mix them.
Managed Compose engine
The presence of engine: means that Compose owns the engine process. Engine worker values are
direct mappings; there is no nested config: field.
namespace: orders
engine:
url: ws://127.0.0.1:49134
registration_namespace_grace_ms: 5000
workers:
configuration:
adapter:
name: fs
config:
directory: ./config
iii-worker-manager:
host: 127.0.0.1
port: 49134
iii-http-functions: {}
iii-stream:
host: 127.0.0.1
port: 3112
iii-sandbox:
auto_install: true
containers: {}
Start it with:
iii compose --namespace orders-daemon --up --file worker-compose.yaml
engine.url defaults to ws://127.0.0.1:49134 and uses Compose's ${VAR:-default} expansion.
engine.workers stays opaque until the engine reads the generated YAML, so its values use
${VAR:default} and retain numeric types. Compose materializes an owner-only config under
<project-dir>/.iii/compose/<daemon-namespace>/ and removes it after clean shutdown. With
III_COMPOSE_STATE_DIR, it uses <state-root>/<project-slug>/<daemon-namespace>/. Changing engine:
requires restarting Compose. Do not combine a managed file with explicit --engine.
Allowed engine worker base names are:
configurationiii-worker-manageriii-http-functionsiii-streamiii-sandbox
Use #instance for another instance of an allowed worker. iii-engine-functions,
iii-telemetry, and iii-observability are injected automatically and must not be declared.
HTTP, cron, queue, state, pubsub, bridge, application, and custom workers belong under
containers:. Add registry packages with:
iii trigger -n orders-daemon compose::add worker=state
Observers
Since 0.25 the engine reads an optional top-level observers: section (iii-observe explains the
model). Every key is optional; these are the defaults:
observers:
local_dispatch: true # let SDKs run a worker's own functions in-process
max_per_connection: 1024 # observers one connection may own (LIMIT_EXCEEDED)
max_per_function: 4096 # observers one function may have (LIMIT_EXCEEDED)
max_observe_depth: 8 # deeper activations are dropped (LOOP_GUARD)
observer_grace_ms: 30000 # suspended observers of a disconnected worker wait this long
disposed_retention_ms: 3600000 # a worker back after the grace period is told they were disposed
owner_ack_timeout_ms: 30000 # an unacknowledged add fails with OWNER_TIMEOUT
activation_timeout_ms: 30000 # an unanswered activation frees its slot and counts as TIMEOUT
default_max_in_flight: 64 # max_in_flight of an observer that sets none
max_queue_per_observer: 1024 # queued activations beyond max_in_flight (then OVERFLOW)
- In
config.yamlit sits next toworkers:. In a managed Compose file it goes underengine.observersand is passed through as written. - Unknown keys and zero counts or depth are rejected at load; zero timeouts only warn. Changes need an engine restart.
observers.local_dispatch: falseturns off in-process calls for every worker.- Inspect live observers with
engine::observers::list({ function_id?, namespace?, worker? })andengine::observers::get({ id })(results are filtered to functions the caller may invoke).engine::observers::dispose({ id })is allowed for the observing worker and unrestricted callers. - Metrics:
iii.observer.activations.total{function_id,delivery},iii.observer.dropped.total{function_id,reason},iii.observers{state},iii.observer.reports.total{function_id},iii.observer.activation.failures.total{function_id,reason}; locally dispatched calls are counted iniii.invocations.totalwithdispatch="local".
RBAC with rbac-proxy
Keep the engine port internal and put the rbac-proxy worker in front of it when
untrusted workers, browsers, or agents need to connect:
iii trigger -n orders-daemon compose::add worker=rbac-proxy
rbac-proxy opens its own WebSocket port, speaks the worker protocol verbatim, and at the boundary
authenticates each connection (rbac.auth_function_id), gates every invocation and trigger binding
(rbac.expose_functions, plus allowed_functions / forbidden_functions from the auth result),
namespaces a session's registrations (`function_registration_pref
常见问题
两种配置模式可以混用吗?
不可以。该技能会提醒不要混用,因为每种模式都以自己的方式管理引擎设置。
引擎的默认端口是多少?
引擎的默认端口是 49134。
更改之后需要重新启动吗?
需要。在托管模式下更改引擎部分之后,必须重新启动 Compose。
详情
作者的原始描述
Configure a managed iii engine through worker-compose.yaml or a directly supervised engine through config.yaml. Use for engine ports, RBAC via the rbac-proxy worker, observer limits, streams, sandboxes, and configuration storage.
repo: iii-hq/iii
热度
- GitHub 星标
- 19k
- 排名
- #10493
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
iii-sandbox
19k帮你的智能体在临时隔离的虚拟机中安全运行不可信或由 AI 生成的代码,完成后将其丢弃。
configuration
19k让你的智能体设置一个共享的命名配置值注册表,并按模式进行检查,使工作进程可以读取并响应变化。
iii
19k教你的智能体了解 iii 工作进程如何运作,使其可以先检查已有的功能,再构建新的工作进程来添加能力。
iii-observability
19k帮你的智能体使用 OpenTelemetry 为 iii 引擎添加追踪、结构化日志、指标和告警,让你看清系统正在发生什么。