All authors

Claude Skills by iii-hq
github.com/iii-hq621 skills10 installs1,735 views
- Linkly`iii-stream` is for **real-time data transmission**: pushing data to a client the moment it changes, like a live feed of clicks for a dashboard. A stream is bidirectional (subscribers can send messages back as well as receive them), but here you only need to broadcast clicks outward. You'll move the live-broadcast concern into its own `click-streamer` worker so the `link` worker stays focused on links.Votes: 0GitHub stars: 18,978
- Understanding Iii<!-- generated by iii-skill-render. DO NOT EDIT (changes here are overwritten on the next render). Edit docs/next/understanding-iii/compose.mdx. -->Votes: 0GitHub stars: 18,978
- Using Iiiapi_key: ${ANTHROPIC_API_KEY} ``` </Warning>Votes: 0GitHub stars: 18,978
- Using Iiiengine: workers: configuration: {} containers: state: worker: package://api.workers.iii.dev/state version: "0.22.2" config_name: state api: worker: path://./workers/api start_after: [state] scripts: run: pnpm start ``` Registry packages require an explicit version. `path://` workers use `scripts.run` from the Compose file or `scripts.start` from their `iii.worker.yaml` manifest. Start a project and keep its daemon in the foreground: ```bash iii compose build --file worker-compose.yaml iii com...Votes: 0GitHub stars: 18,978
- LinklyThis path builds Linkly with an AI agent. You give the agent one prompt per chapter; it writes the workers, and you check the result. The goal here is to build a working link shortener service while demonstrating iii's efficiency when building systems agentically, along with its 4 core properties which we call CODE: - Composability - Observability - Discoverability - Extensibility We'll present them a bit out of order but hopefully this mnemonic helps you remember what iii is all about.Votes: 0GitHub stars: 18,978
- Creating Workersiii --config config.yaml iii compose --namespace dev --engine ws://127.0.0.1:49134 ``` `iii compose` is an intentional verbless daemon invocation, documented in the [CLI reference](../cli-reference/index#iii-compose). The `-n` used below is the short form of `--namespace` for [`iii trigger`](../cli-reference/index#iii-trigger). Run the remaining commands from a third terminal in that same project directory: ```bash iii trigger -n dev compose::add worker=queue ``` <Note> This page covers commo...Votes: 0GitHub stars: 18,978
- Creating Workersworker.unregister_trigger_type( {"id": "mini-http", "description": "Routes HTTP requests to bound functions"} ) ``` </Tab> <Tab title="Rust"> ```rust // e.g. config reload disabled the HTTP listener; stop accepting new bindings // while the worker keeps serving other trigger types. worker.unregister_trigger_type("mini-http"); ``` </Tab> </Tabs> {/* TODO: Update once this inconsistency is fixed */} <Note> Node's `registerTriggerType` also returns a `TriggerTypeRef` with an `.unregister()` shor...Votes: 0GitHub stars: 18,978
- Creating Workersworkers = worker.trigger({ "function_id": "engine::workers::list", "payload": {}, })["workers"] functions = worker.trigger({ "function_id": "engine::functions::list", "payload": {"include_internal": False}, })["functions"] triggers = worker.trigger({ "function_id": "engine::triggers::list", "payload": {"include_internal": False}, })["triggers"] registered_triggers = worker.trigger({ "function_id": "engine::registered-triggers::list", "payload": {"include_internal": False}, })["registered_trig...Votes: 0GitHub stars: 18,978
- Reference{/* AUTO-GENERATED FILE. Do not edit. Regenerate with docs/next/scripts/generate-api-docs.mts. */} {/* AI: any skill-check (vale/AI) text fixes belong in the source doc-comments under sdk/packages/node/helpers/src (prose) or docs/next/scripts/ (structure/formatting), then regenerate. Never edit this file directly. */}Votes: 0GitHub stars: 18,978
- Reference{/* AUTO-GENERATED FILE. Do not edit. Regenerate with docs/next/scripts/generate-api-docs.mts. */} {/* AI: any skill-check (vale/AI) text fixes belong in the source doc-comments under sdk/packages/python/helpers/src (prose) or docs/next/scripts/ (structure/formatting), then regenerate. Never edit this file directly. */}Votes: 0GitHub stars: 18,978
- Using Iii{/* TODO: Re-link worker references to https://workers.iii.dev/workers/<name> once the Worker Docs migration ships. */} <Note> The console is the visual UI for iii systems. It lists workers, functions, and triggers, and shows traces, logs, and metrics from the iii-observability worker. For scripting or agent integration, call worker functions directly. </Note>Votes: 0GitHub stars: 18,978
- Using Iii}) ``` </Tab> <Tab title="Rust"> ```rust use iii_sdk::TriggerAction; use iii_sdk::protocol::TriggerRequest; use serde_json::json; let result = worker .trigger(TriggerRequest { function_id: "math::add".into(), payload: json!({ "a": 2, "b": 3 }), action: None, // action: Some(TriggerAction::Void), // fire-and-forget // action: Some(TriggerAction::Enqueue { queue: "math".to_string() }), // route through queue timeout_ms: None, } .namespace("default"), // target a...Votes: 0GitHub stars: 18,978
- Using IiiEvery worker has an effective namespace. A worker uses `default` when you do not set one. Use a non-default namespace when multiple tenants or projects must use the same worker name or function id on one engine.Votes: 0GitHub stars: 18,978
- Using Iiiworker.register_trigger({ "type": "http", "function_id": "math::add", "config": {"api_path": "/math/add", "http_method": "POST"}, }) ``` </Tab> <Tab title="Rust"> ```rust use iii_sdk::protocol::RegisterTriggerInput; use serde_json::json; // http worker not started worker.register_trigger(RegisterTriggerInput { trigger_type: "http".into(), function_id: "math::add".into(), config: json!({ "api_path": "/math/add", "http_method": "POST" }), metadata: None, })?; ``` </Tab> </Tabs> Start the http w...Votes: 0GitHub stars: 18,978
- Cli Reference{/* AUTO-GENERATED FILE, DO NOT EDIT. Generated from the clap CLI definitions by the hidden `gen-cli-docs` subcommand. Regenerate with `scripts/generate-cli-docs.sh`. */} Reference for the `iii` binary and the `iii console` runtime it dispatches to. Running `iii` with no subcommand starts the engine. The same information is available from the binaries themselves via `iii --help` and `iii <subcommand> --help`. For a guided overview, see [CLI](../using-iii/cli).Votes: 0GitHub stars: 18,978
- Creating Workers``` </Tab> <Tab title="Rust"> ```rust let channel = worker.create_channel(None).await?; // channel.writer // channel.reader // channel.writer_ref // channel.reader_ref ``` </Tab> </Tabs> Write the payload to the local `writer` and close it when finished. The bytes flow through the engine to whichever worker holds the matching `reader`. <Tabs> <Tab title="Node / TypeScript"> ```typescript const channel = await worker.createChannel(); channel.writer.stream.end(Buffer.from("file contents")); ```...Votes: 0GitHub stars: 18,978
- Reference{/* TODO: Re-link worker references to https://workers.iii.dev/workers/<name> once the Worker Docs migration ships. */} <Note> This page documents the wire-level protocol the engine and SDK workers exchange. Most projects use a language SDK ([Node](./sdk-node), [Python](./sdk-python), [Rust](./sdk-rust), [Browser](./sdk-browser)) and never touch the protocol directly. The shapes below are the source of truth those SDKs serialize to. </Note> <Note> Observability introspection (traces, logs, me...Votes: 0GitHub stars: 18,978
- Reference{/* AUTO-GENERATED FILE. Do not edit. Regenerate with docs/next/scripts/generate-api-docs.mts. */} {/* AI: any skill-check (vale/AI) text fixes belong in the source doc-comments under sdk/packages/node/iii/src (prose) or docs/next/scripts/ (structure/formatting), then regenerate. Never edit this file directly. */}Votes: 0GitHub stars: 18,978
- Referenceworker.shutdown() ``` --- Gracefully shut down the client, releasing all resources. Cancels any pending reconnection attempts, rejects all in-flight invocations with an error, closes the WebSocket connection, and stops the background event-loop thread. After this call the instance must not be reused. **Signature** ```python async () -> None ``` ```python worker = register_worker('ws://localhost:49134') await worker.shutdown_async() ``` --- Invoke a remote function. The routing behavior and r...Votes: 0GitHub stars: 18,978
- Reference{/* AUTO-GENERATED FILE. Do not edit. Regenerate with docs/next/scripts/generate-api-docs.mts. */} {/* AI: any skill-check (vale/AI) text fixes belong in the source doc-comments under sdk/packages/rust/iii/src (prose) or docs/next/scripts/ (structure/formatting), then regenerate. Never edit this file directly. */}Votes: 0GitHub stars: 18,978
- LinklyThis path builds Linkly with an AI agent. You give the agent one prompt per chapter; it writes the workers, and you check the result. The goal here is to build a working link shortener service while demonstrating iii's efficiency when building systems agentically, along with its 4 core properties which we call CODE: - Composability - Observability - Discoverability - Extensibility We'll present them a bit out of order but hopefully this mnemonic helps you remember what iii is all about.Votes: 0GitHub stars: 18,978
- LinklyWhere a stream is for a live trickle of events, a **channel** is for **moving a large amount of data at once**: a direct streaming pipe between two endpoints, rather than one request and response. Channels are bidirectional (each end has both a reader and a writer), but here you'll stream in one direction, uploading a CSV of links. You'll give this its own `bulk-importer` worker so the `link` worker stays focused on single links.Votes: 0GitHub stars: 18,978
- Linklybase_image: docker.io/iiidev/python:latest scripts: install: python3 -m venv .venv && .venv/bin/pip install -r requirements.txt start: .venv/bin/python src/main.py ``` Create `analytics/src/main.py` with this code, which subscribes to `link.created` events and keeps count of every time that a new short link is created: <Accordion title="analytics/src/main.py"> ```python analytics/src/main.py import os import time from datetime import datetime, timezone from iii import register_worker, InitOpt...Votes: 0GitHub stars: 18,978
- Linklybase_image: docker.io/iiidev/node:latest scripts: install: "npm install" start: "npm run start" ``` <Info> Compose runs the worker from `scripts.start`, but a worker can also be an ordinary service. Any process that uses a iii SDK and calls `registerWorker()` is a worker. <p> Learn more about the [`iii.worker.yaml` manifest](/creating-workers/workers#worker-manifest). </p> </Info> `link/package.json` declares the dependencies. Its `start` script uses `tsx watch`, which runs the TypeScript sou...Votes: 0GitHub stars: 18,978
- LinklyIn this chapter the browser becomes a worker. It connects to the engine over WebSocket, calls `link::create` directly (no REST API Gateway), subscribes to the live click stream to update a counter, and registers a `user::confirm_destructive_op` function the server calls when a delete needs a human's go-ahead.Votes: 0GitHub stars: 18,978
- LinklyEvery cross-worker call flows through the engine, so the engine traces and logs the whole system end to end. In this chapter you open the console to see that, then, if you want, read the same data directly from the engine.Votes: 0GitHub stars: 18,978
- LinklyThis tutorial builds **Linkly**, a link shortener, one worker at a time. You start with a single function that turns `/s/abc` into a redirect, and finish with a multi-tenant link platform that has durable execution, storage, analytics, a live click stream, bulk imports, and permission gated untrusted browser workers that have all the same functionality and observability as the base system. Each chapter adds one capability by adding a worker to your existing system. The point is not the link s...Votes: 0GitHub stars: 18,978
- LinklyLinkly's links live in `state`, which you set to in-memory back in Chapter 1. Restart the engine and everything is gone. In this chapter you add a `database` worker (SQLite) that holds the durable record of links and a timestamped row for every click on a short code. `state` stays in the picture as a fast read cache in front of the database. <Info> `state` can also persist on its own (`store_method: file_based` with a `file_path`). This chapter uses a dedicated `database` worker instead, whic...Votes: 0GitHub stars: 18,978
- Linkly`iii-stream` is for **real-time data transmission**: pushing data to a client the moment it changes, like a live feed of clicks for a dashboard. A stream is bidirectional (subscribers can send messages back as well as receive them), but here you only need to broadcast clicks outward. You'll move the live-broadcast concern into its own `click-streamer` worker so the `link` worker stays focused on links.Votes: 0GitHub stars: 18,978
- Using Iiiapi_key: ${ANTHROPIC_API_KEY} ``` </Warning>Votes: 0GitHub stars: 18,978
- Using Iii<!-- generated by iii-skill-render. DO NOT EDIT (changes here are overwritten on the next render). Edit docs/next/using-iii/configuration.mdx. -->Votes: 0GitHub stars: 18,978
- Using Iiiengine: workers: configuration: {} containers: state: worker: package://api.workers.iii.dev/state version: "0.22.2" config_name: state api: worker: path://./workers/api start_after: [state] scripts: run: pnpm start ``` Registry packages require an explicit version. `path://` workers use `scripts.run` from the Compose file or `scripts.start` from their `iii.worker.yaml` manifest. Start a project and keep its daemon in the foreground: ```bash iii compose build --file worker-compose.yaml iii com...Votes: 0GitHub stars: 18,978
- Creating Workerslistener: psycopg.Connection | None = None observed = 0 @worker.on_observer_added def open_listener(obs): global listener, observed observed += 1 if observed > 1: return listener = psycopg.connect(os.environ["PRIMARY_DATABASE_URL"], autocommit=True) listener.execute("LISTEN iii_row_changed") @worker.on_observer_removed def close_listener(obs): global listener, observed observed -= 1 if observed > 0: return listener.close() listener = None ``` </Tab> <Tab title="Rust"> ```rust use std::sync::a...Votes: 0GitHub stars: 18,978
- ReferenceA filter is the `filters` object of an observer's source. It decides whether one call of the observed function reaches one observer's target. The language is declarative JSON (`iii-filter` v1): small, total, without side effects or regular expressions, so the same filter gives the same answer wherever it runs: - in the engine, for every call it routes: it holds the call's input, caller, and metadata, and takes its output or error from the answer of the worker that ran it. Engine-hosted functi...Votes: 0GitHub stars: 18,978
- Reference{/* AUTO-GENERATED FILE. Do not edit. Regenerate with docs/next/scripts/generate-api-docs.mts. */} {/* AI: any skill-check (vale/AI) text fixes belong in the source doc-comments under sdk/packages/go/iii (prose) or docs/next/scripts/ (structure/formatting), then regenerate. Never edit this file directly. */}Votes: 0GitHub stars: 18,978
- Reference{/* AUTO-GENERATED FILE. Do not edit. Regenerate with docs/next/scripts/generate-api-docs.mts. */} {/* AI: any skill-check (vale/AI) text fixes belong in the source doc-comments under sdk/packages/go/iii (prose) or docs/next/scripts/ (structure/formatting), then regenerate. Never edit this file directly. */}Votes: 0GitHub stars: 18,978
- Upgrading0.25 makes every function observable with `worker.observe(source, target, options?)`, and runs the calls a worker makes to its own functions in-process. The trigger APIs keep working in 0.25, so most projects upgrade without code changes. This page lists the behavior changes 0.25 brings to existing workers. <Note> 0.26 removes triggers and trigger types. To move them to observers and observable functions with 0.26 SDKs, see [Upgrading from 0.25.x to 0.26.x](./from-0-25-x). To move them while ...Votes: 0GitHub stars: 18,978
- Upgrading<Warning title="Deprecated"> `iii-stream` is deprecated (iii-stream) and will be removed in an upcoming release. `pubsub` is deprecated (pubsub) and will be removed in an upcoming release. Behavior is unchanged for now. This page is the migration guide. </Warning> Use this page to move each `iii-stream` and `pubsub` use case to primitives every SDK ships: observable functions your workers host, explicit storage with queries, streams, and the durable queue. The sections below also list why bot...Votes: 0GitHub stars: 18,978
- Using Iiidef new_order(event: dict) -> None: order = event.get("input", {}) logger.info(f"order {order.get('id')} totals {order.get('total')}") worker.register_function("alerts::new-order", new_order) new_orders = worker.observe("orders::create", "alerts::new-order") new_orders.ready() # blocks until active; use `await new_orders.ready_async()` in asyncio code ``` </Tab> <Tab title="Rust"> ```rust use iii_helpers::observability::Logger; use iii_sdk::{Error, InitOptions, Observed, RegisterFunction, re...Votes: 0GitHub stars: 18,978
- Iii ObserveUse when one iii function should run when another runs (iii.observe), when binding functions to HTTP routes, cron schedules, queue topics, state or database changes, or engine events through their source functions (http::on-request, cron::on-tick, queue::on-message, state::on-changed, database::on-row-changed), when writing filters, or when writing an event source with onObserverAdded, onObserverRemoved, onObservationMatch, and onObservationDeliver across TypeScript, browser, Python, Rust, an...Votes: 0GitHub stars: 18,978
- Cli Reference{/* AUTO-GENERATED FILE, DO NOT EDIT. Generated from the clap CLI definitions by the hidden `gen-cli-docs` subcommand. Regenerate with `scripts/generate-cli-docs.sh`. */} Reference for the `iii` binary. Running `iii` with no subcommand starts the engine. The same information is available from the binary itself via `iii --help` and `iii <subcommand> --help`. For a guided overview, see [CLI](../using-iii/cli).Votes: 0GitHub stars: 18,978
- Creating Workersiii --config config.yaml iii compose --namespace dev --engine ws://127.0.0.1:49134 ``` `iii compose` without a subcommand starts the Compose daemon. `--namespace` selects its namespace, and `--engine` connects it to the existing engine. These options are listed in the generated [CLI reference](../cli-reference/index#iii-compose). Run the remaining commands from a third terminal in that same project directory: ```bash iii trigger -n dev compose::add worker=http ``` <Note> This page covers the ...Votes: 0GitHub stars: 18,978
- Creating Workerslogger.debug("cache lookup", {"key": key}) logger.info("processing link", {"slug": slug}) logger.warn("retrying upstream", {"attempt": attempt}) logger.error("failed to persist", {"slug": slug, "err": str(err)}) ``` </Tab> <Tab title="Rust"> ```rust use iii_helpers::observability::Logger; use serde_json::json; let logger = Logger::new(); // each level takes a message and optional structured data logger.debug("cache lookup", Some(json!({ "key": key }))); logger.info("processing link", Some(jso...Votes: 0GitHub stars: 18,978
- Creating Workersstop = threading.Event() threading.Thread(target=run_timer, args=(every_ms, stop), daemon=True).start() timer = timers[every_ms] = {"observers": {}, "stop": stop} timer["observers"][obs.id] = obs def on_observer_removed(self, obs): every_ms = obs.args["every_ms"] with lock: timer = timers.get(every_ms) if timer is None: return timer["observers"].pop(obs.id, None) if not timer["observers"]: timer["stop"].set() del timers[every_ms] def on_tick(tick: dict) -> None: with lock: timer = timers.get(...Votes: 0GitHub stars: 18,978
- Creating Workersiii --config config.yaml iii compose --namespace dev --engine ws://127.0.0.1:49134 ``` `iii compose` is an intentional verbless daemon invocation, documented in the [CLI reference](../cli-reference/index#iii-compose). The `-n` used below is the short form of `--namespace` for [`iii trigger`](../cli-reference/index#iii-trigger). Run the remaining commands from a third terminal in that same project directory: ```bash iii trigger -n dev compose::add worker=queue ``` <Note> This page covers commo...Votes: 0GitHub stars: 18,978
- Creating Workers- name: iii-worker-manager config: port: 49134 - name: iii-worker-manager config: host: 127.0.0.1 port: 3110 rbac: auth_function_id: auth::browser expose_functions: - match: "link::create" namespace: browser - match: "stream::*" namespace: browser ``` <Warning title="Deprecated"> The `stream::*` rule above exposes deprecated functions. `stream::*` is deprecated (iii-stream) and will be removed in an upcoming release. Behavior is unchanged for now. Expose your own domain functions instead; see...Votes: 0GitHub stars: 18,978
- Creating Workersworkers = worker.trigger({ "function_id": "engine::workers::list", "payload": {}, })["workers"] functions = worker.trigger({ "function_id": "engine::functions::list", "payload": {"include_internal": False}, })["functions"] triggers = worker.trigger({ "function_id": "engine::triggers::list", "payload": {"include_internal": False}, })["triggers"] registered_triggers = worker.trigger({ "function_id": "engine::registered-triggers::list", "payload": {"include_internal": False}, })["registered_trig...Votes: 0GitHub stars: 18,978
- Reference{/* TODO: Re-link worker references to https://workers.iii.dev/workers/<name> once the Worker Docs migration ships. */} <Note> This page documents the wire-level protocol the engine and SDK workers exchange. Most projects use a language SDK ([Node](./sdk-node), [Python](./sdk-python), [Rust](./sdk-rust), [Browser](./sdk-browser)) and never touch the protocol directly. The shapes below are the source of truth those SDKs serialize to. </Note> <Note> Observability introspection (traces, logs, me...Votes: 0GitHub stars: 18,978
- ReferenceA filter is the `filters` object of an observer's source. It decides whether one event reaches one observer's target. The language is declarative JSON (`iii-filter` v1): small, total, without side effects or regular expressions, so the same filter gives the same answer wherever it runs: - in the engine, for routed invocations of auto-delivered functions; - in the SDK that hosts the function, for its local invocations; - in the owner's SDK, for owner-delivered functions, inside `obs.emit`, `ob...Votes: 0GitHub stars: 18,978
- Reference{/* AUTO-GENERATED FILE. Do not edit. Regenerate with docs/next/scripts/generate-api-docs.mts. */} {/* AI: any skill-check (vale/AI) text fixes belong in the source doc-comments under sdk/packages/node/helpers/src (prose) or docs/next/scripts/ (structure/formatting), then regenerate. Never edit this file directly. */}Votes: 0GitHub stars: 18,978