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

Permissions in 0.1.4

  • 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

search.ts2.6 KB
// The Browse tab's reads: the categories and the search. Only the newest
// search writes the list, so answers that arrive out of order never mix.
import * as Effect from "effect/Effect";
import { Host, parse } from "divergence/effect";
import { MarketState } from "./state.ts";
import { messageOf } from "./logic.ts";
import { categoriesSchema, searchAnswerSchema } from "./remote.ts";

export const browseReads = Effect.fn("Market.browseReads")(function* (redraw: () => void) {
  const state = yield* MarketState;
  const host = yield* Host;

  const loadCategories = Effect.fn("Market.loadCategories")(function* () {
    const raw = yield* host.call("host/market.categories", {}).pipe(Effect.catch(() => Effect.succeed(null)));
    if (raw === null) {
      // An older or unreachable registry: the built-in list stays.
      console.warn("market: the categories could not be read: the registry did not answer");
    } else {
      const parsed = categoriesSchema.safeParse(raw);
      if (parsed.success && parsed.data.categories.length) state.categories = parsed.data.categories;
      else console.warn("market: the categories could not be read: the answer did not parse");
    }
    redraw();
  });

  // More pages ask for the words of the list on screen, not what the field
  // holds now. Only the newest search writes its answer: one answered
  // after a later search started is dropped.
  let searchGeneration = 0;
  const search = Effect.fn("Market.search")(function* (more = false) {
    const generation = ++searchGeneration;
    const query = more ? state.searched : state.query.trim();
    state.searching = true;
    state.searchError = null;
    redraw();
    const page = more ? state.pageNo + 1 : 1;
    yield* host
      .call("host/market.search", {
        query,
        category: state.category ?? undefined,
        sort: state.sort || undefined,
        page,
      })
      .pipe(
        Effect.flatMap((raw) => parse("market search", searchAnswerSchema, raw)),
        Effect.tap((answer) =>
          Effect.sync(() => {
            if (generation !== searchGeneration) return;
            state.results = more ? [...(state.results ?? []), ...(answer.results ?? [])] : (answer.results ?? []);
            state.total = answer.total ?? state.results.length;
            state.pageNo = page;
            state.searched = query;
          }),
        ),
        Effect.catch((error) =>
          Effect.sync(() => {
            if (generation === searchGeneration) state.searchError = messageOf(error);
          }),
        ),
      );
    if (generation !== searchGeneration) return;
    state.searching = false;
    redraw();
  });

  return { loadCategories, search };
});

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.