@ncukondo/reference-manager 0.32.0 → 0.33.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 (62) hide show
  1. package/dist/chunks/{SearchableMultiSelect-jAKQd_B0.js → SearchableMultiSelect-B8QVnO_p.js} +2 -2
  2. package/dist/chunks/{SearchableMultiSelect-jAKQd_B0.js.map → SearchableMultiSelect-B8QVnO_p.js.map} +1 -1
  3. package/dist/chunks/{action-menu-DLEwSKrj.js → action-menu-i1v02Qig.js} +3 -3
  4. package/dist/chunks/{action-menu-DLEwSKrj.js.map → action-menu-i1v02Qig.js.map} +1 -1
  5. package/dist/chunks/{checker-kVM4S67y.js → checker-CnWQe7v2.js} +4 -4
  6. package/dist/chunks/{checker-kVM4S67y.js.map → checker-CnWQe7v2.js.map} +1 -1
  7. package/dist/chunks/{crossref-client-DcJ42Qt6.js → crossref-client-Dxwv2A5D.js} +2 -2
  8. package/dist/chunks/{crossref-client-DcJ42Qt6.js.map → crossref-client-Dxwv2A5D.js.map} +1 -1
  9. package/dist/chunks/{fix-interaction-DWUzp9Ri.js → fix-interaction-D_zhtL9k.js} +5 -5
  10. package/dist/chunks/{fix-interaction-DWUzp9Ri.js.map → fix-interaction-D_zhtL9k.js.map} +1 -1
  11. package/dist/chunks/{index-BuQm8A5F.js → index-DMShdNwY.js} +4 -4
  12. package/dist/chunks/{index-BuQm8A5F.js.map → index-DMShdNwY.js.map} +1 -1
  13. package/dist/chunks/{index-B8iEozpf.js → index-DpZ-Ma7M.js} +3 -3
  14. package/dist/chunks/index-DpZ-Ma7M.js.map +1 -0
  15. package/dist/chunks/{index-CmkN2-2A.js → index-PkCQJBdt.js} +75 -32
  16. package/dist/chunks/index-PkCQJBdt.js.map +1 -0
  17. package/dist/chunks/{index-B4-i4PrU.js → index-a52FHX03.js} +672 -16
  18. package/dist/chunks/index-a52FHX03.js.map +1 -0
  19. package/dist/chunks/{loader-BG2eomDC.js → loader-CMu82BI5.js} +42 -1
  20. package/dist/chunks/loader-CMu82BI5.js.map +1 -0
  21. package/dist/chunks/{pubmed-client-Bhzz4Gg5.js → pubmed-client-CPFYI4kR.js} +2 -2
  22. package/dist/chunks/{pubmed-client-Bhzz4Gg5.js.map → pubmed-client-CPFYI4kR.js.map} +1 -1
  23. package/dist/chunks/{reference-select-B9b9Ez7Q.js → reference-select-aEB3-5rp.js} +3 -3
  24. package/dist/chunks/{reference-select-B9b9Ez7Q.js.map → reference-select-aEB3-5rp.js.map} +1 -1
  25. package/dist/chunks/{style-select-aXByJLOo.js → style-select-CQ4BBBZJ.js} +3 -3
  26. package/dist/chunks/{style-select-aXByJLOo.js.map → style-select-CQ4BBBZJ.js.map} +1 -1
  27. package/dist/cli/commands/add.d.ts +9 -1
  28. package/dist/cli/commands/add.d.ts.map +1 -1
  29. package/dist/cli/index.d.ts.map +1 -1
  30. package/dist/cli.js +2 -2
  31. package/dist/config/defaults.d.ts.map +1 -1
  32. package/dist/config/key-parser.d.ts.map +1 -1
  33. package/dist/config/loader.d.ts.map +1 -1
  34. package/dist/config/schema.d.ts +42 -0
  35. package/dist/config/schema.d.ts.map +1 -1
  36. package/dist/features/attachments/types.d.ts +5 -1
  37. package/dist/features/attachments/types.d.ts.map +1 -1
  38. package/dist/features/import/browser.d.ts +16 -0
  39. package/dist/features/import/browser.d.ts.map +1 -0
  40. package/dist/features/import/detector.d.ts +11 -2
  41. package/dist/features/import/detector.d.ts.map +1 -1
  42. package/dist/features/import/importer.d.ts +17 -0
  43. package/dist/features/import/importer.d.ts.map +1 -1
  44. package/dist/features/import/url-archive.d.ts +18 -0
  45. package/dist/features/import/url-archive.d.ts.map +1 -0
  46. package/dist/features/import/url-fetcher.d.ts +35 -0
  47. package/dist/features/import/url-fetcher.d.ts.map +1 -0
  48. package/dist/features/import/url-fulltext.d.ts +10 -0
  49. package/dist/features/import/url-fulltext.d.ts.map +1 -0
  50. package/dist/features/import/url-metadata.d.ts +34 -0
  51. package/dist/features/import/url-metadata.d.ts.map +1 -0
  52. package/dist/features/operations/add.d.ts +11 -0
  53. package/dist/features/operations/add.d.ts.map +1 -1
  54. package/dist/features/operations/json-output.d.ts +1 -0
  55. package/dist/features/operations/json-output.d.ts.map +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/server.js +1 -1
  58. package/package.json +8 -1
  59. package/dist/chunks/index-B4-i4PrU.js.map +0 -1
  60. package/dist/chunks/index-B8iEozpf.js.map +0 -1
  61. package/dist/chunks/index-CmkN2-2A.js.map +0 -1
  62. package/dist/chunks/loader-BG2eomDC.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { Command, Option } from "commander";
2
- 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 packageJson, u as getFulltextAttachmentTypes, v as startServerWithFileWatcher, w as BUILTIN_CONVERTER_NAMES, x as BUILTIN_CONVERTER_INFO } from "./index-B4-i4PrU.js";
2
+ 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 packageJson, u as getFulltextAttachmentTypes, v as startServerWithFileWatcher, w as BUILTIN_CONVERTER_NAMES, x as BUILTIN_CONVERTER_INFO } from "./index-a52FHX03.js";
3
3
  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-CWHg1yol.js";
4
4
  import * as fs from "node:fs";
5
5
  import { promises, readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, unlinkSync, rmSync, symlinkSync } from "node:fs";
@@ -8,7 +8,7 @@ import { homedir } from "node:os";
8
8
  import * as path from "node:path";
9
9
  import path__default, { join, basename, dirname, relative } from "node:path";
10
10
  import { readFile, unlink, stat, readdir, rename } from "node:fs/promises";
11
- import { o as openWithSystemApp, l as loadConfig, e as getDefaultCurrentDirConfigFilename, h as getDefaultUserConfigPath } from "./loader-BG2eomDC.js";
11
+ import { o as openWithSystemApp, l as loadConfig, e as getDefaultCurrentDirConfigFilename, h as getDefaultUserConfigPath } from "./loader-CMu82BI5.js";
12
12
  import { spawn, spawnSync } from "node:child_process";
13
13
  import process$1, { stdin, stdout } from "node:process";
14
14
  import * as readline from "node:readline";
@@ -164,6 +164,9 @@ function formatAddJsonOutput(result, options) {
164
164
  output.idChanged = true;
165
165
  output.originalId = item.originalId;
166
166
  }
167
+ if (item.warnings && item.warnings.length > 0) {
168
+ output.warnings = item.warnings;
169
+ }
167
170
  if (full) {
168
171
  const cslItem = items2.get(item.id);
169
172
  if (cslItem) {
@@ -349,12 +352,30 @@ async function executeAdd(options, context) {
349
352
  if (stdinContent !== void 0) {
350
353
  importOptions.stdinContent = stdinContent;
351
354
  }
355
+ if (options.urlConfig !== void 0) {
356
+ importOptions.urlConfig = options.urlConfig;
357
+ }
358
+ if (options.archiveFormat !== void 0) {
359
+ importOptions.archiveFormat = options.archiveFormat;
360
+ }
361
+ if (options.noArchive !== void 0) {
362
+ importOptions.noArchive = options.noArchive;
363
+ }
364
+ if (options.attachmentsDirectory !== void 0) {
365
+ importOptions.attachmentsDirectory = options.attachmentsDirectory;
366
+ }
352
367
  return context.library.import(inputs, importOptions);
353
368
  }
354
369
  function formatAddedItem(item) {
355
370
  const idPart = item.idChanged ? `${item.id} (was: ${item.originalId})` : item.id;
356
371
  const title2 = item.title ?? "(no title)";
357
- return ` - ${idPart}: "${title2}"`;
372
+ const lines = [` - ${idPart}: "${title2}"`];
373
+ if (item.warnings && item.warnings.length > 0) {
374
+ for (const warning of item.warnings) {
375
+ lines.push(` Warning: ${warning}`);
376
+ }
377
+ }
378
+ return lines.join("\n");
358
379
  }
359
380
  function formatFailedItem(item, verbose) {
360
381
  let error = item.error;
@@ -894,15 +915,15 @@ class OperationsLibrary {
894
915
  }
895
916
  // High-level operations
896
917
  async search(options) {
897
- const { searchReferences } = await import("./index-B4-i4PrU.js").then((n) => n.H);
918
+ const { searchReferences } = await import("./index-a52FHX03.js").then((n) => n.H);
898
919
  return searchReferences(this.library, options);
899
920
  }
900
921
  async list(options) {
901
- const { listReferences } = await import("./index-B4-i4PrU.js").then((n) => n.G);
922
+ const { listReferences } = await import("./index-a52FHX03.js").then((n) => n.G);
902
923
  return listReferences(this.library, options ?? {});
903
924
  }
904
925
  async cite(options) {
905
- const { citeReferences } = await import("./index-B4-i4PrU.js").then((n) => n.F);
926
+ const { citeReferences } = await import("./index-a52FHX03.js").then((n) => n.F);
906
927
  const defaultStyle = options.defaultStyle ?? this.citationConfig?.defaultStyle;
907
928
  const cslDirectory = options.cslDirectory ?? this.citationConfig?.cslDirectory;
908
929
  const mergedOptions = {
@@ -913,36 +934,36 @@ class OperationsLibrary {
913
934
  return citeReferences(this.library, mergedOptions);
914
935
  }
915
936
  async import(inputs, options) {
916
- const { addReferences } = await import("./index-B4-i4PrU.js").then((n) => n.D);
937
+ const { addReferences } = await import("./index-a52FHX03.js").then((n) => n.D);
917
938
  return addReferences(inputs, this.library, options ?? {});
918
939
  }
919
940
  async check(options) {
920
- const { checkReferences } = await import("./index-B4-i4PrU.js").then((n) => n.E);
941
+ const { checkReferences } = await import("./index-a52FHX03.js").then((n) => n.E);
921
942
  return checkReferences(this.library, options);
922
943
  }
923
944
  // Attachment operations
924
945
  async attachAdd(options) {
925
- const { addAttachment: addAttachment2 } = await import("./index-B8iEozpf.js");
946
+ const { addAttachment: addAttachment2 } = await import("./index-DpZ-Ma7M.js");
926
947
  return addAttachment2(this.library, options);
927
948
  }
928
949
  async attachList(options) {
929
- const { listAttachments: listAttachments2 } = await import("./index-B8iEozpf.js");
950
+ const { listAttachments: listAttachments2 } = await import("./index-DpZ-Ma7M.js");
930
951
  return listAttachments2(this.library, options);
931
952
  }
932
953
  async attachGet(options) {
933
- const { getAttachment: getAttachment2 } = await import("./index-B8iEozpf.js");
954
+ const { getAttachment: getAttachment2 } = await import("./index-DpZ-Ma7M.js");
934
955
  return getAttachment2(this.library, options);
935
956
  }
936
957
  async attachDetach(options) {
937
- const { detachAttachment: detachAttachment2 } = await import("./index-B8iEozpf.js");
958
+ const { detachAttachment: detachAttachment2 } = await import("./index-DpZ-Ma7M.js");
938
959
  return detachAttachment2(this.library, options);
939
960
  }
940
961
  async attachSync(options) {
941
- const { syncAttachments: syncAttachments2 } = await import("./index-B8iEozpf.js");
962
+ const { syncAttachments: syncAttachments2 } = await import("./index-DpZ-Ma7M.js");
942
963
  return syncAttachments2(this.library, options);
943
964
  }
944
965
  async attachOpen(options) {
945
- const { openAttachment: openAttachment2 } = await import("./index-B8iEozpf.js");
966
+ const { openAttachment: openAttachment2 } = await import("./index-DpZ-Ma7M.js");
946
967
  return openAttachment2(this.library, options);
947
968
  }
948
969
  }
@@ -1807,7 +1828,7 @@ function getAttachExitCode(result) {
1807
1828
  }
1808
1829
  async function executeInteractiveSelect$3(context, config2) {
1809
1830
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
1810
- const { selectReferencesOrExit } = await import("./reference-select-B9b9Ez7Q.js");
1831
+ const { selectReferencesOrExit } = await import("./reference-select-aEB3-5rp.js");
1811
1832
  const allReferences = await context.library.getAll();
1812
1833
  const identifiers = await withAlternateScreen2(
1813
1834
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -2472,7 +2493,7 @@ async function handleCheckAction(identifiers, options, globalOpts) {
2472
2493
  const jsonOptions = buildJsonOptionsFromRefs(options, outputFormat, result, allRefs);
2473
2494
  outputCheckResult(result, outputFormat, jsonOptions);
2474
2495
  if (options.fix && result.summary.warnings > 0 && allRefs) {
2475
- const { runFixInteraction } = await import("./fix-interaction-DWUzp9Ri.js");
2496
+ const { runFixInteraction } = await import("./fix-interaction-D_zhtL9k.js");
2476
2497
  const findItem = (id2) => allRefs.find((item) => item.id === id2);
2477
2498
  const fixResult = await runFixInteraction(result.results, context.library, findItem);
2478
2499
  const removedSuffix = fixResult.removed.length > 0 ? `, ${fixResult.removed.length} removed` : "";
@@ -2540,7 +2561,7 @@ function outputCheckError(error, format2) {
2540
2561
  }
2541
2562
  async function selectReferencesInteractively(context, config2) {
2542
2563
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
2543
- const { selectReferenceItemsOrExit } = await import("./reference-select-B9b9Ez7Q.js");
2564
+ const { selectReferenceItemsOrExit } = await import("./reference-select-aEB3-5rp.js");
2544
2565
  const allReferences = await context.library.getAll();
2545
2566
  if (allReferences.length === 0) {
2546
2567
  process.stderr.write("No references in library.\n");
@@ -2608,8 +2629,8 @@ function getCiteExitCode(result) {
2608
2629
  }
2609
2630
  async function executeInteractiveCite(options, context, config2) {
2610
2631
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
2611
- const { runCiteFlow } = await import("./index-BuQm8A5F.js");
2612
- const { buildStyleChoices, listCustomStyles } = await import("./style-select-aXByJLOo.js");
2632
+ const { runCiteFlow } = await import("./index-DMShdNwY.js");
2633
+ const { buildStyleChoices, listCustomStyles } = await import("./style-select-CQ4BBBZJ.js");
2613
2634
  const { search } = await import("./file-watcher-CWHg1yol.js").then((n) => n.B);
2614
2635
  const { tokenize } = await import("./file-watcher-CWHg1yol.js").then((n) => n.A);
2615
2636
  const { checkTTY } = await import("./tty-BMyaEOhX.js");
@@ -2824,6 +2845,15 @@ const CONFIG_KEY_REGISTRY = [
2824
2845
  },
2825
2846
  // attachments section
2826
2847
  { key: "attachments.directory", type: "string", description: "Attachments storage directory" },
2848
+ // url section
2849
+ {
2850
+ key: "url.archive_format",
2851
+ type: "enum",
2852
+ description: "Default archive format for URL import",
2853
+ enumValues: ["mhtml", "html"]
2854
+ },
2855
+ { key: "url.browser_path", type: "string", description: "Browser executable path" },
2856
+ { key: "url.timeout", type: "integer", description: "Navigation timeout (seconds)" },
2827
2857
  // cli section
2828
2858
  {
2829
2859
  key: "cli.default_limit",
@@ -7292,7 +7322,7 @@ function formatEditOutput(result) {
7292
7322
  }
7293
7323
  async function executeInteractiveEdit(options, context, config2) {
7294
7324
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
7295
- const { selectReferencesOrExit } = await import("./reference-select-B9b9Ez7Q.js");
7325
+ const { selectReferencesOrExit } = await import("./reference-select-aEB3-5rp.js");
7296
7326
  const allReferences = await context.library.getAll();
7297
7327
  const identifiers = await withAlternateScreen2(
7298
7328
  () => selectReferencesOrExit(allReferences, { multiSelect: true }, config2.cli.tui)
@@ -10868,7 +10898,7 @@ function getFulltextExitCode(result) {
10868
10898
  }
10869
10899
  async function executeInteractiveSelect$2(context, config2, multiSelect = false) {
10870
10900
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
10871
- const { selectReferencesOrExit } = await import("./reference-select-B9b9Ez7Q.js");
10901
+ const { selectReferencesOrExit } = await import("./reference-select-aEB3-5rp.js");
10872
10902
  const allReferences = await context.library.getAll();
10873
10903
  const identifiers = await withAlternateScreen2(
10874
10904
  () => selectReferencesOrExit(allReferences, { multiSelect }, config2.cli.tui)
@@ -32525,7 +32555,7 @@ async function mcpStart(options) {
32525
32555
  async function executeRemove(options, context) {
32526
32556
  const { identifier, idType = "id", fulltextDirectory, deleteFulltext = false } = options;
32527
32557
  if (context.mode === "local" && deleteFulltext && fulltextDirectory) {
32528
- const { removeReference } = await import("./index-B4-i4PrU.js").then((n) => n.A);
32558
+ const { removeReference } = await import("./index-a52FHX03.js").then((n) => n.A);
32529
32559
  return removeReference(context.library, {
32530
32560
  identifier,
32531
32561
  idType,
@@ -32580,7 +32610,7 @@ Continue?`;
32580
32610
  }
32581
32611
  async function executeInteractiveRemove(context, config2) {
32582
32612
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32583
- const { selectReferenceItemsOrExit } = await import("./reference-select-B9b9Ez7Q.js");
32613
+ const { selectReferenceItemsOrExit } = await import("./reference-select-aEB3-5rp.js");
32584
32614
  const allReferences = await context.library.getAll();
32585
32615
  const selectedItems = await withAlternateScreen2(
32586
32616
  () => selectReferenceItemsOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -32805,7 +32835,7 @@ async function executeInteractiveSearch(options, context, config2) {
32805
32835
  validateInteractiveOptions(options);
32806
32836
  const { checkTTY } = await import("./tty-BMyaEOhX.js");
32807
32837
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
32808
- const { runSearchFlow } = await import("./index-BuQm8A5F.js");
32838
+ const { runSearchFlow } = await import("./index-DMShdNwY.js");
32809
32839
  const { search } = await import("./file-watcher-CWHg1yol.js").then((n) => n.B);
32810
32840
  const { tokenize } = await import("./file-watcher-CWHg1yol.js").then((n) => n.A);
32811
32841
  checkTTY();
@@ -32824,7 +32854,7 @@ async function executeInteractiveSearch(options, context, config2) {
32824
32854
  })
32825
32855
  );
32826
32856
  if (result.selectedItems && !result.cancelled) {
32827
- const { isSideEffectAction } = await import("./action-menu-DLEwSKrj.js");
32857
+ const { isSideEffectAction } = await import("./action-menu-i1v02Qig.js");
32828
32858
  if (isSideEffectAction(result.action)) {
32829
32859
  await executeSideEffectAction(result.action, result.selectedItems, context, config2);
32830
32860
  return { output: "", cancelled: false, action: result.action };
@@ -32840,7 +32870,7 @@ async function executeSideEffectAction(action, items2, context, config2) {
32840
32870
  switch (action) {
32841
32871
  case "open-url": {
32842
32872
  const { resolveDefaultUrl: resolveDefaultUrl2 } = await Promise.resolve().then(() => url);
32843
- const { openWithSystemApp: openWithSystemApp2 } = await import("./loader-BG2eomDC.js").then((n) => n.j);
32873
+ const { openWithSystemApp: openWithSystemApp2 } = await import("./loader-CMu82BI5.js").then((n) => n.j);
32844
32874
  const item = items2[0];
32845
32875
  if (!item) return;
32846
32876
  const url$1 = resolveDefaultUrl2(item);
@@ -33122,7 +33152,7 @@ function formatShowOutput(item, options, attachmentsDirectory) {
33122
33152
  }
33123
33153
  async function executeInteractiveSelect$1(context, config2) {
33124
33154
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
33125
- const { selectReferencesOrExit } = await import("./reference-select-B9b9Ez7Q.js");
33155
+ const { selectReferencesOrExit } = await import("./reference-select-aEB3-5rp.js");
33126
33156
  const allReferences = await context.library.getAll();
33127
33157
  const identifiers = await withAlternateScreen2(
33128
33158
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -33371,7 +33401,7 @@ function formatUpdateOutput(result, identifier) {
33371
33401
  }
33372
33402
  async function executeInteractiveUpdate(context, config2) {
33373
33403
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
33374
- const { selectReferencesOrExit } = await import("./reference-select-B9b9Ez7Q.js");
33404
+ const { selectReferencesOrExit } = await import("./reference-select-aEB3-5rp.js");
33375
33405
  const allReferences = await context.library.getAll();
33376
33406
  const identifiers = await withAlternateScreen2(
33377
33407
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -33666,7 +33696,7 @@ function getUrlExitCode(result) {
33666
33696
  }
33667
33697
  async function executeInteractiveSelect(context, config2) {
33668
33698
  const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
33669
- const { selectReferencesOrExit } = await import("./reference-select-B9b9Ez7Q.js");
33699
+ const { selectReferencesOrExit } = await import("./reference-select-aEB3-5rp.js");
33670
33700
  const allReferences = await context.library.getAll();
33671
33701
  const identifiers = await withAlternateScreen2(
33672
33702
  () => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
@@ -34255,6 +34285,14 @@ function buildAddOptions(inputs, options, config2, stdinContent) {
34255
34285
  if (Object.keys(pubmedConfig).length > 0) {
34256
34286
  addOptions.pubmedConfig = pubmedConfig;
34257
34287
  }
34288
+ addOptions.urlConfig = config2.url;
34289
+ if (options.archiveFormat !== void 0) {
34290
+ addOptions.archiveFormat = options.archiveFormat;
34291
+ }
34292
+ if (options.archive === false) {
34293
+ addOptions.noArchive = true;
34294
+ }
34295
+ addOptions.attachmentsDirectory = config2.attachments.directory;
34258
34296
  return addOptions;
34259
34297
  }
34260
34298
  async function outputAddResultJson(result, context, full) {
@@ -34279,7 +34317,7 @@ function shouldAutoFetch(cliFlag, configEnabled) {
34279
34317
  return configEnabled;
34280
34318
  }
34281
34319
  async function performAutoFetch(addedItems, context, config2) {
34282
- const { fulltextFetch: fulltextFetch2 } = await import("./index-B4-i4PrU.js").then((n) => n.z);
34320
+ const { fulltextFetch: fulltextFetch2 } = await import("./index-a52FHX03.js").then((n) => n.z);
34283
34321
  const fetchResults = await autoFetchFulltext(addedItems, context, {
34284
34322
  fulltextConfig: config2.fulltext,
34285
34323
  fulltextDirectory: config2.attachments.directory,
@@ -34341,7 +34379,12 @@ function registerAddCommand(program) {
34341
34379
  "-i, --input <format>",
34342
34380
  "Input format: json|bibtex|ris|pmid|doi|isbn|arxiv|auto",
34343
34381
  "auto"
34344
- ).option("--verbose", "Show detailed error information").option("-o, --output <format>", "Output format: json|text", "text").option("--full", "Include full CSL-JSON data in JSON output").option("--fetch-fulltext", "Auto-fetch OA fulltext after adding").option("--no-fetch-fulltext", "Disable auto-fetch fulltext (overrides config)").action(async (inputs, options) => {
34382
+ ).option("--verbose", "Show detailed error information").option("-o, --output <format>", "Output format: json|text", "text").option("--full", "Include full CSL-JSON data in JSON output").option("--fetch-fulltext", "Auto-fetch OA fulltext after adding").option("--no-fetch-fulltext", "Disable auto-fetch fulltext (overrides config)").addOption(
34383
+ new Option("--archive-format <format>", "Archive format for URL import").choices([
34384
+ "mhtml",
34385
+ "html"
34386
+ ])
34387
+ ).option("--no-archive", "Skip archive creation for URL import").action(async (inputs, options) => {
34345
34388
  await handleAddAction(inputs, options, program);
34346
34389
  });
34347
34390
  }
@@ -34593,4 +34636,4 @@ export {
34593
34636
  restoreStdinAfterInk as r,
34594
34637
  syncAttachments as s
34595
34638
  };
34596
- //# sourceMappingURL=index-CmkN2-2A.js.map
34639
+ //# sourceMappingURL=index-PkCQJBdt.js.map