@sunub/obsidian-mcp-server 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/build/cli/app.d.ts +1 -0
  2. package/build/cli/app.js +7 -0
  3. package/build/cli/app.js.map +1 -0
  4. package/build/cli/colors.d.ts +15 -0
  5. package/build/cli/colors.js +15 -0
  6. package/build/cli/colors.js.map +1 -0
  7. package/build/cli/commands/types.d.ts +19 -0
  8. package/build/cli/commands/types.js +11 -0
  9. package/build/cli/commands/types.js.map +1 -0
  10. package/build/cli/config/mcpServersConfig.d.ts +15 -3
  11. package/build/cli/config/mcpServersConfig.js +2 -2
  12. package/build/cli/config/mcpServersConfig.js.map +1 -1
  13. package/build/cli/constants.d.ts +47 -0
  14. package/build/cli/constants.js +101 -0
  15. package/build/cli/constants.js.map +1 -0
  16. package/build/cli/hooks/useMcpClient.js +1 -1
  17. package/build/cli/index.d.ts +1 -0
  18. package/build/cli/index.js +16 -4
  19. package/build/cli/index.js.map +1 -1
  20. package/build/cli/key/input.d.ts +5 -0
  21. package/build/cli/key/input.js +9 -0
  22. package/build/cli/key/input.js.map +1 -0
  23. package/build/cli/key/mouse.d.ts +23 -0
  24. package/build/cli/key/mouse.js +155 -0
  25. package/build/cli/key/mouse.js.map +1 -0
  26. package/build/cli/key/text-buffer-bestcase.d.ts +867 -0
  27. package/build/cli/key/text-buffer-bestcase.js +2754 -0
  28. package/build/cli/key/text-buffer-bestcase.js.map +1 -0
  29. package/build/cli/key/text-buffer.d.ts +509 -0
  30. package/build/cli/main.d.ts +1 -0
  31. package/build/cli/main.js +20 -0
  32. package/build/cli/main.js.map +1 -0
  33. package/build/cli/reference/text-buffer.d.ts +867 -0
  34. package/build/cli/reference/text-buffer.js +2754 -0
  35. package/build/cli/reference/text-buffer.js.map +1 -0
  36. package/build/cli/theme/builtin/default-dark.d.ts +7 -0
  37. package/build/cli/theme/builtin/default-dark.js +143 -0
  38. package/build/cli/theme/builtin/default-dark.js.map +1 -0
  39. package/build/cli/theme/builtin/no-color.d.ts +7 -0
  40. package/build/cli/theme/builtin/no-color.js +125 -0
  41. package/build/cli/theme/builtin/no-color.js.map +1 -0
  42. package/build/cli/theme/builtin/tokyonight-dark.d.ts +7 -0
  43. package/build/cli/theme/builtin/tokyonight-dark.js +146 -0
  44. package/build/cli/theme/builtin/tokyonight-dark.js.map +1 -0
  45. package/build/cli/theme/semantic-colors.d.ts +2 -0
  46. package/build/cli/theme/semantic-colors.js +19 -0
  47. package/build/cli/theme/semantic-colors.js.map +1 -0
  48. package/build/cli/theme/semantic-tokens.d.ts +42 -0
  49. package/build/cli/theme/semantic-tokens.js +77 -0
  50. package/build/cli/theme/semantic-tokens.js.map +1 -0
  51. package/build/cli/theme/theme-manager.d.ts +32 -0
  52. package/build/cli/theme/theme-manager.js +150 -0
  53. package/build/cli/theme/theme-manager.js.map +1 -0
  54. package/build/cli/theme/theme.d.ts +107 -0
  55. package/build/cli/theme/theme.js +333 -0
  56. package/build/cli/theme/theme.js.map +1 -0
  57. package/build/cli/tmp.d.ts +1 -0
  58. package/build/cli/types.d.ts +72 -0
  59. package/build/cli/types.js +8 -0
  60. package/build/cli/types.js.map +1 -0
  61. package/build/cli/utils/cache.d.ts +21 -0
  62. package/build/cli/utils/cache.js +56 -0
  63. package/build/cli/utils/cache.js.map +1 -0
  64. package/build/cli/utils/debugLogger.js +5 -5
  65. package/build/cli/utils/debugLogger.js.map +1 -1
  66. package/build/config.d.ts +30 -0
  67. package/build/config.js +81 -0
  68. package/build/config.js.map +1 -0
  69. package/build/db.d.ts +1 -0
  70. package/build/index.d.ts +2 -0
  71. package/build/index.js +4 -2
  72. package/build/index.js.map +1 -1
  73. package/build/server.d.ts +2 -0
  74. package/build/server.js +39 -0
  75. package/build/server.js.map +1 -0
  76. package/build/tools/create_document_with_properties/index.js +1 -1
  77. package/build/tools/create_document_with_properties/params.d.ts +3 -3
  78. package/build/tools/create_document_with_properties/params.js +33 -0
  79. package/build/tools/create_document_with_properties/params.js.map +1 -0
  80. package/build/tools/generate_property/index.d.ts +34 -0
  81. package/build/tools/generate_property/params.d.ts +48 -0
  82. package/build/tools/generate_property/params.js +55 -0
  83. package/build/tools/generate_property/params.js.map +1 -0
  84. package/build/tools/index.js +13 -0
  85. package/build/tools/index.js.map +1 -0
  86. package/build/tools/organize_attachments/index.d.ts +32 -0
  87. package/build/tools/organize_attachments/index.js +1 -1
  88. package/build/tools/organize_attachments/params.d.ts +16 -16
  89. package/build/tools/organize_attachments/params.js +61 -0
  90. package/build/tools/organize_attachments/params.js.map +1 -0
  91. package/build/tools/organize_attachments/utils.d.ts +22 -0
  92. package/build/tools/organize_attachments/utils.js +66 -0
  93. package/build/tools/organize_attachments/utils.js.map +1 -0
  94. package/build/tools/vault/index.d.ts +50 -0
  95. package/build/tools/vault/index.js +1 -1
  96. package/build/tools/vault/metrics.d.ts +25 -0
  97. package/build/tools/vault/metrics.js +130 -0
  98. package/build/tools/vault/metrics.js.map +1 -0
  99. package/build/tools/vault/params.d.ts +12 -12
  100. package/build/tools/vault/params.js +148 -0
  101. package/build/tools/vault/params.js.map +1 -0
  102. package/build/tools/vault/types/collect_context.d.ts +249 -249
  103. package/build/tools/vault/types/collect_context.js +103 -0
  104. package/build/tools/vault/types/collect_context.js.map +1 -0
  105. package/build/tools/vault/types/list_all.d.ts +14 -14
  106. package/build/tools/vault/types/list_all.js +53 -0
  107. package/build/tools/vault/types/list_all.js.map +1 -0
  108. package/build/tools/vault/types/read_specific.d.ts +18 -18
  109. package/build/tools/vault/types/read_specific.js +41 -0
  110. package/build/tools/vault/types/read_specific.js.map +1 -0
  111. package/build/tools/vault/types/search.d.ts +22 -22
  112. package/build/tools/vault/types/search.js +59 -0
  113. package/build/tools/vault/types/search.js.map +1 -0
  114. package/build/tools/vault/utils/actions/collect_context.d.ts +4 -0
  115. package/build/tools/vault/utils/actions/index_rag.d.ts +2 -0
  116. package/build/tools/vault/utils/actions/index_rag.js +1 -1
  117. package/build/tools/vault/utils/actions/list_all.d.ts +4 -0
  118. package/build/tools/vault/utils/actions/load_memory.d.ts +4 -0
  119. package/build/tools/vault/utils/actions/read.d.ts +4 -0
  120. package/build/tools/vault/utils/actions/search.d.ts +4 -0
  121. package/build/tools/vault/utils/actions/search_semantic.d.ts +3 -0
  122. package/build/tools/vault/utils/actions/search_semantic.js +23 -6
  123. package/build/tools/vault/utils/actions/search_semantic.js.map +1 -1
  124. package/build/tools/vault/utils/actions/stats.d.ts +3 -0
  125. package/build/tools/vault/utils/constants.d.ts +2 -0
  126. package/build/tools/vault/utils/constants.js +3 -0
  127. package/build/tools/vault/utils/constants.js.map +1 -0
  128. package/build/tools/vault/utils/document.d.ts +35 -0
  129. package/build/tools/vault/utils/shared.d.ts +29 -0
  130. package/build/tools/vault/utils/shared.js +75 -0
  131. package/build/tools/vault/utils/shared.js.map +1 -0
  132. package/build/tools/vault/utils.d.ts +8 -0
  133. package/build/tools/vault/utils.js +9 -0
  134. package/build/tools/vault/utils.js.map +1 -0
  135. package/build/tools/write_property/index.js +1 -1
  136. package/build/tools/write_property/params.d.ts +60 -0
  137. package/build/tools/write_property/params.js +52 -0
  138. package/build/tools/write_property/params.js.map +1 -0
  139. package/build/utils/LLMClient.d.ts +1 -3
  140. package/build/utils/LLMClient.js +18 -4
  141. package/build/utils/LLMClient.js.map +1 -1
  142. package/build/utils/RerankerClient.d.ts +38 -4
  143. package/build/utils/RerankerClient.js +2 -1
  144. package/build/utils/RerankerClient.js.map +1 -1
  145. package/build/utils/VaultWatcher.js +35 -28
  146. package/build/utils/VaultWatcher.js.map +1 -1
  147. package/build/utils/getVaultManager.js +1 -1
  148. package/build/utils/processor/types.d.ts +2 -2
  149. package/build/utils/processor/types.js +21 -0
  150. package/build/utils/processor/types.js.map +1 -0
  151. package/build/utils/semaphore.d.ts +7 -0
  152. package/build/utils/semaphore.js +26 -0
  153. package/build/utils/semaphore.js.map +1 -0
  154. package/package.json +3 -2
@@ -0,0 +1,333 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import tinycolor from "tinycolor2";
7
+ import tinygradient from "tinygradient";
8
+ import { DEFAULT_INPUT_BACKGROUND_OPACITY, DEFAULT_SELECTION_OPACITY, } from "../constants.js";
9
+ // Define the set of Ink's named colors for quick lookup
10
+ export const INK_SUPPORTED_NAMES = new Set([
11
+ "black",
12
+ "red",
13
+ "green",
14
+ "yellow",
15
+ "blue",
16
+ "cyan",
17
+ "magenta",
18
+ "white",
19
+ "gray",
20
+ "grey",
21
+ "blackbright",
22
+ "redbright",
23
+ "greenbright",
24
+ "yellowbright",
25
+ "bluebright",
26
+ "cyanbright",
27
+ "magentabright",
28
+ "whitebright",
29
+ ]);
30
+ // Use tinycolor's built-in names map for CSS colors, excluding ones Ink supports
31
+ export const CSS_NAME_TO_HEX_MAP = Object.fromEntries(Object.entries(tinycolor.names)
32
+ .filter(([name]) => !INK_SUPPORTED_NAMES.has(name))
33
+ .map(([name, hex]) => [name, `#${hex}`]));
34
+ // Mapping for ANSI bright colors that are not in tinycolor's standard CSS names
35
+ export const INK_NAME_TO_HEX_MAP = {
36
+ blackbright: "#555555",
37
+ redbright: "#ff5555",
38
+ greenbright: "#55ff55",
39
+ yellowbright: "#ffff55",
40
+ bluebright: "#5555ff",
41
+ magentabright: "#ff55ff",
42
+ cyanbright: "#55ffff",
43
+ whitebright: "#ffffff",
44
+ };
45
+ /**
46
+ * Calculates the relative luminance of a color.
47
+ * See https://www.w3.org/TR/WCAG20/#relativeluminancedef
48
+ *
49
+ * @param color Color string (hex or Ink-supported name)
50
+ * @returns Luminance value (0-255)
51
+ */
52
+ export function getLuminance(color) {
53
+ const resolved = color.toLowerCase();
54
+ const hex = INK_NAME_TO_HEX_MAP[resolved] || resolved;
55
+ const colorObj = tinycolor(hex);
56
+ if (!colorObj.isValid()) {
57
+ return 0;
58
+ }
59
+ // tinycolor returns 0-1, we need 0-255
60
+ return colorObj.getLuminance() * 255;
61
+ }
62
+ /**
63
+ * Resolves a CSS color value (name or hex) into an Ink-compatible color string.
64
+ * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki').
65
+ * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable.
66
+ */
67
+ export function resolveColor(colorValue) {
68
+ const lowerColor = colorValue.toLowerCase();
69
+ // 1. Check if it's already a hex code and valid
70
+ if (lowerColor.startsWith("#")) {
71
+ if (/^#[0-9A-Fa-f]{3}([0-9A-Fa-f]{3})?$/.test(colorValue)) {
72
+ return lowerColor;
73
+ }
74
+ else {
75
+ return undefined;
76
+ }
77
+ }
78
+ // Handle hex codes without #
79
+ if (/^[0-9A-Fa-f]{3}([0-9A-Fa-f]{3})?$/.test(colorValue)) {
80
+ return `#${lowerColor}`;
81
+ }
82
+ // 2. Check if it's an Ink supported name (lowercase)
83
+ if (INK_SUPPORTED_NAMES.has(lowerColor)) {
84
+ return lowerColor; // Use Ink name directly
85
+ }
86
+ // 3. Check if it's a known CSS name we can map to hex
87
+ // We can't import CSS_NAME_TO_HEX_MAP here due to circular deps,
88
+ // but we can use tinycolor directly for named colors.
89
+ const colorObj = tinycolor(lowerColor);
90
+ if (colorObj.isValid()) {
91
+ return colorObj.toHexString();
92
+ }
93
+ // 4. Could not resolve
94
+ return undefined;
95
+ }
96
+ export function interpolateColor(color1, color2, factor) {
97
+ if (factor <= 0 && color1) {
98
+ return color1;
99
+ }
100
+ if (factor >= 1 && color2) {
101
+ return color2;
102
+ }
103
+ if (!color1 || !color2) {
104
+ return "";
105
+ }
106
+ try {
107
+ const gradient = tinygradient(color1, color2);
108
+ const color = gradient.rgbAt(factor);
109
+ return color.toHexString();
110
+ }
111
+ catch {
112
+ return color1;
113
+ }
114
+ }
115
+ export function getThemeTypeFromBackgroundColor(backgroundColor) {
116
+ if (!backgroundColor) {
117
+ return undefined;
118
+ }
119
+ const resolvedColor = resolveColor(backgroundColor);
120
+ if (!resolvedColor) {
121
+ return undefined;
122
+ }
123
+ const luminance = getLuminance(resolvedColor);
124
+ return luminance > 128 ? "light" : "dark";
125
+ }
126
+ export const lightTheme = {
127
+ type: "light",
128
+ Background: "#FFFFFF",
129
+ Foreground: "#000000",
130
+ LightBlue: "#005FAF",
131
+ AccentBlue: "#005FAF",
132
+ AccentPurple: "#5F00FF",
133
+ AccentCyan: "#005F87",
134
+ AccentGreen: "#005F00",
135
+ AccentYellow: "#875F00",
136
+ AccentRed: "#AF0000",
137
+ DiffAdded: "#D7FFD7",
138
+ DiffRemoved: "#FFD7D7",
139
+ Comment: "#008700",
140
+ Gray: "#5F5F5F",
141
+ DarkGray: "#5F5F5F",
142
+ InputBackground: "#E4E4E4",
143
+ MessageBackground: "#FAFAFA",
144
+ FocusBackground: "#D7FFD7",
145
+ GradientColors: ["#4796E4", "#847ACE", "#C3677F"],
146
+ };
147
+ export const darkTheme = {
148
+ type: "dark",
149
+ Background: "#000000",
150
+ Foreground: "#FFFFFF",
151
+ LightBlue: "#AFD7D7",
152
+ AccentBlue: "#87AFFF",
153
+ AccentPurple: "#D7AFFF",
154
+ AccentCyan: "#87D7D7",
155
+ AccentGreen: "#D7FFD7",
156
+ AccentYellow: "#FFFFAF",
157
+ AccentRed: "#FF87AF",
158
+ DiffAdded: "#005F00",
159
+ DiffRemoved: "#5F0000",
160
+ Comment: "#AFAFAF",
161
+ Gray: "#AFAFAF",
162
+ DarkGray: "#878787",
163
+ InputBackground: "#5F5F5F",
164
+ MessageBackground: "#5F5F5F",
165
+ FocusBackground: "#005F00",
166
+ GradientColors: ["#4796E4", "#847ACE", "#C3677F"],
167
+ };
168
+ export const ansiTheme = {
169
+ type: "ansi",
170
+ Background: "black",
171
+ Foreground: "",
172
+ LightBlue: "blue",
173
+ AccentBlue: "blue",
174
+ AccentPurple: "magenta",
175
+ AccentCyan: "cyan",
176
+ AccentGreen: "green",
177
+ AccentYellow: "yellow",
178
+ AccentRed: "red",
179
+ DiffAdded: "green",
180
+ DiffRemoved: "red",
181
+ Comment: "gray",
182
+ Gray: "gray",
183
+ DarkGray: "gray",
184
+ InputBackground: "black",
185
+ MessageBackground: "black",
186
+ FocusBackground: "black",
187
+ };
188
+ export class Theme {
189
+ name;
190
+ type;
191
+ colors;
192
+ /**
193
+ * The default foreground color for text when no specific highlight rule applies.
194
+ * This is an Ink-compatible color string (hex or name).
195
+ */
196
+ defaultColor;
197
+ /**
198
+ * Stores the mapping from highlight.js class names (e.g., 'hljs-keyword')
199
+ * to Ink-compatible color strings (hex or name).
200
+ */
201
+ _colorMap;
202
+ semanticColors;
203
+ /**
204
+ * Creates a new Theme instance.
205
+ * @param name The name of the theme.
206
+ * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object.
207
+ */
208
+ constructor(name, type, rawMappings, colors, semanticColors) {
209
+ this.name = name;
210
+ this.type = type;
211
+ this.colors = colors;
212
+ this.semanticColors = semanticColors ?? {
213
+ text: {
214
+ primary: this.colors.Foreground,
215
+ secondary: this.colors.Gray,
216
+ link: this.colors.AccentBlue,
217
+ accent: this.colors.AccentPurple,
218
+ response: this.colors.Foreground,
219
+ },
220
+ background: {
221
+ primary: this.colors.Background,
222
+ message: this.colors.MessageBackground ??
223
+ interpolateColor(this.colors.Background, this.colors.Gray, DEFAULT_INPUT_BACKGROUND_OPACITY),
224
+ input: this.colors.InputBackground ??
225
+ interpolateColor(this.colors.Background, this.colors.Gray, DEFAULT_INPUT_BACKGROUND_OPACITY),
226
+ focus: this.colors.FocusBackground ??
227
+ interpolateColor(this.colors.Background, this.colors.FocusColor ?? this.colors.AccentGreen, DEFAULT_SELECTION_OPACITY),
228
+ diff: {
229
+ added: this.colors.DiffAdded,
230
+ removed: this.colors.DiffRemoved,
231
+ },
232
+ },
233
+ border: {
234
+ default: this.colors.DarkGray,
235
+ },
236
+ ui: {
237
+ comment: this.colors.Gray,
238
+ symbol: this.colors.AccentCyan,
239
+ active: this.colors.AccentBlue,
240
+ dark: this.colors.DarkGray,
241
+ focus: this.colors.FocusColor ?? this.colors.AccentGreen,
242
+ gradient: this.colors.GradientColors,
243
+ },
244
+ status: {
245
+ error: this.colors.AccentRed,
246
+ success: this.colors.AccentGreen,
247
+ warning: this.colors.AccentYellow,
248
+ },
249
+ };
250
+ this._colorMap = Object.freeze(this._buildColorMap(rawMappings)); // Build and freeze the map
251
+ // Determine the default foreground color
252
+ const rawDefaultColor = rawMappings["hljs"]?.color;
253
+ this.defaultColor =
254
+ (rawDefaultColor
255
+ ? Theme._resolveColor(rawDefaultColor)
256
+ : undefined) ?? ""; // Default to empty string if not found or resolvable
257
+ }
258
+ /**
259
+ * Gets the Ink-compatible color string for a given highlight.js class name.
260
+ * @param hljsClass The highlight.js class name (e.g., 'hljs-keyword', 'hljs-string').
261
+ * @returns The corresponding Ink color string (hex or name) if it exists.
262
+ */
263
+ getInkColor(hljsClass) {
264
+ return this._colorMap[hljsClass];
265
+ }
266
+ /**
267
+ * Resolves a CSS color value (name or hex) into an Ink-compatible color string.
268
+ * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki').
269
+ * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable.
270
+ */
271
+ static _resolveColor(colorValue) {
272
+ return resolveColor(colorValue);
273
+ }
274
+ /**
275
+ * Builds the internal map from highlight.js class names to Ink-compatible color strings.
276
+ * This method is protected and primarily intended for use by the constructor.
277
+ * @param hljsTheme The raw CSSProperties mappings from a react-syntax-highlighter theme object.
278
+ * @returns An Ink-compatible theme map (Record<string, string>).
279
+ */
280
+ _buildColorMap(hljsTheme) {
281
+ const inkTheme = {};
282
+ for (const key in hljsTheme) {
283
+ // Ensure the key starts with 'hljs-' or is 'hljs' for the base style
284
+ if (!key.startsWith("hljs-") && key !== "hljs") {
285
+ continue; // Skip keys not related to highlighting classes
286
+ }
287
+ const style = hljsTheme[key];
288
+ if (style?.color) {
289
+ const resolvedColor = Theme._resolveColor(style.color);
290
+ if (resolvedColor !== undefined) {
291
+ // Use the original key from the hljsTheme (e.g., 'hljs-keyword')
292
+ inkTheme[key] = resolvedColor;
293
+ }
294
+ // If color is not resolvable, it's omitted from the map,
295
+ // this enables falling back to the default foreground color.
296
+ }
297
+ // We currently only care about the 'color' property for Ink rendering.
298
+ // Other properties like background, fontStyle, etc., are ignored.
299
+ }
300
+ return inkTheme;
301
+ }
302
+ }
303
+ /**
304
+ * Picks a default theme name based on terminal background color.
305
+ * It first tries to find a theme with an exact background color match.
306
+ * If no match is found, it falls back to a light or dark theme based on the
307
+ * luminance of the background color.
308
+ * @param terminalBackground The hex color string of the terminal background.
309
+ * @param availableThemes A list of available themes to search through.
310
+ * @param defaultDarkThemeName The name of the fallback dark theme.
311
+ * @param defaultLightThemeName The name of the fallback light theme.
312
+ * @returns The name of the chosen theme.
313
+ */
314
+ export function pickDefaultThemeName(terminalBackground, availableThemes, defaultDarkThemeName, defaultLightThemeName) {
315
+ if (terminalBackground) {
316
+ const lowerTerminalBackground = terminalBackground.toLowerCase();
317
+ for (const theme of availableThemes) {
318
+ if (!theme.colors.Background)
319
+ continue;
320
+ // resolveColor can return undefined
321
+ const themeBg = resolveColor(theme.colors.Background)?.toLowerCase();
322
+ if (themeBg === lowerTerminalBackground) {
323
+ return theme.name;
324
+ }
325
+ }
326
+ }
327
+ const themeType = getThemeTypeFromBackgroundColor(terminalBackground);
328
+ if (themeType === "light") {
329
+ return defaultLightThemeName;
330
+ }
331
+ return defaultDarkThemeName;
332
+ }
333
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/cli/theme/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EACN,gCAAgC,EAChC,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AAGzB,wDAAwD;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;I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
+ export {};
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Core types for the CLI AI Agent conversation system.
3
+ *
4
+ * These types define the data structures used to manage conversation state,
5
+ * streaming responses, and history rendering throughout the application.
6
+ */
7
+ /** 대화 기록의 단일 항목 */
8
+ export interface HistoryItem {
9
+ /** 고유 식별자 (자동 증가) */
10
+ id: number;
11
+ /** 메시지 타입 */
12
+ type: "user" | "assistant" | "error" | "info";
13
+ /** 메시지 내용 (일반 텍스트, 향후 마크다운 렌더링 확장 가능) */
14
+ content: string;
15
+ /** 생성 시각 (Date.now()) */
16
+ timestamp: number;
17
+ }
18
+ /**
19
+ * 현재 스트리밍 중인 응답의 상태.
20
+ *
21
+ * `<Static>` 바깥에서 활발히 리렌더링되며,
22
+ * `isComplete === true`가 되면 AppContainer가 history로 이관합니다.
23
+ */
24
+ export interface PendingItem {
25
+ type: "assistant";
26
+ /** 실시간으로 누적되는 텍스트 (thinking 제외) */
27
+ content: string;
28
+ /** 생각하는 과정 텍스트 */
29
+ thinkingContent?: string;
30
+ /** 현재 thinking 블록 안에 있는지 */
31
+ isThinking?: boolean;
32
+ /** 스트림이 완료되었는지 */
33
+ isComplete: boolean;
34
+ }
35
+ /**
36
+ * LLM 스트리밍의 전체 상태 머신.
37
+ *
38
+ * - `idle`: 대기 상태 (입력 가능)
39
+ * - `thinking`: 요청 전송 완료, 첫 번째 청크 대기 중
40
+ * - `streaming`: 청크가 도착하여 실시간 출력 중
41
+ * - `error`: 스트리밍 중 에러 발생
42
+ */
43
+ export type StreamingState = "idle" | "thinking" | "streaming" | "error";
44
+ /**
45
+ * 컨텐츠 렌더링 함수 시그니처.
46
+ * 향후 마크다운 렌더링 지원 시 이 타입의 구현체를 교체하면 됩니다.
47
+ */
48
+ export type ContentRenderer = (content: string, width: number) => string;
49
+ /** Ollama 대화 메시지 (멀티턴 히스토리용) */
50
+ export interface OllamaMessage {
51
+ role: "system" | "user" | "assistant";
52
+ content: string;
53
+ }
54
+ /** MCP 도구 호출 결과 (SDK의 CallToolResult 경량 재정의) */
55
+ export interface McpToolResult {
56
+ isError?: boolean;
57
+ content: Array<{
58
+ type: string;
59
+ text?: string;
60
+ }>;
61
+ }
62
+ /** MCP callTool 함수 시그니처 */
63
+ export type CallToolFn = (name: string, args: Record<string, unknown>) => Promise<McpToolResult>;
64
+ /** Dispatcher 슬래시 커맨드 처리 결과 */
65
+ export interface DispatchResult {
66
+ type: "tool_result" | "local_action" | "unknown_command" | "llm_required";
67
+ content: string;
68
+ /** llm_required 타입일 때 원본 사용자 입력 (LLM에게 보낼 의도) */
69
+ userIntent?: string;
70
+ }
71
+ /** MCP 클라이언트 연결 상태 */
72
+ export type McpConnectionState = "disconnected" | "connecting" | "connected" | "error";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Core types for the CLI AI Agent conversation system.
3
+ *
4
+ * These types define the data structures used to manage conversation state,
5
+ * streaming responses, and history rendering throughout the application.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,21 @@
1
+ export interface CacheEntry<V> {
2
+ value: V;
3
+ timestamp: number;
4
+ ttl?: number;
5
+ }
6
+ export interface CacheOptions {
7
+ defaultTTL?: number;
8
+ deleteOnPromiseFailure?: boolean;
9
+ }
10
+ export declare class CacheService<K extends object | string | undefined, V> {
11
+ private readonly storage;
12
+ private readonly defaultTTL?;
13
+ private readonly deleteOnPromiseFailure;
14
+ constructor(options?: CacheOptions);
15
+ get(key: K): V | undefined;
16
+ set(key: K, value: V, ttl?: number): void;
17
+ getOrCreate(key: K, creator: () => V, ttl?: number): V;
18
+ delete(key: K): void;
19
+ }
20
+ export declare function createCache<K extends string | undefined, V>(options: CacheOptions): CacheService<K, V>;
21
+ export declare function createCache<K extends object, V>(options?: CacheOptions): CacheService<K, V>;
@@ -0,0 +1,56 @@
1
+ export class CacheService {
2
+ storage;
3
+ defaultTTL;
4
+ deleteOnPromiseFailure;
5
+ constructor(options = {}) {
6
+ this.storage = new Map();
7
+ this.defaultTTL = options.defaultTTL;
8
+ this.deleteOnPromiseFailure = options.deleteOnPromiseFailure ?? false;
9
+ }
10
+ get(key) {
11
+ const entry = this.storage.get(key);
12
+ if (!entry) {
13
+ return undefined;
14
+ }
15
+ const ttl = entry.ttl ?? this.defaultTTL;
16
+ if (ttl !== undefined && Date.now() - entry.timestamp > ttl) {
17
+ this.delete(key);
18
+ }
19
+ return entry.value;
20
+ }
21
+ set(key, value, ttl) {
22
+ const entry = {
23
+ value,
24
+ timestamp: Date.now(),
25
+ ttl,
26
+ };
27
+ this.storage.set(key, entry);
28
+ if (this.deleteOnPromiseFailure && value instanceof Promise) {
29
+ value.catch(() => {
30
+ if (this.storage.get(key) === entry) {
31
+ this.delete(key);
32
+ }
33
+ });
34
+ }
35
+ }
36
+ getOrCreate(key, creator, ttl) {
37
+ let value = this.get(key);
38
+ if (value === undefined) {
39
+ value = creator();
40
+ this.set(key, value, ttl);
41
+ }
42
+ return value;
43
+ }
44
+ delete(key) {
45
+ if (this.storage instanceof Map) {
46
+ this.storage.delete(key);
47
+ }
48
+ else {
49
+ this.storage.delete(key);
50
+ }
51
+ }
52
+ }
53
+ export function createCache(options = {}) {
54
+ return new CacheService(options);
55
+ }
56
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/cli/utils/cache.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,YAAY;IACP,OAAO,CAAwB;IAC/B,UAAU,CAAU;IACpB,sBAAsB,CAAU;IAEjD,YAAY,UAAwB,EAAE;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,I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AAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,CAAC,GAAM;QACZ,IAAI,IAAI,CAAC,OAAO,YAAY,GAAG,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAA2C,CAAC,MAAM,CAAC,GAAc,CAAC,CAAC;QAC1E,CAAC;IACF,CAAC;CACD;AAQD,MAAM,UAAU,WAAW,CAC1B,UAAwB,EAAE;IAE1B,OAAO,IAAI,YAAY,CAAO,OAAO,CAAC,CAAC;AACxC,CAAC"}
@@ -29,23 +29,23 @@ class DebugLogger {
29
29
  }
30
30
  info(...args) {
31
31
  this.writeToFile("INFO", args);
32
- console.info(chalk.green("[INFO]"), chalk.gray(util.format(...args)));
32
+ console.info(chalk.green("[INFO]"), chalk.green(util.format(...args)));
33
33
  }
34
34
  log(...args) {
35
35
  this.writeToFile("LOG", args);
36
- console.log(chalk.blue("[LOG]"), chalk.white(util.format(...args)));
36
+ console.log(chalk.blue("[LOG]"), chalk.gray(util.format(...args)));
37
37
  }
38
38
  warn(...args) {
39
39
  this.writeToFile("WARN", args);
40
- console.warn(chalk.yellow("[WARN]"), chalk.gray(util.format(...args)));
40
+ console.warn(chalk.yellow("[WARN]"), chalk.yellow(util.format(...args)));
41
41
  }
42
42
  error(...args) {
43
43
  this.writeToFile("ERROR", args);
44
- console.error(chalk.red("[ERROR]"), chalk.gray(util.format(...args)));
44
+ console.error(chalk.red("[ERROR]"), chalk.red(util.format(...args)));
45
45
  }
46
46
  debug(...args) {
47
47
  this.writeToFile("DEBUG", args);
48
- console.debug(chalk.magenta("[DEBUG]"), chalk.gray(util.format(...args)));
48
+ console.debug(chalk.magenta("[DEBUG]"), chalk.magenta(util.format(...args)));
49
49
  }
50
50
  }
51
51
  export const debugLogger = new DebugLog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C;IAC1E,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACvB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACvB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,KAAK,CACZ,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EACxB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CACnC,CAAC;IACH,CAAC;CACD;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ export declare const configSchema: z.ZodObject<{
3
+ vaultPath: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
4
+ loggingLevel: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
5
+ llmApiUrl: z.ZodDefault<z.ZodString>;
6
+ llmEmbeddingApiUrl: z.ZodDefault<z.ZodString>;
7
+ llmEmbeddingModel: z.ZodDefault<z.ZodString>;
8
+ llmChatModel: z.ZodDefault<z.ZodString>;
9
+ llmRerankerApiUrl: z.ZodDefault<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ vaultPath: string;
12
+ loggingLevel: "debug" | "info" | "warn" | "error";
13
+ llmApiUrl: string;
14
+ llmEmbeddingApiUrl: string;
15
+ llmEmbeddingModel: string;
16
+ llmChatModel: string;
17
+ llmRerankerApiUrl: string;
18
+ }, {
19
+ vaultPath: string;
20
+ loggingLevel?: "debug" | "info" | "warn" | "error" | undefined;
21
+ llmApiUrl?: string | undefined;
22
+ llmEmbeddingApiUrl?: string | undefined;
23
+ llmEmbeddingModel?: string | undefined;
24
+ llmChatModel?: string | undefined;
25
+ llmRerankerApiUrl?: string | undefined;
26
+ }>;
27
+ export type ObsidianMcpConfig = z.infer<typeof configSchema>;
28
+ declare const state: ObsidianMcpConfig;
29
+ export declare function getOptions(): ObsidianMcpConfig | false;
30
+ export default state;