Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions approval-gate/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ deploy: binary
manifest: Cargo.toml
bin: approval-gate
description: Policy and decision surface for human-held function calls — pre_trigger gate, pending inbox, per-session permission settings, and two notification trigger types.

dependencies:
iii-state: "^0.19.0"
configuration: "^0.19.0"
iii-directory: "^1.0.0"
session-manager: "^1.0.0"
4 changes: 4 additions & 0 deletions context-manager/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ deploy: binary
manifest: Cargo.toml
bin: context-manager
description: Turns a raw conversation history plus a target model into a model-ready context — token counting, function-result pruning, and history compaction.

dependencies:
configuration: "^0.19.0"
llm-router: "^1.0.0"
9 changes: 5 additions & 4 deletions harness/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ dependencies:
iii-state: "^0.19.0"
iii-queue: "^0.19.0"
configuration: "^0.19.0"
iii-directory: "^0.8.1"
session-manager: "^0.1.0"
context-manager: "^0.1.0"
llm-router: "^0.1.0"
iii-directory: "^1.0.0"
session-manager: "^1.0.0"
context-manager: "^1.0.0"
llm-router: "^1.0.0"
approval-gate: "^1.0.0"
3 changes: 3 additions & 0 deletions iii-directory/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ deploy: binary
manifest: Cargo.toml
bin: iii-directory
description: Engine introspection (functions / triggers / workers), workers registry proxy, and filesystem-backed skill + prompt reader.

dependencies:
configuration: "^0.19.0"
15 changes: 13 additions & 2 deletions iii-directory/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,30 @@ pub async fn apply_config(state: &SharedState, cfg: SkillsConfig) {
state.registered_cache.invalidate().await;
}

/// Trigger payload for `directory::on-config-change`. The handler ignores it
/// (it re-fetches from the authoritative configuration); the empty struct
/// exists so the function publishes a typed request schema rather than AnyValue.
#[derive(Debug, Default, serde::Deserialize, schemars::JsonSchema)]
struct OnConfigChangeRequest {}

#[derive(Debug, serde::Serialize, schemars::JsonSchema)]
struct OnConfigChangeResponse {
ok: bool,
}

/// Register the internal config-change handler and bind a `configuration`
/// trigger for `configuration:updated` on the `iii-directory` entry.
pub fn register_config_trigger(iii: &III, state: SharedState) -> Result<(), IIIError> {
let st = state.clone();
let engine = iii.clone();
iii.register_function(
CONFIG_FN_ID,
RegisterFunction::new_async(move |_payload: Value| {
RegisterFunction::new_async(move |_req: OnConfigChangeRequest| {
let st = st.clone();
let engine = engine.clone();
async move {
on_config_change(&engine, &st).await;
Ok::<Value, IIIError>(json!({ "ok": true }))
Ok::<OnConfigChangeResponse, IIIError>(OnConfigChangeResponse { ok: true })
}
})
.description(
Expand Down
23 changes: 18 additions & 5 deletions iii-directory/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,19 @@ async fn main() -> Result<()> {
Ok(())
}

/// `worker` trigger payload for `directory::__on_worker_added`. Only `worker`
/// is read; declared as a struct so the function publishes a typed schema.
#[derive(Debug, Default, serde::Deserialize, schemars::JsonSchema)]
struct WorkerAddedEvent {
#[serde(default)]
worker: Option<String>,
}

#[derive(Debug, serde::Serialize, schemars::JsonSchema)]
struct WorkerAddedAck {
ok: bool,
}

/// Register the internal `directory::__on_worker_added` handler and
/// subscribe to the `worker` trigger type for `add` operations.
fn setup_auto_download(
Expand All @@ -212,13 +225,13 @@ fn setup_auto_download(
// Register the internal handler that fires on worker-add events.
iii.register_function(
"directory::__on_worker_added",
RegisterFunction::new_async(move |input: serde_json::Value| {
RegisterFunction::new_async(move |event: WorkerAddedEvent| {
let cfg = cfg_inner.load_full();
let cache = cache_inner.clone();
let in_flight = in_flight_inner.clone();
async move {
handle_worker_added(&cfg, &cache, &in_flight, &input).await;
Ok::<_, iii_sdk::IIIError>(json!({"ok": true}))
handle_worker_added(&cfg, &cache, &in_flight, &event).await;
Ok::<_, iii_sdk::IIIError>(WorkerAddedAck { ok: true })
}
})
.description("Internal: auto-download skills on worker add event."),
Expand Down Expand Up @@ -265,9 +278,9 @@ async fn handle_worker_added(
cfg: &SkillsConfig,
cache: &RegisteredWorkersCache,
in_flight: &Arc<InFlightGuard>,
payload: &serde_json::Value,
event: &WorkerAddedEvent,
) {
let worker = match payload.get("worker").and_then(|w| w.as_str()) {
let worker = match event.worker.as_deref() {
Some(w) => w.to_string(),
None => {
tracing::debug!("worker add event missing 'worker' field; skipping");
Expand Down
8 changes: 0 additions & 8 deletions llm-router/config.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions llm-router/iii-permissions.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions llm-router/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ deploy: binary
manifest: Cargo.toml
bin: llm-router
description: One front door + provider protocol in front of every LLM provider.

dependencies:
iii-state: "^0.19.0"
configuration: "^0.19.0"
4 changes: 4 additions & 0 deletions provider-anthropic/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ deploy: binary
manifest: Cargo.toml
bin: provider-anthropic
description: Anthropic Messages API provider worker; implements provider::anthropic::stream and provider::anthropic::refresh_models behind llm-router.

dependencies:
iii-state: "^0.19.0"
llm-router: "^1.0.0"
4 changes: 4 additions & 0 deletions provider-openai/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ deploy: binary
manifest: Cargo.toml
bin: provider-openai
description: OpenAI Chat Completions provider worker; implements provider::openai::stream and provider::openai::refresh_models behind llm-router.

dependencies:
iii-state: "^0.19.0"
llm-router: "^1.0.0"
3 changes: 3 additions & 0 deletions session-manager/iii.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ deploy: binary
manifest: Cargo.toml
bin: session-manager
description: Durable, reactive, branching store of typed conversation entries with six emitted trigger types.

dependencies:
configuration: "^0.19.0"
Loading