use serde_json::Value;
use super::Verb;
pub fn message(workspace: String, agent: String, content: String) -> Value {
MESSAGE.built(vec![workspace, agent, content], &[])
}
pub fn nudge(workspace: String, agent: String) -> Value {
NUDGE.built(vec![workspace, agent], &[])
}
pub fn enroll(workspace: String, name: String, grade: String) -> Value {
ENROLL.built(vec![workspace, name, grade], &[])
}
pub const WORKSPACES: Verb = Verb {
word: "workspaces",
params: &[],
flags: &[],
summary: "every workspace this engine holds, with its rollups",
detail: "The roster, and the whole of what a window's first pane is. It \
names each workspace, how it is classified, how many \
conversations it holds, how many want attention, whether \
anything is running, and where the operator pinned it. It takes \
no address, so its subject is EVERY channel this box holds: it \
asks each in turn — this box's own engine first, then the \
entries in leaf order — and prints the union under the name of \
the channel each answer came from, which is the roster the \
window paints. A channel that will not answer says so in its \
own section while the others still answer. To ask exactly one, \
name it: `lernie ask '{\"op\":\"workspaces\",\"workspace\":\"<entry>\"}'`.",
};
pub const CONVERSATIONS: Verb = Verb {
word: "conversations",
params: &["workspace"],
flags: &[],
summary: "one workspace's conversations",
detail: "The rows a window's middle pane paints: each conversation's \
label, its state, a first-line preview, its age and how far it \
hangs under its root. The id it answers with is the address \
every other verb here takes.",
};
pub const TRANSCRIPT: Verb = Verb {
word: "transcript",
params: &["workspace", "agent"],
flags: &[],
summary: "one conversation, committed entries and the live tail",
detail: "The whole conversation as of now — the delivered messages, the \
model's turns and their tool calls, the results, whatever the \
compactor squashed, and the tail of a turn still in flight. It \
answers once and returns; `follow` is the same subject held \
open.",
};
pub const FOLLOW: Verb = Verb {
word: "follow",
params: &["workspace", "agent"],
flags: &[],
summary: "watch one conversation until it comes to rest",
detail: "It holds the line and prints the tail as the engine writes it, \
and it keeps holding across the engine's own step boundaries — a \
single held read ends when a STEP commits (yog's REMOTE §5.1), \
which is not the end of anything you asked about. It ends when \
the conversation comes to REST: it prints a line saying so and \
exits 0. A conversation already at rest is told to you at once, \
for the same reason. Ctrl-C is the other way out. \
EACH FRAME IS AN APPEND, not the whole answer (REMOTE §5.5): \
absorb every frame of a read, in order, onto an empty fold, and \
what you hold after the last one is what you have. A missed frame \
is missed text — which is what the holding is for.",
};
pub fn workspaces() -> Value {
WORKSPACES.built(Vec::new(), &[])
}
pub fn conversations(workspace: String) -> Value {
CONVERSATIONS.built(vec![workspace], &[])
}
pub fn transcript(workspace: String, agent: String) -> Value {
TRANSCRIPT.built(vec![workspace, agent], &[])
}
pub fn follow(workspace: String, agent: String) -> Value {
FOLLOW.built(vec![workspace, agent], &[])
}
pub const MESSAGE: Verb = Verb {
word: "message",
params: &["workspace", "agent", "content"],
flags: &[],
summary: "deposit a message into a conversation",
detail: "The content crosses verbatim — nothing here trims, wraps or \
normalises it — so quote it as one argument. It answers with the \
deposit's captured run, and the turn it triggers arrives on the \
transcript at its own pace.",
};
pub const ENROLL: Verb = Verb {
word: "enroll",
params: &["workspace", "name", "grade"],
flags: &[],
summary: "mint a new box's material and say it as a code, a line and, if asked, four files",
detail: "The engine mints a leaf on its own CA, seats the client in that \
workspace, answers the material and shreds the key. What comes \
back is REMOTE §8.4's envelope — one line of compact JSON under \
`{\"yog-enroll\":1,…}` — and there are three ways to take those \
same bytes: a QR symbol for a camera, the line itself for the \
paste box an android seat offers, and `--into <dir>` for a box \
with neither, which writes the four files an entry is (`ca.pem`, \
`client.pem`, `client.key`, `address`) into that directory for \
you to carry to the machine they are for. YOU PICK ONE: with no \
`--into` the symbol and the line are both printed and this seat \
keeps NOTHING — not a file, not a cache, not a log line; with \
one, the key goes to the files and never to this terminal, which \
is the one place the act could not shred it afterwards. `grade` \
is `operator` or `foot`. It is refused unless this box's own leaf \
is operator-grade — the new box says nothing and performs no act, \
which is why this is not the in-channel bootstrap REMOTE §1.4 \
forbids.",
};
pub const NUDGE: Verb = Verb {
word: "nudge",
params: &["workspace", "agent"],
flags: &[],
summary: "start a driver on a conversation that has gone quiet",
detail: "It launches the advance and answers at once, carrying nothing \
else, because there is nothing else yet: what the model does with \
the turn arrives on the transcript, and a receipt that guessed at \
it here would be a receipt that lied.",
};
pub(super) const TABLE: &[Verb] = &[
WORKSPACES,
super::queue::ATTENTION,
super::balls::BALLS,
super::balls::BOARD,
super::window::SEARCH,
CONVERSATIONS,
super::balls::WORKSPACE_BALLS,
super::balls::MARKS,
super::fleet::SCIENCE,
super::fleet::WORK_DIFF,
TRANSCRIPT,
FOLLOW,
super::records::AGENT,
super::records::STEPS,
super::records::STEP,
super::records::FILES,
super::records::INBOX,
super::spine::RAIL,
super::spine::GOVERNING,
super::tuning::ROLES,
super::clients::CLIENTS,
super::config::LINEAGES,
super::login::PROVIDERS,
super::login::MODELS,
super::login::LOGIN_TAIL,
MESSAGE,
super::conversation::INTERRUPT,
NUDGE,
super::conversation::STOP,
super::conversation::RETARGET,
super::queue::FLAG,
super::queue::SEEN,
super::capability::ANSWER,
super::capability::REVOKE,
super::capability::RESTORE,
super::conversation::DELETE_AGENT,
ENROLL,
super::login::LOGIN,
super::tuning::MODEL,
super::workspace::PIN,
super::workspace::UNPIN,
super::trail::ACK,
super::fleet::SCAN,
super::fleet::ARM,
super::fleet::DISARM,
super::fleet::DISBAND,
super::trail::CLEAR_TRAIL,
super::balls::ASSIGN,
super::balls::RELEASE,
super::balls::CLOSE,
super::workspace::DELETE_WORKSPACE,
];