Skip to content
Open
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: 3 additions & 3 deletions paseo-omp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ paseo plugin ls paseo-omp

Open the **OMP** sidebar to review the provider-profile contract, choose which composer pills appear, browse and edit native scalar settings, manage OMP-native plugins, verify runtime health, and generate a bounded support report under **Help**. The same tabs, including Accounts, MCPs, and Composer, are available in the workspace OMP panel, which adds a workspace-only Security tab. Then create an agent and select **OMP Plugin**; on a new install, [enable it](#plugin-provider-opt-in) and restart the daemon first. Its optional **MCP** composer control runs OMP-native management commands in the current session; setup questions and authorization stay in that chat timeline, where OAuth can open in a workspace-scoped Paseo Browser or on the current device. While OMP subagents run, a row under each `task` card in the conversation lets you steer or stop one of them; this needs OMP 18.4.9 or newer. Composer pill preferences are shared by clients connected to the same host; normal use requires no other plugin-specific settings.

Open the **Accounts** tab of the **OMP** sidebar to see the logins in OMP's own credential store with their usage and banked resets, add a login through OMP's own sign-in, sign one out, spend a banked reset, and steer OMP's balancing: prefer a login, keep part of its quota in reserve, and set what OMP does at a limit. Steering is written to OMP's own config. See [OMP accounts](docs/configuration.md#omp-accounts).
Open the **Accounts** tab of the **OMP** sidebar to see the logins in OMP's own credential store with their usage and banked resets, add a login through OMP's own sign-in, sign one out, spend a banked reset, and steer OMP's balancing: prefer a login, keep part of its quota in reserve, and set what OMP does at a limit. Each login shows plan and organization badges from its usage report, such as **Business**, **Pro Lite**, **Personal** or an organization name, and the label drops OMP's parenthesized organization once a badge shows it. Steering is written to OMP's own config. See [OMP accounts](docs/configuration.md#omp-accounts).

The quota popover groups recorded limits by provider and OMP account, showing an available recorded email or, when absent, the Copilot account ID (GitHub username) across that account's windows. Duplicate and unnamed accounts receive numbers in opaque account-key order, so changing usage does not swap their numbers; accounts are still displayed by highest usage. Duplicate-name suffixes stay visible when long emails truncate, and a lone unnamed account needs no heading. Copilot accounts also show **GitHub** or **GHE · host**, using the enterprise URL in OMP's recorded account key; unrecognized keys show neither. Only a server-side SHA-256 hash of the account key reaches the client. **CURRENT PROVIDER** identifies the session's provider, not its active account. Provider summary percentages show the highest recorded usage across that provider's accounts.
The quota popover groups recorded limits by provider and OMP account, showing an available recorded email or, when absent, the Copilot account ID (GitHub username) across that account's windows. Duplicate and unnamed accounts receive numbers in opaque account-key order, so changing usage does not swap their numbers; accounts are still displayed by highest usage, and a divider separates each account. Duplicate-name suffixes stay visible when long emails truncate, and a lone unnamed account needs no heading. Copilot accounts also show **GitHub** or **GHE · host**, using the enterprise URL in OMP's recorded account key; unrecognized keys show neither. Badges beside each account name show the plan (such as **Business** or **Pro Lite**) and organization name from OMP's cached usage report for that account; an Anthropic organization named after the account's email shows as **Personal**, and accounts without a cached plan or organization show no badge. The raw account key stays on the server, and the client receives a SHA-256 hash of it. For the session's logins the client also receives OMP's credential id, OMP's login label (the email or, without one, the raw account id, plus the organization name), whether the login is in use or the provider's only stored credential, and the hashes of the usage accounts it links to. The popover marks the login the session uses: a live OMP Plugin session answers through its OMP runtime (`get_logout_accounts`); any other OMP session, including Paseo's bundled **omp** provider, is matched through the session id Paseo stored for the agent to the pin OMP recorded (`session:sticky:<provider>:<session id>`, kept 30 days past its last use). OMP's runtime answer marks a login in use only by its identity, so a login without one, such as a Copilot login, never shows **IN USE** in a live OMP Plugin session even when the session is pinned to it. Both read the agent's own store: a named-profile agent never reads the daemon default store, and an agent Paseo cannot look up gets no account marks. That account leads the current provider marked **IN USE**, and every other login linked to recorded usage has an accent **Switch** button at the end of its name row, which sends `/session pin OAuth credential #<id>` to the session, so the switch and OMP's reply appear in the chat timeline. **Switch** is disabled while the agent runs a turn, since sending then would interrupt it and OMP does not pin while it streams. A login that is the provider's only stored credential, API keys included, shows **ONLY LOGIN** in that spot instead of **Switch**; being the only stored login does not prove use, since an environment or explicit key can still serve the session, so it gets **IN USE** only when OMP reports or recorded it. A login links to recorded usage only by OMP's identity rule: the organization must match, including being absent on both sides, then the email decides, else the account id. A login without any identity, such as a Copilot login, links to no usage, since one stored login and one usage account do not prove the usage is that login's. A login in use, or the provider's only one, that no usage row matches is still named at the top of its provider with **IN USE** or **ONLY LOGIN** and no limits; any other login without matching usage has no row, so it cannot be switched to from the popover. When two logins link to the same usage account, the one in use keeps **IN USE**. A session that has not yet sent a request to the provider has no recorded pin; its linked logins can still be switched to and **CURRENT PROVIDER** identifies only the provider. Paseo sees an OMP Plugin agent's model only as an opaque id, so the pill and popover ask the agent's live OMP session which provider that model belongs to; a closed OMP Plugin agent shows every provider until its session runs again. The composer pill shows the provider icon and the highest recorded usage of the account in use, such as **19%**; its tooltip names the provider and that account. When the account in use is unknown or has no recorded usage value, the pill shows the highest usage across the provider's accounts and its tooltip says **all accounts**. Reset countdowns a day or more away show days and hours, such as **resets 14d 21h**.

Open the **MCPs** tab of the **OMP** sidebar to list the MCP servers OMP connects to, add one by URL or command, test, enable, disable or remove it, and sign a remote server in through your browser, like **Accounts** does for logins. See [OMP MCP servers](docs/configuration.md#omp-mcp-servers).

Expand Down Expand Up @@ -67,7 +67,7 @@ At startup the plugin discovers directory names under `~/.omp/profiles/` (or `PI

Separate provider identities let the model picker request the correct profile catalog before an agent exists. Existing `omp-plugin` and bundled `omp` agents retain their provider; they are not migrated automatically. Profile names use OMP's lowercase grammar, including dotted names such as `team.prod`.

The OMP sidebar and memory panel expose an explicit store selector. Settings, plugins, quota, history, memory and diagnostics use that selection, and profile-agent popovers derive it from the provider ID. OMP-compatible XDG data and state roots are honored when a migrated profile uses them. Default-provider views are labelled **Daemon default store**; changing `providerOptions.command` on the default provider does not make those views profile-aware. Workspace configuration remains project-scoped, with the selected profile supplying inherited settings. Hub records are daemon-wide. The RPCs also accept an explicit absolute `store.agentDir` for custom stores; it is mutually exclusive with `store.profile`.
The OMP sidebar and memory panel expose an explicit store selector. Settings, plugins, quota, history, memory and diagnostics use that selection, and profile-agent popovers derive it from the provider ID. OMP-compatible XDG data and state roots are honored when a migrated profile uses them. Default-provider views are labelled **Daemon default store**, except the quota popover, which names only a profile or custom store; changing `providerOptions.command` on the default provider does not make those views profile-aware. Workspace configuration remains project-scoped, with the selected profile supplying inherited settings. Hub records are daemon-wide. The RPCs also accept an explicit absolute `store.agentDir` for custom stores; it is mutually exclusive with `store.profile`.

Profile selection is request-local: concurrent clients cannot change each other's process environment or cached results. Settings edits affect the selected store immediately.

Expand Down
85 changes: 66 additions & 19 deletions paseo-omp/client/omp-accounts-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
useToast,
} from "@getpaseo/plugin/client/ui";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { type ReactNode, useRef, useState } from "react";
import { type ReactElement, type ReactNode, useRef, useState } from "react";
import { Pressable, Text, View } from "react-native";
import {
cancelOmpAccountLogin,
Expand Down Expand Up @@ -41,6 +41,7 @@ import {
} from "./omp-accounts-state";
import type { OmpConfigStyles } from "./omp-config-styles";
import { ompStoreKey } from "./omp-store-state";
import { providerIcon } from "./provider-brand";
import { quotaResetLabel, quotaSeverityFromFraction } from "./quota-state";

type Theme = PluginSurfaceProps["theme"];
Expand Down Expand Up @@ -189,11 +190,30 @@ function AccountCard({
const reserveShown = reserveOptions(account, defaultReservePct);
const age = usageAgeLabel(account);
return (
<View style={styles.card}>
<View style={[styles.card, { flex: 1 }]}>
<View style={styles.cardHeader}>
<Text numberOfLines={1} style={[styles.cardTitle, { flexShrink: 1 }]}>
{account.label}
</Text>
<View
style={{
flexDirection: "row",
alignItems: "center",
flexWrap: "wrap",
gap: 6,
flexShrink: 1,
}}
>
{/* Cards wrap into columns away from their provider heading, so each names its own. */}
<Icon icon={providerIcon(account.provider)} size={16} color={theme.colors.foreground} />
<Text numberOfLines={1} style={[styles.cardTitle, { flexShrink: 1 }]}>
{account.label}
</Text>
{account.tags.map((tag) => (
<View key={tag} style={styles.chip}>
<Text numberOfLines={1} style={styles.chipText}>
{tag}
</Text>
</View>
))}
</View>
{account.resets ? (
<View style={styles.chip}>
<Text style={styles.chipText}>{resetsLabel(account.resets)}</Text>
Expand Down Expand Up @@ -260,6 +280,28 @@ function AccountCard({
);
}

/** Fixed account card width: wide enough for the label, badges and the reserve picker on one row. */
const ACCOUNT_CARD_WIDTH = 440;
const ACCOUNT_GRID_GAP = 10;

/**
* Fixed-width account cards that wrap, as many to a row as the page fits, instead of each card
* stretching across the page. Nothing is measured, so resizing never flips the column count back.
* A page narrower than one card shrinks the card to the page.
*/
function AccountGrid({ children }: { children: ReactElement[] }) {
return (
<View style={{ flexDirection: "row", flexWrap: "wrap", gap: ACCOUNT_GRID_GAP }}>
{children.map((child) => (
// Each wrapper takes its card's key, so a removed login never shifts another card's state.
<View key={child.key} style={{ width: ACCOUNT_CARD_WIDTH, maxWidth: "100%" }}>
{child}
</View>
))}
</View>
);
}

type SettingRow = {
path: OmpAccountsSettingPath;
label: string;
Expand Down Expand Up @@ -821,27 +863,32 @@ export function OmpAccountsSection({
) : null}
{groups.map(({ provider, accounts: logins }) => (
<View key={provider.id} style={{ gap: 8 }}>
<Text style={styles.cardTitle}>{provider.name}</Text>
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
<Icon icon={providerIcon(provider.id)} size={18} color={theme.colors.foreground} />
<Text style={styles.cardTitle}>{provider.name}</Text>
</View>
{view?.balance
.filter((preview) => preview.provider === provider.id)
.map((preview) => (
<Text key={preview.model} style={styles.collectionSummary}>
{balanceLine(preview)}
</Text>
))}
{logins.map((account) => (
<AccountCard
key={accountKey(account)}
account={account}
theme={theme}
styles={styles}
defaultReservePct={defaultReserve}
saving={steer.isPending}
onRemove={() => setPending({ kind: "remove", account })}
onRedeem={() => setPending({ kind: "reset", account })}
onSteer={(change) => steer.mutate({ kind: "account", account, ...change })}
/>
))}
<AccountGrid>
{logins.map((account) => (
<AccountCard
key={accountKey(account)}
account={account}
theme={theme}
styles={styles}
defaultReservePct={defaultReserve}
saving={steer.isPending}
onRemove={() => setPending({ kind: "remove", account })}
onRedeem={() => setPending({ kind: "reset", account })}
onSteer={(change) => steer.mutate({ kind: "account", account, ...change })}
/>
))}
</AccountGrid>
</View>
))}
{view?.installed && view.fetchedAt !== null ? (
Expand Down
31 changes: 31 additions & 0 deletions paseo-omp/client/provider-brand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { PluginIcon } from "@getpaseo/plugin/client";
import antigravitySvg from "../shared/provider-icons/antigravity.svg";
import claudeSvg from "../shared/provider-icons/claude.svg";
import codexSvg from "../shared/provider-icons/codex.svg";
import copilotSvg from "../shared/provider-icons/copilot.svg";
import grokSvg from "../shared/provider-icons/grok.svg";

// Paseo's provider brand icons are host-internal: a host icon name such as "claude" fails button
// validation and draws nothing through `Icon`. The same marks ship here as inline SVG that paints
// with `currentColor`, so the host tints them like any icon; other providers use Lucide.
const BRAND_ICONS: Record<string, PluginIcon> = {
anthropic: { svg: claudeSvg },
"antigravity-cli": { svg: antigravitySvg },
"github-copilot": { svg: copilotSvg },
"google-antigravity": { svg: antigravitySvg },
openai: { svg: codexSvg },
"openai-codex": { svg: codexSvg },
xai: { svg: grokSvg },
"xai-oauth": { svg: grokSvg },
};

const LUCIDE_ICONS: Record<string, string> = {
azure: "Cloud",
cursor: "MousePointer2",
};

/** The provider's brand mark when known, else the Lucide icon closest to it, else a gauge. */
export function providerIcon(provider: string | null): PluginIcon {
if (!provider) return "Gauge";
return BRAND_ICONS[provider] ?? LUCIDE_ICONS[provider] ?? "Gauge";
}
5 changes: 3 additions & 2 deletions paseo-omp/client/provider-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { PluginButtonIconProps } from "@getpaseo/plugin/client";
import { Icon } from "@getpaseo/plugin/client/ui";
import type { ComponentType } from "react";
import { View } from "react-native";
import { type QuotaSeverity, quotaProviderIconName } from "./quota-state";
import { providerIcon } from "./provider-brand";
import type { QuotaSeverity } from "./quota-state";

export function quotaProviderIcon(
provider: string | null,
Expand All @@ -19,7 +20,7 @@ export function quotaProviderIcon(
: color;
return (
<View style={{ width: size, height: size, alignItems: "center", justifyContent: "center" }}>
<Icon name={quotaProviderIconName(provider)} size={size} color={severityColor} />
<Icon icon={providerIcon(provider)} size={size} color={severityColor} />
</View>
);
}
Expand Down
Loading
Loading