rea-agents 2.2.0 → 2.4.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.
- package/README.md +57 -10
- package/dist/application/ApplicationWorkflowEvidenceResolver.js +162 -0
- package/dist/application/ArtifactExtraction.js +5 -1
- package/dist/application/ArtifactGraphConstruction.js +3 -15
- package/dist/application/ArtifactInventory/classify.js +5 -1
- package/dist/application/ArtifactInventory/reader.js +2 -0
- package/dist/application/BinarySession.js +9 -2
- package/dist/application/BinarySessionStatus.js +40 -1
- package/dist/application/CapabilityInventory.js +26 -3
- package/dist/application/CommandShimReplay.js +6 -3
- package/dist/application/CompositeProvider.js +5 -2
- package/dist/application/DirectAnalysis.js +1 -20
- package/dist/application/DirectAnalysisStatus.js +83 -0
- package/dist/application/Doctor.js +34 -25
- package/dist/application/DoctorDiagnostics.js +1 -4
- package/dist/application/DoctorProjection.js +43 -0
- package/dist/application/DoctorScope.js +102 -0
- package/dist/application/EvidenceReferenceResolver.js +26 -0
- package/dist/application/JavaScriptApplicationEvidence.js +1 -1
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +10 -1
- package/dist/application/JavaScriptApplicationService.js +3 -2
- package/dist/application/JavaScriptApplicationWorkflowEvidence.js +26 -0
- package/dist/application/JavaScriptApplicationWorkflowService.js +49 -1
- package/dist/application/JavaScriptArtifactReconstruction.js +7 -0
- package/dist/application/JavaScriptModuleRelationships.js +25 -1
- package/dist/application/JavaScriptReturnShapeProjection.js +111 -0
- package/dist/application/JavaScriptSemanticGraphBuilder.js +294 -0
- package/dist/application/JavaScriptSemanticGraphConstruction.js +144 -0
- package/dist/application/JavaScriptSemanticGraphEvidence.js +86 -0
- package/dist/application/JavaScriptSemanticGraphFlowProjection.js +72 -0
- package/dist/application/JavaScriptSemanticGraphProjection.js +33 -0
- package/dist/application/JavaScriptSemanticTraceService.js +45 -0
- package/dist/application/LoopbackReplay.js +277 -133
- package/dist/application/LoopbackReplayRecorder.js +101 -0
- package/dist/application/PermissionAuthority.js +7 -3
- package/dist/application/ProcessCaptureEnvironment.js +26 -0
- package/dist/application/ProcessCaptureJournal.js +95 -0
- package/dist/application/ProcessCaptureLifecycle.js +25 -13
- package/dist/application/ProcessCheckpoints.js +35 -4
- package/dist/application/ProcessCli.js +26 -4
- package/dist/application/ProcessHarness.js +64 -83
- package/dist/application/ProcessNormalization.js +9 -2
- package/dist/application/ProcessReactiveCoordinator.js +225 -0
- package/dist/application/ProcessReactiveEffects.js +141 -0
- package/dist/application/ProcessReactiveHarness.js +85 -0
- package/dist/application/ProcessReactiveObservations.js +105 -0
- package/dist/application/ProcessSampling.js +2 -0
- package/dist/application/SessionProviderRouter.js +7 -6
- package/dist/application/Setup.js +11 -10
- package/dist/application/SetupPlan.js +1 -1
- package/dist/application/SetupRegistrationEnvironment.js +12 -0
- package/dist/application/TerminalRenderer.js +3 -1
- package/dist/browser/CdpEndpoint.js +37 -4
- package/dist/catalogIdentity.js +16 -7
- package/dist/cli/coreAnalysisCommands.js +34 -2
- package/dist/cli/javascriptApplicationAnalysis.js +19 -0
- package/dist/cli/setupCommands.js +81 -32
- package/dist/cli/utilityCommands.js +10 -2
- package/dist/cliApplicationCommands.js +79 -16
- package/dist/cliCommandNames.js +3 -0
- package/dist/cliElectronCommands.js +23 -33
- package/dist/cliObservationOptions.js +1 -1
- package/dist/cliOutput.js +56 -0
- package/dist/cliProcessCommands.js +32 -1
- package/dist/cliSetup.js +30 -21
- package/dist/contracts/applicationToolContracts.js +54 -7
- package/dist/contracts/applicationWorkflowInputContracts.js +119 -0
- package/dist/contracts/electronToolContracts.js +53 -32
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +32 -9
- package/dist/contracts/processCaptureExample.js +1 -0
- package/dist/contracts/replayMachineExample.js +37 -0
- package/dist/contracts/toolContractExamples.js +2 -0
- package/dist/contracts/toolContracts.js +5 -1
- package/dist/contracts/toolEffects.js +3 -0
- package/dist/contracts/toolOutputSchemaGroups.js +2 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +43 -0
- package/dist/doctorRuntime.js +41 -0
- package/dist/domain/analysisErrorPresentation.js +5 -3
- package/dist/domain/analysisErrorProjection.js +7 -1
- package/dist/domain/analysisSnapshot.js +2 -0
- package/dist/domain/artifactGraph.js +2 -0
- package/dist/domain/binaryTarget.js +3 -6
- package/dist/domain/changedBehavior.js +5 -4
- package/dist/domain/completionLedgerGeneration.js +190 -0
- package/dist/domain/errors.js +4 -2
- package/dist/domain/evidence.js +2 -0
- package/dist/domain/evidenceCompletionLedger.js +113 -0
- package/dist/domain/hopperStartupFailure.js +9 -0
- package/dist/domain/javascriptApplicationAnalysis.js +44 -2
- package/dist/domain/javascriptExportShapeComparison.js +145 -0
- package/dist/domain/javascriptExportShapeComparisonIdentity.js +11 -0
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +277 -0
- package/dist/domain/javascriptExportShapeSelection.js +132 -0
- package/dist/domain/javascriptExportShapeVariants.js +272 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +2 -2
- package/dist/domain/javascriptSemanticAnalysis.js +17 -36
- package/dist/domain/javascriptSemanticCallResolution.js +129 -0
- package/dist/domain/javascriptSemanticCalls.js +269 -0
- package/dist/domain/javascriptSemanticGraph.js +356 -0
- package/dist/domain/javascriptSemanticGraphSchemas.js +329 -0
- package/dist/domain/javascriptSemanticGraphSerialization.js +23 -0
- package/dist/domain/javascriptSemanticIr.js +14 -1
- package/dist/domain/javascriptSemanticPrimitives.js +36 -0
- package/dist/domain/javascriptSemanticProjection.js +36 -4
- package/dist/domain/javascriptSemanticProvenance.js +29 -0
- package/dist/domain/javascriptSemanticQuery.js +294 -0
- package/dist/domain/javascriptSemanticQueryAssessment.js +74 -0
- package/dist/domain/javascriptSemanticQueryIdentity.js +86 -0
- package/dist/domain/javascriptSemanticQueryRelations.js +15 -0
- package/dist/domain/javascriptSemanticQuerySchemas.js +188 -0
- package/dist/domain/javascriptSemanticReturns.js +187 -0
- package/dist/domain/javascriptSemanticState.js +32 -0
- package/dist/domain/javascriptSemanticTraceSchemas.js +14 -0
- package/dist/domain/javascriptSemanticValues.js +54 -70
- package/dist/domain/processCapture.js +100 -0
- package/dist/domain/processCaptureReactiveValidation.js +175 -0
- package/dist/domain/processCaptureValidation.js +103 -12
- package/dist/domain/processComparison.js +78 -25
- package/dist/domain/processObservation.js +162 -0
- package/dist/domain/processReactiveCheckpointDataflow.js +32 -0
- package/dist/domain/processReactiveMatching.js +210 -0
- package/dist/domain/processReactiveRuntime.js +120 -0
- package/dist/domain/processReactiveScenario.js +361 -0
- package/dist/domain/processReactiveScenarioPreflight.js +120 -0
- package/dist/domain/processReactiveTransition.js +161 -0
- package/dist/domain/processScenario.js +33 -0
- package/dist/domain/processTraceComparison.js +43 -0
- package/dist/domain/processTraceDimensionProjection.js +50 -0
- package/dist/domain/processTraceEvaluation.js +312 -0
- package/dist/domain/processTraceSpecification.js +373 -0
- package/dist/domain/reconstructionVerification.js +5 -4
- package/dist/domain/replayMachine.js +18 -2
- package/dist/domain/replayMachineRun.js +216 -0
- package/dist/domain/replayMachineRuntime.js +88 -9
- package/dist/domain/staticRuntimeCorrelation.js +4 -2
- package/dist/domain/zipPackageFormat.js +20 -0
- package/dist/evaluation/CodexAgentEval.js +24 -0
- package/dist/generatedPackageMetadata.js +1 -1
- package/dist/ghidra/GhidraClient.js +13 -2
- package/dist/ghidra/GhidraDiagnostics.js +1 -0
- package/dist/ghidra/GhidraLauncher.js +7 -3
- package/dist/ghidra/GhidraProvider.js +8 -1
- package/dist/hopper/BridgeLauncher.js +56 -14
- package/dist/hopper/HopperClient.js +23 -10
- package/dist/hopper/HopperDiagnostics.js +14 -0
- package/dist/hopper/HopperProcessDiagnostic.js +14 -0
- package/dist/hopper/HopperProvider.js +8 -1
- package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +72 -0
- package/dist/hopper/LinuxPrivateDisplayProbe.js +217 -0
- package/dist/main/transport.js +2 -0
- package/dist/mcpDoctor.js +310 -0
- package/dist/native/NativeMacOSProvider.js +1 -0
- package/dist/process/ProcessOwnership.js +200 -53
- package/dist/process/ProviderRunLineage.js +21 -0
- package/dist/server/createServer.js +4 -1
- package/dist/server/javascriptApplicationResult.js +22 -1
- package/dist/server/registerApplicationTools/characterization.js +3 -3
- package/dist/server/registerApplicationTools/compareExportShapes.js +37 -0
- package/dist/server/registerApplicationTools/compareVersions.js +12 -6
- package/dist/server/registerApplicationTools/controlledReplay.js +2 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -3
- package/dist/server/registerApplicationTools/helpers.js +37 -25
- package/dist/server/registerApplicationTools/traceFeature.js +9 -5
- package/dist/server/registerApplicationTools/traceSemantics.js +30 -0
- package/dist/server/registerApplicationTools.js +4 -0
- package/dist/server/registerEvidenceResources.js +5 -1
- package/dist/server/registerProcessComparisonTool.js +17 -7
- package/dist/server/registerReplayMachineTool.js +20 -0
- package/dist/server/registerSessionTools.js +12 -7
- package/dist/server/sessionAvailabilityPolicy.js +2 -1
- package/dist/serverIdentity.js +19 -0
- package/package.json +62 -30
- package/scripts/hopper-demo-x11.py +459 -61
- package/scripts/prepack.mjs +55 -0
- package/scripts/prepare.mjs +28 -0
- package/scripts/rea.mjs +26 -5
- package/skills/reverse-engineer-anything/SKILL.md +4 -3
- package/skills/reverse-engineer-anything/references/javascript-applications.md +10 -0
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +2 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { access } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
|
|
7
|
+
const sourceHuskyIsAvailable = async () => {
|
|
8
|
+
try {
|
|
9
|
+
await access(join(root, "src"));
|
|
10
|
+
await access(join(root, "node_modules", "husky", "index.js"));
|
|
11
|
+
return true;
|
|
12
|
+
} catch (cause) {
|
|
13
|
+
if (
|
|
14
|
+
typeof cause === "object" &&
|
|
15
|
+
cause !== null &&
|
|
16
|
+
"code" in cause &&
|
|
17
|
+
cause.code === "ENOENT"
|
|
18
|
+
)
|
|
19
|
+
return false;
|
|
20
|
+
throw cause;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
if (process.env.HUSKY !== "0" && (await sourceHuskyIsAvailable())) {
|
|
25
|
+
const { default: installHusky } = await import("husky");
|
|
26
|
+
const message = installHusky();
|
|
27
|
+
if (message.length > 0) process.stdout.write(`${message}\n`);
|
|
28
|
+
}
|
package/scripts/rea.mjs
CHANGED
|
@@ -13,10 +13,13 @@ const { default: packageJson } = await import("../package.json", {
|
|
|
13
13
|
process.env.REA_PACKAGE_VERSION = packageJson.version;
|
|
14
14
|
const isMcpMode =
|
|
15
15
|
args.length === 1 && (args[0] === "--mcp" || args[0] === "mcp");
|
|
16
|
+
const isMcpDoctorMode = args[0] === "mcp" && args[1] === "doctor";
|
|
16
17
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
17
18
|
const runtimeFiles = isMcpMode
|
|
18
19
|
? ["dist/main.js"]
|
|
19
|
-
:
|
|
20
|
+
: isMcpDoctorMode
|
|
21
|
+
? ["dist/main.js", "dist/mcpDoctor.js"]
|
|
22
|
+
: ["dist/cli.js", "dist/cliOutput.js"];
|
|
20
23
|
|
|
21
24
|
if (!(await compiledRuntimeExists(runtimeFiles))) {
|
|
22
25
|
process.stderr.write(
|
|
@@ -26,12 +29,30 @@ if (!(await compiledRuntimeExists(runtimeFiles))) {
|
|
|
26
29
|
} else if (isMcpMode) {
|
|
27
30
|
const { runEntrypoint } = await import("../dist/main.js");
|
|
28
31
|
await runEntrypoint();
|
|
32
|
+
} else if (isMcpDoctorMode) {
|
|
33
|
+
const { runProductionMcpDoctorCli } = await import("../dist/mcpDoctor.js");
|
|
34
|
+
const result = await runProductionMcpDoctorCli(args.slice(2), {
|
|
35
|
+
dispatcherPath: fileURLToPath(import.meta.url),
|
|
36
|
+
packageRoot,
|
|
37
|
+
});
|
|
38
|
+
process.stdout.write(result.output);
|
|
39
|
+
process.exitCode = result.exitCode;
|
|
29
40
|
} else {
|
|
30
41
|
const { createCli } = await import("../dist/cli.js");
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
const {
|
|
43
|
+
renderCliOutputArgumentError,
|
|
44
|
+
sanitizeCliOutput,
|
|
45
|
+
validateCliOutputArguments,
|
|
46
|
+
} = await import("../dist/cliOutput.js");
|
|
47
|
+
const outputArguments = validateCliOutputArguments(args);
|
|
48
|
+
if (!outputArguments.ok) {
|
|
49
|
+
process.stdout.write(renderCliOutputArgumentError(outputArguments));
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
} else {
|
|
52
|
+
await createCli().serve(args, {
|
|
53
|
+
stdout: (output) => process.stdout.write(sanitizeCliOutput(output)),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
35
56
|
}
|
|
36
57
|
|
|
37
58
|
async function compiledRuntimeExists(paths) {
|
|
@@ -3,8 +3,8 @@ name: reverse-engineer-anything
|
|
|
3
3
|
description: Reverse engineer native, managed, Electron/JavaScript, packaged, and browser applications with REA. Use shipped-artifact or approved runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.
|
|
4
4
|
metadata:
|
|
5
5
|
version: "23"
|
|
6
|
-
tool_count:
|
|
7
|
-
catalog_digest: "
|
|
6
|
+
tool_count: 98
|
|
7
|
+
catalog_digest: "aa413204625f3aeb62732d0f732b9b8b24832eea4520214b1e6bd204e599bcd6"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# REA
|
|
@@ -22,7 +22,8 @@ Choose the first tool from the target the user supplied. Do not call
|
|
|
22
22
|
|
|
23
23
|
- ASAR or extracted JavaScript/Electron tree:
|
|
24
24
|
`analyze_javascript_application`.
|
|
25
|
-
- Archive, application package, ZIP/APK/IPA, or DMG:
|
|
25
|
+
- Archive, application package, ZIP/APK/IPA/MSIX/AppX, or DMG:
|
|
26
|
+
`inventory_artifact`.
|
|
26
27
|
- Managed PE/CLI assembly: `inspect_managed_artifact`.
|
|
27
28
|
- User-owned browser page already open: `list_browser_targets`.
|
|
28
29
|
- User-owned Electron runtime already open: `list_electron_targets`.
|
|
@@ -23,3 +23,13 @@ For version comparison, analyze each version once, then call
|
|
|
23
23
|
fingerprint, or non-module semantic matches. Module ordinals and minified names
|
|
24
24
|
are not persistent identity. Report added or removed only with complete
|
|
25
25
|
opposite-side coverage; otherwise report unknown.
|
|
26
|
+
|
|
27
|
+
When the question asks how one exact exported callable's returned object shape
|
|
28
|
+
changed, analyze each version once and then call
|
|
29
|
+
`compare_javascript_export_shapes` with explicit module paths and export names.
|
|
30
|
+
Use the Evidence IDs returned by the two analysis calls. Accept variant pairing
|
|
31
|
+
only through the tool's unique exact literal discriminant. Cite the comparison
|
|
32
|
+
Evidence and report JSON Pointer changes; dynamic values, ambiguous variants,
|
|
33
|
+
and incomplete parent-property coverage stay unknown. This is static inference,
|
|
34
|
+
not runtime behavior. Use `run_controlled_replay` separately only when the user
|
|
35
|
+
needs approved runtime semantics.
|
|
@@ -24,8 +24,8 @@ parser and must not become an implicit setup dependency.
|
|
|
24
24
|
## Packages and extraction
|
|
25
25
|
|
|
26
26
|
Call `inventory_artifact` before extraction for application bundles, archives,
|
|
27
|
-
ZIP/APK/IPA, ASAR, or DMG inputs. Continue deterministic occurrence
|
|
28
|
-
the returned offset only when needed. Cite graph manifest IDs.
|
|
27
|
+
ZIP/APK/IPA/MSIX/AppX, ASAR, or DMG inputs. Continue deterministic occurrence
|
|
28
|
+
pages from the returned offset only when needed. Cite graph manifest IDs.
|
|
29
29
|
|
|
30
30
|
`extract_artifact` requires explicit approval, an absent absolute output root,
|
|
31
31
|
and selected occurrence IDs. Never extract every entry implicitly. Symlinks and
|