Skip to main content

aion_server/assistant/
mod.rs

1//! The built-in assistant: the aion authoring assistant ships INSIDE the
2//! server binary, present the moment `aion server` runs.
3//!
4//! This is the ops-console doctrine applied to a workflow document. The
5//! console is compiled into the binary and served at `/` with no operator
6//! step; the assistant document
7//! (`crates/aion-server/assistant-embed/assistant.awl`) is compiled into the
8//! binary the same way, installed into the engine at boot, and described over
9//! `/assistant`. A stock `cargo install aion-cli` therefore carries the
10//! assistant — no repository checkout, no example crate, no hand deploy.
11//!
12//! # The brain is a seam, not a dependency
13//!
14//! Nothing here names an agent harness. The document declares one `agent`
15//! action on the assistant's own private queue; WHICH agent serves that
16//! queue, and how it is launched, is declared in the DOCUMENT a worker is
17//! started from — its `harness` section names the kind (norn today, ACP for
18//! external agents) and every launch setting. This module installs the
19//! embedded document and describes it; it neither spawns nor selects a brain.
20//!
21//! # The queue is the assistant's own name, never `default`
22//!
23//! [`document::private_task_queue`] IS the rule: the built-in assistant serves
24//! the queue named after the workflow type it exports, and the embedded
25//! document is refused at load if it declares anything else. `default` is
26//! where an out-of-box worker comes up with no configuration, and contract
27//! admission holds a registering worker against every reachable contract on
28//! its queue — so an assistant sitting on `default` refused the first worker a
29//! newcomer started (#200). The queue belongs to those workers.
30//!
31//! A catalog that predates that change still has its assistant on the old
32//! queue. Nothing here moves it: [`install`] reports the divergence at WARN,
33//! naming both queues and the verbs that perform the move, and leaves routing
34//! exactly as the operator left it.
35//!
36//! # What the install will and will not do
37//!
38//! [`install::install_embedded_assistant`] loads the embedded package into
39//! the engine ONLY when the catalog holds no version of the assistant
40//! workflow type at all — a fresh home. Loading a package re-points routing
41//! for its type ([`aion::Engine::load_package`]), so an unconditional boot
42//! install would silently steal the route from an operator's deliberate
43//! rollback, on every restart. When any version is already resident the
44//! install stands down and says so, naming both hashes and the operator's own
45//! cut verbs. The live cut is the operator's act, never a side effect of a
46//! restart.
47
48/// The served description of the embedded assistant: identity, contract, and
49/// current residency in the engine catalog.
50pub mod descriptor;
51/// The embedded AWL document, its compiled identity, and its verified session
52/// contract.
53pub mod document;
54/// Boot-time installation of the embedded document into the engine catalog.
55pub mod install;
56
57pub use descriptor::{
58    AssistantDescriptor, AssistantResidency, AssistantSessionContract, AssistantSignal, describe,
59};
60pub use document::{
61    CONTINUE_END_FIELD, CONTINUE_MESSAGE_FIELD, CONTINUE_SIGNAL, EMBEDDED_ASSISTANT_DOCUMENT,
62    EMBEDDED_ASSISTANT_FILENAME, EmbeddedAssistant, EmbeddedAssistantError, OBJECTIVE_INPUT,
63    REPO_PATH_INPUT, STATUS_QUERY, embedded_assistant, private_task_queue,
64};
65pub use install::{
66    AssistantInstall, RoutedQueues, WorkerListenerAdvice, install_embedded_assistant,
67    install_embedded_assistant_for_server,
68};