@buildinternet/releases-api-types 0.27.0 → 0.28.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildinternet/releases-api-types",
3
- "version": "0.27.0",
3
+ "version": "0.28.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",
package/src/api-types.ts CHANGED
@@ -636,7 +636,10 @@ export interface StuckSource {
636
636
  isHidden: boolean;
637
637
  /** Non-`dry_run` attempts examined in the window (all errors when stuck). */
638
638
  recentAttempts: number;
639
- /** Errors among the examined attempts (equals `recentAttempts` when stuck). */
639
+ /**
640
+ * Failed or degraded attempts (`error`, `crawl_timeout`, `blocked`) among the
641
+ * examined attempts (equals `recentAttempts` when stuck).
642
+ */
640
643
  recentErrors: number;
641
644
  /** Most-recent fetch attempt timestamp (ISO), or null. */
642
645
  lastAttemptAt: string | null;
@@ -1169,6 +1172,24 @@ export interface FetchLogEntry {
1169
1172
  createdAt: string;
1170
1173
  }
1171
1174
 
1175
+ /**
1176
+ * The managed-agent session currently fetching a source, surfaced read-side on
1177
+ * the fetch-log view so an operator/agent can tell "a fetch is in flight" from
1178
+ * "stuck/dead" without waiting for a terminal `fetch_log` row (#1360). Only
1179
+ * running, non-stale sessions are reported (the StatusHub DO drops sessions idle
1180
+ * past its staleness cutoff), so the presence of this object means a fetch is
1181
+ * live; `startedAt` says how long it has been running.
1182
+ */
1183
+ export interface ActiveFetchSession {
1184
+ sessionId: string;
1185
+ /** Always `running` today — only running sessions are surfaced. */
1186
+ status: string;
1187
+ /** Session start, epoch ms. */
1188
+ startedAt: number;
1189
+ /** Last session activity, epoch ms. */
1190
+ lastUpdatedAt: number;
1191
+ }
1192
+
1172
1193
  // ── Usage ──
1173
1194
 
1174
1195
  export interface UsageBreakdownRow {
@@ -38,6 +38,8 @@ export const LookupSourceSchema = z.looseObject({
38
38
  isHidden: z.boolean().nullable().optional(),
39
39
  discovery: z.enum(["curated", "agent", "on_demand"]).optional(),
40
40
  metadata: z.string().nullable(),
41
+ stars: z.number().int().min(0).nullable().optional(),
42
+ starsFetchedAt: z.string().nullable().optional(),
41
43
  createdAt: z.string().optional(),
42
44
  });
43
45
 
@@ -60,6 +60,7 @@ export const SearchSourceHitSchema = z.object({
60
60
  orgSlug: z.string().nullable(),
61
61
  orgName: z.string().nullable(),
62
62
  productSlug: z.string().nullable(),
63
+ stars: z.number().int().min(0).nullable().optional(),
63
64
  });
64
65
 
65
66
  export const SearchReleaseHitSchema = z.object({
@@ -164,6 +165,7 @@ export const LookupResultPayloadSchema = z.object({
164
165
  name: z.string(),
165
166
  url: z.string(),
166
167
  discovery: z.enum(["curated", "agent", "on_demand"]),
168
+ stars: z.number().int().min(0).nullable().optional(),
167
169
  })
168
170
  .optional(),
169
171
  releases: z
@@ -50,6 +50,11 @@ export const SourceListItemSchema = z.object({
50
50
  productName: z.string().nullable().optional(),
51
51
  productSlug: z.string().nullable().optional(),
52
52
  kind: z.enum(KIND_VALUES).nullable().optional(),
53
+ // GitHub stargazer count. `nullable().optional()` (the house idiom for these
54
+ // shapes): non-github sources and older responses omit it; a fetched row may
55
+ // carry `null`. Consumers treat null/undefined as "unknown".
56
+ stars: z.number().int().min(0).nullable().optional(),
57
+ starsFetchedAt: z.string().nullable().optional(),
53
58
  });
54
59
 
55
60
  /**
@@ -84,6 +89,11 @@ export const SourceWithOrgSchema = z.object({
84
89
  medianGapDays: z.number().nullable(),
85
90
  lastRetieredAt: z.string().nullable(),
86
91
  kind: z.enum(KIND_VALUES).nullable().optional(),
92
+ // GitHub stargazer count. `nullable().optional()` (the house idiom for these
93
+ // shapes): non-github sources and older responses omit it; a fetched row may
94
+ // carry `null`. Consumers treat null/undefined as "unknown".
95
+ stars: z.number().int().min(0).nullable().optional(),
96
+ starsFetchedAt: z.string().nullable().optional(),
87
97
  });
88
98
 
89
99
  export const SourceListResponseSchema = ListResponseSchema(SourceWithOrgSchema);
@@ -161,6 +171,11 @@ export const SourceDetailSchema = z.object({
161
171
  pagination: SourceFeedPaginationSchema,
162
172
  summaries: SourceDetailSummariesSchema,
163
173
  kind: z.enum(KIND_VALUES).nullable().optional(),
174
+ // GitHub stargazer count. `nullable().optional()` (the house idiom for these
175
+ // shapes): non-github sources and older responses omit it; a fetched row may
176
+ // carry `null`. Consumers treat null/undefined as "unknown".
177
+ stars: z.number().int().min(0).nullable().optional(),
178
+ starsFetchedAt: z.string().nullable().optional(),
164
179
  });
165
180
 
166
181
  /**