@hcu-lab.me/mcp-device 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -0
  3. package/dist/bootstrap.d.ts +1 -0
  4. package/dist/bootstrap.js +22 -0
  5. package/dist/command-manager.d.ts +8 -0
  6. package/dist/command-manager.js +241 -0
  7. package/dist/config-field-definitions.d.ts +41 -0
  8. package/dist/config-field-definitions.js +37 -0
  9. package/dist/config-manager.d.ts +102 -0
  10. package/dist/config-manager.js +291 -0
  11. package/dist/config.d.ts +6 -0
  12. package/dist/config.js +10 -0
  13. package/dist/custom-stdio.d.ts +51 -0
  14. package/dist/custom-stdio.js +358 -0
  15. package/dist/data/official-app-ca.pem +12 -0
  16. package/dist/data/onboarding-prompts.json +70 -0
  17. package/dist/device/device-state.d.ts +13 -0
  18. package/dist/device/device-state.js +100 -0
  19. package/dist/device/device-status.d.ts +81 -0
  20. package/dist/device/device-status.js +156 -0
  21. package/dist/device/device.d.ts +16 -0
  22. package/dist/device/device.js +190 -0
  23. package/dist/device/execution-engine.d.ts +144 -0
  24. package/dist/device/execution-engine.js +195 -0
  25. package/dist/device/gateway-channel.d.ts +48 -0
  26. package/dist/device/gateway-channel.js +384 -0
  27. package/dist/device/gateway-config.d.ts +40 -0
  28. package/dist/device/gateway-config.js +207 -0
  29. package/dist/device/gateway-identity.d.ts +35 -0
  30. package/dist/device/gateway-identity.js +178 -0
  31. package/dist/device/gateway-pairing.d.ts +25 -0
  32. package/dist/device/gateway-pairing.js +105 -0
  33. package/dist/device/gateway-secure-transport.d.ts +25 -0
  34. package/dist/device/gateway-secure-transport.js +117 -0
  35. package/dist/device/gateway-tool-adapter.d.ts +17 -0
  36. package/dist/device/gateway-tool-adapter.js +284 -0
  37. package/dist/device/gateway-url-policy.d.ts +3 -0
  38. package/dist/device/gateway-url-policy.js +43 -0
  39. package/dist/device/linux-service.d.ts +70 -0
  40. package/dist/device/linux-service.js +268 -0
  41. package/dist/device/official-trust.d.ts +7 -0
  42. package/dist/device/official-trust.js +49 -0
  43. package/dist/device/project-inspection.d.ts +1 -0
  44. package/dist/device/project-inspection.js +180 -0
  45. package/dist/device/runtime-owner.d.ts +41 -0
  46. package/dist/device/runtime-owner.js +177 -0
  47. package/dist/device/windows-dpapi.d.ts +11 -0
  48. package/dist/device/windows-dpapi.js +67 -0
  49. package/dist/device/windows-service.d.ts +56 -0
  50. package/dist/device/windows-service.js +238 -0
  51. package/dist/error-handlers.d.ts +7 -0
  52. package/dist/error-handlers.js +15 -0
  53. package/dist/handlers/edit-search-handlers.d.ts +6 -0
  54. package/dist/handlers/edit-search-handlers.js +6 -0
  55. package/dist/handlers/filesystem-handlers.d.ts +38 -0
  56. package/dist/handlers/filesystem-handlers.js +440 -0
  57. package/dist/handlers/history-handlers.d.ts +12 -0
  58. package/dist/handlers/history-handlers.js +67 -0
  59. package/dist/handlers/index.d.ts +6 -0
  60. package/dist/handlers/index.js +7 -0
  61. package/dist/handlers/process-handlers.d.ts +9 -0
  62. package/dist/handlers/process-handlers.js +15 -0
  63. package/dist/handlers/search-handlers.d.ts +17 -0
  64. package/dist/handlers/search-handlers.js +224 -0
  65. package/dist/handlers/terminal-handlers.d.ts +21 -0
  66. package/dist/handlers/terminal-handlers.js +35 -0
  67. package/dist/index.d.ts +2 -0
  68. package/dist/index.js +138 -0
  69. package/dist/mcp-device.d.ts +2 -0
  70. package/dist/mcp-device.js +7 -0
  71. package/dist/npm-scripts/remote.d.ts +3 -0
  72. package/dist/npm-scripts/remote.js +314 -0
  73. package/dist/search-manager.d.ts +147 -0
  74. package/dist/search-manager.js +828 -0
  75. package/dist/server.d.ts +46 -0
  76. package/dist/server.js +1563 -0
  77. package/dist/terminal-manager.d.ts +104 -0
  78. package/dist/terminal-manager.js +635 -0
  79. package/dist/tools/config.d.ts +96 -0
  80. package/dist/tools/config.js +260 -0
  81. package/dist/tools/edit.d.ts +38 -0
  82. package/dist/tools/edit.js +435 -0
  83. package/dist/tools/feedback.d.ts +8 -0
  84. package/dist/tools/feedback.js +132 -0
  85. package/dist/tools/filesystem.d.ts +79 -0
  86. package/dist/tools/filesystem.js +947 -0
  87. package/dist/tools/fuzzySearch.d.ts +12 -0
  88. package/dist/tools/fuzzySearch.js +74 -0
  89. package/dist/tools/fuzzySearchCore.d.ts +52 -0
  90. package/dist/tools/fuzzySearchCore.js +125 -0
  91. package/dist/tools/improved-process-tools.d.ts +24 -0
  92. package/dist/tools/improved-process-tools.js +627 -0
  93. package/dist/tools/mime-types.d.ts +3 -0
  94. package/dist/tools/mime-types.js +28 -0
  95. package/dist/tools/pdf/extract-images.d.ts +34 -0
  96. package/dist/tools/pdf/extract-images.js +132 -0
  97. package/dist/tools/pdf/index.d.ts +6 -0
  98. package/dist/tools/pdf/index.js +3 -0
  99. package/dist/tools/pdf/lib/pdf2md.d.ts +36 -0
  100. package/dist/tools/pdf/lib/pdf2md.js +76 -0
  101. package/dist/tools/pdf/manipulations.d.ts +13 -0
  102. package/dist/tools/pdf/manipulations.js +99 -0
  103. package/dist/tools/pdf/markdown.d.ts +26 -0
  104. package/dist/tools/pdf/markdown.js +275 -0
  105. package/dist/tools/pdf/utils.d.ts +12 -0
  106. package/dist/tools/pdf/utils.js +34 -0
  107. package/dist/tools/process.d.ts +3 -0
  108. package/dist/tools/process.js +56 -0
  109. package/dist/tools/prompts.d.ts +28 -0
  110. package/dist/tools/prompts.js +259 -0
  111. package/dist/tools/schemas.d.ts +454 -0
  112. package/dist/tools/schemas.js +242 -0
  113. package/dist/tools/usage.d.ts +5 -0
  114. package/dist/tools/usage.js +24 -0
  115. package/dist/types.d.ts +83 -0
  116. package/dist/types.js +1 -0
  117. package/dist/ui/config-editor/config-editor-runtime.js +150 -0
  118. package/dist/ui/config-editor/index.html +13 -0
  119. package/dist/ui/config-editor/src/app.d.ts +43 -0
  120. package/dist/ui/config-editor/src/app.js +831 -0
  121. package/dist/ui/config-editor/src/array-modal.d.ts +19 -0
  122. package/dist/ui/config-editor/src/array-modal.js +185 -0
  123. package/dist/ui/config-editor/src/main.d.ts +1 -0
  124. package/dist/ui/config-editor/src/main.js +2 -0
  125. package/dist/ui/config-editor/styles.css +587 -0
  126. package/dist/ui/contracts.d.ts +14 -0
  127. package/dist/ui/contracts.js +21 -0
  128. package/dist/ui/file-preview/index.html +16 -0
  129. package/dist/ui/file-preview/preview-runtime.js +469 -0
  130. package/dist/ui/file-preview/shared/preview-file-types.d.ts +5 -0
  131. package/dist/ui/file-preview/shared/preview-file-types.js +59 -0
  132. package/dist/ui/file-preview/src/app.d.ts +4 -0
  133. package/dist/ui/file-preview/src/app.js +680 -0
  134. package/dist/ui/file-preview/src/components/code-viewer.d.ts +6 -0
  135. package/dist/ui/file-preview/src/components/code-viewer.js +73 -0
  136. package/dist/ui/file-preview/src/components/highlighting.d.ts +2 -0
  137. package/dist/ui/file-preview/src/components/highlighting.js +54 -0
  138. package/dist/ui/file-preview/src/components/html-renderer.d.ts +5 -0
  139. package/dist/ui/file-preview/src/components/html-renderer.js +47 -0
  140. package/dist/ui/file-preview/src/components/markdown-renderer.d.ts +1 -0
  141. package/dist/ui/file-preview/src/components/markdown-renderer.js +59 -0
  142. package/dist/ui/file-preview/src/directory-controller.d.ts +8 -0
  143. package/dist/ui/file-preview/src/directory-controller.js +240 -0
  144. package/dist/ui/file-preview/src/document-layout.d.ts +20 -0
  145. package/dist/ui/file-preview/src/document-layout.js +109 -0
  146. package/dist/ui/file-preview/src/document-outline.d.ts +17 -0
  147. package/dist/ui/file-preview/src/document-outline.js +97 -0
  148. package/dist/ui/file-preview/src/document-workspace.d.ts +19 -0
  149. package/dist/ui/file-preview/src/document-workspace.js +33 -0
  150. package/dist/ui/file-preview/src/file-type-handlers.d.ts +10 -0
  151. package/dist/ui/file-preview/src/file-type-handlers.js +109 -0
  152. package/dist/ui/file-preview/src/host/external-actions.d.ts +8 -0
  153. package/dist/ui/file-preview/src/host/external-actions.js +55 -0
  154. package/dist/ui/file-preview/src/host/selection-context.d.ts +9 -0
  155. package/dist/ui/file-preview/src/host/selection-context.js +106 -0
  156. package/dist/ui/file-preview/src/image-preview.d.ts +3 -0
  157. package/dist/ui/file-preview/src/image-preview.js +21 -0
  158. package/dist/ui/file-preview/src/main.d.ts +1 -0
  159. package/dist/ui/file-preview/src/main.js +5 -0
  160. package/dist/ui/file-preview/src/markdown/conflict-dialog.d.ts +40 -0
  161. package/dist/ui/file-preview/src/markdown/conflict-dialog.js +163 -0
  162. package/dist/ui/file-preview/src/markdown/controller.d.ts +44 -0
  163. package/dist/ui/file-preview/src/markdown/controller.js +1043 -0
  164. package/dist/ui/file-preview/src/markdown/editor.d.ts +131 -0
  165. package/dist/ui/file-preview/src/markdown/editor.js +1479 -0
  166. package/dist/ui/file-preview/src/markdown/linking.d.ts +16 -0
  167. package/dist/ui/file-preview/src/markdown/linking.js +228 -0
  168. package/dist/ui/file-preview/src/markdown/outline.d.ts +2 -0
  169. package/dist/ui/file-preview/src/markdown/outline.js +16 -0
  170. package/dist/ui/file-preview/src/markdown/parser.d.ts +30 -0
  171. package/dist/ui/file-preview/src/markdown/parser.js +38 -0
  172. package/dist/ui/file-preview/src/markdown/preview.d.ts +1 -0
  173. package/dist/ui/file-preview/src/markdown/preview.js +20 -0
  174. package/dist/ui/file-preview/src/markdown/slugify.d.ts +3 -0
  175. package/dist/ui/file-preview/src/markdown/slugify.js +31 -0
  176. package/dist/ui/file-preview/src/markdown/utils.d.ts +1 -0
  177. package/dist/ui/file-preview/src/markdown/utils.js +15 -0
  178. package/dist/ui/file-preview/src/model.d.ts +35 -0
  179. package/dist/ui/file-preview/src/model.js +1 -0
  180. package/dist/ui/file-preview/src/panel-actions.d.ts +17 -0
  181. package/dist/ui/file-preview/src/panel-actions.js +182 -0
  182. package/dist/ui/file-preview/src/path-utils.d.ts +6 -0
  183. package/dist/ui/file-preview/src/path-utils.js +64 -0
  184. package/dist/ui/file-preview/src/payload-utils.d.ts +11 -0
  185. package/dist/ui/file-preview/src/payload-utils.js +119 -0
  186. package/dist/ui/file-preview/src/types.d.ts +1 -0
  187. package/dist/ui/file-preview/src/types.js +1 -0
  188. package/dist/ui/file-preview/styles.css +1631 -0
  189. package/dist/ui/resources.d.ts +28 -0
  190. package/dist/ui/resources.js +86 -0
  191. package/dist/ui/shared/compact-row.d.ts +11 -0
  192. package/dist/ui/shared/compact-row.js +18 -0
  193. package/dist/ui/shared/escape-html.d.ts +4 -0
  194. package/dist/ui/shared/escape-html.js +11 -0
  195. package/dist/ui/shared/host-context.d.ts +15 -0
  196. package/dist/ui/shared/host-context.js +51 -0
  197. package/dist/ui/shared/tool-bridge.d.ts +30 -0
  198. package/dist/ui/shared/tool-bridge.js +137 -0
  199. package/dist/ui/shared/tool-shell.d.ts +25 -0
  200. package/dist/ui/shared/tool-shell.js +107 -0
  201. package/dist/ui/shared/ui-event-tracker.d.ts +9 -0
  202. package/dist/ui/shared/ui-event-tracker.js +27 -0
  203. package/dist/ui/shared/widget-state.d.ts +33 -0
  204. package/dist/ui/shared/widget-state.js +158 -0
  205. package/dist/utils/ab-test.d.ts +12 -0
  206. package/dist/utils/ab-test.js +104 -0
  207. package/dist/utils/capture.d.ts +35 -0
  208. package/dist/utils/capture.js +481 -0
  209. package/dist/utils/dockerPrompt.d.ts +17 -0
  210. package/dist/utils/dockerPrompt.js +53 -0
  211. package/dist/utils/feature-flags.d.ts +59 -0
  212. package/dist/utils/feature-flags.js +215 -0
  213. package/dist/utils/files/base.d.ts +173 -0
  214. package/dist/utils/files/base.js +5 -0
  215. package/dist/utils/files/binary.d.ts +21 -0
  216. package/dist/utils/files/binary.js +65 -0
  217. package/dist/utils/files/docx.d.ts +47 -0
  218. package/dist/utils/files/docx.js +679 -0
  219. package/dist/utils/files/excel.d.ts +24 -0
  220. package/dist/utils/files/excel.js +437 -0
  221. package/dist/utils/files/factory.d.ts +41 -0
  222. package/dist/utils/files/factory.js +113 -0
  223. package/dist/utils/files/image.d.ts +21 -0
  224. package/dist/utils/files/image.js +78 -0
  225. package/dist/utils/files/index.d.ts +10 -0
  226. package/dist/utils/files/index.js +13 -0
  227. package/dist/utils/files/pdf.d.ts +32 -0
  228. package/dist/utils/files/pdf.js +142 -0
  229. package/dist/utils/files/text.d.ts +63 -0
  230. package/dist/utils/files/text.js +370 -0
  231. package/dist/utils/fuzzySearchLogger.d.ts +30 -0
  232. package/dist/utils/fuzzySearchLogger.js +126 -0
  233. package/dist/utils/lineEndingHandler.d.ts +21 -0
  234. package/dist/utils/lineEndingHandler.js +77 -0
  235. package/dist/utils/logger.d.ts +32 -0
  236. package/dist/utils/logger.js +72 -0
  237. package/dist/utils/mcp-ui-ab-test.d.ts +13 -0
  238. package/dist/utils/mcp-ui-ab-test.js +62 -0
  239. package/dist/utils/open-browser.d.ts +9 -0
  240. package/dist/utils/open-browser.js +42 -0
  241. package/dist/utils/process-detection.d.ts +23 -0
  242. package/dist/utils/process-detection.js +150 -0
  243. package/dist/utils/ripgrep-resolver.d.ts +9 -0
  244. package/dist/utils/ripgrep-resolver.js +74 -0
  245. package/dist/utils/system-info.d.ts +71 -0
  246. package/dist/utils/system-info.js +712 -0
  247. package/dist/utils/toolHistory.d.ts +86 -0
  248. package/dist/utils/toolHistory.js +257 -0
  249. package/dist/utils/trackTools.d.ts +6 -0
  250. package/dist/utils/trackTools.js +54 -0
  251. package/dist/utils/unsupportedParams.d.ts +24 -0
  252. package/dist/utils/unsupportedParams.js +66 -0
  253. package/dist/utils/usageTracker.d.ts +133 -0
  254. package/dist/utils/usageTracker.js +477 -0
  255. package/dist/utils/welcome-onboarding.d.ts +11 -0
  256. package/dist/utils/welcome-onboarding.js +99 -0
  257. package/dist/utils/withTimeout.d.ts +28 -0
  258. package/dist/utils/withTimeout.js +85 -0
  259. package/dist/version.d.ts +1 -0
  260. package/dist/version.js +1 -0
  261. package/package.json +131 -0
@@ -0,0 +1,454 @@
1
+ import { z } from "zod";
2
+ export declare const GetConfigArgsSchema: z.ZodObject<{
3
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ origin?: "ui" | "llm" | undefined;
6
+ }, {
7
+ origin?: "ui" | "llm" | undefined;
8
+ }>;
9
+ export declare const SetConfigValueArgsSchema: z.ZodObject<{
10
+ key: z.ZodString;
11
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodNull]>;
12
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ value: string | number | boolean | string[] | null;
15
+ key: string;
16
+ origin?: "ui" | "llm" | undefined;
17
+ }, {
18
+ value: string | number | boolean | string[] | null;
19
+ key: string;
20
+ origin?: "ui" | "llm" | undefined;
21
+ }>;
22
+ export declare const ListProcessesArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
23
+ export declare const StartProcessArgsSchema: z.ZodObject<{
24
+ command: z.ZodString;
25
+ timeout_ms: z.ZodNumber;
26
+ working_directory: z.ZodOptional<z.ZodString>;
27
+ shell: z.ZodOptional<z.ZodString>;
28
+ verbose_timing: z.ZodOptional<z.ZodBoolean>;
29
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ command: string;
32
+ timeout_ms: number;
33
+ origin?: "ui" | "llm" | undefined;
34
+ working_directory?: string | undefined;
35
+ shell?: string | undefined;
36
+ verbose_timing?: boolean | undefined;
37
+ }, {
38
+ command: string;
39
+ timeout_ms: number;
40
+ origin?: "ui" | "llm" | undefined;
41
+ working_directory?: string | undefined;
42
+ shell?: string | undefined;
43
+ verbose_timing?: boolean | undefined;
44
+ }>;
45
+ export declare const ReadProcessOutputArgsSchema: z.ZodObject<{
46
+ pid: z.ZodNumber;
47
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
48
+ offset: z.ZodOptional<z.ZodNumber>;
49
+ length: z.ZodOptional<z.ZodNumber>;
50
+ verbose_timing: z.ZodOptional<z.ZodBoolean>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ pid: number;
53
+ length?: number | undefined;
54
+ timeout_ms?: number | undefined;
55
+ verbose_timing?: boolean | undefined;
56
+ offset?: number | undefined;
57
+ }, {
58
+ pid: number;
59
+ length?: number | undefined;
60
+ timeout_ms?: number | undefined;
61
+ verbose_timing?: boolean | undefined;
62
+ offset?: number | undefined;
63
+ }>;
64
+ export declare const ForceTerminateArgsSchema: z.ZodObject<{
65
+ pid: z.ZodNumber;
66
+ }, "strip", z.ZodTypeAny, {
67
+ pid: number;
68
+ }, {
69
+ pid: number;
70
+ }>;
71
+ export declare const ListSessionsArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
72
+ export declare const KillProcessArgsSchema: z.ZodObject<{
73
+ pid: z.ZodNumber;
74
+ }, "strip", z.ZodTypeAny, {
75
+ pid: number;
76
+ }, {
77
+ pid: number;
78
+ }>;
79
+ export declare const ReadFileArgsSchema: z.ZodObject<{
80
+ path: z.ZodString;
81
+ isUrl: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
82
+ offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
83
+ length: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
84
+ sheet: z.ZodOptional<z.ZodString>;
85
+ range: z.ZodOptional<z.ZodString>;
86
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
87
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ length: number;
90
+ path: string;
91
+ offset: number;
92
+ isUrl: boolean;
93
+ origin?: "ui" | "llm" | undefined;
94
+ options?: Record<string, any> | undefined;
95
+ sheet?: string | undefined;
96
+ range?: string | undefined;
97
+ }, {
98
+ path: string;
99
+ length?: number | undefined;
100
+ origin?: "ui" | "llm" | undefined;
101
+ options?: Record<string, any> | undefined;
102
+ offset?: number | undefined;
103
+ isUrl?: boolean | undefined;
104
+ sheet?: string | undefined;
105
+ range?: string | undefined;
106
+ }>;
107
+ export declare const ReadMultipleFilesArgsSchema: z.ZodObject<{
108
+ paths: z.ZodArray<z.ZodString, "many">;
109
+ }, "strip", z.ZodTypeAny, {
110
+ paths: string[];
111
+ }, {
112
+ paths: string[];
113
+ }>;
114
+ export declare const WriteFileArgsSchema: z.ZodObject<{
115
+ path: z.ZodString;
116
+ content: z.ZodString;
117
+ mode: z.ZodDefault<z.ZodEnum<["rewrite", "append"]>>;
118
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ path: string;
121
+ content: string;
122
+ mode: "rewrite" | "append";
123
+ origin?: "ui" | "llm" | undefined;
124
+ }, {
125
+ path: string;
126
+ content: string;
127
+ origin?: "ui" | "llm" | undefined;
128
+ mode?: "rewrite" | "append" | undefined;
129
+ }>;
130
+ export declare const PdfInsertOperationSchema: z.ZodObject<{
131
+ type: z.ZodLiteral<"insert">;
132
+ pageIndex: z.ZodNumber;
133
+ markdown: z.ZodOptional<z.ZodString>;
134
+ sourcePdfPath: z.ZodOptional<z.ZodString>;
135
+ pdfOptions: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ type: "insert";
138
+ pageIndex: number;
139
+ markdown?: string | undefined;
140
+ sourcePdfPath?: string | undefined;
141
+ pdfOptions?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
142
+ }, {
143
+ type: "insert";
144
+ pageIndex: number;
145
+ markdown?: string | undefined;
146
+ sourcePdfPath?: string | undefined;
147
+ pdfOptions?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
148
+ }>;
149
+ export declare const PdfDeleteOperationSchema: z.ZodObject<{
150
+ type: z.ZodLiteral<"delete">;
151
+ pageIndexes: z.ZodArray<z.ZodNumber, "many">;
152
+ }, "strip", z.ZodTypeAny, {
153
+ type: "delete";
154
+ pageIndexes: number[];
155
+ }, {
156
+ type: "delete";
157
+ pageIndexes: number[];
158
+ }>;
159
+ export declare const PdfOperationSchema: z.ZodUnion<[z.ZodObject<{
160
+ type: z.ZodLiteral<"insert">;
161
+ pageIndex: z.ZodNumber;
162
+ markdown: z.ZodOptional<z.ZodString>;
163
+ sourcePdfPath: z.ZodOptional<z.ZodString>;
164
+ pdfOptions: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
165
+ }, "strip", z.ZodTypeAny, {
166
+ type: "insert";
167
+ pageIndex: number;
168
+ markdown?: string | undefined;
169
+ sourcePdfPath?: string | undefined;
170
+ pdfOptions?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
171
+ }, {
172
+ type: "insert";
173
+ pageIndex: number;
174
+ markdown?: string | undefined;
175
+ sourcePdfPath?: string | undefined;
176
+ pdfOptions?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
177
+ }>, z.ZodObject<{
178
+ type: z.ZodLiteral<"delete">;
179
+ pageIndexes: z.ZodArray<z.ZodNumber, "many">;
180
+ }, "strip", z.ZodTypeAny, {
181
+ type: "delete";
182
+ pageIndexes: number[];
183
+ }, {
184
+ type: "delete";
185
+ pageIndexes: number[];
186
+ }>]>;
187
+ export declare const WritePdfArgsSchema: z.ZodObject<{
188
+ path: z.ZodString;
189
+ content: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
190
+ type: z.ZodLiteral<"insert">;
191
+ pageIndex: z.ZodNumber;
192
+ markdown: z.ZodOptional<z.ZodString>;
193
+ sourcePdfPath: z.ZodOptional<z.ZodString>;
194
+ pdfOptions: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
195
+ }, "strip", z.ZodTypeAny, {
196
+ type: "insert";
197
+ pageIndex: number;
198
+ markdown?: string | undefined;
199
+ sourcePdfPath?: string | undefined;
200
+ pdfOptions?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
201
+ }, {
202
+ type: "insert";
203
+ pageIndex: number;
204
+ markdown?: string | undefined;
205
+ sourcePdfPath?: string | undefined;
206
+ pdfOptions?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
207
+ }>, z.ZodObject<{
208
+ type: z.ZodLiteral<"delete">;
209
+ pageIndexes: z.ZodArray<z.ZodNumber, "many">;
210
+ }, "strip", z.ZodTypeAny, {
211
+ type: "delete";
212
+ pageIndexes: number[];
213
+ }, {
214
+ type: "delete";
215
+ pageIndexes: number[];
216
+ }>]>, "many">]>, string | ({
217
+ type: "insert";
218
+ pageIndex: number;
219
+ markdown?: string | undefined;
220
+ sourcePdfPath?: string | undefined;
221
+ pdfOptions?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
222
+ } | {
223
+ type: "delete";
224
+ pageIndexes: number[];
225
+ })[], unknown>;
226
+ outputPath: z.ZodOptional<z.ZodString>;
227
+ options: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
228
+ }, "strip", z.ZodTypeAny, {
229
+ path: string;
230
+ content: string | ({
231
+ type: "insert";
232
+ pageIndex: number;
233
+ markdown?: string | undefined;
234
+ sourcePdfPath?: string | undefined;
235
+ pdfOptions?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
236
+ } | {
237
+ type: "delete";
238
+ pageIndexes: number[];
239
+ })[];
240
+ options?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
241
+ outputPath?: string | undefined;
242
+ }, {
243
+ path: string;
244
+ options?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
245
+ content?: unknown;
246
+ outputPath?: string | undefined;
247
+ }>;
248
+ export declare const CreateDirectoryArgsSchema: z.ZodObject<{
249
+ path: z.ZodString;
250
+ }, "strip", z.ZodTypeAny, {
251
+ path: string;
252
+ }, {
253
+ path: string;
254
+ }>;
255
+ export declare const ListDirectoryArgsSchema: z.ZodObject<{
256
+ path: z.ZodString;
257
+ depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
258
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ path: string;
261
+ depth: number;
262
+ origin?: "ui" | "llm" | undefined;
263
+ }, {
264
+ path: string;
265
+ origin?: "ui" | "llm" | undefined;
266
+ depth?: number | undefined;
267
+ }>;
268
+ export declare const MoveFileArgsSchema: z.ZodObject<{
269
+ source: z.ZodString;
270
+ destination: z.ZodString;
271
+ }, "strip", z.ZodTypeAny, {
272
+ source: string;
273
+ destination: string;
274
+ }, {
275
+ source: string;
276
+ destination: string;
277
+ }>;
278
+ export declare const GetFileInfoArgsSchema: z.ZodObject<{
279
+ path: z.ZodString;
280
+ }, "strip", z.ZodTypeAny, {
281
+ path: string;
282
+ }, {
283
+ path: string;
284
+ }>;
285
+ export declare const EditBlockArgsSchema: z.ZodEffects<z.ZodObject<{
286
+ file_path: z.ZodString;
287
+ old_string: z.ZodOptional<z.ZodString>;
288
+ new_string: z.ZodOptional<z.ZodString>;
289
+ expected_replacements: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
290
+ range: z.ZodOptional<z.ZodString>;
291
+ content: z.ZodOptional<z.ZodAny>;
292
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
293
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
294
+ }, "strip", z.ZodTypeAny, {
295
+ file_path: string;
296
+ expected_replacements: number;
297
+ origin?: "ui" | "llm" | undefined;
298
+ options?: Record<string, any> | undefined;
299
+ range?: string | undefined;
300
+ content?: any;
301
+ old_string?: string | undefined;
302
+ new_string?: string | undefined;
303
+ }, {
304
+ file_path: string;
305
+ origin?: "ui" | "llm" | undefined;
306
+ options?: Record<string, any> | undefined;
307
+ range?: string | undefined;
308
+ content?: any;
309
+ old_string?: string | undefined;
310
+ new_string?: string | undefined;
311
+ expected_replacements?: number | undefined;
312
+ }>, {
313
+ file_path: string;
314
+ expected_replacements: number;
315
+ origin?: "ui" | "llm" | undefined;
316
+ options?: Record<string, any> | undefined;
317
+ range?: string | undefined;
318
+ content?: any;
319
+ old_string?: string | undefined;
320
+ new_string?: string | undefined;
321
+ }, {
322
+ file_path: string;
323
+ origin?: "ui" | "llm" | undefined;
324
+ options?: Record<string, any> | undefined;
325
+ range?: string | undefined;
326
+ content?: any;
327
+ old_string?: string | undefined;
328
+ new_string?: string | undefined;
329
+ expected_replacements?: number | undefined;
330
+ }>;
331
+ export declare const InteractWithProcessArgsSchema: z.ZodObject<{
332
+ pid: z.ZodNumber;
333
+ input: z.ZodString;
334
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
335
+ wait_for_prompt: z.ZodOptional<z.ZodBoolean>;
336
+ verbose_timing: z.ZodOptional<z.ZodBoolean>;
337
+ }, "strip", z.ZodTypeAny, {
338
+ pid: number;
339
+ input: string;
340
+ timeout_ms?: number | undefined;
341
+ verbose_timing?: boolean | undefined;
342
+ wait_for_prompt?: boolean | undefined;
343
+ }, {
344
+ pid: number;
345
+ input: string;
346
+ timeout_ms?: number | undefined;
347
+ verbose_timing?: boolean | undefined;
348
+ wait_for_prompt?: boolean | undefined;
349
+ }>;
350
+ export declare const GetUsageStatsArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
351
+ export declare const GiveFeedbackArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
352
+ export declare const StartSearchArgsSchema: z.ZodObject<{
353
+ path: z.ZodString;
354
+ pattern: z.ZodString;
355
+ searchType: z.ZodDefault<z.ZodEnum<["files", "content"]>>;
356
+ filePattern: z.ZodOptional<z.ZodString>;
357
+ ignoreCase: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
358
+ maxResults: z.ZodOptional<z.ZodNumber>;
359
+ includeHidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
360
+ contextLines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
361
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
362
+ earlyTermination: z.ZodOptional<z.ZodBoolean>;
363
+ literalSearch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
364
+ origin: z.ZodOptional<z.ZodEnum<["ui", "llm"]>>;
365
+ }, "strip", z.ZodTypeAny, {
366
+ path: string;
367
+ pattern: string;
368
+ searchType: "content" | "files";
369
+ ignoreCase: boolean;
370
+ includeHidden: boolean;
371
+ contextLines: number;
372
+ literalSearch: boolean;
373
+ origin?: "ui" | "llm" | undefined;
374
+ timeout_ms?: number | undefined;
375
+ filePattern?: string | undefined;
376
+ maxResults?: number | undefined;
377
+ earlyTermination?: boolean | undefined;
378
+ }, {
379
+ path: string;
380
+ pattern: string;
381
+ origin?: "ui" | "llm" | undefined;
382
+ timeout_ms?: number | undefined;
383
+ searchType?: "content" | "files" | undefined;
384
+ filePattern?: string | undefined;
385
+ ignoreCase?: boolean | undefined;
386
+ maxResults?: number | undefined;
387
+ includeHidden?: boolean | undefined;
388
+ contextLines?: number | undefined;
389
+ earlyTermination?: boolean | undefined;
390
+ literalSearch?: boolean | undefined;
391
+ }>;
392
+ export declare const GetMoreSearchResultsArgsSchema: z.ZodObject<{
393
+ sessionId: z.ZodString;
394
+ offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
395
+ length: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
396
+ }, "strip", z.ZodTypeAny, {
397
+ length: number;
398
+ offset: number;
399
+ sessionId: string;
400
+ }, {
401
+ sessionId: string;
402
+ length?: number | undefined;
403
+ offset?: number | undefined;
404
+ }>;
405
+ export declare const StopSearchArgsSchema: z.ZodObject<{
406
+ sessionId: z.ZodString;
407
+ }, "strip", z.ZodTypeAny, {
408
+ sessionId: string;
409
+ }, {
410
+ sessionId: string;
411
+ }>;
412
+ export declare const ListSearchesArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
413
+ export declare const GetPromptsArgsSchema: z.ZodObject<{
414
+ action: z.ZodEnum<["get_prompt"]>;
415
+ promptId: z.ZodString;
416
+ }, "strip", z.ZodTypeAny, {
417
+ action: "get_prompt";
418
+ promptId: string;
419
+ }, {
420
+ action: "get_prompt";
421
+ promptId: string;
422
+ }>;
423
+ export declare const GetRecentToolCallsArgsSchema: z.ZodObject<{
424
+ maxResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
425
+ toolName: z.ZodOptional<z.ZodString>;
426
+ since: z.ZodOptional<z.ZodString>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ maxResults: number;
429
+ toolName?: string | undefined;
430
+ since?: string | undefined;
431
+ }, {
432
+ maxResults?: number | undefined;
433
+ toolName?: string | undefined;
434
+ since?: string | undefined;
435
+ }>;
436
+ export declare const TrackUiEventArgsSchema: z.ZodObject<{
437
+ event: z.ZodString;
438
+ component: z.ZodDefault<z.ZodOptional<z.ZodString>>;
439
+ params: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>;
440
+ }, "strip", z.ZodTypeAny, {
441
+ params: Record<string, string | number | boolean | null>;
442
+ event: string;
443
+ component: string;
444
+ }, {
445
+ event: string;
446
+ params?: Record<string, string | number | boolean | null> | undefined;
447
+ component?: string | undefined;
448
+ }>;
449
+ /**
450
+ * Map of tool name -> argument schema, used by the dispatcher to detect and warn
451
+ * about parameters a caller sent that the tool does not support. Keep in sync
452
+ * with the tool definitions in server.ts.
453
+ */
454
+ export declare const toolArgSchemas: Record<string, z.ZodTypeAny>;
@@ -0,0 +1,242 @@
1
+ import { z } from "zod";
2
+ // Config tools schemas
3
+ export const GetConfigArgsSchema = z.object({
4
+ // 'ui' marks calls the config-editor widget fires programmatically; they are
5
+ // excluded from tool-call telemetry (see isUiOriginCall in server.ts).
6
+ origin: z.enum(['ui', 'llm']).optional(),
7
+ });
8
+ export const SetConfigValueArgsSchema = z.object({
9
+ key: z.string(),
10
+ value: z.union([
11
+ z.string(),
12
+ z.number(),
13
+ z.boolean(),
14
+ z.array(z.string()),
15
+ z.null(),
16
+ ]),
17
+ // 'ui' marks widget-fired calls; excluded from tool-call telemetry.
18
+ origin: z.enum(['ui', 'llm']).optional(),
19
+ });
20
+ // Empty schemas
21
+ export const ListProcessesArgsSchema = z.object({});
22
+ // Terminal tools schemas
23
+ export const StartProcessArgsSchema = z.object({
24
+ command: z.string(),
25
+ timeout_ms: z.number(),
26
+ working_directory: z.string().optional(),
27
+ shell: z.string().optional(),
28
+ verbose_timing: z.boolean().optional(),
29
+ // 'ui' marks widget-fired calls (e.g. open-in-folder/editor buttons);
30
+ // excluded from tool-call telemetry (see isUiOriginCall in server.ts).
31
+ origin: z.enum(['ui', 'llm']).optional(),
32
+ });
33
+ export const ReadProcessOutputArgsSchema = z.object({
34
+ pid: z.number(),
35
+ timeout_ms: z.number().optional(),
36
+ offset: z.number().optional(), // Line offset: 0=from last read, positive=absolute, negative=tail
37
+ length: z.number().optional(), // Max lines to return (default from config.fileReadLineLimit)
38
+ verbose_timing: z.boolean().optional(),
39
+ });
40
+ export const ForceTerminateArgsSchema = z.object({
41
+ pid: z.number(),
42
+ });
43
+ export const ListSessionsArgsSchema = z.object({});
44
+ export const KillProcessArgsSchema = z.object({
45
+ pid: z.number(),
46
+ });
47
+ // Filesystem tools schemas
48
+ export const ReadFileArgsSchema = z.object({
49
+ path: z.string(),
50
+ isUrl: z.boolean().optional().default(false),
51
+ offset: z.number().optional().default(0),
52
+ length: z.number().optional().default(1000),
53
+ sheet: z.string().optional(), // String only for MCP client compatibility (Cursor doesn't support union types in JSON Schema)
54
+ range: z.string().optional(),
55
+ options: z.record(z.any()).optional(),
56
+ // Whether the call came from the file-preview UI (refresh/navigation) or the
57
+ // LLM. 'ui' calls are excluded from tool-call telemetry; see isUiOriginCall
58
+ // in server.ts.
59
+ origin: z.enum(['ui', 'llm']).optional(),
60
+ });
61
+ export const ReadMultipleFilesArgsSchema = z.object({
62
+ paths: z.array(z.string()),
63
+ });
64
+ export const WriteFileArgsSchema = z.object({
65
+ path: z.string(),
66
+ content: z.string(),
67
+ mode: z.enum(['rewrite', 'append']).default('rewrite'),
68
+ // 'ui' when fired by the file-preview UI, else 'llm'. 'ui' calls are
69
+ // excluded from tool-call telemetry; see isUiOriginCall in server.ts.
70
+ origin: z.enum(['ui', 'llm']).optional(),
71
+ });
72
+ // PDF modification schemas - exported for reuse
73
+ export const PdfInsertOperationSchema = z.object({
74
+ type: z.literal('insert'),
75
+ pageIndex: z.number(),
76
+ markdown: z.string().optional(),
77
+ sourcePdfPath: z.string().optional(),
78
+ pdfOptions: z.object({}).passthrough().optional(),
79
+ });
80
+ export const PdfDeleteOperationSchema = z.object({
81
+ type: z.literal('delete'),
82
+ pageIndexes: z.array(z.number()),
83
+ });
84
+ export const PdfOperationSchema = z.union([PdfInsertOperationSchema, PdfDeleteOperationSchema]);
85
+ export const WritePdfArgsSchema = z.object({
86
+ path: z.string(),
87
+ // Preprocess content to handle JSON strings that should be parsed as arrays
88
+ content: z.preprocess((val) => {
89
+ // If it's a string that looks like JSON array, parse it
90
+ if (typeof val === 'string' && val.trim().startsWith('[')) {
91
+ try {
92
+ return JSON.parse(val);
93
+ }
94
+ catch {
95
+ // If parsing fails, return as-is (might be markdown content)
96
+ return val;
97
+ }
98
+ }
99
+ // Otherwise return as-is
100
+ return val;
101
+ }, z.union([z.string(), z.array(PdfOperationSchema)])),
102
+ outputPath: z.string().optional(),
103
+ options: z.object({}).passthrough().optional(), // Allow passing options to md-to-pdf
104
+ });
105
+ export const CreateDirectoryArgsSchema = z.object({
106
+ path: z.string(),
107
+ });
108
+ export const ListDirectoryArgsSchema = z.object({
109
+ path: z.string(),
110
+ depth: z.number().optional().default(2),
111
+ // 'ui' when fired by the file-preview UI, else 'llm'. 'ui' calls are
112
+ // excluded from tool-call telemetry; see isUiOriginCall in server.ts.
113
+ origin: z.enum(['ui', 'llm']).optional(),
114
+ });
115
+ export const MoveFileArgsSchema = z.object({
116
+ source: z.string(),
117
+ destination: z.string(),
118
+ });
119
+ export const GetFileInfoArgsSchema = z.object({
120
+ path: z.string(),
121
+ });
122
+ // Edit tools schema - SIMPLIFIED from three modes to two
123
+ // Previously supported: text replacement, location-based edits (edits array), and range rewrites
124
+ // Now supports only: text replacement and range rewrites
125
+ // Removed 'edits' array parameter - location-based surgical edits were complex and unnecessary
126
+ // Range rewrites are more powerful and cover all structured file editing needs
127
+ export const EditBlockArgsSchema = z.object({
128
+ file_path: z.string(),
129
+ // Text file string replacement
130
+ old_string: z.string().optional(),
131
+ new_string: z.string().optional(),
132
+ expected_replacements: z.number().optional().default(1),
133
+ // Structured file range rewrite (Excel, etc.)
134
+ range: z.string().optional(),
135
+ content: z.any().optional(),
136
+ options: z.record(z.any()).optional(),
137
+ // 'ui' when fired by the file-preview UI, else 'llm'. 'ui' calls are
138
+ // excluded from tool-call telemetry; see isUiOriginCall in server.ts.
139
+ origin: z.enum(['ui', 'llm']).optional(),
140
+ }).refine(data => {
141
+ // Helper to check if value is actually provided (not undefined, not empty string)
142
+ const hasValue = (v) => v !== undefined && v !== '';
143
+ return (hasValue(data.old_string) && data.new_string !== undefined) ||
144
+ (hasValue(data.range) && hasValue(data.content));
145
+ }, { message: "Must provide either (old_string + new_string) or (range + content)" });
146
+ // Send input to process schema
147
+ export const InteractWithProcessArgsSchema = z.object({
148
+ pid: z.number(),
149
+ input: z.string(),
150
+ timeout_ms: z.number().optional(),
151
+ wait_for_prompt: z.boolean().optional(),
152
+ verbose_timing: z.boolean().optional(),
153
+ });
154
+ // Usage stats schema
155
+ export const GetUsageStatsArgsSchema = z.object({});
156
+ // Feedback tool schema - no pre-filled parameters, all user input
157
+ export const GiveFeedbackArgsSchema = z.object({
158
+ // No parameters needed - form will be filled manually by user
159
+ // Only auto-filled hidden fields remain:
160
+ // - tool_call_count (auto)
161
+ // - days_using (auto)
162
+ // - platform (auto)
163
+ // - client_id (auto)
164
+ });
165
+ // Search schemas (renamed for natural language)
166
+ export const StartSearchArgsSchema = z.object({
167
+ path: z.string(),
168
+ pattern: z.string(),
169
+ searchType: z.enum(['files', 'content']).default('files'),
170
+ filePattern: z.string().optional(),
171
+ ignoreCase: z.boolean().optional().default(true),
172
+ maxResults: z.number().optional(),
173
+ includeHidden: z.boolean().optional().default(false),
174
+ contextLines: z.number().optional().default(5),
175
+ timeout_ms: z.number().optional(), // Match process naming convention
176
+ earlyTermination: z.boolean().optional(), // Stop search early when exact filename match is found (default: true for files, false for content)
177
+ literalSearch: z.boolean().optional().default(false), // Force literal string matching (-F flag) instead of regex
178
+ // 'ui' marks widget-fired calls (e.g. markdown link-target search);
179
+ // excluded from tool-call telemetry (see isUiOriginCall in server.ts).
180
+ origin: z.enum(['ui', 'llm']).optional(),
181
+ });
182
+ export const GetMoreSearchResultsArgsSchema = z.object({
183
+ sessionId: z.string(),
184
+ offset: z.number().optional().default(0), // Same as file reading
185
+ length: z.number().optional().default(100), // Same as file reading (but smaller default)
186
+ });
187
+ export const StopSearchArgsSchema = z.object({
188
+ sessionId: z.string(),
189
+ });
190
+ export const ListSearchesArgsSchema = z.object({});
191
+ // Prompts tool schema - SIMPLIFIED (only get_prompt action)
192
+ export const GetPromptsArgsSchema = z.object({
193
+ action: z.enum(['get_prompt']),
194
+ promptId: z.string(),
195
+ // Disabled to check if it makes sense or should be removed or changed
196
+ // anonymous_user_use_case: z.string().optional(),
197
+ });
198
+ // Tool history schema
199
+ export const GetRecentToolCallsArgsSchema = z.object({
200
+ maxResults: z.number().min(1).max(1000).optional().default(50),
201
+ toolName: z.string().optional(),
202
+ since: z.string().datetime().optional(),
203
+ });
204
+ export const TrackUiEventArgsSchema = z.object({
205
+ event: z.string().min(1).max(80),
206
+ component: z.string().optional().default('file_preview'),
207
+ params: z.record(z.union([z.string(), z.number(), z.boolean(), z.null()])).optional().default({}),
208
+ });
209
+ /**
210
+ * Map of tool name -> argument schema, used by the dispatcher to detect and warn
211
+ * about parameters a caller sent that the tool does not support. Keep in sync
212
+ * with the tool definitions in server.ts.
213
+ */
214
+ export const toolArgSchemas = {
215
+ get_config: GetConfigArgsSchema,
216
+ set_config_value: SetConfigValueArgsSchema,
217
+ read_file: ReadFileArgsSchema,
218
+ read_multiple_files: ReadMultipleFilesArgsSchema,
219
+ write_file: WriteFileArgsSchema,
220
+ write_pdf: WritePdfArgsSchema,
221
+ create_directory: CreateDirectoryArgsSchema,
222
+ list_directory: ListDirectoryArgsSchema,
223
+ move_file: MoveFileArgsSchema,
224
+ start_search: StartSearchArgsSchema,
225
+ get_more_search_results: GetMoreSearchResultsArgsSchema,
226
+ stop_search: StopSearchArgsSchema,
227
+ list_searches: ListSearchesArgsSchema,
228
+ get_file_info: GetFileInfoArgsSchema,
229
+ edit_block: EditBlockArgsSchema,
230
+ start_process: StartProcessArgsSchema,
231
+ read_process_output: ReadProcessOutputArgsSchema,
232
+ interact_with_process: InteractWithProcessArgsSchema,
233
+ force_terminate: ForceTerminateArgsSchema,
234
+ list_sessions: ListSessionsArgsSchema,
235
+ list_processes: ListProcessesArgsSchema,
236
+ kill_process: KillProcessArgsSchema,
237
+ get_usage_stats: GetUsageStatsArgsSchema,
238
+ get_recent_tool_calls: GetRecentToolCallsArgsSchema,
239
+ give_feedback_to_desktop_commander: GiveFeedbackArgsSchema,
240
+ get_prompts: GetPromptsArgsSchema,
241
+ track_ui_event: TrackUiEventArgsSchema,
242
+ };