@ncukondo/reference-manager 0.26.0 → 0.27.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 (34) hide show
  1. package/README.md +3 -0
  2. package/dist/chunks/{SearchableMultiSelect-D2IzthN4.js → SearchableMultiSelect-D6-pj_XI.js} +2 -2
  3. package/dist/chunks/{SearchableMultiSelect-D2IzthN4.js.map → SearchableMultiSelect-D6-pj_XI.js.map} +1 -1
  4. package/dist/chunks/{action-menu-DWdoHTFh.js → action-menu-DP1rmCkH.js} +3 -3
  5. package/dist/chunks/{action-menu-DWdoHTFh.js.map → action-menu-DP1rmCkH.js.map} +1 -1
  6. package/dist/chunks/{checker-CKfdG8Ia.js → checker-B-SL7krG.js} +4 -4
  7. package/dist/chunks/{checker-CKfdG8Ia.js.map → checker-B-SL7krG.js.map} +1 -1
  8. package/dist/chunks/{crossref-client-Gs75LMVf.js → crossref-client-D6g3pLUI.js} +2 -2
  9. package/dist/chunks/{crossref-client-Gs75LMVf.js.map → crossref-client-D6g3pLUI.js.map} +1 -1
  10. package/dist/chunks/{fix-interaction-DNXbmlPr.js → fix-interaction-CTIvq9t4.js} +5 -5
  11. package/dist/chunks/{fix-interaction-DNXbmlPr.js.map → fix-interaction-CTIvq9t4.js.map} +1 -1
  12. package/dist/chunks/{index-BEQ4YIXx.js → index-B8ST0WLa.js} +148 -63
  13. package/dist/chunks/index-B8ST0WLa.js.map +1 -0
  14. package/dist/chunks/{index-tdmbNN9b.js → index-Bo1JIDmF.js} +4 -4
  15. package/dist/chunks/{index-tdmbNN9b.js.map → index-Bo1JIDmF.js.map} +1 -1
  16. package/dist/chunks/{index-of6eJn8N.js → index-DUpYvm-W.js} +35 -23
  17. package/dist/chunks/index-DUpYvm-W.js.map +1 -0
  18. package/dist/chunks/{index-k67fQbe4.js → index-F4gbDFWf.js} +3 -3
  19. package/dist/chunks/index-F4gbDFWf.js.map +1 -0
  20. package/dist/chunks/{pubmed-client-CGReJIOz.js → pubmed-client-mGn5jDIc.js} +2 -2
  21. package/dist/chunks/{pubmed-client-CGReJIOz.js.map → pubmed-client-mGn5jDIc.js.map} +1 -1
  22. package/dist/chunks/{reference-select-i1Cnmc16.js → reference-select-DtzpiOvp.js} +3 -3
  23. package/dist/chunks/{reference-select-i1Cnmc16.js.map → reference-select-DtzpiOvp.js.map} +1 -1
  24. package/dist/chunks/{style-select-COnY01qb.js → style-select-BT-HOyFf.js} +3 -3
  25. package/dist/chunks/{style-select-COnY01qb.js.map → style-select-BT-HOyFf.js.map} +1 -1
  26. package/dist/cli/commands/fulltext.d.ts +12 -7
  27. package/dist/cli/commands/fulltext.d.ts.map +1 -1
  28. package/dist/cli/index.d.ts.map +1 -1
  29. package/dist/cli.js +1 -1
  30. package/dist/server.js +1 -1
  31. package/package.json +1 -1
  32. package/dist/chunks/index-BEQ4YIXx.js.map +0 -1
  33. package/dist/chunks/index-k67fQbe4.js.map +0 -1
  34. package/dist/chunks/index-of6eJn8N.js.map +0 -1
@@ -5,7 +5,7 @@ import { promises, readFileSync, existsSync, mkdirSync, writeFileSync } from "no
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, b as generateFilename, c as findFulltextFiles, h as findFulltextFile, j as extensionToFormat, k as fulltextAttach, l as fulltextGet, m as fulltextDiscover, o as fulltextFetch, q as fulltextConvert, r as getExtension, s as getDefaultExportFromCjs, B as BUILTIN_STYLES, t as getFulltextAttachmentTypes, u as startServerWithFileWatcher } from "./index-of6eJn8N.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, b as generateFilename, c as findFulltextFiles, h as findFulltextFile, j as extensionToFormat, k as fulltextAttach, l as fulltextDiscover, m as fulltextFetch, o as fulltextConvert, q as fulltextGet, r as getExtension, s as getDefaultExportFromCjs, B as BUILTIN_STYLES, t as getFulltextAttachmentTypes, u as startServerWithFileWatcher } from "./index-DUpYvm-W.js";
9
9
  import { readFile, unlink, stat, readdir, rename } from "node:fs/promises";
10
10
  import { o as openWithSystemApp, l as loadConfig, e as getDefaultCurrentDirConfigFilename, h as getDefaultUserConfigPath } from "./loader-B-fte1uv.js";
11
11
  import { spawn, spawnSync } from "node:child_process";
@@ -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.26.0";
22
+ const version$1 = "0.27.0";
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-of6eJn8N.js").then((n) => n.E);
905
+ const { searchReferences } = await import("./index-DUpYvm-W.js").then((n) => n.E);
906
906
  return searchReferences(this.library, options);
907
907
  }
908
908
  async list(options) {
909
- const { listReferences } = await import("./index-of6eJn8N.js").then((n) => n.D);
909
+ const { listReferences } = await import("./index-DUpYvm-W.js").then((n) => n.D);
910
910
  return listReferences(this.library, options ?? {});
911
911
  }
912
912
  async cite(options) {
913
- const { citeReferences } = await import("./index-of6eJn8N.js").then((n) => n.C);
913
+ const { citeReferences } = await import("./index-DUpYvm-W.js").then((n) => n.C);
914
914
  const defaultStyle = options.defaultStyle ?? this.citationConfig?.defaultStyle;
915
915
  const cslDirectory = options.cslDirectory ?? this.citationConfig?.cslDirectory;
916
916
  const mergedOptions = {
@@ -921,36 +921,36 @@ class OperationsLibrary {
921
921
  return citeReferences(this.library, mergedOptions);
922
922
  }
923
923
  async import(inputs, options) {
924
- const { addReferences } = await import("./index-of6eJn8N.js").then((n) => n.z);
924
+ const { addReferences } = await import("./index-DUpYvm-W.js").then((n) => n.z);
925
925
  return addReferences(inputs, this.library, options ?? {});
926
926
  }
927
927
  async check(options) {
928
- const { checkReferences } = await import("./index-of6eJn8N.js").then((n) => n.A);
928
+ const { checkReferences } = await import("./index-DUpYvm-W.js").then((n) => n.A);
929
929
  return checkReferences(this.library, options);
930
930
  }
931
931
  // Attachment operations
932
932
  async attachAdd(options) {
933
- const { addAttachment: addAttachment2 } = await import("./index-k67fQbe4.js");
933
+ const { addAttachment: addAttachment2 } = await import("./index-F4gbDFWf.js");
934
934
  return addAttachment2(this.library, options);
935
935
  }
936
936
  async attachList(options) {
937
- const { listAttachments: listAttachments2 } = await import("./index-k67fQbe4.js");
937
+ const { listAttachments: listAttachments2 } = await import("./index-F4gbDFWf.js");
938
938
  return listAttachments2(this.library, options);
939
939
  }
940
940
  async attachGet(options) {
941
- const { getAttachment: getAttachment2 } = await import("./index-k67fQbe4.js");
941
+ const { getAttachment: getAttachment2 } = await import("./index-F4gbDFWf.js");
942
942
  return getAttachment2(this.library, options);
943
943
  }
944
944
  async attachDetach(options) {
945
- const { detachAttachment: detachAttachment2 } = await import("./index-k67fQbe4.js");
945
+ const { detachAttachment: detachAttachment2 } = await import("./index-F4gbDFWf.js");
946
946
  return detachAttachment2(this.library, options);
947
947
  }
948
948
  async attachSync(options) {
949
- const { syncAttachments: syncAttachments2 } = await import("./index-k67fQbe4.js");
949
+ const { syncAttachments: syncAttachments2 } = await import("./index-F4gbDFWf.js");
950
950
  return syncAttachments2(this.library, options);
951
951
  }
952
952
  async attachOpen(options) {
953
- const { openAttachment: openAttachment2 } = await import("./index-k67fQbe4.js");
953
+ const { openAttachment: openAttachment2 } = await import("./index-F4gbDFWf.js");
954
954
  return openAttachment2(this.library, options);
955
955
  }
956
956
  }
@@ -1806,7 +1806,7 @@ function getAttachExitCode(result) {
1806
1806
  }
1807
1807
  async function executeInteractiveSelect$2(context, config2) {
1808
1808
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
1809
- const { selectReferencesOrExit } = await import("./reference-select-i1Cnmc16.js");
1809
+ const { selectReferencesOrExit } = await import("./reference-select-DtzpiOvp.js");
1810
1810
  const allReferences = await context.library.getAll();
1811
1811
  const identifiers = await withAlternateScreen2(
1812
1812
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -2471,7 +2471,7 @@ async function handleCheckAction(identifiers, options, globalOpts) {
2471
2471
  const jsonOptions = buildJsonOptionsFromRefs(options, outputFormat, result, allRefs);
2472
2472
  outputCheckResult(result, outputFormat, jsonOptions);
2473
2473
  if (options.fix && result.summary.warnings > 0 && allRefs) {
2474
- const { runFixInteraction } = await import("./fix-interaction-DNXbmlPr.js");
2474
+ const { runFixInteraction } = await import("./fix-interaction-CTIvq9t4.js");
2475
2475
  const findItem = (id2) => allRefs.find((item) => item.id === id2);
2476
2476
  const fixResult = await runFixInteraction(result.results, context.library, findItem);
2477
2477
  const removedSuffix = fixResult.removed.length > 0 ? `, ${fixResult.removed.length} removed` : "";
@@ -2539,7 +2539,7 @@ function outputCheckError(error, format2) {
2539
2539
  }
2540
2540
  async function selectReferencesInteractively(context, config2) {
2541
2541
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
2542
- const { selectReferenceItemsOrExit } = await import("./reference-select-i1Cnmc16.js");
2542
+ const { selectReferenceItemsOrExit } = await import("./reference-select-DtzpiOvp.js");
2543
2543
  const allReferences = await context.library.getAll();
2544
2544
  if (allReferences.length === 0) {
2545
2545
  process.stderr.write("No references in library.\n");
@@ -2607,8 +2607,8 @@ function getCiteExitCode(result) {
2607
2607
  }
2608
2608
  async function executeInteractiveCite(options, context, config2) {
2609
2609
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
2610
- const { runCiteFlow } = await import("./index-tdmbNN9b.js");
2611
- const { buildStyleChoices, listCustomStyles } = await import("./style-select-COnY01qb.js");
2610
+ const { runCiteFlow } = await import("./index-Bo1JIDmF.js");
2611
+ const { buildStyleChoices, listCustomStyles } = await import("./style-select-BT-HOyFf.js");
2612
2612
  const { search } = await import("./file-watcher-Dlx0PolG.js").then((n) => n.B);
2613
2613
  const { tokenize } = await import("./file-watcher-Dlx0PolG.js").then((n) => n.A);
2614
2614
  const { checkTTY } = await import("./tty-BMyaEOhX.js");
@@ -7209,7 +7209,7 @@ function formatEditOutput(result) {
7209
7209
  }
7210
7210
  async function executeInteractiveEdit(options, context, config2) {
7211
7211
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
7212
- const { selectReferencesOrExit } = await import("./reference-select-i1Cnmc16.js");
7212
+ const { selectReferencesOrExit } = await import("./reference-select-DtzpiOvp.js");
7213
7213
  const allReferences = await context.library.getAll();
7214
7214
  const identifiers = await withAlternateScreen2(
7215
7215
  () => selectReferencesOrExit(allReferences, { multiSelect: true }, config2.cli.tui)
@@ -10748,14 +10748,14 @@ function formatFulltextConvertOutput(result) {
10748
10748
  function getFulltextExitCode(result) {
10749
10749
  return result.success ? 0 : 1;
10750
10750
  }
10751
- async function executeInteractiveSelect$1(context, config2) {
10751
+ async function executeInteractiveSelect$1(context, config2, multiSelect = false) {
10752
10752
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
10753
- const { selectReferencesOrExit } = await import("./reference-select-i1Cnmc16.js");
10753
+ const { selectReferencesOrExit } = await import("./reference-select-DtzpiOvp.js");
10754
10754
  const allReferences = await context.library.getAll();
10755
10755
  const identifiers = await withAlternateScreen2(
10756
- () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
10756
+ () => selectReferencesOrExit(allReferences, { multiSelect }, config2.cli.tui)
10757
10757
  );
10758
- return identifiers[0];
10758
+ return identifiers;
10759
10759
  }
10760
10760
  function isValidFilePath(value) {
10761
10761
  return typeof value === "string" && value !== "" && value !== "true";
@@ -10787,7 +10787,7 @@ async function handleFulltextAttachAction(identifierArg, filePathArg, options, g
10787
10787
  setExitCode(ExitCode.ERROR);
10788
10788
  return;
10789
10789
  }
10790
- identifier = await executeInteractiveSelect$1(context, config2);
10790
+ identifier = (await executeInteractiveSelect$1(context, config2))[0];
10791
10791
  }
10792
10792
  const { type: type2, filePath } = parseFulltextAttachTypeAndPath(filePathArg, options);
10793
10793
  const stdinContent = !filePath && type2 ? await readStdinBuffer() : void 0;
@@ -10812,6 +10812,48 @@ async function handleFulltextAttachAction(identifierArg, filePathArg, options, g
10812
10812
  setExitCode(ExitCode.INTERNAL_ERROR);
10813
10813
  }
10814
10814
  }
10815
+ function formatMultiFulltextGetOutput(results) {
10816
+ const isSingle = results.length === 1;
10817
+ if (isSingle) {
10818
+ const { result } = results[0];
10819
+ const formatted = formatFulltextGetOutput(result);
10820
+ return {
10821
+ stdout: result.success ? formatted : "",
10822
+ stderr: result.success ? "" : formatted
10823
+ };
10824
+ }
10825
+ const stdoutLines = [];
10826
+ const stderrLines = [];
10827
+ for (const { id: id2, result } of results) {
10828
+ if (result.success) {
10829
+ stdoutLines.push(`${id2}:`);
10830
+ if (result.paths?.pdf) {
10831
+ stdoutLines.push(` pdf: ${result.paths.pdf}`);
10832
+ }
10833
+ if (result.paths?.markdown) {
10834
+ stdoutLines.push(` markdown: ${result.paths.markdown}`);
10835
+ }
10836
+ } else {
10837
+ stderrLines.push(`Error: ${result.error}`);
10838
+ }
10839
+ }
10840
+ return {
10841
+ stdout: stdoutLines.join("\n"),
10842
+ stderr: stderrLines.join("\n")
10843
+ };
10844
+ }
10845
+ function formatFulltextGetJsonOutput(results) {
10846
+ const toJsonItem = ({ id: id2, result }) => {
10847
+ if (result.success) {
10848
+ return { id: id2, success: true, paths: result.paths };
10849
+ }
10850
+ return { id: id2, success: false, error: result.error };
10851
+ };
10852
+ if (results.length === 1) {
10853
+ return JSON.stringify(toJsonItem(results[0]), null, 2);
10854
+ }
10855
+ return JSON.stringify(results.map(toJsonItem), null, 2);
10856
+ }
10815
10857
  function outputFulltextGetResult(result, useStdout) {
10816
10858
  if (result.success && result.content && useStdout) {
10817
10859
  process.stdout.write(result.content);
@@ -10826,27 +10868,26 @@ function outputFulltextGetResult(result, useStdout) {
10826
10868
  `);
10827
10869
  }
10828
10870
  }
10829
- async function handleFulltextGetAction(identifierArg, options, globalOpts) {
10830
- try {
10831
- const config2 = await loadConfigWithOverrides({ ...globalOpts, ...options });
10832
- const context = await createExecutionContext(config2, Library.load);
10833
- let identifier;
10834
- if (identifierArg) {
10835
- identifier = identifierArg;
10836
- } else if (isTTY()) {
10837
- identifier = await executeInteractiveSelect$1(context, config2);
10838
- } else {
10839
- const stdinId = await readIdentifierFromStdin();
10840
- if (!stdinId) {
10841
- process.stderr.write(
10842
- "Error: No identifier provided. Provide an ID, pipe one via stdin, or run interactively in a TTY.\n"
10843
- );
10844
- setExitCode(ExitCode.ERROR);
10845
- return;
10846
- }
10847
- identifier = stdinId;
10848
- }
10849
- const preferValue = options.prefer ?? config2.fulltext.preferredType;
10871
+ async function resolveGetIdentifiers(identifierArgs, context, config2) {
10872
+ if (identifierArgs.length > 0) {
10873
+ return identifierArgs;
10874
+ }
10875
+ if (isTTY()) {
10876
+ return executeInteractiveSelect$1(context, config2, true);
10877
+ }
10878
+ const stdinIds = await readIdentifiersFromStdin();
10879
+ if (stdinIds.length === 0) {
10880
+ process.stderr.write(
10881
+ "Error: No identifier provided. Provide an ID, pipe one via stdin, or run interactively in a TTY.\n"
10882
+ );
10883
+ return null;
10884
+ }
10885
+ return stdinIds;
10886
+ }
10887
+ async function collectFulltextGetResults(identifiers, options, config2, context) {
10888
+ const preferValue = options.prefer ?? config2.fulltext.preferredType;
10889
+ const results = [];
10890
+ for (const identifier of identifiers) {
10850
10891
  const getOptions = {
10851
10892
  identifier,
10852
10893
  fulltextDirectory: config2.attachments.directory,
@@ -10857,8 +10898,48 @@ async function handleFulltextGetAction(identifierArg, options, globalOpts) {
10857
10898
  ...preferValue && { preferredType: preferValue }
10858
10899
  };
10859
10900
  const result = await executeFulltextGet(getOptions, context);
10860
- outputFulltextGetResult(result, Boolean(options.stdout));
10861
- setExitCode(getFulltextExitCode(result));
10901
+ results.push({ id: identifier, result });
10902
+ }
10903
+ return results;
10904
+ }
10905
+ function outputFulltextGetResults(results, options) {
10906
+ if (options.output === "json") {
10907
+ process.stdout.write(`${formatFulltextGetJsonOutput(results)}
10908
+ `);
10909
+ return;
10910
+ }
10911
+ if (results.length === 1) {
10912
+ outputFulltextGetResult(results[0].result, Boolean(options.stdout));
10913
+ return;
10914
+ }
10915
+ const output = formatMultiFulltextGetOutput(results);
10916
+ if (output.stdout) {
10917
+ process.stdout.write(`${output.stdout}
10918
+ `);
10919
+ }
10920
+ if (output.stderr) {
10921
+ process.stderr.write(`${output.stderr}
10922
+ `);
10923
+ }
10924
+ }
10925
+ async function handleFulltextGetAction(identifierArgs, options, globalOpts) {
10926
+ try {
10927
+ const config2 = await loadConfigWithOverrides({ ...globalOpts, ...options });
10928
+ const context = await createExecutionContext(config2, Library.load);
10929
+ const identifiers = await resolveGetIdentifiers(identifierArgs, context, config2);
10930
+ if (!identifiers) {
10931
+ setExitCode(ExitCode.ERROR);
10932
+ return;
10933
+ }
10934
+ if (options.stdout && identifiers.length > 1) {
10935
+ process.stderr.write("Error: --stdout cannot be used with multiple identifiers\n");
10936
+ setExitCode(ExitCode.ERROR);
10937
+ return;
10938
+ }
10939
+ const results = await collectFulltextGetResults(identifiers, options, config2, context);
10940
+ outputFulltextGetResults(results, options);
10941
+ const hasFailure = results.some((r) => !r.result.success);
10942
+ setExitCode(hasFailure ? ExitCode.ERROR : ExitCode.SUCCESS);
10862
10943
  } catch (error) {
10863
10944
  process.stderr.write(`Error: ${error instanceof Error ? error.message : String(error)}
10864
10945
  `);
@@ -10873,7 +10954,7 @@ async function handleFulltextDetachAction(identifierArg, options, globalOpts) {
10873
10954
  if (identifierArg) {
10874
10955
  identifier = identifierArg;
10875
10956
  } else if (isTTY()) {
10876
- identifier = await executeInteractiveSelect$1(context, config2);
10957
+ identifier = (await executeInteractiveSelect$1(context, config2))[0];
10877
10958
  } else {
10878
10959
  const stdinId = await readIdentifierFromStdin();
10879
10960
  if (!stdinId) {
@@ -10913,7 +10994,7 @@ async function handleFulltextOpenAction(identifierArg, options, globalOpts) {
10913
10994
  if (identifierArg) {
10914
10995
  identifier = identifierArg;
10915
10996
  } else if (isTTY()) {
10916
- identifier = await executeInteractiveSelect$1(context, config2);
10997
+ identifier = (await executeInteractiveSelect$1(context, config2))[0];
10917
10998
  } else {
10918
10999
  const stdinId = await readIdentifierFromStdin();
10919
11000
  if (!stdinId) {
@@ -10953,7 +11034,7 @@ async function handleFulltextDiscoverAction(identifierArg, options, globalOpts)
10953
11034
  if (identifierArg) {
10954
11035
  identifier = identifierArg;
10955
11036
  } else if (isTTY()) {
10956
- identifier = await executeInteractiveSelect$1(context, config2);
11037
+ identifier = (await executeInteractiveSelect$1(context, config2))[0];
10957
11038
  } else {
10958
11039
  const stdinId = await readIdentifierFromStdin();
10959
11040
  if (!stdinId) {
@@ -10993,7 +11074,7 @@ async function handleFulltextFetchAction(identifierArg, options, globalOpts) {
10993
11074
  if (identifierArg) {
10994
11075
  identifier = identifierArg;
10995
11076
  } else if (isTTY()) {
10996
- identifier = await executeInteractiveSelect$1(context, config2);
11077
+ identifier = (await executeInteractiveSelect$1(context, config2))[0];
10997
11078
  } else {
10998
11079
  const stdinId = await readIdentifierFromStdin();
10999
11080
  if (!stdinId) {
@@ -11033,7 +11114,7 @@ async function handleFulltextConvertAction(identifierArg, options, globalOpts) {
11033
11114
  if (identifierArg) {
11034
11115
  identifier = identifierArg;
11035
11116
  } else if (isTTY()) {
11036
- identifier = await executeInteractiveSelect$1(context, config2);
11117
+ identifier = (await executeInteractiveSelect$1(context, config2))[0];
11037
11118
  } else {
11038
11119
  const stdinId = await readIdentifierFromStdin();
11039
11120
  if (!stdinId) {
@@ -11075,8 +11156,10 @@ const fulltext = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
11075
11156
  formatFulltextDetachOutput,
11076
11157
  formatFulltextDiscoverOutput,
11077
11158
  formatFulltextFetchOutput,
11159
+ formatFulltextGetJsonOutput,
11078
11160
  formatFulltextGetOutput,
11079
11161
  formatFulltextOpenOutput,
11162
+ formatMultiFulltextGetOutput,
11080
11163
  getFulltextExitCode,
11081
11164
  handleFulltextAttachAction,
11082
11165
  handleFulltextConvertAction,
@@ -32100,7 +32183,7 @@ async function mcpStart(options) {
32100
32183
  async function executeRemove(options, context) {
32101
32184
  const { identifier, idType = "id", fulltextDirectory, deleteFulltext = false } = options;
32102
32185
  if (context.mode === "local" && deleteFulltext && fulltextDirectory) {
32103
- const { removeReference } = await import("./index-of6eJn8N.js").then((n) => n.x);
32186
+ const { removeReference } = await import("./index-DUpYvm-W.js").then((n) => n.x);
32104
32187
  return removeReference(context.library, {
32105
32188
  identifier,
32106
32189
  idType,
@@ -32155,7 +32238,7 @@ Continue?`;
32155
32238
  }
32156
32239
  async function executeInteractiveRemove(context, config2) {
32157
32240
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32158
- const { selectReferenceItemsOrExit } = await import("./reference-select-i1Cnmc16.js");
32241
+ const { selectReferenceItemsOrExit } = await import("./reference-select-DtzpiOvp.js");
32159
32242
  const allReferences = await context.library.getAll();
32160
32243
  const selectedItems = await withAlternateScreen2(
32161
32244
  () => selectReferenceItemsOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -32380,7 +32463,7 @@ async function executeInteractiveSearch(options, context, config2) {
32380
32463
  validateInteractiveOptions(options);
32381
32464
  const { checkTTY } = await import("./tty-BMyaEOhX.js");
32382
32465
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32383
- const { runSearchFlow } = await import("./index-tdmbNN9b.js");
32466
+ const { runSearchFlow } = await import("./index-Bo1JIDmF.js");
32384
32467
  const { search } = await import("./file-watcher-Dlx0PolG.js").then((n) => n.B);
32385
32468
  const { tokenize } = await import("./file-watcher-Dlx0PolG.js").then((n) => n.A);
32386
32469
  checkTTY();
@@ -32399,7 +32482,7 @@ async function executeInteractiveSearch(options, context, config2) {
32399
32482
  })
32400
32483
  );
32401
32484
  if (result.selectedItems && !result.cancelled) {
32402
- const { isSideEffectAction } = await import("./action-menu-DWdoHTFh.js");
32485
+ const { isSideEffectAction } = await import("./action-menu-DP1rmCkH.js");
32403
32486
  if (isSideEffectAction(result.action)) {
32404
32487
  await executeSideEffectAction(result.action, result.selectedItems, context, config2);
32405
32488
  return { output: "", cancelled: false, action: result.action };
@@ -32802,7 +32885,7 @@ function formatUpdateOutput(result, identifier) {
32802
32885
  }
32803
32886
  async function executeInteractiveUpdate(context, config2) {
32804
32887
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32805
- const { selectReferencesOrExit } = await import("./reference-select-i1Cnmc16.js");
32888
+ const { selectReferencesOrExit } = await import("./reference-select-DtzpiOvp.js");
32806
32889
  const allReferences = await context.library.getAll();
32807
32890
  const identifiers = await withAlternateScreen2(
32808
32891
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -33097,7 +33180,7 @@ function getUrlExitCode(result) {
33097
33180
  }
33098
33181
  async function executeInteractiveSelect(context, config2) {
33099
33182
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
33100
- const { selectReferencesOrExit } = await import("./reference-select-i1Cnmc16.js");
33183
+ const { selectReferencesOrExit } = await import("./reference-select-DtzpiOvp.js");
33101
33184
  const allReferences = await context.library.getAll();
33102
33185
  const identifiers = await withAlternateScreen2(
33103
33186
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -33630,7 +33713,7 @@ function shouldAutoFetch(cliFlag, configEnabled) {
33630
33713
  return configEnabled;
33631
33714
  }
33632
33715
  async function performAutoFetch(addedItems, context, config2) {
33633
- const { fulltextFetch: fulltextFetch2 } = await import("./index-of6eJn8N.js").then((n) => n.w);
33716
+ const { fulltextFetch: fulltextFetch2 } = await import("./index-DUpYvm-W.js").then((n) => n.w);
33634
33717
  const fetchResults = await autoFetchFulltext(addedItems, context, {
33635
33718
  fulltextConfig: config2.fulltext,
33636
33719
  fulltextDirectory: config2.attachments.directory,
@@ -33858,10 +33941,12 @@ function registerFulltextCommand(program) {
33858
33941
  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) => {
33859
33942
  await handleFulltextAttachAction(identifier, filePath, options, program.opts());
33860
33943
  });
33861
- 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(
33944
+ fulltextCmd.command("get").description("Get full-text file path or content").argument("[identifiers...]", "Citation keys or UUIDs (interactive selection if omitted)").option("--pdf", "Get PDF file only").option("--markdown", "Get Markdown file only").addOption(
33862
33945
  new Option("--prefer <type>", "Preferred fulltext type").choices(["pdf", "markdown"])
33863
- ).option("--stdout", "Output file content to stdout").option("--uuid", "Interpret identifier as UUID").action(async (identifier, options) => {
33864
- await handleFulltextGetAction(identifier, options, program.opts());
33946
+ ).option("--stdout", "Output file content to stdout").option("--uuid", "Interpret identifiers as UUIDs").addOption(
33947
+ new Option("-o, --output <format>", "Output format: json|text").choices(["json", "text"]).default("text")
33948
+ ).action(async (identifiers, options) => {
33949
+ await handleFulltextGetAction(identifiers, options, program.opts());
33865
33950
  });
33866
33951
  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) => {
33867
33952
  await handleFulltextDetachAction(identifier, options, program.opts());
@@ -33916,4 +34001,4 @@ export {
33916
34001
  restoreStdinAfterInk as r,
33917
34002
  syncAttachments as s
33918
34003
  };
33919
- //# sourceMappingURL=index-BEQ4YIXx.js.map
34004
+ //# sourceMappingURL=index-B8ST0WLa.js.map