Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/buzz-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,11 @@ available rather than silently discarding it.
the confirmation offers another attempt. A Bestie on another device has no
Bestie tab on this one. A hosted Bestie whose provider holds its instructions
(Builderlab does) has the tab and can use **Remembers you**; hosted agents
cannot use Bestie's Attention check-ins.
cannot use Bestie's Attention check-ins. While the Usage plugin is on, the
tab's **Cost** row shows an estimate of what a local Bestie's sessions on
this computer cost over the last 7 days, with **Open Usage**. It is not a
bill, and it says when the agent's type reports no usage or the agent runs
elsewhere. With Usage off there is no Cost row.
- An agent running on this device can also show, change or remove your Bestie
when you ask it to. It saves to this device and your account, as the menu
does, and accepts only your agents you can tag in this community. It also
Expand Down
176 changes: 139 additions & 37 deletions src/bundled/bestie/BestieTab.test.tsx

Large diffs are not rendered by default.

40 changes: 37 additions & 3 deletions src/bundled/bestie/BestieTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type {
AgentAddedTab,
Agents,
} from "../../features/agents/service";
import type { Navigation } from "../../features/navigation/controller";
import type { SettingsCards } from "../../features/settings/service";
import { useRelayConnection } from "../../features/relay/react";
import type { RelayData } from "../../features/relay/service";
import type { RelaySession } from "../../features/relay/session";
Expand All @@ -23,6 +25,7 @@ import { PreferenceRow } from "../../shared/design-system/ui/PreferenceRow";
import { SettingsGroup } from "../../shared/design-system/ui/SettingsGroup";
import { SwitchPreferenceRow } from "../../shared/design-system/ui/SwitchPreferenceRow";
import { bestieName, useBestieChoice } from "../agents/BestieChoice";
import { CostRow } from "./CostRow";
import {
FEATURES,
type Feature,
Expand All @@ -48,9 +51,15 @@ import { inCommunity, savedBestie } from "./saved";

/** The agents a tab saves to, and finds to know which are remote. */
type TabAgents = FeatureAgents & Pick<Agents, "find">;
type TabCards = Pick<SettingsCards, "subscribe" | "has">;

/** The Bestie tab, on the agent saved as Bestie in its community. */
export function bestieTab(relay: RelayData, agents: TabAgents): AgentAddedTab {
export function bestieTab(
relay: RelayData,
agents: TabAgents,
navigation: Pick<Navigation, "open">,
settingsCards: TabCards,
): AgentAddedTab {
const bestie = savedBestie(relay);
return {
id: "bestie",
Expand All @@ -62,7 +71,13 @@ export function bestieTab(relay: RelayData, agents: TabAgents): AgentAddedTab {
inCommunity(agent, relay.snapshot()),
subscribe: bestie.subscribe,
component: ({ agent }) => (
<BestieTab relay={relay} agents={agents} agent={agent} />
<BestieTab
relay={relay}
agents={agents}
agent={agent}
navigation={navigation}
settingsCards={settingsCards}
/>
),
};
}
Expand All @@ -74,6 +89,8 @@ export function bestieTab(relay: RelayData, agents: TabAgents): AgentAddedTab {
export function formerBestieTab(
relay: RelayData,
agents: TabAgents,
navigation: Pick<Navigation, "open">,
settingsCards: TabCards,
): AgentAddedTab {
const bestie = savedBestie(relay);
return {
Expand Down Expand Up @@ -105,7 +122,14 @@ export function formerBestieTab(
};
},
component: ({ agent }) => (
<BestieTab relay={relay} agents={agents} agent={agent} former />
<BestieTab
relay={relay}
agents={agents}
agent={agent}
navigation={navigation}
settingsCards={settingsCards}
former
/>
),
};
}
Expand Down Expand Up @@ -170,11 +194,15 @@ function BestieTab({
relay,
agents,
agent,
navigation,
settingsCards,
former = false,
}: {
relay: RelayData;
agents: TabAgents;
agent: Agent;
navigation: Pick<Navigation, "open">;
settingsCards: TabCards;
former?: boolean;
}) {
const { session, scope } = useRelayConnection(relay);
Expand Down Expand Up @@ -271,6 +299,12 @@ function BestieTab({
)}
/>
)}
<CostRow
Comment thread
rileycrane marked this conversation as resolved.
Resolved
agents={agents}
agent={agent}
open={navigation.open}
settingsCards={settingsCards}
/>
</SettingsGroup>
<InlineHeader title="Settings" />
<SettingsGroup>
Expand Down
Loading
Loading