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
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
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.1.6latest | Nov 21, 2026 | >=5 <6 | 71.9 KB | 6 permissions | Listed |
| 0.1.5 | Nov 18, 2026 | >=5 <6 | 71.4 KB | 6 permissions | Listed |
| 0.1.4 | Nov 16, 2026 | >=5 <6 | 70.5 KB | 6 permissions | Listed |
| 0.1.3 | Nov 11, 2026 | >=5 <6 | 62.7 KB | 6 permissions | Listed |
| 0.1.2 | Nov 9, 2026 | >=5 <6 | 57.5 KB | 6 permissions | Listed |
| 0.1.1 | Oct 27, 2026 | >=2 <4 | 46.2 KB | 6 permissions | Listed |
No comments yet.