Versioned PRODUCT.md library + marketplace — backend (Slice 4)

Mirrors the agent-profile stack for products: ProductProfile entity (org-scoped,
versioned by org+key+version; null org = free builtin), a PRODUCT.md parser + writer,
and endpoints — upload, list, marketplace, get, publish/unpublish, fork, install, and
apply-to-product (sets Product.Identity to the profile's PRODUCT.md). Reuses the shared
ProfileOrigin/Status/Visibility enums; product profiles are gated owner-level
(CreateProductsAndTeams). Adds the product_profiles table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-15 20:40:57 +03:30
parent ad330641c3
commit bcdbc7e941
12 changed files with 1208 additions and 0 deletions
@@ -100,3 +100,28 @@ internal sealed record AgentProfileSummary(
internal sealed record AgentProfileDetail(AgentProfileSummary Profile, string Body);
internal sealed record MarketplaceProfileEntry(AgentProfileSummary Profile, bool AlreadyInLibrary);
internal sealed record UploadProductProfileRequest(Guid OrganizationId, string Content);
internal sealed record PublishProductProfileRequest(Guid OrganizationId, string Version);
internal sealed record ForkProductProfileRequest(Guid OrganizationId, string Version, string? Name = null);
internal sealed record InstallProductProfileRequest(Guid OrganizationId, Guid SourceProfileId);
internal sealed record ApplyProductProfileRequest(Guid OrganizationId, Guid ProductId, string Version);
internal sealed record ProductProfileSummary(
Guid Id,
Guid? OrganizationId,
string Origin,
string ProfileKey,
string Name,
string Version,
string? Summary,
string Visibility,
string Status);
internal sealed record ProductProfileDetail(ProductProfileSummary Profile, string Body);
internal sealed record MarketplaceProductProfileEntry(ProductProfileSummary Profile, bool AlreadyInLibrary);