@ncukondo/reference-manager 0.9.0 → 0.11.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 (48) hide show
  1. package/README.md +15 -5
  2. package/dist/chunks/{action-menu-BN2HHFPR.js → action-menu-DuKYYovJ.js} +3 -2
  3. package/dist/chunks/{action-menu-BN2HHFPR.js.map → action-menu-DuKYYovJ.js.map} +1 -1
  4. package/dist/chunks/{file-watcher-DdhXSm1l.js → file-watcher-BhIAeC21.js} +10 -5
  5. package/dist/chunks/file-watcher-BhIAeC21.js.map +1 -0
  6. package/dist/chunks/{index-DmMZCOno.js → index-Az8CHxm3.js} +175 -346
  7. package/dist/chunks/index-Az8CHxm3.js.map +1 -0
  8. package/dist/chunks/index-C8U-ofi3.js +26523 -0
  9. package/dist/chunks/index-C8U-ofi3.js.map +1 -0
  10. package/dist/chunks/{loader-C-bdImuO.js → loader-B-qMK5su.js} +2 -2
  11. package/dist/chunks/{loader-C-bdImuO.js.map → loader-B-qMK5su.js.map} +1 -1
  12. package/dist/cli/commands/export.d.ts +44 -0
  13. package/dist/cli/commands/export.d.ts.map +1 -0
  14. package/dist/cli/commands/index.d.ts +2 -0
  15. package/dist/cli/commands/index.d.ts.map +1 -1
  16. package/dist/cli/commands/list.d.ts +4 -4
  17. package/dist/cli/commands/list.d.ts.map +1 -1
  18. package/dist/cli/commands/search.d.ts +4 -4
  19. package/dist/cli/commands/search.d.ts.map +1 -1
  20. package/dist/cli/index.d.ts.map +1 -1
  21. package/dist/cli/server-client.d.ts +5 -5
  22. package/dist/cli.js +7 -23247
  23. package/dist/cli.js.map +1 -1
  24. package/dist/features/format/index.d.ts +2 -0
  25. package/dist/features/format/index.d.ts.map +1 -1
  26. package/dist/features/format/items.d.ts +18 -0
  27. package/dist/features/format/items.d.ts.map +1 -0
  28. package/dist/features/operations/library-operations.d.ts +4 -4
  29. package/dist/features/operations/list.d.ts +6 -11
  30. package/dist/features/operations/list.d.ts.map +1 -1
  31. package/dist/features/operations/search.d.ts +6 -11
  32. package/dist/features/operations/search.d.ts.map +1 -1
  33. package/dist/features/search/matcher.d.ts.map +1 -1
  34. package/dist/features/search/tokenizer.d.ts.map +1 -1
  35. package/dist/features/search/types.d.ts +1 -1
  36. package/dist/features/search/types.d.ts.map +1 -1
  37. package/dist/index.js +3 -3
  38. package/dist/mcp/tools/list.d.ts +0 -1
  39. package/dist/mcp/tools/list.d.ts.map +1 -1
  40. package/dist/mcp/tools/search.d.ts.map +1 -1
  41. package/dist/server/routes/list.d.ts +0 -7
  42. package/dist/server/routes/list.d.ts.map +1 -1
  43. package/dist/server/routes/search.d.ts +0 -7
  44. package/dist/server/routes/search.d.ts.map +1 -1
  45. package/dist/server.js +2 -2
  46. package/package.json +2 -1
  47. package/dist/chunks/file-watcher-DdhXSm1l.js.map +0 -1
  48. package/dist/chunks/index-DmMZCOno.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import { e as CslItemSchema, d as detectDuplicate, h as generateId, q as sortOrderSchema, u as sortFieldSchema, p as pickDefined, t as tokenize, s as search$1, b as sortResults, v as searchSortFieldSchema, L as Library, F as FileWatcher } from "./file-watcher-DdhXSm1l.js";
2
+ import { e as CslItemSchema, d as detectDuplicate, h as generateId, q as sortOrderSchema, u as sortFieldSchema, p as pickDefined, t as tokenize, s as search$1, b as sortResults, v as searchSortFieldSchema, L as Library, F as FileWatcher } from "./file-watcher-BhIAeC21.js";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { Cite } from "@citation-js/core";
5
5
  import "@citation-js/plugin-doi";
@@ -31,6 +31,172 @@ async function updateReference(library, options) {
31
31
  }
32
32
  return result;
33
33
  }
34
+ function formatFirstAuthor(item) {
35
+ if (!item.author || item.author.length === 0) {
36
+ return "Unknown";
37
+ }
38
+ const firstAuthor = item.author[0];
39
+ if (!firstAuthor) {
40
+ return "Unknown";
41
+ }
42
+ const family = firstAuthor.family || "Unknown";
43
+ const givenInitial = firstAuthor.given ? firstAuthor.given[0] : "";
44
+ if (givenInitial) {
45
+ return `${family} ${givenInitial}`;
46
+ }
47
+ return family;
48
+ }
49
+ function hasMultipleAuthors(item) {
50
+ return (item.author?.length || 0) > 1;
51
+ }
52
+ function extractYear(item) {
53
+ if (item.issued?.["date-parts"]?.[0]?.[0]) {
54
+ return String(item.issued["date-parts"][0][0]);
55
+ }
56
+ return "n.d.";
57
+ }
58
+ function getJournalAbbrev(item) {
59
+ const containerTitleShort = item["container-title-short"];
60
+ if (typeof containerTitleShort === "string") {
61
+ return containerTitleShort;
62
+ }
63
+ return item["container-title"] || "";
64
+ }
65
+ function formatVolumeIssuePage(item) {
66
+ const volume = item.volume;
67
+ const issue = item.issue;
68
+ const page = item.page;
69
+ if (!volume && !issue && !page) {
70
+ return "";
71
+ }
72
+ let result = "";
73
+ if (volume) {
74
+ result += volume;
75
+ if (issue) {
76
+ result += `(${issue})`;
77
+ }
78
+ if (page) {
79
+ result += `:${page}`;
80
+ }
81
+ } else if (page) {
82
+ result += page;
83
+ }
84
+ return result;
85
+ }
86
+ function getIdentifier(item) {
87
+ if (item.PMID) {
88
+ return `PMID:${item.PMID}`;
89
+ }
90
+ if (item.DOI) {
91
+ return `DOI:${item.DOI}`;
92
+ }
93
+ if (item.URL) {
94
+ return item.URL;
95
+ }
96
+ return "";
97
+ }
98
+ function formatBibliographyEntry(item) {
99
+ const parts = [];
100
+ const author = formatFirstAuthor(item);
101
+ const etAl = hasMultipleAuthors(item) ? " et al" : "";
102
+ parts.push(`${author}${etAl}.`);
103
+ const journal = getJournalAbbrev(item);
104
+ if (journal) {
105
+ parts.push(`${journal}.`);
106
+ }
107
+ const year = extractYear(item);
108
+ const volumeIssuePage = formatVolumeIssuePage(item);
109
+ if (volumeIssuePage) {
110
+ parts.push(`${year};${volumeIssuePage}.`);
111
+ } else {
112
+ parts.push(`${year}.`);
113
+ }
114
+ const identifier = getIdentifier(item);
115
+ if (identifier) {
116
+ parts.push(`${identifier}.`);
117
+ }
118
+ if (item.title) {
119
+ parts.push(`${item.title}.`);
120
+ }
121
+ return parts.join(" ");
122
+ }
123
+ function getFirstAuthorFamilyName(item) {
124
+ if (!item.author || item.author.length === 0) {
125
+ return "Unknown";
126
+ }
127
+ const firstAuthor = item.author[0];
128
+ if (!firstAuthor) {
129
+ return "Unknown";
130
+ }
131
+ return firstAuthor.family || "Unknown";
132
+ }
133
+ function formatInTextEntry(item) {
134
+ const author = getFirstAuthorFamilyName(item);
135
+ const etAl = hasMultipleAuthors(item) ? " et al" : "";
136
+ const year = extractYear(item);
137
+ return `${author}${etAl}, ${year}`;
138
+ }
139
+ function formatBibliography(items) {
140
+ if (items.length === 0) {
141
+ return "";
142
+ }
143
+ return items.map(formatBibliographyEntry).join("\n\n");
144
+ }
145
+ function formatInText(items) {
146
+ if (items.length === 0) {
147
+ return "";
148
+ }
149
+ const citations = items.map(formatInTextEntry).join("; ");
150
+ return `(${citations})`;
151
+ }
152
+ function formatBibliographyCSL(items, options) {
153
+ if (items.length === 0) {
154
+ return "";
155
+ }
156
+ const style = options.style || "apa";
157
+ const format = options.format || "text";
158
+ const locale = options.locale || "en-US";
159
+ try {
160
+ const cite2 = new Cite(items);
161
+ const result = cite2.format("bibliography", {
162
+ format,
163
+ template: style,
164
+ lang: locale
165
+ });
166
+ return result;
167
+ } catch (error) {
168
+ const errorMessage = error instanceof Error ? error.message : String(error);
169
+ process.stderr.write(
170
+ `Warning: CSL processing failed (style: ${style}), falling back to simplified format: ${errorMessage}
171
+ `
172
+ );
173
+ return formatBibliography(items);
174
+ }
175
+ }
176
+ function formatInTextCSL(items, options) {
177
+ if (items.length === 0) {
178
+ return "";
179
+ }
180
+ const style = options.style || "apa";
181
+ const format = options.format || "text";
182
+ const locale = options.locale || "en-US";
183
+ try {
184
+ const cite2 = new Cite(items);
185
+ const result = cite2.format("citation", {
186
+ format,
187
+ template: style,
188
+ lang: locale
189
+ });
190
+ return result;
191
+ } catch (error) {
192
+ const errorMessage = error instanceof Error ? error.message : String(error);
193
+ process.stderr.write(
194
+ `Warning: CSL processing failed (style: ${style}), falling back to simplified format: ${errorMessage}
195
+ `
196
+ );
197
+ return formatInText(items);
198
+ }
199
+ }
34
200
  function getCreatedAt(item) {
35
201
  const createdAt = item.custom?.created_at;
36
202
  if (!createdAt) return 0;
@@ -1172,7 +1338,7 @@ async function processStdinContent(content, options) {
1172
1338
  source: r.source === "content" ? "stdin" : r.source
1173
1339
  }));
1174
1340
  }
1175
- if (format === "pmid" || format === "doi") {
1341
+ if (format === "pmid" || format === "doi" || format === "isbn") {
1176
1342
  const identifiers2 = content.split(/\s+/).filter((s) => s.length > 0);
1177
1343
  return processIdentifiers(identifiers2, options);
1178
1344
  }
@@ -1340,303 +1506,6 @@ function createAddRoute(library, config) {
1340
1506
  });
1341
1507
  return route;
1342
1508
  }
1343
- function formatAuthor(author) {
1344
- const family = author.family || "";
1345
- const givenInitial = author.given ? `${author.given.charAt(0)}.` : "";
1346
- return givenInitial ? `${family}, ${givenInitial}` : family;
1347
- }
1348
- function formatAuthors(authors) {
1349
- return authors.map(formatAuthor).join("; ");
1350
- }
1351
- function formatSingleReference(item) {
1352
- const lines = [];
1353
- const header = item.title ? `[${item.id}] ${item.title}` : `[${item.id}]`;
1354
- lines.push(header);
1355
- if (item.author && item.author.length > 0) {
1356
- lines.push(` Authors: ${formatAuthors(item.author)}`);
1357
- }
1358
- const year = item.issued?.["date-parts"]?.[0]?.[0];
1359
- lines.push(` Year: ${year || "(no year)"}`);
1360
- lines.push(` Type: ${item.type}`);
1361
- if (item.DOI) {
1362
- lines.push(` DOI: ${item.DOI}`);
1363
- }
1364
- if (item.PMID) {
1365
- lines.push(` PMID: ${item.PMID}`);
1366
- }
1367
- if (item.PMCID) {
1368
- lines.push(` PMCID: ${item.PMCID}`);
1369
- }
1370
- if (item.URL) {
1371
- lines.push(` URL: ${item.URL}`);
1372
- }
1373
- const uuid = item.custom?.uuid || "(no uuid)";
1374
- lines.push(` UUID: ${uuid}`);
1375
- return lines.join("\n");
1376
- }
1377
- function formatPretty(items) {
1378
- if (items.length === 0) {
1379
- return "";
1380
- }
1381
- return items.map(formatSingleReference).join("\n\n");
1382
- }
1383
- function mapEntryType(cslType) {
1384
- const typeMap = {
1385
- article: "article",
1386
- "article-journal": "article",
1387
- "article-magazine": "article",
1388
- "article-newspaper": "article",
1389
- book: "book",
1390
- chapter: "inbook",
1391
- "paper-conference": "inproceedings",
1392
- thesis: "phdthesis",
1393
- report: "techreport",
1394
- webpage: "misc"
1395
- };
1396
- return typeMap[cslType] || "misc";
1397
- }
1398
- function formatBibtexAuthor(author) {
1399
- if (author.literal) {
1400
- return author.literal;
1401
- }
1402
- const family = author.family || "";
1403
- const given = author.given || "";
1404
- return given ? `${family}, ${given}` : family;
1405
- }
1406
- function formatBibtexAuthors(authors) {
1407
- return authors.map(formatBibtexAuthor).join(" and ");
1408
- }
1409
- function formatField(name, value) {
1410
- return ` ${name} = {${value}},`;
1411
- }
1412
- function addBasicFields(lines, item) {
1413
- if (item.title) {
1414
- lines.push(formatField("title", item.title));
1415
- }
1416
- if (item.author && item.author.length > 0) {
1417
- lines.push(formatField("author", formatBibtexAuthors(item.author)));
1418
- }
1419
- const year = item.issued?.["date-parts"]?.[0]?.[0];
1420
- if (year) {
1421
- lines.push(formatField("year", String(year)));
1422
- }
1423
- }
1424
- function addPublicationDetails(lines, item, entryType) {
1425
- if (item["container-title"]) {
1426
- if (entryType === "article") {
1427
- lines.push(formatField("journal", item["container-title"]));
1428
- } else if (entryType === "inbook" || entryType === "inproceedings") {
1429
- lines.push(formatField("booktitle", item["container-title"]));
1430
- }
1431
- }
1432
- if (item.volume) {
1433
- lines.push(formatField("volume", item.volume));
1434
- }
1435
- if (item.issue) {
1436
- lines.push(formatField("number", item.issue));
1437
- }
1438
- if (item.page) {
1439
- lines.push(formatField("pages", item.page));
1440
- }
1441
- if (item.publisher) {
1442
- lines.push(formatField("publisher", item.publisher));
1443
- }
1444
- }
1445
- function addIdentifierFields(lines, item) {
1446
- if (item.DOI) {
1447
- lines.push(formatField("doi", item.DOI));
1448
- }
1449
- if (item.URL) {
1450
- lines.push(formatField("url", item.URL));
1451
- }
1452
- if (item.PMID) {
1453
- lines.push(formatField("note", `PMID: ${item.PMID}`));
1454
- } else if (item.PMCID) {
1455
- lines.push(formatField("note", `PMCID: ${item.PMCID}`));
1456
- }
1457
- }
1458
- function formatSingleBibtexEntry(item) {
1459
- const entryType = mapEntryType(item.type);
1460
- const lines = [];
1461
- lines.push(`@${entryType}{${item.id},`);
1462
- addBasicFields(lines, item);
1463
- addPublicationDetails(lines, item, entryType);
1464
- addIdentifierFields(lines, item);
1465
- lines.push("}");
1466
- return lines.join("\n");
1467
- }
1468
- function formatBibtex(items) {
1469
- if (items.length === 0) {
1470
- return "";
1471
- }
1472
- return items.map(formatSingleBibtexEntry).join("\n\n");
1473
- }
1474
- function formatFirstAuthor(item) {
1475
- if (!item.author || item.author.length === 0) {
1476
- return "Unknown";
1477
- }
1478
- const firstAuthor = item.author[0];
1479
- if (!firstAuthor) {
1480
- return "Unknown";
1481
- }
1482
- const family = firstAuthor.family || "Unknown";
1483
- const givenInitial = firstAuthor.given ? firstAuthor.given[0] : "";
1484
- if (givenInitial) {
1485
- return `${family} ${givenInitial}`;
1486
- }
1487
- return family;
1488
- }
1489
- function hasMultipleAuthors(item) {
1490
- return (item.author?.length || 0) > 1;
1491
- }
1492
- function extractYear(item) {
1493
- if (item.issued?.["date-parts"]?.[0]?.[0]) {
1494
- return String(item.issued["date-parts"][0][0]);
1495
- }
1496
- return "n.d.";
1497
- }
1498
- function getJournalAbbrev(item) {
1499
- const containerTitleShort = item["container-title-short"];
1500
- if (typeof containerTitleShort === "string") {
1501
- return containerTitleShort;
1502
- }
1503
- return item["container-title"] || "";
1504
- }
1505
- function formatVolumeIssuePage(item) {
1506
- const volume = item.volume;
1507
- const issue = item.issue;
1508
- const page = item.page;
1509
- if (!volume && !issue && !page) {
1510
- return "";
1511
- }
1512
- let result = "";
1513
- if (volume) {
1514
- result += volume;
1515
- if (issue) {
1516
- result += `(${issue})`;
1517
- }
1518
- if (page) {
1519
- result += `:${page}`;
1520
- }
1521
- } else if (page) {
1522
- result += page;
1523
- }
1524
- return result;
1525
- }
1526
- function getIdentifier(item) {
1527
- if (item.PMID) {
1528
- return `PMID:${item.PMID}`;
1529
- }
1530
- if (item.DOI) {
1531
- return `DOI:${item.DOI}`;
1532
- }
1533
- if (item.URL) {
1534
- return item.URL;
1535
- }
1536
- return "";
1537
- }
1538
- function formatBibliographyEntry(item) {
1539
- const parts = [];
1540
- const author = formatFirstAuthor(item);
1541
- const etAl = hasMultipleAuthors(item) ? " et al" : "";
1542
- parts.push(`${author}${etAl}.`);
1543
- const journal = getJournalAbbrev(item);
1544
- if (journal) {
1545
- parts.push(`${journal}.`);
1546
- }
1547
- const year = extractYear(item);
1548
- const volumeIssuePage = formatVolumeIssuePage(item);
1549
- if (volumeIssuePage) {
1550
- parts.push(`${year};${volumeIssuePage}.`);
1551
- } else {
1552
- parts.push(`${year}.`);
1553
- }
1554
- const identifier = getIdentifier(item);
1555
- if (identifier) {
1556
- parts.push(`${identifier}.`);
1557
- }
1558
- if (item.title) {
1559
- parts.push(`${item.title}.`);
1560
- }
1561
- return parts.join(" ");
1562
- }
1563
- function getFirstAuthorFamilyName(item) {
1564
- if (!item.author || item.author.length === 0) {
1565
- return "Unknown";
1566
- }
1567
- const firstAuthor = item.author[0];
1568
- if (!firstAuthor) {
1569
- return "Unknown";
1570
- }
1571
- return firstAuthor.family || "Unknown";
1572
- }
1573
- function formatInTextEntry(item) {
1574
- const author = getFirstAuthorFamilyName(item);
1575
- const etAl = hasMultipleAuthors(item) ? " et al" : "";
1576
- const year = extractYear(item);
1577
- return `${author}${etAl}, ${year}`;
1578
- }
1579
- function formatBibliography(items) {
1580
- if (items.length === 0) {
1581
- return "";
1582
- }
1583
- return items.map(formatBibliographyEntry).join("\n\n");
1584
- }
1585
- function formatInText(items) {
1586
- if (items.length === 0) {
1587
- return "";
1588
- }
1589
- const citations = items.map(formatInTextEntry).join("; ");
1590
- return `(${citations})`;
1591
- }
1592
- function formatBibliographyCSL(items, options) {
1593
- if (items.length === 0) {
1594
- return "";
1595
- }
1596
- const style = options.style || "apa";
1597
- const format = options.format || "text";
1598
- const locale = options.locale || "en-US";
1599
- try {
1600
- const cite2 = new Cite(items);
1601
- const result = cite2.format("bibliography", {
1602
- format,
1603
- template: style,
1604
- lang: locale
1605
- });
1606
- return result;
1607
- } catch (error) {
1608
- const errorMessage = error instanceof Error ? error.message : String(error);
1609
- process.stderr.write(
1610
- `Warning: CSL processing failed (style: ${style}), falling back to simplified format: ${errorMessage}
1611
- `
1612
- );
1613
- return formatBibliography(items);
1614
- }
1615
- }
1616
- function formatInTextCSL(items, options) {
1617
- if (items.length === 0) {
1618
- return "";
1619
- }
1620
- const style = options.style || "apa";
1621
- const format = options.format || "text";
1622
- const locale = options.locale || "en-US";
1623
- try {
1624
- const cite2 = new Cite(items);
1625
- const result = cite2.format("citation", {
1626
- format,
1627
- template: style,
1628
- lang: locale
1629
- });
1630
- return result;
1631
- } catch (error) {
1632
- const errorMessage = error instanceof Error ? error.message : String(error);
1633
- process.stderr.write(
1634
- `Warning: CSL processing failed (style: ${style}), falling back to simplified format: ${errorMessage}
1635
- `
1636
- );
1637
- return formatInText(items);
1638
- }
1639
- }
1640
1509
  function shouldUseFallback(options) {
1641
1510
  if (options.cslFile) {
1642
1511
  return false;
@@ -1734,24 +1603,7 @@ const healthRoute = new Hono();
1734
1603
  healthRoute.get("/", (c) => {
1735
1604
  return c.json({ status: "ok" });
1736
1605
  });
1737
- function formatItems$1(items, format) {
1738
- switch (format) {
1739
- case "json":
1740
- return items.map((item) => JSON.stringify(item));
1741
- case "bibtex":
1742
- return items.map((item) => formatBibtex([item]));
1743
- case "ids-only":
1744
- return items.map((item) => item.id);
1745
- case "uuid":
1746
- return items.filter(
1747
- (item) => Boolean(item.custom?.uuid)
1748
- ).map((item) => item.custom.uuid);
1749
- default:
1750
- return items.map((item) => formatPretty([item]));
1751
- }
1752
- }
1753
1606
  async function listReferences(library, options) {
1754
- const format = options.format ?? "pretty";
1755
1607
  const sort = options.sort ?? "updated";
1756
1608
  const order = options.order ?? "desc";
1757
1609
  const limit = options.limit ?? 0;
@@ -1760,9 +1612,8 @@ async function listReferences(library, options) {
1760
1612
  const total = allItems.length;
1761
1613
  const sorted = sortReferences(allItems, sort, order);
1762
1614
  const { items: paginatedItems, nextOffset } = paginate(sorted, { limit, offset });
1763
- const formattedItems = formatItems$1(paginatedItems, format);
1764
1615
  return {
1765
- items: formattedItems,
1616
+ items: paginatedItems,
1766
1617
  total,
1767
1618
  limit,
1768
1619
  offset,
@@ -1774,7 +1625,6 @@ const list = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
1774
1625
  listReferences
1775
1626
  }, Symbol.toStringTag, { value: "Module" }));
1776
1627
  const listRequestBodySchema = z.object({
1777
- format: z.enum(["pretty", "json", "bibtex", "ids-only", "uuid"]).optional(),
1778
1628
  sort: sortFieldSchema.optional(),
1779
1629
  order: sortOrderSchema.optional(),
1780
1630
  limit: z.number().int().min(0).optional(),
@@ -1796,7 +1646,6 @@ function createListRoute(library) {
1796
1646
  }
1797
1647
  const requestBody = parseResult.data;
1798
1648
  const options = pickDefined(requestBody, [
1799
- "format",
1800
1649
  "sort",
1801
1650
  "order",
1802
1651
  "limit",
@@ -1920,24 +1769,7 @@ function createReferencesRoute(library) {
1920
1769
  });
1921
1770
  return route;
1922
1771
  }
1923
- function formatItems(items, format) {
1924
- switch (format) {
1925
- case "json":
1926
- return items.map((item) => JSON.stringify(item));
1927
- case "bibtex":
1928
- return items.map((item) => formatBibtex([item]));
1929
- case "ids-only":
1930
- return items.map((item) => item.id);
1931
- case "uuid":
1932
- return items.filter(
1933
- (item) => Boolean(item.custom?.uuid)
1934
- ).map((item) => item.custom.uuid);
1935
- default:
1936
- return items.map((item) => formatPretty([item]));
1937
- }
1938
- }
1939
1772
  async function searchReferences(library, options) {
1940
- const format = options.format ?? "pretty";
1941
1773
  const query = options.query;
1942
1774
  const sort = options.sort ?? "updated";
1943
1775
  const order = options.order ?? "desc";
@@ -1965,9 +1797,8 @@ async function searchReferences(library, options) {
1965
1797
  sorted = sortReferences(matchedItems, sort, order);
1966
1798
  }
1967
1799
  const { items: paginatedItems, nextOffset } = paginate(sorted, { limit, offset });
1968
- const formattedItems = formatItems(paginatedItems, format);
1969
1800
  return {
1970
- items: formattedItems,
1801
+ items: paginatedItems,
1971
1802
  total,
1972
1803
  limit,
1973
1804
  offset,
@@ -1980,7 +1811,6 @@ const search = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
1980
1811
  }, Symbol.toStringTag, { value: "Module" }));
1981
1812
  const searchRequestBodySchema = z.object({
1982
1813
  query: z.string(),
1983
- format: z.enum(["pretty", "json", "bibtex", "ids-only", "uuid"]).optional(),
1984
1814
  sort: searchSortFieldSchema.optional(),
1985
1815
  order: sortOrderSchema.optional(),
1986
1816
  limit: z.number().int().min(0).optional(),
@@ -2003,7 +1833,7 @@ function createSearchRoute(library) {
2003
1833
  const requestBody = parseResult.data;
2004
1834
  const options = {
2005
1835
  query: requestBody.query,
2006
- ...pickDefined(requestBody, ["format", "sort", "order", "limit", "offset"])
1836
+ ...pickDefined(requestBody, ["sort", "order", "limit", "offset"])
2007
1837
  };
2008
1838
  const result = await searchReferences(library, options);
2009
1839
  return c.json(result);
@@ -2052,11 +1882,10 @@ async function startServerWithFileWatcher(libraryPath, config) {
2052
1882
  }
2053
1883
  export {
2054
1884
  BUILTIN_STYLES as B,
2055
- formatBibtex as a,
2056
- add as b,
1885
+ add as a,
1886
+ cite as b,
2057
1887
  createServer as c,
2058
- cite as d,
2059
- search as e,
1888
+ search as d,
2060
1889
  formatBibliographyCSL as f,
2061
1890
  getFulltextAttachmentTypes as g,
2062
1891
  list as l,
@@ -2064,4 +1893,4 @@ export {
2064
1893
  startServerWithFileWatcher as s,
2065
1894
  updateReference as u
2066
1895
  };
2067
- //# sourceMappingURL=index-DmMZCOno.js.map
1896
+ //# sourceMappingURL=index-Az8CHxm3.js.map