rea-agents 6.3.0 → 6.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 +7 -4
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +597 -209
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +186 -0
- package/dist/adb/AdbProvider.js +1190 -0
- package/dist/adb/AdbShellOutput.js +309 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxConfiguration.js +44 -24
- package/dist/android/JadxProvider.js +51 -19
- package/dist/apktool/ApktoolConfiguration.js +84 -0
- package/dist/apktool/ApktoolDecodeOutput.js +59 -0
- package/dist/apktool/ApktoolProvider.js +506 -0
- package/dist/application/AnalysisProvider.js +8 -2
- package/dist/application/AppBundleExecutable.js +27 -22
- package/dist/application/BinaryTargetResolver.js +22 -2
- package/dist/application/CapabilityInventory.js +11 -1
- package/dist/application/ClientConfigurationDocument.js +70 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +35 -0
- package/dist/application/ClientRegistrationStatus.js +66 -31
- package/dist/application/DirectAnalysis.js +2 -2
- package/dist/application/DirectAnalysisCleanup.js +1 -1
- package/dist/application/DirectAnalysisStatus.js +1 -1
- package/dist/application/Doctor.js +5 -3
- package/dist/application/DoctorDiagnostics.js +1 -1
- package/dist/application/EvidenceBundleCommands.js +6 -12
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/JsonFiles.js +6 -5
- package/dist/{cliJsonFile.js → application/JsonInputFile.js} +108 -35
- package/dist/application/LinuxHopper.js +4 -12
- package/dist/application/MacHopper.js +172 -149
- package/dist/application/MipsElfAbiFlags.js +140 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/ReconstructionObligationCandidates.js +9 -3
- package/dist/application/ReferenceSourceImport.js +76 -29
- package/dist/application/ReferenceSourceImportEntries.js +18 -9
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -22
- package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
- package/dist/application/RegularFileRead.js +93 -7
- package/dist/application/Setup.js +54 -6
- package/dist/application/SetupClientConfiguration.js +116 -16
- package/dist/application/SetupHost.js +102 -24
- package/dist/application/SetupPlan.js +5 -8
- package/dist/application/SetupSkill.js +58 -39
- package/dist/application/SupportedClients.js +290 -65
- package/dist/application/Uninstall.js +158 -10
- package/dist/application/UpdateMaintenance.js +17 -21
- package/dist/application/Utf8JsonInput.js +7 -0
- package/dist/application/WebScriptExportService.js +131 -65
- package/dist/application/WebSourceLocationService.js +3 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +40 -2
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/BinarySession.js +2 -1
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
- package/dist/application/evm/EvmInterfaceService.js +3 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +19 -6
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
- package/dist/application/javascript/JavaScriptApplicationService.js +22 -11
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -30
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +67 -19
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +19 -16
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +258 -235
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +115 -26
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -1
- package/dist/application/javascript/JavaScriptModuleRelationships.js +6 -4
- package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +199 -61
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
- package/dist/application/native/NativeUiActionTrace.js +16 -8
- package/dist/application/native/NativeValueTrace.js +23 -6
- package/dist/application/process/ProcessCli.js +25 -20
- package/dist/artifacts/ArtifactPaths.js +129 -8
- package/dist/artifacts/ArtifactProvider.js +20 -15
- package/dist/artifacts/ArtifactReader.js +23 -0
- package/dist/artifacts/ArtifactResourceScope.js +100 -0
- package/dist/artifacts/AsarArtifactReader.js +176 -102
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +168 -65
- package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
- package/dist/artifacts/NativeDmgArtifactReader.js +29 -22
- package/dist/artifacts/SafeOutputTree.js +245 -70
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +77 -27
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +32 -13
- package/dist/artifacts/extraction/ArtifactExtraction.js +110 -86
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +110 -43
- package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
- package/dist/artifacts/inventory/classify.js +75 -32
- package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
- package/dist/artifacts/inventory/reader.js +13 -5
- package/dist/artifacts/inventory/scanCanonical.js +62 -25
- package/dist/artifacts/inventory/scanReader.js +38 -11
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +15 -9
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
- package/dist/browser/BrowserScenarioSecrets.js +52 -37
- package/dist/browser/CdpBrowserProvider.js +5 -0
- package/dist/browser/CdpCaptureDocuments.js +40 -6
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
- package/dist/browser/CdpCaptureEventHandlers.js +26 -9
- package/dist/browser/CdpCaptureEvents.js +4 -9
- package/dist/browser/CdpConnection.js +22 -5
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpTargetSession.js +30 -34
- package/dist/browser/CdpWebMcpDiscovery.js +32 -10
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +60 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +69 -7
- package/dist/browser/PlaywrightScenarioSession.js +127 -54
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +3 -3
- package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
- package/dist/browser/assets/PublishWebScripts.js +75 -20
- package/dist/browser/assets/WebArtifactReads.js +23 -1
- package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/HarCapture.js +14 -0
- package/dist/browser/history/HarCaptureProcess.js +2 -10
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/modules/WebModuleArtifacts.js +1 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/artifactCommands.js +8 -11
- package/dist/cli/binaryDiagnosticsCommands.js +19 -1
- package/dist/cli/browserAdvancedCommands.js +65 -36
- package/dist/cli/coreBinaryCommands.js +0 -5
- package/dist/cli/coreNativeCommands.js +1 -14
- package/dist/cli/electronCommands.js +6 -1
- package/dist/cli/evmCommands.js +13 -4
- package/dist/cli/firmwareCommands.js +7 -2
- package/dist/cli/javascriptApplicationAnalysis.js +17 -1
- package/dist/cli/javascriptRecoveryCommands.js +22 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +11 -4
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/setupCommands.js +15 -3
- package/dist/cli/utilityCommands.js +66 -18
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli.js +6 -0
- package/dist/cliBrowserScenarioCommands.js +2 -1
- package/dist/cliCommandNames.js +32 -0
- package/dist/cliJsonInput.js +2 -2
- package/dist/cliObservationOptions.js +3 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/directAnalysis.js +12 -4
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/config/environment.js +10 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/parseConfig.js +28 -1
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +10 -0
- package/dist/contracts/analysisViewToolContracts.js +17 -2
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/artifactToolContracts.js +8 -5
- package/dist/contracts/browserToolContracts.js +1 -1
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +10 -10
- package/dist/contracts/javascript/electronToolContracts.js +15 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
- package/dist/contracts/officialToolContracts.js +5 -5
- package/dist/contracts/sessionToolContracts.js +2 -2
- package/dist/contracts/sessionToolSchemas.js +6 -2
- package/dist/contracts/toolContractExamples.js +6 -0
- package/dist/contracts/toolContractTypes.js +3 -0
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +167 -0
- package/dist/contracts/toolOutputSchemaGroups.js +5 -3
- package/dist/contracts/toolSchemaMetadata.js +82 -7
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorPresentation.js +18 -6
- package/dist/domain/analysisErrorProjection.js +4 -1
- package/dist/domain/analysisSnapshot.js +2 -1
- package/dist/domain/analysisView/analysisView.js +52 -2
- package/dist/domain/analysisView/binaryLayoutView.js +2 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/android/androidApplication.js +25 -20
- package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
- package/dist/domain/apple/appleApplication.js +40 -23
- package/dist/domain/apple/appleBundleAnatomy.js +95 -28
- package/dist/domain/apple/dyldPaths.js +9 -1
- package/dist/domain/apple/dylibResolution.js +2 -2
- package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
- package/dist/domain/artifactComparison.js +35 -7
- package/dist/domain/artifactGraph.js +5 -3
- package/dist/domain/artifactIdentity.js +30 -2
- package/dist/domain/artifactInspection.js +3 -43
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +11 -12
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +16 -0
- package/dist/domain/binaryTargetTypes.js +8 -1
- package/dist/domain/browserObservationSchemas.js +8 -4
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/evidence.js +2 -1
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +12 -13
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +11 -20
- package/dist/domain/javascript/electronStaticAnalysisNative.js +70 -40
- package/dist/domain/javascript/electronStaticAnalysisValues.js +16 -0
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +4 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +6 -6
- package/dist/domain/javascript/javascriptApplicationGraph.js +79 -18
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +9 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +58 -31
- package/dist/domain/javascript/javascriptAstValues.js +32 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +6 -1
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +8 -11
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +190 -33
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +42 -41
- package/dist/domain/javascript/javascriptSemanticGraph.js +69 -23
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -10
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +40 -7
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +341 -87
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +7 -1
- package/dist/domain/javascript/javascriptSemanticProjection.js +52 -14
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
- package/dist/domain/javascript/javascriptSemanticQuery.js +27 -29
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +13 -23
- package/dist/domain/javascript/javascriptSemanticState.js +22 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +19 -1
- package/dist/domain/javascript/javascriptSemanticValues.js +47 -19
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +8 -6
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonShape.js +63 -52
- package/dist/domain/jsonValue.js +3 -0
- package/dist/domain/managed/managedApplicationGraph.js +37 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +32 -22
- package/dist/domain/managed/managedArtifact.js +1 -0
- package/dist/domain/managed/managedInspectionEvidence.js +13 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeInstruction.js +21 -0
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/peResources.js +94 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/process/processCapture.js +91 -1
- package/dist/domain/process/processCaptureExample.js +24 -0
- package/dist/domain/process/processCaptureValidation.js +79 -0
- package/dist/domain/process/processScenario.js +59 -7
- package/dist/domain/propertyListKeys.js +3 -1
- package/dist/domain/referenceSourceGraph.js +25 -16
- package/dist/domain/referenceSourceImportParsing.js +6 -3
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/webBundleAnalyzerInspection.js +14 -2
- package/dist/domain/webCaptureDiff.js +102 -4
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +7 -13
- package/dist/domain/zipPackageFormat.js +4 -1
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +55 -43
- package/dist/dotnet/ManagedDecodeBudget.js +80 -0
- package/dist/dotnet/ManagedMemberInspector.js +13 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +4 -2
- package/dist/dotnet/ManagedMemberRows.js +9 -4
- package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
- package/dist/dotnet/ManagedMetadataLayout.js +10 -4
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
- package/dist/dotnet/ManagedPeReader.js +41 -25
- package/dist/dotnet/ManagedReaderFailure.js +2 -1
- package/dist/dotnet/ManagedStaticProvider.js +55 -24
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +43 -13
- package/dist/evm/EvmoleFailures.js +0 -2
- package/dist/evm/EvmoleInterfaceProvider.js +67 -2
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/RegularFile.js +33 -1
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +26 -0
- package/dist/firmware/FirmwareCommand.js +25 -3
- package/dist/firmware/FirmwareFiles.js +23 -8
- package/dist/firmware/FirmwareProvider.js +156 -32
- package/dist/firmware/FirmwarePublication.js +24 -3
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +76 -4
- package/dist/ghidra/GhidraDiagnostics.js +11 -8
- package/dist/ghidra/GhidraFunctionValues.js +26 -2
- package/dist/ghidra/GhidraInstallation.js +1 -1
- package/dist/ghidra/GhidraInventoryValues.js +23 -1
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +80 -39
- package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
- package/dist/ghidra/GhidraMipsProfile.js +79 -0
- package/dist/ghidra/GhidraProvider.js +57 -9
- package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
- package/dist/ghidra/GhidraProviderClient.js +282 -21
- package/dist/ghidra/GhidraSessionValues.js +9 -2
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperClient.js +15 -6
- package/dist/hopper/HopperMachOImage.js +2 -0
- package/dist/hopper/HopperProvider.js +13 -2
- package/dist/ida/IdaOperationRunner.js +8 -2
- package/dist/ida/IdaProvider.js +7 -0
- package/dist/ida/IdaSessionClient.js +3 -1
- package/dist/ida/IdaWorkspace.js +4 -2
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
- package/dist/javascript/recovery/RecoveryFiles.js +18 -7
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +11 -7
- package/dist/javascript/recovery/WakaruProvider.js +139 -16
- package/dist/javascript/recovery/WakaruPublication.js +14 -4
- package/dist/javascript/recovery/WakaruRelease.js +10 -3
- package/dist/javascript/recovery/WakaruReport.js +12 -7
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
- package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
- package/dist/jeb/JebMcpConnection.js +179 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +299 -0
- package/dist/mcpDoctor.js +15 -6
- package/dist/native/AppleDispatchCoverage.js +25 -12
- package/dist/native/AppleDispatchMetadata.js +14 -7
- package/dist/native/AppleMachoFixups.js +71 -15
- package/dist/native/AppleMachoSelection.js +23 -3
- package/dist/native/NativeMacOSProvider.js +91 -16
- package/dist/native/NativeMachoInspection.js +11 -7
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +4 -3
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/DarwinProcessRunTokenReader.js +8 -3
- package/dist/process/OwnedCommand.js +4 -3
- package/dist/process/ProcessOwnership.js +104 -112
- package/dist/process/ProcessOwnershipObservation.js +96 -39
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +4 -3
- package/dist/process/capture/FilesystemSnapshot.js +28 -4
- package/dist/process/capture/ProcessCaptureLifecycle.js +350 -59
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessHarness.js +194 -26
- package/dist/process/capture/ProcessNormalization.js +3 -1
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
- package/dist/process/capture/TerminalRenderer.js +24 -7
- package/dist/reference/ReferenceSourceReader.js +22 -5
- package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
- package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
- package/dist/reference/ReferenceSourceReaderFile.js +50 -10
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
- package/dist/server/EvidenceMcpServer.js +36 -1
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +97 -25
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +4 -9
- package/dist/server/registerAndroidTools.js +3 -12
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +12 -9
- package/dist/server/registerBundleComparisonTool.js +16 -2
- package/dist/server/registerCloseLifecycleTool.js +32 -3
- package/dist/server/registerElectronTools.js +28 -10
- package/dist/server/registerEvmTools.js +4 -9
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFunctionComparisonTool.js +5 -2
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerSessionRecordTools.js +2 -1
- package/dist/server/registerSessionTools.js +49 -18
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +4 -9
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/toolResult.js +21 -2
- package/dist/windows/WindowsPrivateRuntime.js +12 -5
- package/install.sh +7 -4
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +33 -5
- package/scripts/rea.mjs +16 -1
- package/skills/reverse-engineer-anything/SKILL.md +52 -51
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +22 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createJavaScriptSemanticGraph,
|
|
2
|
-
import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, } from "../../domain/javascript/javascriptSemanticGraphSchemas.js";
|
|
1
|
+
import { createJavaScriptSemanticGraph, createJavaScriptSemanticGraphUnknown, sealTransferredJavaScriptSemanticGraphSteps, } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
2
|
+
import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, JAVASCRIPT_SEMANTIC_RELATIONS, } from "../../domain/javascript/javascriptSemanticGraphSchemas.js";
|
|
3
3
|
import { sourceRangesEqual as rangesEqual } from "../../domain/javascript/javascriptStaticAnalysisHelpers.js";
|
|
4
4
|
import { projectSemanticEvents, projectSemanticTimers, } from "./JavaScriptSemanticGraphAsyncProjection.js";
|
|
5
5
|
import { projectSemanticChildProcesses } from "./JavaScriptSemanticGraphChildProcessProjection.js";
|
|
@@ -8,6 +8,9 @@ import { projectSemanticResources } from "./JavaScriptSemanticGraphResourceProje
|
|
|
8
8
|
import { projectSemanticObjects } from "./JavaScriptSemanticGraphObjectProjection.js";
|
|
9
9
|
import { projectSemanticValues } from "./JavaScriptSemanticGraphValueProjection.js";
|
|
10
10
|
import { inferredSemanticEvidenceAt } from "./JavaScriptSemanticGraphEvidence.js";
|
|
11
|
+
import { observedSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
|
|
12
|
+
import { partialApplicationCoverage, } from "../../domain/javascript/javascriptApplicationEvidenceSchemas.js";
|
|
13
|
+
import { javaScriptAnalysisCoverageLimits } from "../../domain/javascript/javascriptAnalysisResourceControls.js";
|
|
11
14
|
import { projectSemanticFunctionFingerprints } from "./JavaScriptSemanticGraphFingerprintProjection.js";
|
|
12
15
|
import { projectSemanticClosureCaptures, projectSemanticFrontiers, projectSemanticPromises, projectSemanticReturnValues, } from "./JavaScriptSemanticGraphFlowProjection.js";
|
|
13
16
|
import { createSemanticCallableOwnerLookup, createSemanticCallSiteLookup, createSemanticNodeRangeLookup, semanticFamilyStatus, } from "./JavaScriptSemanticGraphProjection.js";
|
|
@@ -49,10 +52,13 @@ export const buildJavaScriptSemanticGraph = ({ rootArtifactSha256, applicationGr
|
|
|
49
52
|
};
|
|
50
53
|
/** Accumulate semantic nodes while each source IR is still file-local. */
|
|
51
54
|
export const createJavaScriptSemanticGraphProjection = () => {
|
|
52
|
-
const state = emptyState(
|
|
55
|
+
const state = emptyState();
|
|
53
56
|
const fingerprints = [];
|
|
54
57
|
let truncatedFiles = 0;
|
|
55
|
-
|
|
58
|
+
let unavailableFiles = 0;
|
|
59
|
+
let resourceTruncatedFiles = 0;
|
|
60
|
+
const executionLimits = new Map();
|
|
61
|
+
const projectSourceSteps = function* (file, ir) {
|
|
56
62
|
if (state.nodes.size >= SEMANTIC_GRAPH_NODE_CEILING) {
|
|
57
63
|
truncatedFiles += 1;
|
|
58
64
|
return;
|
|
@@ -60,7 +66,7 @@ export const createJavaScriptSemanticGraphProjection = () => {
|
|
|
60
66
|
const remainingTreeBudget = SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size;
|
|
61
67
|
state.fileNodeBudget = Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, remainingTreeBudget);
|
|
62
68
|
state.fileNodesDropped = false;
|
|
63
|
-
fingerprints.push(...
|
|
69
|
+
fingerprints.push(...(yield* projectFileSteps(file, ir, state)));
|
|
64
70
|
// Nodes were dropped only if the budget actually blocked creation. A file
|
|
65
71
|
// that exactly fills its share ends with a zero budget without dropping
|
|
66
72
|
// anything, so the remaining budget alone cannot decide truncation.
|
|
@@ -72,7 +78,21 @@ export const createJavaScriptSemanticGraphProjection = () => {
|
|
|
72
78
|
bindSemanticGraphApplicationNodes(state, applicationGraph);
|
|
73
79
|
if (state.roots.size === 0)
|
|
74
80
|
addFallbackRoot(rootArtifactSha256, state);
|
|
81
|
+
const relations = [...state.relations.values()];
|
|
75
82
|
const unknowns = [...state.unknowns.values()];
|
|
83
|
+
const retainedByFamily = new Map();
|
|
84
|
+
const unknownIdsByFamily = new Map();
|
|
85
|
+
for (const relation of relations) {
|
|
86
|
+
const family = JAVASCRIPT_SEMANTIC_RELATION_FAMILY[relation.relation];
|
|
87
|
+
retainedByFamily.set(family, (retainedByFamily.get(family) ?? 0) + 1);
|
|
88
|
+
}
|
|
89
|
+
for (const unknown of unknowns) {
|
|
90
|
+
const identifiers = unknownIdsByFamily.get(unknown.family);
|
|
91
|
+
if (identifiers === undefined)
|
|
92
|
+
unknownIdsByFamily.set(unknown.family, [unknown.unknown_id]);
|
|
93
|
+
else
|
|
94
|
+
identifiers.push(unknown.unknown_id);
|
|
95
|
+
}
|
|
76
96
|
const graph = factory({
|
|
77
97
|
schema: "JavaScriptSemanticRelationGraph",
|
|
78
98
|
root_artifact_sha256: rootArtifactSha256,
|
|
@@ -80,32 +100,33 @@ export const createJavaScriptSemanticGraphProjection = () => {
|
|
|
80
100
|
root_node_ids: [...state.roots],
|
|
81
101
|
evidence_contexts: state.evidenceContexts.contexts,
|
|
82
102
|
nodes: [...state.nodes.values()],
|
|
83
|
-
relations
|
|
84
|
-
fingerprints
|
|
103
|
+
relations,
|
|
104
|
+
// The input is transferred to the factory; `fingerprints` is cleared below.
|
|
105
|
+
fingerprints: [...fingerprints],
|
|
85
106
|
unknowns,
|
|
86
107
|
coverage: {
|
|
87
|
-
status: truncatedFiles > 0 ? "partial" : "unknown",
|
|
88
|
-
truncated: truncatedFiles > 0,
|
|
89
|
-
omitted_nodes: truncatedFiles > 0 ? null : 0,
|
|
90
|
-
omitted_relations: truncatedFiles > 0 ? null : 0,
|
|
91
|
-
limits:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
status: truncatedFiles > 0 || unavailableFiles > 0 ? "partial" : "unknown",
|
|
109
|
+
truncated: truncatedFiles > 0 || resourceTruncatedFiles > 0,
|
|
110
|
+
omitted_nodes: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
|
|
111
|
+
omitted_relations: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
|
|
112
|
+
limits: [
|
|
113
|
+
...executionLimits.values(),
|
|
114
|
+
...(truncatedFiles > 0
|
|
115
|
+
? [
|
|
116
|
+
{
|
|
117
|
+
name: "semantic_graph_node_ceiling",
|
|
118
|
+
value: SEMANTIC_GRAPH_NODE_CEILING,
|
|
119
|
+
unit: "items",
|
|
120
|
+
},
|
|
121
|
+
]
|
|
122
|
+
: []),
|
|
123
|
+
],
|
|
100
124
|
families: JAVASCRIPT_SEMANTIC_RELATION_FAMILIES.map((family) => ({
|
|
101
125
|
family,
|
|
102
126
|
status: semanticFamilyStatus(family),
|
|
103
|
-
retained_relations:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
unknown_ids: unknowns
|
|
107
|
-
.filter((unknown) => unknown.family === family)
|
|
108
|
-
.map(({ unknown_id: identifier }) => identifier),
|
|
127
|
+
retained_relations: retainedByFamily.get(family) ?? 0,
|
|
128
|
+
omitted_relations: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
|
|
129
|
+
unknown_ids: unknownIdsByFamily.get(family) ?? [],
|
|
109
130
|
})),
|
|
110
131
|
},
|
|
111
132
|
limitations: [
|
|
@@ -131,12 +152,98 @@ export const createJavaScriptSemanticGraphProjection = () => {
|
|
|
131
152
|
return graph;
|
|
132
153
|
};
|
|
133
154
|
return {
|
|
134
|
-
|
|
155
|
+
remainingFileNodeBudget: () => Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, Math.max(0, SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size)),
|
|
156
|
+
adoptFileProjection: (projection) => {
|
|
157
|
+
const newNodes = projection.nodes.filter(({ node_id }) => !state.nodes.has(node_id));
|
|
158
|
+
if (newNodes.length >
|
|
159
|
+
Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size))
|
|
160
|
+
throw new RangeError("Transferred semantic nodes exceed the offered tree capacity");
|
|
161
|
+
for (const context of projection.evidenceContexts)
|
|
162
|
+
state.evidenceContexts.adopt(context);
|
|
163
|
+
for (const node of newNodes)
|
|
164
|
+
state.nodes.set(node.node_id, node);
|
|
165
|
+
for (const relation of projection.relations)
|
|
166
|
+
state.relations.set(relation.relation_id, relation);
|
|
167
|
+
for (const unknown of projection.unknowns)
|
|
168
|
+
state.unknowns.set(unknown.unknown_id, unknown);
|
|
169
|
+
for (const root of projection.roots)
|
|
170
|
+
state.roots.add(root);
|
|
171
|
+
fingerprints.push(...projection.fingerprints);
|
|
172
|
+
if (projection.truncated)
|
|
173
|
+
truncatedFiles += 1;
|
|
174
|
+
},
|
|
175
|
+
recordUnavailableFile: (file, reason, limits, unknownReason) => {
|
|
176
|
+
const retainedLimits = javaScriptAnalysisCoverageLimits(limits);
|
|
177
|
+
for (const limit of retainedLimits) {
|
|
178
|
+
executionLimits.set(JSON.stringify([limit.name, limit.value, limit.unit]), limit);
|
|
179
|
+
}
|
|
180
|
+
state.fileNodeBudget = Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, Math.max(0, SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size));
|
|
181
|
+
const module = retainNode(state, file, {
|
|
182
|
+
kind: "module",
|
|
183
|
+
roleKey: "module",
|
|
184
|
+
location: null,
|
|
185
|
+
label: file.path,
|
|
186
|
+
functionNodeId: null,
|
|
187
|
+
});
|
|
188
|
+
state.fileNodeBudget = null;
|
|
189
|
+
if (module !== null)
|
|
190
|
+
state.roots.add(module.node_id);
|
|
191
|
+
const evidence = {
|
|
192
|
+
...observedSemanticEvidence(file, null),
|
|
193
|
+
authority: "unknown",
|
|
194
|
+
state: "unknown",
|
|
195
|
+
confidence: "unknown",
|
|
196
|
+
coverage: partialApplicationCoverage(retainedLimits, null),
|
|
197
|
+
limitations: [reason],
|
|
198
|
+
};
|
|
199
|
+
for (const family of JAVASCRIPT_SEMANTIC_RELATION_FAMILIES) {
|
|
200
|
+
const unknown = createJavaScriptSemanticGraphUnknown({
|
|
201
|
+
node_id: module?.node_id ?? null,
|
|
202
|
+
family,
|
|
203
|
+
relation_kinds: JAVASCRIPT_SEMANTIC_RELATIONS.filter((relation) => JAVASCRIPT_SEMANTIC_RELATION_FAMILY[relation] === family),
|
|
204
|
+
reason: unknownReason,
|
|
205
|
+
detail: reason,
|
|
206
|
+
candidate_node_ids: [],
|
|
207
|
+
evidence,
|
|
208
|
+
}, state.evidenceContexts);
|
|
209
|
+
state.unknowns.set(unknown.unknown_id, unknown);
|
|
210
|
+
}
|
|
211
|
+
unavailableFiles += 1;
|
|
212
|
+
if (unknownReason === "resource-limit" && retainedLimits.length > 0)
|
|
213
|
+
resourceTruncatedFiles += 1;
|
|
214
|
+
},
|
|
215
|
+
projectFile: (file, ir) => {
|
|
216
|
+
const steps = projectSourceSteps(file, ir);
|
|
217
|
+
while (steps.next().done !== true)
|
|
218
|
+
;
|
|
219
|
+
},
|
|
220
|
+
projectFileSteps: projectSourceSteps,
|
|
135
221
|
finish: (rootArtifactSha256, applicationGraph) => finishWith(createJavaScriptSemanticGraph, rootArtifactSha256, applicationGraph),
|
|
136
|
-
finishImmutableSteps: (rootArtifactSha256, applicationGraph) => finishWith(
|
|
222
|
+
finishImmutableSteps: (rootArtifactSha256, applicationGraph) => finishWith(sealTransferredJavaScriptSemanticGraphSteps, rootArtifactSha256, applicationGraph),
|
|
137
223
|
};
|
|
138
224
|
};
|
|
139
|
-
|
|
225
|
+
/** Project one source with the parent's remaining node capacity, retaining no full IR. */
|
|
226
|
+
export function* projectJavaScriptSemanticFileSteps(file, ir, nodeBudget) {
|
|
227
|
+
if (!Number.isSafeInteger(nodeBudget) ||
|
|
228
|
+
nodeBudget < 0 ||
|
|
229
|
+
nodeBudget > SEMANTIC_GRAPH_FILE_NODE_CEILING)
|
|
230
|
+
throw new RangeError("File semantic projection requires a valid offered node capacity");
|
|
231
|
+
const state = emptyState();
|
|
232
|
+
state.fileNodeBudget = nodeBudget;
|
|
233
|
+
state.fileNodesDropped = false;
|
|
234
|
+
const fingerprints = yield* projectFileSteps(file, ir, state);
|
|
235
|
+
return {
|
|
236
|
+
roots: [...state.roots],
|
|
237
|
+
evidenceContexts: state.evidenceContexts.contexts,
|
|
238
|
+
nodes: [...state.nodes.values()],
|
|
239
|
+
relations: [...state.relations.values()],
|
|
240
|
+
unknowns: [...state.unknowns.values()],
|
|
241
|
+
fingerprints,
|
|
242
|
+
truncated: Boolean(state.fileNodesDropped),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function* projectFileSteps(file, ir, state) {
|
|
246
|
+
yield;
|
|
140
247
|
const moduleNode = retainNode(state, file, {
|
|
141
248
|
kind: "module",
|
|
142
249
|
roleKey: "module",
|
|
@@ -147,7 +254,12 @@ const projectFile = (file, ir, state) => {
|
|
|
147
254
|
if (moduleNode === null)
|
|
148
255
|
return [];
|
|
149
256
|
state.roots.add(moduleNode.node_id);
|
|
150
|
-
|
|
257
|
+
// Node creation keeps source order, which the per-file node budget relies
|
|
258
|
+
// on; yields between nodes do not change it.
|
|
259
|
+
const callableNodes = new Map();
|
|
260
|
+
for (const [index, callable] of ir.callables.entries()) {
|
|
261
|
+
if (index % 64 === 0)
|
|
262
|
+
yield;
|
|
151
263
|
const node = retainNode(state, file, {
|
|
152
264
|
kind: "function",
|
|
153
265
|
roleKey: `callable:${callable.callableId}`,
|
|
@@ -157,10 +269,14 @@ const projectFile = (file, ir, state) => {
|
|
|
157
269
|
// The label is display text; keep the exact name, which may be "".
|
|
158
270
|
properties: { name: callable.name },
|
|
159
271
|
});
|
|
160
|
-
|
|
161
|
-
|
|
272
|
+
if (node !== null)
|
|
273
|
+
callableNodes.set(callable.callableId, node);
|
|
274
|
+
}
|
|
162
275
|
const callableOwnerAt = createSemanticCallableOwnerLookup(ir, callableNodes);
|
|
163
|
-
const bindingNodes = new Map(
|
|
276
|
+
const bindingNodes = new Map();
|
|
277
|
+
for (const [index, binding] of ir.bindings.entries()) {
|
|
278
|
+
if (index % 64 === 0)
|
|
279
|
+
yield;
|
|
164
280
|
const location = binding.definitions[0]?.location ?? null;
|
|
165
281
|
const kind = binding.kind === "parameter" ? "parameter" : "binding";
|
|
166
282
|
const owner = callableOwnerAt(location);
|
|
@@ -171,10 +287,11 @@ const projectFile = (file, ir, state) => {
|
|
|
171
287
|
label: binding.name,
|
|
172
288
|
functionNodeId: owner?.node_id ?? null,
|
|
173
289
|
});
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const
|
|
290
|
+
if (node !== null)
|
|
291
|
+
bindingNodes.set(binding.bindingId, node);
|
|
292
|
+
}
|
|
293
|
+
const returnSiteNodes = yield* createReturnSiteNodes(file, ir, callableNodes, state);
|
|
294
|
+
const callSiteNodes = yield* createCallSiteNodes(file, ir, callableNodes, state);
|
|
178
295
|
const definitions = {
|
|
179
296
|
file,
|
|
180
297
|
ir,
|
|
@@ -193,29 +310,28 @@ const projectFile = (file, ir, state) => {
|
|
|
193
310
|
callableOwnerAt,
|
|
194
311
|
callSiteAt: createSemanticCallSiteLookup(ir, callSiteNodes),
|
|
195
312
|
};
|
|
196
|
-
projectDefinitionsAndReferences(definitions);
|
|
313
|
+
yield* projectDefinitionsAndReferences(definitions);
|
|
197
314
|
const context = {
|
|
198
315
|
...definitions,
|
|
199
316
|
referenceNodesWithin: createSemanticNodeRangeLookup(definitions.referenceNodes),
|
|
200
317
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
projectSemanticResources(context);
|
|
212
|
-
projectSemanticClosureCaptures(context);
|
|
213
|
-
projectSemanticFrontiers(context);
|
|
318
|
+
// Each pass completes before the next starts, so yielding between passes
|
|
319
|
+
// keeps projection order and results unchanged.
|
|
320
|
+
for (const project of FILE_PROJECTION_PASSES) {
|
|
321
|
+
yield;
|
|
322
|
+
const steps = project(context);
|
|
323
|
+
if (steps !== undefined)
|
|
324
|
+
while (steps.next().done !== true)
|
|
325
|
+
yield;
|
|
326
|
+
}
|
|
327
|
+
yield;
|
|
214
328
|
return projectSemanticFunctionFingerprints(file, ir, callableNodes, state.evidenceContexts);
|
|
215
|
-
}
|
|
216
|
-
|
|
329
|
+
}
|
|
330
|
+
function* createReturnSiteNodes(file, ir, callables, state) {
|
|
217
331
|
const result = new Map();
|
|
218
|
-
for (const callable of ir.callables) {
|
|
332
|
+
for (const [index, callable] of ir.callables.entries()) {
|
|
333
|
+
if (index % 64 === 0)
|
|
334
|
+
yield;
|
|
219
335
|
const owner = callables.get(callable.callableId);
|
|
220
336
|
if (owner === undefined)
|
|
221
337
|
continue;
|
|
@@ -233,10 +349,12 @@ const createReturnSiteNodes = (file, ir, callables, state) => {
|
|
|
233
349
|
}
|
|
234
350
|
}
|
|
235
351
|
return result;
|
|
236
|
-
}
|
|
237
|
-
|
|
352
|
+
}
|
|
353
|
+
function* createCallSiteNodes(file, ir, callables, state) {
|
|
238
354
|
const result = new Map();
|
|
239
|
-
for (const call of ir.callSites) {
|
|
355
|
+
for (const [index, call] of ir.callSites.entries()) {
|
|
356
|
+
if (index % 64 === 0)
|
|
357
|
+
yield;
|
|
240
358
|
const owner = call.callerCallableId === null
|
|
241
359
|
? null
|
|
242
360
|
: (callables.get(call.callerCallableId)?.node_id ?? null);
|
|
@@ -251,9 +369,11 @@ const createCallSiteNodes = (file, ir, callables, state) => {
|
|
|
251
369
|
result.set(call.callSiteId, node);
|
|
252
370
|
}
|
|
253
371
|
return result;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
for (const binding of context.ir.bindings) {
|
|
372
|
+
}
|
|
373
|
+
function* projectDefinitionsAndReferences(context) {
|
|
374
|
+
for (const [bindingIndex, binding] of context.ir.bindings.entries()) {
|
|
375
|
+
if (bindingIndex % 64 === 0)
|
|
376
|
+
yield;
|
|
257
377
|
const bindingNode = context.bindingNodes.get(binding.bindingId);
|
|
258
378
|
if (bindingNode === undefined)
|
|
259
379
|
continue;
|
|
@@ -274,6 +394,8 @@ const projectDefinitionsAndReferences = (context) => {
|
|
|
274
394
|
}
|
|
275
395
|
}
|
|
276
396
|
for (const [index, reference] of context.ir.references.entries()) {
|
|
397
|
+
if (index % 64 === 0)
|
|
398
|
+
yield;
|
|
277
399
|
const expression = retainNode(context.state, context.file, {
|
|
278
400
|
kind: "expression",
|
|
279
401
|
roleKey: `reference:${String(index)}:${reference.role}:${reference.name}`,
|
|
@@ -304,7 +426,7 @@ const projectDefinitionsAndReferences = (context) => {
|
|
|
304
426
|
resolution: "resolved",
|
|
305
427
|
});
|
|
306
428
|
}
|
|
307
|
-
}
|
|
429
|
+
}
|
|
308
430
|
const projectCalls = (context) => {
|
|
309
431
|
for (const call of context.ir.callSites) {
|
|
310
432
|
const callNode = context.callSiteNodes.get(call.callSiteId);
|
|
@@ -371,3 +493,19 @@ const createArgumentNode = (context, callNode, callSiteId, argument) => retainNo
|
|
|
371
493
|
: `argument ${String(argument.index)}`,
|
|
372
494
|
functionNodeId: callNode.function_node_id,
|
|
373
495
|
});
|
|
496
|
+
/** Per-file projection passes, run in this order with a yield between each. */
|
|
497
|
+
const FILE_PROJECTION_PASSES = [
|
|
498
|
+
projectSemanticValues,
|
|
499
|
+
projectSemanticObjects,
|
|
500
|
+
projectCalls,
|
|
501
|
+
projectSemanticPromises,
|
|
502
|
+
projectSemanticEvents,
|
|
503
|
+
projectSemanticTimers,
|
|
504
|
+
projectSemanticChildProcesses,
|
|
505
|
+
projectSemanticConfiguration,
|
|
506
|
+
projectSemanticRequests,
|
|
507
|
+
projectSemanticBoundaries,
|
|
508
|
+
projectSemanticResources,
|
|
509
|
+
projectSemanticClosureCaptures,
|
|
510
|
+
projectSemanticFrontiers,
|
|
511
|
+
];
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import { javascriptDisplayText } from "../../domain/javascript/javascriptAstValues.js";
|
|
2
2
|
import { createJavaScriptSemanticGraphNode, createJavaScriptSemanticGraphRelation, JavaScriptSemanticEvidenceContextRegistry, javaScriptSemanticNodeId, } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
3
3
|
import { inferredSemanticEvidence, observedSemanticEvidence, unavailableSemanticRootEvidence, } from "./JavaScriptSemanticGraphEvidence.js";
|
|
4
|
-
/** Create empty projection state
|
|
5
|
-
export const createSemanticGraphProjectionState = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
roots: new Set(),
|
|
13
|
-
applicationNodeIdsByLocation: index.identifiers,
|
|
14
|
-
};
|
|
15
|
-
};
|
|
4
|
+
/** Create empty projection state; application-node links are bound at finish. */
|
|
5
|
+
export const createSemanticGraphProjectionState = () => ({
|
|
6
|
+
nodes: new Map(),
|
|
7
|
+
relations: new Map(),
|
|
8
|
+
unknowns: new Map(),
|
|
9
|
+
evidenceContexts: new JavaScriptSemanticEvidenceContextRegistry(),
|
|
10
|
+
roots: new Set(),
|
|
11
|
+
});
|
|
16
12
|
/** Bind retained semantic identities after all application observations exist. */
|
|
17
13
|
export const bindSemanticGraphApplicationNodes = (state, applicationGraph) => {
|
|
18
|
-
const
|
|
14
|
+
const applicationNodeIdsByLocation = indexApplicationNodes(applicationGraph.nodes);
|
|
19
15
|
for (const [identifier, node] of state.nodes) {
|
|
20
16
|
state.nodes.set(identifier, {
|
|
21
17
|
...node,
|
|
22
18
|
application_node_ids: [
|
|
23
|
-
...(
|
|
19
|
+
...(applicationNodeIdsByLocation.get(applicationLocationKey(node.identity.artifact_sha256, node.identity.module_path, node.identity.source_range)) ?? []),
|
|
24
20
|
],
|
|
25
21
|
});
|
|
26
22
|
}
|
|
@@ -35,7 +31,7 @@ export const constructSemanticGraphNode = (file, input, state) => createJavaScri
|
|
|
35
31
|
role_key: input.roleKey,
|
|
36
32
|
},
|
|
37
33
|
function_node_id: input.functionNodeId,
|
|
38
|
-
application_node_ids:
|
|
34
|
+
application_node_ids: [],
|
|
39
35
|
label: input.label === null ? null : javascriptDisplayText(input.label),
|
|
40
36
|
properties: input.properties ?? {},
|
|
41
37
|
evidence: observedSemanticEvidence(file, input.location),
|
|
@@ -144,11 +140,8 @@ const indexApplicationNodes = (nodes) => {
|
|
|
144
140
|
const sorted = [...values].sort();
|
|
145
141
|
return [key, sorted];
|
|
146
142
|
}));
|
|
147
|
-
return
|
|
143
|
+
return indexed;
|
|
148
144
|
};
|
|
149
|
-
const matchingApplicationNodeIds = (file, input, state) => [
|
|
150
|
-
...(state.applicationNodeIdsByLocation.get(applicationLocationKey(file.sha256, file.path, input.location)) ?? []),
|
|
151
|
-
];
|
|
152
145
|
const addApplicationNodeIdentifier = (identifiers, key, nodeId) => {
|
|
153
146
|
const values = identifiers.get(key) ?? new Set();
|
|
154
147
|
values.add(nodeId);
|
|
@@ -97,7 +97,10 @@ const addRequestNode = (context, operation) => retainSemanticGraphNode(context.s
|
|
|
97
97
|
kind: operation.kind === "request" ? "request" : "response",
|
|
98
98
|
roleKey: operation.requestId,
|
|
99
99
|
location: operation.location,
|
|
100
|
-
label: operation.endpoint
|
|
100
|
+
label: operation.endpoint !== null &&
|
|
101
|
+
operation.endpoint.length <= operation.method.length
|
|
102
|
+
? operation.endpoint
|
|
103
|
+
: operation.method,
|
|
101
104
|
functionNodeId: operation.ownerCallableId === null
|
|
102
105
|
? null
|
|
103
106
|
: (context.callableNodes.get(operation.ownerCallableId)?.node_id ??
|
|
@@ -151,8 +151,10 @@ export const projectSemanticClosureCaptures = (context) => {
|
|
|
151
151
|
});
|
|
152
152
|
};
|
|
153
153
|
/** Retain bounded unresolved dynamic-call, dynamic-property and dynamic-scope frontiers. */
|
|
154
|
-
export
|
|
155
|
-
for (const frontier of context.ir.frontiers) {
|
|
154
|
+
export function* projectSemanticFrontiers(context) {
|
|
155
|
+
for (const [index, frontier] of context.ir.frontiers.entries()) {
|
|
156
|
+
if (index % 64 === 0)
|
|
157
|
+
yield;
|
|
156
158
|
// Dynamic environments leave identifier reads and writes unresolved.
|
|
157
159
|
const family = frontier.kind === "dynamic-call"
|
|
158
160
|
? "call-flow"
|
|
@@ -178,4 +180,4 @@ export const projectSemanticFrontiers = (context) => {
|
|
|
178
180
|
}, context.state.evidenceContexts);
|
|
179
181
|
addSemanticGraphUnknown(context.state, unknown);
|
|
180
182
|
}
|
|
181
|
-
}
|
|
183
|
+
}
|
|
@@ -4,9 +4,11 @@ import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnkn
|
|
|
4
4
|
import { unknownSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
|
|
5
5
|
import { semanticPropertySlot } from "./JavaScriptSemanticGraphValueProjection.js";
|
|
6
6
|
/** Project static object reads, writes, spreads, and destructuring. */
|
|
7
|
-
export
|
|
7
|
+
export function* projectSemanticObjects(context) {
|
|
8
8
|
const values = new Map(context.ir.bindings.map((binding) => [binding.bindingId, binding.value]));
|
|
9
|
-
for (const operation of context.ir.objectOperations) {
|
|
9
|
+
for (const [index, operation] of context.ir.objectOperations.entries()) {
|
|
10
|
+
if (index % 64 === 0)
|
|
11
|
+
yield;
|
|
10
12
|
const occurrence = addObjectOccurrence(context, operation);
|
|
11
13
|
const target = objectTarget(context, values, operation);
|
|
12
14
|
const ends = objectRelationEnds(context, operation, occurrence, target);
|
|
@@ -22,7 +24,7 @@ export const projectSemanticObjects = (context) => {
|
|
|
22
24
|
if (!resolved)
|
|
23
25
|
addObjectUnknown(context, operation, target.slot ?? occurrence, target);
|
|
24
26
|
}
|
|
25
|
-
}
|
|
27
|
+
}
|
|
26
28
|
const OBJECT_RELATIONS = {
|
|
27
29
|
read: "reads-property",
|
|
28
30
|
write: "writes-property",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { semanticContainer, semanticPropertyPointer, } from "../../domain/javascript/javascriptSemanticSlots.js";
|
|
2
|
+
import { digestCanonicalValue } from "../../domain/canonicalDigest.js";
|
|
2
3
|
import { createJavaScriptSemanticGraphUnknown } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
3
4
|
import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, } from "./JavaScriptSemanticGraphConstruction.js";
|
|
4
5
|
import { observedSemanticEvidence, unknownSemanticEvidence, } from "./JavaScriptSemanticGraphEvidence.js";
|
|
@@ -98,14 +99,24 @@ const projectValue = (input) => {
|
|
|
98
99
|
}, context.state.evidenceContexts));
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
|
-
const addLiteralNode = (context, binding, value, role) =>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
const addLiteralNode = (context, binding, value, role) => {
|
|
103
|
+
const encodedValue = JSON.stringify(value);
|
|
104
|
+
const valueDigest = `value-sha256:${digestCanonicalValue(value, "Semantic literal")}`;
|
|
105
|
+
const valueKey = encodedValue.length <= valueDigest.length ? encodedValue : valueDigest;
|
|
106
|
+
const stringLabel = "string literal";
|
|
107
|
+
return retainSemanticGraphNode(context.state, context.file, {
|
|
108
|
+
kind: "literal",
|
|
109
|
+
// Identity needs an exact value commitment, not another payload copy.
|
|
110
|
+
// Keep the complete literal in properties for queries and Evidence export.
|
|
111
|
+
roleKey: `literal:${binding.bindingId}:${role}:${valueKey}`,
|
|
112
|
+
location: binding.definitions[0]?.location ?? null,
|
|
113
|
+
label: typeof value === "string" && encodedValue.length > stringLabel.length
|
|
114
|
+
? stringLabel
|
|
115
|
+
: encodedValue,
|
|
116
|
+
functionNodeId: context.bindingNodes.get(binding.bindingId)?.function_node_id ?? null,
|
|
117
|
+
properties: { value },
|
|
118
|
+
});
|
|
119
|
+
};
|
|
109
120
|
/** Create one canonical slot for a root binding and exact static property path. */
|
|
110
121
|
export const semanticPropertySlot = (context, objectBindingId, path, fact) => retainSemanticGraphNode(context.state, context.file, {
|
|
111
122
|
kind: "property-slot",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jebRequestSchema, } from "../../domain/jeb/jebAnalysis.js";
|
|
2
|
+
import { executeProviderOperation } from "../ProviderOperationExecution.js";
|
|
3
|
+
/** Shared CLI/MCP admission, execution and Evidence composition for JEB. */
|
|
4
|
+
export class JebAnalysisService {
|
|
5
|
+
provider;
|
|
6
|
+
constructor(provider) {
|
|
7
|
+
this.provider = provider;
|
|
8
|
+
}
|
|
9
|
+
/** Run one caller-selected JEB request and retain engine provenance inline. */
|
|
10
|
+
async execute(operation, input, options) {
|
|
11
|
+
return executeProviderOperation(operation, input, options, jebRequestSchema, this.provider, operation === "decompile_jeb_item" ? "derived" : "observed");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AnalysisProtocolError } from "../../domain/analysisErrorCore.js";
|
|
3
3
|
import {} from "../../domain/analysisErrorBase.js";
|
|
4
|
-
import { createEvidence } from "../../domain/evidence.js";
|
|
4
|
+
import { createEvidence, } from "../../domain/evidence.js";
|
|
5
5
|
import { jsonValueSchema } from "../../domain/jsonValue.js";
|
|
6
6
|
import { managedApplicationGraphResultSchema, projectManagedApplicationGraph, projectManagedApplicationGraphInputSchema, } from "../../domain/managed/managedApplicationGraph.js";
|
|
7
7
|
import { err, ok } from "../../domain/result.js";
|
|
@@ -35,14 +35,23 @@ export const traceNativeUiAction = async (analysis, input, signal) => {
|
|
|
35
35
|
if (decoded.data.target_sha256 !== targetSha256)
|
|
36
36
|
return err(new AnalysisOutputError("decode_interface_builder", "UI and native provider results refer to different target SHA-256 values"));
|
|
37
37
|
graph = joinInterfaceBuilderDispatch(decoded.data.graph, metadata.result);
|
|
38
|
+
const archiveDecode = decoded.data.graph.coverage.find((facet) => facet.facet === "archive_decode");
|
|
39
|
+
const documentsFound = decoded.data.documents.length > 0;
|
|
38
40
|
coverage.push({
|
|
39
41
|
facet: "interface_builder_archives",
|
|
40
|
-
status:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
status: archiveDecode?.status === "partial" ||
|
|
43
|
+
archiveDecode?.status === "complete" ||
|
|
44
|
+
archiveDecode?.status === "unsupported"
|
|
45
|
+
? archiveDecode.status
|
|
46
|
+
: documentsFound
|
|
47
|
+
? "complete"
|
|
48
|
+
: "unsupported",
|
|
49
|
+
reason: archiveDecode?.reason ??
|
|
50
|
+
(documentsFound
|
|
51
|
+
? null
|
|
52
|
+
: "no_compiled_interface_builder_archives_found"),
|
|
53
|
+
examined: archiveDecode?.examined ?? decoded.data.documents.length,
|
|
54
|
+
omitted: archiveDecode?.omitted ?? 0,
|
|
46
55
|
});
|
|
47
56
|
const bounded = boundUiGraph(graph, input.max_nodes, input.max_edges);
|
|
48
57
|
graph = bounded.graph;
|
|
@@ -218,8 +227,7 @@ const resolveUiAction = (graph, query) => {
|
|
|
218
227
|
};
|
|
219
228
|
const objectMatches = graph.nodes.filter((node) => ["control", "view", "view_controller", "scene"].includes(node.kind) &&
|
|
220
229
|
(node.id === query ||
|
|
221
|
-
node.attributes.interface_builder_object_id === query
|
|
222
|
-
node.id.endsWith(`:object:${query}`)));
|
|
230
|
+
node.attributes.interface_builder_object_id === query));
|
|
223
231
|
const actionIds = new Set(graph.edges.flatMap((edge) => edge.resolution === "observed" &&
|
|
224
232
|
edge.relation === "target_action" &&
|
|
225
233
|
objectMatches.some(({ id }) => edge.from === id) &&
|