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
|
@@ -5,8 +5,9 @@ import { uniqueSorted } from "../canonicalOrdering.js";
|
|
|
5
5
|
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
6
6
|
import { canonicalJsonDigestSteps } from "../canonicalJsonDigestSteps.js";
|
|
7
7
|
import { freezeOwnedJsonSnapshotSteps } from "../immutableJson.js";
|
|
8
|
+
import { arrayContainerSchema, parseElementSteps, } from "../zodCollectionSteps.js";
|
|
8
9
|
import { applicationGraphEvidenceSchema } from "./javascriptApplicationEvidenceSchemas.js";
|
|
9
|
-
import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, javaScriptSemanticFingerprintInputSchema,
|
|
10
|
+
import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, javaScriptSemanticFingerprintInputSchema, javaScriptSemanticEvidenceContextSchema, javaScriptSemanticGraphInputSchema, javaScriptSemanticGraphRecordSchema, javaScriptSemanticNodeInputSchema, javaScriptSemanticRelationInputSchema, javaScriptSemanticUnknownInputSchema, } from "./javascriptSemanticGraphSchemas.js";
|
|
10
11
|
const normalizeEvidence = (evidence) => ({
|
|
11
12
|
...evidence,
|
|
12
13
|
coverage: {
|
|
@@ -20,18 +21,24 @@ const evidenceContextId = (context) => `jsrg_evidence_${digestCanonicalValue(con
|
|
|
20
21
|
/** Graph-scoped owner for canonical provenance shared by semantic facts. */
|
|
21
22
|
export class JavaScriptSemanticEvidenceContextRegistry {
|
|
22
23
|
#contexts = new Map();
|
|
24
|
+
// Facts share a few contexts, so key them by canonical text and hash each
|
|
25
|
+
// distinct context once instead of on every fact.
|
|
26
|
+
#idsByCanonicalContext = new Map();
|
|
23
27
|
/** Intern normalized non-location provenance at fact construction. */
|
|
24
28
|
intern(evidence) {
|
|
25
29
|
const normalized = normalizeEvidence(evidence);
|
|
26
30
|
const { location, ...context } = normalized;
|
|
31
|
+
const canonicalContext = canonicalJson(context, "JavaScript semantic graph");
|
|
32
|
+
const internedId = this.#idsByCanonicalContext.get(canonicalContext);
|
|
33
|
+
if (internedId !== undefined)
|
|
34
|
+
return { context_id: internedId, location };
|
|
27
35
|
const contextId = evidenceContextId(context);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
canonicalJson(existing, "JavaScript semantic graph") !==
|
|
32
|
-
canonicalJson(row, "JavaScript semantic graph"))
|
|
36
|
+
// This canonical context is new, so a row already stored under its
|
|
37
|
+
// digest holds different provenance.
|
|
38
|
+
if (this.#contexts.has(contextId))
|
|
33
39
|
throw new TypeError("JavaScript semantic evidence context digest collision");
|
|
34
|
-
this.#contexts.set(contextId,
|
|
40
|
+
this.#contexts.set(contextId, { ...context, context_id: contextId });
|
|
41
|
+
this.#idsByCanonicalContext.set(canonicalContext, contextId);
|
|
35
42
|
return { context_id: contextId, location };
|
|
36
43
|
}
|
|
37
44
|
/** Resolve one already interned fact reference for derived evidence. */
|
|
@@ -49,6 +56,24 @@ export class JavaScriptSemanticEvidenceContextRegistry {
|
|
|
49
56
|
/** Release interned contexts after the owning graph is finalized. */
|
|
50
57
|
clear() {
|
|
51
58
|
this.#contexts.clear();
|
|
59
|
+
this.#idsByCanonicalContext.clear();
|
|
60
|
+
}
|
|
61
|
+
/** Validate and intern provenance decoded in this realm from an analysis worker. */
|
|
62
|
+
adopt(input) {
|
|
63
|
+
const context = javaScriptSemanticEvidenceContextSchema.parse(input);
|
|
64
|
+
const { context_id: identifier, ...value } = context;
|
|
65
|
+
if (identifier !== evidenceContextId(value))
|
|
66
|
+
throw new TypeError("Transferred semantic evidence context identifier is stale");
|
|
67
|
+
const canonical = canonicalJson(value, "JavaScript semantic evidence context");
|
|
68
|
+
const existing = this.#contexts.get(identifier);
|
|
69
|
+
if (existing !== undefined) {
|
|
70
|
+
const { context_id: _existingIdentifier, ...existingValue } = existing;
|
|
71
|
+
if (canonical !==
|
|
72
|
+
canonicalJson(existingValue, "JavaScript semantic evidence context"))
|
|
73
|
+
throw new TypeError("Transferred semantic evidence context digest collision");
|
|
74
|
+
}
|
|
75
|
+
this.#contexts.set(identifier, context);
|
|
76
|
+
this.#idsByCanonicalContext.set(canonical, identifier);
|
|
52
77
|
}
|
|
53
78
|
}
|
|
54
79
|
/** Derive a semantic node ID from its kind and exact artifact identity. */
|
|
@@ -60,15 +85,11 @@ export const createJavaScriptSemanticGraphNode = (input, evidenceContexts) => {
|
|
|
60
85
|
...parsed,
|
|
61
86
|
application_node_ids: uniqueSorted(parsed.application_node_ids),
|
|
62
87
|
evidence: evidenceContexts.intern(parsed.evidence),
|
|
63
|
-
identifier_strategy: {
|
|
64
|
-
strategy: "semantic-content-sha256",
|
|
65
|
-
stability: "artifact-version",
|
|
66
|
-
},
|
|
67
88
|
};
|
|
68
|
-
return
|
|
89
|
+
return {
|
|
69
90
|
...semantic,
|
|
70
91
|
node_id: javaScriptSemanticNodeId(semantic),
|
|
71
|
-
}
|
|
92
|
+
};
|
|
72
93
|
};
|
|
73
94
|
/** Normalize one semantic relationship and derive its exact identifier. */
|
|
74
95
|
export const createJavaScriptSemanticGraphRelation = (input, evidenceContexts) => {
|
|
@@ -76,15 +97,11 @@ export const createJavaScriptSemanticGraphRelation = (input, evidenceContexts) =
|
|
|
76
97
|
const semantic = {
|
|
77
98
|
...parsed,
|
|
78
99
|
evidence: evidenceContexts.intern(parsed.evidence),
|
|
79
|
-
identifier_strategy: {
|
|
80
|
-
strategy: "semantic-content-sha256",
|
|
81
|
-
stability: "relationship-exact",
|
|
82
|
-
},
|
|
83
100
|
};
|
|
84
|
-
return
|
|
101
|
+
return {
|
|
85
102
|
...semantic,
|
|
86
103
|
relation_id: `jsrg_relation_${digestCanonicalValue(semantic, "JavaScript semantic graph")}`,
|
|
87
|
-
}
|
|
104
|
+
};
|
|
88
105
|
};
|
|
89
106
|
/** Normalize one unresolved semantic frontier and derive its identifier. */
|
|
90
107
|
export const createJavaScriptSemanticGraphUnknown = (input, evidenceContexts) => {
|
|
@@ -95,10 +112,10 @@ export const createJavaScriptSemanticGraphUnknown = (input, evidenceContexts) =>
|
|
|
95
112
|
candidate_node_ids: uniqueSorted(parsed.candidate_node_ids),
|
|
96
113
|
evidence: evidenceContexts.intern(parsed.evidence),
|
|
97
114
|
};
|
|
98
|
-
return
|
|
115
|
+
return {
|
|
99
116
|
...semantic,
|
|
100
117
|
unknown_id: `jsrg_unknown_${digestCanonicalValue(semantic, "JavaScript semantic graph")}`,
|
|
101
|
-
}
|
|
118
|
+
};
|
|
102
119
|
};
|
|
103
120
|
/** Normalize one function fingerprint and derive its component commitment. */
|
|
104
121
|
export const createJavaScriptSemanticFingerprint = (input, evidenceContexts) => {
|
|
@@ -113,7 +130,7 @@ export const createJavaScriptSemanticFingerprint = (input, evidenceContexts) =>
|
|
|
113
130
|
evidence: evidenceContexts.intern(parsed.evidence),
|
|
114
131
|
};
|
|
115
132
|
const fingerprintSha256 = digestCanonicalValue(semantic.components, "JavaScript semantic graph");
|
|
116
|
-
return
|
|
133
|
+
return {
|
|
117
134
|
...semantic,
|
|
118
135
|
fingerprint_sha256: fingerprintSha256,
|
|
119
136
|
fingerprint_id: `jsrg_fingerprint_${digestCanonicalValue({
|
|
@@ -121,7 +138,7 @@ export const createJavaScriptSemanticFingerprint = (input, evidenceContexts) =>
|
|
|
121
138
|
algorithm: semantic.algorithm,
|
|
122
139
|
fingerprint_sha256: fingerprintSha256,
|
|
123
140
|
}, "JavaScript semantic graph")}`,
|
|
124
|
-
}
|
|
141
|
+
};
|
|
125
142
|
};
|
|
126
143
|
const sortedUniqueIssue = (values, path, label, context) => {
|
|
127
144
|
for (let index = 1; index < values.length; index += 1) {
|
|
@@ -504,8 +521,37 @@ export const createJavaScriptSemanticGraph = (input) => {
|
|
|
504
521
|
return record;
|
|
505
522
|
};
|
|
506
523
|
const validatedImmutableSemanticGraphs = new WeakSet();
|
|
524
|
+
const semanticGraphShape = javaScriptSemanticGraphInputSchema.shape;
|
|
525
|
+
const semanticGraphContainerSchema = javaScriptSemanticGraphInputSchema.extend({
|
|
526
|
+
evidence_contexts: arrayContainerSchema(semanticGraphShape.evidence_contexts),
|
|
527
|
+
nodes: arrayContainerSchema(semanticGraphShape.nodes),
|
|
528
|
+
relations: arrayContainerSchema(semanticGraphShape.relations),
|
|
529
|
+
fingerprints: arrayContainerSchema(semanticGraphShape.fingerprints),
|
|
530
|
+
unknowns: arrayContainerSchema(semanticGraphShape.unknowns),
|
|
531
|
+
});
|
|
507
532
|
/** Clone input synchronously; commit, check and seal the owned graph in steps. */
|
|
508
533
|
export const createImmutableJavaScriptSemanticGraphSteps = (input) => validateAndSealSemanticGraphSteps(normalizeGraphInput(javaScriptSemanticGraphInputSchema.parse(input)));
|
|
534
|
+
/**
|
|
535
|
+
* Seal a graph whose input the caller transfers: the caller neither retains nor
|
|
536
|
+
* mutates any part of it afterwards. Only the graph's own fields are validated
|
|
537
|
+
* synchronously; collection elements are validated and cloned in steps, because
|
|
538
|
+
* a whole-graph parse of a large application held the event loop for seconds.
|
|
539
|
+
*/
|
|
540
|
+
export const sealTransferredJavaScriptSemanticGraphSteps = (input) => parseAndSealSemanticGraphSteps(semanticGraphContainerSchema.parse(input));
|
|
541
|
+
function* parseAndSealSemanticGraphSteps(container) {
|
|
542
|
+
const issues = [];
|
|
543
|
+
const parsed = {
|
|
544
|
+
...container,
|
|
545
|
+
evidence_contexts: yield* parseElementSteps(semanticGraphShape.evidence_contexts.element, container.evidence_contexts, ["evidence_contexts"], issues),
|
|
546
|
+
nodes: yield* parseElementSteps(semanticGraphShape.nodes.element, container.nodes, ["nodes"], issues),
|
|
547
|
+
relations: yield* parseElementSteps(semanticGraphShape.relations.element, container.relations, ["relations"], issues),
|
|
548
|
+
fingerprints: yield* parseElementSteps(semanticGraphShape.fingerprints.element, container.fingerprints, ["fingerprints"], issues),
|
|
549
|
+
unknowns: yield* parseElementSteps(semanticGraphShape.unknowns.element, container.unknowns, ["unknowns"], issues),
|
|
550
|
+
};
|
|
551
|
+
if (issues.length > 0)
|
|
552
|
+
throw new z.ZodError(issues);
|
|
553
|
+
return yield* validateAndSealSemanticGraphSteps(normalizeGraphInput(parsed));
|
|
554
|
+
}
|
|
509
555
|
function* validateAndSealSemanticGraphSteps(semantic) {
|
|
510
556
|
const graph = {
|
|
511
557
|
...semantic,
|
|
@@ -201,11 +201,7 @@ export const javaScriptSemanticNodeInputSchema = z.strictObject({
|
|
|
201
201
|
/** One exact, artifact-version semantic entity. */
|
|
202
202
|
export const javaScriptSemanticNodeSchema = javaScriptSemanticNodeInputSchema.extend({
|
|
203
203
|
evidence: javaScriptSemanticEvidenceReferenceSchema,
|
|
204
|
-
node_id: semanticNodeIdSchema,
|
|
205
|
-
identifier_strategy: z.strictObject({
|
|
206
|
-
strategy: z.literal("semantic-content-sha256"),
|
|
207
|
-
stability: z.literal("artifact-version"),
|
|
208
|
-
}),
|
|
204
|
+
node_id: semanticNodeIdSchema.describe("SHA-256 of the node kind and identity; stable for one artifact version."),
|
|
209
205
|
});
|
|
210
206
|
/** One directed semantic relationship before its ID is derived. */
|
|
211
207
|
export const javaScriptSemanticRelationInputSchema = z.strictObject({
|
|
@@ -219,11 +215,7 @@ export const javaScriptSemanticRelationInputSchema = z.strictObject({
|
|
|
219
215
|
/** One canonical directed semantic relationship. */
|
|
220
216
|
export const javaScriptSemanticRelationSchema = javaScriptSemanticRelationInputSchema.extend({
|
|
221
217
|
evidence: javaScriptSemanticEvidenceReferenceSchema,
|
|
222
|
-
relation_id: semanticRelationIdSchema,
|
|
223
|
-
identifier_strategy: z.strictObject({
|
|
224
|
-
strategy: z.literal("semantic-content-sha256"),
|
|
225
|
-
stability: z.literal("relationship-exact"),
|
|
226
|
-
}),
|
|
218
|
+
relation_id: semanticRelationIdSchema.describe("SHA-256 of the exact relation content, including its evidence reference."),
|
|
227
219
|
});
|
|
228
220
|
/** Reasons semantic analysis can leave an explicit frontier. */
|
|
229
221
|
export const JAVASCRIPT_SEMANTIC_UNKNOWN_REASONS = [
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
-
import { semanticStaticPropertyKey } from "./javascriptAstValues.js";
|
|
3
|
-
import { semanticArrayIndex } from "./javascriptSemanticPropertyPaths.js";
|
|
4
|
-
|
|
2
|
+
import { semanticObjectPatternKeys, semanticStaticPropertyKey, } from "./javascriptAstValues.js";
|
|
3
|
+
import { semanticArrayIndex, } from "./javascriptSemanticPropertyPaths.js";
|
|
4
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
5
|
+
const add = (sources, source, mutation, guards, kind = "iteration") => {
|
|
5
6
|
sources.push({
|
|
7
|
+
kind,
|
|
6
8
|
node: source.node,
|
|
7
9
|
projection: source.projection,
|
|
8
10
|
mutation,
|
|
@@ -25,6 +27,21 @@ const project = (source, key) => {
|
|
|
25
27
|
};
|
|
26
28
|
const visit = (context, pattern, source, guards = {}) => {
|
|
27
29
|
const { sources, mutation } = context;
|
|
30
|
+
if (t.isMemberExpression(pattern)) {
|
|
31
|
+
// Property stores have no lexical alias binding. Preserve the selected
|
|
32
|
+
// reference's escape rather than claiming later writes cannot reach it.
|
|
33
|
+
if (source !== undefined)
|
|
34
|
+
add(sources, source.restStartIndex === undefined
|
|
35
|
+
? source
|
|
36
|
+
: {
|
|
37
|
+
node: source.node,
|
|
38
|
+
projection: [
|
|
39
|
+
...source.projection,
|
|
40
|
+
{ excludedKeys: [], startIndex: source.restStartIndex },
|
|
41
|
+
],
|
|
42
|
+
}, mutation, guards, "reference-store");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
28
45
|
if (t.isTSParameterProperty(pattern)) {
|
|
29
46
|
visit(context, pattern.parameter, source, guards);
|
|
30
47
|
return;
|
|
@@ -48,9 +65,24 @@ const visit = (context, pattern, source, guards = {}) => {
|
|
|
48
65
|
}
|
|
49
66
|
if (t.isObjectPattern(pattern)) {
|
|
50
67
|
for (const property of pattern.properties) {
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
if (t.isRestElement(property)) {
|
|
69
|
+
// A rest copy owns its scalar slots; only selected child references
|
|
70
|
+
// escape when that fresh copy is stored through a member target.
|
|
71
|
+
visit(context, property.argument, source === undefined
|
|
72
|
+
? undefined
|
|
73
|
+
: {
|
|
74
|
+
node: source.node,
|
|
75
|
+
projection: [
|
|
76
|
+
...source.projection,
|
|
77
|
+
{
|
|
78
|
+
excludedKeys: [
|
|
79
|
+
...new Set(semanticObjectPatternKeys(pattern)),
|
|
80
|
+
].sort(compareUnicodeCodePoints),
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
}, guards);
|
|
53
84
|
continue;
|
|
85
|
+
}
|
|
54
86
|
visit(context, property.value, project(source, semanticStaticPropertyKey(property.key, property.computed)), guards);
|
|
55
87
|
}
|
|
56
88
|
return;
|
|
@@ -77,13 +109,14 @@ const visit = (context, pattern, source, guards = {}) => {
|
|
|
77
109
|
if (t.isRestElement(pattern))
|
|
78
110
|
visit(context, pattern.argument, undefined, guards);
|
|
79
111
|
};
|
|
80
|
-
/** Describe
|
|
112
|
+
/** Describe iterator receivers and property reference stores without evaluation. */
|
|
81
113
|
export const semanticIterationSources = (node, parent) => {
|
|
82
114
|
const sources = [];
|
|
83
115
|
const context = { sources, mutation: node };
|
|
84
116
|
if (t.isVariableDeclarator(node) && node.init != null)
|
|
85
117
|
visit(context, node.id, { node: node.init, projection: [] });
|
|
86
|
-
else if (t.isAssignmentExpression(node) &&
|
|
118
|
+
else if (t.isAssignmentExpression(node) &&
|
|
119
|
+
["=", "||=", "&&=", "??="].includes(node.operator))
|
|
87
120
|
visit(context, node.left, { node: node.right, projection: [] });
|
|
88
121
|
else if (t.isForOfStatement(node)) {
|
|
89
122
|
add(sources, { node: node.right, projection: [] }, node, {});
|