windows-exe-decompiler-mcp-server 0.1.0 → 0.1.3
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.
- package/CLAUDE_INSTALLATION.md +129 -0
- package/CODEX_INSTALLATION.md +25 -1
- package/COPILOT_INSTALLATION.md +29 -1
- package/LICENSE +21 -21
- package/README.md +232 -110
- package/dist/analysis-provenance.d.ts +50 -2
- package/dist/analysis-provenance.js +1 -0
- package/dist/analysis-task-runner.js +92 -0
- package/dist/config.d.ts +35 -16
- package/dist/config.js +37 -3
- package/dist/database.js +115 -115
- package/dist/decompiler-worker.d.ts +10 -5
- package/dist/decompiler-worker.js +240 -58
- package/dist/dynamic-trace.d.ts +6 -0
- package/dist/dynamic-trace.js +52 -1
- package/dist/ghidra-config.js +17 -1
- package/dist/index.js +38 -8
- package/dist/pe-runtime-functions.d.ts +90 -0
- package/dist/pe-runtime-functions.js +452 -0
- package/dist/prompts/module-reconstruction-review.d.ts +5 -0
- package/dist/prompts/module-reconstruction-review.js +65 -0
- package/dist/runtime-correlation.d.ts +5 -0
- package/dist/runtime-correlation.js +179 -2
- package/dist/sample-workspace.d.ts +28 -0
- package/dist/sample-workspace.js +186 -0
- package/dist/semantic-name-suggestion-artifacts.d.ts +56 -0
- package/dist/semantic-name-suggestion-artifacts.js +87 -0
- package/dist/server.js +1 -1
- package/dist/setup-guidance.d.ts +73 -0
- package/dist/setup-guidance.js +211 -0
- package/dist/tools/artifact-read.d.ts +10 -10
- package/dist/tools/artifacts-diff.d.ts +8 -8
- package/dist/tools/artifacts-list.d.ts +16 -16
- package/dist/tools/attack-map.d.ts +8 -8
- package/dist/tools/binary-role-profile.d.ts +1197 -0
- package/dist/tools/binary-role-profile.js +575 -0
- package/dist/tools/code-function-explain-apply.d.ts +12 -12
- package/dist/tools/code-function-explain-prepare.d.ts +12 -12
- package/dist/tools/code-function-explain-review.d.ts +58 -58
- package/dist/tools/code-function-rename-apply.d.ts +12 -12
- package/dist/tools/code-function-rename-prepare.d.ts +14 -14
- package/dist/tools/code-function-rename-review.d.ts +66 -66
- package/dist/tools/code-functions-define.d.ts +337 -0
- package/dist/tools/code-functions-define.js +337 -0
- package/dist/tools/code-functions-list.js +1 -1
- package/dist/tools/code-functions-rank.js +1 -1
- package/dist/tools/code-functions-reconstruct.d.ts +368 -58
- package/dist/tools/code-functions-reconstruct.js +130 -10
- package/dist/tools/code-functions-smart-recover.d.ts +352 -0
- package/dist/tools/code-functions-smart-recover.js +190 -0
- package/dist/tools/code-module-review-apply.d.ts +233 -0
- package/dist/tools/code-module-review-apply.js +209 -0
- package/dist/tools/code-module-review-prepare.d.ts +756 -0
- package/dist/tools/code-module-review-prepare.js +343 -0
- package/dist/tools/code-module-review.d.ts +474 -0
- package/dist/tools/code-module-review.js +566 -0
- package/dist/tools/code-reconstruct-export.d.ts +193 -21
- package/dist/tools/code-reconstruct-export.js +578 -21
- package/dist/tools/code-reconstruct-plan.d.ts +20 -20
- package/dist/tools/com-role-profile.d.ts +353 -0
- package/dist/tools/com-role-profile.js +186 -0
- package/dist/tools/dll-export-profile.d.ts +625 -0
- package/dist/tools/dll-export-profile.js +230 -0
- package/dist/tools/dotnet-metadata-extract.d.ts +122 -122
- package/dist/tools/dotnet-reconstruct-export.d.ts +49 -49
- package/dist/tools/dotnet-types-list.d.ts +66 -66
- package/dist/tools/dynamic-dependencies.d.ts +144 -8
- package/dist/tools/dynamic-dependencies.js +20 -1
- package/dist/tools/dynamic-memory-import.js +105 -2
- package/dist/tools/ghidra-analyze.d.ts +20 -0
- package/dist/tools/ghidra-analyze.js +10 -2
- package/dist/tools/ghidra-health.d.ts +177 -0
- package/dist/tools/ghidra-health.js +28 -0
- package/dist/tools/ioc-export.d.ts +8 -8
- package/dist/tools/packer-detect.d.ts +14 -14
- package/dist/tools/packer-detect.js +6 -9
- package/dist/tools/pe-exports-extract.d.ts +8 -8
- package/dist/tools/pe-exports-extract.js +6 -9
- package/dist/tools/pe-fingerprint.d.ts +36 -36
- package/dist/tools/pe-imports-extract.d.ts +8 -8
- package/dist/tools/pe-imports-extract.js +6 -9
- package/dist/tools/pe-pdata-extract.d.ts +448 -0
- package/dist/tools/pe-pdata-extract.js +219 -0
- package/dist/tools/pe-symbols-recover.d.ts +227 -0
- package/dist/tools/pe-symbols-recover.js +316 -0
- package/dist/tools/report-generate.d.ts +15 -1
- package/dist/tools/report-generate.js +139 -16
- package/dist/tools/report-summarize.d.ts +2242 -8
- package/dist/tools/report-summarize.js +246 -10
- package/dist/tools/runtime-detect.d.ts +8 -8
- package/dist/tools/runtime-detect.js +2 -12
- package/dist/tools/rust-binary-analyze.d.ts +2047 -0
- package/dist/tools/rust-binary-analyze.js +443 -0
- package/dist/tools/sample-profile-get.d.ts +135 -16
- package/dist/tools/sample-profile-get.js +35 -32
- package/dist/tools/sandbox-execute.d.ts +10 -10
- package/dist/tools/strings-extract.d.ts +8 -8
- package/dist/tools/strings-extract.js +2 -12
- package/dist/tools/strings-floss-decode.d.ts +8 -8
- package/dist/tools/system-health.d.ts +172 -36
- package/dist/tools/system-health.js +14 -0
- package/dist/tools/system-setup-guide.d.ts +179 -0
- package/dist/tools/system-setup-guide.js +62 -0
- package/dist/tools/tool-help.d.ts +16 -16
- package/dist/tools/tool-help.js +172 -0
- package/dist/tools/yara-scan.d.ts +8 -8
- package/dist/types.d.ts +2 -0
- package/dist/workflows/function-explanation-review.d.ts +3034 -76
- package/dist/workflows/function-explanation-review.js +172 -42
- package/dist/workflows/function-index-recover.d.ts +333 -0
- package/dist/workflows/function-index-recover.js +291 -0
- package/dist/workflows/module-reconstruction-review.d.ts +3537 -0
- package/dist/workflows/module-reconstruction-review.js +354 -0
- package/dist/workflows/reconstruct.d.ts +2182 -223
- package/dist/workflows/reconstruct.js +575 -32
- package/dist/workflows/semantic-name-review.d.ts +1436 -85
- package/dist/workflows/semantic-name-review.js +150 -58
- package/dist/workflows/triage.d.ts +8 -8
- package/ghidra_scripts/DecompileFunction.java +487 -487
- package/ghidra_scripts/ExtractCFG.java +256 -256
- package/ghidra_scripts/ExtractFunctions.java +442 -442
- package/ghidra_scripts/README.md +112 -112
- package/ghidra_scripts/SearchFunctionReferences.java +380 -380
- package/helpers/DotNetMetadataProbe/DotNetMetadataProbe.csproj +9 -9
- package/helpers/DotNetMetadataProbe/Program.cs +566 -566
- package/install-to-claude.ps1 +432 -0
- package/install-to-codex.ps1 +256 -178
- package/install-to-copilot.ps1 +389 -303
- package/package.json +4 -2
- package/requirements.txt +9 -9
- package/workers/requirements-dynamic.txt +11 -11
- package/workers/requirements.txt +8 -8
- package/workers/speakeasy_compat.py +175 -175
- package/workers/static_worker.py +3474 -3474
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { WorkerResult } from './types.js';
|
|
3
|
+
export declare const SetupActionSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
required: z.ZodBoolean;
|
|
6
|
+
kind: z.ZodEnum<["pip_install", "set_env", "provide_path", "verify_install"]>;
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
summary: z.ZodString;
|
|
9
|
+
command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
env_var: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
value_hint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
examples: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
+
applies_to: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
id: string;
|
|
16
|
+
summary: string;
|
|
17
|
+
kind: "pip_install" | "set_env" | "provide_path" | "verify_install";
|
|
18
|
+
title: string;
|
|
19
|
+
required: boolean;
|
|
20
|
+
examples: string[];
|
|
21
|
+
applies_to: string[];
|
|
22
|
+
command?: string | null | undefined;
|
|
23
|
+
env_var?: string | null | undefined;
|
|
24
|
+
value_hint?: string | null | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
id: string;
|
|
27
|
+
summary: string;
|
|
28
|
+
kind: "pip_install" | "set_env" | "provide_path" | "verify_install";
|
|
29
|
+
title: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
command?: string | null | undefined;
|
|
32
|
+
env_var?: string | null | undefined;
|
|
33
|
+
value_hint?: string | null | undefined;
|
|
34
|
+
examples?: string[] | undefined;
|
|
35
|
+
applies_to?: string[] | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const RequiredUserInputSchema: z.ZodObject<{
|
|
38
|
+
key: z.ZodString;
|
|
39
|
+
label: z.ZodString;
|
|
40
|
+
summary: z.ZodString;
|
|
41
|
+
required: z.ZodBoolean;
|
|
42
|
+
env_vars: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
examples: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
summary: string;
|
|
46
|
+
label: string;
|
|
47
|
+
required: boolean;
|
|
48
|
+
examples: string[];
|
|
49
|
+
key: string;
|
|
50
|
+
env_vars: string[];
|
|
51
|
+
}, {
|
|
52
|
+
summary: string;
|
|
53
|
+
label: string;
|
|
54
|
+
required: boolean;
|
|
55
|
+
key: string;
|
|
56
|
+
examples?: string[] | undefined;
|
|
57
|
+
env_vars?: string[] | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
export type SetupAction = z.infer<typeof SetupActionSchema>;
|
|
60
|
+
export type RequiredUserInput = z.infer<typeof RequiredUserInputSchema>;
|
|
61
|
+
export declare function mergeSetupActions(...groups: SetupAction[][]): SetupAction[];
|
|
62
|
+
export declare function mergeRequiredUserInputs(...groups: RequiredUserInput[][]): RequiredUserInput[];
|
|
63
|
+
export declare function buildBaselinePythonSetupActions(): SetupAction[];
|
|
64
|
+
export declare function buildDynamicDependencySetupActions(): SetupAction[];
|
|
65
|
+
export declare function buildPyGhidraSetupActions(): SetupAction[];
|
|
66
|
+
export declare function buildGhidraRequiredUserInputs(): RequiredUserInput[];
|
|
67
|
+
export declare function buildGhidraSetupActions(): SetupAction[];
|
|
68
|
+
export declare function buildAllSetupActions(includeOptional?: boolean): SetupAction[];
|
|
69
|
+
export declare function collectSetupGuidanceFromWorkerResult(result?: WorkerResult | null): {
|
|
70
|
+
setupActions: SetupAction[];
|
|
71
|
+
requiredUserInputs: RequiredUserInput[];
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=setup-guidance.d.ts.map
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SetupActionSchema = z.object({
|
|
3
|
+
id: z.string(),
|
|
4
|
+
required: z.boolean(),
|
|
5
|
+
kind: z.enum(['pip_install', 'set_env', 'provide_path', 'verify_install']),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
summary: z.string(),
|
|
8
|
+
command: z.string().nullable().optional(),
|
|
9
|
+
env_var: z.string().nullable().optional(),
|
|
10
|
+
value_hint: z.string().nullable().optional(),
|
|
11
|
+
examples: z.array(z.string()).default([]),
|
|
12
|
+
applies_to: z.array(z.string()).default([]),
|
|
13
|
+
});
|
|
14
|
+
export const RequiredUserInputSchema = z.object({
|
|
15
|
+
key: z.string(),
|
|
16
|
+
label: z.string(),
|
|
17
|
+
summary: z.string(),
|
|
18
|
+
required: z.boolean(),
|
|
19
|
+
env_vars: z.array(z.string()).default([]),
|
|
20
|
+
examples: z.array(z.string()).default([]),
|
|
21
|
+
});
|
|
22
|
+
const WINDOWS_GHIDRA_EXAMPLES = [
|
|
23
|
+
'C:\\Users\\<user>\\Downloads\\ghidra_12.0.4_PUBLIC',
|
|
24
|
+
'D:\\tools\\ghidra_12.0.4_PUBLIC',
|
|
25
|
+
];
|
|
26
|
+
export function mergeSetupActions(...groups) {
|
|
27
|
+
const merged = new Map();
|
|
28
|
+
for (const group of groups) {
|
|
29
|
+
for (const action of group) {
|
|
30
|
+
merged.set(action.id, action);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return [...merged.values()];
|
|
34
|
+
}
|
|
35
|
+
export function mergeRequiredUserInputs(...groups) {
|
|
36
|
+
const merged = new Map();
|
|
37
|
+
for (const group of groups) {
|
|
38
|
+
for (const input of group) {
|
|
39
|
+
merged.set(input.key, input);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return [...merged.values()];
|
|
43
|
+
}
|
|
44
|
+
export function buildBaselinePythonSetupActions() {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
id: 'install_python_requirements',
|
|
48
|
+
required: true,
|
|
49
|
+
kind: 'pip_install',
|
|
50
|
+
title: 'Install baseline Python dependencies',
|
|
51
|
+
summary: 'Install the baseline static-analysis Python packages before using worker-backed analysis tools.',
|
|
52
|
+
command: 'python -m pip install -r requirements.txt',
|
|
53
|
+
examples: ['python -m pip install -r requirements.txt'],
|
|
54
|
+
applies_to: ['system.health', 'dynamic.dependencies', 'static-analysis'],
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
export function buildDynamicDependencySetupActions() {
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
id: 'install_dynamic_requirements',
|
|
62
|
+
required: false,
|
|
63
|
+
kind: 'pip_install',
|
|
64
|
+
title: 'Install dynamic-analysis extras',
|
|
65
|
+
summary: 'Install the optional dynamic-analysis package set used by Speakeasy, Frida, and process telemetry probes.',
|
|
66
|
+
command: 'python -m pip install -r workers/requirements-dynamic.txt',
|
|
67
|
+
examples: ['python -m pip install -r workers/requirements-dynamic.txt'],
|
|
68
|
+
applies_to: ['dynamic.dependencies', 'sandbox.execute'],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'install_speakeasy_emulator',
|
|
72
|
+
required: false,
|
|
73
|
+
kind: 'pip_install',
|
|
74
|
+
title: 'Install Speakeasy emulator',
|
|
75
|
+
summary: 'Install FLARE Speakeasy for user-mode PE emulation.',
|
|
76
|
+
command: 'python -m pip install speakeasy-emulator',
|
|
77
|
+
examples: ['python -m pip install speakeasy-emulator'],
|
|
78
|
+
applies_to: ['dynamic.dependencies', 'sandbox.execute'],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'install_frida',
|
|
82
|
+
required: false,
|
|
83
|
+
kind: 'pip_install',
|
|
84
|
+
title: 'Install Frida runtime tracing',
|
|
85
|
+
summary: 'Install Frida when you need live instrumentation or API tracing support.',
|
|
86
|
+
command: 'python -m pip install frida',
|
|
87
|
+
examples: ['python -m pip install frida'],
|
|
88
|
+
applies_to: ['dynamic.dependencies'],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'install_psutil',
|
|
92
|
+
required: false,
|
|
93
|
+
kind: 'pip_install',
|
|
94
|
+
title: 'Install psutil process telemetry',
|
|
95
|
+
summary: 'Install psutil for process metadata and lightweight telemetry probes.',
|
|
96
|
+
command: 'python -m pip install psutil',
|
|
97
|
+
examples: ['python -m pip install psutil'],
|
|
98
|
+
applies_to: ['dynamic.dependencies'],
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
export function buildPyGhidraSetupActions() {
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
id: 'install_pyghidra',
|
|
106
|
+
required: false,
|
|
107
|
+
kind: 'pip_install',
|
|
108
|
+
title: 'Install PyGhidra',
|
|
109
|
+
summary: 'Install PyGhidra in the active Python environment to improve Ghidra post-script compatibility.',
|
|
110
|
+
command: 'python -m pip install pyghidra',
|
|
111
|
+
examples: ['python -m pip install pyghidra'],
|
|
112
|
+
applies_to: ['ghidra.health', 'ghidra.analyze', 'system.health'],
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
export function buildGhidraRequiredUserInputs() {
|
|
117
|
+
return [
|
|
118
|
+
{
|
|
119
|
+
key: 'ghidra_install_dir',
|
|
120
|
+
label: 'Ghidra install root',
|
|
121
|
+
summary: 'Provide the absolute path to the Ghidra installation root. This is the directory that contains support\\analyzeHeadless.bat.',
|
|
122
|
+
required: true,
|
|
123
|
+
env_vars: ['GHIDRA_PATH', 'GHIDRA_INSTALL_DIR'],
|
|
124
|
+
examples: WINDOWS_GHIDRA_EXAMPLES,
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
export function buildGhidraSetupActions() {
|
|
129
|
+
return [
|
|
130
|
+
{
|
|
131
|
+
id: 'set_ghidra_path',
|
|
132
|
+
required: true,
|
|
133
|
+
kind: 'set_env',
|
|
134
|
+
title: 'Set GHIDRA_PATH',
|
|
135
|
+
summary: 'Set GHIDRA_PATH to the Ghidra installation root so the server can find support\\analyzeHeadless.bat.',
|
|
136
|
+
env_var: 'GHIDRA_PATH',
|
|
137
|
+
value_hint: 'Absolute path to the Ghidra installation root directory',
|
|
138
|
+
examples: WINDOWS_GHIDRA_EXAMPLES.map((example) => `$env:GHIDRA_PATH = "${example}"`),
|
|
139
|
+
applies_to: ['ghidra.health', 'ghidra.analyze', 'system.health'],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'set_ghidra_install_dir',
|
|
143
|
+
required: false,
|
|
144
|
+
kind: 'set_env',
|
|
145
|
+
title: 'Set GHIDRA_INSTALL_DIR',
|
|
146
|
+
summary: 'As an alternative to GHIDRA_PATH, set GHIDRA_INSTALL_DIR to the same Ghidra installation root.',
|
|
147
|
+
env_var: 'GHIDRA_INSTALL_DIR',
|
|
148
|
+
value_hint: 'Absolute path to the Ghidra installation root directory',
|
|
149
|
+
examples: WINDOWS_GHIDRA_EXAMPLES.map((example) => `$env:GHIDRA_INSTALL_DIR = "${example}"`),
|
|
150
|
+
applies_to: ['ghidra.health', 'ghidra.analyze', 'system.health'],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'verify_ghidra_install_layout',
|
|
154
|
+
required: true,
|
|
155
|
+
kind: 'verify_install',
|
|
156
|
+
title: 'Verify Ghidra install layout',
|
|
157
|
+
summary: 'Confirm the configured directory contains support\\analyzeHeadless.bat. Do not point GHIDRA_PATH at the support subdirectory itself.',
|
|
158
|
+
examples: WINDOWS_GHIDRA_EXAMPLES.map((example) => `${example}\\support\\analyzeHeadless.bat`),
|
|
159
|
+
applies_to: ['ghidra.health', 'ghidra.analyze'],
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
export function buildAllSetupActions(includeOptional = true) {
|
|
164
|
+
return mergeSetupActions(buildBaselinePythonSetupActions(), buildDynamicDependencySetupActions(), buildGhidraSetupActions(), includeOptional ? buildPyGhidraSetupActions() : []);
|
|
165
|
+
}
|
|
166
|
+
function inferSetupGuidanceFromMessages(messages) {
|
|
167
|
+
const combined = messages.join('\n');
|
|
168
|
+
let setupActions = [];
|
|
169
|
+
let requiredUserInputs = [];
|
|
170
|
+
if (/ghidra|analyzeheadless|project_.*ghidra|support\\analyzeHeadless/i.test(combined)) {
|
|
171
|
+
setupActions = mergeSetupActions(setupActions, buildGhidraSetupActions());
|
|
172
|
+
requiredUserInputs = mergeRequiredUserInputs(requiredUserInputs, buildGhidraRequiredUserInputs());
|
|
173
|
+
}
|
|
174
|
+
if (/pyghidra/i.test(combined)) {
|
|
175
|
+
setupActions = mergeSetupActions(setupActions, buildPyGhidraSetupActions());
|
|
176
|
+
}
|
|
177
|
+
if (/python worker|module not found|modulenotfounderror|no module named|yara-python|flare-floss|speakeasy|frida|psutil|pip install/i.test(combined)) {
|
|
178
|
+
setupActions = mergeSetupActions(setupActions, buildBaselinePythonSetupActions());
|
|
179
|
+
if (/speakeasy|frida|psutil/i.test(combined)) {
|
|
180
|
+
setupActions = mergeSetupActions(setupActions, buildDynamicDependencySetupActions());
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
setupActions,
|
|
185
|
+
requiredUserInputs,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export function collectSetupGuidanceFromWorkerResult(result) {
|
|
189
|
+
if (!result) {
|
|
190
|
+
return {
|
|
191
|
+
setupActions: [],
|
|
192
|
+
requiredUserInputs: [],
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
const data = result.data && typeof result.data === 'object' ? result.data : {};
|
|
196
|
+
const setupActions = Array.isArray(data.setup_actions)
|
|
197
|
+
? data.setup_actions.filter(Boolean).map((item) => SetupActionSchema.parse(item))
|
|
198
|
+
: [];
|
|
199
|
+
const requiredUserInputs = Array.isArray(data.required_user_inputs)
|
|
200
|
+
? data.required_user_inputs.filter(Boolean).map((item) => RequiredUserInputSchema.parse(item))
|
|
201
|
+
: [];
|
|
202
|
+
const inferred = inferSetupGuidanceFromMessages([
|
|
203
|
+
...(result.errors || []),
|
|
204
|
+
...(result.warnings || []),
|
|
205
|
+
]);
|
|
206
|
+
return {
|
|
207
|
+
setupActions: mergeSetupActions(setupActions, inferred.setupActions),
|
|
208
|
+
requiredUserInputs: mergeRequiredUserInputs(requiredUserInputs, inferred.requiredUserInputs),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=setup-guidance.js.map
|
|
@@ -24,11 +24,11 @@ export declare const ArtifactReadInputSchema: z.ZodObject<{
|
|
|
24
24
|
sample_id: string;
|
|
25
25
|
recursive: boolean;
|
|
26
26
|
encoding: "utf8" | "base64" | "auto";
|
|
27
|
+
max_bytes: number;
|
|
27
28
|
include_untracked_files: boolean;
|
|
28
29
|
scan_roots: string[];
|
|
29
30
|
select_latest: boolean;
|
|
30
31
|
include_content: boolean;
|
|
31
|
-
max_bytes: number;
|
|
32
32
|
parse_json: boolean;
|
|
33
33
|
ioc_highlights: boolean;
|
|
34
34
|
path?: string | undefined;
|
|
@@ -39,13 +39,13 @@ export declare const ArtifactReadInputSchema: z.ZodObject<{
|
|
|
39
39
|
path?: string | undefined;
|
|
40
40
|
recursive?: boolean | undefined;
|
|
41
41
|
encoding?: "utf8" | "base64" | "auto" | undefined;
|
|
42
|
+
max_bytes?: number | undefined;
|
|
42
43
|
artifact_id?: string | undefined;
|
|
43
44
|
artifact_type?: string | undefined;
|
|
44
45
|
include_untracked_files?: boolean | undefined;
|
|
45
46
|
scan_roots?: string[] | undefined;
|
|
46
47
|
select_latest?: boolean | undefined;
|
|
47
48
|
include_content?: boolean | undefined;
|
|
48
|
-
max_bytes?: number | undefined;
|
|
49
49
|
parse_json?: boolean | undefined;
|
|
50
50
|
ioc_highlights?: boolean | undefined;
|
|
51
51
|
}>;
|
|
@@ -165,10 +165,6 @@ export declare const ArtifactReadOutputSchema: z.ZodObject<{
|
|
|
165
165
|
}>>;
|
|
166
166
|
}, "strip", z.ZodTypeAny, {
|
|
167
167
|
ok: boolean;
|
|
168
|
-
metrics?: {
|
|
169
|
-
elapsed_ms: number;
|
|
170
|
-
tool: string;
|
|
171
|
-
} | undefined;
|
|
172
168
|
data?: {
|
|
173
169
|
sample_id: string;
|
|
174
170
|
artifact: {
|
|
@@ -194,14 +190,14 @@ export declare const ArtifactReadOutputSchema: z.ZodObject<{
|
|
|
194
190
|
pipes?: string[] | undefined;
|
|
195
191
|
} | undefined;
|
|
196
192
|
} | undefined;
|
|
197
|
-
warnings?: string[] | undefined;
|
|
198
|
-
errors?: string[] | undefined;
|
|
199
|
-
}, {
|
|
200
|
-
ok: boolean;
|
|
201
193
|
metrics?: {
|
|
202
194
|
elapsed_ms: number;
|
|
203
195
|
tool: string;
|
|
204
196
|
} | undefined;
|
|
197
|
+
warnings?: string[] | undefined;
|
|
198
|
+
errors?: string[] | undefined;
|
|
199
|
+
}, {
|
|
200
|
+
ok: boolean;
|
|
205
201
|
data?: {
|
|
206
202
|
sample_id: string;
|
|
207
203
|
artifact: {
|
|
@@ -227,6 +223,10 @@ export declare const ArtifactReadOutputSchema: z.ZodObject<{
|
|
|
227
223
|
pipes?: string[] | undefined;
|
|
228
224
|
} | undefined;
|
|
229
225
|
} | undefined;
|
|
226
|
+
metrics?: {
|
|
227
|
+
elapsed_ms: number;
|
|
228
|
+
tool: string;
|
|
229
|
+
} | undefined;
|
|
230
230
|
warnings?: string[] | undefined;
|
|
231
231
|
errors?: string[] | undefined;
|
|
232
232
|
}>;
|
|
@@ -538,10 +538,6 @@ export declare const artifactsDiffOutputSchema: z.ZodObject<{
|
|
|
538
538
|
}>>;
|
|
539
539
|
}, "strip", z.ZodTypeAny, {
|
|
540
540
|
ok: boolean;
|
|
541
|
-
metrics?: {
|
|
542
|
-
elapsed_ms: number;
|
|
543
|
-
tool: string;
|
|
544
|
-
} | undefined;
|
|
545
541
|
data?: {
|
|
546
542
|
sample_id: string;
|
|
547
543
|
summary: {
|
|
@@ -627,14 +623,14 @@ export declare const artifactsDiffOutputSchema: z.ZodObject<{
|
|
|
627
623
|
}[];
|
|
628
624
|
unchanged_count: number;
|
|
629
625
|
} | undefined;
|
|
630
|
-
warnings?: string[] | undefined;
|
|
631
|
-
errors?: string[] | undefined;
|
|
632
|
-
}, {
|
|
633
|
-
ok: boolean;
|
|
634
626
|
metrics?: {
|
|
635
627
|
elapsed_ms: number;
|
|
636
628
|
tool: string;
|
|
637
629
|
} | undefined;
|
|
630
|
+
warnings?: string[] | undefined;
|
|
631
|
+
errors?: string[] | undefined;
|
|
632
|
+
}, {
|
|
633
|
+
ok: boolean;
|
|
638
634
|
data?: {
|
|
639
635
|
sample_id: string;
|
|
640
636
|
summary: {
|
|
@@ -720,6 +716,10 @@ export declare const artifactsDiffOutputSchema: z.ZodObject<{
|
|
|
720
716
|
}[];
|
|
721
717
|
unchanged_count: number;
|
|
722
718
|
} | undefined;
|
|
719
|
+
metrics?: {
|
|
720
|
+
elapsed_ms: number;
|
|
721
|
+
tool: string;
|
|
722
|
+
} | undefined;
|
|
723
723
|
warnings?: string[] | undefined;
|
|
724
724
|
errors?: string[] | undefined;
|
|
725
725
|
}>;
|
|
@@ -169,16 +169,16 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
169
169
|
}, "strip", z.ZodTypeAny, {
|
|
170
170
|
count: number;
|
|
171
171
|
latest_created_at: string;
|
|
172
|
+
types: string[];
|
|
172
173
|
untracked_count: number;
|
|
173
174
|
tracked_count: number;
|
|
174
|
-
types: string[];
|
|
175
175
|
retention_buckets: string[];
|
|
176
176
|
}, {
|
|
177
177
|
count: number;
|
|
178
178
|
latest_created_at: string;
|
|
179
|
+
types: string[];
|
|
179
180
|
untracked_count: number;
|
|
180
181
|
tracked_count: number;
|
|
181
|
-
types: string[];
|
|
182
182
|
retention_buckets: string[];
|
|
183
183
|
}>>;
|
|
184
184
|
by_retention_bucket: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
@@ -205,9 +205,9 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
205
205
|
session_index: Record<string, {
|
|
206
206
|
count: number;
|
|
207
207
|
latest_created_at: string;
|
|
208
|
+
types: string[];
|
|
208
209
|
untracked_count: number;
|
|
209
210
|
tracked_count: number;
|
|
210
|
-
types: string[];
|
|
211
211
|
retention_buckets: string[];
|
|
212
212
|
}>;
|
|
213
213
|
by_retention_bucket: Record<string, number>;
|
|
@@ -234,9 +234,9 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
234
234
|
session_index: Record<string, {
|
|
235
235
|
count: number;
|
|
236
236
|
latest_created_at: string;
|
|
237
|
+
types: string[];
|
|
237
238
|
untracked_count: number;
|
|
238
239
|
tracked_count: number;
|
|
239
|
-
types: string[];
|
|
240
240
|
retention_buckets: string[];
|
|
241
241
|
}>;
|
|
242
242
|
by_retention_bucket: Record<string, number>;
|
|
@@ -266,9 +266,9 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
266
266
|
session_index: Record<string, {
|
|
267
267
|
count: number;
|
|
268
268
|
latest_created_at: string;
|
|
269
|
+
types: string[];
|
|
269
270
|
untracked_count: number;
|
|
270
271
|
tracked_count: number;
|
|
271
|
-
types: string[];
|
|
272
272
|
retention_buckets: string[];
|
|
273
273
|
}>;
|
|
274
274
|
by_retention_bucket: Record<string, number>;
|
|
@@ -325,9 +325,9 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
325
325
|
session_index: Record<string, {
|
|
326
326
|
count: number;
|
|
327
327
|
latest_created_at: string;
|
|
328
|
+
types: string[];
|
|
328
329
|
untracked_count: number;
|
|
329
330
|
tracked_count: number;
|
|
330
|
-
types: string[];
|
|
331
331
|
retention_buckets: string[];
|
|
332
332
|
}>;
|
|
333
333
|
by_retention_bucket: Record<string, number>;
|
|
@@ -375,10 +375,6 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
375
375
|
}>>;
|
|
376
376
|
}, "strip", z.ZodTypeAny, {
|
|
377
377
|
ok: boolean;
|
|
378
|
-
metrics?: {
|
|
379
|
-
elapsed_ms: number;
|
|
380
|
-
tool: string;
|
|
381
|
-
} | undefined;
|
|
382
378
|
data?: {
|
|
383
379
|
sample_id: string;
|
|
384
380
|
summary: {
|
|
@@ -403,9 +399,9 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
403
399
|
session_index: Record<string, {
|
|
404
400
|
count: number;
|
|
405
401
|
latest_created_at: string;
|
|
402
|
+
types: string[];
|
|
406
403
|
untracked_count: number;
|
|
407
404
|
tracked_count: number;
|
|
408
|
-
types: string[];
|
|
409
405
|
retention_buckets: string[];
|
|
410
406
|
}>;
|
|
411
407
|
by_retention_bucket: Record<string, number>;
|
|
@@ -439,14 +435,14 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
439
435
|
latest_only: boolean;
|
|
440
436
|
total_pages: number;
|
|
441
437
|
} | undefined;
|
|
442
|
-
warnings?: string[] | undefined;
|
|
443
|
-
errors?: string[] | undefined;
|
|
444
|
-
}, {
|
|
445
|
-
ok: boolean;
|
|
446
438
|
metrics?: {
|
|
447
439
|
elapsed_ms: number;
|
|
448
440
|
tool: string;
|
|
449
441
|
} | undefined;
|
|
442
|
+
warnings?: string[] | undefined;
|
|
443
|
+
errors?: string[] | undefined;
|
|
444
|
+
}, {
|
|
445
|
+
ok: boolean;
|
|
450
446
|
data?: {
|
|
451
447
|
sample_id: string;
|
|
452
448
|
summary: {
|
|
@@ -471,9 +467,9 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
471
467
|
session_index: Record<string, {
|
|
472
468
|
count: number;
|
|
473
469
|
latest_created_at: string;
|
|
470
|
+
types: string[];
|
|
474
471
|
untracked_count: number;
|
|
475
472
|
tracked_count: number;
|
|
476
|
-
types: string[];
|
|
477
473
|
retention_buckets: string[];
|
|
478
474
|
}>;
|
|
479
475
|
by_retention_bucket: Record<string, number>;
|
|
@@ -507,6 +503,10 @@ export declare const ArtifactsListOutputSchema: z.ZodObject<{
|
|
|
507
503
|
latest_only: boolean;
|
|
508
504
|
total_pages: number;
|
|
509
505
|
} | undefined;
|
|
506
|
+
metrics?: {
|
|
507
|
+
elapsed_ms: number;
|
|
508
|
+
tool: string;
|
|
509
|
+
} | undefined;
|
|
510
510
|
warnings?: string[] | undefined;
|
|
511
511
|
errors?: string[] | undefined;
|
|
512
512
|
}>;
|
|
@@ -172,10 +172,6 @@ export declare const AttackMapOutputSchema: z.ZodObject<{
|
|
|
172
172
|
}>>;
|
|
173
173
|
}, "strip", z.ZodTypeAny, {
|
|
174
174
|
ok: boolean;
|
|
175
|
-
metrics?: {
|
|
176
|
-
elapsed_ms: number;
|
|
177
|
-
tool: string;
|
|
178
|
-
} | undefined;
|
|
179
175
|
data?: {
|
|
180
176
|
sample_id: string;
|
|
181
177
|
inference: {
|
|
@@ -204,14 +200,14 @@ export declare const AttackMapOutputSchema: z.ZodObject<{
|
|
|
204
200
|
}[];
|
|
205
201
|
tactic_summary: Record<string, number>;
|
|
206
202
|
} | undefined;
|
|
207
|
-
warnings?: string[] | undefined;
|
|
208
|
-
errors?: string[] | undefined;
|
|
209
|
-
}, {
|
|
210
|
-
ok: boolean;
|
|
211
203
|
metrics?: {
|
|
212
204
|
elapsed_ms: number;
|
|
213
205
|
tool: string;
|
|
214
206
|
} | undefined;
|
|
207
|
+
warnings?: string[] | undefined;
|
|
208
|
+
errors?: string[] | undefined;
|
|
209
|
+
}, {
|
|
210
|
+
ok: boolean;
|
|
215
211
|
data?: {
|
|
216
212
|
sample_id: string;
|
|
217
213
|
inference: {
|
|
@@ -240,6 +236,10 @@ export declare const AttackMapOutputSchema: z.ZodObject<{
|
|
|
240
236
|
}[];
|
|
241
237
|
tactic_summary: Record<string, number>;
|
|
242
238
|
} | undefined;
|
|
239
|
+
metrics?: {
|
|
240
|
+
elapsed_ms: number;
|
|
241
|
+
tool: string;
|
|
242
|
+
} | undefined;
|
|
243
243
|
warnings?: string[] | undefined;
|
|
244
244
|
errors?: string[] | undefined;
|
|
245
245
|
}>;
|