@ncukondo/reference-manager 0.1.0 → 0.3.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.
- package/README.md +40 -0
- package/dist/chunks/detector-DHztTaFY.js +619 -0
- package/dist/chunks/detector-DHztTaFY.js.map +1 -0
- package/dist/chunks/{detector-BF8Mcc72.js → loader-mQ25o6cV.js} +303 -664
- package/dist/chunks/loader-mQ25o6cV.js.map +1 -0
- package/dist/chunks/search-Be9vzUIH.js +29541 -0
- package/dist/chunks/search-Be9vzUIH.js.map +1 -0
- package/dist/cli/commands/add.d.ts +44 -16
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/cite.d.ts +49 -0
- package/dist/cli/commands/cite.d.ts.map +1 -0
- package/dist/cli/commands/fulltext.d.ts +101 -0
- package/dist/cli/commands/fulltext.d.ts.map +1 -0
- package/dist/cli/commands/index.d.ts +14 -10
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/list.d.ts +23 -6
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/remove.d.ts +47 -12
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/search.d.ts +24 -7
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +26 -13
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/execution-context.d.ts +60 -0
- package/dist/cli/execution-context.d.ts.map +1 -0
- package/dist/cli/helpers.d.ts +18 -0
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/server-client.d.ts +73 -10
- package/dist/cli/server-client.d.ts.map +1 -1
- package/dist/cli.js +1200 -528
- package/dist/cli.js.map +1 -1
- package/dist/config/csl-styles.d.ts +83 -0
- package/dist/config/csl-styles.d.ts.map +1 -0
- package/dist/config/defaults.d.ts +10 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/schema.d.ts +84 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/core/csl-json/types.d.ts +15 -3
- package/dist/core/csl-json/types.d.ts.map +1 -1
- package/dist/core/library.d.ts +60 -0
- package/dist/core/library.d.ts.map +1 -1
- package/dist/features/format/bibtex.d.ts +6 -0
- package/dist/features/format/bibtex.d.ts.map +1 -0
- package/dist/features/format/citation-csl.d.ts +41 -0
- package/dist/features/format/citation-csl.d.ts.map +1 -0
- package/dist/features/format/citation-fallback.d.ts +24 -0
- package/dist/features/format/citation-fallback.d.ts.map +1 -0
- package/dist/features/format/index.d.ts +10 -0
- package/dist/features/format/index.d.ts.map +1 -0
- package/dist/features/format/json.d.ts +6 -0
- package/dist/features/format/json.d.ts.map +1 -0
- package/dist/features/format/pretty.d.ts +6 -0
- package/dist/features/format/pretty.d.ts.map +1 -0
- package/dist/features/fulltext/filename.d.ts +17 -0
- package/dist/features/fulltext/filename.d.ts.map +1 -0
- package/dist/features/fulltext/index.d.ts +7 -0
- package/dist/features/fulltext/index.d.ts.map +1 -0
- package/dist/features/fulltext/manager.d.ts +109 -0
- package/dist/features/fulltext/manager.d.ts.map +1 -0
- package/dist/features/fulltext/types.d.ts +12 -0
- package/dist/features/fulltext/types.d.ts.map +1 -0
- package/dist/features/import/cache.d.ts +37 -0
- package/dist/features/import/cache.d.ts.map +1 -0
- package/dist/features/import/detector.d.ts +42 -0
- package/dist/features/import/detector.d.ts.map +1 -0
- package/dist/features/import/fetcher.d.ts +49 -0
- package/dist/features/import/fetcher.d.ts.map +1 -0
- package/dist/features/import/importer.d.ts +61 -0
- package/dist/features/import/importer.d.ts.map +1 -0
- package/dist/features/import/index.d.ts +8 -0
- package/dist/features/import/index.d.ts.map +1 -0
- package/dist/features/import/normalizer.d.ts +15 -0
- package/dist/features/import/normalizer.d.ts.map +1 -0
- package/dist/features/import/parser.d.ts +33 -0
- package/dist/features/import/parser.d.ts.map +1 -0
- package/dist/features/import/rate-limiter.d.ts +45 -0
- package/dist/features/import/rate-limiter.d.ts.map +1 -0
- package/dist/features/operations/add.d.ts +65 -0
- package/dist/features/operations/add.d.ts.map +1 -0
- package/dist/features/operations/cite.d.ts +48 -0
- package/dist/features/operations/cite.d.ts.map +1 -0
- package/dist/features/operations/list.d.ts +28 -0
- package/dist/features/operations/list.d.ts.map +1 -0
- package/dist/features/operations/remove.d.ts +29 -0
- package/dist/features/operations/remove.d.ts.map +1 -0
- package/dist/features/operations/search.d.ts +30 -0
- package/dist/features/operations/search.d.ts.map +1 -0
- package/dist/features/operations/update.d.ts +39 -0
- package/dist/features/operations/update.d.ts.map +1 -0
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/routes/add.d.ts +11 -0
- package/dist/server/routes/add.d.ts.map +1 -0
- package/dist/server/routes/cite.d.ts +9 -0
- package/dist/server/routes/cite.d.ts.map +1 -0
- package/dist/server/routes/list.d.ts +25 -0
- package/dist/server/routes/list.d.ts.map +1 -0
- package/dist/server/routes/references.d.ts.map +1 -1
- package/dist/server/routes/search.d.ts +26 -0
- package/dist/server/routes/search.d.ts.map +1 -0
- package/dist/server.js +215 -32
- package/dist/server.js.map +1 -1
- package/package.json +15 -4
- package/dist/chunks/detector-BF8Mcc72.js.map +0 -1
- package/dist/cli/output/bibtex.d.ts +0 -6
- package/dist/cli/output/bibtex.d.ts.map +0 -1
- package/dist/cli/output/index.d.ts +0 -7
- package/dist/cli/output/index.d.ts.map +0 -1
- package/dist/cli/output/json.d.ts +0 -6
- package/dist/cli/output/json.d.ts.map +0 -1
- package/dist/cli/output/pretty.d.ts +0 -6
- package/dist/cli/output/pretty.d.ts.map +0 -1
|
@@ -1,22 +1,50 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
3
|
-
|
|
1
|
+
import type { PubmedConfig } from "../../features/import/fetcher.js";
|
|
2
|
+
import { type AddReferencesResult, type AddedItem, type FailedItem, type SkippedItem } from "../../features/operations/add.js";
|
|
3
|
+
import type { ExecutionContext } from "../execution-context.js";
|
|
4
|
+
/**
|
|
5
|
+
* Options for the add command.
|
|
6
|
+
*/
|
|
7
|
+
export interface AddCommandOptions {
|
|
8
|
+
/** Input strings (file paths, PMIDs, DOIs) */
|
|
9
|
+
inputs: string[];
|
|
10
|
+
/** Skip duplicate detection */
|
|
4
11
|
force: boolean;
|
|
12
|
+
/** Explicit input format */
|
|
13
|
+
format?: string;
|
|
14
|
+
/** PubMed API configuration */
|
|
15
|
+
pubmedConfig?: PubmedConfig;
|
|
16
|
+
/** Show verbose error output */
|
|
17
|
+
verbose?: boolean;
|
|
18
|
+
/** Content from stdin */
|
|
19
|
+
stdinContent?: string;
|
|
5
20
|
}
|
|
6
|
-
export interface AddResult {
|
|
7
|
-
added: boolean;
|
|
8
|
-
item: CslItem;
|
|
9
|
-
idChanged: boolean;
|
|
10
|
-
originalId?: string | undefined;
|
|
11
|
-
duplicate?: DuplicateMatch | undefined;
|
|
12
|
-
}
|
|
13
21
|
/**
|
|
14
|
-
*
|
|
22
|
+
* Result from add command execution.
|
|
23
|
+
*/
|
|
24
|
+
export type AddCommandResult = AddReferencesResult;
|
|
25
|
+
export type { AddedItem, FailedItem, SkippedItem };
|
|
26
|
+
/**
|
|
27
|
+
* Execute add command.
|
|
28
|
+
* Routes to server API or direct library operation based on execution context.
|
|
29
|
+
*
|
|
30
|
+
* @param options - Add command options
|
|
31
|
+
* @param context - Execution context (server or local)
|
|
32
|
+
* @returns Add result containing added, failed, and skipped items
|
|
33
|
+
*/
|
|
34
|
+
export declare function executeAdd(options: AddCommandOptions, context: ExecutionContext): Promise<AddCommandResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Format add result for CLI output.
|
|
37
|
+
*
|
|
38
|
+
* @param result - Add result
|
|
39
|
+
* @param verbose - Show verbose error output
|
|
40
|
+
* @returns Formatted output string
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatAddOutput(result: AddCommandResult, verbose: boolean): string;
|
|
43
|
+
/**
|
|
44
|
+
* Determine exit code based on result.
|
|
15
45
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @
|
|
18
|
-
* @param options - Add options
|
|
19
|
-
* @returns Add result
|
|
46
|
+
* @param result - Add result
|
|
47
|
+
* @returns Exit code (0 for success/partial success, 1 for complete failure)
|
|
20
48
|
*/
|
|
21
|
-
export declare function
|
|
49
|
+
export declare function getExitCode(result: AddCommandResult): number;
|
|
22
50
|
//# sourceMappingURL=add.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,EAEjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,+BAA+B;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAGnD,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AAKnD;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,CAAC,CA4B3B;AAiCD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAgClF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAa5D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type CiteResult } from "../../features/operations/cite.js";
|
|
2
|
+
import type { ExecutionContext } from "../execution-context.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for the cite command.
|
|
5
|
+
*/
|
|
6
|
+
export interface CiteCommandOptions {
|
|
7
|
+
identifiers: string[];
|
|
8
|
+
uuid?: boolean;
|
|
9
|
+
style?: string;
|
|
10
|
+
cslFile?: string;
|
|
11
|
+
locale?: string;
|
|
12
|
+
format?: "text" | "html" | "rtf";
|
|
13
|
+
inText?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Result from cite command execution.
|
|
17
|
+
*/
|
|
18
|
+
export type CiteCommandResult = CiteResult;
|
|
19
|
+
/**
|
|
20
|
+
* Execute cite command.
|
|
21
|
+
* Routes to server API or direct library operation based on execution context.
|
|
22
|
+
*
|
|
23
|
+
* @param options - Cite command options
|
|
24
|
+
* @param context - Execution context (server or local)
|
|
25
|
+
* @returns Cite result containing per-identifier results
|
|
26
|
+
*/
|
|
27
|
+
export declare function executeCite(options: CiteCommandOptions, context: ExecutionContext): Promise<CiteCommandResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Format cite result for CLI output.
|
|
30
|
+
*
|
|
31
|
+
* @param result - Cite result
|
|
32
|
+
* @returns Formatted output string (for stdout)
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatCiteOutput(result: CiteCommandResult): string;
|
|
35
|
+
/**
|
|
36
|
+
* Format cite errors for stderr.
|
|
37
|
+
*
|
|
38
|
+
* @param result - Cite result
|
|
39
|
+
* @returns Error messages to write to stderr
|
|
40
|
+
*/
|
|
41
|
+
export declare function formatCiteErrors(result: CiteCommandResult): string;
|
|
42
|
+
/**
|
|
43
|
+
* Determine exit code based on result.
|
|
44
|
+
*
|
|
45
|
+
* @param result - Cite result
|
|
46
|
+
* @returns Exit code (0 for success/partial success, 1 for complete failure)
|
|
47
|
+
*/
|
|
48
|
+
export declare function getCiteExitCode(result: CiteCommandResult): number;
|
|
49
|
+
//# sourceMappingURL=cite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cite.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/cite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAkB,MAAM,mCAAmC,CAAC;AACpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAoD3C;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAQ5B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAQlE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAQlE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAWjE"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext CLI commands: attach, get, detach
|
|
3
|
+
*/
|
|
4
|
+
import { type FulltextType } from "../../features/fulltext/index.js";
|
|
5
|
+
import type { ExecutionContext } from "../execution-context.js";
|
|
6
|
+
/**
|
|
7
|
+
* Options for fulltext attach command
|
|
8
|
+
*/
|
|
9
|
+
export interface FulltextAttachOptions {
|
|
10
|
+
identifier: string;
|
|
11
|
+
filePath?: string;
|
|
12
|
+
type?: FulltextType;
|
|
13
|
+
move?: boolean;
|
|
14
|
+
force?: boolean;
|
|
15
|
+
byUuid?: boolean;
|
|
16
|
+
fulltextDirectory: string;
|
|
17
|
+
stdinContent?: Buffer;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Result from fulltext attach command
|
|
21
|
+
*/
|
|
22
|
+
export interface FulltextAttachResult {
|
|
23
|
+
success: boolean;
|
|
24
|
+
filename?: string;
|
|
25
|
+
type?: FulltextType;
|
|
26
|
+
overwritten?: boolean;
|
|
27
|
+
existingFile?: string;
|
|
28
|
+
requiresConfirmation?: boolean;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Options for fulltext get command
|
|
33
|
+
*/
|
|
34
|
+
export interface FulltextGetOptions {
|
|
35
|
+
identifier: string;
|
|
36
|
+
type?: FulltextType;
|
|
37
|
+
stdout?: boolean;
|
|
38
|
+
byUuid?: boolean;
|
|
39
|
+
fulltextDirectory: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Result from fulltext get command
|
|
43
|
+
*/
|
|
44
|
+
export interface FulltextGetResult {
|
|
45
|
+
success: boolean;
|
|
46
|
+
paths?: {
|
|
47
|
+
pdf?: string;
|
|
48
|
+
markdown?: string;
|
|
49
|
+
};
|
|
50
|
+
content?: Buffer;
|
|
51
|
+
error?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options for fulltext detach command
|
|
55
|
+
*/
|
|
56
|
+
export interface FulltextDetachOptions {
|
|
57
|
+
identifier: string;
|
|
58
|
+
type?: FulltextType;
|
|
59
|
+
delete?: boolean;
|
|
60
|
+
force?: boolean;
|
|
61
|
+
byUuid?: boolean;
|
|
62
|
+
fulltextDirectory: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Result from fulltext detach command
|
|
66
|
+
*/
|
|
67
|
+
export interface FulltextDetachResult {
|
|
68
|
+
success: boolean;
|
|
69
|
+
detached?: FulltextType[];
|
|
70
|
+
deleted?: FulltextType[];
|
|
71
|
+
error?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Execute fulltext attach command
|
|
75
|
+
*/
|
|
76
|
+
export declare function executeFulltextAttach(options: FulltextAttachOptions, context: ExecutionContext): Promise<FulltextAttachResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Execute fulltext get command
|
|
79
|
+
*/
|
|
80
|
+
export declare function executeFulltextGet(options: FulltextGetOptions, context: ExecutionContext): Promise<FulltextGetResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Execute fulltext detach command
|
|
83
|
+
*/
|
|
84
|
+
export declare function executeFulltextDetach(options: FulltextDetachOptions, context: ExecutionContext): Promise<FulltextDetachResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Format fulltext attach output
|
|
87
|
+
*/
|
|
88
|
+
export declare function formatFulltextAttachOutput(result: FulltextAttachResult): string;
|
|
89
|
+
/**
|
|
90
|
+
* Format fulltext get output
|
|
91
|
+
*/
|
|
92
|
+
export declare function formatFulltextGetOutput(result: FulltextGetResult): string;
|
|
93
|
+
/**
|
|
94
|
+
* Format fulltext detach output
|
|
95
|
+
*/
|
|
96
|
+
export declare function formatFulltextDetachOutput(result: FulltextDetachResult): string;
|
|
97
|
+
/**
|
|
98
|
+
* Get exit code for fulltext command result
|
|
99
|
+
*/
|
|
100
|
+
export declare function getFulltextExitCode(result: FulltextAttachResult | FulltextGetResult | FulltextDetachResult): number;
|
|
101
|
+
//# sourceMappingURL=fulltext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fulltext.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/fulltext.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,MAAM,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EAAE,iBAAiB,GAAG,MAAM,CAoBzE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAe/E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,GAAG,oBAAoB,GACtE,MAAM,CAER"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI commands
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export type {
|
|
6
|
-
export {
|
|
7
|
-
export type {
|
|
8
|
-
export {
|
|
9
|
-
export type {
|
|
10
|
-
export {
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
13
|
-
export type {
|
|
4
|
+
export { executeList, formatListOutput } from "./list.js";
|
|
5
|
+
export type { ListCommandOptions, ListCommandResult } from "./list.js";
|
|
6
|
+
export { executeSearch, formatSearchOutput } from "./search.js";
|
|
7
|
+
export type { SearchCommandOptions, SearchCommandResult } from "./search.js";
|
|
8
|
+
export { executeAdd, formatAddOutput, getExitCode } from "./add.js";
|
|
9
|
+
export type { AddCommandOptions, AddCommandResult, AddedItem, FailedItem, SkippedItem, } from "./add.js";
|
|
10
|
+
export { executeRemove, formatRemoveOutput } from "./remove.js";
|
|
11
|
+
export type { RemoveCommandOptions, RemoveCommandResult } from "./remove.js";
|
|
12
|
+
export { executeUpdate, formatUpdateOutput } from "./update.js";
|
|
13
|
+
export type { UpdateCommandOptions, UpdateCommandResult } from "./update.js";
|
|
14
14
|
export { serverStart, serverStop, serverStatus } from "./server.js";
|
|
15
15
|
export type { ServerStartOptions, ServerInfo } from "./server.js";
|
|
16
|
+
export { executeCite, formatCiteOutput, formatCiteErrors, getCiteExitCode } from "./cite.js";
|
|
17
|
+
export type { CiteCommandOptions, CiteCommandResult } from "./cite.js";
|
|
18
|
+
export { executeFulltextAttach, executeFulltextGet, executeFulltextDetach, formatFulltextAttachOutput, formatFulltextGetOutput, formatFulltextDetachOutput, getFulltextExitCode, } from "./fulltext.js";
|
|
19
|
+
export type { FulltextAttachOptions, FulltextAttachResult, FulltextGetOptions, FulltextGetResult, FulltextDetachOptions, FulltextDetachResult, } from "./fulltext.js";
|
|
16
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC1D,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpE,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,WAAW,GACZ,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7F,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEvE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
|
|
@@ -1,15 +1,32 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type ListResult } from "../../features/operations/list.js";
|
|
2
|
+
import type { ExecutionContext } from "../execution-context.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for the list command.
|
|
5
|
+
*/
|
|
6
|
+
export interface ListCommandOptions {
|
|
3
7
|
json?: boolean;
|
|
4
8
|
idsOnly?: boolean;
|
|
5
9
|
uuid?: boolean;
|
|
6
10
|
bibtex?: boolean;
|
|
7
11
|
}
|
|
8
12
|
/**
|
|
9
|
-
*
|
|
13
|
+
* Result from list command execution.
|
|
14
|
+
*/
|
|
15
|
+
export type ListCommandResult = ListResult;
|
|
16
|
+
/**
|
|
17
|
+
* Execute list command.
|
|
18
|
+
* Routes to server API or direct library operation based on execution context.
|
|
19
|
+
*
|
|
20
|
+
* @param options - List command options
|
|
21
|
+
* @param context - Execution context (server or local)
|
|
22
|
+
* @returns List result containing formatted items
|
|
23
|
+
*/
|
|
24
|
+
export declare function executeList(options: ListCommandOptions, context: ExecutionContext): Promise<ListCommandResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Format list result for CLI output.
|
|
10
27
|
*
|
|
11
|
-
* @param
|
|
12
|
-
* @
|
|
28
|
+
* @param result - List result
|
|
29
|
+
* @returns Formatted output string
|
|
13
30
|
*/
|
|
14
|
-
export declare function
|
|
31
|
+
export declare function formatListOutput(result: ListCommandResult): string;
|
|
15
32
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AA4B3C;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAW5B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAKlE"}
|
|
@@ -1,19 +1,54 @@
|
|
|
1
1
|
import type { CslItem } from "../../core/csl-json/types.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import type { FulltextType } from "../../features/fulltext/index.js";
|
|
3
|
+
import { type RemoveResult } from "../../features/operations/remove.js";
|
|
4
|
+
import type { ExecutionContext } from "../execution-context.js";
|
|
5
|
+
/**
|
|
6
|
+
* Options for the remove command.
|
|
7
|
+
*/
|
|
8
|
+
export interface RemoveCommandOptions {
|
|
9
|
+
identifier: string;
|
|
10
|
+
byUuid?: boolean;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Result from remove command execution.
|
|
14
|
+
*/
|
|
15
|
+
export type RemoveCommandResult = RemoveResult;
|
|
16
|
+
/**
|
|
17
|
+
* Execute remove command.
|
|
18
|
+
* Routes to server API or direct library operation based on execution context.
|
|
12
19
|
*
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param options - Remove options
|
|
20
|
+
* @param options - Remove command options
|
|
21
|
+
* @param context - Execution context (server or local)
|
|
16
22
|
* @returns Remove result
|
|
17
23
|
*/
|
|
18
|
-
export declare function
|
|
24
|
+
export declare function executeRemove(options: RemoveCommandOptions, context: ExecutionContext): Promise<RemoveCommandResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Format remove result for CLI output.
|
|
27
|
+
*
|
|
28
|
+
* @param result - Remove result
|
|
29
|
+
* @param identifier - The identifier that was used
|
|
30
|
+
* @returns Formatted output string
|
|
31
|
+
*/
|
|
32
|
+
export declare function formatRemoveOutput(result: RemoveCommandResult, identifier: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get fulltext attachment types from a CSL item.
|
|
35
|
+
*
|
|
36
|
+
* @param item - CSL item to check
|
|
37
|
+
* @returns Array of attached fulltext types
|
|
38
|
+
*/
|
|
39
|
+
export declare function getFulltextAttachmentTypes(item: CslItem): FulltextType[];
|
|
40
|
+
/**
|
|
41
|
+
* Format fulltext warning message for remove confirmation.
|
|
42
|
+
*
|
|
43
|
+
* @param types - Attached fulltext types
|
|
44
|
+
* @returns Warning message string
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatFulltextWarning(types: FulltextType[]): string;
|
|
47
|
+
/**
|
|
48
|
+
* Delete fulltext files associated with a CSL item.
|
|
49
|
+
*
|
|
50
|
+
* @param item - CSL item with fulltext attachments
|
|
51
|
+
* @param fulltextDirectory - Directory containing fulltext files
|
|
52
|
+
*/
|
|
53
|
+
export declare function deleteFulltextFiles(item: CslItem, fulltextDirectory: string): Promise<void>;
|
|
19
54
|
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,qCAAqC,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAU9B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAW1F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,EAAE,CAYxE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CAInE;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBjG"}
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type SearchResult } from "../../features/operations/search.js";
|
|
2
|
+
import type { ExecutionContext } from "../execution-context.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for the search command.
|
|
5
|
+
*/
|
|
6
|
+
export interface SearchCommandOptions {
|
|
7
|
+
query: string;
|
|
3
8
|
json?: boolean;
|
|
4
9
|
idsOnly?: boolean;
|
|
5
10
|
uuid?: boolean;
|
|
6
11
|
bibtex?: boolean;
|
|
7
12
|
}
|
|
8
13
|
/**
|
|
9
|
-
*
|
|
14
|
+
* Result from search command execution.
|
|
15
|
+
*/
|
|
16
|
+
export type SearchCommandResult = SearchResult;
|
|
17
|
+
/**
|
|
18
|
+
* Execute search command.
|
|
19
|
+
* Routes to server API or direct library operation based on execution context.
|
|
20
|
+
*
|
|
21
|
+
* @param options - Search command options
|
|
22
|
+
* @param context - Execution context (server or local)
|
|
23
|
+
* @returns Search result containing formatted items
|
|
24
|
+
*/
|
|
25
|
+
export declare function executeSearch(options: SearchCommandOptions, context: ExecutionContext): Promise<SearchCommandResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Format search result for CLI output.
|
|
10
28
|
*
|
|
11
|
-
* @param
|
|
12
|
-
* @
|
|
13
|
-
* @param options - Output format options
|
|
29
|
+
* @param result - Search result
|
|
30
|
+
* @returns Formatted output string
|
|
14
31
|
*/
|
|
15
|
-
export declare function
|
|
32
|
+
export declare function formatSearchOutput(result: SearchCommandResult): string;
|
|
16
33
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC;AA4B/C;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAW9B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAKtE"}
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
import type { CslItem } from "../../core/csl-json/types.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { type UpdateOperationResult } from "../../features/operations/update.js";
|
|
3
|
+
import type { ExecutionContext } from "../execution-context.js";
|
|
4
|
+
/**
|
|
5
|
+
* Options for the update command.
|
|
6
|
+
*/
|
|
7
|
+
export interface UpdateCommandOptions {
|
|
8
|
+
identifier: string;
|
|
9
|
+
updates: Partial<CslItem>;
|
|
10
|
+
byUuid?: boolean;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Result from update command execution.
|
|
14
|
+
*/
|
|
15
|
+
export type UpdateCommandResult = UpdateOperationResult;
|
|
16
|
+
/**
|
|
17
|
+
* Execute update command.
|
|
18
|
+
* Routes to server API or direct library operation based on execution context.
|
|
12
19
|
*
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param updates - Partial updates to apply
|
|
16
|
-
* @param options - Update options
|
|
20
|
+
* @param options - Update command options
|
|
21
|
+
* @param context - Execution context (server or local)
|
|
17
22
|
* @returns Update result
|
|
18
23
|
*/
|
|
19
|
-
export declare function
|
|
24
|
+
export declare function executeUpdate(options: UpdateCommandOptions, context: ExecutionContext): Promise<UpdateCommandResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Format update result for CLI output.
|
|
27
|
+
*
|
|
28
|
+
* @param result - Update result
|
|
29
|
+
* @param identifier - The identifier that was used
|
|
30
|
+
* @returns Formatted output string
|
|
31
|
+
*/
|
|
32
|
+
export declare function formatUpdateOutput(result: UpdateCommandResult, identifier: string): string;
|
|
20
33
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,KAAK,qBAAqB,EAAmB,MAAM,qCAAqC,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAExD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAU9B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAsB1F"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution Context for CLI Commands
|
|
3
|
+
*
|
|
4
|
+
* Provides a discriminated union type to distinguish between server and local execution modes.
|
|
5
|
+
* This enables CLI commands to avoid redundant library loading when a server is available.
|
|
6
|
+
*/
|
|
7
|
+
import type { Config } from "../config/schema.js";
|
|
8
|
+
import type { Library } from "../core/library.js";
|
|
9
|
+
import { ServerClient } from "./server-client.js";
|
|
10
|
+
/**
|
|
11
|
+
* Server execution context - uses ServerClient for operations
|
|
12
|
+
*/
|
|
13
|
+
export interface ServerExecutionContext {
|
|
14
|
+
type: "server";
|
|
15
|
+
client: ServerClient;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Local execution context - uses Library directly
|
|
19
|
+
*/
|
|
20
|
+
export interface LocalExecutionContext {
|
|
21
|
+
type: "local";
|
|
22
|
+
library: Library;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Discriminated union type for execution context.
|
|
26
|
+
* Commands can use this to determine whether to use server or local operations.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* if (context.type === "server") {
|
|
31
|
+
* // Use context.client for server operations
|
|
32
|
+
* const result = await context.client.list(options);
|
|
33
|
+
* } else {
|
|
34
|
+
* // Use context.library for local operations
|
|
35
|
+
* const items = context.library.getAll();
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export type ExecutionContext = ServerExecutionContext | LocalExecutionContext;
|
|
40
|
+
/**
|
|
41
|
+
* Creates an execution context based on the current configuration.
|
|
42
|
+
*
|
|
43
|
+
* This function checks for an available server connection first.
|
|
44
|
+
* If a server is available, it returns a server context to avoid loading the library.
|
|
45
|
+
* Otherwise, it loads the library and returns a local context.
|
|
46
|
+
*
|
|
47
|
+
* @param config - The application configuration
|
|
48
|
+
* @param loadLibrary - Function to load the library (injected for testability)
|
|
49
|
+
* @returns Promise resolving to either a server or local execution context
|
|
50
|
+
*/
|
|
51
|
+
export declare function createExecutionContext(config: Config, loadLibrary: (path: string) => Promise<Library>): Promise<ExecutionContext>;
|
|
52
|
+
/**
|
|
53
|
+
* Type guard to check if context is a server context
|
|
54
|
+
*/
|
|
55
|
+
export declare function isServerContext(context: ExecutionContext): context is ServerExecutionContext;
|
|
56
|
+
/**
|
|
57
|
+
* Type guard to check if context is a local context
|
|
58
|
+
*/
|
|
59
|
+
export declare function isLocalContext(context: ExecutionContext): context is LocalExecutionContext;
|
|
60
|
+
//# sourceMappingURL=execution-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-context.d.ts","sourceRoot":"","sources":["../../src/cli/execution-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC9C,OAAO,CAAC,gBAAgB,CAAC,CAkB3B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,IAAI,sBAAsB,CAE5F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,IAAI,qBAAqB,CAE1F"}
|
package/dist/cli/helpers.d.ts
CHANGED
|
@@ -58,4 +58,22 @@ export declare function isTTY(): boolean;
|
|
|
58
58
|
* @returns True if user confirmed (y/yes), false otherwise
|
|
59
59
|
*/
|
|
60
60
|
export declare function readConfirmation(prompt: string): Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Read stdin content and split into inputs.
|
|
63
|
+
* Used for reading identifiers from stdin.
|
|
64
|
+
* @returns Array of input strings (split by whitespace)
|
|
65
|
+
*/
|
|
66
|
+
export declare function readStdinInputs(): Promise<string[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Read raw stdin content without splitting.
|
|
69
|
+
* Used for reading file content (JSON, BibTeX, RIS) from stdin.
|
|
70
|
+
* @returns Raw stdin content as string
|
|
71
|
+
*/
|
|
72
|
+
export declare function readStdinContent(): Promise<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Read raw stdin content as Buffer.
|
|
75
|
+
* Used for reading binary file content (PDF) from stdin.
|
|
76
|
+
* @returns Raw stdin content as Buffer
|
|
77
|
+
*/
|
|
78
|
+
export declare function readStdinBuffer(): Promise<Buffer>;
|
|
61
79
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/cli/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,UA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ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmDpC;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CA6BvC;AA8tBD;;GAEG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxD"}
|