@ncukondo/reference-manager 0.22.0 → 0.22.2
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.
- package/dist/chunks/{action-menu-B1DCdkkp.js → action-menu-R-QKMCZJ.js} +3 -3
- package/dist/chunks/{action-menu-B1DCdkkp.js.map → action-menu-R-QKMCZJ.js.map} +1 -1
- package/dist/chunks/{file-watcher-CrsNHUpz.js → file-watcher-Dyns9dxx.js} +30 -22
- package/dist/chunks/file-watcher-Dyns9dxx.js.map +1 -0
- package/dist/chunks/{format-CfTZqhUx.js → format-uBMjeVAZ.js} +23 -8
- package/dist/chunks/format-uBMjeVAZ.js.map +1 -0
- package/dist/chunks/{index-BvIfOciH.js → index-B7NyGOm6.js} +13 -6
- package/dist/chunks/index-B7NyGOm6.js.map +1 -0
- package/dist/chunks/{index-D7eiOplw.js → index-CXZ_Trjb.js} +3 -3
- package/dist/chunks/index-CXZ_Trjb.js.map +1 -0
- package/dist/chunks/{index-BK3hTiKR.js → index-DFhoO9RA.js} +2 -2
- package/dist/chunks/{index-BK3hTiKR.js.map → index-DFhoO9RA.js.map} +1 -1
- package/dist/chunks/{index-DOvEusHb.js → index-DxjW_BKA.js} +37 -41
- package/dist/chunks/index-DxjW_BKA.js.map +1 -0
- package/dist/chunks/{loader-BHvcats5.js → loader-BZgpKsTG.js} +2 -2
- package/dist/chunks/{loader-BHvcats5.js.map → loader-BZgpKsTG.js.map} +1 -1
- package/dist/chunks/{reference-select-DTqhevya.js → reference-select-Cpq_Q4f6.js} +4 -4
- package/dist/chunks/{reference-select-DTqhevya.js.map → reference-select-Cpq_Q4f6.js.map} +1 -1
- package/dist/chunks/{style-select-CXclvgJO.js → style-select-CQIqnmWS.js} +3 -3
- package/dist/chunks/{style-select-CXclvgJO.js.map → style-select-CQIqnmWS.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/config/toml-writer.d.ts.map +1 -1
- package/dist/core/csl-json/serializer.d.ts.map +1 -1
- package/dist/features/interactive/apps/SearchFlowApp.d.ts +3 -1
- package/dist/features/interactive/apps/SearchFlowApp.d.ts.map +1 -1
- package/dist/features/interactive/apps/runSearchFlow.d.ts +1 -1
- package/dist/features/interactive/apps/runSearchFlow.d.ts.map +1 -1
- package/dist/features/interactive/components/SearchableMultiSelect.d.ts +3 -1
- package/dist/features/interactive/components/SearchableMultiSelect.d.ts.map +1 -1
- package/dist/index.js +16 -24
- package/dist/index.js.map +1 -1
- package/dist/server/portfile.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/file-watcher-CrsNHUpz.js.map +0 -1
- package/dist/chunks/format-CfTZqhUx.js.map +0 -1
- package/dist/chunks/index-BvIfOciH.js.map +0 -1
- package/dist/chunks/index-D7eiOplw.js.map +0 -1
- package/dist/chunks/index-DOvEusHb.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { i as isEqual, M as MANAGED_CUSTOM_FIELDS, L as Library,
|
|
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
|
-
import { promises, readFileSync, existsSync,
|
|
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-
|
|
9
|
-
import { readFile, unlink, stat, readdir, rename
|
|
10
|
-
import { o as openWithSystemApp, l as loadConfig, e as getDefaultCurrentDirConfigFilename, h as getDefaultUserConfigPath } from "./loader-
|
|
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";
|
|
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";
|
|
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.
|
|
22
|
+
const version$1 = "0.22.2";
|
|
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,
|
|
@@ -289,14 +289,12 @@ function getPortfilePath() {
|
|
|
289
289
|
return path.join(tmpDir, "reference-manager", "server.port");
|
|
290
290
|
}
|
|
291
291
|
async function writePortfile(portfilePath, port, pid, library, started_at) {
|
|
292
|
-
const dir = path.dirname(portfilePath);
|
|
293
|
-
await promises.mkdir(dir, { recursive: true });
|
|
294
292
|
const data = { port, pid, library };
|
|
295
293
|
if (started_at !== void 0) {
|
|
296
294
|
data.started_at = started_at;
|
|
297
295
|
}
|
|
298
296
|
const content = JSON.stringify(data, null, 2);
|
|
299
|
-
await
|
|
297
|
+
await writeFileAtomic(portfilePath, content);
|
|
300
298
|
}
|
|
301
299
|
async function readPortfile(portfilePath) {
|
|
302
300
|
try {
|
|
@@ -904,15 +902,15 @@ class OperationsLibrary {
|
|
|
904
902
|
}
|
|
905
903
|
// High-level operations
|
|
906
904
|
async search(options) {
|
|
907
|
-
const { searchReferences } = await import("./index-
|
|
905
|
+
const { searchReferences } = await import("./index-DFhoO9RA.js").then((n) => n.z);
|
|
908
906
|
return searchReferences(this.library, options);
|
|
909
907
|
}
|
|
910
908
|
async list(options) {
|
|
911
|
-
const { listReferences } = await import("./index-
|
|
909
|
+
const { listReferences } = await import("./index-DFhoO9RA.js").then((n) => n.y);
|
|
912
910
|
return listReferences(this.library, options ?? {});
|
|
913
911
|
}
|
|
914
912
|
async cite(options) {
|
|
915
|
-
const { citeReferences } = await import("./index-
|
|
913
|
+
const { citeReferences } = await import("./index-DFhoO9RA.js").then((n) => n.x);
|
|
916
914
|
const defaultStyle = options.defaultStyle ?? this.citationConfig?.defaultStyle;
|
|
917
915
|
const cslDirectory = options.cslDirectory ?? this.citationConfig?.cslDirectory;
|
|
918
916
|
const mergedOptions = {
|
|
@@ -923,32 +921,32 @@ class OperationsLibrary {
|
|
|
923
921
|
return citeReferences(this.library, mergedOptions);
|
|
924
922
|
}
|
|
925
923
|
async import(inputs, options) {
|
|
926
|
-
const { addReferences } = await import("./index-
|
|
924
|
+
const { addReferences } = await import("./index-DFhoO9RA.js").then((n) => n.w);
|
|
927
925
|
return addReferences(inputs, this.library, options ?? {});
|
|
928
926
|
}
|
|
929
927
|
// Attachment operations
|
|
930
928
|
async attachAdd(options) {
|
|
931
|
-
const { addAttachment: addAttachment2 } = await import("./index-
|
|
929
|
+
const { addAttachment: addAttachment2 } = await import("./index-CXZ_Trjb.js");
|
|
932
930
|
return addAttachment2(this.library, options);
|
|
933
931
|
}
|
|
934
932
|
async attachList(options) {
|
|
935
|
-
const { listAttachments: listAttachments2 } = await import("./index-
|
|
933
|
+
const { listAttachments: listAttachments2 } = await import("./index-CXZ_Trjb.js");
|
|
936
934
|
return listAttachments2(this.library, options);
|
|
937
935
|
}
|
|
938
936
|
async attachGet(options) {
|
|
939
|
-
const { getAttachment: getAttachment2 } = await import("./index-
|
|
937
|
+
const { getAttachment: getAttachment2 } = await import("./index-CXZ_Trjb.js");
|
|
940
938
|
return getAttachment2(this.library, options);
|
|
941
939
|
}
|
|
942
940
|
async attachDetach(options) {
|
|
943
|
-
const { detachAttachment: detachAttachment2 } = await import("./index-
|
|
941
|
+
const { detachAttachment: detachAttachment2 } = await import("./index-CXZ_Trjb.js");
|
|
944
942
|
return detachAttachment2(this.library, options);
|
|
945
943
|
}
|
|
946
944
|
async attachSync(options) {
|
|
947
|
-
const { syncAttachments: syncAttachments2 } = await import("./index-
|
|
945
|
+
const { syncAttachments: syncAttachments2 } = await import("./index-CXZ_Trjb.js");
|
|
948
946
|
return syncAttachments2(this.library, options);
|
|
949
947
|
}
|
|
950
948
|
async attachOpen(options) {
|
|
951
|
-
const { openAttachment: openAttachment2 } = await import("./index-
|
|
949
|
+
const { openAttachment: openAttachment2 } = await import("./index-CXZ_Trjb.js");
|
|
952
950
|
return openAttachment2(this.library, options);
|
|
953
951
|
}
|
|
954
952
|
}
|
|
@@ -1792,7 +1790,7 @@ function getAttachExitCode(result) {
|
|
|
1792
1790
|
}
|
|
1793
1791
|
async function executeInteractiveSelect$2(context, config2) {
|
|
1794
1792
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
1795
|
-
const { selectReferencesOrExit } = await import("./reference-select-
|
|
1793
|
+
const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
|
|
1796
1794
|
const allReferences = await context.library.getAll();
|
|
1797
1795
|
const identifiers = await withAlternateScreen2(
|
|
1798
1796
|
() => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
|
|
@@ -2340,10 +2338,10 @@ function getCiteExitCode(result) {
|
|
|
2340
2338
|
}
|
|
2341
2339
|
async function executeInteractiveCite(options, context, config2) {
|
|
2342
2340
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
2343
|
-
const { runCiteFlow } = await import("./index-
|
|
2344
|
-
const { buildStyleChoices, listCustomStyles } = await import("./style-select-
|
|
2345
|
-
const { search } = await import("./file-watcher-
|
|
2346
|
-
const { tokenize } = await import("./file-watcher-
|
|
2341
|
+
const { runCiteFlow } = await import("./index-B7NyGOm6.js");
|
|
2342
|
+
const { buildStyleChoices, listCustomStyles } = await import("./style-select-CQIqnmWS.js");
|
|
2343
|
+
const { search } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.B);
|
|
2344
|
+
const { tokenize } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.A);
|
|
2347
2345
|
const { checkTTY } = await import("./tty-BMyaEOhX.js");
|
|
2348
2346
|
checkTTY();
|
|
2349
2347
|
const allReferences = await context.library.getAll();
|
|
@@ -2912,13 +2910,11 @@ function loadExistingTOML(filePath) {
|
|
|
2912
2910
|
}
|
|
2913
2911
|
}
|
|
2914
2912
|
async function writeTOMLValue(filePath, key, value) {
|
|
2915
|
-
const dir = dirname(filePath);
|
|
2916
|
-
await mkdir(dir, { recursive: true });
|
|
2917
2913
|
const obj = loadExistingTOML(filePath);
|
|
2918
2914
|
const keyPath = parseKeyPath(key);
|
|
2919
2915
|
setNestedValue(obj, keyPath, value);
|
|
2920
2916
|
const content = serializeToTOML$1(obj);
|
|
2921
|
-
|
|
2917
|
+
await writeFileAtomic(filePath, content);
|
|
2922
2918
|
}
|
|
2923
2919
|
async function removeTOMLKey(filePath, key) {
|
|
2924
2920
|
if (!existsSync(filePath)) {
|
|
@@ -2929,7 +2925,7 @@ async function removeTOMLKey(filePath, key) {
|
|
|
2929
2925
|
const removed = removeNestedValue(obj, keyPath);
|
|
2930
2926
|
if (removed) {
|
|
2931
2927
|
const content = serializeToTOML$1(obj);
|
|
2932
|
-
|
|
2928
|
+
await writeFileAtomic(filePath, content);
|
|
2933
2929
|
}
|
|
2934
2930
|
}
|
|
2935
2931
|
async function setConfigValue(configPath, key, value, options = {}) {
|
|
@@ -6923,7 +6919,7 @@ function formatEditOutput(result) {
|
|
|
6923
6919
|
}
|
|
6924
6920
|
async function executeInteractiveEdit(options, context, config2) {
|
|
6925
6921
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
6926
|
-
const { selectReferencesOrExit } = await import("./reference-select-
|
|
6922
|
+
const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
|
|
6927
6923
|
const allReferences = await context.library.getAll();
|
|
6928
6924
|
const identifiers = await withAlternateScreen2(
|
|
6929
6925
|
() => selectReferencesOrExit(allReferences, { multiSelect: true }, config2.cli.tui)
|
|
@@ -10460,7 +10456,7 @@ function getFulltextExitCode(result) {
|
|
|
10460
10456
|
}
|
|
10461
10457
|
async function executeInteractiveSelect$1(context, config2) {
|
|
10462
10458
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
10463
|
-
const { selectReferencesOrExit } = await import("./reference-select-
|
|
10459
|
+
const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
|
|
10464
10460
|
const allReferences = await context.library.getAll();
|
|
10465
10461
|
const identifiers = await withAlternateScreen2(
|
|
10466
10462
|
() => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
|
|
@@ -31754,7 +31750,7 @@ async function mcpStart(options) {
|
|
|
31754
31750
|
async function executeRemove(options, context) {
|
|
31755
31751
|
const { identifier, idType = "id", fulltextDirectory, deleteFulltext = false } = options;
|
|
31756
31752
|
if (context.mode === "local" && deleteFulltext && fulltextDirectory) {
|
|
31757
|
-
const { removeReference } = await import("./index-
|
|
31753
|
+
const { removeReference } = await import("./index-DFhoO9RA.js").then((n) => n.v);
|
|
31758
31754
|
return removeReference(context.library, {
|
|
31759
31755
|
identifier,
|
|
31760
31756
|
idType,
|
|
@@ -31809,7 +31805,7 @@ Continue?`;
|
|
|
31809
31805
|
}
|
|
31810
31806
|
async function executeInteractiveRemove(context, config2) {
|
|
31811
31807
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
31812
|
-
const { selectReferenceItemsOrExit } = await import("./reference-select-
|
|
31808
|
+
const { selectReferenceItemsOrExit } = await import("./reference-select-Cpq_Q4f6.js");
|
|
31813
31809
|
const allReferences = await context.library.getAll();
|
|
31814
31810
|
const selectedItems = await withAlternateScreen2(
|
|
31815
31811
|
() => selectReferenceItemsOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
|
|
@@ -32034,9 +32030,9 @@ async function executeInteractiveSearch(options, context, config2) {
|
|
|
32034
32030
|
validateInteractiveOptions(options);
|
|
32035
32031
|
const { checkTTY } = await import("./tty-BMyaEOhX.js");
|
|
32036
32032
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
32037
|
-
const { runSearchFlow } = await import("./index-
|
|
32038
|
-
const { search } = await import("./file-watcher-
|
|
32039
|
-
const { tokenize } = await import("./file-watcher-
|
|
32033
|
+
const { runSearchFlow } = await import("./index-B7NyGOm6.js");
|
|
32034
|
+
const { search } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.B);
|
|
32035
|
+
const { tokenize } = await import("./file-watcher-Dyns9dxx.js").then((n) => n.A);
|
|
32040
32036
|
checkTTY();
|
|
32041
32037
|
const allReferences = await context.library.getAll();
|
|
32042
32038
|
const searchFn = (query) => {
|
|
@@ -32053,7 +32049,7 @@ async function executeInteractiveSearch(options, context, config2) {
|
|
|
32053
32049
|
})
|
|
32054
32050
|
);
|
|
32055
32051
|
if (result.selectedItems && !result.cancelled) {
|
|
32056
|
-
const { isSideEffectAction } = await import("./action-menu-
|
|
32052
|
+
const { isSideEffectAction } = await import("./action-menu-R-QKMCZJ.js");
|
|
32057
32053
|
if (isSideEffectAction(result.action)) {
|
|
32058
32054
|
await executeSideEffectAction(result.action, result.selectedItems, context, config2);
|
|
32059
32055
|
return { output: "", cancelled: false, action: result.action };
|
|
@@ -32069,7 +32065,7 @@ async function executeSideEffectAction(action, items2, context, config2) {
|
|
|
32069
32065
|
switch (action) {
|
|
32070
32066
|
case "open-url": {
|
|
32071
32067
|
const { resolveDefaultUrl: resolveDefaultUrl2 } = await Promise.resolve().then(() => url);
|
|
32072
|
-
const { openWithSystemApp: openWithSystemApp2 } = await import("./loader-
|
|
32068
|
+
const { openWithSystemApp: openWithSystemApp2 } = await import("./loader-BZgpKsTG.js").then((n) => n.j);
|
|
32073
32069
|
const item = items2[0];
|
|
32074
32070
|
if (!item) return;
|
|
32075
32071
|
const url$1 = resolveDefaultUrl2(item);
|
|
@@ -32456,7 +32452,7 @@ function formatUpdateOutput(result, identifier) {
|
|
|
32456
32452
|
}
|
|
32457
32453
|
async function executeInteractiveUpdate(context, config2) {
|
|
32458
32454
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
32459
|
-
const { selectReferencesOrExit } = await import("./reference-select-
|
|
32455
|
+
const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
|
|
32460
32456
|
const allReferences = await context.library.getAll();
|
|
32461
32457
|
const identifiers = await withAlternateScreen2(
|
|
32462
32458
|
() => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
|
|
@@ -32751,7 +32747,7 @@ function getUrlExitCode(result) {
|
|
|
32751
32747
|
}
|
|
32752
32748
|
async function executeInteractiveSelect(context, config2) {
|
|
32753
32749
|
const { withAlternateScreen: withAlternateScreen2 } = await Promise.resolve().then(() => alternateScreen);
|
|
32754
|
-
const { selectReferencesOrExit } = await import("./reference-select-
|
|
32750
|
+
const { selectReferencesOrExit } = await import("./reference-select-Cpq_Q4f6.js");
|
|
32755
32751
|
const allReferences = await context.library.getAll();
|
|
32756
32752
|
const identifiers = await withAlternateScreen2(
|
|
32757
32753
|
() => selectReferencesOrExit(allReferences, { multiSelect: false }, config2.cli.tui)
|
|
@@ -33254,7 +33250,7 @@ function shouldAutoFetch(cliFlag, configEnabled) {
|
|
|
33254
33250
|
return configEnabled;
|
|
33255
33251
|
}
|
|
33256
33252
|
async function performAutoFetch(addedItems, context, config2) {
|
|
33257
|
-
const { fulltextFetch: fulltextFetch2 } = await import("./index-
|
|
33253
|
+
const { fulltextFetch: fulltextFetch2 } = await import("./index-DFhoO9RA.js").then((n) => n.u);
|
|
33258
33254
|
const fetchResults = await autoFetchFulltext(addedItems, context, {
|
|
33259
33255
|
fulltextConfig: config2.fulltext,
|
|
33260
33256
|
fulltextDirectory: config2.attachments.directory,
|
|
@@ -33529,4 +33525,4 @@ export {
|
|
|
33529
33525
|
restoreStdinAfterInk as r,
|
|
33530
33526
|
syncAttachments as s
|
|
33531
33527
|
};
|
|
33532
|
-
//# sourceMappingURL=index-
|
|
33528
|
+
//# sourceMappingURL=index-DxjW_BKA.js.map
|