@ncukondo/reference-manager 0.13.3 → 0.13.4

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.
@@ -9,14 +9,14 @@ import * as path from "node:path";
9
9
  import { join, extname } from "node:path";
10
10
  import { spawnSync, spawn } from "node:child_process";
11
11
  import { mkdir, unlink, rename, copyFile, rm, readFile } from "node:fs/promises";
12
- import { u as updateReference, B as BUILTIN_STYLES, s as startServerWithFileWatcher, g as getFulltextAttachmentTypes } from "./index-C0TB_ha0.js";
12
+ import { u as updateReference, B as BUILTIN_STYLES, s as startServerWithFileWatcher, g as getFulltextAttachmentTypes } from "./index-4KSTJ3rp.js";
13
13
  import { o as openWithSystemApp, l as loadConfig } from "./loader-C1EpnyPm.js";
14
14
  import "@citation-js/core";
15
15
  import "@citation-js/plugin-csl";
16
16
  import process$1, { stdin, stdout } from "node:process";
17
17
  import { serve } from "@hono/node-server";
18
18
  const name = "@ncukondo/reference-manager";
19
- const version$1 = "0.13.3";
19
+ const version$1 = "0.13.4";
20
20
  const description$1 = "A local reference management tool using CSL-JSON as the single source of truth";
21
21
  const packageJson = {
22
22
  name,
@@ -27319,8 +27319,9 @@ class StdioServerTransport {
27319
27319
  }
27320
27320
  }
27321
27321
  class OperationsLibrary {
27322
- constructor(library) {
27322
+ constructor(library, citationConfig) {
27323
27323
  this.library = library;
27324
+ this.citationConfig = citationConfig;
27324
27325
  }
27325
27326
  // ILibrary delegation
27326
27327
  find(identifier, options) {
@@ -27343,19 +27344,26 @@ class OperationsLibrary {
27343
27344
  }
27344
27345
  // High-level operations
27345
27346
  async search(options) {
27346
- const { searchReferences } = await import("./index-C0TB_ha0.js").then((n) => n.d);
27347
+ const { searchReferences } = await import("./index-4KSTJ3rp.js").then((n) => n.d);
27347
27348
  return searchReferences(this.library, options);
27348
27349
  }
27349
27350
  async list(options) {
27350
- const { listReferences } = await import("./index-C0TB_ha0.js").then((n) => n.l);
27351
+ const { listReferences } = await import("./index-4KSTJ3rp.js").then((n) => n.l);
27351
27352
  return listReferences(this.library, options ?? {});
27352
27353
  }
27353
27354
  async cite(options) {
27354
- const { citeReferences } = await import("./index-C0TB_ha0.js").then((n) => n.b);
27355
- return citeReferences(this.library, options);
27355
+ const { citeReferences } = await import("./index-4KSTJ3rp.js").then((n) => n.b);
27356
+ const defaultStyle = options.defaultStyle ?? this.citationConfig?.defaultStyle;
27357
+ const cslDirectory = options.cslDirectory ?? this.citationConfig?.cslDirectory;
27358
+ const mergedOptions = {
27359
+ ...options,
27360
+ ...defaultStyle !== void 0 && { defaultStyle },
27361
+ ...cslDirectory !== void 0 && { cslDirectory }
27362
+ };
27363
+ return citeReferences(this.library, mergedOptions);
27356
27364
  }
27357
27365
  async import(inputs, options) {
27358
- const { addReferences } = await import("./index-C0TB_ha0.js").then((n) => n.a);
27366
+ const { addReferences } = await import("./index-4KSTJ3rp.js").then((n) => n.a);
27359
27367
  return addReferences(inputs, this.library, options ?? {});
27360
27368
  }
27361
27369
  }
@@ -27365,7 +27373,7 @@ async function createMcpContext(options) {
27365
27373
  });
27366
27374
  const libraryPath = options.libraryPath ?? config2.library;
27367
27375
  const library = await Library.load(libraryPath);
27368
- const libraryOperations = new OperationsLibrary(library);
27376
+ const libraryOperations = new OperationsLibrary(library, config2.citation);
27369
27377
  const fileWatcher = new FileWatcher(libraryPath, {
27370
27378
  debounceMs: config2.watch.debounceMs,
27371
27379
  maxRetries: config2.watch.maxRetries,
@@ -27867,7 +27875,7 @@ async function mcpStart(options) {
27867
27875
  async function executeRemove(options, context) {
27868
27876
  const { identifier, idType = "id", fulltextDirectory, deleteFulltext = false } = options;
27869
27877
  if (context.mode === "local" && deleteFulltext && fulltextDirectory) {
27870
- const { removeReference } = await import("./index-C0TB_ha0.js").then((n) => n.r);
27878
+ const { removeReference } = await import("./index-4KSTJ3rp.js").then((n) => n.r);
27871
27879
  return removeReference(context.library, {
27872
27880
  identifier,
27873
27881
  idType,
@@ -27996,7 +28004,7 @@ async function executeInteractiveSearch(options, context, config2) {
27996
28004
  validateInteractiveOptions(options);
27997
28005
  const { checkTTY } = await import("./tty-CDBIQraQ.js");
27998
28006
  const { runSearchPrompt } = await import("./search-prompt-RtHDJFgL.js");
27999
- const { runActionMenu } = await import("./action-menu-Dc3wCGod.js");
28007
+ const { runActionMenu } = await import("./action-menu-De64T89o.js");
28000
28008
  const { search } = await import("./file-watcher-D2Y-SlcE.js").then((n) => n.y);
28001
28009
  const { tokenize } = await import("./file-watcher-D2Y-SlcE.js").then((n) => n.x);
28002
28010
  checkTTY();
@@ -28737,7 +28745,7 @@ async function createExecutionContext(config2, loadLibrary) {
28737
28745
  const library = await loadLibrary(config2.library);
28738
28746
  return {
28739
28747
  mode: "local",
28740
- library: new OperationsLibrary(library)
28748
+ library: new OperationsLibrary(library, config2.citation)
28741
28749
  };
28742
28750
  }
28743
28751
  async function readJsonInput(file) {
@@ -29528,4 +29536,4 @@ export {
29528
29536
  formatBibtex as f,
29529
29537
  main as m
29530
29538
  };
29531
- //# sourceMappingURL=index-CU6eBQaB.js.map
29539
+ //# sourceMappingURL=index-DNGailHu.js.map