@ncukondo/reference-manager 0.22.2 → 0.22.3

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 (40) hide show
  1. package/dist/chunks/{action-menu-R-QKMCZJ.js → action-menu-CKMhb5fv.js} +3 -3
  2. package/dist/chunks/{action-menu-R-QKMCZJ.js.map → action-menu-CKMhb5fv.js.map} +1 -1
  3. package/dist/chunks/{format-uBMjeVAZ.js → format-B2MDhuHt.js} +2 -2
  4. package/dist/chunks/{format-uBMjeVAZ.js.map → format-B2MDhuHt.js.map} +1 -1
  5. package/dist/chunks/{index-CXZ_Trjb.js → index-4607sQqe.js} +3 -3
  6. package/dist/chunks/index-4607sQqe.js.map +1 -0
  7. package/dist/chunks/{index-DFhoO9RA.js → index-CNr_FIip.js} +20 -4
  8. package/dist/chunks/index-CNr_FIip.js.map +1 -0
  9. package/dist/chunks/{index-DxjW_BKA.js → index-CYp8N4gu.js} +62 -40
  10. package/dist/chunks/index-CYp8N4gu.js.map +1 -0
  11. package/dist/chunks/{index-B7NyGOm6.js → index-DjQiOVp_.js} +4 -4
  12. package/dist/chunks/{index-B7NyGOm6.js.map → index-DjQiOVp_.js.map} +1 -1
  13. package/dist/chunks/{loader-BZgpKsTG.js → loader-CJB3-kI5.js} +36 -14
  14. package/dist/chunks/loader-CJB3-kI5.js.map +1 -0
  15. package/dist/chunks/{reference-select-Cpq_Q4f6.js → reference-select-dvLqdttM.js} +3 -3
  16. package/dist/chunks/{reference-select-Cpq_Q4f6.js.map → reference-select-dvLqdttM.js.map} +1 -1
  17. package/dist/chunks/{style-select-CQIqnmWS.js → style-select-BpKQvCBz.js} +3 -3
  18. package/dist/chunks/{style-select-CQIqnmWS.js.map → style-select-BpKQvCBz.js.map} +1 -1
  19. package/dist/cli/commands/fulltext.d.ts +4 -0
  20. package/dist/cli/commands/fulltext.d.ts.map +1 -1
  21. package/dist/cli/index.d.ts.map +1 -1
  22. package/dist/cli.js +1 -1
  23. package/dist/config/defaults.d.ts.map +1 -1
  24. package/dist/config/env-override.d.ts.map +1 -1
  25. package/dist/config/key-parser.d.ts.map +1 -1
  26. package/dist/config/loader.d.ts.map +1 -1
  27. package/dist/config/schema.d.ts +22 -0
  28. package/dist/config/schema.d.ts.map +1 -1
  29. package/dist/features/operations/fulltext/get.d.ts +2 -0
  30. package/dist/features/operations/fulltext/get.d.ts.map +1 -1
  31. package/dist/features/operations/fulltext/open.d.ts +2 -0
  32. package/dist/features/operations/fulltext/open.d.ts.map +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/mcp/tools/fulltext.d.ts.map +1 -1
  35. package/dist/server.js +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunks/index-CXZ_Trjb.js.map +0 -1
  38. package/dist/chunks/index-DFhoO9RA.js.map +0 -1
  39. package/dist/chunks/index-DxjW_BKA.js.map +0 -1
  40. package/dist/chunks/loader-BZgpKsTG.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { Command } from "commander";
1
+ import { Command, Option } from "commander";
2
2
  import { i as isEqual, M as MANAGED_CUSTOM_FIELDS, w as writeFileAtomic, L as Library, h as CslItemSchema, p as pickDefined, a as sortOrderSchema, z as paginationOptionsSchema, F as FileWatcher, b as sortFieldSchema, y as searchSortFieldSchema } from "./file-watcher-Dyns9dxx.js";
3
3
  import * as fs from "node:fs";
4
4
  import { promises, readFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
5
5
  import * as os from "node:os";
6
6
  import * as path from "node:path";
7
7
  import path__default, { join, basename, dirname } from "node:path";
8
- import { n as normalizePathForOutput, d as deleteDirectoryIfEmpty, p as parseFilename, i as isReservedRole, e as ensureDirectory, a as addAttachment, R as RESERVED_ROLES, g as generateFilename, b as findFulltextFiles, c as findFulltextFile, h as extensionToFormat, j as fulltextAttach, k as fulltextGet, l as fulltextDiscover, m as fulltextFetch, o as fulltextConvert, q as getExtension, B as BUILTIN_STYLES, r as getFulltextAttachmentTypes, s as startServerWithFileWatcher } from "./index-DFhoO9RA.js";
8
+ import { n as normalizePathForOutput, d as deleteDirectoryIfEmpty, p as parseFilename, i as isReservedRole, e as ensureDirectory, a as addAttachment, R as RESERVED_ROLES, g as generateFilename, b as findFulltextFiles, c as findFulltextFile, h as extensionToFormat, j as fulltextAttach, k as fulltextGet, l as fulltextDiscover, m as fulltextFetch, o as fulltextConvert, q as getExtension, B as BUILTIN_STYLES, r as getFulltextAttachmentTypes, s as startServerWithFileWatcher } from "./index-CNr_FIip.js";
9
9
  import { readFile, unlink, stat, readdir, rename } from "node:fs/promises";
10
- import { o as openWithSystemApp, l as loadConfig, e as getDefaultCurrentDirConfigFilename, h as getDefaultUserConfigPath } from "./loader-BZgpKsTG.js";
10
+ import { o as openWithSystemApp, l as loadConfig, e as getDefaultCurrentDirConfigFilename, h as getDefaultUserConfigPath } from "./loader-CJB3-kI5.js";
11
11
  import { spawn, spawnSync } from "node:child_process";
12
12
  import process$1, { stdin, stdout } from "node:process";
13
13
  import * as readline from "node:readline";
@@ -19,7 +19,7 @@ import "@citation-js/plugin-csl";
19
19
  import { ZodOptional as ZodOptional$2, z } from "zod";
20
20
  import { serve } from "@hono/node-server";
21
21
  const name = "@ncukondo/reference-manager";
22
- const version$1 = "0.22.2";
22
+ const version$1 = "0.22.3";
23
23
  const description$1 = "A local reference management tool using CSL-JSON as the single source of truth";
24
24
  const packageJson = {
25
25
  name,
@@ -902,15 +902,15 @@ class OperationsLibrary {
902
902
  }
903
903
  // High-level operations
904
904
  async search(options) {
905
- const { searchReferences } = await import("./index-DFhoO9RA.js").then((n) => n.z);
905
+ const { searchReferences } = await import("./index-CNr_FIip.js").then((n) => n.z);
906
906
  return searchReferences(this.library, options);
907
907
  }
908
908
  async list(options) {
909
- const { listReferences } = await import("./index-DFhoO9RA.js").then((n) => n.y);
909
+ const { listReferences } = await import("./index-CNr_FIip.js").then((n) => n.y);
910
910
  return listReferences(this.library, options ?? {});
911
911
  }
912
912
  async cite(options) {
913
- const { citeReferences } = await import("./index-DFhoO9RA.js").then((n) => n.x);
913
+ const { citeReferences } = await import("./index-CNr_FIip.js").then((n) => n.x);
914
914
  const defaultStyle = options.defaultStyle ?? this.citationConfig?.defaultStyle;
915
915
  const cslDirectory = options.cslDirectory ?? this.citationConfig?.cslDirectory;
916
916
  const mergedOptions = {
@@ -921,32 +921,32 @@ class OperationsLibrary {
921
921
  return citeReferences(this.library, mergedOptions);
922
922
  }
923
923
  async import(inputs, options) {
924
- const { addReferences } = await import("./index-DFhoO9RA.js").then((n) => n.w);
924
+ const { addReferences } = await import("./index-CNr_FIip.js").then((n) => n.w);
925
925
  return addReferences(inputs, this.library, options ?? {});
926
926
  }
927
927
  // Attachment operations
928
928
  async attachAdd(options) {
929
- const { addAttachment: addAttachment2 } = await import("./index-CXZ_Trjb.js");
929
+ const { addAttachment: addAttachment2 } = await import("./index-4607sQqe.js");
930
930
  return addAttachment2(this.library, options);
931
931
  }
932
932
  async attachList(options) {
933
- const { listAttachments: listAttachments2 } = await import("./index-CXZ_Trjb.js");
933
+ const { listAttachments: listAttachments2 } = await import("./index-4607sQqe.js");
934
934
  return listAttachments2(this.library, options);
935
935
  }
936
936
  async attachGet(options) {
937
- const { getAttachment: getAttachment2 } = await import("./index-CXZ_Trjb.js");
937
+ const { getAttachment: getAttachment2 } = await import("./index-4607sQqe.js");
938
938
  return getAttachment2(this.library, options);
939
939
  }
940
940
  async attachDetach(options) {
941
- const { detachAttachment: detachAttachment2 } = await import("./index-CXZ_Trjb.js");
941
+ const { detachAttachment: detachAttachment2 } = await import("./index-4607sQqe.js");
942
942
  return detachAttachment2(this.library, options);
943
943
  }
944
944
  async attachSync(options) {
945
- const { syncAttachments: syncAttachments2 } = await import("./index-CXZ_Trjb.js");
945
+ const { syncAttachments: syncAttachments2 } = await import("./index-4607sQqe.js");
946
946
  return syncAttachments2(this.library, options);
947
947
  }
948
948
  async attachOpen(options) {
949
- const { openAttachment: openAttachment2 } = await import("./index-CXZ_Trjb.js");
949
+ const { openAttachment: openAttachment2 } = await import("./index-4607sQqe.js");
950
950
  return openAttachment2(this.library, options);
951
951
  }
952
952
  }
@@ -1790,7 +1790,7 @@ function getAttachExitCode(result) {
1790
1790
  }
1791
1791
  async function executeInteractiveSelect$2(context, config2) {
1792
1792
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
1793
- const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
1793
+ const { selectReferencesOrExit } = await import("./reference-select-dvLqdttM.js");
1794
1794
  const allReferences = await context.library.getAll();
1795
1795
  const identifiers = await withAlternateScreen2(
1796
1796
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -2338,8 +2338,8 @@ function getCiteExitCode(result) {
2338
2338
  }
2339
2339
  async function executeInteractiveCite(options, context, config2) {
2340
2340
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
2341
- const { runCiteFlow } = await import("./index-B7NyGOm6.js");
2342
- const { buildStyleChoices, listCustomStyles } = await import("./style-select-CQIqnmWS.js");
2341
+ const { runCiteFlow } = await import("./index-DjQiOVp_.js");
2342
+ const { buildStyleChoices, listCustomStyles } = await import("./style-select-BpKQvCBz.js");
2343
2343
  const { search } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.B);
2344
2344
  const { tokenize } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.A);
2345
2345
  const { checkTTY } = await import("./tty-BMyaEOhX.js");
@@ -2423,6 +2423,7 @@ const ENV_OVERRIDE_MAP = {
2423
2423
  REFERENCE_MANAGER_CLI_DEFAULT_LIMIT: "cli.default_limit",
2424
2424
  REFERENCE_MANAGER_MCP_DEFAULT_LIMIT: "mcp.default_limit",
2425
2425
  REFERENCE_MANAGER_CLIPBOARD_AUTO_COPY: "cli.tui.clipboard_auto_copy",
2426
+ REFERENCE_MANAGER_FULLTEXT_PREFERRED_TYPE: "fulltext.preferred_type",
2426
2427
  PUBMED_EMAIL: "pubmed.email",
2427
2428
  PUBMED_API_KEY: "pubmed.api_key",
2428
2429
  UNPAYWALL_EMAIL: "fulltext.sources.unpaywall_email",
@@ -2496,6 +2497,13 @@ const CONFIG_KEY_REGISTRY = [
2496
2497
  type: "string[]",
2497
2498
  description: "Fulltext source priority order"
2498
2499
  },
2500
+ {
2501
+ key: "fulltext.preferred_type",
2502
+ type: "enum",
2503
+ description: "Preferred fulltext type for open/get",
2504
+ enumValues: ["pdf", "markdown"],
2505
+ optional: true
2506
+ },
2499
2507
  {
2500
2508
  key: "fulltext.auto_fetch_on_add",
2501
2509
  type: "boolean",
@@ -6919,7 +6927,7 @@ function formatEditOutput(result) {
6919
6927
  }
6920
6928
  async function executeInteractiveEdit(options, context, config2) {
6921
6929
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
6922
- const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
6930
+ const { selectReferencesOrExit } = await import("./reference-select-dvLqdttM.js");
6923
6931
  const allReferences = await context.library.getAll();
6924
6932
  const identifiers = await withAlternateScreen2(
6925
6933
  () => selectReferencesOrExit(allReferences, { multiSelect: true }, config2.cli.tui)
@@ -10247,23 +10255,25 @@ async function fulltextDetach(library, options) {
10247
10255
  function buildFilePath(attachmentsDirectory, directory, filename) {
10248
10256
  return join(attachmentsDirectory, directory, filename);
10249
10257
  }
10250
- function determineTypeToOpen(attachments) {
10258
+ function determineTypeToOpen(attachments, preferredType) {
10251
10259
  const files = findFulltextFiles(attachments);
10252
10260
  if (files.length === 0) return void 0;
10253
- const pdfFile = files.find((f) => f.filename.endsWith(".pdf"));
10254
- if (pdfFile) return "pdf";
10255
- const mdFile = files.find((f) => f.filename.endsWith(".md"));
10256
- if (mdFile) return "markdown";
10261
+ const hasPdf = files.some((f) => f.filename.endsWith(".pdf"));
10262
+ const hasMd = files.some((f) => f.filename.endsWith(".md"));
10263
+ if (preferredType === "markdown" && hasMd) return "markdown";
10264
+ if (preferredType === "pdf" && hasPdf) return "pdf";
10265
+ if (hasPdf) return "pdf";
10266
+ if (hasMd) return "markdown";
10257
10267
  return void 0;
10258
10268
  }
10259
10269
  async function fulltextOpen(library, options) {
10260
- const { identifier, type: type2, idType = "id", fulltextDirectory } = options;
10270
+ const { identifier, type: type2, preferredType, idType = "id", fulltextDirectory } = options;
10261
10271
  const item = await library.find(identifier, { idType });
10262
10272
  if (!item) {
10263
10273
  return { success: false, error: `Reference not found: ${identifier}` };
10264
10274
  }
10265
10275
  const attachments = item.custom?.attachments;
10266
- const typeToOpen = type2 ?? determineTypeToOpen(attachments);
10276
+ const typeToOpen = type2 ?? determineTypeToOpen(attachments, preferredType);
10267
10277
  if (!typeToOpen) {
10268
10278
  return { success: false, error: `No fulltext attached to reference: ${identifier}` };
10269
10279
  }
@@ -10309,6 +10319,7 @@ async function executeFulltextGet(options, context) {
10309
10319
  const operationOptions = {
10310
10320
  identifier: options.identifier,
10311
10321
  type: options.type,
10322
+ preferredType: options.preferredType,
10312
10323
  stdout: options.stdout,
10313
10324
  idType: options.idType,
10314
10325
  fulltextDirectory: options.fulltextDirectory
@@ -10329,6 +10340,7 @@ async function executeFulltextOpen(options, context) {
10329
10340
  const operationOptions = {
10330
10341
  identifier: options.identifier,
10331
10342
  type: options.type,
10343
+ preferredType: options.preferredType,
10332
10344
  idType: options.idType,
10333
10345
  fulltextDirectory: options.fulltextDirectory
10334
10346
  };
@@ -10456,7 +10468,7 @@ function getFulltextExitCode(result) {
10456
10468
  }
10457
10469
  async function executeInteractiveSelect$1(context, config2) {
10458
10470
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
10459
- const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
10471
+ const { selectReferencesOrExit } = await import("./reference-select-dvLqdttM.js");
10460
10472
  const allReferences = await context.library.getAll();
10461
10473
  const identifiers = await withAlternateScreen2(
10462
10474
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -10552,13 +10564,15 @@ async function handleFulltextGetAction(identifierArg, options, globalOpts) {
10552
10564
  }
10553
10565
  identifier = stdinId;
10554
10566
  }
10567
+ const preferValue = options.prefer ?? config2.fulltext.preferredType;
10555
10568
  const getOptions = {
10556
10569
  identifier,
10557
10570
  fulltextDirectory: config2.attachments.directory,
10558
10571
  ...options.pdf && { type: "pdf" },
10559
10572
  ...options.markdown && { type: "markdown" },
10560
10573
  ...options.stdout && { stdout: options.stdout },
10561
- ...options.uuid && { idType: "uuid" }
10574
+ ...options.uuid && { idType: "uuid" },
10575
+ ...preferValue && { preferredType: preferValue }
10562
10576
  };
10563
10577
  const result = await executeFulltextGet(getOptions, context);
10564
10578
  outputFulltextGetResult(result, Boolean(options.stdout));
@@ -10629,12 +10643,14 @@ async function handleFulltextOpenAction(identifierArg, options, globalOpts) {
10629
10643
  }
10630
10644
  identifier = stdinId;
10631
10645
  }
10646
+ const preferValue = options.prefer ?? config2.fulltext.preferredType;
10632
10647
  const openOptions = {
10633
10648
  identifier,
10634
10649
  fulltextDirectory: config2.attachments.directory,
10635
10650
  ...options.pdf && { type: "pdf" },
10636
10651
  ...options.markdown && { type: "markdown" },
10637
- ...options.uuid && { idType: "uuid" }
10652
+ ...options.uuid && { idType: "uuid" },
10653
+ ...preferValue && { preferredType: preferValue }
10638
10654
  };
10639
10655
  const result = await executeFulltextOpen(openOptions, context);
10640
10656
  const output = formatFulltextOpenOutput(result);
@@ -31377,9 +31393,11 @@ function registerFulltextGetTool(server, getLibraryOperations, getConfig) {
31377
31393
  async (args) => {
31378
31394
  const libraryOps = getLibraryOperations();
31379
31395
  const config2 = getConfig();
31396
+ const preferredType = config2.fulltext?.preferredType;
31380
31397
  const pathResult = await fulltextGet(libraryOps, {
31381
31398
  identifier: args.id,
31382
- fulltextDirectory: config2.attachments.directory
31399
+ fulltextDirectory: config2.attachments.directory,
31400
+ ...preferredType && { preferredType }
31383
31401
  });
31384
31402
  if (!pathResult.success) {
31385
31403
  return {
@@ -31750,7 +31768,7 @@ async function mcpStart(options) {
31750
31768
  async function executeRemove(options, context) {
31751
31769
  const { identifier, idType = "id", fulltextDirectory, deleteFulltext = false } = options;
31752
31770
  if (context.mode === "local" && deleteFulltext && fulltextDirectory) {
31753
- const { removeReference } = await import("./index-DFhoO9RA.js").then((n) => n.v);
31771
+ const { removeReference } = await import("./index-CNr_FIip.js").then((n) => n.v);
31754
31772
  return removeReference(context.library, {
31755
31773
  identifier,
31756
31774
  idType,
@@ -31805,7 +31823,7 @@ Continue?`;
31805
31823
  }
31806
31824
  async function executeInteractiveRemove(context, config2) {
31807
31825
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
31808
- const { selectReferenceItemsOrExit } = await import("./reference-select-Cpq_Q4f6.js");
31826
+ const { selectReferenceItemsOrExit } = await import("./reference-select-dvLqdttM.js");
31809
31827
  const allReferences = await context.library.getAll();
31810
31828
  const selectedItems = await withAlternateScreen2(
31811
31829
  () => selectReferenceItemsOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -32030,7 +32048,7 @@ async function executeInteractiveSearch(options, context, config2) {
32030
32048
  validateInteractiveOptions(options);
32031
32049
  const { checkTTY } = await import("./tty-BMyaEOhX.js");
32032
32050
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32033
- const { runSearchFlow } = await import("./index-B7NyGOm6.js");
32051
+ const { runSearchFlow } = await import("./index-DjQiOVp_.js");
32034
32052
  const { search } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.B);
32035
32053
  const { tokenize } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.A);
32036
32054
  checkTTY();
@@ -32049,7 +32067,7 @@ async function executeInteractiveSearch(options, context, config2) {
32049
32067
  })
32050
32068
  );
32051
32069
  if (result.selectedItems && !result.cancelled) {
32052
- const { isSideEffectAction } = await import("./action-menu-R-QKMCZJ.js");
32070
+ const { isSideEffectAction } = await import("./action-menu-CKMhb5fv.js");
32053
32071
  if (isSideEffectAction(result.action)) {
32054
32072
  await executeSideEffectAction(result.action, result.selectedItems, context, config2);
32055
32073
  return { output: "", cancelled: false, action: result.action };
@@ -32065,7 +32083,7 @@ async function executeSideEffectAction(action, items2, context, config2) {
32065
32083
  switch (action) {
32066
32084
  case "open-url": {
32067
32085
  const { resolveDefaultUrl: resolveDefaultUrl2 } = await Promise.resolve().then(() => url);
32068
- const { openWithSystemApp: openWithSystemApp2 } = await import("./loader-BZgpKsTG.js").then((n) => n.j);
32086
+ const { openWithSystemApp: openWithSystemApp2 } = await import("./loader-CJB3-kI5.js").then((n) => n.j);
32069
32087
  const item = items2[0];
32070
32088
  if (!item) return;
32071
32089
  const url$1 = resolveDefaultUrl2(item);
@@ -32452,7 +32470,7 @@ function formatUpdateOutput(result, identifier) {
32452
32470
  }
32453
32471
  async function executeInteractiveUpdate(context, config2) {
32454
32472
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32455
- const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
32473
+ const { selectReferencesOrExit } = await import("./reference-select-dvLqdttM.js");
32456
32474
  const allReferences = await context.library.getAll();
32457
32475
  const identifiers = await withAlternateScreen2(
32458
32476
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -32747,7 +32765,7 @@ function getUrlExitCode(result) {
32747
32765
  }
32748
32766
  async function executeInteractiveSelect(context, config2) {
32749
32767
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32750
- const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
32768
+ const { selectReferencesOrExit } = await import("./reference-select-dvLqdttM.js");
32751
32769
  const allReferences = await context.library.getAll();
32752
32770
  const identifiers = await withAlternateScreen2(
32753
32771
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -33250,7 +33268,7 @@ function shouldAutoFetch(cliFlag, configEnabled) {
33250
33268
  return configEnabled;
33251
33269
  }
33252
33270
  async function performAutoFetch(addedItems, context, config2) {
33253
- const { fulltextFetch: fulltextFetch2 } = await import("./index-DFhoO9RA.js").then((n) => n.u);
33271
+ const { fulltextFetch: fulltextFetch2 } = await import("./index-CNr_FIip.js").then((n) => n.u);
33254
33272
  const fetchResults = await autoFetchFulltext(addedItems, context, {
33255
33273
  fulltextConfig: config2.fulltext,
33256
33274
  fulltextDirectory: config2.attachments.directory,
@@ -33471,13 +33489,17 @@ function registerFulltextCommand(program) {
33471
33489
  fulltextCmd.command("attach").description("Attach a full-text file to a reference").argument("[identifier]", "Citation key or UUID (interactive selection if omitted)").argument("[file-path]", "Path to the file to attach").option("--pdf [path]", "Attach as PDF (path optional if provided as argument)").option("--markdown [path]", "Attach as Markdown (path optional if provided as argument)").option("--move", "Move file instead of copy").option("-f, --force", "Overwrite existing attachment").option("--uuid", "Interpret identifier as UUID").action(async (identifier, filePath, options) => {
33472
33490
  await handleFulltextAttachAction(identifier, filePath, options, program.opts());
33473
33491
  });
33474
- fulltextCmd.command("get").description("Get full-text file path or content").argument("[identifier]", "Citation key or UUID (interactive selection if omitted)").option("--pdf", "Get PDF file only").option("--markdown", "Get Markdown file only").option("--stdout", "Output file content to stdout").option("--uuid", "Interpret identifier as UUID").action(async (identifier, options) => {
33492
+ fulltextCmd.command("get").description("Get full-text file path or content").argument("[identifier]", "Citation key or UUID (interactive selection if omitted)").option("--pdf", "Get PDF file only").option("--markdown", "Get Markdown file only").addOption(
33493
+ new Option("--prefer <type>", "Preferred fulltext type").choices(["pdf", "markdown"])
33494
+ ).option("--stdout", "Output file content to stdout").option("--uuid", "Interpret identifier as UUID").action(async (identifier, options) => {
33475
33495
  await handleFulltextGetAction(identifier, options, program.opts());
33476
33496
  });
33477
33497
  fulltextCmd.command("detach").description("Detach full-text file from a reference").argument("[identifier]", "Citation key or UUID (interactive selection if omitted)").option("--pdf", "Detach PDF only").option("--markdown", "Detach Markdown only").option("--remove-files", "Also delete the file from disk").option("-f, --force", "Skip confirmation for file removal").option("--uuid", "Interpret identifier as UUID").action(async (identifier, options) => {
33478
33498
  await handleFulltextDetachAction(identifier, options, program.opts());
33479
33499
  });
33480
- fulltextCmd.command("open").description("Open full-text file with system default application").argument("[identifier]", "Citation key or UUID (interactive selection if omitted)").option("--pdf", "Open PDF file").option("--markdown", "Open Markdown file").option("--uuid", "Interpret identifier as UUID").action(async (identifier, options) => {
33500
+ fulltextCmd.command("open").description("Open full-text file with system default application").argument("[identifier]", "Citation key or UUID (interactive selection if omitted)").option("--pdf", "Open PDF file").option("--markdown", "Open Markdown file").addOption(
33501
+ new Option("--prefer <type>", "Preferred fulltext type").choices(["pdf", "markdown"])
33502
+ ).option("--uuid", "Interpret identifier as UUID").action(async (identifier, options) => {
33481
33503
  await handleFulltextOpenAction(identifier, options, program.opts());
33482
33504
  });
33483
33505
  fulltextCmd.command("discover").description("Check OA (Open Access) availability for a reference").argument("[identifier]", "Citation key or UUID (interactive selection if omitted)").option("--uuid", "Interpret identifier as UUID").action(async (identifier, options) => {
@@ -33525,4 +33547,4 @@ export {
33525
33547
  restoreStdinAfterInk as r,
33526
33548
  syncAttachments as s
33527
33549
  };
33528
- //# sourceMappingURL=index-DxjW_BKA.js.map
33550
+ //# sourceMappingURL=index-CYp8N4gu.js.map