Skip to content

Commit e8c2119

Browse files
wesbillmanCarl
andauthored
Make bundled plugin defaults explicit and hide unavailable entry points (#557)
Signed-off-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
1 parent 1800895 commit e8c2119

21 files changed

Lines changed: 564 additions & 40 deletions

‎crates/plugin-manager/src/lib.rs‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,27 @@ impl Manager {
357357
.bundled_overrides
358358
.get(&manifest.id)
359359
.copied()
360-
.unwrap_or(!matches!(
360+
// New bundles must opt in to the default-on policy.
361+
.unwrap_or(matches!(
361362
manifest.id.as_str(),
362-
"buzz.channel-templates" | "buzz.todos"
363+
"buzz.channels"
364+
| "buzz.feedback"
365+
| "buzz.diffs"
366+
| "buzz.identity-naming"
367+
| "buzz.agent-activity"
368+
| "buzz.terminal"
369+
| "buzz.profiles"
370+
| "buzz.links"
371+
| "buzz.mentions"
372+
| "buzz.emoji"
373+
| "buzz.github"
374+
| "buzz.inbox"
375+
| "buzz.projects"
376+
| "buzz.agents"
377+
| "buzz.workflows"
378+
| "buzz.sessions"
379+
| "block.hosted-communities"
380+
| "buzz.moderation"
363381
));
364382
PluginInfo {
365383
manifest,

‎crates/plugin-manager/tests/management.rs‎

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ fn bundled_plugins_have_independent_flags_and_all_ids_are_reserved() {
469469
"buzz.terminal",
470470
"buzz.sessions",
471471
"buzz.inbox",
472-
"buzz.bestie",
473472
"buzz.projects",
474473
"buzz.agents",
475474
"buzz.emoji",
@@ -596,3 +595,49 @@ fn channels_is_required_even_with_saved_disabled_settings() {
596595
.enabled
597596
);
598597
}
598+
599+
#[test]
600+
fn bundled_defaults_preserve_saved_choices_and_only_channels_is_required() {
601+
let (_root, manager, _source) = fixture();
602+
let catalog = manager.catalog().unwrap();
603+
assert_eq!(catalog.plugins.len(), 21);
604+
for plugin in &catalog.plugins {
605+
let id = plugin.manifest.id.as_str();
606+
let default = !matches!(id, "buzz.bestie" | "buzz.todos" | "buzz.channel-templates");
607+
assert_eq!(plugin.enabled, default, "{id}");
608+
if id == "buzz.channels" {
609+
assert!(manager.change("disable", id).is_err());
610+
} else {
611+
for enabled in [true, false] {
612+
manager
613+
.change(if enabled { "enable" } else { "disable" }, id)
614+
.unwrap();
615+
assert_eq!(
616+
manager
617+
.catalog()
618+
.unwrap()
619+
.plugins
620+
.iter()
621+
.find(|p| p.manifest.id == id)
622+
.unwrap()
623+
.enabled,
624+
enabled,
625+
"{id}"
626+
);
627+
}
628+
}
629+
}
630+
// Existing native profiles can keep Bestie on across process restarts.
631+
manager.change("enable", "buzz.bestie").unwrap();
632+
let reopened = Manager::open(Some(_root.path().to_path_buf()), "test", false).unwrap();
633+
assert!(
634+
reopened
635+
.catalog()
636+
.unwrap()
637+
.plugins
638+
.iter()
639+
.find(|p| p.manifest.id == "buzz.bestie")
640+
.unwrap()
641+
.enabled
642+
);
643+
}

‎docs/plugin-architecture.md‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bundled/agents/ local control UI and read-only current-Buzz library page
5353
features/agents/ app-owned control capability; separate session-owned library
5454
bundled/github/ builtin GitHub panel plugin
5555
bundled/bestie/ builtin Bestie page, companion panel and its snake launcher
56-
bundled/inbox/ builtin Inbox page, a placeholder until inbox content exists
56+
bundled/inbox/ builtin Inbox page for unread conversations and mentions
5757
```
5858

5959
The host composes one channel sidebar beside independently mounted pages. It reuses
@@ -103,7 +103,22 @@ render failures and remounts on target or revision changes. Unloading a plugin
103103
removes its contributions and closes its panel. Other pages can use these same
104104
contracts with their own layout and local navigation.
105105

106-
The initial distribution contains Channels, Inbox, Projects, Agents, GitHub, Bestie, Emoji, Mentions, Profiles, Terminal and Links. Projects
106+
### Bundled defaults
107+
108+
All 21 plugins remain bundled. **Channels is the only required plugin.** Bestie,
109+
Todos, and Templates & teams are off by default. Feedback, Diff viewer, Identity
110+
Naming, Agent Activity, Terminal, Profiles, Links, Mentions, Emoji, GitHub, Inbox,
111+
Projects, Agents, Workflows, Sessions, Hosted communities, and Community admin are
112+
on by default, but optional. Both browser and native catalogs declare that policy.
113+
114+
Saved enabled/disabled flags win over defaults (except required Channels). There
115+
is no migration or forced reset: a browser profile that previously saved its full
116+
plugin snapshot can retain Bestie enabled. Native profiles store per-plugin
117+
overrides. Default-on does not promise platform support: Terminal contributes UI
118+
only on macOS/Linux desktop; Hosted communities still requires its development
119+
broker backend. Disabling Community admin removes its Invite to community shortcut.
120+
121+
Projects
107122
is enabled by default and owns versioned, validated entity page routes. It resolves
108123
signed metadata through the session reader and reports navigation completion only
109124
after destination content is presented. Git browsing uses a narrow host-owned,
@@ -339,8 +354,8 @@ are ordinary shared components, not another registry.
339354
Only open intent crosses pages: the panel component can remount under a new page,
340355
so this mechanism does not promise persistent agent sessions or drafts. Bestie
341356
currently supplies art and truthful not-connected copy, with no send control or
342-
agent API. Both browser and Rust native/CLI catalogs list it as independently
343-
enabled by the normal bundled policy; saved disabled flags still win.
357+
agent API. Both browser and Rust native/CLI catalogs keep it bundled but off by default;
358+
saved enabled or disabled flags still win. Enable it under Settings → Plugins.
344359

345360
`main.tsx` creates the shared services once; `app/App.tsx` owns startup screens,
346361
navigation, and built-in Settings. `app/services.ts` composes the core services.

‎docs/terminal.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Terminal plugin
22

33
In a channel, click **Terminal** in the conversation header or press **Cmd+J**
4-
(macOS) / **Ctrl+J** (other platforms). The bottom drawer starts a login shell the
4+
(macOS) / **Ctrl+J** (Linux desktop). The bottom drawer starts a login shell the
55
first time it opens for that community/account/channel. **Hide** and the shortcut
66
hide the drawer without stopping work; reopening reattaches the same emulator and
77
shell. **End session** explicitly terminates it; **Restart** starts a fresh shell.
@@ -24,9 +24,9 @@ channels. Do not copy private keys into `.env.local`. The launcher derives this
2424
worktree's port from its path; pass `--port` only if another server already owns
2525
it.
2626

27-
Local PTYs are implemented for macOS/Linux. Windows native startup reports that it
28-
is unsupported in this slice. Browser-only Buzz hides the terminal launcher and
29-
does not register its shortcut; there is no HTTP shell endpoint. Automated macOS native tests and browser engines do
27+
Local PTYs are implemented for macOS/Linux. Terminal remains enabled by default,
28+
but Windows desktop and browser-only Buzz register neither its panel nor its
29+
launcher or shortcut. Windows PTY support is not implemented; there is no HTTP shell endpoint. Automated macOS native tests and browser engines do
3030
not establish Linux or packaged desktop acceptance.
3131

3232
## Appearance and welcome

‎src/app/App.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function ConnectedApp({ services }: { services: AppServices }) {
182182
// A scoped Settings target selects its community on the way.
183183
onOpenTarget={(target) => void services.navigation.open(target)}
184184
communities={services.communities}
185+
settingsCards={services.settingsCards}
185186
accountActions={services.accountActions}
186187
onProfile={
187188
ownProfile && launcher.canOpen(ownProfile)

‎src/app/Settings.test.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function registry(initial: Contribution<SettingsCard>[]) {
3232
},
3333
register() {},
3434
retainVisibility: () => () => {},
35+
has: (key) => entries.some((entry) => entry.key === key),
3536
visibility: (key) => entries.some((entry) => entry.key === key),
3637
};
3738
return {

‎src/app/pages.integration.test.mjs‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,33 @@ test("the app runtime exposes ready bundled pages and removes them on disable",
4646
);
4747
assert.notEqual(services.accountActions.snapshot()[0], firstFeedback);
4848
await settle();
49-
assert.equal(services.pages.snapshot().length, 7);
49+
assert.equal(services.pages.snapshot().length, 6);
50+
const { bundledPlugins } = await vite.ssrLoadModule(
51+
"/src/bundled/index.ts",
52+
);
53+
assert.equal(bundledPlugins.length, 21);
54+
for (const plugin of bundledPlugins) {
55+
assert.equal(
56+
typeof plugin.enabledByDefault,
57+
"boolean",
58+
plugin.manifest.id,
59+
);
60+
assert.equal(
61+
plugin.enabledByDefault,
62+
!["buzz.bestie", "buzz.todos", "buzz.channel-templates"].includes(
63+
plugin.manifest.id,
64+
),
65+
plugin.manifest.id,
66+
);
67+
}
68+
assert.equal(
69+
services.pages.snapshot().some((p) => p.pluginId === "buzz.bestie"),
70+
false,
71+
);
72+
assert.equal(
73+
services.panels.snapshot().some((p) => p.pluginId === "buzz.bestie"),
74+
false,
75+
);
5076
const inbox = services.pages
5177
.snapshot()
5278
.find((page) => page.pluginId === "buzz.inbox");
@@ -216,6 +242,12 @@ test("the app runtime exposes ready bundled pages and removes them on disable",
216242
),
217243
);
218244

245+
await services.plugins.change("enable", "buzz.bestie");
246+
await vi.waitFor(() =>
247+
assert.ok(
248+
services.panels.snapshot().some((p) => p.pluginId === "buzz.bestie"),
249+
),
250+
);
219251
const firstBestie = services.panels
220252
.snapshot()
221253
.find((panel) => panel.pluginId === "buzz.bestie");

‎src/app/shell/AppShell.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { IconButton } from "../../shared/design-system/ui/IconButton";
44
import { SidebarIcon } from "../../shared/design-system/icons";
55
import { Panel } from "../../shared/design-system/ui/Panel";
66
import { isTauri } from "@tauri-apps/api/core";
7+
import type { SettingsCards } from "../../features/settings/service";
78
import type { RegisteredPage } from "../../features/pages/service";
89
import type { AccountActionsService } from "../../features/account-actions/service";
910
import type { Communities } from "../../features/communities/service";
@@ -27,6 +28,7 @@ export function AppShell({
2728
workspace,
2829
sidebar,
2930
communities,
31+
settingsCards,
3032
accountActions,
3133
onProfile,
3234
searchServices,
@@ -45,6 +47,7 @@ export function AppShell({
4547
workspace?: boolean;
4648
sidebar?: (pages: ReactNode) => ReactNode;
4749
communities: Communities;
50+
settingsCards?: SettingsCards | undefined;
4851
accountActions: AccountActionsService;
4952
onProfile?: ((trigger: HTMLButtonElement) => void) | undefined;
5053
searchServices?: SearchServices;
@@ -204,6 +207,7 @@ export function AppShell({
204207
<div className="flex min-h-0 flex-1">
205208
<CommunityRail
206209
communities={communities}
210+
settingsCards={settingsCards}
207211
onSelect={onCommunitySelect}
208212
onOpenTarget={onOpenTarget}
209213
/>

‎src/bundled/index.ts‎

Lines changed: 95 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,109 @@ import moderationManifest from "./moderation/manifest.json";
4343
import * as moderation from "./moderation";
4444

4545
export const bundledPlugins: readonly BundledPlugin[] = [
46-
{ manifest: { ...feedbackManifest, apiVersion: 1 }, module: feedback },
46+
{
47+
manifest: { ...feedbackManifest, apiVersion: 1 },
48+
module: feedback,
49+
enabledByDefault: true,
50+
},
4751
{
4852
manifest: { ...todosManifest, apiVersion: 1 },
4953
module: todos,
5054
enabledByDefault: false,
5155
},
52-
{ manifest: { ...diffsManifest, apiVersion: 1 }, module: diffs },
56+
{
57+
manifest: { ...diffsManifest, apiVersion: 1 },
58+
module: diffs,
59+
enabledByDefault: true,
60+
},
5361
{
5462
manifest: { ...templatesManifest, apiVersion: 1 },
5563
module: templates,
5664
enabledByDefault: false,
5765
},
58-
{ manifest: { ...namingManifest, apiVersion: 1 }, module: naming },
59-
{ manifest: { ...activityManifest, apiVersion: 1 }, module: activity },
60-
{ manifest: { ...terminalManifest, apiVersion: 1 }, module: terminal },
61-
{ manifest: { ...profilesManifest, apiVersion: 1 }, module: profiles },
62-
{ manifest: { ...linksManifest, apiVersion: 1 }, module: links },
63-
{ manifest: { ...mentionsManifest, apiVersion: 1 }, module: mentions },
64-
{ manifest: { ...emojiManifest, apiVersion: 1 }, module: emoji },
65-
{ manifest: { ...channelsManifest, apiVersion: 1 }, module: channels },
66-
{ manifest: { ...githubManifest, apiVersion: 1 }, module: github },
67-
{ manifest: { ...bestieManifest, apiVersion: 1 }, module: bestie },
68-
{ manifest: { ...inboxManifest, apiVersion: 1 }, module: inbox },
69-
{ manifest: { ...projectsManifest, apiVersion: 1 }, module: projects },
70-
{ manifest: { ...agentsManifest, apiVersion: 1 }, module: agents },
71-
{ manifest: { ...workflowsManifest, apiVersion: 1 }, module: workflows },
72-
{ manifest: { ...sessionsManifest, apiVersion: 1 }, module: sessions },
73-
{ manifest: { ...hostedManifest, apiVersion: 1 }, module: hosted },
74-
{ manifest: { ...moderationManifest, apiVersion: 1 }, module: moderation },
66+
{
67+
manifest: { ...namingManifest, apiVersion: 1 },
68+
module: naming,
69+
enabledByDefault: true,
70+
},
71+
{
72+
manifest: { ...activityManifest, apiVersion: 1 },
73+
module: activity,
74+
enabledByDefault: true,
75+
},
76+
{
77+
manifest: { ...terminalManifest, apiVersion: 1 },
78+
module: terminal,
79+
enabledByDefault: true,
80+
},
81+
{
82+
manifest: { ...profilesManifest, apiVersion: 1 },
83+
module: profiles,
84+
enabledByDefault: true,
85+
},
86+
{
87+
manifest: { ...linksManifest, apiVersion: 1 },
88+
module: links,
89+
enabledByDefault: true,
90+
},
91+
{
92+
manifest: { ...mentionsManifest, apiVersion: 1 },
93+
module: mentions,
94+
enabledByDefault: true,
95+
},
96+
{
97+
manifest: { ...emojiManifest, apiVersion: 1 },
98+
module: emoji,
99+
enabledByDefault: true,
100+
},
101+
{
102+
manifest: { ...channelsManifest, apiVersion: 1 },
103+
module: channels,
104+
enabledByDefault: true,
105+
},
106+
{
107+
manifest: { ...githubManifest, apiVersion: 1 },
108+
module: github,
109+
enabledByDefault: true,
110+
},
111+
{
112+
manifest: { ...bestieManifest, apiVersion: 1 },
113+
module: bestie,
114+
enabledByDefault: false,
115+
},
116+
{
117+
manifest: { ...inboxManifest, apiVersion: 1 },
118+
module: inbox,
119+
enabledByDefault: true,
120+
},
121+
{
122+
manifest: { ...projectsManifest, apiVersion: 1 },
123+
module: projects,
124+
enabledByDefault: true,
125+
},
126+
{
127+
manifest: { ...agentsManifest, apiVersion: 1 },
128+
module: agents,
129+
enabledByDefault: true,
130+
},
131+
{
132+
manifest: { ...workflowsManifest, apiVersion: 1 },
133+
module: workflows,
134+
enabledByDefault: true,
135+
},
136+
{
137+
manifest: { ...sessionsManifest, apiVersion: 1 },
138+
module: sessions,
139+
enabledByDefault: true,
140+
},
141+
{
142+
manifest: { ...hostedManifest, apiVersion: 1 },
143+
module: hosted,
144+
enabledByDefault: true,
145+
},
146+
{
147+
manifest: { ...moderationManifest, apiVersion: 1 },
148+
module: moderation,
149+
enabledByDefault: true,
150+
},
75151
];

0 commit comments

Comments
 (0)