@buildinternet/releases-api-types 0.59.0 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +14 -6
  2. package/dist/api-types.d.ts +1168 -0
  3. package/dist/api-types.d.ts.map +1 -0
  4. package/dist/api-types.js +134 -0
  5. package/dist/schemas/account-profile.d.ts +29 -0
  6. package/dist/schemas/account-profile.d.ts.map +1 -0
  7. package/dist/schemas/account-profile.js +24 -0
  8. package/dist/schemas/ai-models.d.ts +67 -0
  9. package/dist/schemas/ai-models.d.ts.map +1 -0
  10. package/{src/schemas/ai-models.ts → dist/schemas/ai-models.js} +25 -31
  11. package/dist/schemas/api-keys.d.ts +71 -0
  12. package/dist/schemas/api-keys.d.ts.map +1 -0
  13. package/dist/schemas/api-keys.js +32 -0
  14. package/dist/schemas/classifications.d.ts +134 -0
  15. package/dist/schemas/classifications.d.ts.map +1 -0
  16. package/dist/schemas/classifications.js +96 -0
  17. package/dist/schemas/collections.d.ts +605 -0
  18. package/dist/schemas/collections.d.ts.map +1 -0
  19. package/dist/schemas/collections.js +320 -0
  20. package/dist/schemas/datasets.d.ts +34 -0
  21. package/dist/schemas/datasets.d.ts.map +1 -0
  22. package/dist/schemas/datasets.js +11 -0
  23. package/dist/schemas/errors.d.ts +43 -0
  24. package/dist/schemas/errors.d.ts.map +1 -0
  25. package/dist/schemas/errors.js +61 -0
  26. package/dist/schemas/feedback.d.ts +134 -0
  27. package/dist/schemas/feedback.d.ts.map +1 -0
  28. package/dist/schemas/feedback.js +76 -0
  29. package/dist/schemas/follows.d.ts +154 -0
  30. package/dist/schemas/follows.d.ts.map +1 -0
  31. package/dist/schemas/follows.js +42 -0
  32. package/dist/schemas/listing.d.ts +374 -0
  33. package/dist/schemas/listing.d.ts.map +1 -0
  34. package/dist/schemas/listing.js +175 -0
  35. package/dist/schemas/lookups.d.ts +285 -0
  36. package/dist/schemas/lookups.d.ts.map +1 -0
  37. package/{src/schemas/lookups.ts → dist/schemas/lookups.js} +67 -80
  38. package/dist/schemas/marketing-classifier.d.ts +32 -0
  39. package/dist/schemas/marketing-classifier.d.ts.map +1 -0
  40. package/{src/schemas/marketing-classifier.ts → dist/schemas/marketing-classifier.js} +14 -18
  41. package/dist/schemas/orgs.d.ts +950 -0
  42. package/dist/schemas/orgs.d.ts.map +1 -0
  43. package/dist/schemas/orgs.js +473 -0
  44. package/dist/schemas/overviews.d.ts +205 -0
  45. package/dist/schemas/overviews.d.ts.map +1 -0
  46. package/{src/schemas/overviews.ts → dist/schemas/overviews.js} +41 -54
  47. package/dist/schemas/products.d.ts +595 -0
  48. package/dist/schemas/products.d.ts.map +1 -0
  49. package/{src/schemas/products.ts → dist/schemas/products.js} +113 -136
  50. package/dist/schemas/publish-tokens.d.ts +55 -0
  51. package/dist/schemas/publish-tokens.d.ts.map +1 -0
  52. package/{src/schemas/publish-tokens.ts → dist/schemas/publish-tokens.js} +18 -29
  53. package/dist/schemas/recommendations.d.ts +52 -0
  54. package/dist/schemas/recommendations.d.ts.map +1 -0
  55. package/dist/schemas/recommendations.js +58 -0
  56. package/dist/schemas/related.d.ts +331 -0
  57. package/dist/schemas/related.d.ts.map +1 -0
  58. package/dist/schemas/related.js +115 -0
  59. package/dist/schemas/releases.d.ts +623 -0
  60. package/dist/schemas/releases.d.ts.map +1 -0
  61. package/dist/schemas/releases.js +414 -0
  62. package/dist/schemas/resolve.d.ts +259 -0
  63. package/dist/schemas/resolve.d.ts.map +1 -0
  64. package/{src/schemas/resolve.ts → dist/schemas/resolve.js} +2 -5
  65. package/dist/schemas/search.d.ts +475 -0
  66. package/dist/schemas/search.d.ts.map +1 -0
  67. package/dist/schemas/search.js +258 -0
  68. package/dist/schemas/semantic-alert-summary.d.ts +54 -0
  69. package/dist/schemas/semantic-alert-summary.d.ts.map +1 -0
  70. package/dist/schemas/semantic-alert-summary.js +57 -0
  71. package/dist/schemas/semantic-alerts.d.ts +41 -0
  72. package/dist/schemas/semantic-alerts.d.ts.map +1 -0
  73. package/dist/schemas/semantic-alerts.js +42 -0
  74. package/dist/schemas/shared.d.ts +247 -0
  75. package/dist/schemas/shared.d.ts.map +1 -0
  76. package/dist/schemas/shared.js +248 -0
  77. package/dist/schemas/site-notice.d.ts +35 -0
  78. package/dist/schemas/site-notice.d.ts.map +1 -0
  79. package/{src/schemas/site-notice.ts → dist/schemas/site-notice.js} +14 -18
  80. package/dist/schemas/sitemap.d.ts +97 -0
  81. package/dist/schemas/sitemap.d.ts.map +1 -0
  82. package/dist/schemas/sitemap.js +107 -0
  83. package/dist/schemas/sources.d.ts +1145 -0
  84. package/dist/schemas/sources.d.ts.map +1 -0
  85. package/dist/schemas/sources.js +645 -0
  86. package/dist/schemas/stats.d.ts +82 -0
  87. package/dist/schemas/stats.d.ts.map +1 -0
  88. package/dist/schemas/stats.js +59 -0
  89. package/dist/schemas/taxonomy.d.ts +344 -0
  90. package/dist/schemas/taxonomy.d.ts.map +1 -0
  91. package/{src/schemas/taxonomy.ts → dist/schemas/taxonomy.js} +47 -58
  92. package/dist/schemas/webhooks.d.ts +618 -0
  93. package/dist/schemas/webhooks.d.ts.map +1 -0
  94. package/dist/schemas/webhooks.js +191 -0
  95. package/dist/schemas/well-known.d.ts +302 -0
  96. package/dist/schemas/well-known.d.ts.map +1 -0
  97. package/dist/schemas/well-known.js +192 -0
  98. package/dist/schemas/workspace-integrations.d.ts +27 -0
  99. package/dist/schemas/workspace-integrations.d.ts.map +1 -0
  100. package/dist/schemas/workspace-integrations.js +22 -0
  101. package/package.json +16 -5
  102. package/src/api-types.ts +0 -2229
  103. package/src/schemas/account-profile.ts +0 -28
  104. package/src/schemas/ai-models.test.ts +0 -29
  105. package/src/schemas/classifications.ts +0 -109
  106. package/src/schemas/collections.ts +0 -346
  107. package/src/schemas/datasets.ts +0 -31
  108. package/src/schemas/errors.test.ts +0 -55
  109. package/src/schemas/errors.ts +0 -81
  110. package/src/schemas/feedback.ts +0 -56
  111. package/src/schemas/listing.ts +0 -226
  112. package/src/schemas/orgs.ts +0 -533
  113. package/src/schemas/recommendations.ts +0 -39
  114. package/src/schemas/related.ts +0 -126
  115. package/src/schemas/releases.ts +0 -449
  116. package/src/schemas/search.ts +0 -274
  117. package/src/schemas/semantic-alert-summary.ts +0 -65
  118. package/src/schemas/shared.notice.test.ts +0 -36
  119. package/src/schemas/shared.ts +0 -267
  120. package/src/schemas/site-notice.test.ts +0 -67
  121. package/src/schemas/sitemap.ts +0 -117
  122. package/src/schemas/sources.ts +0 -674
  123. package/src/schemas/stats.ts +0 -62
  124. package/src/schemas/well-known.test.ts +0 -264
  125. package/src/schemas/well-known.ts +0 -252
  126. package/src/schemas/workspace-integrations.ts +0 -26
@@ -0,0 +1,1168 @@
1
+ /**
2
+ * Shared API response types — single source of truth for the wire protocol.
3
+ * Consumed by: web frontend, MCP worker, OSS CLI, and the API worker.
4
+ */
5
+ import type { z } from "zod";
6
+ export type { SourceType, SourceDiscovery, SourceFetchPriority, } from "@buildinternet/releases-core/source-enums";
7
+ import type { SourceType, SourceFetchPriority } from "@buildinternet/releases-core/source-enums";
8
+ import type { UserApiKey } from "./schemas/api-keys.js";
9
+ import type { SEMANTIC_ALERT_CANDIDATE_POOL } from "./schemas/semantic-alerts.js";
10
+ import type { UserWebhookListItem, WorkspaceMemberRole } from "./schemas/webhooks.js";
11
+ export { SEMANTIC_ALERT_MAX_PER_USER, SEMANTIC_ALERT_QUERY_MAX_CHARS, SEMANTIC_ALERT_THRESHOLD_DEFAULT, SEMANTIC_ALERT_THRESHOLD_MIN, SEMANTIC_ALERT_THRESHOLD_MAX, SEMANTIC_ALERT_CANDIDATE_POOL, SemanticAlertCreateBodySchema, SemanticAlertUpdateBodySchema, type SemanticAlertCreateBody, type SemanticAlertUpdateBody, } from "./schemas/semantic-alerts.js";
12
+ import type { BreakingLevel } from "@buildinternet/releases-core/breaking";
13
+ import type { AiLaneIdSchema, AiLaneModelsPutSchema, AiLaneStateSchema, OpenRouterCatalogModelSchema, AiLaneModelsResponseSchema } from "./schemas/ai-models.js";
14
+ import type { MarketingClassifierThresholdPutSchema, MarketingFilteredSourceSchema, MarketingClassifierStateSchema } from "./schemas/marketing-classifier.js";
15
+ import type { MediaItemSchema, PaginationSchema, StatsSchema, ReleaseTypeSchema, ReleaseCompositionSchema, ReleaseItemSchema, ReleaseSummaryItemSchema, OverviewPageItemSchema, OverviewCitationSchema, OrgStatusSchema, ReleaseLocationItemSchema } from "./schemas/shared.js";
16
+ import type { OrgListItemSchema, OrgListResponseSchema, OrgAccountItemSchema, OrgAccountsResponseSchema, OrgTagsResponseSchema, CreateOrgBodySchema, UpdateOrgBodySchema, SetOrgAvatarBodySchema, SetOrgAvatarResponseSchema, OrgDetailSchema, OrgCatalogItemSchema, OrgCatalogResponseSchema, OrgCollectionsResponseSchema, AddOrgAccountBodySchema, IgnoredUrlItemSchema, OrgIgnoredUrlsResponseSchema, AddIgnoredUrlBodySchema, AddIgnoredUrlResponseSchema, DeleteIgnoredUrlResponseSchema, OrgTagsBodySchema, OrgTagsMutationResponseSchema, CreateTagBodySchema, TagRowSchema, OrgActivityResponseSchema, OrgHeatmapResponseSchema, OrgSparklinesResponseSchema, OrgReleaseItemSchema, OrgFeedPaginationSchema, OrgReleasesFeedResponseSchema, OrgRecentReleaseItemSchema, OrgRecentReleasesResponseSchema, DeleteOrgAccountResponseSchema } from "./schemas/orgs.js";
17
+ import type { UploadAvatarResponseSchema, WorkspaceProfileFieldsSchema, PatchWorkspaceProfileBodySchema, WorkspaceProfileResponseSchema } from "./schemas/account-profile.js";
18
+ import type { UploadsIntegrationStatusSchema, UploadsOAuthConnectResponseSchema, UploadsOAuthCallbackBodySchema, UploadsOAuthCallbackResponseSchema } from "./schemas/workspace-integrations.js";
19
+ import type { SourceListItemSchema, SourceWithOrgSchema, SourceListResponseSchema, SourceListResultSchema, SourceDetailSchema, SourceFeedPaginationSchema, SourceReleasesResponseSchema, SourceMutationResponseSchema, AppStoreMaterializeResponseSchema, SourceOrgRefSchema, SourcePatchInputSchema, CreateSourceBodySchema, ChangelogFileSummarySchema, SourceChangelogResponseSchema, SourceActivityResponseSchema, SourceHeatmapResponseSchema, SourceKnownReleaseItemSchema, SourceKnownReleasesResponseSchema, SourceRecentReleasesResponseSchema, SourceSessionsResponseSchema, SourceSummaryRowSchema, SourceSummariesResponseSchema, CreateSourceSummaryBodySchema, CreateSourceSummaryResponseSchema, SourceFetchResponseSchema, SourceContentHashResponseSchema, SourceContentHashBodySchema, ChangelogTokensResponseSchema, SourceMetadataResponseSchema, ChangelogProbeResponseSchema, DeleteSourceResponseSchema, DeleteSourceReleasesResponseSchema, InsertReleaseResponseSchema, BatchReleasesResponseSchema, BatchReleaseInputSchema, BatchReleasesBodySchema, RawSnapshotResponseSchema, OversizedChangelogFileRowSchema, OversizedChangelogFilesResponseSchema, FetchableSourcesResponseSchema, FeedSourcesResponseSchema, ChangedSourcesResponseSchema } from "./schemas/sources.js";
20
+ import type { ProductRowSchema, ProductCreateResponseSchema, ProductListItemSchema, ProductListResponseSchema, ProductDetailSourceSchema, ProductDetailSchema, CreateProductBodySchema, UpdateProductBodySchema, AdoptProductBodySchema, ProductAdoptResultSchema, ProductAdoptDryRunSchema, ProductAdoptResponseSchema, ProductDeleteResponseSchema, ProductTagsListResponseSchema, ProductTagsBodySchema, ProductTagsMutationResponseSchema, ProductActivityResponseSchema, ProductHeatmapResponseSchema } from "./schemas/products.js";
21
+ import type { ReleaseLatestSourceSchema, ReleaseLatestProductSchema, ReleaseLatestItemSchema, ReleaseLatestResponseSchema, ReleaseCoverageSiblingSchema, ReleaseCoverageRowSchema, ReleaseCoverageResponseSchema, LinkReleaseCoverageBodySchema, LinkReleaseCoverageResponseSchema, UnlinkReleaseCoverageResponseSchema, ReleaseWithMediaRowSchema, ReleasesWithMediaResponseSchema, ReleaseDetailOrgSchema, ReleaseDetailResponseSchema, ReleaseUrlConflictDetailsSchema, UpdateReleaseBodySchema, ReleasePatchResponseSchema, ReleaseDeleteResponseSchema, ReleaseBatchDeleteBodySchema, ReleaseBatchDeleteResponseSchema, ReleaseSuppressResponseSchema, ReleaseUnsuppressResponseSchema, ReleaseSuppressBodySchema, ReleaseBatchSuppressBodySchema, ReleaseBatchSuppressResponseSchema, ReleaseStreamMessageSchema } from "./schemas/releases.js";
22
+ import type { LookupStatusSchema, LookupBodySchema, LookupSourceSchema, LookupReleaseSchema, LookupRelatedOrgSchema, LookupResponseSchema, LookupSourceBySlugResponseSchema, LookupProductBySlugResponseSchema, DomainLookupOrgSchema, DomainLookupProductSchema, DomainLookupResponseSchema } from "./schemas/lookups.js";
23
+ import type { SearchOrgHitSchema, SearchCatalogHitSchema, SearchSourceHitSchema, SearchReleaseHitSchema, SearchChunkHitSchema, SearchCollectionHitSchema, LookupResultPayloadSchema, UnifiedSearchResponseSchema } from "./schemas/search.js";
24
+ import type { TaxonomyOrgSchema, TaxonomyProductSchema, CategoryListItemSchema, CategoryListResponseSchema, CategoryDetailSchema, UpdateCategoryRequestSchema, UpdateCategoryResponseSchema, CategoryFeedPaginationSchema, CategoryReleasesResponseSchema, TagDetailSchema } from "./schemas/taxonomy.js";
25
+ import type { StatsSourceActivitySchema, StatsRecentActivitySchema, StatsResponseSchema } from "./schemas/stats.js";
26
+ import type { FeedbackTypeSchema, FeedbackStatusSchema, FeedbackItemSchema, FeedbackListResponseSchema, FeedbackUpdateBodySchema, FeedbackDeleteResponseSchema, FeedbackSubmitBodySchema, FeedbackSubmitResponseSchema } from "./schemas/feedback.js";
27
+ import type { ClassificationSummarySchema, ClassificationRecentResponseSchema, ClassificationRecentItemSchema } from "./schemas/classifications.js";
28
+ import type { SemanticAlertSummarySchema } from "./schemas/semantic-alert-summary.js";
29
+ import type { RecommendationNotifyAddedBodySchema, RecommendationNotifyAddedResultSchema, RecommendationSubmitBodySchema, RecommendationSubmitResponseSchema } from "./schemas/recommendations.js";
30
+ import type { SitemapSourceSchema, SitemapPayloadSchema, SitemapReleaseSchema, SitemapReleasesPayloadSchema } from "./schemas/sitemap.js";
31
+ import type { RelatedScopeSchema, RelatedReleaseThumbnailSchema, RelatedReleaseSourceSchema, RelatedReleaseItemSchema, RelatedSourceItemSchema, RelatedReleasesOkResponseSchema, RelatedReleasesDegradedResponseSchema, RelatedReleasesResponseSchema, RelatedSourcesOkResponseSchema, RelatedSourcesDegradedResponseSchema, RelatedSourcesResponseSchema } from "./schemas/related.js";
32
+ import type { CollectionMemberOrgSchema, ProductParentOrgSchema, CollectionMemberProductSchema, CollectionMemberSchema, CollectionListItemSchema, CollectionListResponseSchema, CollectionDetailSchema, CollectionReleaseItemSchema, CollectionFeedPaginationSchema, CollectionReleasesResponseSchema, CollectionRowSchema, CreateCollectionRequestSchema, UpdateCollectionRequestSchema, CollectionMemberInputSchema, AddCollectionMemberRequestSchema, ReplaceCollectionMembersRequestSchema, ResolvedCollectionMemberSchema, ReplaceCollectionMembersResponseSchema, AddCollectionMemberResponseSchema, CollectionDailySummarySchema, CollectionDailySummariesResponseSchema, CollectionWeeklyDigestListItemSchema, CollectionWeeklyDigestsResponseSchema, DigestCoveredReleaseSchema, DigestSectionSchema, CollectionWeeklyDigestDetailSchema } from "./schemas/collections.js";
33
+ import type { OrgOverviewResponseSchema, IncomingOverviewCitationSchema, RegenerateOverviewBodySchema, RegenerateOverviewResponseSchema, ProductOverviewResponseSchema, OverviewInputsCheckResponseSchema, OverviewInputsFullResponseSchema, OverviewInputsResponseSchema, PlaybookResponseSchema, UpdatePlaybookNotesBodySchema, UpdatePlaybookNotesResponseSchema } from "./schemas/overviews.js";
34
+ export { MediaItemSchema, PaginationSchema, ListResponseSchema, StatsSchema, ReleaseTypeSchema, ReleaseCompositionSchema, ReleaseItemSchema, ReleaseSummaryItemSchema, OverviewPageItemSchema, OverviewCitationSchema, OrgStatusSchema, ReleaseLocationItemSchema, CategorySchema, NoticeSchema, } from "./schemas/shared.js";
35
+ export { SiteNoticeSchema, SiteNoticeResponseSchema } from "./schemas/site-notice.js";
36
+ export { AiLaneIdSchema, AiLaneModelsPutSchema, AiLaneStateSchema, OpenRouterCatalogModelSchema, AiLaneModelsResponseSchema, } from "./schemas/ai-models.js";
37
+ export { MarketingClassifierThresholdPutSchema, MarketingFilteredSourceSchema, MarketingClassifierStateSchema, MARKETING_THRESHOLD_MIN, MARKETING_THRESHOLD_MAX, } from "./schemas/marketing-classifier.js";
38
+ export { OrgListItemSchema, OrgListResponseSchema, OrgAccountItemSchema, OrgAccountsResponseSchema, OrgTagsResponseSchema, CreateOrgBodySchema, UpdateOrgBodySchema, SetOrgAvatarBodySchema, SetOrgAvatarResponseSchema, OrgDetailSchema, OrgCatalogItemSchema, OrgCatalogResponseSchema, OrgCollectionsResponseSchema, AddOrgAccountBodySchema, IgnoredUrlItemSchema, OrgIgnoredUrlsResponseSchema, AddIgnoredUrlBodySchema, AddIgnoredUrlResponseSchema, DeleteIgnoredUrlResponseSchema, OrgTagsBodySchema, OrgTagsMutationResponseSchema, CreateTagBodySchema, TagRowSchema, OrgActivityResponseSchema, OrgHeatmapResponseSchema, OrgSparklinesResponseSchema, OrgReleaseItemSchema, OrgFeedPaginationSchema, OrgReleasesFeedResponseSchema, OrgRecentReleaseItemSchema, OrgRecentReleasesResponseSchema, DeleteOrgAccountResponseSchema, } from "./schemas/orgs.js";
39
+ export { UploadAvatarResponseSchema, WorkspaceProfileFieldsSchema, PatchWorkspaceProfileBodySchema, WorkspaceProfileResponseSchema, } from "./schemas/account-profile.js";
40
+ export { UploadsIntegrationStatusSchema, UploadsOAuthConnectResponseSchema, UploadsOAuthCallbackBodySchema, UploadsOAuthCallbackResponseSchema, } from "./schemas/workspace-integrations.js";
41
+ export { CreateStubOrgBodySchema, StubFromDomainBodySchema, ReleasesJsonConfigSchema, ReleasesJsonDomainReleaseSchema, ReleasesJsonDomainSchema, ReleasesJsonProductSchema, ReleasesJsonRegistriesSchema, ReleasesJsonRepoProductSchema, ReleasesJsonRepoReleaseSchema, ReleasesJsonRepoSchema, SyncWellKnownResponseSchema, } from "./schemas/well-known.js";
42
+ export type { CreateStubOrgBody, StubFromDomainBody, ReleasesJsonConfig, ReleasesJsonDomain, ReleasesJsonDomainRelease, ReleasesJsonProduct, ReleasesJsonRepo, ReleasesJsonRepoRelease, } from "./schemas/well-known.js";
43
+ export { ListingValidateBodySchema, ListingActivateBodySchema, ListingIssueSchema, ListingSetupStepSchema, ListingLocationSchema, ListingOrgPointerSchema, ListingValidationResultSchema, ListingActivateResultSchema, ListingClaimBodySchema, ListingClaimVerifyBodySchema, OrgClaimStatusSchema, ClaimMethodSchema, OrgClaimSchema, ClaimCheckOutcomeSchema, ClaimVerifyResultSchema, ListingClaimsResultSchema, AdminOrgClaimSchema, ListOrgClaimsResponseSchema, RevokeOrgClaimBodySchema, ListingPromoteBodySchema, ListingPromoteLocatorOutcomeSchema, ListingPromoteLocatorSchema, ListingPromoteResultSchema, ListingCapabilitiesSchema, type ListingValidateBody, type ListingActivateBody, type ListingIssue, type ListingSetupStep, type ListingLocation, type ListingValidationResult, type ListingActivateResult, type ListingClaimBody, type ListingClaimVerifyBody, type OrgClaimStatus, type ClaimMethod, type OrgClaim, type ClaimCheckOutcome, type ClaimVerifyResult, type ListingClaimsResult, type AdminOrgClaim, type ListOrgClaimsResponse, type RevokeOrgClaimBody, type ListingPromoteBody, type ListingPromoteLocatorOutcome, type ListingPromoteLocator, type ListingPromoteResult, type ListingCapabilities, } from "./schemas/listing.js";
44
+ export { CreatePublishTokenBodySchema, CreatedPublishTokenSchema, PublishTokenSchema, ListPublishTokensResponseSchema, RevokePublishTokenResponseSchema, type CreatePublishTokenBody, type CreatedPublishToken, type PublishToken, type ListPublishTokensResponse, type RevokePublishTokenResponse, } from "./schemas/publish-tokens.js";
45
+ export { UserApiKeySchema, CreatedUserApiKeySchema, ListUserApiKeysResponseSchema, CreateUserApiKeyBodySchema, RevokeUserApiKeyResponseSchema, type UserApiKey, type CreatedUserApiKey, type ListUserApiKeysResponse, type CreateUserApiKeyBody, type RevokeUserApiKeyResponse, } from "./schemas/api-keys.js";
46
+ export { FollowTargetSchema, FollowSchema, FollowsListResponseSchema, FollowRequestSchema, FollowMutationResponseSchema, PersonalizedFeedPaginationSchema, PersonalizedFeedResponseSchema, type FollowTarget, type Follow, type FollowsListResponse, type FollowRequest, type FollowMutationResponse, type PersonalizedFeedPagination, type PersonalizedFeedResponse, } from "./schemas/follows.js";
47
+ export { WebhookDeliveryHealthSchema, UserWebhookScopeSchema, UserWebhookReleaseTypeFilterSchema, UserWebhookFormatSchema, UserWebhookSubscriptionSchema, UserWebhookDeliveryHealthSchema, UserWebhookListItemSchema, UserWebhookListResponseSchema, CreateUserWebhookResponseSchema, RotateUserWebhookSecretResponseSchema, TestUserWebhookResponseSchema, WorkspaceMemberRoleSchema, WorkspaceWebhookSubscriptionSchema, WorkspaceWebhookListItemSchema, WorkspaceWebhookListResponseSchema, CreateWorkspaceWebhookResponseSchema, CreateUserWebhookBodySchema, CreateWorkspaceWebhookBodySchema, UserWebhookSchema, WorkspaceWebhookSchema, UpdateWebhookBodySchema, WebhookDeliveryRowSchema, WebhookDeliveriesResponseSchema, type WebhookDeliveryHealth, type UserWebhookScope, type UserWebhookReleaseTypeFilter, type UserWebhookFormat, type UserWebhookSubscription, type UserWebhookDeliveryHealth, type UserWebhookListItem, type UserWebhookListResponse, type CreateUserWebhookResponse, type RotateUserWebhookSecretResponse, type TestUserWebhookResponse, type WorkspaceMemberRole, type WorkspaceWebhookSubscription, type WorkspaceWebhookListItem, type WorkspaceWebhookListResponse, type CreateWorkspaceWebhookResponse, type CreateUserWebhookBody, type CreateWorkspaceWebhookBody, type UserWebhook, type WorkspaceWebhook, type UpdateWebhookBody, type WebhookDeliveryRow, type WebhookDeliveriesResponse, } from "./schemas/webhooks.js";
48
+ export { SourceListItemSchema, SourceWithOrgSchema, SourceListResponseSchema, SourceListResultSchema, SourceDetailSchema, SourceFeedPaginationSchema, SourceReleasesResponseSchema, SourceMutationResponseSchema, AppStoreMaterializeResponseSchema, SourceOrgRefSchema, SourcePatchInputSchema, CreateSourceBodySchema, ChangelogFileSummarySchema, SourceChangelogResponseSchema, SourceActivityResponseSchema, SourceHeatmapResponseSchema, SourceKnownReleaseItemSchema, SourceKnownReleasesResponseSchema, SourceRecentReleasesResponseSchema, SourceSessionsResponseSchema, SourceSummaryRowSchema, SourceSummariesResponseSchema, CreateSourceSummaryBodySchema, CreateSourceSummaryResponseSchema, SourceFetchResponseSchema, SourceContentHashResponseSchema, SourceContentHashBodySchema, ChangelogTokensResponseSchema, SourceMetadataResponseSchema, ChangelogProbeResponseSchema, DeleteSourceResponseSchema, DeleteSourceReleasesResponseSchema, InsertReleaseResponseSchema, BatchReleasesResponseSchema, BatchReleaseInputSchema, BatchReleasesBodySchema, RawSnapshotResponseSchema, OversizedChangelogFileRowSchema, OversizedChangelogFilesResponseSchema, FetchableSourcesResponseSchema, FeedSourcesResponseSchema, ChangedSourcesResponseSchema, } from "./schemas/sources.js";
49
+ export { ProductRowSchema, ProductCreateResponseSchema, ProductListItemSchema, ProductListResponseSchema, ProductDetailSourceSchema, ProductDetailSchema, CreateProductBodySchema, UpdateProductBodySchema, AdoptProductBodySchema, ProductAdoptResultSchema, ProductAdoptDryRunSchema, ProductAdoptResponseSchema, ProductDeleteResponseSchema, ProductTagsListResponseSchema, ProductTagsBodySchema, ProductTagsMutationResponseSchema, ProductActivityResponseSchema, ProductHeatmapResponseSchema, } from "./schemas/products.js";
50
+ export { LookupStatusSchema, LookupBodySchema, LookupSourceSchema, LookupReleaseSchema, LookupRelatedOrgSchema, LookupResponseSchema, LookupSourceBySlugResponseSchema, LookupProductBySlugResponseSchema, DomainLookupOrgSchema, DomainLookupProductSchema, DomainLookupResponseSchema, } from "./schemas/lookups.js";
51
+ export { TaxonomyOrgSchema, TaxonomyProductSchema, CategoryListItemSchema, CategoryListResponseSchema, CategoryDetailSchema, UpdateCategoryRequestSchema, UpdateCategoryResponseSchema, CategoryReleaseItemSchema, CategoryFeedPaginationSchema, CategoryReleasesResponseSchema, TagDetailSchema, } from "./schemas/taxonomy.js";
52
+ export { ReleaseLatestSourceSchema, ReleaseLatestProductSchema, ReleaseLatestItemSchema, ReleaseLatestResponseSchema, ReleaseCoverageSiblingSchema, ReleaseCoverageRowSchema, ReleaseCoverageResponseSchema, LinkReleaseCoverageBodySchema, LinkReleaseCoverageResponseSchema, UnlinkReleaseCoverageResponseSchema, ReleaseWithMediaRowSchema, ReleasesWithMediaResponseSchema, ReleaseDetailOrgSchema, ReleaseDetailResponseSchema, ReleaseUrlConflictDetailsSchema, UpdateReleaseBodySchema, ReleasePatchResponseSchema, ReleaseDeleteResponseSchema, ReleaseBatchDeleteBodySchema, ReleaseBatchDeleteResponseSchema, ReleaseSuppressResponseSchema, ReleaseUnsuppressResponseSchema, ReleaseSuppressBodySchema, ReleaseBatchSuppressBodySchema, ReleaseBatchSuppressResponseSchema, ReleaseStreamMessageSchema, } from "./schemas/releases.js";
53
+ export { SearchOrgHitSchema, SearchCatalogHitSchema, SearchSourceHitSchema, SearchReleaseHitSchema, SearchChunkHitSchema, SearchCollectionHitSchema, LookupResultPayloadSchema, UnifiedSearchResponseSchema, } from "./schemas/search.js";
54
+ export { StatsSourceActivitySchema, StatsRecentActivitySchema, StatsResponseSchema, } from "./schemas/stats.js";
55
+ export { FeedbackTypeSchema, FeedbackStatusSchema, FeedbackItemSchema, FeedbackListResponseSchema, FeedbackUpdateBodySchema, FeedbackDeleteResponseSchema, FeedbackSubmitBodySchema, FeedbackSubmitResponseSchema, FEEDBACK_MESSAGE_MIN_CHARS, FEEDBACK_MESSAGE_MAX_CHARS, FEEDBACK_CONTACT_MAX_CHARS, } from "./schemas/feedback.js";
56
+ export { ClassificationSummarySchema, ClassificationRecentResponseSchema, ClassificationRecentItemSchema, } from "./schemas/classifications.js";
57
+ export { SemanticAlertSummarySchema } from "./schemas/semantic-alert-summary.js";
58
+ export { RecommendationNotifyAddedBodySchema, RecommendationNotifyAddedResultSchema, RecommendationSubmitBodySchema, RecommendationSubmitResponseSchema, RECOMMENDATION_URL_MAX_CHARS, RECOMMENDATION_NOTE_MAX_CHARS, RECOMMENDATION_CONTACT_EMAIL_MAX_CHARS, } from "./schemas/recommendations.js";
59
+ export { SitemapSourceSchema, SitemapPayloadSchema, SitemapReleaseSchema, SitemapReleasesPayloadSchema, } from "./schemas/sitemap.js";
60
+ export { errorEnvelopeSchema, decodeApiError, isApiError } from "./schemas/errors.js";
61
+ export type { ErrorEnvelope, DecodedApiError } from "./schemas/errors.js";
62
+ export { RelatedScopeSchema, RelatedReleaseThumbnailSchema, RelatedReleaseSourceSchema, RelatedReleaseItemSchema, RelatedSourceItemSchema, RelatedReleasesOkResponseSchema, RelatedReleasesDegradedResponseSchema, RelatedReleasesResponseSchema, RelatedSourcesOkResponseSchema, RelatedSourcesDegradedResponseSchema, RelatedSourcesResponseSchema, } from "./schemas/related.js";
63
+ export { CollectionMemberOrgSchema, ProductParentOrgSchema, CollectionMemberProductSchema, CollectionMemberSchema, CollectionListItemSchema, CollectionListResponseSchema, CollectionDetailSchema, CollectionReleaseItemSchema, CollectionFeedPaginationSchema, CollectionReleasesResponseSchema, CollectionRowSchema, CreateCollectionRequestSchema, UpdateCollectionRequestSchema, CollectionMemberInputSchema, AddCollectionMemberRequestSchema, ReplaceCollectionMembersRequestSchema, ResolvedCollectionMemberSchema, ReplaceCollectionMembersResponseSchema, AddCollectionMemberResponseSchema, CollectionDailySummarySchema, CollectionDailySummariesResponseSchema, CollectionWeeklyDigestListItemSchema, CollectionWeeklyDigestsResponseSchema, DigestCoveredReleaseSchema, DigestSectionSchema, CollectionWeeklyDigestDetailSchema, } from "./schemas/collections.js";
64
+ export { OrgOverviewResponseSchema, IncomingOverviewCitationSchema, RegenerateOverviewBodySchema, RegenerateOverviewResponseSchema, ProductOverviewResponseSchema, OverviewInputsCheckResponseSchema, OverviewInputsFullResponseSchema, OverviewInputsResponseSchema, PlaybookResponseSchema, UpdatePlaybookNotesBodySchema, UpdatePlaybookNotesResponseSchema, } from "./schemas/overviews.js";
65
+ export { ResolveResponseSchema } from "./schemas/resolve.js";
66
+ export type { ResolveResponse } from "./schemas/resolve.js";
67
+ export type MediaItem = z.infer<typeof MediaItemSchema>;
68
+ export type AiLaneId = z.infer<typeof AiLaneIdSchema>;
69
+ export type AiLaneModelsPut = z.infer<typeof AiLaneModelsPutSchema>;
70
+ export type AiLaneState = z.infer<typeof AiLaneStateSchema>;
71
+ export type OpenRouterCatalogModel = z.infer<typeof OpenRouterCatalogModelSchema>;
72
+ export type AiLaneModelsResponse = z.infer<typeof AiLaneModelsResponseSchema>;
73
+ export type MarketingClassifierThresholdPut = z.infer<typeof MarketingClassifierThresholdPutSchema>;
74
+ export type MarketingFilteredSource = z.infer<typeof MarketingFilteredSourceSchema>;
75
+ export type MarketingClassifierState = z.infer<typeof MarketingClassifierStateSchema>;
76
+ export type OrgStatus = z.infer<typeof OrgStatusSchema>;
77
+ export type ReleaseLocationItem = z.infer<typeof ReleaseLocationItemSchema>;
78
+ export type Stats = z.infer<typeof StatsSchema>;
79
+ export type Pagination = z.infer<typeof PaginationSchema>;
80
+ export interface ListResponse<T> {
81
+ items: T[];
82
+ pagination: Pagination;
83
+ }
84
+ export type SitemapSource = z.infer<typeof SitemapSourceSchema>;
85
+ export type SitemapPayload = z.infer<typeof SitemapPayloadSchema>;
86
+ /** @deprecated The `GET /v1/sitemap/releases` endpoint was retired in #2219. */
87
+ export type SitemapRelease = z.infer<typeof SitemapReleaseSchema>;
88
+ /** @deprecated The `GET /v1/sitemap/releases` endpoint was retired in #2219. */
89
+ export type SitemapReleasesPayload = z.infer<typeof SitemapReleasesPayloadSchema>;
90
+ export type RelatedScope = z.infer<typeof RelatedScopeSchema>;
91
+ export type RelatedReleaseThumbnail = z.infer<typeof RelatedReleaseThumbnailSchema>;
92
+ export type RelatedReleaseSource = z.infer<typeof RelatedReleaseSourceSchema>;
93
+ export type RelatedReleaseItem = z.infer<typeof RelatedReleaseItemSchema>;
94
+ export type RelatedSourceItem = z.infer<typeof RelatedSourceItemSchema>;
95
+ export type RelatedReleasesOkResponse = z.infer<typeof RelatedReleasesOkResponseSchema>;
96
+ export type RelatedReleasesDegradedResponse = z.infer<typeof RelatedReleasesDegradedResponseSchema>;
97
+ export type RelatedReleasesResponse = z.infer<typeof RelatedReleasesResponseSchema>;
98
+ export type RelatedSourcesOkResponse = z.infer<typeof RelatedSourcesOkResponseSchema>;
99
+ export type RelatedSourcesDegradedResponse = z.infer<typeof RelatedSourcesDegradedResponseSchema>;
100
+ export type RelatedSourcesResponse = z.infer<typeof RelatedSourcesResponseSchema>;
101
+ export type OrgListItem = z.infer<typeof OrgListItemSchema>;
102
+ export type OrgListResponse = z.infer<typeof OrgListResponseSchema>;
103
+ export type OrgAccountItem = z.infer<typeof OrgAccountItemSchema>;
104
+ export type OrgAccountsResponse = z.infer<typeof OrgAccountsResponseSchema>;
105
+ export type OrgTagsResponse = z.infer<typeof OrgTagsResponseSchema>;
106
+ export type CreateOrgBody = z.infer<typeof CreateOrgBodySchema>;
107
+ export type UpdateOrgBody = z.infer<typeof UpdateOrgBodySchema>;
108
+ export type SetOrgAvatarBody = z.infer<typeof SetOrgAvatarBodySchema>;
109
+ export type SetOrgAvatarResponse = z.infer<typeof SetOrgAvatarResponseSchema>;
110
+ export type UploadAvatarResponse = z.infer<typeof UploadAvatarResponseSchema>;
111
+ export type WorkspaceProfileFields = z.infer<typeof WorkspaceProfileFieldsSchema>;
112
+ export type PatchWorkspaceProfileBody = z.infer<typeof PatchWorkspaceProfileBodySchema>;
113
+ export type WorkspaceProfileResponse = z.infer<typeof WorkspaceProfileResponseSchema>;
114
+ export type UploadsIntegrationStatus = z.infer<typeof UploadsIntegrationStatusSchema>;
115
+ export type UploadsOAuthConnectResponse = z.infer<typeof UploadsOAuthConnectResponseSchema>;
116
+ export type UploadsOAuthCallbackBody = z.infer<typeof UploadsOAuthCallbackBodySchema>;
117
+ export type UploadsOAuthCallbackResponse = z.infer<typeof UploadsOAuthCallbackResponseSchema>;
118
+ export type OrgDetail = z.infer<typeof OrgDetailSchema>;
119
+ export type OrgCatalogItem = z.infer<typeof OrgCatalogItemSchema>;
120
+ export type OrgCatalogResponse = z.infer<typeof OrgCatalogResponseSchema>;
121
+ export type OrgCollectionsResponse = z.infer<typeof OrgCollectionsResponseSchema>;
122
+ export type AddOrgAccountBody = z.infer<typeof AddOrgAccountBodySchema>;
123
+ export type IgnoredUrlItem = z.infer<typeof IgnoredUrlItemSchema>;
124
+ export type OrgIgnoredUrlsResponse = z.infer<typeof OrgIgnoredUrlsResponseSchema>;
125
+ export type AddIgnoredUrlBody = z.infer<typeof AddIgnoredUrlBodySchema>;
126
+ export type AddIgnoredUrlResponse = z.infer<typeof AddIgnoredUrlResponseSchema>;
127
+ export type DeleteIgnoredUrlResponse = z.infer<typeof DeleteIgnoredUrlResponseSchema>;
128
+ export type OrgTagsBody = z.infer<typeof OrgTagsBodySchema>;
129
+ export type OrgTagsMutationResponse = z.infer<typeof OrgTagsMutationResponseSchema>;
130
+ export type CreateTagBody = z.infer<typeof CreateTagBodySchema>;
131
+ export type TagRow = z.infer<typeof TagRowSchema>;
132
+ export type OrgActivityResponse = z.infer<typeof OrgActivityResponseSchema>;
133
+ export type OrgHeatmapResponse = z.infer<typeof OrgHeatmapResponseSchema>;
134
+ export type OrgSparklinesResponse = z.infer<typeof OrgSparklinesResponseSchema>;
135
+ export type OrgReleaseItem = z.infer<typeof OrgReleaseItemSchema>;
136
+ export type OrgFeedPagination = z.infer<typeof OrgFeedPaginationSchema>;
137
+ export type OrgReleasesFeedResponse = z.infer<typeof OrgReleasesFeedResponseSchema>;
138
+ export type OrgRecentReleaseItem = z.infer<typeof OrgRecentReleaseItemSchema>;
139
+ export type OrgRecentReleasesResponse = z.infer<typeof OrgRecentReleasesResponseSchema>;
140
+ export type DeleteOrgAccountResponse = z.infer<typeof DeleteOrgAccountResponseSchema>;
141
+ export type SourceListItem = z.infer<typeof SourceListItemSchema>;
142
+ export type SourceWithOrg = z.infer<typeof SourceWithOrgSchema>;
143
+ export type SourceListResponse = z.infer<typeof SourceListResponseSchema>;
144
+ export type SourceListResult = z.infer<typeof SourceListResultSchema>;
145
+ export type SourcePatchInput = z.infer<typeof SourcePatchInputSchema>;
146
+ export type CreateSourceBody = z.infer<typeof CreateSourceBodySchema>;
147
+ export type ChangelogFileSummary = z.infer<typeof ChangelogFileSummarySchema>;
148
+ export type SourceChangelogResponse = z.infer<typeof SourceChangelogResponseSchema>;
149
+ export type SourceDetail = z.infer<typeof SourceDetailSchema>;
150
+ export type SourceFeedPagination = z.infer<typeof SourceFeedPaginationSchema>;
151
+ export type SourceMutationResponse = z.infer<typeof SourceMutationResponseSchema>;
152
+ export type AppStoreMaterializeResponse = z.infer<typeof AppStoreMaterializeResponseSchema>;
153
+ export type SourceOrgRef = z.infer<typeof SourceOrgRefSchema>;
154
+ export type SourceActivityResponse = z.infer<typeof SourceActivityResponseSchema>;
155
+ export type SourceHeatmapResponse = z.infer<typeof SourceHeatmapResponseSchema>;
156
+ export type SourceKnownReleaseItem = z.infer<typeof SourceKnownReleaseItemSchema>;
157
+ export type SourceKnownReleasesResponse = z.infer<typeof SourceKnownReleasesResponseSchema>;
158
+ export type SourceRecentReleasesResponse = z.infer<typeof SourceRecentReleasesResponseSchema>;
159
+ export type SourceSessionsResponse = z.infer<typeof SourceSessionsResponseSchema>;
160
+ export type SourceSummaryRow = z.infer<typeof SourceSummaryRowSchema>;
161
+ export type SourceSummariesResponse = z.infer<typeof SourceSummariesResponseSchema>;
162
+ export type CreateSourceSummaryBody = z.infer<typeof CreateSourceSummaryBodySchema>;
163
+ export type CreateSourceSummaryResponse = z.infer<typeof CreateSourceSummaryResponseSchema>;
164
+ export type SourceFetchResponse = z.infer<typeof SourceFetchResponseSchema>;
165
+ export type SourceContentHashResponse = z.infer<typeof SourceContentHashResponseSchema>;
166
+ export type SourceContentHashBody = z.infer<typeof SourceContentHashBodySchema>;
167
+ export type ChangelogTokensResponse = z.infer<typeof ChangelogTokensResponseSchema>;
168
+ export type SourceMetadataResponse = z.infer<typeof SourceMetadataResponseSchema>;
169
+ export type ChangelogProbeResponse = z.infer<typeof ChangelogProbeResponseSchema>;
170
+ export type DeleteSourceResponse = z.infer<typeof DeleteSourceResponseSchema>;
171
+ export type DeleteSourceReleasesResponse = z.infer<typeof DeleteSourceReleasesResponseSchema>;
172
+ export type InsertReleaseResponse = z.infer<typeof InsertReleaseResponseSchema>;
173
+ export type BatchReleasesResponse = z.infer<typeof BatchReleasesResponseSchema>;
174
+ export type BatchReleaseInput = z.infer<typeof BatchReleaseInputSchema>;
175
+ export type BatchReleasesBody = z.infer<typeof BatchReleasesBodySchema>;
176
+ export type RawSnapshotResponse = z.infer<typeof RawSnapshotResponseSchema>;
177
+ export type OversizedChangelogFileRow = z.infer<typeof OversizedChangelogFileRowSchema>;
178
+ export type OversizedChangelogFilesResponse = z.infer<typeof OversizedChangelogFilesResponseSchema>;
179
+ export type FetchableSourcesResponse = z.infer<typeof FetchableSourcesResponseSchema>;
180
+ export type FeedSourcesResponse = z.infer<typeof FeedSourcesResponseSchema>;
181
+ export type ChangedSourcesResponse = z.infer<typeof ChangedSourcesResponseSchema>;
182
+ export interface OrgsRollupRow {
183
+ /** Org slug, or "—" for sources without an org. */
184
+ orgSlug: string;
185
+ sourceCount: number;
186
+ /** Sources with no release on file or `latestDate` older than `staleDays`. */
187
+ staleCount: number;
188
+ /** Most-recent release across all of the org's sources, or null. */
189
+ mostRecentRelease: string | null;
190
+ mostRecentAgeDays: number | null;
191
+ /** True iff every source in the org is stale (and the org has at least one source). */
192
+ allStale: boolean;
193
+ }
194
+ export interface OrgsRollupResponse extends ListResponse<OrgsRollupRow> {
195
+ meta: {
196
+ /** Stale cutoff used server-side, in days. */
197
+ staleDays: number;
198
+ totalOrgs: number;
199
+ /** Orgs where every source is stale. */
200
+ dormantOrgs: number;
201
+ /** Orgs with at least one stale source. */
202
+ anyStaleOrgs: number;
203
+ };
204
+ }
205
+ /**
206
+ * A source whose recent fetch history is all errors with no reachability — a
207
+ * candidate for pausing. "Stuck" means: within the last `window` non-`dry_run`
208
+ * fetch attempts, every one was an `error` (zero `success`/`no_change`) and
209
+ * there were at least `minAttempts` of them.
210
+ *
211
+ * This keys off the `fetch_log` error streak rather than
212
+ * `sources.consecutive_errors`, because the scrape/agent fetch path never bumps
213
+ * that column (a source can fail for days with `consecutive_errors = 0`).
214
+ */
215
+ export interface StuckSource {
216
+ sourceId: string;
217
+ sourceSlug: string;
218
+ name: string;
219
+ type: SourceType;
220
+ url: string;
221
+ kind: string | null;
222
+ orgSlug: string | null;
223
+ orgName: string | null;
224
+ /** Current fetch tier — `paused` rows only appear when `includePaused`. */
225
+ fetchPriority: SourceFetchPriority;
226
+ /** True when this is the org's primary changelog (Firebase's was). */
227
+ isPrimary: boolean;
228
+ isHidden: boolean;
229
+ /** Non-`dry_run` attempts examined in the window (all errors when stuck). */
230
+ recentAttempts: number;
231
+ /**
232
+ * Failed or degraded attempts (`error`, `crawl_timeout`, `blocked`) among the
233
+ * examined attempts (equals `recentAttempts` when stuck).
234
+ */
235
+ recentErrors: number;
236
+ /** Most-recent fetch attempt timestamp (ISO), or null. */
237
+ lastAttemptAt: string | null;
238
+ /** Most-recent error message. */
239
+ lastError: string | null;
240
+ /** Most-recent error category, when the fetcher classified it. */
241
+ lastErrorCategory: string | null;
242
+ /** Last time the source was reachable (`success`/`no_change`), ISO; null = never. */
243
+ lastSuccessAt: string | null;
244
+ /** `sources.last_fetched_at` — null when the source has never fetched. */
245
+ lastFetchedAt: string | null;
246
+ /** When the source row was created (ISO) — proxy for how long it's failed. */
247
+ sourceCreatedAt: string | null;
248
+ }
249
+ export interface StuckSourcesResponse extends ListResponse<StuckSource> {
250
+ meta: {
251
+ /** Recent non-`dry_run` attempts examined per source. */
252
+ window: number;
253
+ /** Minimum attempts in the window required to flag a source. */
254
+ minAttempts: number;
255
+ /** Whether already-paused sources were included. */
256
+ includePaused: boolean;
257
+ };
258
+ }
259
+ /**
260
+ * A source flagged as "overdue for evaluation" — `sources.last_fetched_at`
261
+ * (written on every successful check, including `no_change`) is older than
262
+ * the health scan's threshold, or null. This is deliberately independent of
263
+ * release recency: a source can be perfectly healthy (actively checked, just
264
+ * quiet) while its latest release is months old, and conversely every source
265
+ * can look quiet-but-fine by release date while the thing that checks them —
266
+ * ingest, extraction, the AI provider — has silently stopped running. See the
267
+ * 2026-07-23 spend-cap outage (#2168): `last_fetched_at` froze across every
268
+ * affected source for six days while nothing else changed.
269
+ */
270
+ export interface ProviderHealthSource {
271
+ sourceId: string;
272
+ sourceSlug: string;
273
+ name: string;
274
+ type: SourceType;
275
+ orgSlug: string | null;
276
+ orgName: string | null;
277
+ fetchPriority: SourceFetchPriority;
278
+ isPrimary: boolean;
279
+ /** `sources.last_fetched_at` — null when the source has never been fetched successfully. */
280
+ lastFetchedAt: string | null;
281
+ /** Days since `lastFetchedAt` (or since the source was created, if never fetched). */
282
+ daysSinceFetched: number;
283
+ }
284
+ export interface ProviderHealthResponse extends ListResponse<ProviderHealthSource> {
285
+ meta: {
286
+ /** A source is "overdue" once its last successful check exceeds this many days. */
287
+ overdueThresholdDays: number;
288
+ /** Active (non-paused, non-deleted) sources considered by the scan. */
289
+ totalActiveSources: number;
290
+ /** Sources whose last successful check is older than the threshold, or never. */
291
+ overdueSources: number;
292
+ /** Distinct orgs with at least one overdue source. */
293
+ overdueOrgs: number;
294
+ /** Distinct orgs represented among active sources. */
295
+ totalOrgs: number;
296
+ /**
297
+ * Active sources that should still be polling but whose SourceActor mirror
298
+ * is unmanaged / missing `nextAlarmAt` (#2286). Independent of overdue
299
+ * last-check — a freshly fetched source can still have a dead alarm.
300
+ */
301
+ unmanagedActors: number;
302
+ };
303
+ }
304
+ /**
305
+ * Release type — mirrors `RELEASE_TYPES` in `@buildinternet/releases-core/schema`.
306
+ * Optional on the wire so older API responses (mid-deploy or pinned old workers)
307
+ * degrade gracefully — consumers that see `undefined` should treat it as `"feature"`.
308
+ */
309
+ export type ReleaseType = z.infer<typeof ReleaseTypeSchema>;
310
+ export type ReleaseItem = z.infer<typeof ReleaseItemSchema>;
311
+ export type ReleaseComposition = z.infer<typeof ReleaseCompositionSchema>;
312
+ /**
313
+ * One entry in a {@link WhatsChangedResponse} — a release in the requested
314
+ * upgrade range; a slim, release-derived projection. `breaking`/`migrationNotes`
315
+ * come from #1696 (`"unknown"` until classified or for non-dev-facing kinds).
316
+ */
317
+ export interface WhatsChangedEntry {
318
+ version: string | null;
319
+ publishedAt: string | null;
320
+ /** AI-generated title when present, else the raw release title. */
321
+ title: string | null;
322
+ summary: string | null;
323
+ breaking: BreakingLevel;
324
+ migrationNotes: string | null;
325
+ /** Original source URL. Primary citation link; prefer this over `webUrl`. */
326
+ url: string | null;
327
+ /**
328
+ * releases.sh detail page — the slugged `/release/<id>-<slug>` form (#1906),
329
+ * built from `WEB_BASE_URL`. Secondary to `url` (the original source).
330
+ */
331
+ webUrl: string | null;
332
+ }
333
+ /**
334
+ * Response of `GET /v1/whats-changed` (#1697, upgrade intelligence Phase 1) —
335
+ * the changelog entries in the half-open version range `(from, to]` for a
336
+ * package (`from` exclusive, `to` inclusive). `status: "unknown"` (still
337
+ * HTTP 200 — a valid answer, not an error) when the package can't be resolved
338
+ * read-only from the catalog (e.g. an npm/PyPI name absent until #1345).
339
+ * `entries` are ordered oldest→newest; a range wider than the token budget is
340
+ * truncated (newest entries kept), flagged by `truncated` + `truncatedAtTokens`.
341
+ */
342
+ export interface WhatsChangedResponse {
343
+ status: "resolved" | "unknown";
344
+ package: string;
345
+ ecosystem: "npm" | "pypi" | "github" | null;
346
+ from: string;
347
+ to: string;
348
+ source: {
349
+ sourceId: string;
350
+ sourceSlug: string;
351
+ orgSlug: string;
352
+ } | null;
353
+ entries: WhatsChangedEntry[];
354
+ count: number;
355
+ truncated: boolean;
356
+ truncatedAtTokens?: number;
357
+ }
358
+ export interface ReleaseDetail {
359
+ id: string;
360
+ sourceId: string;
361
+ version: string | null;
362
+ title: string;
363
+ content: string;
364
+ /** AI-generated summary (#852, renamed in #860). Nullable — most rows unpopulated. */
365
+ summary: string | null;
366
+ /**
367
+ * AI-generated self-contained news-headline form of the release (#852,
368
+ * renamed in #860). Nullable because most rows are unpopulated — fall
369
+ * back to `title` for display. `.optional()` for the same mid-deploy /
370
+ * pinned-worker reason as `type` on {@link ReleaseItem}.
371
+ */
372
+ titleGenerated?: string | null;
373
+ /** AI-generated smart-brevity headline (#852, renamed in #860). Same fallback as `titleGenerated`. */
374
+ titleShort?: string | null;
375
+ /**
376
+ * Machine-readable breaking-change level (#1696). `.optional()` for mid-deploy
377
+ * / pinned-worker tolerance; absent or `"unknown"` means not classified (the
378
+ * fail-open default). Populated live at ingest for developer-facing source
379
+ * kinds; history is `"unknown"` pending a backfill. Route population + the web
380
+ * chip are #1696 follow-ups.
381
+ */
382
+ breaking?: BreakingLevel;
383
+ /** Explicit upgrade/migration steps lifted from the body (#1696); null when the body gives none. */
384
+ migrationNotes?: string | null;
385
+ /**
386
+ * AI-scored release importance, 1 (housekeeping) to 5 (landmark). Scored at
387
+ * ingest by the release-content pass; fail-open — null/absent means not
388
+ * scored. Additive — older servers omit it.
389
+ */
390
+ importance?: number | null;
391
+ /** Original source URL. Primary citation link; `webUrl` is the releases.sh copy. */
392
+ url: string | null;
393
+ /**
394
+ * releases.sh detail-page URL (friendly form: ID + current title slug).
395
+ * Secondary to `url`. Additive — older servers omit it.
396
+ */
397
+ webUrl?: string;
398
+ media: MediaItem[];
399
+ publishedAt: string | null;
400
+ fetchedAt: string;
401
+ sourceName: string;
402
+ sourceSlug: string;
403
+ sourceType: string;
404
+ /**
405
+ * Owning org. `avatarUrl` is the resolved `organizations.avatar_url`
406
+ * (nullable; `.optional()` for mid-deploy / pinned-worker tolerance).
407
+ * `discovery` and `isHidden` are additive — older servers omit them.
408
+ */
409
+ org: {
410
+ slug: string;
411
+ name: string;
412
+ avatarUrl?: string | null;
413
+ /** How the org was created. Additive — older servers omit it. */
414
+ discovery?: "curated" | "agent" | "on_demand";
415
+ /** Whether the org is hidden from public listings. Additive — older servers omit it. */
416
+ isHidden?: boolean;
417
+ } | null;
418
+ /**
419
+ * Owning product, when the source is grouped under one (`sources.product_id`).
420
+ * `null` when ungrouped; `.optional()` so older servers that omit it still type.
421
+ */
422
+ product?: {
423
+ slug: string;
424
+ name: string;
425
+ } | null;
426
+ /** Release type. See {@link ReleaseType}. */
427
+ type?: ReleaseType;
428
+ /** Per-category item counts from the AI release-content pass. See {@link ReleaseComposition}. */
429
+ composition?: ReleaseComposition | null;
430
+ /** App Store platform + icon, present only when `sourceType === "appstore"`. */
431
+ appStore?: {
432
+ platform: "ios" | "macos";
433
+ iconUrl: string | null;
434
+ } | null;
435
+ /** Video provider tag, present only when `sourceType === "video"`. */
436
+ video?: {
437
+ provider: "youtube" | "vimeo" | "wistia";
438
+ } | null;
439
+ /**
440
+ * Whether the release's source is hidden from public listings. Additive —
441
+ * older servers omit it; treat `undefined` as `false`.
442
+ */
443
+ sourceIsHidden?: boolean;
444
+ }
445
+ export type ReleaseCoverageSibling = z.infer<typeof ReleaseCoverageSiblingSchema>;
446
+ export type ReleaseCoverageRow = z.infer<typeof ReleaseCoverageRowSchema>;
447
+ export type ReleaseCoverageResponse = z.infer<typeof ReleaseCoverageResponseSchema>;
448
+ export type LinkReleaseCoverageBody = z.infer<typeof LinkReleaseCoverageBodySchema>;
449
+ export type LinkReleaseCoverageResponse = z.infer<typeof LinkReleaseCoverageResponseSchema>;
450
+ export type UnlinkReleaseCoverageResponse = z.infer<typeof UnlinkReleaseCoverageResponseSchema>;
451
+ export type ReleaseLatestSource = z.infer<typeof ReleaseLatestSourceSchema>;
452
+ export type ReleaseLatestProduct = z.infer<typeof ReleaseLatestProductSchema>;
453
+ export type ReleaseLatestItem = z.infer<typeof ReleaseLatestItemSchema>;
454
+ export type ReleaseLatestResponse = z.infer<typeof ReleaseLatestResponseSchema>;
455
+ export type ReleaseWithMediaRow = z.infer<typeof ReleaseWithMediaRowSchema>;
456
+ export type ReleasesWithMediaResponse = z.infer<typeof ReleasesWithMediaResponseSchema>;
457
+ export type ReleaseDetailOrg = z.infer<typeof ReleaseDetailOrgSchema>;
458
+ export type ReleaseDetailResponse = z.infer<typeof ReleaseDetailResponseSchema>;
459
+ export type ReleaseUrlConflictDetails = z.infer<typeof ReleaseUrlConflictDetailsSchema>;
460
+ export type UpdateReleaseBody = z.infer<typeof UpdateReleaseBodySchema>;
461
+ export type ReleasePatchResponse = z.infer<typeof ReleasePatchResponseSchema>;
462
+ export type ReleaseDeleteResponse = z.infer<typeof ReleaseDeleteResponseSchema>;
463
+ export type ReleaseBatchDeleteBody = z.infer<typeof ReleaseBatchDeleteBodySchema>;
464
+ export type ReleaseBatchDeleteResponse = z.infer<typeof ReleaseBatchDeleteResponseSchema>;
465
+ export type ReleaseSuppressResponse = z.infer<typeof ReleaseSuppressResponseSchema>;
466
+ export type ReleaseUnsuppressResponse = z.infer<typeof ReleaseUnsuppressResponseSchema>;
467
+ export type ReleaseSuppressBody = z.infer<typeof ReleaseSuppressBodySchema>;
468
+ export type ReleaseBatchSuppressBody = z.infer<typeof ReleaseBatchSuppressBodySchema>;
469
+ export type ReleaseBatchSuppressResponse = z.infer<typeof ReleaseBatchSuppressResponseSchema>;
470
+ export type ReleaseStreamMessage = z.infer<typeof ReleaseStreamMessageSchema>;
471
+ export type ReleaseSummaryItem = z.infer<typeof ReleaseSummaryItemSchema>;
472
+ /**
473
+ * A user's personalized feed token, including the full re-revealable feed URL.
474
+ * The token is reversible (stored recoverably) because the feed serves only
475
+ * public release data and carries no PII — so the URL can be re-displayed and
476
+ * copied on any visit (see #1519 design, decision 6). One per user.
477
+ */
478
+ export interface FeedToken {
479
+ /** Absolute, tokenized Atom URL — e.g. https://api.releases.sh/v1/feed/relf_…_….atom */
480
+ feedUrl: string;
481
+ /** Non-secret public handle (for masked display). */
482
+ lookupId: string;
483
+ createdAt: string;
484
+ lastUsedAt: string | null;
485
+ }
486
+ /** `GET /v1/me/feed/token` — the token, or null if the user has none yet. */
487
+ export interface FeedTokenResponse {
488
+ token: FeedToken | null;
489
+ }
490
+ /** How often a user wants a digest email. `off` = no emails. */
491
+ export type DigestCadence = "off" | "daily" | "weekly";
492
+ /** GET /v1/me/digest response — the caller's current cadence. */
493
+ export interface DigestPrefsResponse {
494
+ cadence: DigestCadence;
495
+ }
496
+ /** PUT /v1/me/digest request body. */
497
+ export interface DigestPrefsRequest {
498
+ cadence: DigestCadence;
499
+ }
500
+ /** One collection whose weekly digest the caller gets by email (#2459). */
501
+ export interface CollectionDigestSubscription {
502
+ collectionSlug: string;
503
+ collectionName: string;
504
+ /** ISO-8601. */
505
+ createdAt: string;
506
+ }
507
+ /** GET /v1/me/collection-digests response, newest first. */
508
+ export interface CollectionDigestSubscriptionsResponse {
509
+ subscriptions: CollectionDigestSubscription[];
510
+ }
511
+ /** PUT / DELETE /v1/me/collection-digests/:slug response. Both are idempotent. */
512
+ export interface CollectionDigestSubscriptionResponse {
513
+ collectionSlug: string;
514
+ subscribed: boolean;
515
+ }
516
+ /** One saved semantic alert. Query text is returned only to the owning user. */
517
+ export interface SemanticAlert {
518
+ id: string;
519
+ query: string;
520
+ enabled: boolean;
521
+ /** Inclusive match probability in [0.50, 1.00]. Default 0.80. */
522
+ threshold: number;
523
+ /** Deliver matches by email. */
524
+ deliverEmail: boolean;
525
+ /** Deliver matches to the linked webhook. */
526
+ deliverWebhook: boolean;
527
+ /** Optional link to one of the caller's `/v1/me/webhooks` subscriptions. */
528
+ webhookSubscriptionId: string | null;
529
+ createdAt: string;
530
+ updatedAt: string;
531
+ }
532
+ /**
533
+ * Claimed-match activity for one alert (#2320). Counts are rows in
534
+ * `semantic_alert_matches` (notified matches only — below-threshold scores
535
+ * are not stored). Present on list and notifications-bootstrap rows.
536
+ */
537
+ export interface SemanticAlertActivity {
538
+ /** Matches in the last 7 days. Included in `matches30d`. */
539
+ matches7d: number;
540
+ /** Matches in the last 30 days. */
541
+ matches30d: number;
542
+ /** Newest claim, or null when the alert has never matched. */
543
+ lastMatchedAt: string | null;
544
+ /** Newest claim's release, when that row still exists. */
545
+ lastMatch: {
546
+ releaseId: string;
547
+ title: string;
548
+ /** Canonical site path, `/release/rel_…`. */
549
+ path: string;
550
+ } | null;
551
+ }
552
+ /** A list row: the saved alert plus recent match activity. */
553
+ export interface SemanticAlertListItem extends SemanticAlert {
554
+ activity: SemanticAlertActivity;
555
+ }
556
+ /** GET /v1/me/semantic-alerts. `candidatePool` is the locked v1 scope. */
557
+ export interface SemanticAlertListResponse {
558
+ alerts: SemanticAlertListItem[];
559
+ candidatePool: typeof SEMANTIC_ALERT_CANDIDATE_POOL;
560
+ maxAlerts: number;
561
+ }
562
+ /**
563
+ * GET /v1/me/settings/notifications — one-shot bootstrap for `/account/notifications`.
564
+ * Composes digest cadence + feed token + webhook list so the settings page can
565
+ * render with a single round-trip instead of three independent mounts.
566
+ * `semanticAlerts` is `null` when `semantic-alerts-enabled` is off (hide the
567
+ * section); an array, possibly empty, when the lane is on.
568
+ */
569
+ export interface NotificationSettingsResponse {
570
+ cadence: DigestCadence;
571
+ feedToken: FeedToken | null;
572
+ webhooks: UserWebhookListItem[];
573
+ semanticAlerts: SemanticAlertListItem[] | null;
574
+ }
575
+ /**
576
+ * GET /v1/me/settings/developer — one-shot bootstrap for `/account/webhooks`
577
+ * (Webhooks & API). `apiKeys` is `null` when the user-api-keys feature is off
578
+ * so the UI can hide the keys section without a separate probe.
579
+ */
580
+ export interface DeveloperSettingsResponse {
581
+ webhooks: UserWebhookListItem[];
582
+ apiKeys: UserApiKey[] | null;
583
+ }
584
+ /** GET /v1/me/workspaces — one row per workspace the caller belongs to. */
585
+ export interface MeWorkspace {
586
+ /** Better Auth organization id. */
587
+ id: string;
588
+ name: string;
589
+ slug: string;
590
+ logo: string | null;
591
+ /** Workspace membership role (`member.role`, not `user.role`). */
592
+ role: WorkspaceMemberRole;
593
+ /** The caller's active workspace (see docs/architecture/workspaces.md). */
594
+ active: boolean;
595
+ createdAt: string;
596
+ }
597
+ export interface MeWorkspacesResponse {
598
+ workspaces: MeWorkspace[];
599
+ }
600
+ export type SearchOrgHit = z.infer<typeof SearchOrgHitSchema>;
601
+ export type SearchCatalogHit = z.infer<typeof SearchCatalogHitSchema>;
602
+ export type SearchSourceHit = z.infer<typeof SearchSourceHitSchema>;
603
+ export interface RawSourceHit extends SearchSourceHit {
604
+ productName?: string;
605
+ productCategory?: string;
606
+ /** Owning org's avatar URL — folded onto the catalog hit for the byline avatar. */
607
+ orgAvatarUrl?: string | null;
608
+ /** Entity taxonomy kind from the `sources.kind` column. */
609
+ entityKind?: string | null;
610
+ }
611
+ /**
612
+ * Fold source hits into the catalog list. Sources under a matched product
613
+ * are dropped (product wins); orphan sources become `entryType: "source"`.
614
+ */
615
+ export declare function foldSourcesIntoCatalog(existingProducts: SearchCatalogHit[], rawSources: RawSourceHit[]): SearchCatalogHit[];
616
+ export type SearchReleaseHit = z.infer<typeof SearchReleaseHitSchema>;
617
+ export type SearchChunkHit = z.infer<typeof SearchChunkHitSchema>;
618
+ export type SearchCollectionHit = z.infer<typeof SearchCollectionHitSchema>;
619
+ /**
620
+ * Merge collection hits from three independent sources into one ordered,
621
+ * deduped array on the wire:
622
+ *
623
+ * 1. Direct lexical matches — name/slug/description LIKE.
624
+ * 2. Direct semantic matches — vector hit (hybrid/semantic only).
625
+ * 3. Member rollups — collections containing one of the result orgs.
626
+ *
627
+ * A direct row always wins for a given slug; member rollups attach their
628
+ * `matchedOrgSlugs` to a winning direct row so the UI keeps the "shown
629
+ * because" affordance. Within each `via` bucket, rows order by score desc
630
+ * (missing scores last) then by name.
631
+ *
632
+ * Pure: no DB, no Workers runtime. Used by both `/v1/search` and the MCP
633
+ * `search` tool so the merge stays in lockstep across surfaces.
634
+ */
635
+ export declare function mergeCollectionHits(direct: SearchCollectionHit[], semantic: SearchCollectionHit[], member: SearchCollectionHit[], limit: number): SearchCollectionHit[];
636
+ export type LookupStatus = z.infer<typeof LookupStatusSchema>;
637
+ export type LookupBody = z.infer<typeof LookupBodySchema>;
638
+ export type LookupSourceRow = z.infer<typeof LookupSourceSchema>;
639
+ export type LookupReleaseRow = z.infer<typeof LookupReleaseSchema>;
640
+ export type LookupRelatedOrg = z.infer<typeof LookupRelatedOrgSchema>;
641
+ export type LookupResponse = z.infer<typeof LookupResponseSchema>;
642
+ export type LookupSourceBySlugResponse = z.infer<typeof LookupSourceBySlugResponseSchema>;
643
+ export type LookupProductBySlugResponse = z.infer<typeof LookupProductBySlugResponseSchema>;
644
+ export type DomainLookupOrg = z.infer<typeof DomainLookupOrgSchema>;
645
+ export type DomainLookupProduct = z.infer<typeof DomainLookupProductSchema>;
646
+ export type DomainLookupResponse = z.infer<typeof DomainLookupResponseSchema>;
647
+ export type LookupResultPayload = z.infer<typeof LookupResultPayloadSchema>;
648
+ export type UnifiedSearchResponse = z.infer<typeof UnifiedSearchResponseSchema>;
649
+ export type OverviewPageItem = z.infer<typeof OverviewPageItemSchema>;
650
+ export type OverviewCitation = z.infer<typeof OverviewCitationSchema>;
651
+ /** @deprecated Use OverviewPageItem */
652
+ export type KnowledgePageItem = OverviewPageItem;
653
+ export type OrgOverviewResponse = z.infer<typeof OrgOverviewResponseSchema>;
654
+ export type IncomingOverviewCitation = z.infer<typeof IncomingOverviewCitationSchema>;
655
+ export type RegenerateOverviewBody = z.infer<typeof RegenerateOverviewBodySchema>;
656
+ export type RegenerateOverviewResponse = z.infer<typeof RegenerateOverviewResponseSchema>;
657
+ export type ProductOverviewResponse = z.infer<typeof ProductOverviewResponseSchema>;
658
+ export type OverviewInputsCheckResponse = z.infer<typeof OverviewInputsCheckResponseSchema>;
659
+ export type OverviewInputsFullResponse = z.infer<typeof OverviewInputsFullResponseSchema>;
660
+ export type OverviewInputsResponse = z.infer<typeof OverviewInputsResponseSchema>;
661
+ export type PlaybookResponse = z.infer<typeof PlaybookResponseSchema>;
662
+ export type UpdatePlaybookNotesBody = z.infer<typeof UpdatePlaybookNotesBodySchema>;
663
+ export type UpdatePlaybookNotesResponse = z.infer<typeof UpdatePlaybookNotesResponseSchema>;
664
+ export type OverviewStaleness = "missing" | "behind" | "fresh";
665
+ /**
666
+ * `opted_out` — the org has `autoGenerateContent=false`, so the overview-regen
667
+ * eligibility filter skips it regardless of staleness. Surfaced so an
668
+ * orchestrator planning a sweep doesn't queue a regen that will never run
669
+ * (#1795).
670
+ */
671
+ export type OverviewPlanAction = "missing" | "refresh" | "skip" | "opted_out";
672
+ /**
673
+ * Per-org row returned by GET /v1/admin/overviews. Designed for orchestrators
674
+ * planning a maintenance sweep — `releasesSinceOverview` is the freshness
675
+ * signal that matters, not date diff alone.
676
+ */
677
+ export interface OverviewManifestRow {
678
+ orgSlug: string;
679
+ orgName: string;
680
+ orgCreatedAt: string;
681
+ discovery: "curated" | "agent" | "on_demand";
682
+ overviewUpdatedAt: string | null;
683
+ overviewGeneratedAt: string | null;
684
+ lastContributingReleaseAt: string | null;
685
+ orgLastActivity: string | null;
686
+ releasesSinceOverview: number;
687
+ recentReleaseCount: number;
688
+ staleness: OverviewStaleness;
689
+ /**
690
+ * Whether the org is opted into automatic AI content. When `false`, the
691
+ * overview-regen cron skips it — the staleness signal alone is
692
+ * misleading without this (#1795). Older workers may omit it mid-deploy.
693
+ */
694
+ autoGenerateContent?: boolean;
695
+ /** Only populated when ?format=plan. */
696
+ action?: OverviewPlanAction;
697
+ /** Only populated when ?format=plan. */
698
+ needsFetch?: boolean;
699
+ }
700
+ export type OverviewManifestResponse = ListResponse<OverviewManifestRow>;
701
+ /**
702
+ * Lightweight pre-flight payload returned by GET /v1/orgs/:slug/overview/inputs?check=true.
703
+ * Skips the heavy release-content hydration so an orchestrator can decide whether
704
+ * to dispatch without paying for the full payload.
705
+ */
706
+ export interface OverviewInputsCheck {
707
+ orgSlug: string;
708
+ selected: number;
709
+ totalAvailable: number;
710
+ hasExistingContent: boolean;
711
+ wouldRegenerate: boolean;
712
+ windowDays: number;
713
+ }
714
+ /** @deprecated Use UnifiedSearchResponse */
715
+ export type SearchResult = SearchReleaseHit;
716
+ /** @deprecated Use UnifiedSearchResponse */
717
+ export interface SearchResponse {
718
+ query: string;
719
+ results: SearchResult[];
720
+ }
721
+ export interface WeeklyBucket {
722
+ weekStart: string;
723
+ count: number;
724
+ earliestVersion: string | null;
725
+ latestVersion: string | null;
726
+ }
727
+ /**
728
+ * @deprecated Use SourceActivityResponse (Zod-derived).
729
+ * The hand-written interface is kept for callsite compatibility — shape is identical.
730
+ */
731
+ export type SourceActivity = SourceActivityResponse;
732
+ /** @deprecated Use OrgActivityResponse */
733
+ export type OrgActivity = OrgActivityResponse;
734
+ /** @deprecated Use OrgSparklinesResponse */
735
+ export type OrgSparklines = OrgSparklinesResponse;
736
+ /** @deprecated Use OrgHeatmapResponse */
737
+ export type OrgHeatmap = OrgHeatmapResponse;
738
+ /**
739
+ * @deprecated Use SourceHeatmapResponse (Zod-derived).
740
+ * The hand-written interface is kept for callsite compatibility — shape is identical.
741
+ */
742
+ export type SourceHeatmap = SourceHeatmapResponse;
743
+ export type SourceReleasesResponse = z.infer<typeof SourceReleasesResponseSchema>;
744
+ export type ProductRow = z.infer<typeof ProductRowSchema>;
745
+ export type ProductCreateResponse = z.infer<typeof ProductCreateResponseSchema>;
746
+ export type ProductListItem = z.infer<typeof ProductListItemSchema>;
747
+ export type ProductListResponse = z.infer<typeof ProductListResponseSchema>;
748
+ export type ProductDetailSource = z.infer<typeof ProductDetailSourceSchema>;
749
+ export type ProductDetail = z.infer<typeof ProductDetailSchema>;
750
+ export type CreateProductBody = z.infer<typeof CreateProductBodySchema>;
751
+ export type UpdateProductBody = z.infer<typeof UpdateProductBodySchema>;
752
+ export type AdoptProductBody = z.infer<typeof AdoptProductBodySchema>;
753
+ export type ProductAdoptResult = z.infer<typeof ProductAdoptResultSchema>;
754
+ export type ProductAdoptDryRun = z.infer<typeof ProductAdoptDryRunSchema>;
755
+ export type ProductAdoptResponse = z.infer<typeof ProductAdoptResponseSchema>;
756
+ export type ProductDeleteResponse = z.infer<typeof ProductDeleteResponseSchema>;
757
+ export type ProductTagsListResponse = z.infer<typeof ProductTagsListResponseSchema>;
758
+ export type ProductTagsBody = z.infer<typeof ProductTagsBodySchema>;
759
+ export type ProductTagsMutationResponse = z.infer<typeof ProductTagsMutationResponseSchema>;
760
+ export type ProductActivityResponse = z.infer<typeof ProductActivityResponseSchema>;
761
+ export type ProductHeatmapResponse = z.infer<typeof ProductHeatmapResponseSchema>;
762
+ export type TaxonomyOrg = z.infer<typeof TaxonomyOrgSchema>;
763
+ export type TaxonomyProduct = z.infer<typeof TaxonomyProductSchema>;
764
+ export type CategoryDetail = z.infer<typeof CategoryDetailSchema>;
765
+ export type CategoryListItem = z.infer<typeof CategoryListItemSchema>;
766
+ export type CategoryListResponse = z.infer<typeof CategoryListResponseSchema>;
767
+ export type UpdateCategoryRequest = z.infer<typeof UpdateCategoryRequestSchema>;
768
+ export type UpdateCategoryResponse = z.infer<typeof UpdateCategoryResponseSchema>;
769
+ export type CategoryFeedPagination = z.infer<typeof CategoryFeedPaginationSchema>;
770
+ export type CategoryReleasesResponse = z.infer<typeof CategoryReleasesResponseSchema>;
771
+ export type TagDetail = z.infer<typeof TagDetailSchema>;
772
+ /**
773
+ * Aggregated release feed row for a category rollup — same wire shape as
774
+ * `CollectionReleaseItem` (both surfaces use `formatAggregateReleaseRow` in
775
+ * `apps/api/src/utils.ts`). Aliased rather than duplicated so renderers
776
+ * can treat them as one.
777
+ */
778
+ export type CategoryReleaseItem = CollectionReleaseItem;
779
+ export type CollectionMemberOrg = z.infer<typeof CollectionMemberOrgSchema>;
780
+ export type ProductParentOrg = z.infer<typeof ProductParentOrgSchema>;
781
+ export type CollectionMemberProduct = z.infer<typeof CollectionMemberProductSchema>;
782
+ export type CollectionMember = z.infer<typeof CollectionMemberSchema>;
783
+ export type CollectionListItem = z.infer<typeof CollectionListItemSchema>;
784
+ export type CollectionListResponse = z.infer<typeof CollectionListResponseSchema>;
785
+ export type CollectionDetail = z.infer<typeof CollectionDetailSchema>;
786
+ export type CollectionReleaseItem = z.infer<typeof CollectionReleaseItemSchema>;
787
+ export type CollectionFeedPagination = z.infer<typeof CollectionFeedPaginationSchema>;
788
+ export type CollectionReleasesResponse = z.infer<typeof CollectionReleasesResponseSchema>;
789
+ export type CollectionRow = z.infer<typeof CollectionRowSchema>;
790
+ export type CreateCollectionRequest = z.infer<typeof CreateCollectionRequestSchema>;
791
+ export type UpdateCollectionRequest = z.infer<typeof UpdateCollectionRequestSchema>;
792
+ export type CollectionMemberInput = z.infer<typeof CollectionMemberInputSchema>;
793
+ export type AddCollectionMemberRequest = z.infer<typeof AddCollectionMemberRequestSchema>;
794
+ export type ReplaceCollectionMembersRequest = z.infer<typeof ReplaceCollectionMembersRequestSchema>;
795
+ export type ResolvedCollectionMember = z.infer<typeof ResolvedCollectionMemberSchema>;
796
+ export type ReplaceCollectionMembersResponse = z.infer<typeof ReplaceCollectionMembersResponseSchema>;
797
+ export type AddCollectionMemberResponse = z.infer<typeof AddCollectionMemberResponseSchema>;
798
+ export type CollectionDailySummary = z.infer<typeof CollectionDailySummarySchema>;
799
+ export type CollectionDailySummariesResponse = z.infer<typeof CollectionDailySummariesResponseSchema>;
800
+ export type CollectionWeeklyDigestListItem = z.infer<typeof CollectionWeeklyDigestListItemSchema>;
801
+ export type CollectionWeeklyDigestsResponse = z.infer<typeof CollectionWeeklyDigestsResponseSchema>;
802
+ export type DigestCoveredRelease = z.infer<typeof DigestCoveredReleaseSchema>;
803
+ export type DigestSection = z.infer<typeof DigestSectionSchema>;
804
+ export type CollectionWeeklyDigestDetail = z.infer<typeof CollectionWeeklyDigestDetailSchema>;
805
+ /** Flat release shape returned by GET /v1/releases/:id with source metadata. */
806
+ export interface ReleaseWithSource {
807
+ id: string;
808
+ sourceId: string;
809
+ version: string | null;
810
+ title: string;
811
+ content: string;
812
+ /** AI-generated summary (#852, renamed in #860). Nullable — most rows unpopulated. */
813
+ summary: string | null;
814
+ /** AI-generated headline (#852, renamed in #860). See {@link ReleaseDetail.titleGenerated}. */
815
+ titleGenerated?: string | null;
816
+ /** AI-generated smart-brevity headline (#852, renamed in #860). */
817
+ titleShort?: string | null;
818
+ /** AI-scored importance 1–5. See {@link ReleaseDetail.importance}. */
819
+ importance?: number | null;
820
+ url: string | null;
821
+ contentHash: string | null;
822
+ metadata: string | null;
823
+ publishedAt: string | null;
824
+ suppressed: boolean;
825
+ suppressedReason: string | null;
826
+ fetchedAt: string;
827
+ sourceName: string | null;
828
+ sourceSlug: string | null;
829
+ }
830
+ export interface LatestRelease {
831
+ id: string;
832
+ title: string;
833
+ version: string | null;
834
+ publishedAt: string | null;
835
+ sourceName: string;
836
+ sourceSlug: string;
837
+ /**
838
+ * Source type (`github`/`scrape`/`feed`/`agent`/`appstore`/`video`). Lets the
839
+ * live feed render the source-type icon for a freshly-arrived event. Additive —
840
+ * older buffered events / pinned workers omit it.
841
+ */
842
+ sourceType?: string;
843
+ /**
844
+ * Owning-org context, resolved at publish time so the live feed can render an
845
+ * avatar + org name the instant an event arrives. Nested to match
846
+ * {@link ReleaseDetail.org} and the build-event input. Additive/nullable:
847
+ * absent for orphan sources or older buffered events. Avatar fallback chain:
848
+ * `avatarUrl` → `github.com/<githubHandle>.png` → an initial.
849
+ */
850
+ org?: {
851
+ slug: string;
852
+ name: string;
853
+ avatarUrl: string | null;
854
+ githubHandle: string | null;
855
+ } | null;
856
+ /** AI-generated summary (#852, renamed in #860). Nullable — most rows unpopulated. */
857
+ summary: string | null;
858
+ /** AI-generated headline (#852, renamed in #860). See {@link ReleaseDetail.titleGenerated}. */
859
+ titleGenerated?: string | null;
860
+ /** AI-generated smart-brevity headline (#852, renamed in #860). */
861
+ titleShort?: string | null;
862
+ /** AI-scored importance 1–5. See {@link ReleaseDetail.importance}. */
863
+ importance?: number | null;
864
+ media: MediaItem[];
865
+ /**
866
+ * Cached release-body size — `LENGTH(content)` and `countTokensSafe(content)`
867
+ * snapshotted at ingest, so clients can advertise "this release is ~1.5K
868
+ * tokens" without round-tripping the body. Both fields are optional and
869
+ * nullable: pre-existing rows land null until the backfill script
870
+ * populates them. See #958.
871
+ */
872
+ contentChars?: number | null;
873
+ contentTokens?: number | null;
874
+ /**
875
+ * Owning product, when the release's source is grouped under a product.
876
+ * `null` / `undefined` when the source has no `product_id`. Additive — older
877
+ * API responses omit this field; treat `undefined` as `null`. #1217.
878
+ */
879
+ product?: {
880
+ slug: string;
881
+ name: string;
882
+ } | null;
883
+ }
884
+ export type StatsSourceActivity = z.infer<typeof StatsSourceActivitySchema>;
885
+ export type StatsRecentActivity = z.infer<typeof StatsRecentActivitySchema>;
886
+ export type StatsResponse = z.infer<typeof StatsResponseSchema>;
887
+ /**
888
+ * The richer subset of the `GET /v1/stats` response — period + totals +
889
+ * sourceHealth + sourceActivity + recentActivity. The full wire shape
890
+ * (`StatsResponse`) merges these fields with the flat back-compat `Stats`
891
+ * counts.
892
+ */
893
+ export type StatsSummary = Omit<StatsResponse, "orgs" | "sources" | "releases" | "products">;
894
+ export type FeedbackType = z.infer<typeof FeedbackTypeSchema>;
895
+ export type FeedbackStatus = z.infer<typeof FeedbackStatusSchema>;
896
+ export type FeedbackItem = z.infer<typeof FeedbackItemSchema>;
897
+ export type FeedbackListResponse = z.infer<typeof FeedbackListResponseSchema>;
898
+ export type FeedbackUpdateBody = z.infer<typeof FeedbackUpdateBodySchema>;
899
+ export type FeedbackDeleteResponse = z.infer<typeof FeedbackDeleteResponseSchema>;
900
+ export type FeedbackSubmitBody = z.infer<typeof FeedbackSubmitBodySchema>;
901
+ export type FeedbackSubmitResponse = z.infer<typeof FeedbackSubmitResponseSchema>;
902
+ export type ClassificationSummary = z.infer<typeof ClassificationSummarySchema>;
903
+ export type ClassificationRecentResponse = z.infer<typeof ClassificationRecentResponseSchema>;
904
+ export type ClassificationRecentItem = z.infer<typeof ClassificationRecentItemSchema>;
905
+ export type SemanticAlertSummary = z.infer<typeof SemanticAlertSummarySchema>;
906
+ export type RecommendationNotifyAddedBody = z.infer<typeof RecommendationNotifyAddedBodySchema>;
907
+ export type RecommendationNotifyAddedResult = z.infer<typeof RecommendationNotifyAddedResultSchema>;
908
+ export type RecommendationSubmitBody = z.infer<typeof RecommendationSubmitBodySchema>;
909
+ export type RecommendationSubmitResponse = z.infer<typeof RecommendationSubmitResponseSchema>;
910
+ export interface FetchLogEntry {
911
+ id: string;
912
+ sourceName: string;
913
+ sourceSlug: string;
914
+ status: string;
915
+ releasesFound: number;
916
+ releasesInserted: number;
917
+ durationMs: number | null;
918
+ error: string | null;
919
+ createdAt: string;
920
+ }
921
+ /**
922
+ * The managed-agent session currently fetching a source, surfaced read-side on
923
+ * the fetch-log view so an operator/agent can tell "a fetch is in flight" from
924
+ * "stuck/dead" without waiting for a terminal `fetch_log` row (#1360). Only
925
+ * running, non-stale sessions are reported (the StatusHub DO drops sessions idle
926
+ * past its staleness cutoff), so the presence of this object means a fetch is
927
+ * live; `startedAt` says how long it has been running.
928
+ */
929
+ export interface ActiveFetchSession {
930
+ sessionId: string;
931
+ /** Always `running` today — only running sessions are surfaced. */
932
+ status: string;
933
+ /** Session start, epoch ms. */
934
+ startedAt: number;
935
+ /** Last session activity, epoch ms. */
936
+ lastUpdatedAt: number;
937
+ }
938
+ export interface UsageBreakdownRow {
939
+ label: string | null;
940
+ totalInput: number;
941
+ totalOutput: number;
942
+ count: number;
943
+ }
944
+ export interface UsageStatsResponse {
945
+ totals: {
946
+ totalInput: number;
947
+ totalOutput: number;
948
+ count: number;
949
+ };
950
+ byOperation: UsageBreakdownRow[];
951
+ byModel: UsageBreakdownRow[];
952
+ bySource: UsageBreakdownRow[];
953
+ }
954
+ /**
955
+ * Where the session error originated.
956
+ * - `provider`: managed-agents service / Anthropic-side (e.g. unknown_error, model_overloaded, retries_exhausted)
957
+ * - `us`: this codebase / our agent setup (e.g. parser failure, no tools called, timeout)
958
+ */
959
+ export type SessionErrorSource = "provider" | "us";
960
+ export interface Session {
961
+ sessionId: string;
962
+ company: string;
963
+ type: "onboard" | "update";
964
+ /**
965
+ * Sub-agent **role** label that ran this session — `"coordinator"` is the
966
+ * parent orchestrator (typically Sonnet) when a multi-agent session
967
+ * delegates, `"sonnet"` / `"haiku"` are direct single-agent runs.
968
+ * `"deterministic"` marks the #1878/#1881 update path that skips the
969
+ * Managed-Agents (Haiku) session entirely — no Anthropic session runs, so
970
+ * it must never be reported as `"haiku"`. Surfaces on the detail GET.
971
+ *
972
+ * This is a logical role label, not the runtime model identifier. The
973
+ * resolved Anthropic model string (e.g. `claude-sonnet-5-5`,
974
+ * `claude-haiku-5-5`) lives on `usage.model` when the session reported
975
+ * one — consult that field for the concrete model.
976
+ */
977
+ agent?: "sonnet" | "haiku" | "coordinator" | "deterministic";
978
+ /** Identifies the client that started this session (e.g. hostname). */
979
+ runner?: string;
980
+ /** Correlation ID for end-to-end tracing across CLI → API → managed agent. */
981
+ correlationId?: string;
982
+ /** Anthropic session ID for linking to console logs. */
983
+ anthropicSessionId?: string;
984
+ status: "running" | "complete" | "error" | "cancelled";
985
+ step?: string;
986
+ sourcesFound?: number;
987
+ sourcesValidated?: number;
988
+ totalSources?: number;
989
+ sourcesFetched?: number;
990
+ releasesFound?: number;
991
+ releasesInserted?: number;
992
+ currentAction?: string;
993
+ startedAt: number;
994
+ lastUpdatedAt: number;
995
+ error?: string;
996
+ /** Where the error originated. Absent on legacy sessions; treat as `"us"`. */
997
+ errorSource?: SessionErrorSource;
998
+ /** Provider error type (e.g. `unknown_error`, `model_overloaded_error`). */
999
+ errorType?: string;
1000
+ /** Stop reason from the final `session.status_idle` event (e.g. `retries_exhausted`). */
1001
+ stopReason?: string;
1002
+ /** Number of provider `session.error` events observed before terminal. */
1003
+ retryCount?: number;
1004
+ /** Non-fatal warnings collected during the session. */
1005
+ warnings?: string[];
1006
+ /**
1007
+ * Token usage + estimated cost from the managed-agents session. `estimatedUsd`
1008
+ * is a snapshot of Anthropic list prices at session-completion time.
1009
+ */
1010
+ usage?: {
1011
+ inputTokens?: number;
1012
+ outputTokens?: number;
1013
+ cacheWriteTokens?: number;
1014
+ cacheReadTokens?: number;
1015
+ model?: string;
1016
+ estimatedUsd?: number;
1017
+ };
1018
+ /**
1019
+ * Final agent-reported state for terminal `onboard` sessions — the JSON
1020
+ * blob the agent passed to its `releases_report_state` tool, plus an
1021
+ * `agentSessionId` field stitched in server-side. Empty on `update`
1022
+ * sessions and pre-report errors. Typed as `Record<string, unknown>`
1023
+ * because the shape is owned by the discovery system prompt and may
1024
+ * grow new fields without a wire bump; the keys produced today are:
1025
+ *
1026
+ * - `product` (`string`) — company name
1027
+ * - `domain` (`string | null`) — discovered domain
1028
+ * - `githubOrg` (`string | null`) — discovered GitHub org
1029
+ * - `startedAt`, `updatedAt` (ISO strings)
1030
+ * - `status` (e.g. `"awaiting_review"`)
1031
+ * - `sources` (`Array<{ url, type, slug, label, confidence,
1032
+ * validated, validationError?, releaseCount, releasesFetched,
1033
+ * fetched, contentDepth }>`)
1034
+ * - `agentSessionId` (`string`) — Anthropic session ID, useful for
1035
+ * cross-referencing console logs
1036
+ */
1037
+ result?: Record<string, unknown>;
1038
+ activeSources?: string[];
1039
+ cancelRequested?: boolean;
1040
+ }
1041
+ export type SessionListResponse = ListResponse<Session>;
1042
+ export interface BlockedUrlItem {
1043
+ id: string;
1044
+ pattern: string;
1045
+ type: "exact" | "domain";
1046
+ reason: string | null;
1047
+ createdAt: string;
1048
+ }
1049
+ export type IgnoredUrlListResponse = ListResponse<IgnoredUrlItem>;
1050
+ export type BlockedUrlListResponse = ListResponse<BlockedUrlItem>;
1051
+ export interface EmbedBackfillResponse {
1052
+ processed: number;
1053
+ succeeded: number;
1054
+ failed: number;
1055
+ remaining: number;
1056
+ dryRun?: boolean;
1057
+ }
1058
+ /**
1059
+ * Cascade-scope preview returned by `GET /v1/admin/orgs/:slug/dependents`.
1060
+ * Backs the confirmation prompt in CLI/web before a hard-delete on an org —
1061
+ * post-#690 Phase C, hard-deleting an org cascades into every source row
1062
+ * tied to it and every per-source dependent table listed below.
1063
+ */
1064
+ export interface OrgDependentsResponse {
1065
+ org: {
1066
+ id: string;
1067
+ slug: string;
1068
+ name: string;
1069
+ };
1070
+ counts: {
1071
+ sources: number;
1072
+ releases: number;
1073
+ fetchLog: number;
1074
+ sourceChangelogFiles: number;
1075
+ sourceChangelogChunks: number;
1076
+ releaseSummaries: number;
1077
+ mediaAssets: number;
1078
+ webhookSubscriptions: number;
1079
+ };
1080
+ }
1081
+ export interface EmbedStatusResponse {
1082
+ releases: {
1083
+ total: number;
1084
+ embedded: number;
1085
+ unembedded: number;
1086
+ };
1087
+ entities: {
1088
+ total: number;
1089
+ embedded: number;
1090
+ unembedded: number;
1091
+ breakdown: {
1092
+ org: {
1093
+ total: number;
1094
+ embedded: number;
1095
+ unembedded: number;
1096
+ };
1097
+ product: {
1098
+ total: number;
1099
+ embedded: number;
1100
+ unembedded: number;
1101
+ };
1102
+ source: {
1103
+ total: number;
1104
+ embedded: number;
1105
+ unembedded: number;
1106
+ };
1107
+ };
1108
+ };
1109
+ chunks: {
1110
+ total: number;
1111
+ embedded: number;
1112
+ unembedded: number;
1113
+ };
1114
+ }
1115
+ /**
1116
+ * Returned verbatim by GET /v1/evaluate. Lives in the public api-types package
1117
+ * so external consumers (CLI, third-party clients) can import the shape
1118
+ * without depending on worker-internal AI helpers.
1119
+ */
1120
+ export interface EvaluationResult {
1121
+ recommendedMethod: "feed" | "github" | "markdown" | "scrape" | "crawl";
1122
+ recommendedUrl: string;
1123
+ feedUrl?: string;
1124
+ feedType?: "rss" | "atom" | "jsonfeed";
1125
+ githubRepo?: string;
1126
+ pageStructure: "single-page" | "index" | "unknown";
1127
+ alternatives: Array<{
1128
+ url: string;
1129
+ method: string;
1130
+ note: string;
1131
+ }>;
1132
+ confidence: "high" | "medium" | "low";
1133
+ provider?: string;
1134
+ notes?: string;
1135
+ }
1136
+ /**
1137
+ * Identity returned by `GET /v1/tokens/me` — the caller introspecting its own
1138
+ * credential. `kind: "root"` is the static break-glass key (synthetic identity,
1139
+ * no DB row); `kind: "token"` is a DB-backed `relk_` token.
1140
+ */
1141
+ export interface TokenIdentity {
1142
+ kind: "root" | "token";
1143
+ /** Display label; "root" for the static key, "local-dev" when no secret is bound. */
1144
+ name: string;
1145
+ /** e.g. ["read","write"] or ["*"] for root. */
1146
+ scopes: string[];
1147
+ principalType: "internal" | "agent" | "user";
1148
+ principalId?: string | null;
1149
+ /**
1150
+ * Stable internal principal id for consumption telemetry (#1719). Same value the
1151
+ * auth middleware attaches (`relk_` row id, `relu_${keyId}`, …) — never the raw
1152
+ * secret. Returned on self-introspection so MCP can distinguish `relu_` keys.
1153
+ */
1154
+ tokenId?: string | null;
1155
+ /**
1156
+ * Owning user id for a user-scoped principal (`relu_` key) — the Better Auth
1157
+ * `apikey.referenceId`. Lets a consumer bucket all of an account's credentials
1158
+ * together. Null for the static root key and machine (`relk_`) tokens, which
1159
+ * have no owning user. Distinct from `principalId`, which carries an
1160
+ * agent/internal id for machine tokens. Used by the MCP worker to bucket
1161
+ * `relu_` keys per-account on the rate-limit account tier (#1729).
1162
+ */
1163
+ userId?: string | null;
1164
+ expiresAt?: string | null;
1165
+ lastUsedAt?: string | null;
1166
+ }
1167
+ export * from "./schemas/datasets.js";
1168
+ //# sourceMappingURL=api-types.d.ts.map