directory::__on_worker_added
Internal: auto-download skills on worker add event.
- workerstring
- okbooleanrequired
Engine introspection, workers registry proxy, filesystem-backed skills, system prompts, and agent profiles, plus lexical function search with a conditional pre-generate hint.
exact versions are immutable; binary and bundle artifacts are digest-pinned.
Internal: auto-download skills on worker add event.
Create a new agent profile at <agents_folder>/<id>.md from full-file markdown (frontmatter with a non-empty `name`, emoji-only `logo`; the body is the system prompt and may be empty). Rejects ids or paths that already exist; a bundled id is shadowed.
Full file content, frontmatter included; `name` is required, the body is the system prompt and may be empty.
New profile id, used as the file stem; lowercase ASCII, digits, `-` and `_` only, and not already taken.
Bytes written.
File mtime after the write, RFC 3339.
Display name parsed from the (new) frontmatter.
Delete one existing agent profile's markdown file by id. Deleting the local shadow of a bundled profile falls back to the bundled copy; profiles that extend it stop resolving until fixed.
Existing agent profile id, as returned by `directory::agents::list`.
Fetch one agent profile by id: the system prompt resolved through its `extends` chain, display fields, skill filter, model, reasoning_effort, and `inheritance_error` when the chain does not resolve. Pass raw: true for the exact on-disk file to edit with directory::agents::update.
When true, also return the exact on-disk file (frontmatter included) as `raw`, ready for directory::agents::update.
Bundled with the worker, no file behind it (see `list`).
Harness subagent color token (closed set, validated at write time); `null` = neutral.
Parent profile id (`extends:`), as declared; `null` = none.
Harness subagent icon token (closed set, validated at write time); `null` = caller picks.
Set when the `extends` chain does not resolve (unknown parent, loop, deeper than 8): `system_prompt` and the inherited fields then come from this file alone, `raw` still round-trips so the chain can be fixed, and the harness refuses to run the profile meanwhile.
Model id for sessions using this profile, resolved through `extends`; `null` = the send decides. Served verbatim — resolution against the live model catalog happens where it is used.
File mtime as RFC 3339; empty for a bundled profile.
FULL on-disk file content (this profile's own file, ancestors excluded). Present only when the request set `raw: true`.
Provider-native reasoning effort paired with `model`, resolved through `extends`; `null` = the model/provider default. Served verbatim and validated at use time.
The skill filter, resolved through `extends` (the nearest profile with a non-empty filter). Empty = every skill.
The RESOLVED identity: every ancestor's body root-first, then this file's body, frontmatter stripped, joined by a blank line; blank bodies are skipped, so a profile with no prompt of its own serves its parent chain unchanged and a prompt-less profile without `extends` serves `""`. A profile that has a body and no `extends` serves that body verbatim.
Filter entries that resolve to no currently visible skill. Warnings — the agent profile still loads.
List agent profiles (id, name, description, logo, icon, color, model, reasoning_effort, skill_count, extends, modified_at) from the agents folder plus the bundled ones (`builtin: true`). Inherited fields resolve through `extends`; skill_count null means every skill.
Bundled with the worker, no file behind it: editing it creates the local file (which then shadows this entry); there is nothing to delete.
Harness subagent color token for display identities; `null` = neutral.
Parent profile id (`extends:`), as declared; `null` = none.
Harness subagent icon token for spawn display identities; `null` = caller picks.
Flat agent profile id (the file stem) — what `harness::send { options: { agent } }` will take.
Set when the `extends` chain does not resolve (unknown parent, loop, too deep): the row carries the profile's own fields only, and the harness refuses to run it until the chain is fixed.
Emoji logo, `null` when the agent profile has none.
Model id for sessions using this profile, resolved through `extends`; `null` = the send decides.
File mtime as RFC 3339; empty for a bundled profile.
Display name from frontmatter (`name:`).
Provider-native reasoning effort paired with `model`, resolved through `extends`; `null` = the model/provider default.
Length of the agent profile's skill filter, resolved through `extends`; `null` = no filter (every skill).
Overwrite one existing agent profile with full-file markdown (frontmatter with a non-empty `name`, emoji-only `logo`; the body is the system prompt and may be empty). Updating a bundled profile creates a local file that shadows it.
FULL new file content, frontmatter block included — the string `directory::agents::get { raw: true }` returns, edited.
Existing agent profile id, as returned by `directory::agents::list`.
Bytes written.
File mtime after the write, RFC 3339.
Display name parsed from the (new) frontmatter.
Full detail for one engine function: schemas, owning worker, and registered triggers that target it. Proxies to the engine's native engine::functions::info for the core data.
Fully-qualified function id on the bus (e.g. `sandbox::create`).
Internal: the exact search-hint text per exposure mode, for the configuration UI.
Internal: reload tunable iii-directory settings from the authoritative configuration when it changes.
Internal: refresh the search catalog after the engine function set changes.
Internal: inject the conditional search hint into one harness generation.
How the harness exposes functions to the model for this generation. Absent on harnesses that predate the field, which only ever exposed through agent_trigger by default.
The durable transcript row for one hook pass. Coarse by design: outcome, reason, and counts only — no prompts, messages, tool contracts, session ids, or timings ever leave the hook.
Ephemeral tail messages for this generation only. The hint rides here rather than as a system-prompt mutation: the system prompt is the provider's first input item, and a once-per-turn append there invalidated the entire prompt-cache prefix twice per turn.
Preview one registry worker before installing: envelope (version, kind, dependencies, config), its public function and trigger names with descriptions, and skill file paths. Schemas are omitted — install, then read contracts with engine::functions::info. Pass `readme: true` for the README prose; `version` or `tag` (default tag "latest").
Worker name in the registry (e.g. `"resend"`).
Include the README markdown (10–25 KB for most workers). Off by default: the card is for judging fit before `compose::add`; the README is for setup prose and examples.
Mutually exclusive with `tag`. If neither is provided we fall back to `tag: "latest"`.
Same shape as `directory::registry::workers::list` rows (and the engine's `engine::workers::list` rows for the shared core fields).
Profile picture URL. `null` when the author hasn't uploaded one.
Free-form runtime configuration block from the publish payload.
Container image tag, populated only for `type=image` workers.
Worker kind — `binary`, `image`, or `engine`.
Latest published version (worker-list) or the resolved version (worker-info, when called with `version` / `tag`).
List workers from the public registry, optionally filtered by fuzzy `search` (default order: downloads). Cursor-paginated: pass back `pagination.next_cursor` as `cursor`.
Cursor from a previous call's `pagination.next_cursor`; omit for the first page.
Optional free-text query, fuzzy-matched by the registry; omitted means ordered by downloads.
Pagination envelope returned alongside a worker-list page. Mirrors the OpenAPI `Pagination` schema.
Opaque cursor for the next page. `null` on the last page.
Server-authored page size. The client cannot override this.
Profile picture URL. `null` when the author hasn't uploaded one.
Free-form runtime configuration block from the publish payload.
Container image tag, populated only for `type=image` workers.
Worker kind — `binary`, `image`, or `engine`.
Latest published version (worker-list) or the resolved version (worker-info, when called with `version` / `tag`).
Search available functions for one to six external capabilities; returns compact function-id candidates grouped by worker.
One to six non-empty capability searches derived from the goal and current execution state. For one search at each decision point, include all unmet external capabilities once. Exclude intrinsic reasoning, summarization, planning, or formatting, and do not repeat needs already represented or satisfied. Requests to summarize provided text or content are ignored. Write every entry in English, translating non-English user requests while preserving proper names, URLs, and function IDs.
Matching workers from the private registry. Their functions are NOT callable until the worker is installed.
Compact candidates only. After installation, search again and fetch selected contracts through `engine::functions::info`.
First description sentence, capped at 160 bytes.
The `compose::add` target and payload; agent-trigger callers add `description`.
First description sentence, capped at 160 bytes.
Create a new skill at <skills_folder>/<id>.md from full-file markdown (frontmatter optional, non-empty body). Rejects ids or paths that already exist, including system-installed skills. Use directory::skills::update to edit existing skills.
Full file content, frontmatter optional; only the size cap and a non-empty body are enforced.
New skill id, used as the file path under skills_folder (`/`-separated segments of `[a-z0-9_-]`), not already taken.
Bytes written.
Frontmatter `function_id:` of the content, `null` when absent.
The created skill's id (normalized form of the input id).
File mtime after the write, RFC 3339.
Title resolved from the content (frontmatter `title:`, then `name:`, then body H1, then the id) — what `list` rows will show.
Frontmatter `type:` of the content, `null` when absent.
Delete one existing skill's markdown file by id (same id forms as directory::skills::get); refuses read-only system-installed skills.
Existing skill id — the same forms `directory::skills::get` accepts (bare id, `<id>.md`, `SKILL(S).md`, `iii://<id>`).
Id of the skill whose file was removed — the RESOLVED on-disk id (e.g. `ns/index` for input `ns`), not the input form.
Download skills into skills_folder from exactly one source: {repo, skill, branch?} clones a GitHub skill folder; {worker, version?|tag?} pulls from the workers registry. Prefer the explicit download_from_registry / download_from_repo.
Source A: branch to clone. Defaults to `"main"`. Pass `"master"` (or any other branch name) for repos whose default branch is not `main`.
Source A: GitHub repo URL. Pair with `skill`.
Source A: subfolder under `skills/` inside the repo. Doubles as the destination namespace inside `skills_folder`.
Registry tag to pull (default `latest`); mutually exclusive with `version`.
Source B: explicit semver to pull. Mutually exclusive with `tag`.
Source B: workers registry name. Pair with exactly one of `version` / `tag`.
Download one worker's directory bundle from the workers registry into skills_folder. `worker` is required; pass `version` (exact semver) or `tag` (default "latest"), not both. Files are overwritten file-by-file.
Registry tag to pull (e.g. `"latest"`). Mutually exclusive with `version`. Defaults to `"latest"` when neither is provided.
Explicit semver to pull. Mutually exclusive with `tag`.
Worker name in the registry (e.g. `"shell"`).
Download one skill folder from a GitHub repo into skills_folder: `repo` (https/ssh/git@ URL) and `skill` (subfolder under `skills/`, also the destination namespace) are required; `branch` defaults to "main".
Branch to clone. Defaults to `"main"`.
GitHub repo URL (validated: https / ssh / git@ only).
Subfolder under `skills/` inside the repo. Doubles as the destination namespace inside `skills_folder`.
Fetch one skill by id and return its raw markdown body plus id, title, type, function_id, and modified_at. A worker overview is addressed by the bare worker name; `<id>.md` and `iii://<id>` forms are accepted. On a miss, D110 names the closest ids.
Skill id as returned by directory::skills::list (e.g. `directory/skills/list`); `<id>.md` and `iii://<id>` forms are accepted.
When true, also return the exact on-disk file (frontmatter included) as `raw`, ready for directory::skills::update.
Raw markdown body (post-frontmatter) from disk. Note: there is no `description` field. `description` is the body's first paragraph, which is already inside `body` — every caller asking for the body would otherwise pay for the prefix twice. Use `directory::skills::list` rows when you want the teaser without the full body.
Whether model-facing indexes should omit this skill from invocation candidates.
Frontmatter `function_id:` when present — the canonical bus function id this skill documents (e.g. `sandbox::create`). The response's `id` field is the SKILL path on disk; `function_id` is what the agent should pass to `agent_trigger`. `null` when the skill isn't 1:1 with a single function.
File mtime as RFC 3339.
Absolute on-disk path of the skill file. Its parent directory is the skill's base directory — where payload the body references by relative path (`scripts/`, `reference/`, agent-skills convention) lives. Only meaningful to callers sharing this worker's filesystem (shell/file tools on the same machine).
FULL on-disk file content (frontmatter block included). Present only when the request set `raw: true`. This is the exact string to hand back to `directory::skills::update`; fallback notes that `get` may prepend to `body` are never added here.
Frontmatter `title:` when present and non-empty, otherwise the first `# H1` line in the body, otherwise the bare `id`.
Frontmatter `type:` (e.g. `index`, `how-to`, `reference`). `null` when the file has no frontmatter or omits the key.
Per-worker overview: one short markdown block per installed worker (title, first paragraph, and the directory::skills::get call for the full reference). For per-skill rows use directory::skills::list.
Rendered markdown document — one short `## <title>` block per installed worker (each worker's root overview doc, whether or not it declares frontmatter `type: index`), carrying the worker's first-paragraph overview and a `directory::skills::get` call to read the full reference. Sorted lex by id.
Number of worker entries rendered (i.e. the count of worker overview rows that survived the filter). Cheap sanity check that doesn't require re-parsing the body.
List skills, one row per skill (id, title, type, function_id, description, bytes, modified_at). Filters: `search` (substring on id/title/description), `prefix` (worker namespace), `type`; `include_description: false` for lighter rows. Pass a row's `function_id`, not its `id`, to agent_trigger.
When `false`, the response omits the first-paragraph `description` field on every row. Useful for token-light pickers that only need `id` + `title` + `type`. Default `true`.
Exact prefix match against `id`. Combine with `search` to scope a fuzzy match to one worker namespace, e.g. `prefix: "sandbox/"`.
Case-insensitive substring match against `id`, `title`, and (when `include_description` is true) the first body paragraph. Omitted rows are filtered out cheaply on the FsSkill { id } pass before the per-file frontmatter read, so a narrowed list is dramatically cheaper for the caller than the unfiltered one.
Exact match against the frontmatter `type:` field (`index`, `how-to`, `reference`, ...). `null` for entries with no frontmatter `type:`.
First paragraph of the body, empty when the file has only headings. Also empty when the caller passed `list { include_description: false }` for a token-light row.
Whether model-facing indexes should omit this skill from invocation candidates.
Frontmatter `function_id:` when present — the canonical bus function id this skill documents (e.g. `sandbox::create`). The row's `id` field is the SKILL path on disk (e.g. `sandbox/skills/sandbox/create`); `function_id` is what an agent should pass to `agent_trigger`. `null` for skills that aren't 1:1 with a single function (index/reference).
File mtime as RFC 3339 (best effort; empty if unavailable).
Frontmatter `title:` when present and non-empty, otherwise the first `# H1` line in the body, otherwise the bare `id`.
Frontmatter `type:` (e.g. `index`, `how-to`, `reference`). `null` when the file has no frontmatter or omits the key.
Overwrite one existing skill with full-file markdown (pass back the `raw` from directory::skills::get { raw: true }, edited). Never creates files; refuses read-only system-installed skills.
FULL new file content, frontmatter block included — the string `directory::skills::get { raw: true }` returns, edited.
Skill id to overwrite (same forms directory::skills::get accepts); the file must already exist.
Bytes written.
Frontmatter `function_id:` of the new content, `null` when absent.
The id that was updated (normalized form of the input id).
File mtime after the write, RFC 3339.
Title resolved from the NEW content (frontmatter `title:`, then body H1, then the id) — what `list` rows will now show.
Frontmatter `type:` of the new content, `null` when absent.
Create a new system prompt at <skills_folder>/system-prompts/<name>.md from full-file markdown (non-empty frontmatter `description` required; a declared `name` must match). Rejects names or paths that already exist.
Full file content, frontmatter included; `description` is required and a declared `name` must match.
New system prompt name, used as the file stem; same charset as listed names and not already taken.
Bytes written.
Description parsed from the frontmatter.
File mtime after the write, RFC 3339.
The created system prompt's name (as requested).
Permanently delete one EXISTING filesystem-backed system prompt by name. Resolves against the same merged scan as directory::system-prompts::list, removes only that prompt's markdown file, and fans out directory::system-prompts::on-change with { op: "delete" }.
Existing system prompt name, as returned by `directory::system-prompts::list`.
Name of the system prompt whose file was removed.
Fetch one system prompt by name — a filesystem-backed entry, or a worker-bundled one (`builtin: true`) when no local file shadows it. Returns the raw markdown body plus name, description, and modified_at — no envelope, no templating.
When `true`, the response includes the full on-disk file content (frontmatter included) as `raw`, ready for `directory::system-prompts::update`.
Served from the copy bundled with the worker (no local file yet): an update creates the local file.
List system prompts (name, description, modified_at) from skills_folder's `system-prompts/` plus the ones bundled with this worker (`builtin: true` until a local file shadows one).
Bundled with the worker, no file behind it: editing it creates the local file (which then shadows this entry); there is nothing to delete.
Overwrite one existing system prompt with full-file markdown; the frontmatter must keep a non-empty `description`. Updating a bundled prompt (`builtin: true`) creates a local file that shadows it. Returns the effective name (frontmatter `name:` wins over the file stem).
Full file content, frontmatter included; `description` must stay non-empty.
System prompt name to overwrite, as listed; a bundled prompt (`builtin: true`) is copied to a local file first.
Bytes written.
Description parsed from the new frontmatter.
File mtime after the write, RFC 3339.
The system prompt's EFFECTIVE name after the write: the new frontmatter `name:` when declared, otherwise the file stem. Differs from the input name when the update renames the system prompt.
Serve the iii-directory worker's injected console UI assets (content function for its console:script / console:style triggers).
The asset path from the trigger config (e.g. `state/page.js`).
The asset source, verbatim.
MIME type the console should serve the asset with.
Fires after a directory::skills::download that wrote at least one agent profile, or a directory::agents::update, create, or delete. Also fires with { op: "external" } when a watched agents file changes on disk outside this worker.
Fires after a directory::skills::download that wrote at least one skill markdown file, or a directory::skills::update, create, or delete. Also fires with { op: "external" } when a watched skills root changes on disk outside this worker — including the read-only agents skills root, when that root exists at startup.
Fires after a directory::skills::download that wrote at least one system prompt, or a directory::system-prompts::update, create, or delete. Also fires with { op: "external" } when a watched system-prompts root changes on disk outside this worker.