use serde_json::Value;
use super::Verb;
pub const PROVIDERS: Verb = Verb {
word: "providers",
params: &["workspace"],
flags: &[],
summary: "what this workspace's wall can sign in to",
detail: "One row per provider the wall routes, in the engine's own \
listing order — which is brazen's routing order, so the first \
row that can answer is the one a turn goes down. Each says what \
the engine knows about its credential, why a sign-in cannot be \
started on it where one cannot, and whether it takes an effort \
level and the priority lane at all. It is read on the wall the \
workspace names, so a wall held elsewhere answers about the \
credentials its own agents read.",
};
pub const MODELS: Verb = Verb {
word: "models",
params: &["workspace", "provider"],
flags: &[],
summary: "the model ids one provider row offers",
detail: "The ids that row answers to, as the engine has them — the \
values `model` takes as its last argument. It is asked of one \
row rather than of the wall, because two rows offering the same \
id are still two different routes to it.",
};
pub const LOGIN: Verb = Verb {
word: "login",
params: &["workspace", "provider"],
flags: &[],
summary: "start a sign-in on one provider row, in that workspace's wall",
detail: "The run happens on the ENGINE, inside the named workspace's \
wall, so the credential lands where the agents that need it run \
— nothing credential-shaped ever crosses this wire. It answers \
at once with the run's standing rather than waiting the flow \
out, and the lines are read with `login-tail`. A second sign-in \
on a live pair replaces the first, which is the operator's own \
restart and the reason there is no cancel. A row whose flow \
needs a browser at the engine's own loopback can only be \
completed from a browser on that box, or through a port-forward \
the operator sets up.",
};
pub const LOGIN_TAIL: Verb = Verb {
word: "login-tail",
params: &["workspace", "provider"],
flags: &[],
summary: "hold the line on one sign-in's output",
detail: "Buffered from the start, then live to the outcome, with the \
settled exit as the last frame. Each frame carries what the run \
said SINCE the last one, so a read starts from empty and asking \
twice replays the whole of it. A pair nobody has signed in to \
answers one empty frame — nobody has signed in here is a \
reading, not a silence.",
};
pub fn providers(workspace: String) -> Value {
PROVIDERS.built(vec![workspace], &[])
}
pub fn models(workspace: String, provider: String) -> Value {
MODELS.built(vec![workspace, provider], &[])
}
pub fn login(workspace: String, provider: String) -> Value {
LOGIN.built(vec![workspace, provider], &[])
}
pub fn login_tail(workspace: String, provider: String) -> Value {
LOGIN_TAIL.built(vec![workspace, provider], &[])
}