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.5

Permissions in 0.1.5

  • 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

profile.tsx4.2 KB
// The Profile tab: an account without a username claims one first; then
// the picture, which also fills the sidebar's Options circle, the profile's
// fields as the website shows them, Save and the profile on the website.
import type { Element, ValueEvent } from "divergence";
import { PROFILE_FIELDS, accountName, profileChanges } from "./logic.ts";
import { column, fill, row } from "./parts.tsx";
import type { Ctx } from "./parts.tsx";
import type { Controller } from "./controller.ts";

const PICTURE = 64;

export function profilePage(ctx: Ctx, market: Controller): Element | null {
  const { state } = market;
  const account = state.account;
  if (!account?.signedIn) return null;
  const record = "account" in account ? account.account : undefined;
  const publisher = record?.publisher;
  if (!publisher?.name) return claimCard(ctx, market);
  const picture = "picture" in account ? account.picture : null;
  const edits = state.profileEdits;
  const changed = Object.keys(profileChanges(publisher, edits)).length > 0;
  return (
    <div {...column} gap="large">
      <div {...row} gap="large">
          {picture
                    ? <image path={picture} width={PICTURE} height={PICTURE} radius="full" />
                    : (
                      <div {...row} width={PICTURE} height={PICTURE} flexShrink={0} borderRadius="full" background="muted" justifyContent="center">
                        <icon name="user-round" tone="muted" />
                      </div>
                    )}
          <div {...column} {...fill} gap={2}>
              <text style="body" size="sm" bold>{accountName(record)}</text>
              {record?.email ? <text style="body" size="xs" tone="muted">{record.email}</text> : null}
            </div>
          <button id="profile-picture-upload" label={picture ? "Change picture…" : "Upload picture…"} small variant="outline" loading={!!state.busy.picture} onClick={() => ctx.run(market.uploadPicture())} />
          {picture ? <button id="profile-picture-remove" label="Remove" small variant="ghost" disabled={!!state.busy.picture} onClick={() => ctx.run(market.removePicture())} /> : null}
        </div>
      <div {...column} gap="medium">
          {PROFILE_FIELDS.map((field) => (
                    <div {...column} gap={4}>
                      <text style="body" size="xs" tone="muted">{field.label}</text>
                      <input id={`profile-${field.key}`} value={edits[field.key] ?? publisher[field.key] ?? ""} placeholder={field.placeholder} multiline={"multiline" in field} onChange={(e: ValueEvent<string>) => market.editProfile(field.key, e.value)} />
                    </div>
                  ))}
          <checkbox id="profile-credit-opt-out" label="Do not credit me by name when a fix of mine is merged into an official plugin" checked={edits.creditOptOut ?? !!publisher.creditOptOut} onChange={(e: ValueEvent<boolean>) => market.editProfile("creditOptOut", e.value)} />
        </div>
      <div {...row} gap="small">
          <button id="profile-save" label="Save" small variant="primary" disabled={!changed} loading={!!state.busy["profile-save"]} onClick={() => ctx.run(market.saveProfile())} />
          <button id="profile-site" label="View on the website" icon="external-link" small variant="ghost" onClick={() => ctx.run(market.openProfileSite())} />
        </div>
    </div>
  );
}

// The registry keeps a profile and a picture only for a publisher, so an
// account without a username claims one first.
function claimCard(ctx: Ctx, market: Controller): Element {
  const { state } = market;
  return (
    <div {...column} gap="small">
      <text style="body" size="sm" bold>Choose a username</text>
      <text style="body" size="xs" tone="muted">Your profile and picture need one. It names you on the marketplace.</text>
      <div {...row} gap="small">
          <div {...column} {...fill}>
              <input id="profile-claim" value={state.claimName} placeholder="2 to 39 lowercase letters, digits or -" onChange={(e: ValueEvent<string>) => market.setClaimName(e.value)} />
            </div>
          <button id="profile-claim-save" label="Claim" small variant="primary" disabled={!state.claimName.trim()} loading={!!state.busy.claim} onClick={() => ctx.run(market.claimUsername())} />
        </div>
    </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.