@sunub/obsidian-mcp-server 0.3.6 → 0.3.9

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 (334) hide show
  1. package/build/config.d.ts +1 -27
  2. package/build/config.js +4 -31
  3. package/build/config.js.map +1 -1
  4. package/build/db.js +3 -0
  5. package/build/db.js.map +1 -1
  6. package/build/index.js +3 -0
  7. package/build/index.js.map +1 -1
  8. package/build/server.js +1 -1
  9. package/build/server.js.map +1 -1
  10. package/build/setup.d.ts +1 -0
  11. package/build/setup.js +4 -2
  12. package/build/setup.js.map +1 -1
  13. package/build/tools/create_document_with_properties/index.d.ts +5 -5
  14. package/build/tools/create_document_with_properties/index.js +2 -2
  15. package/build/tools/create_document_with_properties/index.js.map +1 -1
  16. package/build/tools/create_document_with_properties/params.d.ts +8 -8
  17. package/build/tools/create_document_with_properties/params.js +1 -1
  18. package/build/tools/create_document_with_properties/params.js.map +1 -1
  19. package/build/tools/generate_property/index.d.ts +1 -1
  20. package/build/tools/generate_property/index.js +1 -1
  21. package/build/tools/generate_property/index.js.map +1 -1
  22. package/build/tools/generate_property/params.d.ts +4 -4
  23. package/build/tools/index.d.ts +8 -8
  24. package/build/tools/index.js +5 -5
  25. package/build/tools/index.js.map +1 -1
  26. package/build/tools/organize_attachments/index.d.ts +1 -1
  27. package/build/tools/organize_attachments/index.js +2 -2
  28. package/build/tools/organize_attachments/index.js.map +1 -1
  29. package/build/tools/vault/index.d.ts +1 -1
  30. package/build/tools/vault/index.js +3 -3
  31. package/build/tools/vault/index.js.map +1 -1
  32. package/build/tools/vault/params.d.ts +2 -2
  33. package/build/tools/vault/types/collect_context.d.ts +32 -32
  34. package/build/tools/vault/types/collect_context.js +1 -1
  35. package/build/tools/vault/types/collect_context.js.map +1 -1
  36. package/build/tools/vault/types/list_all.d.ts +12 -12
  37. package/build/tools/vault/types/list_all.js +2 -2
  38. package/build/tools/vault/types/list_all.js.map +1 -1
  39. package/build/tools/vault/types/read_specific.d.ts +6 -6
  40. package/build/tools/vault/types/read_specific.js +1 -1
  41. package/build/tools/vault/types/read_specific.js.map +1 -1
  42. package/build/tools/vault/types/search.d.ts +10 -10
  43. package/build/tools/vault/utils/actions/collect_context.d.ts +1 -1
  44. package/build/tools/vault/utils/actions/collect_context.js +4 -4
  45. package/build/tools/vault/utils/actions/collect_context.js.map +1 -1
  46. package/build/tools/vault/utils/actions/list_all.d.ts +1 -1
  47. package/build/tools/vault/utils/actions/list_all.js +1 -1
  48. package/build/tools/vault/utils/actions/list_all.js.map +1 -1
  49. package/build/tools/vault/utils/actions/load_memory.d.ts +1 -1
  50. package/build/tools/vault/utils/actions/load_memory.js +3 -3
  51. package/build/tools/vault/utils/actions/load_memory.js.map +1 -1
  52. package/build/tools/vault/utils/actions/read.d.ts +1 -1
  53. package/build/tools/vault/utils/actions/read.js +1 -1
  54. package/build/tools/vault/utils/actions/read.js.map +1 -1
  55. package/build/tools/vault/utils/actions/search.d.ts +1 -1
  56. package/build/tools/vault/utils/actions/search.js +2 -2
  57. package/build/tools/vault/utils/actions/search.js.map +1 -1
  58. package/build/tools/vault/utils/shared.d.ts +1 -1
  59. package/build/tools/vault/utils.d.ts +7 -7
  60. package/build/tools/vault/utils.js +7 -7
  61. package/build/tools/vault/utils.js.map +1 -1
  62. package/build/tools/write_property/index.d.ts +5 -5
  63. package/build/tools/write_property/index.js +1 -1
  64. package/build/tools/write_property/index.js.map +1 -1
  65. package/build/tools/write_property/params.d.ts +8 -8
  66. package/build/utils/DirectoryWalker.d.ts +1 -1
  67. package/build/utils/Embedder.js +1 -1
  68. package/build/utils/Embedder.js.map +1 -1
  69. package/build/utils/Indexer.d.ts +2 -2
  70. package/build/utils/Indexer.js +2 -2
  71. package/build/utils/Indexer.js.map +1 -1
  72. package/build/utils/LLMClient.js +16 -0
  73. package/build/utils/LLMClient.js.map +1 -1
  74. package/build/utils/LocalReranker.js +1 -1
  75. package/build/utils/LocalReranker.js.map +1 -1
  76. package/build/utils/RAGIndexer.d.ts +1 -1
  77. package/build/utils/RAGIndexer.js +6 -6
  78. package/build/utils/RAGIndexer.js.map +1 -1
  79. package/build/utils/RerankerClient.js +20 -1
  80. package/build/utils/RerankerClient.js.map +1 -1
  81. package/build/utils/VaultManger/VaultManager.d.ts +3 -3
  82. package/build/utils/VaultManger/VaultManager.js +9 -9
  83. package/build/utils/VaultManger/VaultManager.js.map +1 -1
  84. package/build/utils/VaultManger/index.d.ts +3 -3
  85. package/build/utils/VaultManger/index.js +2 -2
  86. package/build/utils/VaultManger/index.js.map +1 -1
  87. package/build/utils/VaultManger/types.d.ts +1 -1
  88. package/build/utils/VaultWatcher.js +1 -1
  89. package/build/utils/VaultWatcher.js.map +1 -1
  90. package/build/utils/VectorDB.js +31 -6
  91. package/build/utils/VectorDB.js.map +1 -1
  92. package/build/utils/getVaultManager.d.ts +1 -1
  93. package/build/utils/getVaultManager.js +1 -1
  94. package/build/utils/getVaultManager.js.map +1 -1
  95. package/build/utils/processor/MatterParser.d.ts +1 -1
  96. package/build/utils/processor/MatterParser.js +1 -1
  97. package/build/utils/processor/MatterParser.js.map +1 -1
  98. package/package.json +13 -49
  99. package/LICENSE +0 -15
  100. package/README.md +0 -512
  101. package/build/cli/App.d.ts +0 -1
  102. package/build/cli/App.js +0 -194
  103. package/build/cli/App.js.map +0 -1
  104. package/build/cli/AppContainer.d.ts +0 -1
  105. package/build/cli/AppContainer.js +0 -18
  106. package/build/cli/AppContainer.js.map +0 -1
  107. package/build/cli/colors.d.ts +0 -15
  108. package/build/cli/colors.js +0 -15
  109. package/build/cli/colors.js.map +0 -1
  110. package/build/cli/commands/types.d.ts +0 -19
  111. package/build/cli/commands/types.js +0 -11
  112. package/build/cli/commands/types.js.map +0 -1
  113. package/build/cli/config/SettingContext.d.ts +0 -1
  114. package/build/cli/config/SettingContext.js +0 -2
  115. package/build/cli/config/SettingContext.js.map +0 -1
  116. package/build/cli/config/mcpServersConfig.d.ts +0 -30
  117. package/build/cli/config/mcpServersConfig.js +0 -119
  118. package/build/cli/config/mcpServersConfig.js.map +0 -1
  119. package/build/cli/config/settingSchema.d.ts +0 -180
  120. package/build/cli/config/settingSchema.js +0 -128
  121. package/build/cli/config/settingSchema.js.map +0 -1
  122. package/build/cli/constants.d.ts +0 -47
  123. package/build/cli/constants.js +0 -101
  124. package/build/cli/constants.js.map +0 -1
  125. package/build/cli/context/InputContext.d.ts +0 -12
  126. package/build/cli/context/InputContext.js +0 -10
  127. package/build/cli/context/InputContext.js.map +0 -1
  128. package/build/cli/context/KeypressContext.d.ts +0 -30
  129. package/build/cli/context/KeypressContext.js +0 -200
  130. package/build/cli/context/KeypressContext.js.map +0 -1
  131. package/build/cli/context/KeypressContext.util.d.ts +0 -7
  132. package/build/cli/context/KeypressContext.util.js +0 -476
  133. package/build/cli/context/KeypressContext.util.js.map +0 -1
  134. package/build/cli/hooks/useAtCompletion.d.ts +0 -12
  135. package/build/cli/hooks/useAtCompletion.js +0 -5
  136. package/build/cli/hooks/useAtCompletion.js.map +0 -1
  137. package/build/cli/hooks/useCommandCompletion.d.ts +0 -59
  138. package/build/cli/hooks/useCommandCompletion.js +0 -344
  139. package/build/cli/hooks/useCommandCompletion.js.map +0 -1
  140. package/build/cli/hooks/useCompletion.d.ts +0 -22
  141. package/build/cli/hooks/useCompletion.js +0 -84
  142. package/build/cli/hooks/useCompletion.js.map +0 -1
  143. package/build/cli/hooks/useDispatcher.d.ts +0 -6
  144. package/build/cli/hooks/useDispatcher.js +0 -286
  145. package/build/cli/hooks/useDispatcher.js.map +0 -1
  146. package/build/cli/hooks/useFocus.d.ts +0 -2
  147. package/build/cli/hooks/useFocus.js +0 -3
  148. package/build/cli/hooks/useFocus.js.map +0 -1
  149. package/build/cli/hooks/useInputHistory.d.ts +0 -24
  150. package/build/cli/hooks/useInputHistory.js +0 -159
  151. package/build/cli/hooks/useInputHistory.js.map +0 -1
  152. package/build/cli/hooks/useKeyMatchers.d.ts +0 -17
  153. package/build/cli/hooks/useKeyMatchers.js +0 -13
  154. package/build/cli/hooks/useKeyMatchers.js.map +0 -1
  155. package/build/cli/hooks/useKeypress.d.ts +0 -19
  156. package/build/cli/hooks/useKeypress.js +0 -28
  157. package/build/cli/hooks/useKeypress.js.map +0 -1
  158. package/build/cli/hooks/useLlmStream/constants.d.ts +0 -4
  159. package/build/cli/hooks/useLlmStream/constants.js +0 -5
  160. package/build/cli/hooks/useLlmStream/constants.js.map +0 -1
  161. package/build/cli/hooks/useLlmStream/index.d.ts +0 -2
  162. package/build/cli/hooks/useLlmStream/index.js +0 -2
  163. package/build/cli/hooks/useLlmStream/index.js.map +0 -1
  164. package/build/cli/hooks/useLlmStream/llmService.d.ts +0 -2
  165. package/build/cli/hooks/useLlmStream/llmService.js +0 -110
  166. package/build/cli/hooks/useLlmStream/llmService.js.map +0 -1
  167. package/build/cli/hooks/useLlmStream/types.d.ts +0 -38
  168. package/build/cli/hooks/useLlmStream/types.js +0 -2
  169. package/build/cli/hooks/useLlmStream/types.js.map +0 -1
  170. package/build/cli/hooks/useLlmStream/useLlmStream.d.ts +0 -12
  171. package/build/cli/hooks/useLlmStream/useLlmStream.js +0 -162
  172. package/build/cli/hooks/useLlmStream/useLlmStream.js.map +0 -1
  173. package/build/cli/hooks/useLlmStream/utils.d.ts +0 -15
  174. package/build/cli/hooks/useLlmStream/utils.js +0 -108
  175. package/build/cli/hooks/useLlmStream/utils.js.map +0 -1
  176. package/build/cli/hooks/useMcpClient.d.ts +0 -10
  177. package/build/cli/hooks/useMcpClient.js +0 -100
  178. package/build/cli/hooks/useMcpClient.js.map +0 -1
  179. package/build/cli/hooks/useMcpManager.d.ts +0 -26
  180. package/build/cli/hooks/useMcpManager.js +0 -89
  181. package/build/cli/hooks/useMcpManager.js.map +0 -1
  182. package/build/cli/hooks/usePromptCompletion.d.ts +0 -19
  183. package/build/cli/hooks/usePromptCompletion.js +0 -13
  184. package/build/cli/hooks/usePromptCompletion.js.map +0 -1
  185. package/build/cli/hooks/useRagContext.d.ts +0 -6
  186. package/build/cli/hooks/useRagContext.js +0 -83
  187. package/build/cli/hooks/useRagContext.js.map +0 -1
  188. package/build/cli/hooks/useShellCompletion.d.ts +0 -18
  189. package/build/cli/hooks/useShellCompletion.js +0 -10
  190. package/build/cli/hooks/useShellCompletion.js.map +0 -1
  191. package/build/cli/hooks/useSlashCompletion.d.ts +0 -21
  192. package/build/cli/hooks/useSlashCompletion.js +0 -11
  193. package/build/cli/hooks/useSlashCompletion.js.map +0 -1
  194. package/build/cli/hooks/useTerminalSize.d.ts +0 -4
  195. package/build/cli/hooks/useTerminalSize.js +0 -21
  196. package/build/cli/hooks/useTerminalSize.js.map +0 -1
  197. package/build/cli/index.d.ts +0 -1
  198. package/build/cli/index.js +0 -10
  199. package/build/cli/index.js.map +0 -1
  200. package/build/cli/key/input.d.ts +0 -5
  201. package/build/cli/key/input.js +0 -9
  202. package/build/cli/key/input.js.map +0 -1
  203. package/build/cli/key/keyBindings.d.ts +0 -152
  204. package/build/cli/key/keyBindings.js +0 -630
  205. package/build/cli/key/keyBindings.js.map +0 -1
  206. package/build/cli/key/keyMatchers.d.ts +0 -19
  207. package/build/cli/key/keyMatchers.js +0 -25
  208. package/build/cli/key/keyMatchers.js.map +0 -1
  209. package/build/cli/key/mouse.d.ts +0 -23
  210. package/build/cli/key/mouse.js +0 -155
  211. package/build/cli/key/mouse.js.map +0 -1
  212. package/build/cli/key/text-buffer-bestcase.d.ts +0 -867
  213. package/build/cli/key/text-buffer-bestcase.js +0 -2754
  214. package/build/cli/key/text-buffer-bestcase.js.map +0 -1
  215. package/build/cli/key/text-buffer.d.ts +0 -506
  216. package/build/cli/key/text-buffer.js +0 -919
  217. package/build/cli/key/text-buffer.js.map +0 -1
  218. package/build/cli/main.d.ts +0 -1
  219. package/build/cli/main.js +0 -20
  220. package/build/cli/main.js.map +0 -1
  221. package/build/cli/reference/HistoryItemDisplay.d.ts +0 -23
  222. package/build/cli/reference/HistoryItemDisplay.js +0 -63
  223. package/build/cli/reference/HistoryItemDisplay.js.map +0 -1
  224. package/build/cli/reference/InputContext.d.ts +0 -17
  225. package/build/cli/reference/InputContext.js +0 -16
  226. package/build/cli/reference/InputContext.js.map +0 -1
  227. package/build/cli/reference/KerypressContext.d.ts +0 -37
  228. package/build/cli/reference/KerypressContext.js +0 -791
  229. package/build/cli/reference/KerypressContext.js.map +0 -1
  230. package/build/cli/reference/MainContent.d.ts +0 -6
  231. package/build/cli/reference/MainContent.js +0 -207
  232. package/build/cli/reference/MainContent.js.map +0 -1
  233. package/build/cli/reference/UIStateContext.d.ts +0 -188
  234. package/build/cli/reference/UIStateContext.js +0 -16
  235. package/build/cli/reference/UIStateContext.js.map +0 -1
  236. package/build/cli/reference/text-buffer.d.ts +0 -867
  237. package/build/cli/reference/text-buffer.js +0 -2754
  238. package/build/cli/reference/text-buffer.js.map +0 -1
  239. package/build/cli/reference/useGeminiStream.d.ts +0 -42
  240. package/build/cli/reference/useGeminiStream.js +0 -1404
  241. package/build/cli/reference/useGeminiStream.js.map +0 -1
  242. package/build/cli/services/McpClientService.d.ts +0 -32
  243. package/build/cli/services/McpClientService.js +0 -123
  244. package/build/cli/services/McpClientService.js.map +0 -1
  245. package/build/cli/services/McpManager.d.ts +0 -28
  246. package/build/cli/services/McpManager.js +0 -146
  247. package/build/cli/services/McpManager.js.map +0 -1
  248. package/build/cli/theme/builtin/default-dark.d.ts +0 -7
  249. package/build/cli/theme/builtin/default-dark.js +0 -143
  250. package/build/cli/theme/builtin/default-dark.js.map +0 -1
  251. package/build/cli/theme/builtin/no-color.d.ts +0 -7
  252. package/build/cli/theme/builtin/no-color.js +0 -125
  253. package/build/cli/theme/builtin/no-color.js.map +0 -1
  254. package/build/cli/theme/builtin/tokyonight-dark.d.ts +0 -7
  255. package/build/cli/theme/builtin/tokyonight-dark.js +0 -146
  256. package/build/cli/theme/builtin/tokyonight-dark.js.map +0 -1
  257. package/build/cli/theme/semantic-colors.d.ts +0 -2
  258. package/build/cli/theme/semantic-colors.js +0 -19
  259. package/build/cli/theme/semantic-colors.js.map +0 -1
  260. package/build/cli/theme/semantic-tokens.d.ts +0 -42
  261. package/build/cli/theme/semantic-tokens.js +0 -77
  262. package/build/cli/theme/semantic-tokens.js.map +0 -1
  263. package/build/cli/theme/theme-manager.d.ts +0 -32
  264. package/build/cli/theme/theme-manager.js +0 -150
  265. package/build/cli/theme/theme-manager.js.map +0 -1
  266. package/build/cli/theme/theme.d.ts +0 -107
  267. package/build/cli/theme/theme.js +0 -333
  268. package/build/cli/theme/theme.js.map +0 -1
  269. package/build/cli/tmp.d.ts +0 -1
  270. package/build/cli/tmp.js +0 -27
  271. package/build/cli/tmp.js.map +0 -1
  272. package/build/cli/types.d.ts +0 -74
  273. package/build/cli/types.js +0 -8
  274. package/build/cli/types.js.map +0 -1
  275. package/build/cli/ui/ConnectionStatus.d.ts +0 -13
  276. package/build/cli/ui/ConnectionStatus.js +0 -24
  277. package/build/cli/ui/ConnectionStatus.js.map +0 -1
  278. package/build/cli/ui/HelpCommands.d.ts +0 -5
  279. package/build/cli/ui/HelpCommands.js +0 -11
  280. package/build/cli/ui/HelpCommands.js.map +0 -1
  281. package/build/cli/ui/HistoryItemDisplay.d.ts +0 -9
  282. package/build/cli/ui/HistoryItemDisplay.js +0 -38
  283. package/build/cli/ui/HistoryItemDisplay.js.map +0 -1
  284. package/build/cli/ui/InputPrompt-bestcase.d.ts +0 -63
  285. package/build/cli/ui/InputPrompt-bestcase.js +0 -1301
  286. package/build/cli/ui/InputPrompt-bestcase.js.map +0 -1
  287. package/build/cli/ui/InputPrompt.d.ts +0 -13
  288. package/build/cli/ui/InputPrompt.js +0 -145
  289. package/build/cli/ui/InputPrompt.js.map +0 -1
  290. package/build/cli/ui/InputPrompt.tmp.d.ts +0 -7
  291. package/build/cli/ui/InputPrompt.tmp.js +0 -215
  292. package/build/cli/ui/InputPrompt.tmp.js.map +0 -1
  293. package/build/cli/ui/LLMErrorComponent.d.ts +0 -6
  294. package/build/cli/ui/LLMErrorComponent.js +0 -14
  295. package/build/cli/ui/LLMErrorComponent.js.map +0 -1
  296. package/build/cli/ui/LLMHealthChecker.d.ts +0 -8
  297. package/build/cli/ui/LLMHealthChecker.js +0 -22
  298. package/build/cli/ui/LLMHealthChecker.js.map +0 -1
  299. package/build/cli/ui/MCPServers.d.ts +0 -11
  300. package/build/cli/ui/MCPServers.js +0 -18
  301. package/build/cli/ui/MCPServers.js.map +0 -1
  302. package/build/cli/ui/MainContent.d.ts +0 -10
  303. package/build/cli/ui/MainContent.js +0 -24
  304. package/build/cli/ui/MainContent.js.map +0 -1
  305. package/build/cli/ui/MouseContext.d.ts +0 -1
  306. package/build/cli/ui/MouseContext.js +0 -2
  307. package/build/cli/ui/MouseContext.js.map +0 -1
  308. package/build/cli/ui/SuggestionsDisplay.d.ts +0 -25
  309. package/build/cli/ui/SuggestionsDisplay.js +0 -45
  310. package/build/cli/ui/SuggestionsDisplay.js.map +0 -1
  311. package/build/cli/ui/ThinkingIndicator.d.ts +0 -2
  312. package/build/cli/ui/ThinkingIndicator.js +0 -16
  313. package/build/cli/ui/ThinkingIndicator.js.map +0 -1
  314. package/build/cli/ui/layout/DefaultAppLayout.d.ts +0 -2
  315. package/build/cli/ui/layout/DefaultAppLayout.js +0 -6
  316. package/build/cli/ui/layout/DefaultAppLayout.js.map +0 -1
  317. package/build/cli/ui/shared/ExpandableText.d.ts +0 -14
  318. package/build/cli/ui/shared/ExpandableText.js +0 -19
  319. package/build/cli/ui/shared/ExpandableText.js.map +0 -1
  320. package/build/cli/utils/cache.d.ts +0 -21
  321. package/build/cli/utils/cache.js +0 -56
  322. package/build/cli/utils/cache.js.map +0 -1
  323. package/build/cli/utils/commandUtils.d.ts +0 -11
  324. package/build/cli/utils/commandUtils.js +0 -16
  325. package/build/cli/utils/commandUtils.js.map +0 -1
  326. package/build/cli/utils/debugLogger.d.ts +0 -12
  327. package/build/cli/utils/debugLogger.js +0 -54
  328. package/build/cli/utils/debugLogger.js.map +0 -1
  329. package/build/cli/utils/historyStorage.d.ts +0 -13
  330. package/build/cli/utils/historyStorage.js +0 -64
  331. package/build/cli/utils/historyStorage.js.map +0 -1
  332. package/build/cli/utils/textUtil.d.ts +0 -68
  333. package/build/cli/utils/textUtil.js +0 -236
  334. package/build/cli/utils/textUtil.js.map +0 -1
@@ -1,10 +0,0 @@
1
- import type React from "react";
2
- import type { HistoryItem, PendingItem, StreamingState } from "../types.js";
3
- interface MainContentProps {
4
- history: HistoryItem[];
5
- pendingItem: PendingItem | null;
6
- streamingState: StreamingState;
7
- width: number;
8
- }
9
- export declare const MainContent: React.FC<MainContentProps>;
10
- export {};
@@ -1,24 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Box, Static, Text } from "ink";
3
- import { HELP_COMMAND_MARKER } from "../constants.js";
4
- import { HelpCommands } from "./HelpCommands.js";
5
- import { HistoryItemDisplay } from "./HistoryItemDisplay.js";
6
- import { ThinkingIndicator } from "./ThinkingIndicator.js";
7
- const MAX_THINKING_LINES = 6;
8
- function ThinkingBlock({ content, isActive, }) {
9
- const lines = content.split("\n").filter((l) => l.trim());
10
- const displayLines = isActive ? lines : lines.slice(0, MAX_THINKING_LINES);
11
- const truncated = !isActive && lines.length > MAX_THINKING_LINES;
12
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, marginBottom: isActive ? 0 : 1, children: [_jsxs(Text, { color: "gray", dimColor: true, bold: true, children: ["\uD83D\uDCAD ", isActive ? "thinking..." : `thought (${lines.length} lines)`] }), displayLines.map((line, i) => (_jsx(Text
13
- // biome-ignore lint/suspicious/noArrayIndexKey: static display lines
14
- , { color: "gray", dimColor: true, wrap: "wrap", children: line }, i))), truncated && (_jsxs(Text, { color: "gray", dimColor: true, children: ["... (", lines.length - MAX_THINKING_LINES, " more lines)"] }))] }));
15
- }
16
- export const MainContent = ({ history, pendingItem, streamingState, width, }) => {
17
- return (_jsxs(_Fragment, { children: [_jsx(Static, { items: history, children: (item) => {
18
- if (item.content === HELP_COMMAND_MARKER) {
19
- return _jsx(HelpCommands, { width: width }, item.id);
20
- }
21
- return _jsx(HistoryItemDisplay, { item: item, width: width }, item.id);
22
- } }), streamingState === "thinking" && _jsx(ThinkingIndicator, {}), pendingItem && (_jsxs(Box, { flexDirection: "column", width: width, paddingX: 1, marginBottom: 1, children: [pendingItem.thinkingContent && (_jsx(ThinkingBlock, { content: pendingItem.thinkingContent, isActive: pendingItem.isThinking === true })), pendingItem.content.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { color: "cyan", bold: true, children: "\u25C0 Assistant" }), _jsx(Text, { wrap: "wrap", children: pendingItem.content })] }))] }))] }));
23
- };
24
- //# sourceMappingURL=MainContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MainContent.js","sourceRoot":"","sources":["../../../src/cli/ui/MainContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAS3D,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,SAAS,aAAa,CAAC,EACtB,OAAO,EACP,QAAQ,GAIR;IACA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;IAC3E,MAAM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AAC,EAAE,CAA8B,CAAC;gBACvE,CAAC,GACO,EAER,cAAc,KAAK,UAAU,IAAI,KAAC,iBAAiB,KAAG,EAEtD,WAAW,IAAI,CACf,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,aACpE,WAAW,CAAC,eAAe,IAAI,CAC/B,KAAC,aAAa,IACb,OAAO,EAAE,WAAW,CAAC,eAAe,EACpC,QAAQ,EAAE,WAAW,CAAC,UAAU,KAAK,IAAI,GACxC,CACF,EAEA,WAAW,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAClC,8BACC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,uCAEhB,EACP,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,YAAE,WAAW,CAAC,OAAO,GAAQ,IAC5C,CACH,IACI,CACN,IACC,CACH,CAAC;AACH,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=MouseContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MouseContext.js","sourceRoot":"","sources":["../../../src/cli/ui/MouseContext.tsx"],"names":[],"mappings":""}
@@ -1,25 +0,0 @@
1
- import { CommandKind } from "../commands/types.js";
2
- import { MAX_WIDTH } from "./shared/ExpandableText.js";
3
- export interface Suggestion {
4
- label: string;
5
- value: string;
6
- insertValue?: string;
7
- description?: string;
8
- matchedIndex?: number;
9
- commandKind?: CommandKind;
10
- sectionTitle?: string;
11
- submitValue?: string;
12
- }
13
- interface SuggestionsDisplayProps {
14
- suggestions: Suggestion[];
15
- activeIndex: number;
16
- isLoading: boolean;
17
- width: number;
18
- scrollOffset: number;
19
- userInput: string;
20
- mode: "reverse" | "slash";
21
- expandedIndex?: number;
22
- }
23
- export declare const MAX_SUGGESTIONS_TO_SHOW = 8;
24
- export { MAX_WIDTH };
25
- export declare function SuggestionsDisplay({ suggestions, activeIndex, isLoading, width, scrollOffset, userInput, mode, expandedIndex, }: SuggestionsDisplayProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,45 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { Colors } from "../colors.js";
4
- import { CommandKind } from "../commands/types.js";
5
- import { theme } from "../theme/semantic-colors.js";
6
- import { sanitizeForDisplay } from "../utils/textUtil.js";
7
- import { ExpandableText, MAX_WIDTH } from "./shared/ExpandableText.js";
8
- export const MAX_SUGGESTIONS_TO_SHOW = 8;
9
- export { MAX_WIDTH };
10
- export function SuggestionsDisplay({ suggestions, activeIndex, isLoading, width, scrollOffset, userInput, mode, expandedIndex, }) {
11
- if (isLoading) {
12
- return (_jsx(Box, { paddingX: 1, width: width, children: _jsx(Text, { color: "gray", children: "Loading suggestions..." }) }));
13
- }
14
- if (suggestions.length === 0) {
15
- return null; // Don't render anything if there are no suggestions
16
- }
17
- // Calculate the visible slice based on scrollOffset
18
- const startIndex = scrollOffset;
19
- const endIndex = Math.min(scrollOffset + MAX_SUGGESTIONS_TO_SHOW, suggestions.length);
20
- const visibleSuggestions = suggestions.slice(startIndex, endIndex);
21
- const COMMAND_KIND_SUFFIX = {
22
- [CommandKind.MCP_PROMPT]: " [MCP]",
23
- [CommandKind.AGENT]: " [Agent]",
24
- };
25
- const getFullLabel = (s) => s.label + (s.commandKind ? (COMMAND_KIND_SUFFIX[s.commandKind] ?? "") : "");
26
- const maxLabelLength = Math.max(...suggestions.map((s) => getFullLabel(s).length));
27
- const commandColumnWidth = mode === "slash" ? Math.min(maxLabelLength, Math.floor(width * 0.5)) : 0;
28
- return (_jsxs(Box, { flexDirection: "column", paddingX: 1, width: width, children: [scrollOffset > 0 && _jsx(Text, { color: theme.text.primary, children: "\u25B2" }), visibleSuggestions.map((suggestion, index) => {
29
- const originalIndex = startIndex + index;
30
- const isActive = originalIndex === activeIndex;
31
- const isExpanded = originalIndex === expandedIndex;
32
- const textColor = isActive ? theme.ui.focus : theme.text.secondary;
33
- const isLong = suggestion.value.length >= MAX_WIDTH;
34
- const previousSectionTitle = suggestions[originalIndex - 1]?.sectionTitle;
35
- const shouldRenderSectionHeader = mode === "slash" &&
36
- !!suggestion.sectionTitle &&
37
- suggestion.sectionTitle !== previousSectionTitle;
38
- const labelElement = (_jsx(ExpandableText, { label: suggestion.value, matchedIndex: suggestion.matchedIndex, userInput: userInput, textColor: textColor, isExpanded: isExpanded }));
39
- return (_jsxs(Box, { flexDirection: "column", children: [shouldRenderSectionHeader && (_jsxs(Text, { color: theme.text.secondary, children: ["-- ", suggestion.sectionTitle, " --"] })), _jsxs(Box, { flexDirection: "row", backgroundColor: isActive ? theme.background.focus : undefined, children: [_jsx(Box, { ...(mode === "slash"
40
- ? { width: commandColumnWidth, flexShrink: 0 }
41
- : { flexShrink: 1 }), children: _jsxs(Box, { children: [labelElement, suggestion.commandKind &&
42
- COMMAND_KIND_SUFFIX[suggestion.commandKind] && (_jsx(Text, { color: textColor, children: COMMAND_KIND_SUFFIX[suggestion.commandKind] }))] }) }), suggestion.description && (_jsx(Box, { flexGrow: 1, paddingLeft: 3, children: _jsx(Text, { color: textColor, wrap: "truncate", children: sanitizeForDisplay(suggestion.description, 100) }) })), isActive && isLong && (_jsx(Box, { width: 3, flexShrink: 0, children: _jsx(Text, { color: Colors.Gray, children: isExpanded ? " ← " : " → " }) }))] })] }, `${suggestion.value}-${originalIndex}`));
43
- }), endIndex < suggestions.length && _jsx(Text, { color: "gray", children: "\u25BC" }), suggestions.length > MAX_SUGGESTIONS_TO_SHOW && (_jsxs(Text, { color: "gray", children: ["(", activeIndex + 1, "/", suggestions.length, ")"] }))] }));
44
- }
45
- //# sourceMappingURL=SuggestionsDisplay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SuggestionsDisplay.js","sourceRoot":"","sources":["../../../src/cli/ui/SuggestionsDisplay.tsx"],"names":[],"mappings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,UAAU,YACrC,kBAAkB,CAAC,UAAU,CAAC,WAAW,EAAE,GAAG,CAAC,GAC1C,GACF,CACN,EAEA,QAAQ,IAAI,MAAM,IAAI,CACtB,KAAC,GAAG,IAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,YAC3B,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,YAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAQ,GACxD,CACN,IACI,KA1CD,GAAG,UAAU,CAAC,KAAK,IAAI,aAAa,EAAE,CA2CtC,CACN,CAAC;YACH,CAAC,CAAC,EACD,QAAQ,GAAG,WAAW,CAAC,MAAM,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,uBAAS,EAC5D,WAAW,CAAC,MAAM,GAAG,uBAAuB,IAAI,CAChD,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBACf,WAAW,GAAG,CAAC,OAAG,WAAW,CAAC,MAAM,SAChC,CACP,IACI,CACN,CAAC;AACH,CAAC"}
@@ -1,2 +0,0 @@
1
- import type React from "react";
2
- export declare const ThinkingIndicator: React.FC;
@@ -1,16 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { useEffect, useState } from "react";
4
- const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
5
- const FRAME_INTERVAL_MS = 80;
6
- export const ThinkingIndicator = () => {
7
- const [frameIndex, setFrameIndex] = useState(0);
8
- useEffect(() => {
9
- const timer = setInterval(() => {
10
- setFrameIndex((prev) => (prev + 1) % SPINNER_FRAMES.length);
11
- }, FRAME_INTERVAL_MS);
12
- return () => clearInterval(timer);
13
- }, []);
14
- return (_jsx(Box, { paddingX: 1, marginBottom: 1, marginTop: 1, children: _jsxs(Text, { color: "cyan", children: [SPINNER_FRAMES[frameIndex], " Thinking..."] }) }));
15
- };
16
- //# sourceMappingURL=ThinkingIndicator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThinkingIndicator.js","sourceRoot":"","sources":["../../../src/cli/ui/ThinkingIndicator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1E,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,CAAC,MAAM,iBAAiB,GAAa,GAAG,EAAE;IAC/C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;YAC9B,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAC7D,CAAC,EAAE,iBAAiB,CAAC,CAAC;QAEtB,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACN,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,YAC9C,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,aAAE,cAAc,CAAC,UAAU,CAAC,oBAAoB,GAC7D,CACN,CAAC;AACH,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type React from "react";
2
- export declare const DefaultAppLayout: React.FC;
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Box } from "ink";
3
- export const DefaultAppLayout = () => {
4
- return _jsx(Box, { flexDirection: "column", flexGrow: 0, flexShrink: 0 });
5
- };
6
- //# sourceMappingURL=DefaultAppLayout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DefaultAppLayout.js","sourceRoot":"","sources":["../../../../src/cli/ui/layout/DefaultAppLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1B,MAAM,CAAC,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC9C,OAAO,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,GAAQ,CAAC;AACvE,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { ReactElement } from "react";
2
- export declare const MAX_WIDTH = 120;
3
- interface ExpandableTextProps {
4
- label: string;
5
- matchedIndex?: number;
6
- userInput?: string;
7
- textColor?: string;
8
- isExpanded?: boolean;
9
- }
10
- /**
11
- * Renders a suggestion label, highlighting the matched portion if provided.
12
- */
13
- export declare function ExpandableText({ label, matchedIndex, userInput, textColor, isExpanded: _isExpanded, }: ExpandableTextProps): ReactElement;
14
- export {};
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Text } from "ink";
3
- export const MAX_WIDTH = 120;
4
- /**
5
- * Renders a suggestion label, highlighting the matched portion if provided.
6
- */
7
- export function ExpandableText({ label, matchedIndex, userInput, textColor, isExpanded: _isExpanded, }) {
8
- if (matchedIndex !== undefined &&
9
- matchedIndex >= 0 &&
10
- userInput &&
11
- userInput.length > 0) {
12
- const before = label.slice(0, matchedIndex);
13
- const match = label.slice(matchedIndex, matchedIndex + userInput.length);
14
- const after = label.slice(matchedIndex + userInput.length);
15
- return (_jsxs(Text, { color: textColor, children: [before, _jsx(Text, { bold: true, children: match }), after] }));
16
- }
17
- return _jsx(Text, { color: textColor, children: label });
18
- }
19
- //# sourceMappingURL=ExpandableText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpandableText.js","sourceRoot":"","sources":["../../../../src/cli/ui/shared/ExpandableText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAU7B;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,EAC9B,KAAK,EACL,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EAAE,WAAW,GACF;IACrB,IACC,YAAY,KAAK,SAAS;QAC1B,YAAY,IAAI,CAAC;QACjB,SAAS;QACT,SAAS,CAAC,MAAM,GAAG,CAAC,EACnB,CAAC;QACF,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QACzE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3D,OAAO,CACN,MAAC,IAAI,IAAC,KAAK,EAAE,SAAS,aACpB,MAAM,EACP,KAAC,IAAI,IAAC,IAAI,kBAAE,KAAK,GAAQ,EACxB,KAAK,IACA,CACP,CAAC;IACH,CAAC;IACD,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,YAAG,KAAK,GAAQ,CAAC;AAC/C,CAAC"}
@@ -1,21 +0,0 @@
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>;
@@ -1,56 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/cli/utils/cache.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,YAAY;IACP,OAAO,CAAwB;IAC/B,UAA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,CAAC;IAED,WAAW,CAAC,GAAM,EAAE,OAAgB,EAAE,GAAY;QACjD,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,KAAK,GAAG,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,GAAG,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"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Utility functions for command parsing.
3
- */
4
- /**
5
- * Returns true if the trimmed text begins with '/', indicating a slash command.
6
- */
7
- export declare function isSlashCommand(text: string): boolean;
8
- /**
9
- * Returns true if the trimmed text begins with '@', indicating an at-command.
10
- */
11
- export declare function isAtCommand(text: string): boolean;
@@ -1,16 +0,0 @@
1
- /**
2
- * Utility functions for command parsing.
3
- */
4
- /**
5
- * Returns true if the trimmed text begins with '/', indicating a slash command.
6
- */
7
- export function isSlashCommand(text) {
8
- return text.trimStart().startsWith("/");
9
- }
10
- /**
11
- * Returns true if the trimmed text begins with '@', indicating an at-command.
12
- */
13
- export function isAtCommand(text) {
14
- return text.trimStart().startsWith("@");
15
- }
16
- //# sourceMappingURL=commandUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commandUtils.js","sourceRoot":"","sources":["../../../src/cli/utils/commandUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC"}
@@ -1,12 +0,0 @@
1
- declare class DebugLogger {
2
- private logStream;
3
- constructor();
4
- private writeToFile;
5
- info(...args: unknown[]): void;
6
- log(...args: unknown[]): void;
7
- warn(...args: unknown[]): void;
8
- error(...args: unknown[]): void;
9
- debug(...args: unknown[]): void;
10
- }
11
- export declare const debugLogger: DebugLogger;
12
- export {};
@@ -1,54 +0,0 @@
1
- import * as fs from "node:fs";
2
- import { dirname } from "node:path";
3
- import * as util from "node:util";
4
- import chalk from "chalk";
5
- import dotenv from "dotenv";
6
- dotenv.config();
7
- class DebugLogger {
8
- logStream;
9
- constructor() {
10
- const logFilePath = process.env["DEBUG_LOG_FILE"] || "logs/debug.log";
11
- if (logFilePath) {
12
- const logDir = dirname(logFilePath);
13
- if (!fs.existsSync(logDir)) {
14
- fs.mkdirSync(logDir, { recursive: true });
15
- }
16
- this.logStream = fs.createWriteStream(logFilePath, {
17
- flags: "a",
18
- });
19
- }
20
- this.logStream?.on("error", (err) => {
21
- console.error(chalk.red("[STREAM_ERROR]"), chalk.gray(util.format("Error writing to debug log stream:", err)));
22
- });
23
- }
24
- writeToFile(level, args) {
25
- if (this.logStream) {
26
- const message = util.format(...args);
27
- const timestamp = new Date().toISOString();
28
- const logEntry = `[${timestamp}] [${level}] ${message}\n`;
29
- this.logStream.write(logEntry);
30
- }
31
- }
32
- info(...args) {
33
- this.writeToFile("INFO", args);
34
- console.error(chalk.green("[INFO]"), chalk.green(util.format(...args)));
35
- }
36
- log(...args) {
37
- this.writeToFile("LOG", args);
38
- console.error(chalk.blue("[LOG]"), chalk.gray(util.format(...args)));
39
- }
40
- warn(...args) {
41
- this.writeToFile("WARN", args);
42
- console.error(chalk.yellow("[WARN]"), chalk.yellow(util.format(...args)));
43
- }
44
- error(...args) {
45
- this.writeToFile("ERROR", args);
46
- console.error(chalk.red("[ERROR]"), chalk.red(util.format(...args)));
47
- }
48
- debug(...args) {
49
- this.writeToFile("DEBUG", args);
50
- console.error(chalk.bgGrey("[DEBUG]"), chalk.bgGrey(util.format(...args)));
51
- }
52
- }
53
- export const debugLogger = new DebugLogger();
54
- //# sourceMappingURL=debugLogger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debugLogger.js","sourceRoot":"","sources":["../../../src/cli/utils/debugLogger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,WAAW;IACR,SAAS,CAA6B;IAE9C;QACC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC;QAEtE,IAAI,WAAW,EAAE,CAAC;YACjB,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;YAEpC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC5B,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3C,CAAC;YAED,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,iBAAiB,CAAC,WAAW,EAAE;gBAClD,KAAK,EAAE,GAAG;aACV,CAAC,CAAC;QACJ,CA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CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3E,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,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;CACD;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- export interface HistoryItem {
2
- text: string;
3
- timestamp: number;
4
- }
5
- export declare class HistoryStorage {
6
- private filePath;
7
- constructor(filePath?: string);
8
- getPreviousUserMessages(): Promise<string[]>;
9
- appendMessage(text: string): Promise<void>;
10
- private getRawItems;
11
- private saveItems;
12
- }
13
- export declare const historyStorage: HistoryStorage;
@@ -1,64 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import os from "node:os";
3
- import path from "node:path";
4
- import { debugLogger } from "./debugLogger.js";
5
- const HISTORY_FILE_PATH = path.join(os.homedir(), ".obsidian-mcp-agent-history.json");
6
- const EXPIRY_MS = 24 * 60 * 60 * 1000; // 24 hours
7
- export class HistoryStorage {
8
- filePath;
9
- constructor(filePath = HISTORY_FILE_PATH) {
10
- this.filePath = filePath;
11
- }
12
- async getPreviousUserMessages() {
13
- try {
14
- const data = await fs.readFile(this.filePath, "utf-8");
15
- const parsed = JSON.parse(data);
16
- const now = Date.now();
17
- const validItems = parsed.filter((item) => now - item.timestamp <= EXPIRY_MS);
18
- // If items were pruned, save back to file to save disk space
19
- if (validItems.length < parsed.length) {
20
- await this.saveItems(validItems);
21
- }
22
- // Return just the text values
23
- return validItems.map((item) => item.text);
24
- }
25
- catch (error) {
26
- if (error.code !== "ENOENT") {
27
- debugLogger.warn("Failed to read history storage", error);
28
- }
29
- return [];
30
- }
31
- }
32
- async appendMessage(text) {
33
- try {
34
- const currentMessages = await this.getRawItems();
35
- const now = Date.now();
36
- // Prune old items first
37
- const validItems = currentMessages.filter((item) => now - item.timestamp <= EXPIRY_MS);
38
- validItems.push({ text, timestamp: now });
39
- await this.saveItems(validItems);
40
- }
41
- catch (error) {
42
- debugLogger.warn("Failed to append message to history storage", error);
43
- }
44
- }
45
- async getRawItems() {
46
- try {
47
- const data = await fs.readFile(this.filePath, "utf-8");
48
- return JSON.parse(data);
49
- }
50
- catch (_error) {
51
- return [];
52
- }
53
- }
54
- async saveItems(items) {
55
- try {
56
- await fs.writeFile(this.filePath, JSON.stringify(items, null, 2), "utf-8");
57
- }
58
- catch (error) {
59
- debugLogger.warn("Failed to save items to history storage", error);
60
- }
61
- }
62
- }
63
- export const historyStorage = new HistoryStorage();
64
- //# sourceMappingURL=historyStorage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"historyStorage.js","sourceRoot":"","sources":["../../../src/cli/utils/historyStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,iBAAiB,GAAG,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@license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Calculates the maximum width of a multi-line ASCII art string.
8
- * @param asciiArt The ASCII art string.
9
- * @returns The length of the longest line in the ASCII art.
10
- */
11
- export declare const getAsciiArtWidth: (asciiArt: string) => number;
12
- /**
13
- * Checks if a string contains only ASCII characters (0-127).
14
- */
15
- export declare function isAscii(str: string): boolean;
16
- export declare function toCodePoints(str: string): string[];
17
- export declare function cpLen(str: string): number;
18
- /**
19
- * Converts a code point index to a UTF-16 code unit offset.
20
- */
21
- export declare function cpIndexToOffset(str: string, cpIndex: number): number;
22
- export declare function cpSlice(str: string, start: number, end?: number): string;
23
- /**
24
- * Strip characters that can break terminal rendering.
25
- *
26
- * This is a strict sanitization function intended for general display
27
- * contexts. It strips all C1 control characters (0x80-0x9F) and VT
28
- * control sequences. For list display contexts where a more lenient
29
- * approach is needed (preserving C1 characters and only stripping ANSI
30
- * codes and newlines/tabs), use a separate function instead.
31
- *
32
- * Processing order:
33
- * 1. stripAnsi removes ANSI escape sequences (including 8-bit CSI 0x9B)
34
- * 2. Regex strips C0, C1, BiDi, and zero-width control characters
35
- * 3. stripVTControlCharacters removes any remaining VT sequences
36
- *
37
- * Characters stripped:
38
- * - ANSI escape sequences (via strip-ansi)
39
- * - VT control sequences (via Node.js util.stripVTControlCharacters)
40
- * - C0 control chars (0x00-0x1F) except TAB(0x09), LF(0x0A), CR(0x0D)
41
- * - C1 control chars (0x80-0x9F) that can cause display issues
42
- * - BiDi control chars (U+200E, U+200F, U+202A-U+202E, U+2066-U+2069)
43
- * - Zero-width chars (U+200B, U+FEFF)
44
- *
45
- * Characters preserved:
46
- * - All printable Unicode including emojis
47
- * - ZWJ (U+200D) - needed for complex emoji sequences
48
- * - ZWNJ (U+200C) - preserve zero-width non-joiner
49
- * - DEL (0x7F) - handled functionally by applyOperations, not a display issue
50
- * - CR/LF (0x0D/0x0A) - needed for line breaks
51
- * - TAB (0x09) - preserve tabs
52
- */
53
- export declare function stripUnsafeCharacters(str: string): string;
54
- /**
55
- * Sanitize a string for display in inline UI components (e.g. Help, Suggestions).
56
- * Removes ANSI codes, dangerous control characters, collapses whitespace
57
- * characters into a single space, and optionally truncates.
58
- */
59
- export declare function sanitizeForDisplay(str: string, maxLength?: number): string;
60
- /**
61
- * Normalizes escaped newline characters (e.g., "\\n") into actual newline characters.
62
- */
63
- export declare function normalizeEscapedNewlines(value: string): string;
64
- /**
65
- * Cached version of stringWidth function for better performance
66
- */
67
- export declare const getCachedStringWidth: (str: string) => number;
68
- export declare function escapeAnsiCtrlCodes<T>(obj: T): T;