Skip to main content

Agent

The agents table in marketplace-fleapoai-service holds every agent's catalog listing. It is not a runtime — see Architecture.

Schema

ColumnTypeNotes
idUUIDPrimary key
nametextHuman-readable name
slugtext, uniqueURL slug; immutable after publish
descriptiontextMarketing description (detail page hero)
longDescriptiontext, nullableMulti-paragraph body copy
taglinetextOne-sentence pitch
iconUrltext, nullableCDN-hosted icon
photoUrlstext[]Screenshots gallery
statusenumdraft | active | coming_soon | inactive
featuredboolHomepage placement
isNewboolRenders the "New" badge
productDomaintext, nullableAgent's frontend URL (used to validate returnUrl on checkout)
docsUrltext, nullableOutbound link to agent's docs
changelogUrltext, nullableOutbound link
oauthClientIdtext, uniqueReference into better-auth oauthClient row
redirectUristext[]OAuth allow-list; mirrored into oauthClient
createdByUUIDauth.user.id of admin who created
publishedAttimestamptz, nullableSet when status flips to active
createdAt, updatedAttimestamptz

Lifecycle

status controls visibility and OAuth client enablement. See Publishing & approval.

DTO

type AgentDto = {
id: string;
slug: string;
name: string;
tagline: string;
description: string;
longDescription: string | null;
iconUrl: string | null;
photoUrls: string[];
status: "draft" | "active" | "coming_soon" | "inactive";
featured: boolean;
isNew: boolean;
publishedAt: string | null;
productDomain: string | null;
docsUrl: string | null;
changelogUrl: string | null;
oauthClientId: string;
redirectUris: string[];

capabilities: CapabilityDto[];
steps: StepDto[];
changelog: ChangelogEntryDto[];
trustSignals: string[];
tags: TagDto[];

rating: number | null; // 1-decimal avg, null if reviewCount === 0
reviewCount: number;
installs: number;

createdBy: string;
createdAt: string;
updatedAt: string;
};

The frontend converts this to a leaner Agent shape via toDisplayAgent() in src/data/agents.ts.

Endpoints

VerbPathGuard
GET/agentspublic, paginated
GET/agents/:idpublic
GET/agents/by-slug/:slugpublic
POST/agentsplatform_admin
POST/agents/:idplatform_admin
DELETE/agents/:idplatform_admin
POST/agents/:id/demo-requestbearer

See API Reference for full schemas.

Identity bridge

When you POST /agents, the service:

  1. Inserts the agents row.
  2. Creates a better-auth oauthClient row (type public, tokenEndpointAuthMethod: 'none', PKCE-S256 enforced).
  3. Mirrors redirectUris from the agent row to the client row.
  4. Returns the new oauthClientId.

On POST /agents/:id with a changed redirectUris[], the mirror is updated.

This is the only linkage between the catalog row and the OIDC client. There is no agent-side "key" issued by the marketplace beyond this.