@buildinternet/releases-api-types 0.10.0 → 0.12.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.
- package/package.json +2 -2
- package/src/api-types.ts +38 -1
- package/src/schemas/shared.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildinternet/releases-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Wire protocol — request/response types for the Releases registry API. Shared by web, workers, and clients.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@buildinternet/releases-core": "^0.
|
|
20
|
+
"@buildinternet/releases-core": "^0.19.0",
|
|
21
21
|
"zod": "^4.3.6"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
package/src/api-types.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
ReleaseItemSchema,
|
|
20
20
|
ReleaseSummaryItemSchema,
|
|
21
21
|
OverviewPageItemSchema,
|
|
22
|
+
OverviewCitationSchema,
|
|
22
23
|
} from "./schemas/shared.js";
|
|
23
24
|
import type {
|
|
24
25
|
OrgListItemSchema,
|
|
@@ -68,6 +69,7 @@ export {
|
|
|
68
69
|
ReleaseItemSchema,
|
|
69
70
|
ReleaseSummaryItemSchema,
|
|
70
71
|
OverviewPageItemSchema,
|
|
72
|
+
OverviewCitationSchema,
|
|
71
73
|
CategorySchema,
|
|
72
74
|
} from "./schemas/shared.js";
|
|
73
75
|
export {
|
|
@@ -207,6 +209,15 @@ export interface ReleaseDetail {
|
|
|
207
209
|
title: string;
|
|
208
210
|
content: string;
|
|
209
211
|
contentSummary: string | null;
|
|
212
|
+
/**
|
|
213
|
+
* AI-generated self-contained news-headline form of the release (#852).
|
|
214
|
+
* Nullable because most rows are unpopulated — fall back to `title` for
|
|
215
|
+
* display. `.optional()` for the same mid-deploy / pinned-worker reason
|
|
216
|
+
* as `type` on {@link ReleaseItem}.
|
|
217
|
+
*/
|
|
218
|
+
contentTitle?: string | null;
|
|
219
|
+
/** AI-generated smart-brevity headline (#852). Same fallback as `contentTitle`. */
|
|
220
|
+
contentTitleShort?: string | null;
|
|
210
221
|
url: string | null;
|
|
211
222
|
media: MediaItem[];
|
|
212
223
|
publishedAt: string | null;
|
|
@@ -332,6 +343,10 @@ export interface SearchReleaseHit {
|
|
|
332
343
|
version: string | null;
|
|
333
344
|
title: string;
|
|
334
345
|
summary: string;
|
|
346
|
+
/** AI-generated headline (#852). Optional + nullable: most rows are unpopulated. */
|
|
347
|
+
contentTitle?: string | null;
|
|
348
|
+
/** AI-generated smart-brevity headline (#852). Same caveat as contentTitle. */
|
|
349
|
+
contentTitleShort?: string | null;
|
|
335
350
|
/**
|
|
336
351
|
* Full release body, media URLs hydrated through the MEDIA_ORIGIN proxy.
|
|
337
352
|
* Present so the web can render the same markdown + thumbnail treatment
|
|
@@ -492,6 +507,7 @@ export interface UnifiedSearchResponse {
|
|
|
492
507
|
// ── Overview Pages ──
|
|
493
508
|
|
|
494
509
|
export type OverviewPageItem = z.infer<typeof OverviewPageItemSchema>;
|
|
510
|
+
export type OverviewCitation = z.infer<typeof OverviewCitationSchema>;
|
|
495
511
|
|
|
496
512
|
/** @deprecated Use OverviewPageItem */
|
|
497
513
|
export type KnowledgePageItem = OverviewPageItem;
|
|
@@ -685,15 +701,19 @@ export interface CollectionMemberOrg {
|
|
|
685
701
|
name: string;
|
|
686
702
|
domain: string | null;
|
|
687
703
|
avatarUrl: string | null;
|
|
704
|
+
/** GitHub handle from org_accounts; lets the avatar fall back to github.com/<handle>.png. */
|
|
705
|
+
githubHandle: string | null;
|
|
688
706
|
description: string | null;
|
|
689
707
|
}
|
|
690
708
|
|
|
691
|
-
/** Item shape on GET /v1/collections (list). */
|
|
709
|
+
/** Item shape on GET /v1/collections (list) and GET /v1/orgs/:slug/collections. */
|
|
692
710
|
export interface CollectionListItem {
|
|
693
711
|
slug: string;
|
|
694
712
|
name: string;
|
|
695
713
|
description: string | null;
|
|
696
714
|
memberCount: number;
|
|
715
|
+
/** First few members for inline preview on the list page (capped at 3). */
|
|
716
|
+
previewMembers?: CollectionMemberOrg[];
|
|
697
717
|
}
|
|
698
718
|
|
|
699
719
|
/** Detail shape on GET /v1/collections/:slug. */
|
|
@@ -712,6 +732,15 @@ export interface CollectionDetail {
|
|
|
712
732
|
*/
|
|
713
733
|
export interface CollectionReleaseItem extends OrgReleaseItem {
|
|
714
734
|
org: { slug: string; name: string };
|
|
735
|
+
/**
|
|
736
|
+
* Product the release belongs to, if the source is bound to one. Powers
|
|
737
|
+
* the timeline's same-product rollup ("3 earlier Claude Code releases
|
|
738
|
+
* today") on the collections view. `null` for orgs without products or
|
|
739
|
+
* standalone sources. Optional on the wire so older workers mid-rollout
|
|
740
|
+
* (and hand-constructed test fixtures) don't trip the typecheck — clients
|
|
741
|
+
* should treat missing and `null` identically.
|
|
742
|
+
*/
|
|
743
|
+
product?: { slug: string; name: string } | null;
|
|
715
744
|
}
|
|
716
745
|
|
|
717
746
|
export interface CollectionReleasesResponse {
|
|
@@ -770,6 +799,10 @@ export interface ReleaseWithSource {
|
|
|
770
799
|
title: string;
|
|
771
800
|
content: string;
|
|
772
801
|
contentSummary: string | null;
|
|
802
|
+
/** AI-generated headline (#852). See {@link ReleaseDetail.contentTitle}. */
|
|
803
|
+
contentTitle?: string | null;
|
|
804
|
+
/** AI-generated smart-brevity headline (#852). */
|
|
805
|
+
contentTitleShort?: string | null;
|
|
773
806
|
url: string | null;
|
|
774
807
|
contentHash: string | null;
|
|
775
808
|
metadata: string | null;
|
|
@@ -789,6 +822,10 @@ export interface LatestRelease {
|
|
|
789
822
|
sourceName: string;
|
|
790
823
|
sourceSlug: string;
|
|
791
824
|
contentSummary: string | null;
|
|
825
|
+
/** AI-generated headline (#852). See {@link ReleaseDetail.contentTitle}. */
|
|
826
|
+
contentTitle?: string | null;
|
|
827
|
+
/** AI-generated smart-brevity headline (#852). */
|
|
828
|
+
contentTitleShort?: string | null;
|
|
792
829
|
media: MediaItem[];
|
|
793
830
|
}
|
|
794
831
|
|
package/src/schemas/shared.ts
CHANGED
|
@@ -57,6 +57,12 @@ export const ReleaseItemSchema = z.object({
|
|
|
57
57
|
// fall back to a SemVer-prerelease regex. `.optional()` for the same
|
|
58
58
|
// older-response degrade-gracefully reason as `type`.
|
|
59
59
|
prerelease: z.boolean().optional(),
|
|
60
|
+
// AI-generated headline forms paired with `summary` (#852). Both nullable —
|
|
61
|
+
// most rows in the DB have neither populated, and we don't plan to backfill,
|
|
62
|
+
// so consumers must fall back to `title` for display. `.optional()` for the
|
|
63
|
+
// same mid-deploy / pinned-worker reason as `type`.
|
|
64
|
+
contentTitle: z.string().nullable().optional(),
|
|
65
|
+
contentTitleShort: z.string().nullable().optional(),
|
|
60
66
|
});
|
|
61
67
|
|
|
62
68
|
export const ReleaseSummaryItemSchema = z.object({
|
|
@@ -68,6 +74,22 @@ export const ReleaseSummaryItemSchema = z.object({
|
|
|
68
74
|
generatedAt: z.string(),
|
|
69
75
|
});
|
|
70
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Inline citation attached to an overview page (#846). Each row maps a
|
|
79
|
+
* character span in `OverviewPageItem.content` back to a release URL the
|
|
80
|
+
* model cited via Anthropic's search_result blocks. Optional everywhere it
|
|
81
|
+
* appears — pages generated before #846 lands have none, and consumers
|
|
82
|
+
* should degrade gracefully.
|
|
83
|
+
*/
|
|
84
|
+
export const OverviewCitationSchema = z.object({
|
|
85
|
+
startIndex: z.number().int().min(0),
|
|
86
|
+
endIndex: z.number().int().min(0),
|
|
87
|
+
sourceUrl: z.string(),
|
|
88
|
+
title: z.string().nullable().optional(),
|
|
89
|
+
citedText: z.string(),
|
|
90
|
+
releaseId: z.string().nullable().optional(),
|
|
91
|
+
});
|
|
92
|
+
|
|
71
93
|
export const OverviewPageItemSchema = z.object({
|
|
72
94
|
scope: z.enum(["org", "product"]),
|
|
73
95
|
orgSlug: z.string().nullable().optional(),
|
|
@@ -77,4 +99,5 @@ export const OverviewPageItemSchema = z.object({
|
|
|
77
99
|
lastContributingReleaseAt: z.string().nullable(),
|
|
78
100
|
generatedAt: z.string(),
|
|
79
101
|
updatedAt: z.string(),
|
|
102
|
+
citations: z.array(OverviewCitationSchema).optional(),
|
|
80
103
|
});
|