feat(host,gui): the command that reaches a company's books is made in one place

The Connect page of P15 unit A4 shows an assistant the exact command it
must run to reach a company (`<this program> mcp --book ID`, with --root
when a root was named). `connect` already built that command, so it is
now one function (`bridge_serve_args`/`command_line`) used by both, and
the step `connect` does first (the company's default key exists and its
copy is in the token file) is `ensure_key`, which the page offers by
itself for assistants it has no button for.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 10:03:35 -07:00
1 parent 016f1b2afc
commit 1d1a2a5a88
3 files changed
+64 -40

No files matched your search

+10 -4
View File
@@ -267,10 +267,16 @@ pub trait Owner: Send + Sync {
fn serve_revoke(&self, _book: &str, _name: &str) -> Result<String, String> {
Err("not here".into())
}
/// The command an assistant runs to reach the company `book`, as text
/// to type (the program and `mcp --book ID`, quoted for a terminal):
/// what the Connect page shows for an assistant it has no button for.
fn bridge_command(&self, _book: &str) -> Result<String, String> {
/// This program run with `words`, as a line to type in a terminal (the
/// program's own path, the words, the data root if one was named): what
/// the Connect page shows for an assistant it has no button for.
fn command_line(&self, _words: &[&str]) -> Result<String, String> {
Err("not here".into())
}
/// The key an assistant needs to reach the company `book` exists (made
/// now if it did not): `Ok(true)` when it was made now. What `connect`
/// does first, for an assistant set up by hand. Blocks.
fn make_key(&self, _book: &str) -> Result<bool, String> {
Err("not here".into())
}
/// Close the books: everything holding them lets go.