本文へスキップ
Skillpedia
一般的なプログラミング19k · #10492

iii-core-primitives

できること

iiiの基本的な構成要素である関数、トリガー、ワーカーを説明し、それぞれの登録方法を示します。TypeScript、Python、Rustでiiiシステムのコードを書く開発者向けです。

使う場面

  • ✓新しい関数を登録し、それにトリガーを結び付けたいとき。
  • ✓ある関数が呼び出された後に、別の関数を実行させたいとき。
  • ✓現在接続されているワーカーと関数を確認したいとき。

スキルのリンク

https://github.com/iii-hq/iii/blob/main/skills/iii-core-primitives/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/iii-hq/iii/blob/main/skills/iii-core-primitives/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“orders::validateという関数をTypeScriptで登録し、新しい注文が届くたびに実行されるようにしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、ハンドラーを持つ関数を登録し、スケジュールやキューなどのイベント元に結び付ける方法を示します。また、別の関数が呼び出された後に実行されるオブザーバーや、関数の直接呼び出しとバックグラウンド実行についても説明します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Core Primitives

iii has three top-level primitives:

  • Function: a named unit of work such as orders::validate
  • Trigger: an event source bound to a function
  • Worker: a process that connects to the engine and executes functions

Since 0.25 every function is also observable: iii.observe(source, target) invokes target on each invocation of source that passes its filters. Observers replace trigger bindings over time; the built-in providers (http, cron, queue, state, stream, pub/sub, database) still use trigger types in 0.25, so keep registerTrigger for them. See iii-observe.

Use :: in function IDs, leading slashes in HTTP api_path, and expression for cron config.

Function Registration

Register local handlers when you control the implementation. Register HTTP-invoked functions when iii should call an existing external endpoint.

Shape Use for
registerFunction(id, handler, options?) Local worker code
registerFunction(id, HttpInvocationConfig, options?) Existing HTTP services
registerTrigger({ type, function_id, config, metadata? }) Binding a built-in event source (deprecated in 0.25, still required for providers that have not migrated)
observe({ function_id, args?, filters? }, target, options?) Running target after another function's invocations, or on an engine event (iii-observe)
trigger({ function_id, payload, action?, timeout? }) Calling any function by ID

Functions and triggers can carry metadata for ownership, discovery, and generated skills. Do not put secrets in metadata.

Workers and Registry

A worker is any process that connects to the engine and registers functions or trigger types. There are two common paths:

Task Use
Create your own worker Write SDK code that calls registerWorker, registerFunction, and registerTrigger or observe
Add an existing capability Browse https://workers.iii.dev/, then call compose::add worker=<name>
Pin a worker version compose::add worker=<name>@<version>
Declare a local worker Add worker: path://./workers/my-worker under containers:
Reproduce a project Commit the exact versions in worker-compose.yaml

The public worker registry at workers.iii.dev is for installable workers such as HTTP, state, queue, pub/sub, cron, database, shell, console, rbac-proxy, and other capability workers. (iii-sandbox and iii-observability are engine-owned and are not added through the registry.) Those workers may ship their own function-level skills; do not duplicate every capability as a top-level iii skill.

Worker Manifest

Use iii.worker.yaml when iii should start a local worker project:

name: math-worker
runtime:
  kind: python
  package_manager: pip
  entry: math_worker.py
scripts:
  install: "pip install -r requirements.txt"
  start: "python math_worker.py"

The manifest describes how to start the process. Once running, the WebSocket connection and function registrations are what make the worker part of iii.

Live Engine Registry

The engine keeps a live registry of connected workers, registered functions, triggers, and trigger types. Read it through the built-in discovery functions:

Function Returns
engine::workers::list Connected workers and metrics
engine::functions::list Registered functions
engine::triggers::list Registered triggers
engine::trigger-types::list Advertised trigger types and schemas
engine::observers::list Observers you may see (function_id, namespace, worker filters)

For topology changes, observe the engine-hosted sources engine::on-workers-changed or engine::on-functions-changed with deliver: 'input' (see iii-observe). The older engine::workers-available and engine::functions-available trigger types still fire.

Built-In Trigger Shapes

The workers behind these types have not moved to source functions in 0.25, so bind them with registerTrigger. Each call logs a one-time deprecation warning per process; it is informational and the binding works as before. For log, the engine also hosts the observability::on-log source (iii-observe).

Trigger type Registration config Handler payload
http { api_path: "/orders/:id", http_method: "POST" } { query_params, path_params, headers, path, method, body }
cron `{ expression: "0 0 9 * * *
よくある質問

オブザーバーとは何ですか?

別の関数が呼び出されるたびに、その関数を変更せずに対象の関数を実行する仕組みです。

関数IDはどの形式ですか?

orders::validateのように、コロン2つを使います。

レジストリからワーカーをインストールできますか?

はい。公開レジストリからワーカーをインストールする方法も扱います。

詳細

作者による元の説明

Use when registering iii functions, binding triggers, observing functions, selecting sync/void/enqueue invocation, creating workers, inspecting the live worker registry, installing registry workers, authoring event sources, moving channel data, or adapting external HTTP functions across TypeScript, Python, and Rust.

repo: iii-hq/iii

人気

GitHubのスター
19k
ランキング
#10492
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル