windows-exe-decompiler-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 (190) hide show
  1. package/CODEX_INSTALLATION.md +69 -0
  2. package/COPILOT_INSTALLATION.md +77 -0
  3. package/LICENSE +21 -0
  4. package/README.md +314 -0
  5. package/bin/windows-exe-decompiler-mcp-server.js +3 -0
  6. package/dist/analysis-provenance.d.ts +184 -0
  7. package/dist/analysis-provenance.js +74 -0
  8. package/dist/analysis-task-runner.d.ts +31 -0
  9. package/dist/analysis-task-runner.js +160 -0
  10. package/dist/artifact-inventory.d.ts +23 -0
  11. package/dist/artifact-inventory.js +175 -0
  12. package/dist/cache-manager.d.ts +128 -0
  13. package/dist/cache-manager.js +454 -0
  14. package/dist/confidence-semantics.d.ts +66 -0
  15. package/dist/confidence-semantics.js +122 -0
  16. package/dist/config.d.ts +335 -0
  17. package/dist/config.js +193 -0
  18. package/dist/database.d.ts +227 -0
  19. package/dist/database.js +601 -0
  20. package/dist/decompiler-worker.d.ts +441 -0
  21. package/dist/decompiler-worker.js +1962 -0
  22. package/dist/dynamic-trace.d.ts +95 -0
  23. package/dist/dynamic-trace.js +629 -0
  24. package/dist/env-validator.d.ts +15 -0
  25. package/dist/env-validator.js +249 -0
  26. package/dist/error-handler.d.ts +28 -0
  27. package/dist/error-handler.example.d.ts +22 -0
  28. package/dist/error-handler.example.js +141 -0
  29. package/dist/error-handler.js +139 -0
  30. package/dist/ghidra-analysis-status.d.ts +49 -0
  31. package/dist/ghidra-analysis-status.js +178 -0
  32. package/dist/ghidra-config.d.ts +134 -0
  33. package/dist/ghidra-config.js +464 -0
  34. package/dist/index.d.ts +9 -0
  35. package/dist/index.js +200 -0
  36. package/dist/job-queue.d.ts +169 -0
  37. package/dist/job-queue.js +407 -0
  38. package/dist/logger.d.ts +106 -0
  39. package/dist/logger.js +176 -0
  40. package/dist/policy-guard.d.ts +115 -0
  41. package/dist/policy-guard.js +243 -0
  42. package/dist/process-output.d.ts +15 -0
  43. package/dist/process-output.js +90 -0
  44. package/dist/prompts/function-explanation-review.d.ts +5 -0
  45. package/dist/prompts/function-explanation-review.js +64 -0
  46. package/dist/prompts/semantic-name-review.d.ts +5 -0
  47. package/dist/prompts/semantic-name-review.js +63 -0
  48. package/dist/runtime-correlation.d.ts +34 -0
  49. package/dist/runtime-correlation.js +279 -0
  50. package/dist/runtime-paths.d.ts +3 -0
  51. package/dist/runtime-paths.js +11 -0
  52. package/dist/selection-diff.d.ts +667 -0
  53. package/dist/selection-diff.js +53 -0
  54. package/dist/semantic-name-suggestion-artifacts.d.ts +116 -0
  55. package/dist/semantic-name-suggestion-artifacts.js +314 -0
  56. package/dist/server.d.ts +129 -0
  57. package/dist/server.js +578 -0
  58. package/dist/tools/artifact-read.d.ts +235 -0
  59. package/dist/tools/artifact-read.js +317 -0
  60. package/dist/tools/artifacts-diff.d.ts +728 -0
  61. package/dist/tools/artifacts-diff.js +304 -0
  62. package/dist/tools/artifacts-list.d.ts +515 -0
  63. package/dist/tools/artifacts-list.js +389 -0
  64. package/dist/tools/attack-map.d.ts +290 -0
  65. package/dist/tools/attack-map.js +519 -0
  66. package/dist/tools/cache-observability.d.ts +4 -0
  67. package/dist/tools/cache-observability.js +36 -0
  68. package/dist/tools/code-function-cfg.d.ts +50 -0
  69. package/dist/tools/code-function-cfg.js +102 -0
  70. package/dist/tools/code-function-decompile.d.ts +55 -0
  71. package/dist/tools/code-function-decompile.js +103 -0
  72. package/dist/tools/code-function-disassemble.d.ts +43 -0
  73. package/dist/tools/code-function-disassemble.js +185 -0
  74. package/dist/tools/code-function-explain-apply.d.ts +255 -0
  75. package/dist/tools/code-function-explain-apply.js +225 -0
  76. package/dist/tools/code-function-explain-prepare.d.ts +535 -0
  77. package/dist/tools/code-function-explain-prepare.js +276 -0
  78. package/dist/tools/code-function-explain-review.d.ts +397 -0
  79. package/dist/tools/code-function-explain-review.js +589 -0
  80. package/dist/tools/code-function-rename-apply.d.ts +248 -0
  81. package/dist/tools/code-function-rename-apply.js +220 -0
  82. package/dist/tools/code-function-rename-prepare.d.ts +506 -0
  83. package/dist/tools/code-function-rename-prepare.js +279 -0
  84. package/dist/tools/code-function-rename-review.d.ts +574 -0
  85. package/dist/tools/code-function-rename-review.js +761 -0
  86. package/dist/tools/code-functions-list.d.ts +37 -0
  87. package/dist/tools/code-functions-list.js +91 -0
  88. package/dist/tools/code-functions-rank.d.ts +34 -0
  89. package/dist/tools/code-functions-rank.js +90 -0
  90. package/dist/tools/code-functions-reconstruct.d.ts +2725 -0
  91. package/dist/tools/code-functions-reconstruct.js +2807 -0
  92. package/dist/tools/code-functions-search.d.ts +39 -0
  93. package/dist/tools/code-functions-search.js +90 -0
  94. package/dist/tools/code-reconstruct-export.d.ts +1212 -0
  95. package/dist/tools/code-reconstruct-export.js +4002 -0
  96. package/dist/tools/code-reconstruct-plan.d.ts +274 -0
  97. package/dist/tools/code-reconstruct-plan.js +342 -0
  98. package/dist/tools/dotnet-metadata-extract.d.ts +541 -0
  99. package/dist/tools/dotnet-metadata-extract.js +355 -0
  100. package/dist/tools/dotnet-reconstruct-export.d.ts +567 -0
  101. package/dist/tools/dotnet-reconstruct-export.js +1151 -0
  102. package/dist/tools/dotnet-types-list.d.ts +325 -0
  103. package/dist/tools/dotnet-types-list.js +201 -0
  104. package/dist/tools/dynamic-dependencies.d.ts +115 -0
  105. package/dist/tools/dynamic-dependencies.js +213 -0
  106. package/dist/tools/dynamic-memory-import.d.ts +10 -0
  107. package/dist/tools/dynamic-memory-import.js +567 -0
  108. package/dist/tools/dynamic-trace-import.d.ts +10 -0
  109. package/dist/tools/dynamic-trace-import.js +235 -0
  110. package/dist/tools/entrypoint-fallback-disasm.d.ts +30 -0
  111. package/dist/tools/entrypoint-fallback-disasm.js +89 -0
  112. package/dist/tools/ghidra-analyze.d.ts +88 -0
  113. package/dist/tools/ghidra-analyze.js +208 -0
  114. package/dist/tools/ghidra-health.d.ts +37 -0
  115. package/dist/tools/ghidra-health.js +212 -0
  116. package/dist/tools/ioc-export.d.ts +209 -0
  117. package/dist/tools/ioc-export.js +542 -0
  118. package/dist/tools/packer-detect.d.ts +165 -0
  119. package/dist/tools/packer-detect.js +284 -0
  120. package/dist/tools/pe-exports-extract.d.ts +175 -0
  121. package/dist/tools/pe-exports-extract.js +253 -0
  122. package/dist/tools/pe-fingerprint.d.ts +234 -0
  123. package/dist/tools/pe-fingerprint.js +269 -0
  124. package/dist/tools/pe-imports-extract.d.ts +105 -0
  125. package/dist/tools/pe-imports-extract.js +245 -0
  126. package/dist/tools/report-generate.d.ts +157 -0
  127. package/dist/tools/report-generate.js +457 -0
  128. package/dist/tools/report-summarize.d.ts +2131 -0
  129. package/dist/tools/report-summarize.js +596 -0
  130. package/dist/tools/runtime-detect.d.ts +135 -0
  131. package/dist/tools/runtime-detect.js +247 -0
  132. package/dist/tools/sample-ingest.d.ts +94 -0
  133. package/dist/tools/sample-ingest.js +327 -0
  134. package/dist/tools/sample-profile-get.d.ts +183 -0
  135. package/dist/tools/sample-profile-get.js +121 -0
  136. package/dist/tools/sandbox-execute.d.ts +441 -0
  137. package/dist/tools/sandbox-execute.js +392 -0
  138. package/dist/tools/strings-extract.d.ts +375 -0
  139. package/dist/tools/strings-extract.js +314 -0
  140. package/dist/tools/strings-floss-decode.d.ts +143 -0
  141. package/dist/tools/strings-floss-decode.js +259 -0
  142. package/dist/tools/system-health.d.ts +434 -0
  143. package/dist/tools/system-health.js +446 -0
  144. package/dist/tools/task-cancel.d.ts +21 -0
  145. package/dist/tools/task-cancel.js +70 -0
  146. package/dist/tools/task-status.d.ts +27 -0
  147. package/dist/tools/task-status.js +106 -0
  148. package/dist/tools/task-sweep.d.ts +22 -0
  149. package/dist/tools/task-sweep.js +77 -0
  150. package/dist/tools/tool-help.d.ts +340 -0
  151. package/dist/tools/tool-help.js +261 -0
  152. package/dist/tools/yara-scan.d.ts +554 -0
  153. package/dist/tools/yara-scan.js +313 -0
  154. package/dist/types.d.ts +266 -0
  155. package/dist/types.js +41 -0
  156. package/dist/worker-pool.d.ts +204 -0
  157. package/dist/worker-pool.js +650 -0
  158. package/dist/workflows/deep-static.d.ts +104 -0
  159. package/dist/workflows/deep-static.js +276 -0
  160. package/dist/workflows/function-explanation-review.d.ts +655 -0
  161. package/dist/workflows/function-explanation-review.js +440 -0
  162. package/dist/workflows/reconstruct.d.ts +2053 -0
  163. package/dist/workflows/reconstruct.js +666 -0
  164. package/dist/workflows/semantic-name-review.d.ts +2418 -0
  165. package/dist/workflows/semantic-name-review.js +521 -0
  166. package/dist/workflows/triage.d.ts +659 -0
  167. package/dist/workflows/triage.js +1374 -0
  168. package/dist/workspace-manager.d.ts +150 -0
  169. package/dist/workspace-manager.js +411 -0
  170. package/ghidra_scripts/DecompileFunction.java +487 -0
  171. package/ghidra_scripts/DecompileFunction.py +150 -0
  172. package/ghidra_scripts/ExtractCFG.java +256 -0
  173. package/ghidra_scripts/ExtractCFG.py +233 -0
  174. package/ghidra_scripts/ExtractFunctions.java +442 -0
  175. package/ghidra_scripts/ExtractFunctions.py +101 -0
  176. package/ghidra_scripts/README.md +125 -0
  177. package/ghidra_scripts/SearchFunctionReferences.java +380 -0
  178. package/helpers/DotNetMetadataProbe/DotNetMetadataProbe.csproj +9 -0
  179. package/helpers/DotNetMetadataProbe/Program.cs +566 -0
  180. package/install-to-codex.ps1 +178 -0
  181. package/install-to-copilot.ps1 +303 -0
  182. package/package.json +101 -0
  183. package/requirements.txt +9 -0
  184. package/workers/requirements-dynamic.txt +11 -0
  185. package/workers/requirements.txt +8 -0
  186. package/workers/speakeasy_compat.py +175 -0
  187. package/workers/static_worker.py +5183 -0
  188. package/workers/yara_rules/default.yar +33 -0
  189. package/workers/yara_rules/malware_families.yar +93 -0
  190. package/workers/yara_rules/packers.yar +80 -0
@@ -0,0 +1,1212 @@
1
+ /**
2
+ * code.reconstruct.export tool implementation
3
+ * Module-level regrouping + source-like project skeleton export.
4
+ */
5
+ import { z } from 'zod';
6
+ import type { ToolDefinition, ToolArgs, WorkerResult } from '../types.js';
7
+ import type { WorkspaceManager } from '../workspace-manager.js';
8
+ import type { DatabaseManager } from '../database.js';
9
+ import type { CacheManager } from '../cache-manager.js';
10
+ import { type FunctionSearchResult } from '../decompiler-worker.js';
11
+ import { type DynamicTraceSummary } from '../dynamic-trace.js';
12
+ export declare const CodeReconstructExportInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
13
+ sample_id: z.ZodString;
14
+ topk: z.ZodDefault<z.ZodNumber>;
15
+ module_limit: z.ZodDefault<z.ZodNumber>;
16
+ min_module_size: z.ZodDefault<z.ZodNumber>;
17
+ include_imports: z.ZodDefault<z.ZodBoolean>;
18
+ include_strings: z.ZodDefault<z.ZodBoolean>;
19
+ export_name: z.ZodOptional<z.ZodString>;
20
+ validate_build: z.ZodDefault<z.ZodBoolean>;
21
+ run_harness: z.ZodDefault<z.ZodBoolean>;
22
+ compiler_path: z.ZodOptional<z.ZodString>;
23
+ build_timeout_ms: z.ZodDefault<z.ZodNumber>;
24
+ run_timeout_ms: z.ZodDefault<z.ZodNumber>;
25
+ evidence_scope: z.ZodDefault<z.ZodEnum<["all", "latest", "session"]>>;
26
+ evidence_session_tag: z.ZodOptional<z.ZodString>;
27
+ semantic_scope: z.ZodDefault<z.ZodEnum<["all", "latest", "session"]>>;
28
+ semantic_session_tag: z.ZodOptional<z.ZodString>;
29
+ reuse_cached: z.ZodDefault<z.ZodBoolean>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ sample_id: string;
32
+ evidence_scope: "all" | "latest" | "session";
33
+ topk: number;
34
+ include_strings: boolean;
35
+ semantic_scope: "all" | "latest" | "session";
36
+ module_limit: number;
37
+ min_module_size: number;
38
+ include_imports: boolean;
39
+ validate_build: boolean;
40
+ run_harness: boolean;
41
+ build_timeout_ms: number;
42
+ run_timeout_ms: number;
43
+ reuse_cached: boolean;
44
+ evidence_session_tag?: string | undefined;
45
+ semantic_session_tag?: string | undefined;
46
+ export_name?: string | undefined;
47
+ compiler_path?: string | undefined;
48
+ }, {
49
+ sample_id: string;
50
+ evidence_scope?: "all" | "latest" | "session" | undefined;
51
+ topk?: number | undefined;
52
+ include_strings?: boolean | undefined;
53
+ evidence_session_tag?: string | undefined;
54
+ semantic_scope?: "all" | "latest" | "session" | undefined;
55
+ semantic_session_tag?: string | undefined;
56
+ module_limit?: number | undefined;
57
+ min_module_size?: number | undefined;
58
+ include_imports?: boolean | undefined;
59
+ export_name?: string | undefined;
60
+ validate_build?: boolean | undefined;
61
+ run_harness?: boolean | undefined;
62
+ compiler_path?: string | undefined;
63
+ build_timeout_ms?: number | undefined;
64
+ run_timeout_ms?: number | undefined;
65
+ reuse_cached?: boolean | undefined;
66
+ }>, {
67
+ sample_id: string;
68
+ evidence_scope: "all" | "latest" | "session";
69
+ topk: number;
70
+ include_strings: boolean;
71
+ semantic_scope: "all" | "latest" | "session";
72
+ module_limit: number;
73
+ min_module_size: number;
74
+ include_imports: boolean;
75
+ validate_build: boolean;
76
+ run_harness: boolean;
77
+ build_timeout_ms: number;
78
+ run_timeout_ms: number;
79
+ reuse_cached: boolean;
80
+ evidence_session_tag?: string | undefined;
81
+ semantic_session_tag?: string | undefined;
82
+ export_name?: string | undefined;
83
+ compiler_path?: string | undefined;
84
+ }, {
85
+ sample_id: string;
86
+ evidence_scope?: "all" | "latest" | "session" | undefined;
87
+ topk?: number | undefined;
88
+ include_strings?: boolean | undefined;
89
+ evidence_session_tag?: string | undefined;
90
+ semantic_scope?: "all" | "latest" | "session" | undefined;
91
+ semantic_session_tag?: string | undefined;
92
+ module_limit?: number | undefined;
93
+ min_module_size?: number | undefined;
94
+ include_imports?: boolean | undefined;
95
+ export_name?: string | undefined;
96
+ validate_build?: boolean | undefined;
97
+ run_harness?: boolean | undefined;
98
+ compiler_path?: string | undefined;
99
+ build_timeout_ms?: number | undefined;
100
+ run_timeout_ms?: number | undefined;
101
+ reuse_cached?: boolean | undefined;
102
+ }>, {
103
+ sample_id: string;
104
+ evidence_scope: "all" | "latest" | "session";
105
+ topk: number;
106
+ include_strings: boolean;
107
+ semantic_scope: "all" | "latest" | "session";
108
+ module_limit: number;
109
+ min_module_size: number;
110
+ include_imports: boolean;
111
+ validate_build: boolean;
112
+ run_harness: boolean;
113
+ build_timeout_ms: number;
114
+ run_timeout_ms: number;
115
+ reuse_cached: boolean;
116
+ evidence_session_tag?: string | undefined;
117
+ semantic_session_tag?: string | undefined;
118
+ export_name?: string | undefined;
119
+ compiler_path?: string | undefined;
120
+ }, {
121
+ sample_id: string;
122
+ evidence_scope?: "all" | "latest" | "session" | undefined;
123
+ topk?: number | undefined;
124
+ include_strings?: boolean | undefined;
125
+ evidence_session_tag?: string | undefined;
126
+ semantic_scope?: "all" | "latest" | "session" | undefined;
127
+ semantic_session_tag?: string | undefined;
128
+ module_limit?: number | undefined;
129
+ min_module_size?: number | undefined;
130
+ include_imports?: boolean | undefined;
131
+ export_name?: string | undefined;
132
+ validate_build?: boolean | undefined;
133
+ run_harness?: boolean | undefined;
134
+ compiler_path?: string | undefined;
135
+ build_timeout_ms?: number | undefined;
136
+ run_timeout_ms?: number | undefined;
137
+ reuse_cached?: boolean | undefined;
138
+ }>;
139
+ export type CodeReconstructExportInput = z.infer<typeof CodeReconstructExportInputSchema>;
140
+ export declare const CodeReconstructExportOutputSchema: z.ZodObject<{
141
+ ok: z.ZodBoolean;
142
+ data: z.ZodOptional<z.ZodObject<{
143
+ sample_id: z.ZodString;
144
+ export_root: z.ZodString;
145
+ manifest_path: z.ZodString;
146
+ gaps_path: z.ZodString;
147
+ notes_path: z.ZodString;
148
+ cli_model_path: z.ZodString;
149
+ support_header_path: z.ZodString;
150
+ harness_path: z.ZodString;
151
+ build_manifest_path: z.ZodString;
152
+ build_validation: z.ZodObject<{
153
+ attempted: z.ZodBoolean;
154
+ status: z.ZodEnum<["passed", "failed", "skipped", "unavailable"]>;
155
+ compiler: z.ZodNullable<z.ZodString>;
156
+ compiler_path: z.ZodNullable<z.ZodString>;
157
+ command: z.ZodNullable<z.ZodString>;
158
+ exit_code: z.ZodNullable<z.ZodNumber>;
159
+ timed_out: z.ZodBoolean;
160
+ error: z.ZodNullable<z.ZodString>;
161
+ log_path: z.ZodNullable<z.ZodString>;
162
+ executable_path: z.ZodNullable<z.ZodString>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ status: "failed" | "passed" | "skipped" | "unavailable";
165
+ error: string | null;
166
+ timed_out: boolean;
167
+ exit_code: number | null;
168
+ command: string | null;
169
+ compiler_path: string | null;
170
+ attempted: boolean;
171
+ compiler: string | null;
172
+ log_path: string | null;
173
+ executable_path: string | null;
174
+ }, {
175
+ status: "failed" | "passed" | "skipped" | "unavailable";
176
+ error: string | null;
177
+ timed_out: boolean;
178
+ exit_code: number | null;
179
+ command: string | null;
180
+ compiler_path: string | null;
181
+ attempted: boolean;
182
+ compiler: string | null;
183
+ log_path: string | null;
184
+ executable_path: string | null;
185
+ }>;
186
+ harness_validation: z.ZodObject<{
187
+ attempted: z.ZodBoolean;
188
+ status: z.ZodEnum<["passed", "failed", "skipped", "unavailable"]>;
189
+ command: z.ZodNullable<z.ZodString>;
190
+ exit_code: z.ZodNullable<z.ZodNumber>;
191
+ timed_out: z.ZodBoolean;
192
+ error: z.ZodNullable<z.ZodString>;
193
+ log_path: z.ZodNullable<z.ZodString>;
194
+ matched_entries: z.ZodNumber;
195
+ mismatched_entries: z.ZodNumber;
196
+ }, "strip", z.ZodTypeAny, {
197
+ status: "failed" | "passed" | "skipped" | "unavailable";
198
+ error: string | null;
199
+ timed_out: boolean;
200
+ exit_code: number | null;
201
+ command: string | null;
202
+ attempted: boolean;
203
+ log_path: string | null;
204
+ matched_entries: number;
205
+ mismatched_entries: number;
206
+ }, {
207
+ status: "failed" | "passed" | "skipped" | "unavailable";
208
+ error: string | null;
209
+ timed_out: boolean;
210
+ exit_code: number | null;
211
+ command: string | null;
212
+ attempted: boolean;
213
+ log_path: string | null;
214
+ matched_entries: number;
215
+ mismatched_entries: number;
216
+ }>;
217
+ module_count: z.ZodNumber;
218
+ unresolved_count: z.ZodNumber;
219
+ binary_profile: z.ZodObject<{
220
+ binary_role: z.ZodString;
221
+ original_filename: z.ZodNullable<z.ZodString>;
222
+ export_count: z.ZodNumber;
223
+ forwarder_count: z.ZodNumber;
224
+ notable_exports: z.ZodArray<z.ZodString, "many">;
225
+ packed: z.ZodBoolean;
226
+ packing_confidence: z.ZodNumber;
227
+ analysis_priorities: z.ZodArray<z.ZodString, "many">;
228
+ cli_profile: z.ZodOptional<z.ZodNullable<z.ZodObject<{
229
+ tool_name: z.ZodString;
230
+ help_banner: z.ZodString;
231
+ command_count: z.ZodNumber;
232
+ commands: z.ZodArray<z.ZodObject<{
233
+ verb: z.ZodString;
234
+ summary: z.ZodString;
235
+ }, "strip", z.ZodTypeAny, {
236
+ summary: string;
237
+ verb: string;
238
+ }, {
239
+ summary: string;
240
+ verb: string;
241
+ }>, "many">;
242
+ }, "strip", z.ZodTypeAny, {
243
+ commands: {
244
+ summary: string;
245
+ verb: string;
246
+ }[];
247
+ tool_name: string;
248
+ help_banner: string;
249
+ command_count: number;
250
+ }, {
251
+ commands: {
252
+ summary: string;
253
+ verb: string;
254
+ }[];
255
+ tool_name: string;
256
+ help_banner: string;
257
+ command_count: number;
258
+ }>>>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ packed: boolean;
261
+ binary_role: string;
262
+ original_filename: string | null;
263
+ export_count: number;
264
+ forwarder_count: number;
265
+ notable_exports: string[];
266
+ packing_confidence: number;
267
+ analysis_priorities: string[];
268
+ cli_profile?: {
269
+ commands: {
270
+ summary: string;
271
+ verb: string;
272
+ }[];
273
+ tool_name: string;
274
+ help_banner: string;
275
+ command_count: number;
276
+ } | null | undefined;
277
+ }, {
278
+ packed: boolean;
279
+ binary_role: string;
280
+ original_filename: string | null;
281
+ export_count: number;
282
+ forwarder_count: number;
283
+ notable_exports: string[];
284
+ packing_confidence: number;
285
+ analysis_priorities: string[];
286
+ cli_profile?: {
287
+ commands: {
288
+ summary: string;
289
+ verb: string;
290
+ }[];
291
+ tool_name: string;
292
+ help_banner: string;
293
+ command_count: number;
294
+ } | null | undefined;
295
+ }>;
296
+ runtime_evidence: z.ZodNullable<z.ZodObject<{
297
+ executed: z.ZodBoolean;
298
+ api_count: z.ZodNumber;
299
+ stage_count: z.ZodNumber;
300
+ observed_apis: z.ZodArray<z.ZodString, "many">;
301
+ region_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
302
+ observed_modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
303
+ observed_strings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
304
+ stages: z.ZodArray<z.ZodString, "many">;
305
+ summary: z.ZodString;
306
+ }, "strip", z.ZodTypeAny, {
307
+ summary: string;
308
+ stages: string[];
309
+ executed: boolean;
310
+ api_count: number;
311
+ stage_count: number;
312
+ observed_apis: string[];
313
+ observed_strings?: string[] | undefined;
314
+ region_types?: string[] | undefined;
315
+ observed_modules?: string[] | undefined;
316
+ }, {
317
+ summary: string;
318
+ stages: string[];
319
+ executed: boolean;
320
+ api_count: number;
321
+ stage_count: number;
322
+ observed_apis: string[];
323
+ observed_strings?: string[] | undefined;
324
+ region_types?: string[] | undefined;
325
+ observed_modules?: string[] | undefined;
326
+ }>>;
327
+ provenance: z.ZodObject<{
328
+ runtime: z.ZodObject<{
329
+ scope: z.ZodEnum<["all", "latest", "session"]>;
330
+ session_selector: z.ZodNullable<z.ZodString>;
331
+ artifact_count: z.ZodNumber;
332
+ artifact_ids: z.ZodArray<z.ZodString, "many">;
333
+ session_tags: z.ZodArray<z.ZodString, "many">;
334
+ earliest_artifact_at: z.ZodNullable<z.ZodString>;
335
+ latest_artifact_at: z.ZodNullable<z.ZodString>;
336
+ scope_note: z.ZodString;
337
+ }, "strip", z.ZodTypeAny, {
338
+ artifact_count: number;
339
+ scope_note: string;
340
+ artifact_ids: string[];
341
+ session_selector: string | null;
342
+ session_tags: string[];
343
+ scope: "all" | "latest" | "session";
344
+ earliest_artifact_at: string | null;
345
+ latest_artifact_at: string | null;
346
+ }, {
347
+ artifact_count: number;
348
+ scope_note: string;
349
+ artifact_ids: string[];
350
+ session_selector: string | null;
351
+ session_tags: string[];
352
+ scope: "all" | "latest" | "session";
353
+ earliest_artifact_at: string | null;
354
+ latest_artifact_at: string | null;
355
+ }>;
356
+ semantic_names: z.ZodOptional<z.ZodObject<{
357
+ scope: z.ZodEnum<["all", "latest", "session"]>;
358
+ session_selector: z.ZodNullable<z.ZodString>;
359
+ artifact_count: z.ZodNumber;
360
+ artifact_ids: z.ZodArray<z.ZodString, "many">;
361
+ session_tags: z.ZodArray<z.ZodString, "many">;
362
+ earliest_artifact_at: z.ZodNullable<z.ZodString>;
363
+ latest_artifact_at: z.ZodNullable<z.ZodString>;
364
+ scope_note: z.ZodString;
365
+ }, "strip", z.ZodTypeAny, {
366
+ artifact_count: number;
367
+ scope_note: string;
368
+ artifact_ids: string[];
369
+ session_selector: string | null;
370
+ session_tags: string[];
371
+ scope: "all" | "latest" | "session";
372
+ earliest_artifact_at: string | null;
373
+ latest_artifact_at: string | null;
374
+ }, {
375
+ artifact_count: number;
376
+ scope_note: string;
377
+ artifact_ids: string[];
378
+ session_selector: string | null;
379
+ session_tags: string[];
380
+ scope: "all" | "latest" | "session";
381
+ earliest_artifact_at: string | null;
382
+ latest_artifact_at: string | null;
383
+ }>>;
384
+ semantic_explanations: z.ZodOptional<z.ZodObject<{
385
+ scope: z.ZodEnum<["all", "latest", "session"]>;
386
+ session_selector: z.ZodNullable<z.ZodString>;
387
+ artifact_count: z.ZodNumber;
388
+ artifact_ids: z.ZodArray<z.ZodString, "many">;
389
+ session_tags: z.ZodArray<z.ZodString, "many">;
390
+ earliest_artifact_at: z.ZodNullable<z.ZodString>;
391
+ latest_artifact_at: z.ZodNullable<z.ZodString>;
392
+ scope_note: z.ZodString;
393
+ }, "strip", z.ZodTypeAny, {
394
+ artifact_count: number;
395
+ scope_note: string;
396
+ artifact_ids: string[];
397
+ session_selector: string | null;
398
+ session_tags: string[];
399
+ scope: "all" | "latest" | "session";
400
+ earliest_artifact_at: string | null;
401
+ latest_artifact_at: string | null;
402
+ }, {
403
+ artifact_count: number;
404
+ scope_note: string;
405
+ artifact_ids: string[];
406
+ session_selector: string | null;
407
+ session_tags: string[];
408
+ scope: "all" | "latest" | "session";
409
+ earliest_artifact_at: string | null;
410
+ latest_artifact_at: string | null;
411
+ }>>;
412
+ }, "strip", z.ZodTypeAny, {
413
+ runtime: {
414
+ artifact_count: number;
415
+ scope_note: string;
416
+ artifact_ids: string[];
417
+ session_selector: string | null;
418
+ session_tags: string[];
419
+ scope: "all" | "latest" | "session";
420
+ earliest_artifact_at: string | null;
421
+ latest_artifact_at: string | null;
422
+ };
423
+ semantic_names?: {
424
+ artifact_count: number;
425
+ scope_note: string;
426
+ artifact_ids: string[];
427
+ session_selector: string | null;
428
+ session_tags: string[];
429
+ scope: "all" | "latest" | "session";
430
+ earliest_artifact_at: string | null;
431
+ latest_artifact_at: string | null;
432
+ } | undefined;
433
+ semantic_explanations?: {
434
+ artifact_count: number;
435
+ scope_note: string;
436
+ artifact_ids: string[];
437
+ session_selector: string | null;
438
+ session_tags: string[];
439
+ scope: "all" | "latest" | "session";
440
+ earliest_artifact_at: string | null;
441
+ latest_artifact_at: string | null;
442
+ } | undefined;
443
+ }, {
444
+ runtime: {
445
+ artifact_count: number;
446
+ scope_note: string;
447
+ artifact_ids: string[];
448
+ session_selector: string | null;
449
+ session_tags: string[];
450
+ scope: "all" | "latest" | "session";
451
+ earliest_artifact_at: string | null;
452
+ latest_artifact_at: string | null;
453
+ };
454
+ semantic_names?: {
455
+ artifact_count: number;
456
+ scope_note: string;
457
+ artifact_ids: string[];
458
+ session_selector: string | null;
459
+ session_tags: string[];
460
+ scope: "all" | "latest" | "session";
461
+ earliest_artifact_at: string | null;
462
+ latest_artifact_at: string | null;
463
+ } | undefined;
464
+ semantic_explanations?: {
465
+ artifact_count: number;
466
+ scope_note: string;
467
+ artifact_ids: string[];
468
+ session_selector: string | null;
469
+ session_tags: string[];
470
+ scope: "all" | "latest" | "session";
471
+ earliest_artifact_at: string | null;
472
+ latest_artifact_at: string | null;
473
+ } | undefined;
474
+ }>;
475
+ modules: z.ZodArray<z.ZodObject<{
476
+ name: z.ZodString;
477
+ confidence: z.ZodNumber;
478
+ function_count: z.ZodNumber;
479
+ import_hints: z.ZodArray<z.ZodString, "many">;
480
+ string_hints: z.ZodArray<z.ZodString, "many">;
481
+ runtime_apis: z.ZodArray<z.ZodString, "many">;
482
+ runtime_stages: z.ZodArray<z.ZodString, "many">;
483
+ interface_path: z.ZodString;
484
+ pseudocode_path: z.ZodString;
485
+ rewrite_path: z.ZodString;
486
+ functions: z.ZodArray<z.ZodObject<{
487
+ function: z.ZodString;
488
+ address: z.ZodString;
489
+ confidence: z.ZodNumber;
490
+ gaps: z.ZodArray<z.ZodString, "many">;
491
+ suggested_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
492
+ suggested_role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
493
+ rename_confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
494
+ rule_based_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
495
+ llm_suggested_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
496
+ validated_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
497
+ name_resolution_source: z.ZodOptional<z.ZodNullable<z.ZodEnum<["rule", "llm", "hybrid", "unresolved"]>>>;
498
+ explanation_summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
499
+ explanation_behavior: z.ZodOptional<z.ZodNullable<z.ZodString>>;
500
+ explanation_confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
501
+ }, "strip", z.ZodTypeAny, {
502
+ function: string;
503
+ address: string;
504
+ gaps: string[];
505
+ confidence: number;
506
+ rule_based_name?: string | null | undefined;
507
+ llm_suggested_name?: string | null | undefined;
508
+ validated_name?: string | null | undefined;
509
+ suggested_name?: string | null | undefined;
510
+ suggested_role?: string | null | undefined;
511
+ rename_confidence?: number | null | undefined;
512
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
513
+ explanation_summary?: string | null | undefined;
514
+ explanation_behavior?: string | null | undefined;
515
+ explanation_confidence?: number | null | undefined;
516
+ }, {
517
+ function: string;
518
+ address: string;
519
+ gaps: string[];
520
+ confidence: number;
521
+ rule_based_name?: string | null | undefined;
522
+ llm_suggested_name?: string | null | undefined;
523
+ validated_name?: string | null | undefined;
524
+ suggested_name?: string | null | undefined;
525
+ suggested_role?: string | null | undefined;
526
+ rename_confidence?: number | null | undefined;
527
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
528
+ explanation_summary?: string | null | undefined;
529
+ explanation_behavior?: string | null | undefined;
530
+ explanation_confidence?: number | null | undefined;
531
+ }>, "many">;
532
+ }, "strip", z.ZodTypeAny, {
533
+ name: string;
534
+ confidence: number;
535
+ function_count: number;
536
+ functions: {
537
+ function: string;
538
+ address: string;
539
+ gaps: string[];
540
+ confidence: number;
541
+ rule_based_name?: string | null | undefined;
542
+ llm_suggested_name?: string | null | undefined;
543
+ validated_name?: string | null | undefined;
544
+ suggested_name?: string | null | undefined;
545
+ suggested_role?: string | null | undefined;
546
+ rename_confidence?: number | null | undefined;
547
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
548
+ explanation_summary?: string | null | undefined;
549
+ explanation_behavior?: string | null | undefined;
550
+ explanation_confidence?: number | null | undefined;
551
+ }[];
552
+ string_hints: string[];
553
+ import_hints: string[];
554
+ runtime_apis: string[];
555
+ runtime_stages: string[];
556
+ interface_path: string;
557
+ pseudocode_path: string;
558
+ rewrite_path: string;
559
+ }, {
560
+ name: string;
561
+ confidence: number;
562
+ function_count: number;
563
+ functions: {
564
+ function: string;
565
+ address: string;
566
+ gaps: string[];
567
+ confidence: number;
568
+ rule_based_name?: string | null | undefined;
569
+ llm_suggested_name?: string | null | undefined;
570
+ validated_name?: string | null | undefined;
571
+ suggested_name?: string | null | undefined;
572
+ suggested_role?: string | null | undefined;
573
+ rename_confidence?: number | null | undefined;
574
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
575
+ explanation_summary?: string | null | undefined;
576
+ explanation_behavior?: string | null | undefined;
577
+ explanation_confidence?: number | null | undefined;
578
+ }[];
579
+ string_hints: string[];
580
+ import_hints: string[];
581
+ runtime_apis: string[];
582
+ runtime_stages: string[];
583
+ interface_path: string;
584
+ pseudocode_path: string;
585
+ rewrite_path: string;
586
+ }>, "many">;
587
+ }, "strip", z.ZodTypeAny, {
588
+ sample_id: string;
589
+ modules: {
590
+ name: string;
591
+ confidence: number;
592
+ function_count: number;
593
+ functions: {
594
+ function: string;
595
+ address: string;
596
+ gaps: string[];
597
+ confidence: number;
598
+ rule_based_name?: string | null | undefined;
599
+ llm_suggested_name?: string | null | undefined;
600
+ validated_name?: string | null | undefined;
601
+ suggested_name?: string | null | undefined;
602
+ suggested_role?: string | null | undefined;
603
+ rename_confidence?: number | null | undefined;
604
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
605
+ explanation_summary?: string | null | undefined;
606
+ explanation_behavior?: string | null | undefined;
607
+ explanation_confidence?: number | null | undefined;
608
+ }[];
609
+ string_hints: string[];
610
+ import_hints: string[];
611
+ runtime_apis: string[];
612
+ runtime_stages: string[];
613
+ interface_path: string;
614
+ pseudocode_path: string;
615
+ rewrite_path: string;
616
+ }[];
617
+ provenance: {
618
+ runtime: {
619
+ artifact_count: number;
620
+ scope_note: string;
621
+ artifact_ids: string[];
622
+ session_selector: string | null;
623
+ session_tags: string[];
624
+ scope: "all" | "latest" | "session";
625
+ earliest_artifact_at: string | null;
626
+ latest_artifact_at: string | null;
627
+ };
628
+ semantic_names?: {
629
+ artifact_count: number;
630
+ scope_note: string;
631
+ artifact_ids: string[];
632
+ session_selector: string | null;
633
+ session_tags: string[];
634
+ scope: "all" | "latest" | "session";
635
+ earliest_artifact_at: string | null;
636
+ latest_artifact_at: string | null;
637
+ } | undefined;
638
+ semantic_explanations?: {
639
+ artifact_count: number;
640
+ scope_note: string;
641
+ artifact_ids: string[];
642
+ session_selector: string | null;
643
+ session_tags: string[];
644
+ scope: "all" | "latest" | "session";
645
+ earliest_artifact_at: string | null;
646
+ latest_artifact_at: string | null;
647
+ } | undefined;
648
+ };
649
+ export_root: string;
650
+ manifest_path: string;
651
+ gaps_path: string;
652
+ notes_path: string;
653
+ cli_model_path: string;
654
+ support_header_path: string;
655
+ harness_path: string;
656
+ build_manifest_path: string;
657
+ build_validation: {
658
+ status: "failed" | "passed" | "skipped" | "unavailable";
659
+ error: string | null;
660
+ timed_out: boolean;
661
+ exit_code: number | null;
662
+ command: string | null;
663
+ compiler_path: string | null;
664
+ attempted: boolean;
665
+ compiler: string | null;
666
+ log_path: string | null;
667
+ executable_path: string | null;
668
+ };
669
+ harness_validation: {
670
+ status: "failed" | "passed" | "skipped" | "unavailable";
671
+ error: string | null;
672
+ timed_out: boolean;
673
+ exit_code: number | null;
674
+ command: string | null;
675
+ attempted: boolean;
676
+ log_path: string | null;
677
+ matched_entries: number;
678
+ mismatched_entries: number;
679
+ };
680
+ module_count: number;
681
+ unresolved_count: number;
682
+ binary_profile: {
683
+ packed: boolean;
684
+ binary_role: string;
685
+ original_filename: string | null;
686
+ export_count: number;
687
+ forwarder_count: number;
688
+ notable_exports: string[];
689
+ packing_confidence: number;
690
+ analysis_priorities: string[];
691
+ cli_profile?: {
692
+ commands: {
693
+ summary: string;
694
+ verb: string;
695
+ }[];
696
+ tool_name: string;
697
+ help_banner: string;
698
+ command_count: number;
699
+ } | null | undefined;
700
+ };
701
+ runtime_evidence: {
702
+ summary: string;
703
+ stages: string[];
704
+ executed: boolean;
705
+ api_count: number;
706
+ stage_count: number;
707
+ observed_apis: string[];
708
+ observed_strings?: string[] | undefined;
709
+ region_types?: string[] | undefined;
710
+ observed_modules?: string[] | undefined;
711
+ } | null;
712
+ }, {
713
+ sample_id: string;
714
+ modules: {
715
+ name: string;
716
+ confidence: number;
717
+ function_count: number;
718
+ functions: {
719
+ function: string;
720
+ address: string;
721
+ gaps: string[];
722
+ confidence: number;
723
+ rule_based_name?: string | null | undefined;
724
+ llm_suggested_name?: string | null | undefined;
725
+ validated_name?: string | null | undefined;
726
+ suggested_name?: string | null | undefined;
727
+ suggested_role?: string | null | undefined;
728
+ rename_confidence?: number | null | undefined;
729
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
730
+ explanation_summary?: string | null | undefined;
731
+ explanation_behavior?: string | null | undefined;
732
+ explanation_confidence?: number | null | undefined;
733
+ }[];
734
+ string_hints: string[];
735
+ import_hints: string[];
736
+ runtime_apis: string[];
737
+ runtime_stages: string[];
738
+ interface_path: string;
739
+ pseudocode_path: string;
740
+ rewrite_path: string;
741
+ }[];
742
+ provenance: {
743
+ runtime: {
744
+ artifact_count: number;
745
+ scope_note: string;
746
+ artifact_ids: string[];
747
+ session_selector: string | null;
748
+ session_tags: string[];
749
+ scope: "all" | "latest" | "session";
750
+ earliest_artifact_at: string | null;
751
+ latest_artifact_at: string | null;
752
+ };
753
+ semantic_names?: {
754
+ artifact_count: number;
755
+ scope_note: string;
756
+ artifact_ids: string[];
757
+ session_selector: string | null;
758
+ session_tags: string[];
759
+ scope: "all" | "latest" | "session";
760
+ earliest_artifact_at: string | null;
761
+ latest_artifact_at: string | null;
762
+ } | undefined;
763
+ semantic_explanations?: {
764
+ artifact_count: number;
765
+ scope_note: string;
766
+ artifact_ids: string[];
767
+ session_selector: string | null;
768
+ session_tags: string[];
769
+ scope: "all" | "latest" | "session";
770
+ earliest_artifact_at: string | null;
771
+ latest_artifact_at: string | null;
772
+ } | undefined;
773
+ };
774
+ export_root: string;
775
+ manifest_path: string;
776
+ gaps_path: string;
777
+ notes_path: string;
778
+ cli_model_path: string;
779
+ support_header_path: string;
780
+ harness_path: string;
781
+ build_manifest_path: string;
782
+ build_validation: {
783
+ status: "failed" | "passed" | "skipped" | "unavailable";
784
+ error: string | null;
785
+ timed_out: boolean;
786
+ exit_code: number | null;
787
+ command: string | null;
788
+ compiler_path: string | null;
789
+ attempted: boolean;
790
+ compiler: string | null;
791
+ log_path: string | null;
792
+ executable_path: string | null;
793
+ };
794
+ harness_validation: {
795
+ status: "failed" | "passed" | "skipped" | "unavailable";
796
+ error: string | null;
797
+ timed_out: boolean;
798
+ exit_code: number | null;
799
+ command: string | null;
800
+ attempted: boolean;
801
+ log_path: string | null;
802
+ matched_entries: number;
803
+ mismatched_entries: number;
804
+ };
805
+ module_count: number;
806
+ unresolved_count: number;
807
+ binary_profile: {
808
+ packed: boolean;
809
+ binary_role: string;
810
+ original_filename: string | null;
811
+ export_count: number;
812
+ forwarder_count: number;
813
+ notable_exports: string[];
814
+ packing_confidence: number;
815
+ analysis_priorities: string[];
816
+ cli_profile?: {
817
+ commands: {
818
+ summary: string;
819
+ verb: string;
820
+ }[];
821
+ tool_name: string;
822
+ help_banner: string;
823
+ command_count: number;
824
+ } | null | undefined;
825
+ };
826
+ runtime_evidence: {
827
+ summary: string;
828
+ stages: string[];
829
+ executed: boolean;
830
+ api_count: number;
831
+ stage_count: number;
832
+ observed_apis: string[];
833
+ observed_strings?: string[] | undefined;
834
+ region_types?: string[] | undefined;
835
+ observed_modules?: string[] | undefined;
836
+ } | null;
837
+ }>>;
838
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
839
+ errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
840
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
841
+ metrics: z.ZodOptional<z.ZodObject<{
842
+ elapsed_ms: z.ZodNumber;
843
+ tool: z.ZodString;
844
+ cached: z.ZodOptional<z.ZodBoolean>;
845
+ cache_key: z.ZodOptional<z.ZodString>;
846
+ cache_tier: z.ZodOptional<z.ZodString>;
847
+ cache_created_at: z.ZodOptional<z.ZodString>;
848
+ cache_expires_at: z.ZodOptional<z.ZodString>;
849
+ cache_hit_at: z.ZodOptional<z.ZodString>;
850
+ }, "strip", z.ZodTypeAny, {
851
+ elapsed_ms: number;
852
+ tool: string;
853
+ cached?: boolean | undefined;
854
+ cache_key?: string | undefined;
855
+ cache_tier?: string | undefined;
856
+ cache_created_at?: string | undefined;
857
+ cache_expires_at?: string | undefined;
858
+ cache_hit_at?: string | undefined;
859
+ }, {
860
+ elapsed_ms: number;
861
+ tool: string;
862
+ cached?: boolean | undefined;
863
+ cache_key?: string | undefined;
864
+ cache_tier?: string | undefined;
865
+ cache_created_at?: string | undefined;
866
+ cache_expires_at?: string | undefined;
867
+ cache_hit_at?: string | undefined;
868
+ }>>;
869
+ }, "strip", z.ZodTypeAny, {
870
+ ok: boolean;
871
+ metrics?: {
872
+ elapsed_ms: number;
873
+ tool: string;
874
+ cached?: boolean | undefined;
875
+ cache_key?: string | undefined;
876
+ cache_tier?: string | undefined;
877
+ cache_created_at?: string | undefined;
878
+ cache_expires_at?: string | undefined;
879
+ cache_hit_at?: string | undefined;
880
+ } | undefined;
881
+ data?: {
882
+ sample_id: string;
883
+ modules: {
884
+ name: string;
885
+ confidence: number;
886
+ function_count: number;
887
+ functions: {
888
+ function: string;
889
+ address: string;
890
+ gaps: string[];
891
+ confidence: number;
892
+ rule_based_name?: string | null | undefined;
893
+ llm_suggested_name?: string | null | undefined;
894
+ validated_name?: string | null | undefined;
895
+ suggested_name?: string | null | undefined;
896
+ suggested_role?: string | null | undefined;
897
+ rename_confidence?: number | null | undefined;
898
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
899
+ explanation_summary?: string | null | undefined;
900
+ explanation_behavior?: string | null | undefined;
901
+ explanation_confidence?: number | null | undefined;
902
+ }[];
903
+ string_hints: string[];
904
+ import_hints: string[];
905
+ runtime_apis: string[];
906
+ runtime_stages: string[];
907
+ interface_path: string;
908
+ pseudocode_path: string;
909
+ rewrite_path: string;
910
+ }[];
911
+ provenance: {
912
+ runtime: {
913
+ artifact_count: number;
914
+ scope_note: string;
915
+ artifact_ids: string[];
916
+ session_selector: string | null;
917
+ session_tags: string[];
918
+ scope: "all" | "latest" | "session";
919
+ earliest_artifact_at: string | null;
920
+ latest_artifact_at: string | null;
921
+ };
922
+ semantic_names?: {
923
+ artifact_count: number;
924
+ scope_note: string;
925
+ artifact_ids: string[];
926
+ session_selector: string | null;
927
+ session_tags: string[];
928
+ scope: "all" | "latest" | "session";
929
+ earliest_artifact_at: string | null;
930
+ latest_artifact_at: string | null;
931
+ } | undefined;
932
+ semantic_explanations?: {
933
+ artifact_count: number;
934
+ scope_note: string;
935
+ artifact_ids: string[];
936
+ session_selector: string | null;
937
+ session_tags: string[];
938
+ scope: "all" | "latest" | "session";
939
+ earliest_artifact_at: string | null;
940
+ latest_artifact_at: string | null;
941
+ } | undefined;
942
+ };
943
+ export_root: string;
944
+ manifest_path: string;
945
+ gaps_path: string;
946
+ notes_path: string;
947
+ cli_model_path: string;
948
+ support_header_path: string;
949
+ harness_path: string;
950
+ build_manifest_path: string;
951
+ build_validation: {
952
+ status: "failed" | "passed" | "skipped" | "unavailable";
953
+ error: string | null;
954
+ timed_out: boolean;
955
+ exit_code: number | null;
956
+ command: string | null;
957
+ compiler_path: string | null;
958
+ attempted: boolean;
959
+ compiler: string | null;
960
+ log_path: string | null;
961
+ executable_path: string | null;
962
+ };
963
+ harness_validation: {
964
+ status: "failed" | "passed" | "skipped" | "unavailable";
965
+ error: string | null;
966
+ timed_out: boolean;
967
+ exit_code: number | null;
968
+ command: string | null;
969
+ attempted: boolean;
970
+ log_path: string | null;
971
+ matched_entries: number;
972
+ mismatched_entries: number;
973
+ };
974
+ module_count: number;
975
+ unresolved_count: number;
976
+ binary_profile: {
977
+ packed: boolean;
978
+ binary_role: string;
979
+ original_filename: string | null;
980
+ export_count: number;
981
+ forwarder_count: number;
982
+ notable_exports: string[];
983
+ packing_confidence: number;
984
+ analysis_priorities: string[];
985
+ cli_profile?: {
986
+ commands: {
987
+ summary: string;
988
+ verb: string;
989
+ }[];
990
+ tool_name: string;
991
+ help_banner: string;
992
+ command_count: number;
993
+ } | null | undefined;
994
+ };
995
+ runtime_evidence: {
996
+ summary: string;
997
+ stages: string[];
998
+ executed: boolean;
999
+ api_count: number;
1000
+ stage_count: number;
1001
+ observed_apis: string[];
1002
+ observed_strings?: string[] | undefined;
1003
+ region_types?: string[] | undefined;
1004
+ observed_modules?: string[] | undefined;
1005
+ } | null;
1006
+ } | undefined;
1007
+ warnings?: string[] | undefined;
1008
+ errors?: string[] | undefined;
1009
+ artifacts?: any[] | undefined;
1010
+ }, {
1011
+ ok: boolean;
1012
+ metrics?: {
1013
+ elapsed_ms: number;
1014
+ tool: string;
1015
+ cached?: boolean | undefined;
1016
+ cache_key?: string | undefined;
1017
+ cache_tier?: string | undefined;
1018
+ cache_created_at?: string | undefined;
1019
+ cache_expires_at?: string | undefined;
1020
+ cache_hit_at?: string | undefined;
1021
+ } | undefined;
1022
+ data?: {
1023
+ sample_id: string;
1024
+ modules: {
1025
+ name: string;
1026
+ confidence: number;
1027
+ function_count: number;
1028
+ functions: {
1029
+ function: string;
1030
+ address: string;
1031
+ gaps: string[];
1032
+ confidence: number;
1033
+ rule_based_name?: string | null | undefined;
1034
+ llm_suggested_name?: string | null | undefined;
1035
+ validated_name?: string | null | undefined;
1036
+ suggested_name?: string | null | undefined;
1037
+ suggested_role?: string | null | undefined;
1038
+ rename_confidence?: number | null | undefined;
1039
+ name_resolution_source?: "hybrid" | "rule" | "llm" | "unresolved" | null | undefined;
1040
+ explanation_summary?: string | null | undefined;
1041
+ explanation_behavior?: string | null | undefined;
1042
+ explanation_confidence?: number | null | undefined;
1043
+ }[];
1044
+ string_hints: string[];
1045
+ import_hints: string[];
1046
+ runtime_apis: string[];
1047
+ runtime_stages: string[];
1048
+ interface_path: string;
1049
+ pseudocode_path: string;
1050
+ rewrite_path: string;
1051
+ }[];
1052
+ provenance: {
1053
+ runtime: {
1054
+ artifact_count: number;
1055
+ scope_note: string;
1056
+ artifact_ids: string[];
1057
+ session_selector: string | null;
1058
+ session_tags: string[];
1059
+ scope: "all" | "latest" | "session";
1060
+ earliest_artifact_at: string | null;
1061
+ latest_artifact_at: string | null;
1062
+ };
1063
+ semantic_names?: {
1064
+ artifact_count: number;
1065
+ scope_note: string;
1066
+ artifact_ids: string[];
1067
+ session_selector: string | null;
1068
+ session_tags: string[];
1069
+ scope: "all" | "latest" | "session";
1070
+ earliest_artifact_at: string | null;
1071
+ latest_artifact_at: string | null;
1072
+ } | undefined;
1073
+ semantic_explanations?: {
1074
+ artifact_count: number;
1075
+ scope_note: string;
1076
+ artifact_ids: string[];
1077
+ session_selector: string | null;
1078
+ session_tags: string[];
1079
+ scope: "all" | "latest" | "session";
1080
+ earliest_artifact_at: string | null;
1081
+ latest_artifact_at: string | null;
1082
+ } | undefined;
1083
+ };
1084
+ export_root: string;
1085
+ manifest_path: string;
1086
+ gaps_path: string;
1087
+ notes_path: string;
1088
+ cli_model_path: string;
1089
+ support_header_path: string;
1090
+ harness_path: string;
1091
+ build_manifest_path: string;
1092
+ build_validation: {
1093
+ status: "failed" | "passed" | "skipped" | "unavailable";
1094
+ error: string | null;
1095
+ timed_out: boolean;
1096
+ exit_code: number | null;
1097
+ command: string | null;
1098
+ compiler_path: string | null;
1099
+ attempted: boolean;
1100
+ compiler: string | null;
1101
+ log_path: string | null;
1102
+ executable_path: string | null;
1103
+ };
1104
+ harness_validation: {
1105
+ status: "failed" | "passed" | "skipped" | "unavailable";
1106
+ error: string | null;
1107
+ timed_out: boolean;
1108
+ exit_code: number | null;
1109
+ command: string | null;
1110
+ attempted: boolean;
1111
+ log_path: string | null;
1112
+ matched_entries: number;
1113
+ mismatched_entries: number;
1114
+ };
1115
+ module_count: number;
1116
+ unresolved_count: number;
1117
+ binary_profile: {
1118
+ packed: boolean;
1119
+ binary_role: string;
1120
+ original_filename: string | null;
1121
+ export_count: number;
1122
+ forwarder_count: number;
1123
+ notable_exports: string[];
1124
+ packing_confidence: number;
1125
+ analysis_priorities: string[];
1126
+ cli_profile?: {
1127
+ commands: {
1128
+ summary: string;
1129
+ verb: string;
1130
+ }[];
1131
+ tool_name: string;
1132
+ help_banner: string;
1133
+ command_count: number;
1134
+ } | null | undefined;
1135
+ };
1136
+ runtime_evidence: {
1137
+ summary: string;
1138
+ stages: string[];
1139
+ executed: boolean;
1140
+ api_count: number;
1141
+ stage_count: number;
1142
+ observed_apis: string[];
1143
+ observed_strings?: string[] | undefined;
1144
+ region_types?: string[] | undefined;
1145
+ observed_modules?: string[] | undefined;
1146
+ } | null;
1147
+ } | undefined;
1148
+ warnings?: string[] | undefined;
1149
+ errors?: string[] | undefined;
1150
+ artifacts?: any[] | undefined;
1151
+ }>;
1152
+ export type CodeReconstructExportOutput = z.infer<typeof CodeReconstructExportOutputSchema>;
1153
+ export declare const codeReconstructExportToolDefinition: ToolDefinition;
1154
+ interface NativeBuildValidationResult {
1155
+ attempted: boolean;
1156
+ status: 'passed' | 'failed' | 'skipped' | 'unavailable';
1157
+ compiler: string | null;
1158
+ compiler_path: string | null;
1159
+ command: string | null;
1160
+ exit_code: number | null;
1161
+ timed_out: boolean;
1162
+ error: string | null;
1163
+ stdout: string;
1164
+ stderr: string;
1165
+ log_path: string | null;
1166
+ executable_path: string | null;
1167
+ }
1168
+ interface HarnessValidationResult {
1169
+ attempted: boolean;
1170
+ status: 'passed' | 'failed' | 'skipped' | 'unavailable';
1171
+ command: string | null;
1172
+ exit_code: number | null;
1173
+ timed_out: boolean;
1174
+ error: string | null;
1175
+ stdout: string;
1176
+ stderr: string;
1177
+ log_path: string | null;
1178
+ matched_entries: number;
1179
+ mismatched_entries: number;
1180
+ }
1181
+ interface CodeReconstructExportDependencies {
1182
+ reconstructFunctionsHandler?: (args: ToolArgs) => Promise<WorkerResult>;
1183
+ importsExtractHandler?: (args: ToolArgs) => Promise<WorkerResult>;
1184
+ exportsExtractHandler?: (args: ToolArgs) => Promise<WorkerResult>;
1185
+ packerDetectHandler?: (args: ToolArgs) => Promise<WorkerResult>;
1186
+ stringsExtractHandler?: (args: ToolArgs) => Promise<WorkerResult>;
1187
+ searchFunctions?: (sampleId: string, options: {
1188
+ apiQuery?: string;
1189
+ stringQuery?: string;
1190
+ limit?: number;
1191
+ timeout?: number;
1192
+ }) => Promise<FunctionSearchResult>;
1193
+ runtimeEvidenceLoader?: (sampleId: string, options?: {
1194
+ evidenceScope?: 'all' | 'latest' | 'session';
1195
+ sessionTag?: string;
1196
+ }) => Promise<DynamicTraceSummary | null>;
1197
+ nativeBuildValidator?: (args: {
1198
+ exportRoot: string;
1199
+ srcRoot: string;
1200
+ moduleRewriteFiles: string[];
1201
+ compilerPath?: string | null;
1202
+ timeoutMs: number;
1203
+ }) => Promise<NativeBuildValidationResult>;
1204
+ harnessValidator?: (args: {
1205
+ executablePath: string;
1206
+ cwd: string;
1207
+ timeoutMs: number;
1208
+ }) => Promise<HarnessValidationResult>;
1209
+ }
1210
+ export declare function createCodeReconstructExportHandler(workspaceManager: WorkspaceManager, database: DatabaseManager, cacheManager: CacheManager, dependencies?: CodeReconstructExportDependencies): (args: ToolArgs) => Promise<WorkerResult>;
1211
+ export {};
1212
+ //# sourceMappingURL=code-reconstruct-export.d.ts.map