@ncukondo/reference-manager 0.1.0 → 0.4.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 (168) hide show
  1. package/README.md +278 -80
  2. package/dist/chunks/{detector-BF8Mcc72.js → file-watcher-B-SiUw5f.js} +469 -327
  3. package/dist/chunks/file-watcher-B-SiUw5f.js.map +1 -0
  4. package/dist/chunks/index-DLIGxQaB.js +29851 -0
  5. package/dist/chunks/index-DLIGxQaB.js.map +1 -0
  6. package/dist/chunks/loader-DuzyKV70.js +394 -0
  7. package/dist/chunks/loader-DuzyKV70.js.map +1 -0
  8. package/dist/cli/commands/add.d.ts +44 -16
  9. package/dist/cli/commands/add.d.ts.map +1 -1
  10. package/dist/cli/commands/cite.d.ts +49 -0
  11. package/dist/cli/commands/cite.d.ts.map +1 -0
  12. package/dist/cli/commands/fulltext.d.ts +72 -0
  13. package/dist/cli/commands/fulltext.d.ts.map +1 -0
  14. package/dist/cli/commands/index.d.ts +14 -10
  15. package/dist/cli/commands/index.d.ts.map +1 -1
  16. package/dist/cli/commands/list.d.ts +23 -6
  17. package/dist/cli/commands/list.d.ts.map +1 -1
  18. package/dist/cli/commands/mcp.d.ts +16 -0
  19. package/dist/cli/commands/mcp.d.ts.map +1 -0
  20. package/dist/cli/commands/remove.d.ts +47 -12
  21. package/dist/cli/commands/remove.d.ts.map +1 -1
  22. package/dist/cli/commands/search.d.ts +24 -7
  23. package/dist/cli/commands/search.d.ts.map +1 -1
  24. package/dist/cli/commands/server.d.ts +2 -0
  25. package/dist/cli/commands/server.d.ts.map +1 -1
  26. package/dist/cli/commands/update.d.ts +26 -13
  27. package/dist/cli/commands/update.d.ts.map +1 -1
  28. package/dist/cli/execution-context.d.ts +47 -0
  29. package/dist/cli/execution-context.d.ts.map +1 -0
  30. package/dist/cli/helpers.d.ts +18 -0
  31. package/dist/cli/helpers.d.ts.map +1 -1
  32. package/dist/cli/index.d.ts.map +1 -1
  33. package/dist/cli/server-client.d.ts +61 -14
  34. package/dist/cli/server-client.d.ts.map +1 -1
  35. package/dist/cli/server-detection.d.ts +1 -0
  36. package/dist/cli/server-detection.d.ts.map +1 -1
  37. package/dist/cli.js +21979 -564
  38. package/dist/cli.js.map +1 -1
  39. package/dist/config/csl-styles.d.ts +83 -0
  40. package/dist/config/csl-styles.d.ts.map +1 -0
  41. package/dist/config/defaults.d.ts +10 -0
  42. package/dist/config/defaults.d.ts.map +1 -1
  43. package/dist/config/loader.d.ts.map +1 -1
  44. package/dist/config/schema.d.ts +86 -3
  45. package/dist/config/schema.d.ts.map +1 -1
  46. package/dist/core/csl-json/types.d.ts +18 -3
  47. package/dist/core/csl-json/types.d.ts.map +1 -1
  48. package/dist/core/library-interface.d.ts +100 -0
  49. package/dist/core/library-interface.d.ts.map +1 -0
  50. package/dist/core/library.d.ts +56 -13
  51. package/dist/core/library.d.ts.map +1 -1
  52. package/dist/features/format/bibtex.d.ts +6 -0
  53. package/dist/features/format/bibtex.d.ts.map +1 -0
  54. package/dist/features/format/citation-csl.d.ts +41 -0
  55. package/dist/features/format/citation-csl.d.ts.map +1 -0
  56. package/dist/features/format/citation-fallback.d.ts +24 -0
  57. package/dist/features/format/citation-fallback.d.ts.map +1 -0
  58. package/dist/features/format/index.d.ts +10 -0
  59. package/dist/features/format/index.d.ts.map +1 -0
  60. package/dist/features/format/json.d.ts +6 -0
  61. package/dist/features/format/json.d.ts.map +1 -0
  62. package/dist/features/format/pretty.d.ts +6 -0
  63. package/dist/features/format/pretty.d.ts.map +1 -0
  64. package/dist/features/fulltext/filename.d.ts +17 -0
  65. package/dist/features/fulltext/filename.d.ts.map +1 -0
  66. package/dist/features/fulltext/index.d.ts +7 -0
  67. package/dist/features/fulltext/index.d.ts.map +1 -0
  68. package/dist/features/fulltext/manager.d.ts +109 -0
  69. package/dist/features/fulltext/manager.d.ts.map +1 -0
  70. package/dist/features/fulltext/types.d.ts +12 -0
  71. package/dist/features/fulltext/types.d.ts.map +1 -0
  72. package/dist/features/import/cache.d.ts +37 -0
  73. package/dist/features/import/cache.d.ts.map +1 -0
  74. package/dist/features/import/detector.d.ts +42 -0
  75. package/dist/features/import/detector.d.ts.map +1 -0
  76. package/dist/features/import/fetcher.d.ts +49 -0
  77. package/dist/features/import/fetcher.d.ts.map +1 -0
  78. package/dist/features/import/importer.d.ts +61 -0
  79. package/dist/features/import/importer.d.ts.map +1 -0
  80. package/dist/features/import/index.d.ts +8 -0
  81. package/dist/features/import/index.d.ts.map +1 -0
  82. package/dist/features/import/normalizer.d.ts +15 -0
  83. package/dist/features/import/normalizer.d.ts.map +1 -0
  84. package/dist/features/import/parser.d.ts +33 -0
  85. package/dist/features/import/parser.d.ts.map +1 -0
  86. package/dist/features/import/rate-limiter.d.ts +45 -0
  87. package/dist/features/import/rate-limiter.d.ts.map +1 -0
  88. package/dist/features/operations/add.d.ts +65 -0
  89. package/dist/features/operations/add.d.ts.map +1 -0
  90. package/dist/features/operations/cite.d.ts +48 -0
  91. package/dist/features/operations/cite.d.ts.map +1 -0
  92. package/dist/features/operations/fulltext/attach.d.ts +47 -0
  93. package/dist/features/operations/fulltext/attach.d.ts.map +1 -0
  94. package/dist/features/operations/fulltext/detach.d.ts +38 -0
  95. package/dist/features/operations/fulltext/detach.d.ts.map +1 -0
  96. package/dist/features/operations/fulltext/get.d.ts +41 -0
  97. package/dist/features/operations/fulltext/get.d.ts.map +1 -0
  98. package/dist/features/operations/fulltext/index.d.ts +9 -0
  99. package/dist/features/operations/fulltext/index.d.ts.map +1 -0
  100. package/dist/features/operations/index.d.ts +15 -0
  101. package/dist/features/operations/index.d.ts.map +1 -0
  102. package/dist/features/operations/library-operations.d.ts +64 -0
  103. package/dist/features/operations/library-operations.d.ts.map +1 -0
  104. package/dist/features/operations/list.d.ts +28 -0
  105. package/dist/features/operations/list.d.ts.map +1 -0
  106. package/dist/features/operations/operations-library.d.ts +36 -0
  107. package/dist/features/operations/operations-library.d.ts.map +1 -0
  108. package/dist/features/operations/remove.d.ts +29 -0
  109. package/dist/features/operations/remove.d.ts.map +1 -0
  110. package/dist/features/operations/search.d.ts +30 -0
  111. package/dist/features/operations/search.d.ts.map +1 -0
  112. package/dist/features/operations/update.d.ts +39 -0
  113. package/dist/features/operations/update.d.ts.map +1 -0
  114. package/dist/features/search/matcher.d.ts.map +1 -1
  115. package/dist/features/search/normalizer.d.ts +12 -0
  116. package/dist/features/search/normalizer.d.ts.map +1 -1
  117. package/dist/features/search/tokenizer.d.ts.map +1 -1
  118. package/dist/features/search/types.d.ts +1 -1
  119. package/dist/features/search/types.d.ts.map +1 -1
  120. package/dist/features/search/uppercase.d.ts +41 -0
  121. package/dist/features/search/uppercase.d.ts.map +1 -0
  122. package/dist/index.js +21 -187
  123. package/dist/index.js.map +1 -1
  124. package/dist/mcp/context.d.ts +19 -0
  125. package/dist/mcp/context.d.ts.map +1 -0
  126. package/dist/mcp/index.d.ts +20 -0
  127. package/dist/mcp/index.d.ts.map +1 -0
  128. package/dist/mcp/resources/index.d.ts +10 -0
  129. package/dist/mcp/resources/index.d.ts.map +1 -0
  130. package/dist/mcp/resources/library.d.ts +26 -0
  131. package/dist/mcp/resources/library.d.ts.map +1 -0
  132. package/dist/mcp/tools/add.d.ts +17 -0
  133. package/dist/mcp/tools/add.d.ts.map +1 -0
  134. package/dist/mcp/tools/cite.d.ts +15 -0
  135. package/dist/mcp/tools/cite.d.ts.map +1 -0
  136. package/dist/mcp/tools/fulltext.d.ts +51 -0
  137. package/dist/mcp/tools/fulltext.d.ts.map +1 -0
  138. package/dist/mcp/tools/index.d.ts +12 -0
  139. package/dist/mcp/tools/index.d.ts.map +1 -0
  140. package/dist/mcp/tools/list.d.ts +13 -0
  141. package/dist/mcp/tools/list.d.ts.map +1 -0
  142. package/dist/mcp/tools/remove.d.ts +19 -0
  143. package/dist/mcp/tools/remove.d.ts.map +1 -0
  144. package/dist/mcp/tools/search.d.ts +13 -0
  145. package/dist/mcp/tools/search.d.ts.map +1 -0
  146. package/dist/server/index.d.ts +26 -2
  147. package/dist/server/index.d.ts.map +1 -1
  148. package/dist/server/routes/add.d.ts +11 -0
  149. package/dist/server/routes/add.d.ts.map +1 -0
  150. package/dist/server/routes/cite.d.ts +9 -0
  151. package/dist/server/routes/cite.d.ts.map +1 -0
  152. package/dist/server/routes/list.d.ts +25 -0
  153. package/dist/server/routes/list.d.ts.map +1 -0
  154. package/dist/server/routes/references.d.ts.map +1 -1
  155. package/dist/server/routes/search.d.ts +26 -0
  156. package/dist/server/routes/search.d.ts.map +1 -0
  157. package/dist/server.js +5 -88
  158. package/dist/server.js.map +1 -1
  159. package/package.json +16 -4
  160. package/dist/chunks/detector-BF8Mcc72.js.map +0 -1
  161. package/dist/cli/output/bibtex.d.ts +0 -6
  162. package/dist/cli/output/bibtex.d.ts.map +0 -1
  163. package/dist/cli/output/index.d.ts +0 -7
  164. package/dist/cli/output/index.d.ts.map +0 -1
  165. package/dist/cli/output/json.d.ts +0 -6
  166. package/dist/cli/output/json.d.ts.map +0 -1
  167. package/dist/cli/output/pretty.d.ts +0 -6
  168. package/dist/cli/output/pretty.d.ts.map +0 -1
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Fulltext attach operation
3
+ */
4
+ import type { ILibrary } from "../../../core/library-interface.js";
5
+ import { type FulltextType } from "../../fulltext/index.js";
6
+ /**
7
+ * Options for fulltextAttach operation
8
+ */
9
+ export interface FulltextAttachOptions {
10
+ /** Reference identifier (id or uuid) */
11
+ identifier: string;
12
+ /** Path to the file to attach */
13
+ filePath?: string | undefined;
14
+ /** Explicit file type (pdf or markdown) */
15
+ type?: FulltextType | undefined;
16
+ /** Move file instead of copy */
17
+ move?: boolean | undefined;
18
+ /** Force overwrite existing file */
19
+ force?: boolean | undefined;
20
+ /** Use uuid instead of id for lookup */
21
+ byUuid?: boolean | undefined;
22
+ /** Directory for fulltext files */
23
+ fulltextDirectory: string;
24
+ /** Content from stdin */
25
+ stdinContent?: Buffer | undefined;
26
+ }
27
+ /**
28
+ * Result of fulltextAttach operation
29
+ */
30
+ export interface FulltextAttachResult {
31
+ success: boolean;
32
+ filename?: string | undefined;
33
+ type?: FulltextType | undefined;
34
+ overwritten?: boolean | undefined;
35
+ existingFile?: string | undefined;
36
+ requiresConfirmation?: boolean | undefined;
37
+ error?: string | undefined;
38
+ }
39
+ /**
40
+ * Attach a fulltext file to a reference.
41
+ *
42
+ * @param library - The library containing the reference
43
+ * @param options - Attach options
44
+ * @returns Result of the attach operation
45
+ */
46
+ export declare function fulltextAttach(library: ILibrary, options: FulltextAttachOptions): Promise<FulltextAttachResult>;
47
+ //# sourceMappingURL=attach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/attach.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG9F;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,2CAA2C;IAC3C,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,mCAAmC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAuHD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAqE/B"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Fulltext detach operation
3
+ */
4
+ import type { ILibrary } from "../../../core/library-interface.js";
5
+ import { type FulltextType } from "../../fulltext/index.js";
6
+ /**
7
+ * Options for fulltextDetach operation
8
+ */
9
+ export interface FulltextDetachOptions {
10
+ /** Reference identifier (id or uuid) */
11
+ identifier: string;
12
+ /** Specific type to detach (pdf or markdown) */
13
+ type?: FulltextType | undefined;
14
+ /** Delete the file from disk */
15
+ delete?: boolean | undefined;
16
+ /** Use uuid instead of id for lookup */
17
+ byUuid?: boolean | undefined;
18
+ /** Directory for fulltext files */
19
+ fulltextDirectory: string;
20
+ }
21
+ /**
22
+ * Result of fulltextDetach operation
23
+ */
24
+ export interface FulltextDetachResult {
25
+ success: boolean;
26
+ detached?: FulltextType[];
27
+ deleted?: FulltextType[];
28
+ error?: string;
29
+ }
30
+ /**
31
+ * Detach fulltext file(s) from a reference.
32
+ *
33
+ * @param library - The library containing the reference
34
+ * @param options - Detach options
35
+ * @returns Result of the detach operation
36
+ */
37
+ export declare function fulltextDetach(library: ILibrary, options: FulltextDetachOptions): Promise<FulltextDetachResult>;
38
+ //# sourceMappingURL=detach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/detach.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AAGjC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,mCAAmC;IACnC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqDD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CA0C/B"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Fulltext get operation
3
+ */
4
+ import type { ILibrary } from "../../../core/library-interface.js";
5
+ import { type FulltextType } from "../../fulltext/index.js";
6
+ /**
7
+ * Options for fulltextGet operation
8
+ */
9
+ export interface FulltextGetOptions {
10
+ /** Reference identifier (id or uuid) */
11
+ identifier: string;
12
+ /** Specific type to get (pdf or markdown) */
13
+ type?: FulltextType | undefined;
14
+ /** If true, return file content instead of path */
15
+ stdout?: boolean | undefined;
16
+ /** Use uuid instead of id for lookup */
17
+ byUuid?: boolean | undefined;
18
+ /** Directory for fulltext files */
19
+ fulltextDirectory: string;
20
+ }
21
+ /**
22
+ * Result of fulltextGet operation
23
+ */
24
+ export interface FulltextGetResult {
25
+ success: boolean;
26
+ paths?: {
27
+ pdf?: string;
28
+ markdown?: string;
29
+ };
30
+ content?: Buffer;
31
+ error?: string;
32
+ }
33
+ /**
34
+ * Get fulltext file paths or content for a reference.
35
+ *
36
+ * @param library - The library containing the reference
37
+ * @param options - Get options
38
+ * @returns Result with file paths or content
39
+ */
40
+ export declare function fulltextGet(library: ILibrary, options: FulltextGetOptions): Promise<FulltextGetResult>;
41
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/get.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,mCAAmC;IACnC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmDD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAwB5B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Fulltext operations module
3
+ *
4
+ * Provides operations for managing fulltext files attached to references.
5
+ */
6
+ export { fulltextAttach, type FulltextAttachOptions, type FulltextAttachResult } from "./attach.js";
7
+ export { fulltextGet, type FulltextGetOptions, type FulltextGetResult } from "./get.js";
8
+ export { fulltextDetach, type FulltextDetachOptions, type FulltextDetachResult } from "./detach.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Operations module exports
3
+ *
4
+ * Re-exports ILibraryOperations interface and OperationsLibrary class
5
+ * for CLI unification pattern.
6
+ *
7
+ * See: spec/decisions/ADR-009-ilibrary-operations-pattern.md
8
+ */
9
+ export type { ILibraryOperations, ImportOptions, ImportResult, } from "./library-operations.js";
10
+ export { OperationsLibrary } from "./operations-library.js";
11
+ export type { SearchOperationOptions, SearchResult } from "./search.js";
12
+ export type { ListOptions, ListResult } from "./list.js";
13
+ export type { CiteOperationOptions, CiteResult, CiteItemResult } from "./cite.js";
14
+ export type { AddReferencesOptions, AddReferencesResult } from "./add.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAClF,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * ILibraryOperations interface
3
+ *
4
+ * Extends ILibrary with high-level operations for CLI unification.
5
+ * Both OperationsLibrary (local) and ServerClient (server) implement this interface,
6
+ * allowing CLI commands to use a single interface without branching.
7
+ *
8
+ * See: spec/decisions/ADR-009-ilibrary-operations-pattern.md
9
+ */
10
+ import type { ILibrary } from "../../core/library-interface.js";
11
+ import type { AddReferencesOptions, AddReferencesResult } from "./add.js";
12
+ import type { CiteOperationOptions, CiteResult } from "./cite.js";
13
+ import type { ListOptions, ListResult } from "./list.js";
14
+ import type { SearchOperationOptions, SearchResult } from "./search.js";
15
+ /**
16
+ * Options for import operation
17
+ *
18
+ * Extends AddReferencesOptions since import is the high-level version of add.
19
+ */
20
+ export type ImportOptions = AddReferencesOptions;
21
+ /**
22
+ * Result of import operation
23
+ */
24
+ export type ImportResult = AddReferencesResult;
25
+ /**
26
+ * High-level library operations interface
27
+ *
28
+ * Extends ILibrary with search, list, cite, and import methods.
29
+ * This interface is implemented by:
30
+ * - OperationsLibrary: Wraps Library and uses operation functions
31
+ * - ServerClient: Makes HTTP requests to server endpoints
32
+ */
33
+ export interface ILibraryOperations extends ILibrary {
34
+ /**
35
+ * Search references by query
36
+ *
37
+ * @param options - Search options including query and format
38
+ * @returns Search results with formatted items
39
+ */
40
+ search(options: SearchOperationOptions): Promise<SearchResult>;
41
+ /**
42
+ * List all references
43
+ *
44
+ * @param options - List options including format
45
+ * @returns List results with formatted items
46
+ */
47
+ list(options?: ListOptions): Promise<ListResult>;
48
+ /**
49
+ * Generate citations for references
50
+ *
51
+ * @param options - Citation options including identifiers, style, and format
52
+ * @returns Citation results
53
+ */
54
+ cite(options: CiteOperationOptions): Promise<CiteResult>;
55
+ /**
56
+ * Import references from various sources
57
+ *
58
+ * @param inputs - Array of inputs (PMID, DOI, BibTeX, RIS, file paths)
59
+ * @param options - Import options
60
+ * @returns Import results with added, failed, and skipped items
61
+ */
62
+ import(inputs: string[], options?: ImportOptions): Promise<ImportResult>;
63
+ }
64
+ //# sourceMappingURL=library-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library-operations.d.ts","sourceRoot":"","sources":["../../../src/features/operations/library-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ;IAClD;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEzD;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1E"}
@@ -0,0 +1,28 @@
1
+ import type { ILibrary } from "../../core/library-interface.js";
2
+ /**
3
+ * Output format options for list operation
4
+ */
5
+ export type ListFormat = "pretty" | "json" | "bibtex" | "ids-only" | "uuid";
6
+ /**
7
+ * Options for listReferences operation
8
+ */
9
+ export interface ListOptions {
10
+ /** Output format (default: "pretty") */
11
+ format?: ListFormat;
12
+ }
13
+ /**
14
+ * Result of listReferences operation
15
+ */
16
+ export interface ListResult {
17
+ /** Formatted strings for each reference */
18
+ items: string[];
19
+ }
20
+ /**
21
+ * List all references from the library with specified format.
22
+ *
23
+ * @param library - The library to list references from
24
+ * @param options - Formatting options
25
+ * @returns Formatted strings for each reference
26
+ */
27
+ export declare function listReferences(library: ILibrary, options: ListOptions): Promise<ListResult>;
28
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/features/operations/list.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA4BjG"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * OperationsLibrary class
3
+ *
4
+ * Wraps an ILibrary instance and provides ILibraryOperations interface.
5
+ * Delegates ILibrary methods to the underlying library and implements
6
+ * high-level operations (search, list, cite, import) using operation functions.
7
+ *
8
+ * See: spec/decisions/ADR-009-ilibrary-operations-pattern.md
9
+ */
10
+ import type { CslItem } from "../../core/csl-json/types.js";
11
+ import type { FindOptions, ILibrary, RemoveResult, UpdateOptions, UpdateResult } from "../../core/library-interface.js";
12
+ import type { CiteOperationOptions, CiteResult } from "./cite.js";
13
+ import type { ILibraryOperations, ImportOptions, ImportResult } from "./library-operations.js";
14
+ import type { ListOptions, ListResult } from "./list.js";
15
+ import type { SearchOperationOptions, SearchResult } from "./search.js";
16
+ /**
17
+ * OperationsLibrary wraps an ILibrary and implements ILibraryOperations
18
+ *
19
+ * This allows CLI commands to use a single interface without branching
20
+ * between local (Library) and server (ServerClient) modes.
21
+ */
22
+ export declare class OperationsLibrary implements ILibraryOperations {
23
+ private readonly library;
24
+ constructor(library: ILibrary);
25
+ find(identifier: string, options?: FindOptions): Promise<CslItem | undefined>;
26
+ getAll(): Promise<CslItem[]>;
27
+ add(item: CslItem): Promise<CslItem>;
28
+ update(idOrUuid: string, updates: Partial<CslItem>, options?: UpdateOptions): Promise<UpdateResult>;
29
+ remove(identifier: string, options?: FindOptions): Promise<RemoveResult>;
30
+ save(): Promise<void>;
31
+ search(options: SearchOperationOptions): Promise<SearchResult>;
32
+ list(options?: ListOptions): Promise<ListResult>;
33
+ cite(options: CiteOperationOptions): Promise<CiteResult>;
34
+ import(inputs: string[], options?: ImportOptions): Promise<ImportResult>;
35
+ }
36
+ //# sourceMappingURL=operations-library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations-library.d.ts","sourceRoot":"","sources":["../../../src/features/operations/operations-library.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,YAAY,EACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,QAAQ;IAI9C,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAI7E,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAI5B,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIpC,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,CAAC;IAIxB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAIxE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMf,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAK9D,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAKhD,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;IAKxD,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAI/E"}
@@ -0,0 +1,29 @@
1
+ import type { CslItem } from "../../core/csl-json/types.js";
2
+ import type { ILibrary } from "../../core/library-interface.js";
3
+ /**
4
+ * Options for removeReference operation
5
+ */
6
+ export interface RemoveOperationOptions {
7
+ /** Reference ID or UUID */
8
+ identifier: string;
9
+ /** If true, identifier is treated as UUID; otherwise as ID (default: false) */
10
+ byUuid?: boolean;
11
+ }
12
+ /**
13
+ * Result of removeReference operation
14
+ */
15
+ export interface RemoveResult {
16
+ /** Whether the reference was removed */
17
+ removed: boolean;
18
+ /** The removed item (if found and removal succeeded) */
19
+ removedItem?: CslItem;
20
+ }
21
+ /**
22
+ * Remove a reference from the library.
23
+ *
24
+ * @param library - The library to remove from
25
+ * @param options - Remove options including identifier and lookup method
26
+ * @returns Result indicating success and the removed item
27
+ */
28
+ export declare function removeReference(library: ILibrary, options: RemoveOperationOptions): Promise<RemoveResult>;
29
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/features/operations/remove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,wDAAwD;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,YAAY,CAAC,CAUvB"}
@@ -0,0 +1,30 @@
1
+ import type { ILibrary } from "../../core/library-interface.js";
2
+ /**
3
+ * Output format options for search operation
4
+ */
5
+ export type SearchFormat = "pretty" | "json" | "bibtex" | "ids-only" | "uuid";
6
+ /**
7
+ * Options for searchReferences operation
8
+ */
9
+ export interface SearchOperationOptions {
10
+ /** Search query string */
11
+ query: string;
12
+ /** Output format (default: "pretty") */
13
+ format?: SearchFormat;
14
+ }
15
+ /**
16
+ * Result of searchReferences operation
17
+ */
18
+ export interface SearchResult {
19
+ /** Formatted strings for each matching reference */
20
+ items: string[];
21
+ }
22
+ /**
23
+ * Search references in the library and return formatted results.
24
+ *
25
+ * @param library - The library to search in
26
+ * @param options - Search query and formatting options
27
+ * @returns Formatted strings for each matching reference
28
+ */
29
+ export declare function searchReferences(library: ILibrary, options: SearchOperationOptions): Promise<SearchResult>;
30
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/features/operations/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAMhE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,YAAY,CAAC,CA0CvB"}
@@ -0,0 +1,39 @@
1
+ import type { CslItem } from "../../core/csl-json/types.js";
2
+ import type { ILibrary } from "../../core/library-interface.js";
3
+ /**
4
+ * Options for updateReference operation
5
+ */
6
+ export interface UpdateOperationOptions {
7
+ /** Reference ID or UUID */
8
+ identifier: string;
9
+ /** If true, identifier is treated as UUID; otherwise as ID (default: false) */
10
+ byUuid?: boolean;
11
+ /** Partial updates to apply to the reference */
12
+ updates: Partial<CslItem>;
13
+ /** How to handle ID collision: 'fail' (default) or 'suffix' */
14
+ onIdCollision?: "fail" | "suffix";
15
+ }
16
+ /**
17
+ * Result of updateReference operation
18
+ */
19
+ export interface UpdateOperationResult {
20
+ /** Whether the update was successful */
21
+ updated: boolean;
22
+ /** The updated item (if successful) */
23
+ item?: CslItem;
24
+ /** True if ID collision occurred (only when updated=false and onIdCollision='fail') */
25
+ idCollision?: boolean;
26
+ /** True if the ID was changed due to collision resolution */
27
+ idChanged?: boolean;
28
+ /** The new ID after collision resolution (only when idChanged=true) */
29
+ newId?: string;
30
+ }
31
+ /**
32
+ * Update a reference in the library.
33
+ *
34
+ * @param library - The library to update
35
+ * @param options - Update options including identifier, updates, and collision handling
36
+ * @returns Result indicating success and the updated item
37
+ */
38
+ export declare function updateReference(library: ILibrary, options: UpdateOperationOptions): Promise<UpdateOperationResult>;
39
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/features/operations/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1B,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uFAAuF;IACvF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CA8BhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../../src/features/search/matcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAiB,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAuRvF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,CAQ/E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,YAAY,GAAG,IAAI,CA4C7F;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,YAAY,EAAE,CAWnF"}
1
+ {"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../../src/features/search/matcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAiB,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAqUvF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,CAQ/E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,YAAY,GAAG,IAAI,CA4C7F;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,YAAY,EAAE,CAWnF"}
@@ -9,4 +9,16 @@
9
9
  * 5. Whitespace normalization
10
10
  */
11
11
  export declare function normalize(text: string): string;
12
+ /**
13
+ * Normalize text for matching while preserving case
14
+ *
15
+ * Applies the following transformations:
16
+ * 1. Unicode NFKC normalization
17
+ * 2. Remove diacritics (accents)
18
+ * 3. Normalize whitespace
19
+ *
20
+ * Unlike `normalize`, this function preserves letter case
21
+ * for use with uppercase-sensitive matching.
22
+ */
23
+ export declare function normalizePreservingCase(text: string): string;
12
24
  //# sourceMappingURL=normalizer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../src/features/search/normalizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsB9C"}
1
+ {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../src/features/search/normalizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsB9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAc5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../../src/features/search/tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,WAAW,EAAe,MAAM,YAAY,CAAC;AA2B3E;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAuBnD"}
1
+ {"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../../src/features/search/tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,WAAW,EAAe,MAAM,YAAY,CAAC;AA4B3E;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAuBnD"}
@@ -5,7 +5,7 @@ import type { CslItem } from "../../core/csl-json/types.js";
5
5
  /**
6
6
  * Field specifier for field-specific search
7
7
  */
8
- export type FieldSpecifier = "author" | "title" | "year" | "doi" | "pmid" | "pmcid" | "url" | "keyword";
8
+ export type FieldSpecifier = "author" | "title" | "year" | "doi" | "pmid" | "pmcid" | "url" | "keyword" | "tag";
9
9
  /**
10
10
  * Search token representing a parsed query element
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/search/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,GACL,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,QAAQ,EAAE,aAAa,CAAC;IACxB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,iCAAiC;IACjC,KAAK,EAAE,WAAW,CAAC;IACnB,qCAAqC;IACrC,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,iEAAiE;IACjE,eAAe,EAAE,aAAa,CAAC;IAC/B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnD,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/search/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,GACL,SAAS,GACT,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,QAAQ,EAAE,aAAa,CAAC;IACxB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,iCAAiC;IACjC,KAAK,EAAE,WAAW,CAAC;IACnB,qCAAqC;IACrC,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,iEAAiE;IACjE,eAAe,EAAE,aAAa,CAAC;IAC/B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnD,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Represents a segment of consecutive uppercase letters in a string.
3
+ */
4
+ export interface UppercaseSegment {
5
+ /** The uppercase segment text */
6
+ segment: string;
7
+ /** Start index (inclusive) */
8
+ start: number;
9
+ /** End index (exclusive) */
10
+ end: number;
11
+ }
12
+ /**
13
+ * Checks if the text contains 2 or more consecutive uppercase letters.
14
+ * Pattern: /[A-Z]{2,}/
15
+ *
16
+ * @param text - The text to check
17
+ * @returns true if text contains consecutive uppercase letters
18
+ */
19
+ export declare function hasConsecutiveUppercase(text: string): boolean;
20
+ /**
21
+ * Extracts all segments of 2 or more consecutive uppercase letters from text.
22
+ * Pattern: /[A-Z]{2,}/g
23
+ *
24
+ * @param text - The text to extract segments from
25
+ * @returns Array of uppercase segments with their positions
26
+ */
27
+ export declare function extractUppercaseSegments(text: string): UppercaseSegment[];
28
+ /**
29
+ * Matches a query string against a target string with case sensitivity
30
+ * for consecutive uppercase segments in the query.
31
+ *
32
+ * - If query contains 2+ consecutive uppercase letters (e.g., AI, RNA),
33
+ * those portions must match exactly in the target.
34
+ * - Other portions are matched case-insensitively.
35
+ *
36
+ * @param query - The search query
37
+ * @param target - The target string to match against
38
+ * @returns true if query matches target according to the rules
39
+ */
40
+ export declare function matchWithUppercaseSensitivity(query: string, target: string): boolean;
41
+ //# sourceMappingURL=uppercase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uppercase.d.ts","sourceRoot":"","sources":["../../../src/features/search/uppercase.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG7D;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAazE;AAoDD;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CA6BpF"}