Official

market

The plugin marketplace: browse, install through an agent's scan, update and publish plugins, and the marketplace tools of agents in the Plugins workspace.

The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/market@0.1.3

Permissions in 0.1.3

  • Marketplace marketOfficial onlyUses the marketplace APIs. Only official plugins can have it.Search, read, install, update and publish marketplace plugins, and sign in to the marketplace
  • Manage plugins plugins.manageOfficial onlyReloads and enables plugins. Only official plugins can have it.Ask for the enable card of a plugin an agent installed
  • Control chats chats.controlHighCreates chats, sends prompts and cancels runs.Open the chat in the Plugins workspace where an agent scans, installs or updates a plugin
  • Provide agent tools tools.provideMediumGives tools to agents.Give agents in the Plugins workspace the marketplace tools
  • Read chats chats.readMediumReads your transcripts and chat lists.Find the agent, model and effort last used in the Plugins workspace
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Show the marketplace pageSlots: center

Files

parts.tsx4.1 KB
// What the marketplace's views share: layout shortcuts, the badge, and the
// agent, model and effort menus that the install row, the Updates tab and
// the bug report form all show.
import * as kit from "divergence";
import type { Element, ValueEvent } from "divergence";
import type { EffectViewContext } from "divergence/effect";
import { effortChoices, optionOf } from "./logic.ts";
import type { Menus } from "./state.ts";
import type { Controller } from "./controller.ts";

// Layout for the templates: a flex column, a row that centres its children
// across, a child that takes the free space, the whole parent, a centred
// reading column, and something clickable.
export const column = { display: "flex", flexDirection: "column" } as const;
export const row = { display: "flex", flexDirection: "row", alignItems: "center" } as const;
export const fill = { flexGrow: 1, flexShrink: 1, flexBasis: "0%", minWidth: 0, minHeight: 0 } as const;
export const full = { width: "100%", height: "100%" } as const;
export const reading = { maxWidth: 880, width: "100%", marginX: "auto" } as const;
export const clickable = { group: "hover" } as const;
// The fine outline that keeps a picture's edge on a surface of its tone
// (DESIGN.md §3); an older runtime has no constant.
export const EDGED = kit.EDGED ?? { elevation: "edge" };

export type Ctx = EffectViewContext<object>;

export function badge(text: string, variant: "default" | "info" | "success" | "warning" | "danger"): Element {
  return <badge variant={variant}>{text}</badge>;
}

export function menus(ctx: Ctx, market: Controller): Element | null {
  const m: Menus | null = market.state.menus;
  if (!m)
    return <div {...row} gap="small"><spinner /><text style="body" size="xs" tone="muted">Loading agents…</text></div>;
  if (!m.agents.length)
    return <text style="body" size="xs" tone="warning">{m.error ?? "Enable an agent in Settings > Agents to scan plugins."}</text>;
  const models = optionOf(m.options, "model");
  const efforts = effortChoices(m.options, m.choice.model);
  const pick = (
    id: string,
    value: string | null,
    options: readonly { readonly value: string; readonly label: string; readonly svg?: string }[],
    onChange: (value: string) => void,
    width: number,
  ): Element =>
    (
      <div {...row} maxWidth={width}>
        <select id={id} value={value ?? ""} small options={options} onChange={(e: ValueEvent<string>) => onChange(e.value)} />
      </div>
    );
  const picks = (
    <div {...row} gap="small" flexWrap="wrap">
      {pick(
            "market-agent",
            m.choice.agentId,
            m.agents.map((a) => ({ value: a.id, label: a.name, svg: a.icon })),
            (value) => ctx.run(market.chooseAgent(value)),
            190,
          )}
      {models?.choices?.length
              ? pick(
                  "market-model",
                  m.choice.model,
                  models.choices.map((c) => ({ value: c.value, label: c.name, svg: c.icon })),
                  (value) => market.chooseModel(value),
                  220,
                )
              : null}
      {efforts.length
              ? pick(
                  "market-effort",
                  m.choice.effort,
                  efforts.map((c) => ({ value: c.value, label: c.name })),
                  (value) => market.chooseEffort(value),
                  130,
                )
              : null}
    </div>
  );
  if (!m.error) return picks;
  return <div {...column} gap={4}>{picks}<text style="body" size="xs" tone="warning">{m.error}</text></div>;
}

// A quiet text link (a mark and a label) whose mark sits on the edge it
// starts from: its hover fill reaches into the gutter instead of pushing
// the mark in, as a ghost button's padding would.
export function textLink(id: string, icon: string, label: string, onClick: () => unknown, tooltip?: string): Element {
  return (
    <div id={id} role="button" {...row} {...clickable} cursor="pointer" gap={6} height={24} paddingX={6} marginX={-6} borderRadius="sm" hover={{ background: "hover" }} tooltip={tooltip} onClick={onClick}>
      <icon name={icon} small tone="muted" />
      <text style="body" size="xs" tone="muted">{label}</text>
    </div>
  );
}

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.1.6latestNov 21, 2026>=5 <671.9 KB6 permissionsListed
0.1.5Nov 18, 2026>=5 <671.4 KB6 permissionsListed
0.1.4Nov 16, 2026>=5 <670.5 KB6 permissionsListed
0.1.3Nov 11, 2026>=5 <662.7 KB6 permissionsListed
0.1.2Nov 9, 2026>=5 <657.5 KB6 permissionsListed
0.1.1Oct 27, 2026>=2 <446.2 KB6 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.