@ncukondo/reference-manager 0.3.0 → 0.5.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 +282 -107
- package/dist/chunks/file-watcher-B-SiUw5f.js +1557 -0
- package/dist/chunks/file-watcher-B-SiUw5f.js.map +1 -0
- package/dist/chunks/{search-Be9vzUIH.js → index-DLIGxQaB.js} +399 -89
- package/dist/chunks/index-DLIGxQaB.js.map +1 -0
- package/dist/chunks/loader-DuzyKV70.js +394 -0
- package/dist/chunks/loader-DuzyKV70.js.map +1 -0
- package/dist/cli/commands/add.d.ts +3 -3
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/cite.d.ts +3 -3
- package/dist/cli/commands/cite.d.ts.map +1 -1
- package/dist/cli/commands/fulltext.d.ts +5 -34
- package/dist/cli/commands/fulltext.d.ts.map +1 -1
- package/dist/cli/commands/list.d.ts +3 -3
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/mcp.d.ts +16 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/remove.d.ts +3 -3
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/search.d.ts +3 -3
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/server.d.ts +2 -0
- package/dist/cli/commands/server.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +3 -3
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/execution-context.d.ts +23 -36
- package/dist/cli/execution-context.d.ts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/server-client.d.ts +24 -40
- package/dist/cli/server-client.d.ts.map +1 -1
- package/dist/cli/server-detection.d.ts +1 -0
- package/dist/cli/server-detection.d.ts.map +1 -1
- package/dist/cli.js +21061 -317
- package/dist/cli.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/schema.d.ts +2 -3
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/core/csl-json/types.d.ts +3 -0
- package/dist/core/csl-json/types.d.ts.map +1 -1
- package/dist/core/library-interface.d.ts +100 -0
- package/dist/core/library-interface.d.ts.map +1 -0
- package/dist/core/library.d.ts +29 -46
- package/dist/core/library.d.ts.map +1 -1
- package/dist/features/operations/add.d.ts +2 -2
- package/dist/features/operations/add.d.ts.map +1 -1
- package/dist/features/operations/cite.d.ts +2 -2
- package/dist/features/operations/cite.d.ts.map +1 -1
- package/dist/features/operations/fulltext/attach.d.ts +47 -0
- package/dist/features/operations/fulltext/attach.d.ts.map +1 -0
- package/dist/features/operations/fulltext/detach.d.ts +38 -0
- package/dist/features/operations/fulltext/detach.d.ts.map +1 -0
- package/dist/features/operations/fulltext/get.d.ts +41 -0
- package/dist/features/operations/fulltext/get.d.ts.map +1 -0
- package/dist/features/operations/fulltext/index.d.ts +9 -0
- package/dist/features/operations/fulltext/index.d.ts.map +1 -0
- package/dist/features/operations/index.d.ts +15 -0
- package/dist/features/operations/index.d.ts.map +1 -0
- package/dist/features/operations/library-operations.d.ts +64 -0
- package/dist/features/operations/library-operations.d.ts.map +1 -0
- package/dist/features/operations/list.d.ts +2 -2
- package/dist/features/operations/list.d.ts.map +1 -1
- package/dist/features/operations/operations-library.d.ts +36 -0
- package/dist/features/operations/operations-library.d.ts.map +1 -0
- package/dist/features/operations/remove.d.ts +4 -4
- package/dist/features/operations/remove.d.ts.map +1 -1
- package/dist/features/operations/search.d.ts +2 -2
- package/dist/features/operations/search.d.ts.map +1 -1
- package/dist/features/operations/update.d.ts +2 -2
- package/dist/features/operations/update.d.ts.map +1 -1
- package/dist/features/search/matcher.d.ts.map +1 -1
- package/dist/features/search/normalizer.d.ts +12 -0
- package/dist/features/search/normalizer.d.ts.map +1 -1
- package/dist/features/search/tokenizer.d.ts.map +1 -1
- package/dist/features/search/types.d.ts +1 -1
- package/dist/features/search/types.d.ts.map +1 -1
- package/dist/features/search/uppercase.d.ts +41 -0
- package/dist/features/search/uppercase.d.ts.map +1 -0
- package/dist/index.js +24 -192
- package/dist/index.js.map +1 -1
- package/dist/mcp/context.d.ts +19 -0
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +20 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/resources/index.d.ts +10 -0
- package/dist/mcp/resources/index.d.ts.map +1 -0
- package/dist/mcp/resources/library.d.ts +26 -0
- package/dist/mcp/resources/library.d.ts.map +1 -0
- package/dist/mcp/tools/add.d.ts +17 -0
- package/dist/mcp/tools/add.d.ts.map +1 -0
- package/dist/mcp/tools/cite.d.ts +15 -0
- package/dist/mcp/tools/cite.d.ts.map +1 -0
- package/dist/mcp/tools/fulltext.d.ts +51 -0
- package/dist/mcp/tools/fulltext.d.ts.map +1 -0
- package/dist/mcp/tools/index.d.ts +12 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/list.d.ts +13 -0
- package/dist/mcp/tools/list.d.ts.map +1 -0
- package/dist/mcp/tools/remove.d.ts +19 -0
- package/dist/mcp/tools/remove.d.ts.map +1 -0
- package/dist/mcp/tools/search.d.ts +13 -0
- package/dist/mcp/tools/search.d.ts.map +1 -0
- package/dist/server/index.d.ts +23 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/routes/references.d.ts.map +1 -1
- package/dist/server.js +5 -271
- package/dist/server.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunks/detector-DHztTaFY.js +0 -619
- package/dist/chunks/detector-DHztTaFY.js.map +0 -1
- package/dist/chunks/loader-mQ25o6cV.js +0 -1054
- package/dist/chunks/loader-mQ25o6cV.js.map +0 -1
- package/dist/chunks/search-Be9vzUIH.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CslItem } from "../../core/csl-json/types.js";
|
|
2
2
|
import type { FulltextType } from "../../features/fulltext/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import type { RemoveResult } from "../../features/operations/remove.js";
|
|
4
4
|
import type { ExecutionContext } from "../execution-context.js";
|
|
5
5
|
/**
|
|
6
6
|
* Options for the remove command.
|
|
@@ -15,10 +15,10 @@ export interface RemoveCommandOptions {
|
|
|
15
15
|
export type RemoveCommandResult = RemoveResult;
|
|
16
16
|
/**
|
|
17
17
|
* Execute remove command.
|
|
18
|
-
*
|
|
18
|
+
* Uses context.library.remove() which works for both local and server modes.
|
|
19
19
|
*
|
|
20
20
|
* @param options - Remove command options
|
|
21
|
-
* @param context - Execution context
|
|
21
|
+
* @param context - Execution context
|
|
22
22
|
* @returns Remove result
|
|
23
23
|
*/
|
|
24
24
|
export declare function executeRemove(options: RemoveCommandOptions, context: ExecutionContext): Promise<RemoveCommandResult>;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,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,CAI9B;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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SearchResult } from "../../features/operations/search.js";
|
|
2
2
|
import type { ExecutionContext } from "../execution-context.js";
|
|
3
3
|
/**
|
|
4
4
|
* Options for the search command.
|
|
@@ -16,10 +16,10 @@ export interface SearchCommandOptions {
|
|
|
16
16
|
export type SearchCommandResult = SearchResult;
|
|
17
17
|
/**
|
|
18
18
|
* Execute search command.
|
|
19
|
-
*
|
|
19
|
+
* Uses context.library.search() which works for both local and server modes.
|
|
20
20
|
*
|
|
21
21
|
* @param options - Search command options
|
|
22
|
-
* @param context - Execution context
|
|
22
|
+
* @param context - Execution context
|
|
23
23
|
* @returns Search result containing formatted items
|
|
24
24
|
*/
|
|
25
25
|
export declare function executeSearch(options: SearchCommandOptions, context: ExecutionContext): Promise<SearchCommandResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACtF,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,CAK9B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAKtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AASrD,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAe5E;AA4ED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpE;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA0BnF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CslItem } from "../../core/csl-json/types.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { UpdateOperationResult } from "../../features/operations/update.js";
|
|
3
3
|
import type { ExecutionContext } from "../execution-context.js";
|
|
4
4
|
/**
|
|
5
5
|
* Options for the update command.
|
|
@@ -15,10 +15,10 @@ export interface UpdateCommandOptions {
|
|
|
15
15
|
export type UpdateCommandResult = UpdateOperationResult;
|
|
16
16
|
/**
|
|
17
17
|
* Execute update command.
|
|
18
|
-
*
|
|
18
|
+
* Uses context.library.update() which works for both local and server modes.
|
|
19
19
|
*
|
|
20
20
|
* @param options - Update command options
|
|
21
|
-
* @param context - Execution context
|
|
21
|
+
* @param context - Execution context
|
|
22
22
|
* @returns Update result
|
|
23
23
|
*/
|
|
24
24
|
export declare function executeUpdate(options: UpdateCommandOptions, context: ExecutionContext): Promise<UpdateCommandResult>;
|
|
@@ -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;AAC5D,OAAO,EAAE,
|
|
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,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,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,CAI9B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAsB1F"}
|
|
@@ -1,60 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Execution Context for CLI Commands
|
|
3
3
|
*
|
|
4
|
-
* Provides a
|
|
5
|
-
*
|
|
4
|
+
* Provides a unified interface for CLI commands to interact with the library,
|
|
5
|
+
* regardless of whether running in local or server mode.
|
|
6
|
+
*
|
|
7
|
+
* See: spec/decisions/ADR-009-ilibrary-operations-pattern.md
|
|
6
8
|
*/
|
|
7
9
|
import type { Config } from "../config/schema.js";
|
|
8
10
|
import type { Library } from "../core/library.js";
|
|
9
|
-
import {
|
|
10
|
-
/**
|
|
11
|
-
* Server execution context - uses ServerClient for operations
|
|
12
|
-
*/
|
|
13
|
-
export interface ServerExecutionContext {
|
|
14
|
-
type: "server";
|
|
15
|
-
client: ServerClient;
|
|
16
|
-
}
|
|
11
|
+
import type { ILibraryOperations } from "../features/operations/library-operations.js";
|
|
17
12
|
/**
|
|
18
|
-
*
|
|
13
|
+
* Execution mode indicating whether CLI is using local file access or server API.
|
|
19
14
|
*/
|
|
20
|
-
export
|
|
21
|
-
type: "local";
|
|
22
|
-
library: Library;
|
|
23
|
-
}
|
|
15
|
+
export type ExecutionMode = "local" | "server";
|
|
24
16
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
17
|
+
* Unified execution context for CLI commands.
|
|
18
|
+
*
|
|
19
|
+
* Commands use `context.library` for all operations without needing to branch
|
|
20
|
+
* based on execution mode. The `mode` field is available for diagnostics and logging.
|
|
27
21
|
*
|
|
28
22
|
* @example
|
|
29
23
|
* ```typescript
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* } else {
|
|
34
|
-
* // Use context.library for local operations
|
|
35
|
-
* const items = context.library.getAll();
|
|
36
|
-
* }
|
|
24
|
+
* // No branching needed - same code works for both modes
|
|
25
|
+
* const results = await context.library.search({ query });
|
|
26
|
+
* console.log(`Mode: ${context.mode}`);
|
|
37
27
|
* ```
|
|
38
28
|
*/
|
|
39
|
-
export
|
|
29
|
+
export interface ExecutionContext {
|
|
30
|
+
/** Execution mode for diagnostics and logging */
|
|
31
|
+
mode: ExecutionMode;
|
|
32
|
+
/** Unified operations interface - works for both local and server modes */
|
|
33
|
+
library: ILibraryOperations;
|
|
34
|
+
}
|
|
40
35
|
/**
|
|
41
36
|
* Creates an execution context based on the current configuration.
|
|
42
37
|
*
|
|
43
38
|
* This function checks for an available server connection first.
|
|
44
|
-
* If a server is available, it returns a
|
|
45
|
-
* Otherwise, it loads the library and returns a
|
|
39
|
+
* If a server is available, it returns a context with ServerClient.
|
|
40
|
+
* Otherwise, it loads the library and returns a context with OperationsLibrary.
|
|
46
41
|
*
|
|
47
42
|
* @param config - The application configuration
|
|
48
43
|
* @param loadLibrary - Function to load the library (injected for testability)
|
|
49
|
-
* @returns Promise resolving to
|
|
44
|
+
* @returns Promise resolving to an ExecutionContext
|
|
50
45
|
*/
|
|
51
46
|
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
47
|
//# sourceMappingURL=execution-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-context.d.ts","sourceRoot":"","sources":["../../src/cli/execution-context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"execution-context.d.ts","sourceRoot":"","sources":["../../src/cli/execution-context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAKvF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,IAAI,EAAE,aAAa,CAAC;IACpB,2EAA2E;IAC3E,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;;;;;;;;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,CAmB3B"}
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAoDpC;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CA8BvC;AAmwBD;;GAEG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxD"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import type { CslItem } from "../core/csl-json/types.js";
|
|
2
|
-
import type {
|
|
3
|
-
import type { CiteResult } from "../features/operations/
|
|
4
|
-
import type { ListOptions, ListResult } from "../features/operations/list.js";
|
|
5
|
-
import type { RemoveResult } from "../features/operations/remove.js";
|
|
6
|
-
import type { SearchOperationOptions, SearchResult } from "../features/operations/search.js";
|
|
7
|
-
import type { UpdateOperationResult } from "../features/operations/update.js";
|
|
8
|
-
/**
|
|
9
|
-
* Options for addFromInputs method.
|
|
10
|
-
*/
|
|
11
|
-
export interface AddFromInputsOptions {
|
|
12
|
-
force?: boolean;
|
|
13
|
-
format?: string;
|
|
14
|
-
}
|
|
2
|
+
import type { FindOptions, RemoveResult as ILibraryRemoveResult, RemoveOptions, UpdateOptions, UpdateResult } from "../core/library-interface.js";
|
|
3
|
+
import type { AddReferencesResult, CiteResult, ILibraryOperations, ImportOptions, ListOptions, ListResult, SearchOperationOptions, SearchResult } from "../features/operations/index.js";
|
|
15
4
|
/**
|
|
16
5
|
* Options for cite method.
|
|
17
6
|
*/
|
|
@@ -27,7 +16,7 @@ export interface CiteOptions {
|
|
|
27
16
|
/**
|
|
28
17
|
* Client for communicating with the reference-manager HTTP server.
|
|
29
18
|
*/
|
|
30
|
-
export declare class ServerClient {
|
|
19
|
+
export declare class ServerClient implements ILibraryOperations {
|
|
31
20
|
private baseUrl;
|
|
32
21
|
constructor(baseUrl: string);
|
|
33
22
|
/**
|
|
@@ -36,49 +25,44 @@ export declare class ServerClient {
|
|
|
36
25
|
*/
|
|
37
26
|
getAll(): Promise<CslItem[]>;
|
|
38
27
|
/**
|
|
39
|
-
* Find reference by
|
|
28
|
+
* Find reference by citation ID or UUID.
|
|
40
29
|
* @param identifier - Citation ID or UUID
|
|
41
|
-
* @param options -
|
|
42
|
-
* @
|
|
43
|
-
* @returns CSL item or null if not found
|
|
30
|
+
* @param options - Find options (byUuid to use UUID lookup)
|
|
31
|
+
* @returns CSL item or undefined if not found
|
|
44
32
|
*/
|
|
45
|
-
find(identifier: string, options?:
|
|
46
|
-
byUuid?: boolean;
|
|
47
|
-
}): Promise<CslItem | null>;
|
|
33
|
+
find(identifier: string, options?: FindOptions): Promise<CslItem | undefined>;
|
|
48
34
|
/**
|
|
49
35
|
* Add new reference to the library.
|
|
50
36
|
* @param item - CSL item to add
|
|
51
|
-
* @returns
|
|
37
|
+
* @returns The added CSL item (with generated ID and UUID)
|
|
52
38
|
*/
|
|
53
39
|
add(item: CslItem): Promise<CslItem>;
|
|
54
40
|
/**
|
|
55
|
-
* Update
|
|
41
|
+
* Update reference by citation ID or UUID.
|
|
56
42
|
* @param identifier - Citation ID or UUID
|
|
57
43
|
* @param updates - Partial CSL item with fields to update
|
|
58
|
-
* @param options -
|
|
59
|
-
* @
|
|
60
|
-
* @returns Update operation result
|
|
44
|
+
* @param options - Update options (byUuid to use UUID lookup, onIdCollision for collision handling)
|
|
45
|
+
* @returns Update result with updated item, success status, and any ID changes
|
|
61
46
|
*/
|
|
62
|
-
update(identifier: string, updates: Partial<CslItem>, options?:
|
|
63
|
-
byUuid?: boolean;
|
|
64
|
-
}): Promise<UpdateOperationResult>;
|
|
47
|
+
update(identifier: string, updates: Partial<CslItem>, options?: UpdateOptions): Promise<UpdateResult>;
|
|
65
48
|
/**
|
|
66
|
-
* Remove reference by
|
|
67
|
-
* @param identifier -
|
|
68
|
-
* @param options -
|
|
69
|
-
* @
|
|
70
|
-
|
|
49
|
+
* Remove a reference by citation ID or UUID.
|
|
50
|
+
* @param identifier - The citation ID or UUID of the reference to remove
|
|
51
|
+
* @param options - Remove options (byUuid to use UUID lookup)
|
|
52
|
+
* @returns Remove result with removed status and removedItem
|
|
53
|
+
*/
|
|
54
|
+
remove(identifier: string, options?: RemoveOptions): Promise<ILibraryRemoveResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Save is a no-op for ServerClient (HTTP requests are already persisted).
|
|
71
57
|
*/
|
|
72
|
-
|
|
73
|
-
byUuid?: boolean;
|
|
74
|
-
}): Promise<RemoveResult>;
|
|
58
|
+
save(): Promise<void>;
|
|
75
59
|
/**
|
|
76
|
-
*
|
|
60
|
+
* Import references from various input formats.
|
|
77
61
|
* @param inputs - Array of inputs (file paths, PMIDs, DOIs)
|
|
78
|
-
* @param options - Options for
|
|
62
|
+
* @param options - Options for import operation
|
|
79
63
|
* @returns Result containing added, failed, and skipped items
|
|
80
64
|
*/
|
|
81
|
-
|
|
65
|
+
import(inputs: string[], options?: ImportOptions): Promise<AddReferencesResult>;
|
|
82
66
|
/**
|
|
83
67
|
* Generate citations for references.
|
|
84
68
|
* @param options - Cite options including identifiers and formatting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-client.d.ts","sourceRoot":"","sources":["../../src/cli/server-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"server-client.d.ts","sourceRoot":"","sources":["../../src/cli/server-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,IAAI,oBAAoB,EACpC,aAAa,EACb,aAAa,EACb,YAAY,EACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,YAAY,EACb,MAAM,iCAAiC,CAAC;AAIzC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,YAAa,YAAW,kBAAkB;IACzC,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM;IAMnC;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAWlC;;;;;OAKG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAsBvF;;;;OAIG;IACG,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAgB1C;;;;;;OAMG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,CAAC;IA0BxB;;;;;OAKG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAyB5F;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAerF;;;;OAIG;IACG,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAerD;;;;OAIG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAetD;;;;OAIG;IACG,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;CAcrE"}
|
|
@@ -15,6 +15,7 @@ export interface ServerConnection {
|
|
|
15
15
|
export declare function getServerConnection(libraryPath: string, config: Config): Promise<ServerConnection | null>;
|
|
16
16
|
/**
|
|
17
17
|
* Start server in daemon mode.
|
|
18
|
+
* Spawns server process directly (without --daemon flag) in background.
|
|
18
19
|
* @param libraryPath - Path to the library file
|
|
19
20
|
* @param _config - Configuration (reserved for future use)
|
|
20
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-detection.d.ts","sourceRoot":"","sources":["../../src/cli/server-detection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AASlD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAmClC;AAED
|
|
1
|
+
{"version":3,"file":"server-detection.d.ts","sourceRoot":"","sources":["../../src/cli/server-detection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AASlD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAmClC;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW3F;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CActE"}
|