feat(app): the Connect page's Claude desktop app row writes a one-click extension (P15 C1)

Claude's desktop extension format is the MCP Bundle: a .mcpb zip with a
manifest.json (manifest 0.3, github.com/anthropics/mcpb). The row's
button makes the company's agent key if there is none and writes
Documents/Wanderbooks/Extensions/wanderbooks-<id>.mcpb: a manifest whose
server is a binary running this program's own stable path as
mcp --book <id>, the 512 px icon and a short README as the entry point.
The package carries no program (the one executable is the installed
one), no key and no path of the data root. The page then says in plain
words where in Claude to pick the file and to keep Wanderbooks open, and
offers to show the file. The manifest is checked against Anthropic's
published schema (a test fixture) and its required fields. The blessed
Connect page pictures change by exactly the new row. The program's
version is now one value set by main for every platform, not only Unix.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 15:31:21 -07:00
1 parent 479d3a5c5e
commit 2bc442f795
15 files changed
+1039 -21

No files matched your search

+55
View File
@@ -247,6 +247,17 @@ impl Owner for Fake {
self.note(format!("connect {} {book}", agent.key()));
Ok(vec![format!("{} reaches the books.", agent.label())])
}
fn claude_desktop_extension(
&self,
book: &str,
company: &str,
) -> Result<ledger_gui::owner::ExtensionMade, String> {
self.note(format!("extension {book} {company}"));
Ok(ledger_gui::owner::ExtensionMade {
file: "/docs/Wanderbooks/Extensions/wanderbooks-alpha.mcpb".into(),
folder: "/docs/Wanderbooks/Extensions".into(),
})
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
@@ -731,6 +742,50 @@ fn the_connect_buttons_do_what_connect_does() {
drop(h);
}
/// WB-pkg-5: the "Claude desktop app" row makes the extension for this
/// company through the owner, then says in words what to do with the file.
#[test]
fn the_claude_desktop_row_makes_the_extension_and_says_what_to_do_next() {
let w = World::new(&[("alpha", "Wanderland Labs")]);
let owner = Fake::new();
owner.answer(roster(vec![], vec![]));
let mut h = start(&w, &["alpha"], &owner);
refresh(&mut h);
h.state_mut().goto(Route::Connect);
h.run_steps(3);
assert!(h.query_by_label_contains("Claude desktop app").is_some());
assert!(
h.query_by_label_contains("Show the file").is_none(),
"nothing is made yet"
);
h.get_by_role_and_label(Role::Button, "Make the Claude extension")
.click();
h.run_steps(2);
wait_for("the extension was made", || {
owner
.said()
.contains(&"extension alpha Wanderland Labs".to_string())
});
until(&mut h, "it said what came of it", |a| {
a.views()[0].connect_state().said().is_some()
});
h.run_steps(2);
for words in [
"wanderbooks-alpha.mcpb",
"Settings",
"Extensions",
"Install Extension",
"Keep Wanderbooks open",
] {
assert!(
h.query_by_label_contains(words).is_some(),
"{words} is said on the page"
);
}
assert!(h.query_by_label_contains("Show the file").is_some());
drop(h);
}
// ---- 5: the warning before a close ---------------------------------------------
fn connected_alpha(owner: &Fake) {
@@ -1 +1 @@
2abd53e6457106f8
de92373f318d6a38
@@ -1 +1 @@
b990ac9586df492a
d163fd8e3925b936