Iii Core Primitives
Use when registering iii functions, binding triggers, observing functions, selecting...
Install
npx skills add iii-hq/iii --skill iii-core-primitives -g -a claude-code -y- Repository
- iii-hq/iii18.9k
- Category
- Engineering
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 2,919 tokens
- Runs scripts
- No, instructions only
What it does
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.
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:
