@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,146 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { interpolateColor, Theme } from "../theme.js";
7
+ const palette = {
8
+ bg: "#1a1b26",
9
+ bg_dark: "#16161e",
10
+ bg_dark1: "#0C0E14",
11
+ bg_highlight: "#292e42",
12
+ blue: "#7aa2f7",
13
+ blue0: "#3d59a1",
14
+ blue1: "#2ac3de",
15
+ blue2: "#0db9d7",
16
+ blue5: "#89ddff",
17
+ blue6: "#b4f9f8",
18
+ blue7: "#394b70",
19
+ comment: "#565f89",
20
+ cyan: "#7dcfff",
21
+ fg: "#c0caf5",
22
+ fg_dark: "#a9b1d6",
23
+ fg_gutter: "#3b4261",
24
+ green: "#9ece6a",
25
+ green1: "#73daca",
26
+ green2: "#41a6b5",
27
+ magenta: "#bb9af7",
28
+ magenta2: "#ff007c",
29
+ orange: "#ff9e64",
30
+ purple: "#9d7cd8",
31
+ red: "#f7768e",
32
+ red1: "#db4b4b",
33
+ teal: "#1abc9c",
34
+ yellow: "#e0af68",
35
+ diff: {
36
+ add: "#243e4a",
37
+ change: "#1f2231",
38
+ delete: "#4a272f",
39
+ },
40
+ };
41
+ const tokyoNightColors = {
42
+ type: "dark",
43
+ Background: palette.bg,
44
+ Foreground: palette.fg,
45
+ LightBlue: palette.purple,
46
+ AccentBlue: palette.magenta,
47
+ AccentPurple: palette.blue,
48
+ AccentCyan: palette.cyan,
49
+ AccentGreen: palette.teal,
50
+ AccentYellow: palette.yellow,
51
+ AccentRed: palette.red1,
52
+ DiffAdded: palette.diff.add,
53
+ DiffRemoved: palette.diff.delete,
54
+ Comment: palette.comment,
55
+ Gray: palette.fg_dark,
56
+ DarkGray: palette.fg_gutter,
57
+ FocusColor: palette.blue,
58
+ GradientColors: [palette.blue, palette.magenta, palette.cyan],
59
+ };
60
+ export const TokyoNight = new Theme("Tokyo Night", "dark", {
61
+ hljs: {
62
+ display: "block",
63
+ overflowX: "auto",
64
+ padding: "0.5em",
65
+ background: palette.bg,
66
+ color: palette.fg,
67
+ },
68
+ "hljs-addition": { background: palette.diff.add },
69
+ "hljs-attr": { color: palette.green1 },
70
+ "hljs-attribute": { color: palette.green1 },
71
+ "hljs-brace": { color: palette.fg_dark },
72
+ "hljs-built_in": { color: palette.blue1 },
73
+ "hljs-builtin-symbol": { color: palette.blue1 },
74
+ "hljs-bullet": {
75
+ color: palette.orange,
76
+ fontWeight: "bold",
77
+ },
78
+ "hljs-char": { color: palette.green },
79
+ "hljs-char-escape": { color: palette.magenta },
80
+ "hljs-character": { color: palette.green },
81
+ "hljs-class": { color: palette.blue1 },
82
+ "hljs-class-title": { color: palette.blue1 },
83
+ "hljs-code": { color: palette.green },
84
+ "hljs-comment": {
85
+ color: palette.comment,
86
+ fontStyle: "italic",
87
+ },
88
+ "hljs-computation-expression": { color: palette.cyan },
89
+ "hljs-deletion": { background: palette.diff.delete },
90
+ "hljs-doctag": { color: palette.yellow },
91
+ "hljs-emphasis": { fontStyle: "italic" },
92
+ "hljs-function": { color: palette.blue },
93
+ "hljs-function-dispatch": { color: palette.blue },
94
+ "hljs-keyword": {
95
+ color: palette.magenta,
96
+ fontStyle: "italic",
97
+ },
98
+ "hljs-label": { color: palette.blue },
99
+ "hljs-link": { color: palette.teal },
100
+ "hljs-literal": { color: palette.orange },
101
+ "hljs-message-name": { color: palette.blue },
102
+ "hljs-meta": { color: palette.cyan },
103
+ "hljs-meta-prompt": { color: palette.fg_dark },
104
+ "hljs-name": { color: palette.magenta },
105
+ "hljs-named-character": { color: palette.blue1 },
106
+ "hljs-number": { color: palette.orange },
107
+ "hljs-operator": { color: palette.blue5 },
108
+ "hljs-params": { color: palette.yellow },
109
+ "hljs-property": { color: palette.green1 },
110
+ "hljs-punctuation": { color: palette.fg_dark },
111
+ "hljs-quote": {
112
+ color: palette.comment,
113
+ fontStyle: "italic",
114
+ },
115
+ "hljs-regex": { color: palette.blue6 },
116
+ "hljs-regexp": { color: palette.blue6 },
117
+ "hljs-rest_arg": {
118
+ color: interpolateColor(palette.yellow, palette.fg, 0.8),
119
+ },
120
+ "hljs-section": {
121
+ color: palette.blue,
122
+ fontWeight: "bold",
123
+ },
124
+ "hljs-selector-attr": { color: palette.cyan },
125
+ "hljs-selector-class": { color: palette.green1 },
126
+ "hljs-selector-id": { color: palette.green1 },
127
+ "hljs-selector-pseudo": { color: palette.cyan },
128
+ "hljs-selector-tag": { color: palette.magenta },
129
+ "hljs-string": { color: palette.green },
130
+ "hljs-strong": { fontWeight: "bold" },
131
+ "hljs-subst": { color: palette.blue5 },
132
+ "hljs-symbol": { color: palette.magenta },
133
+ "hljs-tag": { color: palette.blue1 },
134
+ "hljs-template-tag": { color: palette.blue5 },
135
+ "hljs-template-variable": { color: palette.fg },
136
+ "hljs-title": { color: palette.blue },
137
+ "hljs-title-class": { color: palette.blue1 },
138
+ "hljs-title-class-inherited": { color: palette.blue1 },
139
+ "hljs-title-function": { color: palette.blue },
140
+ "hljs-title-function-invoke": { color: palette.blue },
141
+ "hljs-type": { color: palette.blue1 },
142
+ "hljs-variable": { color: palette.fg },
143
+ "hljs-variable-constant": { color: palette.orange },
144
+ "hljs-variable-language": { color: palette.red },
145
+ }, tokyoNightColors);
146
+ //# sourceMappingURL=tokyonight-dark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokyonight-dark.js","sourceRoot":"","sources":["../../../../src/cli/theme/builtin/tokyonight-dark.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAoB,gBAAgB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,OAAO,GAAG;IACf,EAAE,EAAE,SAAS;IACb,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,SAAS;IACnB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IA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C5C,4BAA4B,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE;IACtD,qBAAqB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE;IAC9C,4BAA4B,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE;IACrD,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE;IACrC,eAAe,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE;IACtC,wBAAwB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE;IACnD,wBAAwB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE;CAChD,EACD,gBAAgB,CAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { SemanticColors } from "./semantic-tokens.js";
2
+ export declare const theme: SemanticColors;
@@ -0,0 +1,19 @@
1
+ import { themeManager } from "./theme-manager.js";
2
+ export const theme = {
3
+ get text() {
4
+ return themeManager.getSemanticColors().text;
5
+ },
6
+ get background() {
7
+ return themeManager.getSemanticColors().background;
8
+ },
9
+ get border() {
10
+ return themeManager.getSemanticColors().border;
11
+ },
12
+ get ui() {
13
+ return themeManager.getSemanticColors().ui;
14
+ },
15
+ get status() {
16
+ return themeManager.getSemanticColors().status;
17
+ },
18
+ };
19
+ //# sourceMappingURL=semantic-colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-colors.js","sourceRoot":"","sources":["../../../src/cli/theme/semantic-colors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,KAAK,GAAmB;IACpC,IAAI,IAAI;QACP,OAAO,YAAY,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC;IAC9C,CAAC;IACD,IAAI,UAAU;QACb,OAAO,YAAY,CAAC,iBAAiB,EAAE,CAAC,UAAU,CAAC;IACpD,CAAC;IACD,IAAI,MAAM;QACT,OAAO,YAAY,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC;IAChD,CAAC;IACD,IAAI,EAAE;QACL,OAAO,YAAY,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC;IAC5C,CAAC;IACD,IAAI,MAAM;QACT,OAAO,YAAY,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC;IAChD,CAAC;CACD,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export interface SemanticColors {
7
+ text: {
8
+ primary: string;
9
+ secondary: string;
10
+ link: string;
11
+ accent: string;
12
+ response: string;
13
+ };
14
+ background: {
15
+ primary: string;
16
+ message: string;
17
+ input: string;
18
+ focus: string;
19
+ diff: {
20
+ added: string;
21
+ removed: string;
22
+ };
23
+ };
24
+ border: {
25
+ default: string;
26
+ };
27
+ ui: {
28
+ comment: string;
29
+ symbol: string;
30
+ active: string;
31
+ dark: string;
32
+ focus: string;
33
+ gradient: string[] | undefined;
34
+ };
35
+ status: {
36
+ error: string;
37
+ success: string;
38
+ warning: string;
39
+ };
40
+ }
41
+ export declare const lightSemanticColors: SemanticColors;
42
+ export declare const darkSemanticColors: SemanticColors;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { darkTheme, lightTheme } from "./theme.js";
7
+ export const lightSemanticColors = {
8
+ text: {
9
+ primary: lightTheme.Foreground,
10
+ secondary: lightTheme.Gray,
11
+ link: lightTheme.AccentBlue,
12
+ accent: lightTheme.AccentPurple,
13
+ response: lightTheme.Foreground,
14
+ },
15
+ background: {
16
+ primary: lightTheme.Background,
17
+ message: lightTheme.MessageBackground ?? "",
18
+ input: lightTheme.InputBackground ?? "",
19
+ focus: lightTheme.FocusBackground ?? "",
20
+ diff: {
21
+ added: lightTheme.DiffAdded,
22
+ removed: lightTheme.DiffRemoved,
23
+ },
24
+ },
25
+ border: {
26
+ default: lightTheme.DarkGray,
27
+ },
28
+ ui: {
29
+ comment: lightTheme.Comment,
30
+ symbol: lightTheme.Gray,
31
+ active: lightTheme.AccentBlue,
32
+ dark: lightTheme.DarkGray,
33
+ focus: lightTheme.AccentGreen,
34
+ gradient: lightTheme.GradientColors,
35
+ },
36
+ status: {
37
+ error: lightTheme.AccentRed,
38
+ success: lightTheme.AccentGreen,
39
+ warning: lightTheme.AccentYellow,
40
+ },
41
+ };
42
+ export const darkSemanticColors = {
43
+ text: {
44
+ primary: darkTheme.Foreground,
45
+ secondary: darkTheme.Gray,
46
+ link: darkTheme.AccentBlue,
47
+ accent: darkTheme.AccentPurple,
48
+ response: darkTheme.Foreground,
49
+ },
50
+ background: {
51
+ primary: darkTheme.Background,
52
+ message: darkTheme.MessageBackground ?? "",
53
+ input: darkTheme.InputBackground ?? "",
54
+ focus: darkTheme.FocusBackground ?? "",
55
+ diff: {
56
+ added: darkTheme.DiffAdded,
57
+ removed: darkTheme.DiffRemoved,
58
+ },
59
+ },
60
+ border: {
61
+ default: darkTheme.DarkGray,
62
+ },
63
+ ui: {
64
+ comment: darkTheme.Comment,
65
+ symbol: darkTheme.Gray,
66
+ active: darkTheme.AccentBlue,
67
+ dark: darkTheme.DarkGray,
68
+ focus: darkTheme.AccentGreen,
69
+ gradient: darkTheme.GradientColors,
70
+ },
71
+ status: {
72
+ error: darkTheme.AccentRed,
73
+ success: darkTheme.AccentGreen,
74
+ warning: darkTheme.AccentYellow,
75
+ },
76
+ };
77
+ //# sourceMappingURL=semantic-tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-tokens.js","sourceRoot":"","sources":["../../../src/cli/theme/semantic-tokens.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAsCnD,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IA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AO,EAAE,SAAS,CAAC,UAAU;QAC7B,OAAO,EAAE,SAAS,CAAC,iBAAiB,IAAI,EAAE;QAC1C,KAAK,EAAE,SAAS,CAAC,eAAe,IAAI,EAAE;QACtC,KAAK,EAAE,SAAS,CAAC,eAAe,IAAI,EAAE;QACtC,IAAI,EAAE;YACL,KAAK,EAAE,SAAS,CAAC,SAAS;YAC1B,OAAO,EAAE,SAAS,CAAC,WAAW;SAC9B;KACD;IACD,MAAM,EAAE;QACP,OAAO,EAAE,SAAS,CAAC,QAAQ;KAC3B;IACD,EAAE,EAAE;QACH,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,MAAM,EAAE,SAAS,CAAC,IAAI;QACtB,MAAM,EAAE,SAAS,CAAC,UAAU;QAC5B,IAAI,EAAE,SAAS,CAAC,QAAQ;QACxB,KAAK,EAAE,SAAS,CAAC,WAAW;QAC5B,QAAQ,EAAE,SAAS,CAAC,cAAc;KAClC;IACD,MAAM,EAAE;QACP,KAAK,EAAE,SAAS,CAAC,SAAS;QAC1B,OAAO,EAAE,SAAS,CAAC,WAAW;QAC9B,OAAO,EAAE,SAAS,CAAC,YAAY;KAC/B;CACD,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { SemanticColors } from "./semantic-tokens.js";
7
+ import type { ColorsTheme, Theme, ThemeType } from "./theme.js";
8
+ export interface ThemeDisplay {
9
+ name: string;
10
+ type: ThemeType;
11
+ }
12
+ export declare const DEFAULT_THEME: Theme;
13
+ declare class ThemeManager {
14
+ private readonly availableThemes;
15
+ private activeTheme;
16
+ private terminalBackground;
17
+ private cachedColors;
18
+ private cachedSemanticColors;
19
+ private lastCacheKey;
20
+ constructor();
21
+ setTerminalBackground(color: string | undefined): void;
22
+ getTerminalBackground(): string | undefined;
23
+ private clearCache;
24
+ setActiveTheme(themeName: string | undefined): boolean;
25
+ getActiveTheme(): Theme;
26
+ getColors(): ColorsTheme;
27
+ getSemanticColors(): SemanticColors;
28
+ isThemeCompatible(activeTheme: Theme, terminalBackground: string | undefined): boolean;
29
+ getAvailableThemes(): ThemeDisplay[];
30
+ }
31
+ export declare const themeManager: ThemeManager;
32
+ export {};
@@ -0,0 +1,150 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import process from "node:process";
7
+ import { DEFAULT_BACKGROUND_OPACITY, DEFAULT_BORDER_OPACITY, DEFAULT_INPUT_BACKGROUND_OPACITY, DEFAULT_SELECTION_OPACITY, } from "../constants.js";
8
+ import { DefaultDark } from "./builtin/default-dark.js";
9
+ import { NoColorTheme } from "./builtin/no-color.js";
10
+ import { TokyoNight } from "./builtin/tokyonight-dark.js";
11
+ import { getThemeTypeFromBackgroundColor, interpolateColor, resolveColor, } from "./theme.js";
12
+ // 기본 테마를 TokyoNight으로 설정
13
+ export const DEFAULT_THEME = TokyoNight;
14
+ class ThemeManager {
15
+ availableThemes;
16
+ activeTheme;
17
+ terminalBackground;
18
+ // Cache for dynamic colors
19
+ cachedColors;
20
+ cachedSemanticColors;
21
+ lastCacheKey;
22
+ constructor() {
23
+ // 고정된 테마 리스트
24
+ this.availableThemes = [TokyoNight, DefaultDark];
25
+ this.activeTheme = DEFAULT_THEME;
26
+ }
27
+ setTerminalBackground(color) {
28
+ if (this.terminalBackground !== color) {
29
+ this.terminalBackground = color;
30
+ this.clearCache();
31
+ }
32
+ }
33
+ getTerminalBackground() {
34
+ return this.terminalBackground;
35
+ }
36
+ clearCache() {
37
+ this.cachedColors = undefined;
38
+ this.cachedSemanticColors = undefined;
39
+ this.lastCacheKey = undefined;
40
+ }
41
+ setActiveTheme(themeName) {
42
+ if (!themeName) {
43
+ this.activeTheme = DEFAULT_THEME;
44
+ this.clearCache();
45
+ return true;
46
+ }
47
+ const theme = this.availableThemes.find((t) => t.name === themeName);
48
+ if (!theme) {
49
+ return false;
50
+ }
51
+ if (this.activeTheme !== theme) {
52
+ this.activeTheme = theme;
53
+ this.clearCache();
54
+ }
55
+ return true;
56
+ }
57
+ getActiveTheme() {
58
+ if (process.env["NO_COLOR"]) {
59
+ return NoColorTheme;
60
+ }
61
+ // 현재 테마가 유효한지 확인 후 반환, 아니면 기본값
62
+ const isValid = this.availableThemes.some((t) => t.name === this.activeTheme.name);
63
+ if (!isValid) {
64
+ this.activeTheme = DEFAULT_THEME;
65
+ }
66
+ return this.activeTheme;
67
+ }
68
+ getColors() {
69
+ const activeTheme = this.getActiveTheme();
70
+ const cacheKey = `${activeTheme.name}:${this.terminalBackground}`;
71
+ if (this.cachedColors && this.lastCacheKey === cacheKey) {
72
+ return this.cachedColors;
73
+ }
74
+ const colors = activeTheme.colors;
75
+ if (this.terminalBackground &&
76
+ this.isThemeCompatible(activeTheme, this.terminalBackground)) {
77
+ this.cachedColors = {
78
+ ...colors,
79
+ Background: this.terminalBackground,
80
+ DarkGray: interpolateColor(this.terminalBackground, colors.Gray, DEFAULT_BORDER_OPACITY),
81
+ InputBackground: interpolateColor(this.terminalBackground, colors.Gray, DEFAULT_INPUT_BACKGROUND_OPACITY),
82
+ MessageBackground: interpolateColor(this.terminalBackground, colors.Gray, DEFAULT_BACKGROUND_OPACITY),
83
+ FocusBackground: interpolateColor(this.terminalBackground, activeTheme.colors.FocusColor ?? activeTheme.colors.AccentGreen, DEFAULT_SELECTION_OPACITY),
84
+ };
85
+ }
86
+ else {
87
+ this.cachedColors = colors;
88
+ }
89
+ this.lastCacheKey = cacheKey;
90
+ return this.cachedColors;
91
+ }
92
+ getSemanticColors() {
93
+ const activeTheme = this.getActiveTheme();
94
+ const cacheKey = `${activeTheme.name}:${this.terminalBackground}`;
95
+ if (this.cachedSemanticColors && this.lastCacheKey === cacheKey) {
96
+ return this.cachedSemanticColors;
97
+ }
98
+ const semanticColors = activeTheme.semanticColors;
99
+ if (this.terminalBackground &&
100
+ this.isThemeCompatible(activeTheme, this.terminalBackground)) {
101
+ const colors = this.getColors();
102
+ this.cachedSemanticColors = {
103
+ ...semanticColors,
104
+ background: {
105
+ ...semanticColors.background,
106
+ primary: this.terminalBackground,
107
+ message: colors.MessageBackground ?? "",
108
+ input: colors.InputBackground ?? "",
109
+ focus: colors.FocusBackground ?? "",
110
+ },
111
+ border: {
112
+ ...semanticColors.border,
113
+ default: colors.DarkGray,
114
+ },
115
+ ui: {
116
+ ...semanticColors.ui,
117
+ dark: colors.DarkGray,
118
+ focus: colors.FocusColor ?? colors.AccentGreen,
119
+ },
120
+ };
121
+ }
122
+ else {
123
+ this.cachedSemanticColors = semanticColors;
124
+ }
125
+ this.lastCacheKey = cacheKey;
126
+ return this.cachedSemanticColors;
127
+ }
128
+ isThemeCompatible(activeTheme, terminalBackground) {
129
+ if (activeTheme.type === "ansi") {
130
+ return true;
131
+ }
132
+ const backgroundType = getThemeTypeFromBackgroundColor(terminalBackground);
133
+ if (!backgroundType) {
134
+ return true;
135
+ }
136
+ const themeType = activeTheme.type === "custom"
137
+ ? getThemeTypeFromBackgroundColor(resolveColor(activeTheme.colors.Background) ||
138
+ activeTheme.colors.Background)
139
+ : activeTheme.type;
140
+ return themeType === backgroundType;
141
+ }
142
+ getAvailableThemes() {
143
+ return this.availableThemes.map((theme) => ({
144
+ name: theme.name,
145
+ type: theme.type,
146
+ }));
147
+ }
148
+ }
149
+ export const themeManager = new ThemeManager();
150
+ //# sourceMappingURL=theme-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-manager.js","sourceRoot":"","sources":["../../../src/cli/theme/theme-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EACN,0BAA0B,EAC1B,sBAAsB,EACtB,gCAAgC,EAChC,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,u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AChB,IAAI,EAAE,KAAK,CAAC,IAAI;SAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACD;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { CSSProperties } from "react";
7
+ import type { SemanticColors } from "./semantic-tokens.js";
8
+ export declare const INK_SUPPORTED_NAMES: Set<string>;
9
+ export declare const CSS_NAME_TO_HEX_MAP: {
10
+ [k: string]: string;
11
+ };
12
+ export declare const INK_NAME_TO_HEX_MAP: Readonly<Record<string, string>>;
13
+ /**
14
+ * Calculates the relative luminance of a color.
15
+ * See https://www.w3.org/TR/WCAG20/#relativeluminancedef
16
+ *
17
+ * @param color Color string (hex or Ink-supported name)
18
+ * @returns Luminance value (0-255)
19
+ */
20
+ export declare function getLuminance(color: string): number;
21
+ /**
22
+ * Resolves a CSS color value (name or hex) into an Ink-compatible color string.
23
+ * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki').
24
+ * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable.
25
+ */
26
+ export declare function resolveColor(colorValue: string): string | undefined;
27
+ export declare function interpolateColor(color1: string, color2: string, factor: number): string;
28
+ export declare function getThemeTypeFromBackgroundColor(backgroundColor: string | undefined): "light" | "dark" | undefined;
29
+ export type ThemeType = "light" | "dark" | "ansi" | "custom";
30
+ export interface ColorsTheme {
31
+ type: ThemeType;
32
+ Background: string;
33
+ Foreground: string;
34
+ LightBlue: string;
35
+ AccentBlue: string;
36
+ AccentPurple: string;
37
+ AccentCyan: string;
38
+ AccentGreen: string;
39
+ AccentYellow: string;
40
+ AccentRed: string;
41
+ DiffAdded: string;
42
+ DiffRemoved: string;
43
+ Comment: string;
44
+ Gray: string;
45
+ DarkGray: string;
46
+ InputBackground?: string;
47
+ MessageBackground?: string;
48
+ FocusBackground?: string;
49
+ FocusColor?: string;
50
+ GradientColors?: string[];
51
+ }
52
+ export declare const lightTheme: ColorsTheme;
53
+ export declare const darkTheme: ColorsTheme;
54
+ export declare const ansiTheme: ColorsTheme;
55
+ export declare class Theme {
56
+ readonly name: string;
57
+ readonly type: ThemeType;
58
+ readonly colors: ColorsTheme;
59
+ /**
60
+ * The default foreground color for text when no specific highlight rule applies.
61
+ * This is an Ink-compatible color string (hex or name).
62
+ */
63
+ readonly defaultColor: string;
64
+ /**
65
+ * Stores the mapping from highlight.js class names (e.g., 'hljs-keyword')
66
+ * to Ink-compatible color strings (hex or name).
67
+ */
68
+ protected readonly _colorMap: Readonly<Record<string, string>>;
69
+ readonly semanticColors: SemanticColors;
70
+ /**
71
+ * Creates a new Theme instance.
72
+ * @param name The name of the theme.
73
+ * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object.
74
+ */
75
+ constructor(name: string, type: ThemeType, rawMappings: Record<string, CSSProperties>, colors: ColorsTheme, semanticColors?: SemanticColors);
76
+ /**
77
+ * Gets the Ink-compatible color string for a given highlight.js class name.
78
+ * @param hljsClass The highlight.js class name (e.g., 'hljs-keyword', 'hljs-string').
79
+ * @returns The corresponding Ink color string (hex or name) if it exists.
80
+ */
81
+ getInkColor(hljsClass: string): string | undefined;
82
+ /**
83
+ * Resolves a CSS color value (name or hex) into an Ink-compatible color string.
84
+ * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki').
85
+ * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable.
86
+ */
87
+ private static _resolveColor;
88
+ /**
89
+ * Builds the internal map from highlight.js class names to Ink-compatible color strings.
90
+ * This method is protected and primarily intended for use by the constructor.
91
+ * @param hljsTheme The raw CSSProperties mappings from a react-syntax-highlighter theme object.
92
+ * @returns An Ink-compatible theme map (Record<string, string>).
93
+ */
94
+ protected _buildColorMap(hljsTheme: Record<string, CSSProperties>): Record<string, string>;
95
+ }
96
+ /**
97
+ * Picks a default theme name based on terminal background color.
98
+ * It first tries to find a theme with an exact background color match.
99
+ * If no match is found, it falls back to a light or dark theme based on the
100
+ * luminance of the background color.
101
+ * @param terminalBackground The hex color string of the terminal background.
102
+ * @param availableThemes A list of available themes to search through.
103
+ * @param defaultDarkThemeName The name of the fallback dark theme.
104
+ * @param defaultLightThemeName The name of the fallback light theme.
105
+ * @returns The name of the chosen theme.
106
+ */
107
+ export declare function pickDefaultThemeName(terminalBackground: string | undefined, availableThemes: readonly Theme[], defaultDarkThemeName: string, defaultLightThemeName: string): string;