@remnux/mcp-server 0.1.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 (220) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +720 -0
  3. package/dist/archive-extractor.d.ts +46 -0
  4. package/dist/archive-extractor.d.ts.map +1 -0
  5. package/dist/archive-extractor.js +268 -0
  6. package/dist/archive-extractor.js.map +1 -0
  7. package/dist/catalog/index.d.ts +40 -0
  8. package/dist/catalog/index.d.ts.map +1 -0
  9. package/dist/catalog/index.js +114 -0
  10. package/dist/catalog/index.js.map +1 -0
  11. package/dist/cli.d.ts +3 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +154 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/config/archive-passwords.txt +3 -0
  16. package/dist/connectors/docker.d.ts +13 -0
  17. package/dist/connectors/docker.d.ts.map +1 -0
  18. package/dist/connectors/docker.js +201 -0
  19. package/dist/connectors/docker.js.map +1 -0
  20. package/dist/connectors/index.d.ts +27 -0
  21. package/dist/connectors/index.d.ts.map +1 -0
  22. package/dist/connectors/index.js +23 -0
  23. package/dist/connectors/index.js.map +1 -0
  24. package/dist/connectors/local.d.ts +10 -0
  25. package/dist/connectors/local.d.ts.map +1 -0
  26. package/dist/connectors/local.js +105 -0
  27. package/dist/connectors/local.js.map +1 -0
  28. package/dist/connectors/ssh.d.ts +21 -0
  29. package/dist/connectors/ssh.d.ts.map +1 -0
  30. package/dist/connectors/ssh.js +237 -0
  31. package/dist/connectors/ssh.js.map +1 -0
  32. package/dist/errors/error-mapper.d.ts +9 -0
  33. package/dist/errors/error-mapper.d.ts.map +1 -0
  34. package/dist/errors/error-mapper.js +24 -0
  35. package/dist/errors/error-mapper.js.map +1 -0
  36. package/dist/errors/remnux-error.d.ts +14 -0
  37. package/dist/errors/remnux-error.d.ts.map +1 -0
  38. package/dist/errors/remnux-error.js +19 -0
  39. package/dist/errors/remnux-error.js.map +1 -0
  40. package/dist/file-type-mappings.d.ts +30 -0
  41. package/dist/file-type-mappings.d.ts.map +1 -0
  42. package/dist/file-type-mappings.js +136 -0
  43. package/dist/file-type-mappings.js.map +1 -0
  44. package/dist/file-upload.d.ts +44 -0
  45. package/dist/file-upload.d.ts.map +1 -0
  46. package/dist/file-upload.js +170 -0
  47. package/dist/file-upload.js.map +1 -0
  48. package/dist/handlers/analyze-file.d.ts +10 -0
  49. package/dist/handlers/analyze-file.d.ts.map +1 -0
  50. package/dist/handlers/analyze-file.js +149 -0
  51. package/dist/handlers/analyze-file.js.map +1 -0
  52. package/dist/handlers/check-tools.d.ts +9 -0
  53. package/dist/handlers/check-tools.d.ts.map +1 -0
  54. package/dist/handlers/check-tools.js +47 -0
  55. package/dist/handlers/check-tools.js.map +1 -0
  56. package/dist/handlers/download-file.d.ts +10 -0
  57. package/dist/handlers/download-file.d.ts.map +1 -0
  58. package/dist/handlers/download-file.js +113 -0
  59. package/dist/handlers/download-file.js.map +1 -0
  60. package/dist/handlers/download-from-url.d.ts +30 -0
  61. package/dist/handlers/download-from-url.d.ts.map +1 -0
  62. package/dist/handlers/download-from-url.js +295 -0
  63. package/dist/handlers/download-from-url.js.map +1 -0
  64. package/dist/handlers/extract-archive.d.ts +10 -0
  65. package/dist/handlers/extract-archive.d.ts.map +1 -0
  66. package/dist/handlers/extract-archive.js +57 -0
  67. package/dist/handlers/extract-archive.js.map +1 -0
  68. package/dist/handlers/extract-iocs.d.ts +10 -0
  69. package/dist/handlers/extract-iocs.d.ts.map +1 -0
  70. package/dist/handlers/extract-iocs.js +21 -0
  71. package/dist/handlers/extract-iocs.js.map +1 -0
  72. package/dist/handlers/get-file-info.d.ts +10 -0
  73. package/dist/handlers/get-file-info.d.ts.map +1 -0
  74. package/dist/handlers/get-file-info.js +89 -0
  75. package/dist/handlers/get-file-info.js.map +1 -0
  76. package/dist/handlers/list-files.d.ts +10 -0
  77. package/dist/handlers/list-files.d.ts.map +1 -0
  78. package/dist/handlers/list-files.js +60 -0
  79. package/dist/handlers/list-files.js.map +1 -0
  80. package/dist/handlers/run-tool.d.ts +10 -0
  81. package/dist/handlers/run-tool.d.ts.map +1 -0
  82. package/dist/handlers/run-tool.js +99 -0
  83. package/dist/handlers/run-tool.js.map +1 -0
  84. package/dist/handlers/suggest-tools.d.ts +10 -0
  85. package/dist/handlers/suggest-tools.d.ts.map +1 -0
  86. package/dist/handlers/suggest-tools.js +202 -0
  87. package/dist/handlers/suggest-tools.js.map +1 -0
  88. package/dist/handlers/types.d.ts +15 -0
  89. package/dist/handlers/types.d.ts.map +1 -0
  90. package/dist/handlers/types.js +2 -0
  91. package/dist/handlers/types.js.map +1 -0
  92. package/dist/handlers/upload-file.d.ts +10 -0
  93. package/dist/handlers/upload-file.d.ts.map +1 -0
  94. package/dist/handlers/upload-file.js +33 -0
  95. package/dist/handlers/upload-file.js.map +1 -0
  96. package/dist/handlers/upload-from-host.d.ts +10 -0
  97. package/dist/handlers/upload-from-host.d.ts.map +1 -0
  98. package/dist/handlers/upload-from-host.js +33 -0
  99. package/dist/handlers/upload-from-host.js.map +1 -0
  100. package/dist/handlers/upload-sample.d.ts +10 -0
  101. package/dist/handlers/upload-sample.d.ts.map +1 -0
  102. package/dist/handlers/upload-sample.js +26 -0
  103. package/dist/handlers/upload-sample.js.map +1 -0
  104. package/dist/index.d.ts +15 -0
  105. package/dist/index.d.ts.map +1 -0
  106. package/dist/index.js +254 -0
  107. package/dist/index.js.map +1 -0
  108. package/dist/ioc/extractor.d.ts +21 -0
  109. package/dist/ioc/extractor.d.ts.map +1 -0
  110. package/dist/ioc/extractor.js +91 -0
  111. package/dist/ioc/extractor.js.map +1 -0
  112. package/dist/ioc/known-values.d.ts +7 -0
  113. package/dist/ioc/known-values.d.ts.map +1 -0
  114. package/dist/ioc/known-values.js +43 -0
  115. package/dist/ioc/known-values.js.map +1 -0
  116. package/dist/ioc/noise.d.ts +6 -0
  117. package/dist/ioc/noise.d.ts.map +1 -0
  118. package/dist/ioc/noise.js +170 -0
  119. package/dist/ioc/noise.js.map +1 -0
  120. package/dist/ioc/patterns.d.ts +10 -0
  121. package/dist/ioc/patterns.d.ts.map +1 -0
  122. package/dist/ioc/patterns.js +65 -0
  123. package/dist/ioc/patterns.js.map +1 -0
  124. package/dist/ioc/scoring.d.ts +6 -0
  125. package/dist/ioc/scoring.d.ts.map +1 -0
  126. package/dist/ioc/scoring.js +69 -0
  127. package/dist/ioc/scoring.js.map +1 -0
  128. package/dist/parsers/capa.d.ts +9 -0
  129. package/dist/parsers/capa.d.ts.map +1 -0
  130. package/dist/parsers/capa.js +55 -0
  131. package/dist/parsers/capa.js.map +1 -0
  132. package/dist/parsers/diec.d.ts +9 -0
  133. package/dist/parsers/diec.d.ts.map +1 -0
  134. package/dist/parsers/diec.js +53 -0
  135. package/dist/parsers/diec.js.map +1 -0
  136. package/dist/parsers/floss.d.ts +14 -0
  137. package/dist/parsers/floss.d.ts.map +1 -0
  138. package/dist/parsers/floss.js +89 -0
  139. package/dist/parsers/floss.js.map +1 -0
  140. package/dist/parsers/index.d.ts +16 -0
  141. package/dist/parsers/index.d.ts.map +1 -0
  142. package/dist/parsers/index.js +46 -0
  143. package/dist/parsers/index.js.map +1 -0
  144. package/dist/parsers/oleid.d.ts +8 -0
  145. package/dist/parsers/oleid.d.ts.map +1 -0
  146. package/dist/parsers/oleid.js +94 -0
  147. package/dist/parsers/oleid.js.map +1 -0
  148. package/dist/parsers/olevba.d.ts +8 -0
  149. package/dist/parsers/olevba.d.ts.map +1 -0
  150. package/dist/parsers/olevba.js +83 -0
  151. package/dist/parsers/olevba.js.map +1 -0
  152. package/dist/parsers/passthrough.d.ts +6 -0
  153. package/dist/parsers/passthrough.d.ts.map +1 -0
  154. package/dist/parsers/passthrough.js +13 -0
  155. package/dist/parsers/passthrough.js.map +1 -0
  156. package/dist/parsers/pdf-parser.d.ts +9 -0
  157. package/dist/parsers/pdf-parser.d.ts.map +1 -0
  158. package/dist/parsers/pdf-parser.js +76 -0
  159. package/dist/parsers/pdf-parser.js.map +1 -0
  160. package/dist/parsers/pdfid.d.ts +9 -0
  161. package/dist/parsers/pdfid.d.ts.map +1 -0
  162. package/dist/parsers/pdfid.js +56 -0
  163. package/dist/parsers/pdfid.js.map +1 -0
  164. package/dist/parsers/peframe.d.ts +8 -0
  165. package/dist/parsers/peframe.d.ts.map +1 -0
  166. package/dist/parsers/peframe.js +76 -0
  167. package/dist/parsers/peframe.js.map +1 -0
  168. package/dist/parsers/readelf.d.ts +8 -0
  169. package/dist/parsers/readelf.d.ts.map +1 -0
  170. package/dist/parsers/readelf.js +50 -0
  171. package/dist/parsers/readelf.js.map +1 -0
  172. package/dist/parsers/types.d.ts +30 -0
  173. package/dist/parsers/types.d.ts.map +1 -0
  174. package/dist/parsers/types.js +5 -0
  175. package/dist/parsers/types.js.map +1 -0
  176. package/dist/parsers/yara.d.ts +8 -0
  177. package/dist/parsers/yara.d.ts.map +1 -0
  178. package/dist/parsers/yara.js +88 -0
  179. package/dist/parsers/yara.js.map +1 -0
  180. package/dist/response.d.ts +44 -0
  181. package/dist/response.d.ts.map +1 -0
  182. package/dist/response.js +48 -0
  183. package/dist/response.js.map +1 -0
  184. package/dist/schemas/tools.d.ts +135 -0
  185. package/dist/schemas/tools.d.ts.map +1 -0
  186. package/dist/schemas/tools.js +53 -0
  187. package/dist/schemas/tools.js.map +1 -0
  188. package/dist/security/blocklist.d.ts +69 -0
  189. package/dist/security/blocklist.d.ts.map +1 -0
  190. package/dist/security/blocklist.js +148 -0
  191. package/dist/security/blocklist.js.map +1 -0
  192. package/dist/state/session.d.ts +35 -0
  193. package/dist/state/session.d.ts.map +1 -0
  194. package/dist/state/session.js +45 -0
  195. package/dist/state/session.js.map +1 -0
  196. package/dist/tools/definitions.d.ts +9 -0
  197. package/dist/tools/definitions.d.ts.map +1 -0
  198. package/dist/tools/definitions.js +708 -0
  199. package/dist/tools/definitions.js.map +1 -0
  200. package/dist/tools/invoker.d.ts +17 -0
  201. package/dist/tools/invoker.d.ts.map +1 -0
  202. package/dist/tools/invoker.js +44 -0
  203. package/dist/tools/invoker.js.map +1 -0
  204. package/dist/tools/registry.d.ts +62 -0
  205. package/dist/tools/registry.d.ts.map +1 -0
  206. package/dist/tools/registry.js +53 -0
  207. package/dist/tools/registry.js.map +1 -0
  208. package/dist/workflows/engine.d.ts +27 -0
  209. package/dist/workflows/engine.d.ts.map +1 -0
  210. package/dist/workflows/engine.js +224 -0
  211. package/dist/workflows/engine.js.map +1 -0
  212. package/dist/workflows/loader.d.ts +33 -0
  213. package/dist/workflows/loader.d.ts.map +1 -0
  214. package/dist/workflows/loader.js +130 -0
  215. package/dist/workflows/loader.js.map +1 -0
  216. package/dist/workflows/types.d.ts +109 -0
  217. package/dist/workflows/types.d.ts.map +1 -0
  218. package/dist/workflows/types.js +5 -0
  219. package/dist/workflows/types.js.map +1 -0
  220. package/package.json +68 -0
@@ -0,0 +1,10 @@
1
+ import type { HandlerDeps } from "./types.js";
2
+ import type { RunToolArgs } from "../schemas/tools.js";
3
+ export declare function handleRunTool(deps: HandlerDeps, args: RunToolArgs): Promise<{
4
+ content: Array<{
5
+ type: "text";
6
+ text: string;
7
+ }>;
8
+ isError?: boolean;
9
+ }>;
10
+ //# sourceMappingURL=run-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-tool.d.ts","sourceRoot":"","sources":["../../src/handlers/run-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQvD,wBAAsB,aAAa,CACjC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,WAAW;;;;;;GA2FlB"}
@@ -0,0 +1,99 @@
1
+ import { validateFilePath, isCommandSafe } from "../security/blocklist.js";
2
+ import { formatResponse, formatError } from "../response.js";
3
+ import { REMnuxError } from "../errors/remnux-error.js";
4
+ import { toREMnuxError } from "../errors/error-mapper.js";
5
+ import { parseToolOutput, hasParser } from "../parsers/index.js";
6
+ import { toolRegistry } from "../tools/registry.js";
7
+ export async function handleRunTool(deps, args) {
8
+ const startTime = Date.now();
9
+ const { connector, config } = deps;
10
+ // Build full command
11
+ let fullCommand = args.command;
12
+ if (args.input_file) {
13
+ // Validate input file path (skip unless --sandbox)
14
+ if (!config.noSandbox) {
15
+ const pathValidation = validateFilePath(args.input_file, config.samplesDir);
16
+ if (!pathValidation.safe) {
17
+ return formatError("run_tool", new REMnuxError(pathValidation.error || "Invalid input file path", "INVALID_PATH", "validation", "Use a relative path within the samples directory"), startTime);
18
+ }
19
+ }
20
+ // Append quoted file path to command (single-quotes prevent shell expansion)
21
+ // Escape any single quotes in the path as defense-in-depth (isPathSafe also rejects them)
22
+ const escapedFile = args.input_file.replace(/'/g, "'\\''");
23
+ fullCommand = `${args.command} '${config.samplesDir}/${escapedFile}'`;
24
+ }
25
+ // Security: Validate command against blocklist
26
+ const validation = isCommandSafe(fullCommand);
27
+ if (!validation.safe) {
28
+ return formatError("run_tool", new REMnuxError(validation.error || "Command blocked", "COMMAND_BLOCKED", "security", "This command is blocked for security reasons. Use an allowed tool instead."), startTime);
29
+ }
30
+ const MAX_STDOUT_RESPONSE = 100 * 1024; // 100KB — fits in LLM context
31
+ const MAX_STDERR_RESPONSE = 50 * 1024;
32
+ try {
33
+ const result = await connector.executeShell(fullCommand, {
34
+ timeout: (args.timeout || config.timeout) * 1000,
35
+ cwd: config.samplesDir,
36
+ });
37
+ let stdout = result.stdout || "";
38
+ let stderr = result.stderr || "";
39
+ // Filter Volatility 3 progress bar noise from stderr
40
+ stderr = stderr.replace(/^Progress:\s+[\d.]+\s+.*$/gm, "").trim();
41
+ let truncated = false;
42
+ const fullStdoutLength = stdout.length;
43
+ if (stdout.length > MAX_STDOUT_RESPONSE) {
44
+ stdout = stdout.slice(0, MAX_STDOUT_RESPONSE);
45
+ truncated = true;
46
+ }
47
+ if (stderr.length > MAX_STDERR_RESPONSE) {
48
+ stderr = stderr.slice(0, MAX_STDERR_RESPONSE);
49
+ truncated = true;
50
+ }
51
+ // Auto-parse output if command matches a known tool with a parser
52
+ let findings;
53
+ let parsedMetadata;
54
+ const toolName = detectToolName(fullCommand);
55
+ if (toolName && hasParser(toolName) && stdout) {
56
+ const parsed = parseToolOutput(toolName, stdout);
57
+ if (parsed.parsed) {
58
+ findings = parsed.findings;
59
+ parsedMetadata = parsed.metadata;
60
+ }
61
+ }
62
+ return formatResponse("run_tool", {
63
+ command: fullCommand,
64
+ stdout,
65
+ stderr,
66
+ exit_code: result.exitCode,
67
+ truncated,
68
+ ...(truncated && {
69
+ truncation_notice: "Output exceeded response size limit. Use 'run_tool' with '| head -N' or redirect to a file for full output.",
70
+ full_stdout_length: fullStdoutLength,
71
+ }),
72
+ ...(findings && { findings, parsed_metadata: parsedMetadata }),
73
+ }, startTime);
74
+ }
75
+ catch (error) {
76
+ return formatError("run_tool", toREMnuxError(error), startTime);
77
+ }
78
+ }
79
+ /**
80
+ * Detect the parser-registered tool name from a command string.
81
+ * Extracts the base command name (strips path and .py suffix),
82
+ * then finds a registry definition whose command matches AND has a parser.
83
+ */
84
+ function detectToolName(command) {
85
+ const firstWord = command.split(/\s/)[0];
86
+ // Strip path prefix (/usr/bin/olevba → olevba) and .py suffix
87
+ const baseCmd = firstWord.replace(/^.*\//, "").replace(/\.py$/, "");
88
+ // Check registry definitions that have a parser
89
+ for (const def of toolRegistry.all()) {
90
+ if (def.command === baseCmd && hasParser(def.name)) {
91
+ return def.name;
92
+ }
93
+ }
94
+ // Direct parser name match (e.g. command name IS the parser key)
95
+ if (hasParser(baseCmd))
96
+ return baseCmd;
97
+ return undefined;
98
+ }
99
+ //# sourceMappingURL=run-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-tool.js","sourceRoot":"","sources":["../../src/handlers/run-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;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AG,EAAE,EAAE,CAAC;QACrC,IAAI,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,OAAO,GAAG,CAAC,IAAI,CAAC;QAClB,CAAC;IACH,CAAC;IACD,iEAAiE;IACjE,IAAI,SAAS,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACvC,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { HandlerDeps } from "./types.js";
2
+ import type { SuggestToolsArgs } from "../schemas/tools.js";
3
+ export declare function handleSuggestTools(deps: HandlerDeps, args: SuggestToolsArgs): Promise<{
4
+ content: Array<{
5
+ type: "text";
6
+ text: string;
7
+ }>;
8
+ isError?: boolean;
9
+ }>;
10
+ //# sourceMappingURL=suggest-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggest-tools.d.ts","sourceRoot":"","sources":["../../src/handlers/suggest-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA8J5D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,gBAAgB;;;;;;GA8FvB"}
@@ -0,0 +1,202 @@
1
+ import { validateFilePath } from "../security/blocklist.js";
2
+ import { matchFileType, CATEGORY_TAG_MAP } from "../file-type-mappings.js";
3
+ import { toolRegistry } from "../tools/registry.js";
4
+ import { formatResponse, formatError } from "../response.js";
5
+ import { REMnuxError } from "../errors/remnux-error.js";
6
+ import { toREMnuxError } from "../errors/error-mapper.js";
7
+ /**
8
+ * Base per-category expert guidance for the AI agent.
9
+ */
10
+ const BASE_HINTS = {
11
+ DOTNET: "Start with peframe and diec for triage. diec detects packers/protectors. " +
12
+ "ilspycmd decompiles .NET to C# source. " +
13
+ "capa identifies capabilities like C2, persistence, or file manipulation.",
14
+ PE: "Start with peframe and diec for triage — diec detects packers and compilers. " +
15
+ "capa maps capabilities to MITRE ATT&CK. floss extracts obfuscated strings. " +
16
+ "For deep analysis, pedump shows raw PE structure and brxor bruteforces XOR-encoded strings.",
17
+ PDF: "Start with pdfid to identify suspicious elements (/JS, /JavaScript, /OpenAction, /Launch). " +
18
+ "Use pdf-parser --stats for structural overview. If suspicious objects found, " +
19
+ "extract them with pdf-parser -o <obj_id> -d. peepdf-3 provides interactive deep analysis. " +
20
+ "qpdf decrypts permission-locked PDFs. pdftk extracts metadata and document info.",
21
+ OLE2: "Start with oleid for risk indicators (macros, encryption, external links). " +
22
+ "olevba extracts and analyzes VBA macros — look for auto-execute triggers and suspicious keywords. " +
23
+ "oledump lists OLE streams; use -s <stream> -v to dump specific macro streams. " +
24
+ "pcodedmp disassembles VBA p-code (useful when source is stomped). " +
25
+ "xlmdeobfuscator handles Excel 4.0 XLM macros.",
26
+ OOXML: "olevba handles both OLE2 and OOXML macro extraction. " +
27
+ "zipdump lists the ZIP structure — OOXML files are ZIP archives with XML inside. " +
28
+ "Look for unusual entries or embedded OLE objects within the archive. " +
29
+ "pcodedmp disassembles VBA p-code. xlmdeobfuscator deobfuscates Excel 4.0 XLM macros.",
30
+ RTF: "rtfobj extracts embedded objects (OLE, packages) from RTF files. " +
31
+ "rtfdump analyzes RTF structure and can reveal obfuscated content. " +
32
+ "Look for embedded executables, shellcode, or CVE exploits in objects.",
33
+ ELF: "readelf -h shows ELF header (type, arch, entry point). " +
34
+ "readelf -S lists sections — look for unusual section names or sizes. " +
35
+ "capa detects capabilities in ELF binaries similar to PE analysis.",
36
+ Script: "strings extracts readable content for quick triage. " +
37
+ "js-beautify reformats and deobfuscates JavaScript — look for eval(), " +
38
+ "document.write(), String.fromCharCode(), and unescape() patterns. " +
39
+ "base64dump finds and decodes Base64 and other encoded strings — " +
40
+ "common in PowerShell, bash, and JavaScript malware. " +
41
+ "box-js analyzes and deobfuscates JavaScript malware in a sandbox environment. " +
42
+ "For heavily obfuscated JS, consider manual deobfuscation with run_tool after reviewing js-beautify output.",
43
+ JAR: "zipdump lists the JAR archive contents (JAR files are ZIP format). " +
44
+ "Look for unusual class files, embedded resources, or manifest entries. " +
45
+ "exiftool reveals metadata about the archive.",
46
+ Email: "emldump analyzes EML structure and extracts attachments. " +
47
+ "msgconvert converts Outlook MSG files to EML format for analysis with emldump. " +
48
+ "Look for suspicious attachments, embedded URLs, and header anomalies. " +
49
+ "Extract attachments for further analysis with appropriate tools.",
50
+ APK: "apktool decompiles the APK to smali and extracts resources. " +
51
+ "droidlysis performs static analysis identifying permissions, API calls, and risk indicators. " +
52
+ "Look for excessive permissions, obfuscation, and suspicious network activity.",
53
+ OneNote: "OneNote file detected. No dedicated OneNote tools are currently available in REMnux. " +
54
+ "Use strings and exiftool for basic triage. Use run_tool to manually extract embedded objects. " +
55
+ "OneNote files may contain embedded scripts, executables, or malicious attachments.",
56
+ Shellcode: "Raw shellcode detected. scdbgc provides fast Win32 API call tracing (x86 only). " +
57
+ "speakeasy emulates both x86 and x64 shellcode with Windows API emulation. " +
58
+ "Look for resolved API names, network connections, file system access, and registry modifications in emulation output. " +
59
+ "For deep analysis, qltool (Qiling) provides multi-platform emulation and tracesc traces execution via Wine. " +
60
+ "Use strings and xorsearch for static indicators before emulation.",
61
+ Memory: "Memory image detected. Start with vol3-info to identify OS and kernel version. " +
62
+ "vol3-pslist and vol3-pstree reveal running processes; vol3-psscan finds hidden/unlinked processes. " +
63
+ "vol3-netscan shows network connections. vol3-cmdline extracts process arguments. " +
64
+ "vol3-dlllist shows loaded DLLs. vol3-filescan finds file objects. vol3-hivelist lists registry hives. " +
65
+ "For deeper analysis, vol3-malfind detects injected code and vol3-handles lists open handles. " +
66
+ "For Linux memory images, use vol3-linux-pslist.",
67
+ Unknown: "File type not recognized. strings and exiftool provide basic triage. " +
68
+ "base64dump searches for encoded content. xorsearch tries common XOR keys. " +
69
+ "translate.py applies byte-level transforms (XOR, shift). re-search.py extracts regex patterns. " +
70
+ "file-magic.py identifies embedded file types. numbers-to-string.py decodes numeric payloads. " +
71
+ "Consider using 'file' or 'diec' via run_tool for deeper type identification.",
72
+ };
73
+ /** Extract observable properties from `file` command output. */
74
+ function extractFileProperties(fileOutput) {
75
+ const lower = fileOutput.toLowerCase();
76
+ const props = {};
77
+ if (/upx/i.test(fileOutput))
78
+ props.packed = "UPX";
79
+ else if (/aspack/i.test(fileOutput))
80
+ props.packed = "ASPack";
81
+ else if (/pecompact/i.test(fileOutput))
82
+ props.packed = "PECompact";
83
+ else if (/themida/i.test(fileOutput))
84
+ props.packed = "Themida";
85
+ if (lower.includes(".net") || lower.includes("mono/") || lower.includes("msil")) {
86
+ props.isDotNet = true;
87
+ }
88
+ if (lower.includes("(dll)") || lower.includes("dll ")) {
89
+ props.isDll = true;
90
+ }
91
+ if (/purebasic/i.test(fileOutput))
92
+ props.compiler = "PureBasic";
93
+ else if (/masm/i.test(fileOutput))
94
+ props.compiler = "MASM";
95
+ else if (/delphi/i.test(fileOutput))
96
+ props.compiler = "Delphi";
97
+ else if (/autoit/i.test(fileOutput))
98
+ props.compiler = "AutoIt";
99
+ return props;
100
+ }
101
+ /** Generate dynamic hints by augmenting base hints with property-specific guidance. */
102
+ function generateHints(category, fileOutput) {
103
+ const base = BASE_HINTS[category] ?? BASE_HINTS.Unknown;
104
+ const props = extractFileProperties(fileOutput);
105
+ const extras = [];
106
+ if (props.packed) {
107
+ extras.push(`Packer detected: ${props.packed}. ` +
108
+ "capa and floss results may be limited on packed samples. " +
109
+ (props.packed === "UPX"
110
+ ? "UPX can be unpacked with the upx-decompress tool — recommend unpacking then re-analyzing."
111
+ : "No standard unpacker available; expect partial static analysis results."));
112
+ }
113
+ if (props.isDotNet) {
114
+ extras.push("Detected .NET assembly — ilspycmd decompilation recommended for source-level analysis.");
115
+ }
116
+ if (props.isDll) {
117
+ extras.push("DLL detected — check exports with `pedump --exports` for entry point analysis.");
118
+ }
119
+ if (props.compiler) {
120
+ extras.push(`Unusual compiler: ${props.compiler}. This may indicate specialized tooling or uncommon origin.`);
121
+ }
122
+ if (extras.length === 0)
123
+ return base;
124
+ return base + "\n\nAdditional notes: " + extras.join(" ");
125
+ }
126
+ export async function handleSuggestTools(deps, args) {
127
+ const startTime = Date.now();
128
+ try {
129
+ const { connector, config } = deps;
130
+ const depth = (args.depth ?? "standard");
131
+ // Validate file path (skip unless --sandbox)
132
+ if (!config.noSandbox) {
133
+ const validation = validateFilePath(args.file, config.samplesDir);
134
+ if (!validation.safe) {
135
+ return formatError("suggest_tools", new REMnuxError(validation.error || "Invalid file path", "INVALID_PATH", "validation", "Use a relative path within the samples directory"), startTime);
136
+ }
137
+ }
138
+ const filePath = `${config.samplesDir}/${args.file}`;
139
+ // Detect file type
140
+ let fileOutput;
141
+ try {
142
+ const result = await connector.execute(["file", filePath], { timeout: 30000 });
143
+ fileOutput = result.stdout?.trim() || "";
144
+ if (!fileOutput) {
145
+ return formatError("suggest_tools", new REMnuxError("Could not determine file type (empty `file` output)", "EMPTY_OUTPUT", "tool_failure", "Check that the file exists and is readable"), startTime);
146
+ }
147
+ }
148
+ catch (error) {
149
+ const msg = `Error running file command: ${error instanceof Error ? error.message : "Unknown error"}`;
150
+ return formatError("suggest_tools", new REMnuxError(msg, "EMPTY_OUTPUT", "tool_failure", "Check that the file exists and is readable"), startTime);
151
+ }
152
+ // Match category and get tools from registry
153
+ const category = matchFileType(fileOutput, args.file);
154
+ const primaryTag = CATEGORY_TAG_MAP[category.name] ?? "fallback";
155
+ const tools = toolRegistry.byTagAndTier(primaryTag, depth);
156
+ // Check tool availability (batch all unique commands in one shell call)
157
+ const uniqueCommands = [...new Set(tools.map((t) => t.command))];
158
+ const availableCommands = new Set();
159
+ if (uniqueCommands.length > 0) {
160
+ try {
161
+ // Single shell call: check all commands at once
162
+ const checks = uniqueCommands.map((c) => `which ${c} >/dev/null 2>&1 && echo "${c}"`).join("; ");
163
+ const check = await connector.executeShell(checks, {
164
+ timeout: 10000,
165
+ cwd: config.samplesDir,
166
+ });
167
+ for (const line of (check.stdout || "").split("\n")) {
168
+ const cmd = line.trim();
169
+ if (cmd)
170
+ availableCommands.add(cmd);
171
+ }
172
+ }
173
+ catch {
174
+ // On failure, assume all available (graceful degradation)
175
+ for (const c of uniqueCommands)
176
+ availableCommands.add(c);
177
+ }
178
+ }
179
+ const recommended = tools.map((t) => ({
180
+ name: t.name,
181
+ description: t.description,
182
+ tier: t.tier,
183
+ tags: t.tags ?? [],
184
+ ...(availableCommands.has(t.command) ? {} : { available: false }),
185
+ }));
186
+ return formatResponse("suggest_tools", {
187
+ file: args.file,
188
+ detected_type: fileOutput,
189
+ matched_category: category.name,
190
+ depth,
191
+ recommended_tools: recommended,
192
+ ...(recommended.length === 0 && {
193
+ warning: `No tools registered for category "${category.name}" at depth "${depth}". Try depth "deep" or use run_tool directly.`,
194
+ }),
195
+ analysis_hints: generateHints(category.name, fileOutput),
196
+ }, startTime);
197
+ }
198
+ catch (error) {
199
+ return formatError("suggest_tools", toREMnuxError(error), startTime);
200
+ }
201
+ }
202
+ //# sourceMappingURL=suggest-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggest-tools.js","sourceRoot":"","sources":["../../src/handlers/suggest-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,GAA2B;IACzC,MAAM,EACJ,2EAA2E;QAC3E,yCAAyC;QACzC,0EAA0E;IAC5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AAE,CAAC,CAAC,WAAW;YAC1B,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;YAClB,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAc,EAAE,CAAC;SAC3E,CAAC,CAAC,CAAC;QAEJ,OAAO,cAAc,CAAC,eAAe,EAAE;YACrC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,aAAa,EAAE,UAAU;YACzB,gBAAgB,EAAE,QAAQ,CAAC,IAAI;YAC/B,KAAK;YACL,iBAAiB,EAAE,WAAW;YAC9B,GAAG,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI;gBAC9B,OAAO,EAAE,qCAAqC,QAAQ,CAAC,IAAI,eAAe,KAAK,+CAA+C;aAC/H,CAAC;YACF,cAAc,EAAE,aAAa,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;SACzD,EAAE,SAAS,CAAC,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,WAAW,CAAC,eAAe,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Connector } from "../connectors/index.js";
2
+ import type { SessionState } from "../state/session.js";
3
+ export interface HandlerConfig {
4
+ samplesDir: string;
5
+ outputDir: string;
6
+ timeout: number;
7
+ noSandbox: boolean;
8
+ mode: "docker" | "ssh" | "local";
9
+ }
10
+ export interface HandlerDeps {
11
+ connector: Connector;
12
+ config: HandlerConfig;
13
+ sessionState: SessionState;
14
+ }
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/handlers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/handlers/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { HandlerDeps } from "./types.js";
2
+ import type { UploadFromHostArgs } from "../schemas/tools.js";
3
+ export declare function handleUploadFile(deps: HandlerDeps, args: UploadFromHostArgs): Promise<{
4
+ content: Array<{
5
+ type: "text";
6
+ text: string;
7
+ }>;
8
+ isError?: boolean;
9
+ }>;
10
+ //# sourceMappingURL=upload-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../src/handlers/upload-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAO9D,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,kBAAkB;;;;;;GAkDzB"}
@@ -0,0 +1,33 @@
1
+ import { uploadSampleFromHost, validateHostPath, validateFilename } from "../file-upload.js";
2
+ import { formatResponse, formatError } from "../response.js";
3
+ import { REMnuxError } from "../errors/remnux-error.js";
4
+ import { toREMnuxError } from "../errors/error-mapper.js";
5
+ import { basename } from "path";
6
+ export async function handleUploadFile(deps, args) {
7
+ const startTime = Date.now();
8
+ const { connector, config } = deps;
9
+ // Validate host path first
10
+ const pathValidation = validateHostPath(args.host_path);
11
+ if (!pathValidation.valid) {
12
+ return formatError("upload_file", new REMnuxError(pathValidation.error || "Invalid host path", "INVALID_PATH", "validation", "Provide an absolute path to a file on the host filesystem"), startTime);
13
+ }
14
+ // Validate filename if provided
15
+ const targetFilename = args.filename ?? basename(args.host_path);
16
+ const filenameValidation = validateFilename(targetFilename);
17
+ if (!filenameValidation.valid) {
18
+ return formatError("upload_file", new REMnuxError(filenameValidation.error || "Invalid filename", "INVALID_FILENAME", "validation", "Use alphanumeric characters, hyphens, underscores, and dots only"), startTime);
19
+ }
20
+ try {
21
+ const result = await uploadSampleFromHost(connector, config.samplesDir, args.host_path, args.filename, args.overwrite);
22
+ if (result.success) {
23
+ return formatResponse("upload_file", result, startTime);
24
+ }
25
+ else {
26
+ return formatError("upload_file", new REMnuxError(result.error || "Upload failed", "UPLOAD_FAILED", "tool_failure", "Check that the file exists and is readable on the host filesystem"), startTime);
27
+ }
28
+ }
29
+ catch (error) {
30
+ return formatError("upload_file", toREMnuxError(error), startTime);
31
+ }
32
+ }
33
+ //# sourceMappingURL=upload-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../src/handlers/upload-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE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,MAAM,CAAC,KAAK,IAAI,eAAe,EAC/B,eAAe,EACf,cAAc,EACd,mEAAmE,CACpE,EAAE,SAAS,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,WAAW,CAAC,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { HandlerDeps } from "./types.js";
2
+ import type { UploadFromHostArgs } from "../schemas/tools.js";
3
+ export declare function handleUploadFromHost(deps: HandlerDeps, args: UploadFromHostArgs): Promise<{
4
+ content: Array<{
5
+ type: "text";
6
+ text: string;
7
+ }>;
8
+ isError?: boolean;
9
+ }>;
10
+ //# sourceMappingURL=upload-from-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-from-host.d.ts","sourceRoot":"","sources":["../../src/handlers/upload-from-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAO9D,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,kBAAkB;;;;;;GAkDzB"}
@@ -0,0 +1,33 @@
1
+ import { uploadSampleFromHost, validateHostPath, validateFilename } from "../file-upload.js";
2
+ import { formatResponse, formatError } from "../response.js";
3
+ import { REMnuxError } from "../errors/remnux-error.js";
4
+ import { toREMnuxError } from "../errors/error-mapper.js";
5
+ import { basename } from "path";
6
+ export async function handleUploadFromHost(deps, args) {
7
+ const startTime = Date.now();
8
+ const { connector, config } = deps;
9
+ // Validate host path first
10
+ const pathValidation = validateHostPath(args.host_path);
11
+ if (!pathValidation.valid) {
12
+ return formatError("upload_from_host", new REMnuxError(pathValidation.error || "Invalid host path", "INVALID_PATH", "validation", "Provide an absolute path to a file on the host filesystem"), startTime);
13
+ }
14
+ // Validate filename if provided
15
+ const targetFilename = args.filename ?? basename(args.host_path);
16
+ const filenameValidation = validateFilename(targetFilename);
17
+ if (!filenameValidation.valid) {
18
+ return formatError("upload_from_host", new REMnuxError(filenameValidation.error || "Invalid filename", "INVALID_FILENAME", "validation", "Use alphanumeric characters, hyphens, underscores, and dots only"), startTime);
19
+ }
20
+ try {
21
+ const result = await uploadSampleFromHost(connector, config.samplesDir, args.host_path, args.filename, args.overwrite);
22
+ if (result.success) {
23
+ return formatResponse("upload_from_host", result, startTime);
24
+ }
25
+ else {
26
+ return formatError("upload_from_host", new REMnuxError(result.error || "Upload failed", "UPLOAD_FAILED", "tool_failure", "Check that the file exists and is readable on the host filesystem"), startTime);
27
+ }
28
+ }
29
+ catch (error) {
30
+ return formatError("upload_from_host", toREMnuxError(error), startTime);
31
+ }
32
+ }
33
+ //# sourceMappingURL=upload-from-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-from-host.js","sourceRoot":"","sources":["../../src/handlers/upload-from-host.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAiB,EACjB,IAAwB;IAExB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEnC,2BAA2B;IAC3B,MAAM,cAAc,GAAG,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC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1,10 @@
1
+ import type { HandlerDeps } from "./types.js";
2
+ import type { UploadSampleArgs } from "../schemas/tools.js";
3
+ export declare function handleUploadSample(deps: HandlerDeps, args: UploadSampleArgs): Promise<{
4
+ content: Array<{
5
+ type: "text";
6
+ text: string;
7
+ }>;
8
+ isError?: boolean;
9
+ }>;
10
+ //# sourceMappingURL=upload-sample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-sample.d.ts","sourceRoot":"","sources":["../../src/handlers/upload-sample.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,gBAAgB;;;;;;GAsCvB"}
@@ -0,0 +1,26 @@
1
+ import { uploadSample, validateFilename } from "../file-upload.js";
2
+ import { formatResponse, formatError } from "../response.js";
3
+ import { REMnuxError } from "../errors/remnux-error.js";
4
+ import { toREMnuxError } from "../errors/error-mapper.js";
5
+ export async function handleUploadSample(deps, args) {
6
+ const startTime = Date.now();
7
+ const { connector, config } = deps;
8
+ // Validate filename first (before attempting upload)
9
+ const filenameValidation = validateFilename(args.filename);
10
+ if (!filenameValidation.valid) {
11
+ return formatError("upload_sample", new REMnuxError(filenameValidation.error || "Invalid filename", "INVALID_FILENAME", "validation", "Use alphanumeric characters, hyphens, underscores, and dots only"), startTime);
12
+ }
13
+ try {
14
+ const result = await uploadSample(connector, config.samplesDir, args.filename, args.content_base64, args.overwrite);
15
+ if (result.success) {
16
+ return formatResponse("upload_sample", result, startTime);
17
+ }
18
+ else {
19
+ return formatError("upload_sample", new REMnuxError(result.error || "Upload failed", "UPLOAD_FAILED", "tool_failure", "Check disk space and write permissions in the samples directory"), startTime);
20
+ }
21
+ }
22
+ catch (error) {
23
+ return formatError("upload_sample", toREMnuxError(error), startTime);
24
+ }
25
+ }
26
+ //# sourceMappingURL=upload-sample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-sample.js","sourceRoot":"","sources":["../../src/handlers/upload-sample.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAiB,EACjB,IAAsB;IAEtB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEnC,qDAAqD;IACrD,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3D,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,eAAe,EAAE,IAAI,WAAW,CACjD,kBAAkB,CAAC,KAAK,IAAI,kBAAkB,EAC9C,kBAAkB,EAClB,YAAY,EACZ,kEAAkE,CACnE,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,YAAY,CAC/B,SAAS,EACT,MAAM,CAAC,UAAU,EACjB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,SAAS,CACf,CAAC;QAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,cAAc,CAAC,eAAe,EAAE,MAA4C,EAAE,SAAS,CAAC,CAAC;QAClG,CAAC;aAAM,CAAC;YACN,OAAO,WAAW,CAAC,eAAe,EAAE,IAAI,WAAW,CACjD,MAAM,CAAC,KAAK,IAAI,eAAe,EAC/B,eAAe,EACf,cAAc,EACd,iEAAiE,CAClE,EAAE,SAAS,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,WAAW,CAAC,eAAe,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { type ConnectorConfig } from "./connectors/index.js";
3
+ export interface ServerConfig extends ConnectorConfig {
4
+ samplesDir: string;
5
+ outputDir: string;
6
+ timeout: number;
7
+ noSandbox?: boolean;
8
+ transport?: "stdio" | "http";
9
+ httpPort?: number;
10
+ httpHost?: string;
11
+ httpToken?: string;
12
+ }
13
+ export declare function createServer(config: ServerConfig): Promise<McpServer>;
14
+ export declare function startServer(config: ServerConfig): Promise<void>;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAOtF,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA6B9E,MAAM,WAAW,YAAa,SAAQ,eAAe;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,YAAY,sBA6OtD;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,YAAY,iBAarD"}