@mantra-ai/core 0.1.6 → 0.2.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.
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Typed client for the Semantic Scholar Academic Graph API.
3
+ *
4
+ * Unauthenticated: 100 requests per 5 minutes.
5
+ * Authenticated (x-api-key header): higher limits.
6
+ *
7
+ * @see https://api.semanticscholar.org/api-docs/graph
8
+ */
9
+ const BASE_URL = "https://api.semanticscholar.org/graph/v1";
10
+ const SEARCH_FIELDS = [
11
+ "paperId",
12
+ "title",
13
+ "abstract",
14
+ "year",
15
+ "authors",
16
+ "citationCount",
17
+ "influentialCitationCount",
18
+ "venue",
19
+ "externalIds",
20
+ "url",
21
+ ].join(",");
22
+ const DETAIL_FIELDS = [
23
+ ...SEARCH_FIELDS.split(","),
24
+ "referenceCount",
25
+ "isOpenAccess",
26
+ "openAccessPdf",
27
+ "publicationDate",
28
+ "journal",
29
+ ].join(",");
30
+ /** Max retries on 429 / 5xx before giving up. */
31
+ const MAX_RETRIES = 2;
32
+ /** Request timeout in ms. */
33
+ const REQUEST_TIMEOUT_MS = 10_000;
34
+ // ── Helpers ──────────────────────────────────────────────────────────
35
+ function buildHeaders(apiKey) {
36
+ const headers = {
37
+ Accept: "application/json",
38
+ };
39
+ if (apiKey) {
40
+ headers["x-api-key"] = apiKey;
41
+ }
42
+ return headers;
43
+ }
44
+ async function fetchWithRetry(url, headers) {
45
+ let lastError;
46
+ for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
47
+ try {
48
+ const res = await fetch(url, {
49
+ headers,
50
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
51
+ });
52
+ // Retry on 429 or 5xx
53
+ if ((res.status === 429 || res.status >= 500) && attempt < MAX_RETRIES) {
54
+ // Exponential backoff: 1s, 2s
55
+ await new Promise((r) => setTimeout(r, 1000 * (attempt + 1)));
56
+ continue;
57
+ }
58
+ return res;
59
+ }
60
+ catch (e) {
61
+ lastError = e;
62
+ if (attempt < MAX_RETRIES) {
63
+ await new Promise((r) => setTimeout(r, 1000 * (attempt + 1)));
64
+ continue;
65
+ }
66
+ }
67
+ }
68
+ throw lastError ?? new Error("fetchWithRetry exhausted");
69
+ }
70
+ // ── Public API ───────────────────────────────────────────────────────
71
+ /**
72
+ * Search for papers by keyword query.
73
+ *
74
+ * @see https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data/operation/post_graph_get_papers_search
75
+ */
76
+ export async function searchPapers(query, opts) {
77
+ const limit = Math.min(opts?.limit ?? 20, 100);
78
+ const offset = opts?.offset ?? 0;
79
+ const params = new URLSearchParams({
80
+ query,
81
+ fields: SEARCH_FIELDS,
82
+ limit: String(limit),
83
+ offset: String(offset),
84
+ });
85
+ const url = `${BASE_URL}/paper/search?${params}`;
86
+ try {
87
+ const res = await fetchWithRetry(url, buildHeaders(opts?.apiKey));
88
+ if (!res.ok) {
89
+ const status = res.status;
90
+ if (status === 400)
91
+ return { ok: false, status, reason: "not_found" };
92
+ if (status === 429)
93
+ return { ok: false, status, reason: "rate_limited" };
94
+ return { ok: false, status, reason: "upstream_error" };
95
+ }
96
+ const data = (await res.json());
97
+ return { ok: true, data };
98
+ }
99
+ catch {
100
+ return { ok: false, reason: "network_error" };
101
+ }
102
+ }
103
+ /**
104
+ * Get detailed information about a single paper.
105
+ *
106
+ * Accepts S2 paper ID, DOI (prefixed with "DOI:"), ArXiv ID ("ARXIV:"), etc.
107
+ *
108
+ * @see https://api.semanticscholar.org/api-docs/graph#tag/Paper-Data/operation/post_graph_get_paper
109
+ */
110
+ export async function getPaperDetails(paperId, opts) {
111
+ const url = `${BASE_URL}/paper/${encodeURIComponent(paperId)}?fields=${DETAIL_FIELDS}`;
112
+ try {
113
+ const res = await fetchWithRetry(url, buildHeaders(opts?.apiKey));
114
+ if (!res.ok) {
115
+ const status = res.status;
116
+ if (status === 404)
117
+ return { ok: false, status, reason: "not_found" };
118
+ if (status === 429)
119
+ return { ok: false, status, reason: "rate_limited" };
120
+ return { ok: false, status, reason: "upstream_error" };
121
+ }
122
+ const data = (await res.json());
123
+ return { ok: true, data };
124
+ }
125
+ catch {
126
+ return { ok: false, reason: "network_error" };
127
+ }
128
+ }
129
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/sources/semantic-scholar/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAE5D,MAAM,aAAa,GAAG;IACpB,SAAS;IACT,OAAO;IACP,UAAU;IACV,MAAM;IACN,SAAS;IACT,eAAe;IACf,0BAA0B;IAC1B,OAAO;IACP,aAAa;IACb,KAAK;CACN,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,aAAa,GAAG;IACpB,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC;IAC3B,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,SAAS;CACV,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,iDAAiD;AACjD,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,6BAA6B;AAC7B,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAgDlC,wEAAwE;AAExE,SAAS,YAAY,CAAC,MAAe;IACnC,MAAM,OAAO,GAA2B;QACtC,MAAM,EAAE,kBAAkB;KAC3B,CAAC;IACF,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC;IAChC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,GAAW,EACX,OAA+B;IAE/B,IAAI,SAAkB,CAAC;IAEvB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;QACxD,IAAI,CAAC;YACH,MAAM,GAAG,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C,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;YAC1B,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;YACtE,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;YACzE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;QACzD,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAY,CAAC;QAC3C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IAChD,CAAC;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Semantic Scholar discovery provider.
3
+ *
4
+ * Adapts the S2 API client to the DiscoverProvider interface.
5
+ */
6
+ import type { DiscoverCandidateCore, DiscoverProvider, DiscoverSearchOpts } from "../../discovery/types";
7
+ import { type S2ClientOpts } from "./client";
8
+ export declare class SemanticScholarProvider implements DiscoverProvider {
9
+ readonly name = "Semantic Scholar";
10
+ readonly sourceKind: "semantic-scholar";
11
+ readonly capabilities: readonly ["search"];
12
+ readonly isLocal = false;
13
+ private opts;
14
+ constructor(opts?: S2ClientOpts);
15
+ search(query: string, opts?: DiscoverSearchOpts): Promise<DiscoverCandidateCore[]>;
16
+ }
17
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/sources/semantic-scholar/provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AA0CzE,qBAAa,uBAAwB,YAAW,gBAAgB;IAC9D,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,UAAU,EAAG,kBAAkB,CAAU;IAClD,QAAQ,CAAC,YAAY,sBAAuB;IAC5C,QAAQ,CAAC,OAAO,SAAS;IAEzB,OAAO,CAAC,IAAI,CAAe;gBAEf,IAAI,CAAC,EAAE,YAAY;IAIzB,MAAM,CACV,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,kBAAkB,GACxB,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAkBpC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Semantic Scholar discovery provider.
3
+ *
4
+ * Adapts the S2 API client to the DiscoverProvider interface.
5
+ */
6
+ import { searchPapers } from "./client";
7
+ /**
8
+ * Map an S2Paper to a DiscoverCandidateCore.
9
+ * Handles sparse records gracefully — every field may be null.
10
+ */
11
+ function s2PaperToCandidate(paper, position) {
12
+ const doi = paper.externalIds?.DOI ?? null;
13
+ const authors = paper.authors
14
+ ?.map((a) => a.name)
15
+ .filter(Boolean)
16
+ .join(", ") || null;
17
+ // Truncate abstract to ~200 chars for snippet
18
+ let abstractSnippet = null;
19
+ if (paper.abstract) {
20
+ abstractSnippet =
21
+ paper.abstract.length > 200
22
+ ? paper.abstract.slice(0, 197) + "..."
23
+ : paper.abstract;
24
+ }
25
+ return {
26
+ doi,
27
+ title: paper.title,
28
+ authors,
29
+ year: paper.year,
30
+ sources: ["semantic-scholar"],
31
+ score: position, // position-based; normalizeScore handles conversion to 0–1
32
+ semanticScholarId: paper.paperId,
33
+ citationCount: paper.citationCount,
34
+ influentialCitationCount: paper.influentialCitationCount,
35
+ abstractSnippet,
36
+ venue: paper.venue || null,
37
+ url: paper.url,
38
+ };
39
+ }
40
+ export class SemanticScholarProvider {
41
+ name = "Semantic Scholar";
42
+ sourceKind = "semantic-scholar";
43
+ capabilities = ["search"];
44
+ isLocal = false;
45
+ opts;
46
+ constructor(opts) {
47
+ this.opts = opts ?? {};
48
+ }
49
+ async search(query, opts) {
50
+ const limit = opts?.limit ?? 20;
51
+ const result = await searchPapers(query, {
52
+ ...this.opts,
53
+ limit,
54
+ });
55
+ if (!result.ok) {
56
+ // Throw so the registry captures it as a provider error
57
+ // and the other providers continue working.
58
+ throw new Error(`Semantic Scholar search failed: ${result.reason}${result.status ? ` (${result.status})` : ""}`);
59
+ }
60
+ return result.data.data.map((paper, i) => s2PaperToCandidate(paper, i));
61
+ }
62
+ }
63
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/sources/semantic-scholar/provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,EAAE,YAAY,EAAmC,MAAM,UAAU,CAAC;AAEzE;;;GAGG;AACH,SAAS,kBAAkB,CACzB,KAAc,EACd,QAAgB;IAEhB,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,IAAI,CAAC;IAE3C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;QAC3B,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SACnB,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAEtB,8CAA8C;IAC9C,IAAI,eAAe,GAAkB,IAAI,CAAC;IAC1C,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,eAAe;YACb,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG;gBACzB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK;gBAC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O,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF"}
@@ -397,14 +397,14 @@ export declare const ExpandPaginationSchema: z.ZodOptional<z.ZodObject<{
397
397
  limit: z.ZodNumber;
398
398
  has_more: z.ZodBoolean;
399
399
  }, "strip", z.ZodTypeAny, {
400
- total: number;
401
- offset: number;
402
400
  limit: number;
401
+ offset: number;
402
+ total: number;
403
403
  has_more: boolean;
404
404
  }, {
405
- total: number;
406
- offset: number;
407
405
  limit: number;
406
+ offset: number;
407
+ total: number;
408
408
  has_more: boolean;
409
409
  }>>;
410
410
  export declare const VersionResponseSchema: z.ZodObject<{
@@ -491,14 +491,14 @@ export declare const VersionResponseSchema: z.ZodObject<{
491
491
  limit: z.ZodNumber;
492
492
  has_more: z.ZodBoolean;
493
493
  }, "strip", z.ZodTypeAny, {
494
- total: number;
495
- offset: number;
496
494
  limit: number;
495
+ offset: number;
496
+ total: number;
497
497
  has_more: boolean;
498
498
  }, {
499
- total: number;
500
- offset: number;
501
499
  limit: number;
500
+ offset: number;
501
+ total: number;
502
502
  has_more: boolean;
503
503
  }>>;
504
504
  assets: z.ZodOptional<z.ZodUnknown>;
@@ -509,14 +509,14 @@ export declare const VersionResponseSchema: z.ZodObject<{
509
509
  limit: z.ZodNumber;
510
510
  has_more: z.ZodBoolean;
511
511
  }, "strip", z.ZodTypeAny, {
512
- total: number;
513
- offset: number;
514
512
  limit: number;
513
+ offset: number;
514
+ total: number;
515
515
  has_more: boolean;
516
516
  }, {
517
- total: number;
518
- offset: number;
519
517
  limit: number;
518
+ offset: number;
519
+ total: number;
520
520
  has_more: boolean;
521
521
  }>>;
522
522
  work: z.ZodOptional<z.ZodObject<{
@@ -579,15 +579,15 @@ export declare const VersionResponseSchema: z.ZodObject<{
579
579
  } | undefined;
580
580
  source_id?: string | null | undefined;
581
581
  _blocks_pagination?: {
582
- total: number;
583
- offset: number;
584
582
  limit: number;
583
+ offset: number;
584
+ total: number;
585
585
  has_more: boolean;
586
586
  } | undefined;
587
587
  _citations_pagination?: {
588
- total: number;
589
- offset: number;
590
588
  limit: number;
589
+ offset: number;
590
+ total: number;
591
591
  has_more: boolean;
592
592
  } | undefined;
593
593
  }, {
@@ -637,15 +637,15 @@ export declare const VersionResponseSchema: z.ZodObject<{
637
637
  } | undefined;
638
638
  source_id?: string | null | undefined;
639
639
  _blocks_pagination?: {
640
- total: number;
641
- offset: number;
642
640
  limit: number;
641
+ offset: number;
642
+ total: number;
643
643
  has_more: boolean;
644
644
  } | undefined;
645
645
  _citations_pagination?: {
646
- total: number;
647
- offset: number;
648
646
  limit: number;
647
+ offset: number;
648
+ total: number;
649
649
  has_more: boolean;
650
650
  } | undefined;
651
651
  }>;
@@ -904,14 +904,14 @@ export declare const VersionsListResponseSchema: z.ZodObject<{
904
904
  limit: z.ZodNumber;
905
905
  has_more: z.ZodBoolean;
906
906
  }, "strip", z.ZodTypeAny, {
907
- total: number;
908
- offset: number;
909
907
  limit: number;
908
+ offset: number;
909
+ total: number;
910
910
  has_more: boolean;
911
911
  }, {
912
- total: number;
913
- offset: number;
914
912
  limit: number;
913
+ offset: number;
914
+ total: number;
915
915
  has_more: boolean;
916
916
  }>>;
917
917
  assets: z.ZodOptional<z.ZodUnknown>;
@@ -922,14 +922,14 @@ export declare const VersionsListResponseSchema: z.ZodObject<{
922
922
  limit: z.ZodNumber;
923
923
  has_more: z.ZodBoolean;
924
924
  }, "strip", z.ZodTypeAny, {
925
- total: number;
926
- offset: number;
927
925
  limit: number;
926
+ offset: number;
927
+ total: number;
928
928
  has_more: boolean;
929
929
  }, {
930
- total: number;
931
- offset: number;
932
930
  limit: number;
931
+ offset: number;
932
+ total: number;
933
933
  has_more: boolean;
934
934
  }>>;
935
935
  work: z.ZodOptional<z.ZodObject<{
@@ -992,15 +992,15 @@ export declare const VersionsListResponseSchema: z.ZodObject<{
992
992
  } | undefined;
993
993
  source_id?: string | null | undefined;
994
994
  _blocks_pagination?: {
995
- total: number;
996
- offset: number;
997
995
  limit: number;
996
+ offset: number;
997
+ total: number;
998
998
  has_more: boolean;
999
999
  } | undefined;
1000
1000
  _citations_pagination?: {
1001
- total: number;
1002
- offset: number;
1003
1001
  limit: number;
1002
+ offset: number;
1003
+ total: number;
1004
1004
  has_more: boolean;
1005
1005
  } | undefined;
1006
1006
  }, {
@@ -1050,15 +1050,15 @@ export declare const VersionsListResponseSchema: z.ZodObject<{
1050
1050
  } | undefined;
1051
1051
  source_id?: string | null | undefined;
1052
1052
  _blocks_pagination?: {
1053
- total: number;
1054
- offset: number;
1055
1053
  limit: number;
1054
+ offset: number;
1055
+ total: number;
1056
1056
  has_more: boolean;
1057
1057
  } | undefined;
1058
1058
  _citations_pagination?: {
1059
- total: number;
1060
- offset: number;
1061
1059
  limit: number;
1060
+ offset: number;
1061
+ total: number;
1062
1062
  has_more: boolean;
1063
1063
  } | undefined;
1064
1064
  }>]>, "many">;
@@ -1153,15 +1153,15 @@ export declare const VersionsListResponseSchema: z.ZodObject<{
1153
1153
  } | undefined;
1154
1154
  source_id?: string | null | undefined;
1155
1155
  _blocks_pagination?: {
1156
- total: number;
1157
- offset: number;
1158
1156
  limit: number;
1157
+ offset: number;
1158
+ total: number;
1159
1159
  has_more: boolean;
1160
1160
  } | undefined;
1161
1161
  _citations_pagination?: {
1162
- total: number;
1163
- offset: number;
1164
1162
  limit: number;
1163
+ offset: number;
1164
+ total: number;
1165
1165
  has_more: boolean;
1166
1166
  } | undefined;
1167
1167
  })[];
@@ -1256,15 +1256,15 @@ export declare const VersionsListResponseSchema: z.ZodObject<{
1256
1256
  } | undefined;
1257
1257
  source_id?: string | null | undefined;
1258
1258
  _blocks_pagination?: {
1259
- total: number;
1260
- offset: number;
1261
1259
  limit: number;
1260
+ offset: number;
1261
+ total: number;
1262
1262
  has_more: boolean;
1263
1263
  } | undefined;
1264
1264
  _citations_pagination?: {
1265
- total: number;
1266
- offset: number;
1267
1265
  limit: number;
1266
+ offset: number;
1267
+ total: number;
1268
1268
  has_more: boolean;
1269
1269
  } | undefined;
1270
1270
  })[];
@@ -1280,14 +1280,14 @@ export declare const VersionExpandedDataSchema: z.ZodOptional<z.ZodObject<{
1280
1280
  limit: z.ZodNumber;
1281
1281
  has_more: z.ZodBoolean;
1282
1282
  }, "strip", z.ZodTypeAny, {
1283
- total: number;
1284
- offset: number;
1285
1283
  limit: number;
1284
+ offset: number;
1285
+ total: number;
1286
1286
  has_more: boolean;
1287
1287
  }, {
1288
- total: number;
1289
- offset: number;
1290
1288
  limit: number;
1289
+ offset: number;
1290
+ total: number;
1291
1291
  has_more: boolean;
1292
1292
  }>>;
1293
1293
  assets: z.ZodOptional<z.ZodUnknown>;
@@ -1298,14 +1298,14 @@ export declare const VersionExpandedDataSchema: z.ZodOptional<z.ZodObject<{
1298
1298
  limit: z.ZodNumber;
1299
1299
  has_more: z.ZodBoolean;
1300
1300
  }, "strip", z.ZodTypeAny, {
1301
- total: number;
1302
- offset: number;
1303
1301
  limit: number;
1302
+ offset: number;
1303
+ total: number;
1304
1304
  has_more: boolean;
1305
1305
  }, {
1306
- total: number;
1307
- offset: number;
1308
1306
  limit: number;
1307
+ offset: number;
1308
+ total: number;
1309
1309
  has_more: boolean;
1310
1310
  }>>;
1311
1311
  }, "strip", z.ZodTypeAny, {
@@ -1315,15 +1315,15 @@ export declare const VersionExpandedDataSchema: z.ZodOptional<z.ZodObject<{
1315
1315
  citations?: unknown;
1316
1316
  assets?: unknown;
1317
1317
  _blocks_pagination?: {
1318
- total: number;
1319
- offset: number;
1320
1318
  limit: number;
1319
+ offset: number;
1320
+ total: number;
1321
1321
  has_more: boolean;
1322
1322
  } | undefined;
1323
1323
  _citations_pagination?: {
1324
- total: number;
1325
- offset: number;
1326
1324
  limit: number;
1325
+ offset: number;
1326
+ total: number;
1327
1327
  has_more: boolean;
1328
1328
  } | undefined;
1329
1329
  }, {
@@ -1333,15 +1333,15 @@ export declare const VersionExpandedDataSchema: z.ZodOptional<z.ZodObject<{
1333
1333
  citations?: unknown;
1334
1334
  assets?: unknown;
1335
1335
  _blocks_pagination?: {
1336
- total: number;
1337
- offset: number;
1338
1336
  limit: number;
1337
+ offset: number;
1338
+ total: number;
1339
1339
  has_more: boolean;
1340
1340
  } | undefined;
1341
1341
  _citations_pagination?: {
1342
- total: number;
1343
- offset: number;
1344
1342
  limit: number;
1343
+ offset: number;
1344
+ total: number;
1345
1345
  has_more: boolean;
1346
1346
  } | undefined;
1347
1347
  }>>;
@@ -1527,14 +1527,14 @@ export declare const VersionEnvelopeSuccessSchema: z.ZodObject<{
1527
1527
  limit: z.ZodNumber;
1528
1528
  has_more: z.ZodBoolean;
1529
1529
  }, "strip", z.ZodTypeAny, {
1530
- total: number;
1531
- offset: number;
1532
1530
  limit: number;
1531
+ offset: number;
1532
+ total: number;
1533
1533
  has_more: boolean;
1534
1534
  }, {
1535
- total: number;
1536
- offset: number;
1537
1535
  limit: number;
1536
+ offset: number;
1537
+ total: number;
1538
1538
  has_more: boolean;
1539
1539
  }>>;
1540
1540
  assets: z.ZodOptional<z.ZodUnknown>;
@@ -1545,14 +1545,14 @@ export declare const VersionEnvelopeSuccessSchema: z.ZodObject<{
1545
1545
  limit: z.ZodNumber;
1546
1546
  has_more: z.ZodBoolean;
1547
1547
  }, "strip", z.ZodTypeAny, {
1548
- total: number;
1549
- offset: number;
1550
1548
  limit: number;
1549
+ offset: number;
1550
+ total: number;
1551
1551
  has_more: boolean;
1552
1552
  }, {
1553
- total: number;
1554
- offset: number;
1555
1553
  limit: number;
1554
+ offset: number;
1555
+ total: number;
1556
1556
  has_more: boolean;
1557
1557
  }>>;
1558
1558
  }, "strip", z.ZodTypeAny, {
@@ -1562,15 +1562,15 @@ export declare const VersionEnvelopeSuccessSchema: z.ZodObject<{
1562
1562
  citations?: unknown;
1563
1563
  assets?: unknown;
1564
1564
  _blocks_pagination?: {
1565
- total: number;
1566
- offset: number;
1567
1565
  limit: number;
1566
+ offset: number;
1567
+ total: number;
1568
1568
  has_more: boolean;
1569
1569
  } | undefined;
1570
1570
  _citations_pagination?: {
1571
- total: number;
1572
- offset: number;
1573
1571
  limit: number;
1572
+ offset: number;
1573
+ total: number;
1574
1574
  has_more: boolean;
1575
1575
  } | undefined;
1576
1576
  }, {
@@ -1580,15 +1580,15 @@ export declare const VersionEnvelopeSuccessSchema: z.ZodObject<{
1580
1580
  citations?: unknown;
1581
1581
  assets?: unknown;
1582
1582
  _blocks_pagination?: {
1583
- total: number;
1584
- offset: number;
1585
1583
  limit: number;
1584
+ offset: number;
1585
+ total: number;
1586
1586
  has_more: boolean;
1587
1587
  } | undefined;
1588
1588
  _citations_pagination?: {
1589
- total: number;
1590
- offset: number;
1591
1589
  limit: number;
1590
+ offset: number;
1591
+ total: number;
1592
1592
  has_more: boolean;
1593
1593
  } | undefined;
1594
1594
  }>>;
@@ -1643,15 +1643,15 @@ export declare const VersionEnvelopeSuccessSchema: z.ZodObject<{
1643
1643
  citations?: unknown;
1644
1644
  assets?: unknown;
1645
1645
  _blocks_pagination?: {
1646
- total: number;
1647
- offset: number;
1648
1646
  limit: number;
1647
+ offset: number;
1648
+ total: number;
1649
1649
  has_more: boolean;
1650
1650
  } | undefined;
1651
1651
  _citations_pagination?: {
1652
- total: number;
1653
- offset: number;
1654
1652
  limit: number;
1653
+ offset: number;
1654
+ total: number;
1655
1655
  has_more: boolean;
1656
1656
  } | undefined;
1657
1657
  } | undefined;
@@ -1706,15 +1706,15 @@ export declare const VersionEnvelopeSuccessSchema: z.ZodObject<{
1706
1706
  citations?: unknown;
1707
1707
  assets?: unknown;
1708
1708
  _blocks_pagination?: {
1709
- total: number;
1710
- offset: number;
1711
1709
  limit: number;
1710
+ offset: number;
1711
+ total: number;
1712
1712
  has_more: boolean;
1713
1713
  } | undefined;
1714
1714
  _citations_pagination?: {
1715
- total: number;
1716
- offset: number;
1717
1715
  limit: number;
1716
+ offset: number;
1717
+ total: number;
1718
1718
  has_more: boolean;
1719
1719
  } | undefined;
1720
1720
  } | undefined;