rea-agents 6.1.0 → 6.3.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 +24 -24
- package/bridge/ghidra/ReaGhidraBridge.java +32 -4
- package/bridge/hopper_bridge.py +8 -1
- package/dist/android/JadxConfiguration.js +87 -7
- package/dist/android/JadxMcpTransport.js +14 -2
- package/dist/android/JadxProvider.js +64 -36
- package/dist/android/JadxSession.js +51 -9
- package/dist/application/BinaryTargetResolver.js +68 -20
- package/dist/application/BrowserEvidence.js +3 -8
- package/dist/application/BrowserScenarioEvidence.js +4 -20
- package/dist/application/CapabilityInventory.js +43 -9
- package/dist/application/ClientConfigurationDocument.js +97 -25
- package/dist/application/ClientRegistrationStatus.js +19 -6
- package/dist/application/DirectAnalysis.js +41 -20
- package/dist/application/DirectAnalysisCleanup.js +71 -0
- package/dist/application/DirectAnalysisStatus.js +3 -7
- package/dist/application/Doctor.js +40 -53
- package/dist/application/DoctorDiagnostics.js +2 -3
- package/dist/application/EnhancedTools.js +51 -6
- package/dist/application/EvidenceBundleFiles.js +8 -3
- package/dist/application/InvestigationProviders.js +13 -5
- package/dist/application/JsonFiles.js +56 -23
- package/dist/application/LinuxHopper.js +11 -7
- package/dist/application/MacHopper.js +15 -18
- package/dist/application/RealHopperAssertions.js +0 -11
- package/dist/application/ReconstructionObligationCandidates.js +10 -3
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -1
- package/dist/application/ReferenceSourceImportEntries.js +1 -1
- package/dist/application/RegularFileRead.js +17 -0
- package/dist/application/Setup.js +26 -23
- package/dist/application/SetupClientConfiguration.js +18 -7
- package/dist/application/SetupHost.js +20 -29
- package/dist/application/SetupPlan.js +24 -20
- package/dist/application/SetupSkill.js +57 -8
- package/dist/application/SupportedClients.js +43 -0
- package/dist/application/Uninstall.js +98 -30
- package/dist/application/UpdateMaintenance.js +13 -7
- package/dist/application/UpdateRuntime.js +12 -12
- package/dist/application/Utf8JsonInput.js +64 -0
- package/dist/application/WebScriptExportService.js +38 -5
- package/dist/application/WorkflowEvidence.js +25 -2
- package/dist/application/XrefsAddressResolution.js +45 -0
- package/dist/application/analysisView/AnalysisViewService.js +76 -0
- package/dist/application/android/AndroidAnalysisService.js +1 -1
- package/dist/application/binary/AnalysisClientCleanup.js +30 -5
- package/dist/application/binary/AnalysisProviderEvaluation.js +1 -2
- package/dist/application/binary/AnalysisProviderRegistry.js +2 -6
- package/dist/application/binary/AnalysisSnapshotCache.js +13 -10
- package/dist/application/binary/BinarySession.js +86 -29
- package/dist/application/binary/BinarySessionComposition.js +1 -3
- package/dist/application/binary/BinarySessionExecution.js +3 -5
- package/dist/application/binary/BinarySessionOpen.js +10 -2
- package/dist/application/binary/BinarySessionRecords.js +1 -1
- package/dist/application/binary/BinarySessionStatus.js +1 -6
- package/dist/application/binary/CompositeProvider.js +4 -18
- package/dist/application/binary/LazyAnalysisProvider.js +5 -5
- package/dist/application/binary/SessionProviderRouter.js +27 -135
- package/dist/application/homebrew.js +48 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +10 -14
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +5 -1
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +3 -6
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +107 -46
- package/dist/application/javascript/JavaScriptApplicationService.js +7 -1
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +59 -45
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +5 -9
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +19 -27
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +11 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +9 -0
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +8 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +46 -29
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +0 -1
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +86 -27
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +52 -9
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +1 -0
- package/dist/application/javascript/JavaScriptJsonModules.js +2 -2
- package/dist/application/javascript/JavaScriptModuleRelationships.js +6 -18
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +3 -3
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +11 -27
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +4 -5
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +8 -6
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +7 -5
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +3 -4
- package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +2 -2
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +3 -7
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +76 -47
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +4 -4
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +3 -4
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +51 -25
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +15 -10
- package/dist/application/managed/ManagedMemberComparisonService.js +2 -1
- package/dist/application/managed/ManagedNativeVerificationService.js +2 -1
- package/dist/application/native/NativeCallRoutes.js +2 -4
- package/dist/application/process/ProcessCli.js +11 -11
- package/dist/application/process/ProcessEvidence.js +0 -1
- package/dist/artifacts/ArtifactProvider.js +53 -30
- package/dist/artifacts/ArtifactProviderMetadata.js +1 -4
- package/dist/artifacts/ArtifactReader.js +31 -0
- package/dist/artifacts/AsarArtifactReader.js +81 -17
- package/dist/artifacts/DirectoryArtifactReader.js +2 -1
- package/dist/artifacts/MachOSliceArtifactReader.js +9 -2
- package/dist/artifacts/NativeDmgArtifactReader.js +207 -77
- package/dist/artifacts/NativeDmgOwnership.js +109 -0
- package/dist/artifacts/SafeOutputTree.js +16 -2
- package/dist/artifacts/ZipArtifactReader.js +11 -4
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +4 -2
- package/dist/artifacts/apple/DylibResolutionReader.js +17 -7
- package/dist/artifacts/apple/KeyedArchiveReader.js +68 -42
- package/dist/artifacts/apple/MachoLoadCommandReader.js +36 -6
- package/dist/artifacts/extraction/ArtifactExtraction.js +104 -29
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +71 -66
- package/dist/artifacts/inventory/ArtifactInventory.js +0 -1
- package/dist/artifacts/inventory/classify.js +33 -14
- package/dist/artifacts/inventory/hashStableRootArtifact.js +37 -0
- package/dist/artifacts/inventory/reader.js +3 -3
- package/dist/artifacts/inventory/scanCanonical.js +64 -34
- package/dist/artifacts/inventory/scanReader.js +12 -20
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +65 -27
- package/dist/browser/BrowserScenarioPartialObservation.js +106 -0
- package/dist/browser/CdpBrowserProvider.js +6 -6
- package/dist/browser/CdpCaptureEventHandlers.js +2 -4
- package/dist/browser/CdpCaptureEvents.js +0 -1
- package/dist/browser/CdpCaptureStorageFingerprints.js +3 -3
- package/dist/browser/CdpCaptureValues.js +20 -0
- package/dist/browser/CdpElectronInspection.js +2 -2
- package/dist/browser/CdpElectronProvider.js +4 -5
- package/dist/browser/CdpElectronScriptEvents.js +2 -8
- package/dist/browser/CdpElectronScripts.js +4 -5
- package/dist/browser/CdpPageCaptureScripts.js +2 -3
- package/dist/browser/CdpSafeMetadata.js +10 -10
- package/dist/browser/CdpWebMcpDiscovery.js +16 -13
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +64 -49
- package/dist/browser/PlaywrightElectronActiveActions.js +2 -56
- package/dist/browser/PlaywrightElectronActiveProvider.js +10 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +1 -1
- package/dist/browser/PlaywrightScenarioBrowser.js +269 -66
- package/dist/browser/PlaywrightScenarioEvents.js +1 -1
- package/dist/browser/PlaywrightScenarioSession.js +41 -32
- package/dist/browser/WebSourceMapFetcher.js +32 -6
- package/dist/browser/assets/ScenarioScriptCapture.js +8 -12
- package/dist/browser/assets/ScriptCaptureAdapters.js +1 -1
- package/dist/browser/history/CaptureFailures.js +6 -2
- package/dist/browser/history/MitmproxyCaptureAdapter.js +4 -2
- package/dist/catalogIdentity.js +0 -1
- package/dist/cli/analysisViewCommands.js +36 -0
- package/dist/cli/artifactCommands.js +11 -12
- package/dist/cli/coreAnalysisCommands.js +3 -3
- package/dist/cli/coreBinaryCommands.js +37 -28
- package/dist/cli/coreNativeCommands.js +9 -10
- package/dist/cli/electronCommands.js +12 -13
- package/dist/cli/interactiveSetup.js +6 -6
- package/dist/cli/javascriptApplicationAnalysis.js +2 -12
- package/dist/cli/jsonOutput.js +3 -2
- package/dist/cli/managedCommands.js +7 -8
- package/dist/cli/nativeCallCommands.js +1 -2
- package/dist/cli/omittableDefaults.js +50 -0
- package/dist/cli/processCommands.js +3 -2
- package/dist/cli/setupCommands.js +16 -15
- package/dist/cli/streamedJsonOutput.js +83 -4
- package/dist/cli/utilityCommands.js +10 -12
- package/dist/cli.js +19 -8
- package/dist/cliBrowserScenarioCommands.js +2 -2
- package/dist/cliCommandNames.js +1 -0
- package/dist/cliJsonFile.js +179 -0
- package/dist/cliJsonInput.js +60 -33
- package/dist/cliObservationOptions.js +4 -0
- package/dist/cliOutput.js +0 -38
- package/dist/composition/auxiliaryAnalysisProviders.js +30 -25
- package/dist/composition/binary.js +9 -9
- package/dist/composition/browserScenario.js +2 -1
- package/dist/composition/directAnalysis.js +20 -14
- package/dist/composition/electronScenario.js +1 -1
- package/dist/composition/optionalObservationProviders.js +12 -7
- package/dist/config/environment.js +6 -0
- package/dist/config/ghidraStartupTimeout.js +4 -9
- package/dist/config/homeDirectory.js +12 -0
- package/dist/config/mcpResponseBudget.js +9 -1
- package/dist/config/parseConfig.js +7 -3
- package/dist/config/parsers.js +19 -22
- package/dist/contracts/analysisViewToolContracts.js +56 -0
- package/dist/contracts/applicationToolContracts.js +5 -4
- package/dist/contracts/artifactComparisonExample.js +7 -7
- package/dist/contracts/artifactToolContracts.js +1 -1
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/browserToolContracts.js +19 -15
- package/dist/contracts/enhancedInputs.js +2 -2
- package/dist/contracts/enhancedToolContracts.js +4 -3
- package/dist/contracts/errorSchemas.js +3 -1
- package/dist/contracts/evm/evmToolContracts.js +1 -1
- package/dist/contracts/functionComparisonExample.js +8 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +181 -0
- package/dist/contracts/investigationExamples.js +4 -3
- package/dist/contracts/javascript/electronToolContracts.js +3 -2
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +3 -22
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
- package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +1 -1
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +8 -7
- package/dist/contracts/managed/managedToolContracts.js +8 -12
- package/dist/contracts/managed/managedWorkflowToolContracts.js +1 -1
- package/dist/contracts/mobileApplicationGraphExamples.js +8 -8
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +1 -1
- package/dist/contracts/native/nativeToolContracts.js +2 -2
- package/dist/contracts/officialToolContracts.js +2 -1
- package/dist/contracts/promptContracts.js +2 -2
- package/dist/contracts/providerSelection.js +1 -1
- package/dist/contracts/sessionLifecycleInputs.js +4 -3
- package/dist/contracts/sessionStatusContract.js +3 -2
- package/dist/contracts/sessionToolContracts.js +17 -4
- package/dist/contracts/sessionToolSchemas.js +4 -16
- package/dist/contracts/toolContracts.js +2 -0
- package/dist/contracts/toolEffects.js +1 -0
- package/dist/contracts/toolOutputSchemaGroups.js +138 -94
- package/dist/contracts/toolOutputSchemaPrimitives.js +13 -26
- package/dist/contracts/toolSchemaMetadata.js +18 -69
- package/dist/contracts/webNetworkCaptureToolContracts.js +1 -1
- package/dist/contracts/webRuntimeToolContracts.js +1 -1
- package/dist/contracts/webScriptToolContracts.js +1 -1
- package/dist/doctorRuntime.js +7 -5
- package/dist/domain/analysisErrorBase.js +5 -0
- package/dist/domain/analysisErrorCore.js +3 -0
- package/dist/domain/analysisErrorPresentation.js +22 -5
- package/dist/domain/analysisErrorProjection.js +24 -5
- package/dist/domain/analysisSnapshot.js +31 -31
- package/dist/domain/analysisView/analysisView.js +241 -0
- package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
- package/dist/domain/analysisView/binaryLayoutView.js +159 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +238 -0
- package/dist/domain/android/androidApplication.js +1 -1
- package/dist/domain/android/androidPartialObservation.js +36 -0
- package/dist/domain/apple/appleApplication.js +1 -1
- package/dist/domain/apple/dylibResolution.js +10 -3
- package/dist/domain/apple/interfaceBuilderGraph.js +0 -1
- package/dist/domain/apple/keyedArchive.js +26 -2
- package/dist/domain/artifactComparison.js +15 -6
- package/dist/domain/artifactGraph.js +17 -4
- package/dist/domain/artifactIdentity.js +8 -8
- package/dist/domain/artifactInspection.js +8 -8
- package/dist/domain/artifactInventoryEvidence.js +9 -16
- package/dist/domain/artifactOperationError.js +3 -3
- package/dist/domain/artifactPartialObservation.js +1 -0
- package/dist/domain/artifactPathSyntax.js +49 -0
- package/dist/domain/binaryTarget.js +39 -13
- package/dist/domain/browserCaptureComparison.js +13 -49
- package/dist/domain/browserCompleteness.js +3 -2
- package/dist/domain/browserNetworkEvidence.js +10 -4
- package/dist/domain/browserObservation.js +0 -1
- package/dist/domain/browserObservationSchemas.js +14 -3
- package/dist/domain/browserScenario.js +0 -1
- package/dist/domain/browserScenarioCapture.js +1 -2
- package/dist/domain/browserScenarioCaptureValues.js +2 -2
- package/dist/domain/browserScenarioDiff.js +0 -2
- package/dist/domain/browserScenarioDiffEvidence.js +0 -12
- package/dist/domain/browserScenarioDiffValues.js +2 -2
- package/dist/domain/browserScenarioNormalization.js +3 -3
- package/dist/domain/browserScenarioValues.js +6 -6
- package/dist/domain/callPath.js +15 -18
- package/dist/domain/callPathSchemas.js +2 -2
- package/dist/domain/canonicalDigest.js +7 -1
- package/dist/domain/canonicalOrdering.js +1 -13
- package/dist/domain/changedBehavior.js +5 -6
- package/dist/domain/comparisonSemantics.js +0 -5
- package/dist/domain/completionLedgerGeneration.js +2 -1
- package/dist/domain/configurationErrors.js +12 -0
- package/dist/domain/conformancePackage.js +4 -3
- package/dist/domain/digests.js +0 -3
- package/dist/domain/evidence.js +19 -40
- package/dist/domain/evidenceBundle.js +58 -42
- package/dist/domain/evidenceCompletionLedger.js +2 -1
- package/dist/domain/firmware/firmwareAnalysis.js +4 -3
- package/dist/domain/functionComparison.js +6 -6
- package/dist/domain/functionComparisonDimensions.js +120 -87
- package/dist/domain/functionComparisonNormalization.js +26 -36
- package/dist/domain/functionComparisonResults.js +3 -6
- package/dist/domain/functionComparisonSchemas.js +2 -8
- package/dist/domain/functionDossierEvidence.js +4 -38
- package/dist/domain/hopperValues.js +11 -15
- package/dist/domain/javascript/electronActiveObservation.js +29 -71
- package/dist/domain/javascript/electronObservation.js +14 -3
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +12 -11
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +11 -2
- package/dist/domain/javascript/electronStaticAnalysisNative.js +7 -4
- package/dist/domain/javascript/electronStaticAnalysisValues.js +8 -4
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +3 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +12 -8
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +6 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +41 -16
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +9 -2
- package/dist/domain/javascript/javascriptApplicationVersionComparison.js +4 -4
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +37 -22
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +50 -36
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +9 -8
- package/dist/domain/javascript/javascriptAstFingerprint.js +2 -2
- package/dist/domain/javascript/javascriptAstValues.js +22 -0
- package/dist/{application/javascript/JavaScriptReturnShapeProjection.js → domain/javascript/javascriptExportReturnShapeProjection.js} +4 -4
- package/dist/domain/javascript/javascriptExportShapeComparison.js +10 -3
- package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +6 -1
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +58 -22
- package/dist/domain/javascript/javascriptExportShapeSelection.js +7 -7
- package/dist/domain/javascript/javascriptExportShapeVariants.js +70 -16
- package/dist/domain/javascript/javascriptFeatureSeed.js +25 -3
- package/dist/domain/javascript/javascriptFeatureTrace.js +7 -6
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +17 -9
- package/dist/domain/javascript/javascriptFeatureTraversal.js +4 -5
- package/dist/domain/javascript/javascriptNativeHandoff.js +7 -7
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +0 -1
- package/dist/domain/javascript/javascriptRuntimeObservation.js +18 -7
- package/dist/domain/javascript/javascriptRuntimeReconciliation.js +12 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +9 -8
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +5 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +6 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +12 -222
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +7 -7
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +209 -11
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +2 -1
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +9 -7
- package/dist/domain/javascript/javascriptSemanticCalls.js +2 -1
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +4 -3
- package/dist/domain/javascript/javascriptSemanticCoverage.js +20 -0
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +7 -9
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +4 -11
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +2 -2
- package/dist/domain/javascript/javascriptSemanticGraph.js +220 -71
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +19 -1
- package/dist/domain/javascript/javascriptSemanticIr.js +0 -4
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +106 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +515 -74
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +44 -36
- package/dist/domain/javascript/javascriptSemanticObjects.js +79 -42
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +8 -14
- package/dist/domain/javascript/javascriptSemanticProjection.js +21 -16
- package/dist/domain/javascript/javascriptSemanticPromises.js +16 -21
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +23 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +3 -3
- package/dist/domain/javascript/javascriptSemanticQuery.js +8 -2
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +3 -2
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -9
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +16 -10
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +1 -1
- package/dist/domain/javascript/javascriptSemanticResources.js +1 -1
- package/dist/domain/javascript/javascriptSemanticReturns.js +55 -44
- package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
- package/dist/domain/javascript/javascriptSemanticTraversal.js +6 -1
- package/dist/domain/javascript/javascriptSemanticValues.js +180 -76
- package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
- package/dist/domain/javascript/javascriptSourceParser.js +34 -9
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +5 -6
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +2 -1
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +26 -16
- package/dist/domain/javascript/sourceToBundleComparison.js +19 -8
- package/dist/domain/javascript/sourceToBundleSignals.js +53 -25
- package/dist/domain/jsonSerialization.js +109 -55
- package/dist/domain/jsonShape.js +46 -19
- package/dist/domain/localPath.js +10 -4
- package/dist/domain/managed/managedApplicationGraph.js +10 -6
- package/dist/domain/managed/managedApplicationGraphNodes.js +82 -57
- package/dist/domain/managed/managedArtifact.js +6 -4
- package/dist/domain/managed/managedMemberComparison.js +2 -9
- package/dist/domain/managed/managedMemberComparisonMatch.js +6 -7
- package/dist/domain/managed/managedNativeVerification.js +0 -2
- package/dist/domain/managed/managedNativeVerificationMatch.js +9 -3
- package/dist/domain/native/binaryLayout.js +2 -3
- package/dist/domain/native/nativeApiBoundary.js +1 -1
- package/dist/domain/native/nativeCallObservation.js +3 -3
- package/dist/domain/native/nativeInstruction.js +7 -0
- package/dist/domain/native/nativeValueFlow.js +5 -11
- package/dist/domain/native/objcSwiftMetadata.js +15 -17
- package/dist/domain/native/recordedCrash.js +2 -3
- package/dist/domain/offsetDateTime.js +17 -0
- package/dist/domain/process/processCapture.js +22 -20
- package/dist/domain/process/processCaptureCoverage.js +70 -0
- package/dist/domain/process/processCaptureExample.js +45 -1
- package/dist/domain/process/processCaptureParsing.js +1 -34
- package/dist/domain/process/processCaptureValidation.js +82 -13
- package/dist/domain/process/processComparison.js +39 -43
- package/dist/domain/process/processObservation.js +10 -2
- package/dist/domain/process/processScenario.js +24 -2
- package/dist/domain/process/processTraceComparison.js +0 -2
- package/dist/domain/process/processTraceDimensionProjection.js +1 -1
- package/dist/domain/process/processTraceEvaluation.js +19 -15
- package/dist/domain/process/processTraceSpecification.js +4 -7
- package/dist/domain/providerAdapterError.js +2 -0
- package/dist/domain/providerCleanupError.js +6 -2
- package/dist/domain/reconstructionCoverage.js +7 -3
- package/dist/domain/reconstructionObligationLedgerSchemas.js +2 -1
- package/dist/domain/reconstructionReadinessSchemas.js +2 -1
- package/dist/domain/reconstructionUnknowns.js +4 -3
- package/dist/domain/reconstructionVerification.js +6 -5
- package/dist/domain/reconstructionVerificationSchemas.js +2 -1
- package/dist/domain/referenceSourceGraph.js +27 -28
- package/dist/domain/referenceSourceImportParsing.js +34 -45
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/staticRuntimeCorrelation.js +4 -3
- package/dist/domain/stringPatterns.js +6 -0
- package/dist/domain/swiftSymbolClassification.js +66 -0
- package/dist/domain/symbolAnalysis.js +83 -20
- package/dist/domain/unicodeCodePointOrder.js +6 -0
- package/dist/domain/webBundleAnalyzerInspection.js +9 -1
- package/dist/domain/webCaptureDiff.js +71 -30
- package/dist/domain/webCaptureDiffSchemas.js +8 -11
- package/dist/domain/webEventListeners.js +3 -2
- package/dist/domain/webExecution.js +3 -2
- package/dist/domain/webInventory.js +3 -2
- package/dist/domain/webMcpDiscovery.js +4 -3
- package/dist/domain/webRuntime.js +0 -2
- package/dist/domain/webScriptExport.js +2 -2
- package/dist/dotnet/ManagedArtifactInspector.js +2 -19
- package/dist/dotnet/ManagedMemberInspector.js +12 -18
- package/dist/dotnet/ManagedMemberInspectorCore.js +47 -44
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +1 -2
- package/dist/dotnet/ManagedMemberRows.js +75 -62
- package/dist/dotnet/ManagedMetadataInventory.js +16 -22
- package/dist/dotnet/ManagedMethodBodyReader.js +4 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +109 -94
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +12 -21
- package/dist/dotnet/ManagedReaderFailure.js +16 -0
- package/dist/dotnet/ManagedStaticProvider.js +13 -12
- package/dist/dotnet/ManagedStaticProviderMetadata.js +1 -4
- package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
- package/dist/evaluation/AgentEvaluationReport.js +28 -0
- package/dist/evaluation/CodexAgentEval.js +12 -8
- package/dist/evaluation/KnownAnswerEvaluation.js +281 -0
- package/dist/evm/EvmoleInterfaceProvider.js +2 -1
- package/dist/filesystem/RegularFile.js +41 -0
- package/dist/firmware/FirmwareCommand.js +9 -5
- package/dist/firmware/FirmwareProvider.js +4 -4
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +3 -6
- package/dist/ghidra/GhidraClient.js +105 -36
- package/dist/ghidra/GhidraClientStartup.js +0 -2
- package/dist/ghidra/GhidraDoctor.js +6 -5
- package/dist/ghidra/GhidraFunctionValues.js +3 -5
- package/dist/ghidra/GhidraInstallation.js +151 -22
- package/dist/ghidra/GhidraJavaLaunch.js +6 -2
- package/dist/ghidra/GhidraLauncher.js +58 -26
- package/dist/ghidra/GhidraProvider.js +6 -2
- package/dist/ghidra/GhidraProviderCapabilities.js +6 -0
- package/dist/ghidra/GhidraProviderClient.js +13 -3
- package/dist/ghidra/GhidraSessionError.js +2 -0
- package/dist/ghidra/GhidraSessionRoot.js +39 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +17 -10
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +8 -2
- package/dist/hopper/BridgeLauncher.js +34 -45
- package/dist/hopper/HopperAnalysisProfile.js +3 -8
- package/dist/hopper/HopperCleanup.js +56 -27
- package/dist/hopper/HopperClient.js +86 -65
- package/dist/hopper/HopperMachOImage.js +3 -2
- package/dist/hopper/HopperProvider.js +16 -18
- package/dist/hopper/HopperRegexSearch.js +3 -6
- package/dist/hopper/HopperTargetLease.js +132 -49
- package/dist/hopper/LinuxPrivateDisplayProbe.js +6 -0
- package/dist/ida/IdaConfiguration.js +8 -3
- package/dist/ida/IdaInput.js +1 -7
- package/dist/ida/IdaMcpConnection.js +8 -4
- package/dist/ida/IdaOperationRunner.js +5 -3
- package/dist/ida/IdaProvider.js +8 -12
- package/dist/ida/IdaSessionClient.js +24 -20
- package/dist/ida/IdaWorkspace.js +12 -13
- package/dist/inspector/JavaScriptRuntimeScope.js +9 -5
- package/dist/inspector/V8InspectorCaptureProjection.js +47 -14
- package/dist/inspector/V8InspectorProvider.js +97 -35
- package/dist/javascript/recovery/WakaruCommand.js +7 -2
- package/dist/javascript/recovery/WakaruExecution.js +5 -2
- package/dist/main/shutdown.js +81 -29
- package/dist/main/startup.js +9 -2
- package/dist/main/transport.js +23 -3
- package/dist/main.js +11 -18
- package/dist/native/AppleMachoSelection.js +16 -6
- package/dist/native/AppleObjcDispatchFacets.js +3 -3
- package/dist/native/AppleObjcProperties.js +17 -7
- package/dist/native/CommandRunner.js +9 -7
- package/dist/native/LldbCallTracer.js +249 -77
- package/dist/native/NativeMacOSProvider.js +32 -17
- package/dist/native/NativeMacOSProviderMetadata.js +1 -2
- package/dist/native/NativeUiHelperRuntime.js +11 -2
- package/dist/native/NativeUiObservation.js +2 -2
- package/dist/native/pwntools/PwntoolsDecoder.js +2 -1
- package/dist/process/DarwinProcessRunTokenReader.js +16 -2
- package/dist/process/ExecFileOutput.js +88 -6
- package/dist/process/PrivateRuntimeRoot.js +10 -5
- package/dist/process/ProcessOwnership.js +1 -4
- package/dist/process/ProcessOwnershipObservation.js +18 -16
- package/dist/process/ProviderProcess.js +1 -3
- package/dist/process/capture/FilesystemSnapshot.js +131 -24
- package/dist/process/capture/ProcessCaptureError.js +13 -0
- package/dist/process/capture/ProcessCaptureLifecycle.js +148 -74
- package/dist/process/capture/ProcessFilesystemEffects.js +51 -6
- package/dist/process/capture/ProcessHarness.js +16 -33
- package/dist/process/capture/ProcessNormalization.js +20 -2
- package/dist/process/capture/ProcessSampling.js +25 -2
- package/dist/process/capture/TerminalRenderer.js +14 -0
- package/dist/process/snapshotEnvironment.js +14 -0
- package/dist/server/EvidenceMcpServer.js +25 -14
- package/dist/server/analysisAdmission.js +8 -0
- package/dist/server/createServer.js +71 -59
- package/dist/server/mcpClientMetadata.js +12 -5
- package/dist/server/promptCompletion.js +3 -8
- package/dist/server/registerAnalysisViewTool.js +15 -0
- package/dist/server/registerAndroidTools.js +2 -3
- package/dist/server/registerApplicationTools/compareExportShapes.js +6 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +4 -5
- package/dist/server/registerApplicationTools/coverage.js +1 -2
- package/dist/server/registerApplicationTools/helpers.js +4 -4
- package/dist/server/registerApplicationTools/obligationLedger.js +4 -5
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -4
- package/dist/server/registerApplicationTools/traceFeature.js +4 -5
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +4 -5
- package/dist/server/registerArtifactTools.js +2 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +2 -3
- package/dist/server/registerBrowserScenarioTool.js +3 -4
- package/dist/server/registerBrowserTools.js +13 -16
- package/dist/server/registerBundleComparisonTool.js +5 -6
- package/dist/server/registerCloseLifecycleTool.js +8 -7
- package/dist/server/registerElectronTools.js +10 -13
- package/dist/server/registerEnhancedTools.js +82 -77
- package/dist/server/registerEvidenceTools.js +54 -47
- package/dist/server/registerEvmTools.js +2 -3
- package/dist/server/registerFirmwareTools.js +2 -3
- package/dist/server/registerFunctionComparisonTool.js +7 -8
- package/dist/server/registerInvestigationTools.js +14 -15
- package/dist/server/registerJavaScriptRecoveryTool.js +2 -3
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +6 -6
- package/dist/server/registerManagedTools.js +7 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +5 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +4 -5
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +6 -7
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +6 -7
- package/dist/server/registerOfficialTools.js +32 -41
- package/dist/server/registerProcessComparisonTool.js +8 -8
- package/dist/server/registerRecordedCrashTools.js +2 -3
- package/dist/server/registerSessionRecordTools.js +15 -19
- package/dist/server/registerSessionStatusTool.js +3 -4
- package/dist/server/registerSessionTools.js +19 -19
- package/dist/server/registerWebModuleTool.js +2 -3
- package/dist/server/registerWebNetworkCaptureTool.js +2 -3
- package/dist/server/registerWebRuntimeTools.js +4 -5
- package/dist/server/registerWebScriptTool.js +2 -3
- package/dist/server/registerWebSourceLocationTool.js +2 -3
- package/dist/server/toolResult.js +66 -94
- package/dist/server/toolResultEncoding.js +11 -10
- package/dist/windows/WindowsNativeLoader.js +1 -0
- package/dist/windows/WindowsOwnedProcess.js +60 -15
- package/dist/windows/WindowsPrivateRuntime.js +7 -8
- package/native/windows/README.md +3 -1
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +42 -30
- package/scripts/rea.mjs +3 -6
- package/skills/reverse-engineer-anything/SKILL.md +14 -13
- package/skills/reverse-engineer-anything/references/android-applications.md +6 -3
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -4
- package/skills/reverse-engineer-anything/references/javascript-applications.md +16 -6
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +18 -0
- package/dist/artifacts/inventory/policy.js +0 -2
- package/dist/config.js +0 -1
- package/dist/contracts/browserCaptureToolInputSchema.js +0 -43
- package/dist/contracts/process/processCaptureExample.js +0 -2
- package/dist/contracts/toolOutputSchemas.js +0 -2
- package/dist/domain/managed/managedApplicationGraphNodeCoverage.js +0 -6
- package/dist/main/reload.js +0 -12
- package/dist/main/state.js +0 -3
- package/dist/server/registerNativeTools.js +0 -6
- package/dist/server/sessionToolPolicies.js +0 -2
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as t from "@babel/types";
|
|
2
|
+
import { semanticStaticPropertyKey, unwrapJavaScriptExpression, } from "./javascriptAstValues.js";
|
|
3
|
+
const statementPosition = (statement, parents, declarator) => {
|
|
4
|
+
const parent = parents.get(statement);
|
|
5
|
+
if (!t.isProgram(parent) && !t.isBlockStatement(parent))
|
|
6
|
+
return null;
|
|
7
|
+
const index = parent.body.indexOf(statement);
|
|
8
|
+
return index < 0
|
|
9
|
+
? null
|
|
10
|
+
: {
|
|
11
|
+
body: parent.body,
|
|
12
|
+
index,
|
|
13
|
+
declaratorIndex: t.isVariableDeclaration(statement) && declarator !== undefined
|
|
14
|
+
? statement.declarations.indexOf(declarator)
|
|
15
|
+
: -1,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const positionPrecedes = (left, right) => left.body === right.body &&
|
|
19
|
+
(left.index < right.index ||
|
|
20
|
+
(left.index === right.index &&
|
|
21
|
+
left.declaratorIndex >= 0 &&
|
|
22
|
+
left.declaratorIndex < right.declaratorIndex));
|
|
23
|
+
const directInitializerPosition = (node, parents) => {
|
|
24
|
+
const parent = parents.get(node);
|
|
25
|
+
if (t.isVariableDeclarator(parent) && parent.init === node) {
|
|
26
|
+
const declaration = parents.get(parent);
|
|
27
|
+
return t.isVariableDeclaration(declaration)
|
|
28
|
+
? statementPosition(declaration, parents, parent)
|
|
29
|
+
: null;
|
|
30
|
+
}
|
|
31
|
+
if (t.isAssignmentExpression(parent) &&
|
|
32
|
+
parent.operator === "=" &&
|
|
33
|
+
parent.right === node &&
|
|
34
|
+
t.isIdentifier(parent.left)) {
|
|
35
|
+
const statement = parents.get(parent);
|
|
36
|
+
return t.isExpressionStatement(statement) && statement.expression === parent
|
|
37
|
+
? statementPosition(statement, parents)
|
|
38
|
+
: null;
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
42
|
+
const directMutationPosition = (node, parents) => {
|
|
43
|
+
if (t.isForOfStatement(node))
|
|
44
|
+
return statementPosition(node, parents);
|
|
45
|
+
if (t.isVariableDeclarator(node)) {
|
|
46
|
+
const declaration = parents.get(node);
|
|
47
|
+
return t.isVariableDeclaration(declaration)
|
|
48
|
+
? statementPosition(declaration, parents, node)
|
|
49
|
+
: null;
|
|
50
|
+
}
|
|
51
|
+
if (t.isSpreadElement(node)) {
|
|
52
|
+
const array = parents.get(node);
|
|
53
|
+
return t.isArrayExpression(array)
|
|
54
|
+
? semanticCapturePosition(array, parents)
|
|
55
|
+
: null;
|
|
56
|
+
}
|
|
57
|
+
if (!t.isAssignmentExpression(node) &&
|
|
58
|
+
!t.isUpdateExpression(node) &&
|
|
59
|
+
!t.isUnaryExpression(node, { operator: "delete" }) &&
|
|
60
|
+
!t.isCallExpression(node) &&
|
|
61
|
+
!t.isOptionalCallExpression(node) &&
|
|
62
|
+
!t.isNewExpression(node) &&
|
|
63
|
+
!t.isTaggedTemplateExpression(node))
|
|
64
|
+
return null;
|
|
65
|
+
let current = node;
|
|
66
|
+
while (true) {
|
|
67
|
+
const parent = parents.get(current);
|
|
68
|
+
if (parent === undefined ||
|
|
69
|
+
t.isFunction(parent) ||
|
|
70
|
+
(t.isLogicalExpression(parent) && parent.right === current) ||
|
|
71
|
+
(t.isConditionalExpression(parent) && parent.test !== current))
|
|
72
|
+
return null;
|
|
73
|
+
if (t.isStatement(parent))
|
|
74
|
+
return statementPosition(parent, parents);
|
|
75
|
+
if (t.isVariableDeclarator(parent)) {
|
|
76
|
+
const declaration = parents.get(parent);
|
|
77
|
+
return t.isVariableDeclaration(declaration)
|
|
78
|
+
? statementPosition(declaration, parents, parent)
|
|
79
|
+
: null;
|
|
80
|
+
}
|
|
81
|
+
current = parent;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const referenceInitializerPosition = (node, parents) => {
|
|
85
|
+
// Defaults live inside the declaration pattern rather than its initializer.
|
|
86
|
+
let current = node;
|
|
87
|
+
while (true) {
|
|
88
|
+
const direct = directInitializerPosition(current, parents);
|
|
89
|
+
if (direct !== null)
|
|
90
|
+
return direct;
|
|
91
|
+
const parent = parents.get(current);
|
|
92
|
+
if (parent === undefined || t.isStatement(parent) || t.isFunction(parent))
|
|
93
|
+
return null;
|
|
94
|
+
if (t.isVariableDeclarator(parent)) {
|
|
95
|
+
const declaration = parents.get(parent);
|
|
96
|
+
return t.isVariableDeclaration(declaration)
|
|
97
|
+
? statementPosition(declaration, parents, parent)
|
|
98
|
+
: null;
|
|
99
|
+
}
|
|
100
|
+
current = parent;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
/** Resolve origins at their use or capture, never at a later transitive effect. */
|
|
104
|
+
export const semanticMutationInitializers = (binding, mutation, parents) => {
|
|
105
|
+
const mutationPosition = directMutationPosition(mutation, parents) ??
|
|
106
|
+
referenceInitializerPosition(mutation, parents);
|
|
107
|
+
if (mutationPosition === null)
|
|
108
|
+
return binding;
|
|
109
|
+
const origins = [
|
|
110
|
+
...binding.initializers.map((initializer) => ({
|
|
111
|
+
initializer,
|
|
112
|
+
position: initializer.entryBody === undefined
|
|
113
|
+
? directInitializerPosition(initializer.node, parents)
|
|
114
|
+
: {
|
|
115
|
+
body: initializer.entryBody.body,
|
|
116
|
+
index: -1,
|
|
117
|
+
declaratorIndex: -1,
|
|
118
|
+
},
|
|
119
|
+
})),
|
|
120
|
+
...binding.referenceInitializers.map((initializer) => ({
|
|
121
|
+
initializer,
|
|
122
|
+
position: referenceInitializerPosition(initializer.node, parents),
|
|
123
|
+
})),
|
|
124
|
+
];
|
|
125
|
+
if (origins.some(({ position }) => position === null || !positionPrecedes(position, mutationPosition)))
|
|
126
|
+
return binding;
|
|
127
|
+
const latest = origins.reduce((latest, { position }) => position !== null &&
|
|
128
|
+
(latest === null || positionPrecedes(latest, position))
|
|
129
|
+
? position
|
|
130
|
+
: latest, null);
|
|
131
|
+
const retained = new Set(origins
|
|
132
|
+
.filter(({ position }) => position?.index === latest?.index &&
|
|
133
|
+
position?.declaratorIndex === latest?.declaratorIndex)
|
|
134
|
+
.map(({ initializer }) => initializer));
|
|
135
|
+
return {
|
|
136
|
+
initializers: binding.initializers.filter((initializer) => retained.has(initializer)),
|
|
137
|
+
referenceInitializers: binding.referenceInitializers.filter((initializer) => retained.has(initializer)),
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
/** Locate a capture only in an unconditional declaration or literal initializer. */
|
|
141
|
+
export const semanticCapturePosition = (node, parents) => {
|
|
142
|
+
let current = node;
|
|
143
|
+
while (true) {
|
|
144
|
+
const direct = directInitializerPosition(current, parents);
|
|
145
|
+
if (direct !== null)
|
|
146
|
+
return direct;
|
|
147
|
+
const parent = parents.get(current);
|
|
148
|
+
if (t.isObjectProperty(parent) &&
|
|
149
|
+
parent.value === current &&
|
|
150
|
+
semanticStaticPropertyKey(parent.key, parent.computed) !== null)
|
|
151
|
+
current = parent;
|
|
152
|
+
else if (t.isObjectExpression(parent) || t.isArrayExpression(parent))
|
|
153
|
+
current = parent;
|
|
154
|
+
else
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
/** Intermediate values must themselves have been initialized before capture. */
|
|
159
|
+
export const semanticBindingPrecedesCapture = (binding, capture, parents) => {
|
|
160
|
+
const initializer = binding.initializers[0];
|
|
161
|
+
if (binding.initializers.length !== 1 || initializer === undefined)
|
|
162
|
+
return false;
|
|
163
|
+
const sourcePosition = directInitializerPosition(initializer.node, parents);
|
|
164
|
+
const capturePosition = semanticCapturePosition(capture, parents);
|
|
165
|
+
return (sourcePosition !== null &&
|
|
166
|
+
capturePosition !== null &&
|
|
167
|
+
positionPrecedes(sourcePosition, capturePosition));
|
|
168
|
+
};
|
|
169
|
+
/** Ignore later escapes only while reading earlier references in one activation. */
|
|
170
|
+
export const semanticEscapeFollowsCapture = (binding, capture, escape, parents) => {
|
|
171
|
+
const initializer = binding.initializers[0];
|
|
172
|
+
if (escape === undefined ||
|
|
173
|
+
initializer === undefined ||
|
|
174
|
+
!semanticBindingPrecedesCapture(binding, capture, parents))
|
|
175
|
+
return false;
|
|
176
|
+
// A literal allocates here. Aliases are evaluated at the same capture point,
|
|
177
|
+
// so an outer/persistent origin still receives all of its own escape effects.
|
|
178
|
+
const origin = unwrapJavaScriptExpression(initializer.node).node;
|
|
179
|
+
if (!t.isObjectExpression(origin) &&
|
|
180
|
+
!t.isArrayExpression(origin) &&
|
|
181
|
+
!t.isIdentifier(origin) &&
|
|
182
|
+
!t.isMemberExpression(origin) &&
|
|
183
|
+
!t.isOptionalMemberExpression(origin))
|
|
184
|
+
return false;
|
|
185
|
+
const capturePosition = semanticCapturePosition(capture, parents);
|
|
186
|
+
const escapePosition = directMutationPosition(escape, parents);
|
|
187
|
+
return (capturePosition !== null &&
|
|
188
|
+
escapePosition !== null &&
|
|
189
|
+
positionPrecedes(capturePosition, escapePosition));
|
|
190
|
+
};
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
import { semanticPropertyPathKeyMatches, } from "./javascriptSemanticPropertyPaths.js";
|
|
2
|
+
/** Invalidate escaped object references without rewriting their containing slots. */
|
|
3
|
+
export const invalidateSemanticEscapedPath = (value, path) => {
|
|
4
|
+
if (value.status !== "object" && value.status !== "array")
|
|
5
|
+
return value;
|
|
6
|
+
const [key, ...remaining] = path;
|
|
7
|
+
if (key === undefined)
|
|
8
|
+
return {
|
|
9
|
+
status: "unknown",
|
|
10
|
+
reason: "This object reference may have been mutated by a call.",
|
|
11
|
+
};
|
|
12
|
+
const invalidateChild = (property) => semanticPropertyPathKeyMatches(key, property.name)
|
|
13
|
+
? {
|
|
14
|
+
...property,
|
|
15
|
+
value: invalidateSemanticEscapedPath(property.value, remaining),
|
|
16
|
+
}
|
|
17
|
+
: property;
|
|
18
|
+
return value.status === "object"
|
|
19
|
+
? { ...value, properties: value.properties.map(invalidateChild) }
|
|
20
|
+
: { ...value, items: value.items.map(invalidateChild) };
|
|
21
|
+
};
|
|
1
22
|
/** Invalidate only slots that an explicit mutation can affect. */
|
|
2
23
|
export const invalidateSemanticMutationPath = (value, path) => {
|
|
3
24
|
const [key, ...remaining] = path;
|
|
@@ -7,47 +28,34 @@ export const invalidateSemanticMutationPath = (value, path) => {
|
|
|
7
28
|
};
|
|
8
29
|
if (key === undefined || key === null)
|
|
9
30
|
return unknown;
|
|
10
|
-
if (value.status === "object") {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
31
|
+
if (value.status === "object" || value.status === "array") {
|
|
32
|
+
if (value.status === "array" && key === "length")
|
|
33
|
+
return {
|
|
34
|
+
status: "array",
|
|
35
|
+
items: [],
|
|
36
|
+
unknownItems: true,
|
|
37
|
+
omittedItems: null,
|
|
38
|
+
};
|
|
39
|
+
const slots = value.status === "object" ? value.properties : value.items;
|
|
40
|
+
const observed = slots.some((property) => semanticPropertyPathKeyMatches(key, property.name));
|
|
41
|
+
const properties = slots.map((property) => semanticPropertyPathKeyMatches(key, property.name)
|
|
14
42
|
? {
|
|
15
43
|
...property,
|
|
44
|
+
...(remaining.length === 0
|
|
45
|
+
? { presence: "unknown-coverage" }
|
|
46
|
+
: {}),
|
|
16
47
|
value: invalidateSemanticMutationPath(property.value, remaining),
|
|
17
48
|
}
|
|
18
49
|
: property);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
properties,
|
|
29
|
-
unknownProperties: false,
|
|
30
|
-
omittedProperties: 0,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
if (value.status === "array") {
|
|
34
|
-
const index = typeof key === "number" ? key : Number(key);
|
|
35
|
-
if (!Number.isSafeInteger(index) ||
|
|
36
|
-
index < 0 ||
|
|
37
|
-
String(index) !== String(key))
|
|
38
|
-
return unknown;
|
|
39
|
-
const observed = value.items[index] !== undefined;
|
|
40
|
-
const items = value.items.map((item, position) => position === index
|
|
41
|
-
? invalidateSemanticMutationPath(item, remaining)
|
|
42
|
-
: item);
|
|
43
|
-
return value.unknownItems || !observed
|
|
44
|
-
? {
|
|
45
|
-
status: "array",
|
|
46
|
-
items,
|
|
47
|
-
unknownItems: true,
|
|
48
|
-
omittedItems: observed ? value.omittedItems : null,
|
|
49
|
-
}
|
|
50
|
-
: { status: "array", items, unknownItems: false, omittedItems: 0 };
|
|
50
|
+
if (!observed && typeof key !== "object")
|
|
51
|
+
properties.push({
|
|
52
|
+
name: String(key),
|
|
53
|
+
value: unknown,
|
|
54
|
+
presence: "unknown-coverage",
|
|
55
|
+
});
|
|
56
|
+
return value.status === "object"
|
|
57
|
+
? { ...value, properties }
|
|
58
|
+
: { ...value, items: properties };
|
|
51
59
|
}
|
|
52
60
|
return unknown;
|
|
53
61
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
-
import { semanticCallableIdForNode, semanticReadsBeforeWrite,
|
|
2
|
+
import { semanticCallableIdForNode, semanticReadsBeforeWrite, } from "./javascriptSemanticProjection.js";
|
|
3
|
+
import { semanticStaticPropertyKey, unwrapJavaScriptExpression, } from "./javascriptAstValues.js";
|
|
3
4
|
import { resolveSemanticBindingState, } from "./javascriptSemanticState.js";
|
|
4
5
|
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
|
|
5
6
|
import { range } from "./javascriptStaticAnalysisHelpers.js";
|
|
@@ -19,16 +20,19 @@ export const collectJavaScriptSemanticObjects = (program, state, callables) => {
|
|
|
19
20
|
collectMember(node, parent, ownerCallableId, context);
|
|
20
21
|
else if (t.isSpreadElement(node) &&
|
|
21
22
|
parent !== null &&
|
|
22
|
-
t.isObjectExpression(parent))
|
|
23
|
+
t.isObjectExpression(parent)) {
|
|
24
|
+
const identity = expressionObjectIdentity(node.argument, state);
|
|
23
25
|
addObjectOperation({
|
|
24
26
|
node,
|
|
25
27
|
kind: "spread",
|
|
26
28
|
ownerCallableId,
|
|
27
|
-
objectBindingId:
|
|
29
|
+
objectBindingId: identity.bindingId,
|
|
28
30
|
targetBindingId: null,
|
|
29
|
-
|
|
31
|
+
propertyPath: identity.path,
|
|
30
32
|
}, state, output);
|
|
31
|
-
|
|
33
|
+
}
|
|
34
|
+
else if (t.isVariableDeclarator(node) &&
|
|
35
|
+
(t.isObjectPattern(node.id) || t.isArrayPattern(node.id)))
|
|
32
36
|
collectDestructuring(node, ownerCallableId, state, output);
|
|
33
37
|
},
|
|
34
38
|
exit: (node) => {
|
|
@@ -41,9 +45,12 @@ export const collectJavaScriptSemanticObjects = (program, state, callables) => {
|
|
|
41
45
|
};
|
|
42
46
|
const collectMember = (node, parent, ownerCallableId, context) => {
|
|
43
47
|
const { state, output } = context;
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
// A chain is one property access; retaining every prefix duplicates work and
|
|
49
|
+
// would make full paths quadratic in deeply nested producer expressions.
|
|
50
|
+
if ((t.isMemberExpression(parent) || t.isOptionalMemberExpression(parent)) &&
|
|
51
|
+
parent.object === node)
|
|
46
52
|
return;
|
|
53
|
+
const identity = expressionObjectIdentity(node, state);
|
|
47
54
|
const write = (t.isAssignmentExpression(parent) && parent.left === node) ||
|
|
48
55
|
(t.isUpdateExpression(parent) && parent.argument === node);
|
|
49
56
|
const readsBeforeWrite = write && semanticReadsBeforeWrite(node, parent);
|
|
@@ -52,42 +59,53 @@ const collectMember = (node, parent, ownerCallableId, context) => {
|
|
|
52
59
|
node,
|
|
53
60
|
kind: "read",
|
|
54
61
|
ownerCallableId,
|
|
55
|
-
objectBindingId:
|
|
62
|
+
objectBindingId: identity.bindingId,
|
|
56
63
|
targetBindingId: null,
|
|
57
|
-
|
|
64
|
+
propertyPath: identity.path,
|
|
58
65
|
}, state, output);
|
|
59
66
|
addObjectOperation({
|
|
60
67
|
node,
|
|
61
68
|
kind: write ? "write" : "read",
|
|
62
69
|
ownerCallableId,
|
|
63
|
-
objectBindingId:
|
|
70
|
+
objectBindingId: identity.bindingId,
|
|
64
71
|
targetBindingId: null,
|
|
65
|
-
|
|
72
|
+
propertyPath: identity.path,
|
|
66
73
|
}, state, output);
|
|
67
74
|
};
|
|
68
75
|
const collectDestructuring = (node, ownerCallableId, state, output) => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
const source = expressionObjectIdentity(node.init, state);
|
|
77
|
+
const visit = (pattern, path) => {
|
|
78
|
+
if (t.isObjectPattern(pattern)) {
|
|
79
|
+
for (const property of pattern.properties) {
|
|
80
|
+
if (!t.isObjectProperty(property))
|
|
81
|
+
continue;
|
|
82
|
+
const name = semanticStaticPropertyKey(property.key, property.computed);
|
|
83
|
+
if (name !== null)
|
|
84
|
+
visit(property.value, [...path, name]);
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (t.isArrayPattern(pattern)) {
|
|
89
|
+
pattern.elements.forEach((element, index) => {
|
|
90
|
+
if (element !== null && !t.isRestElement(element))
|
|
91
|
+
visit(element, [...path, String(index)]);
|
|
92
|
+
});
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const target = bindingIdentifier(pattern);
|
|
96
|
+
if (target === null)
|
|
97
|
+
return;
|
|
79
98
|
addObjectOperation({
|
|
80
|
-
node:
|
|
99
|
+
node: pattern,
|
|
81
100
|
kind: "destructure",
|
|
82
101
|
ownerCallableId,
|
|
83
|
-
objectBindingId,
|
|
84
|
-
targetBindingId: target
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
?.bindingId ?? null),
|
|
88
|
-
propertyName: name,
|
|
102
|
+
objectBindingId: source.bindingId,
|
|
103
|
+
targetBindingId: resolveSemanticBindingState(state, target, target.name)?.bindingId ??
|
|
104
|
+
null,
|
|
105
|
+
propertyPath: source.path === null ? null : [...source.path, ...path],
|
|
89
106
|
}, state, output);
|
|
90
|
-
}
|
|
107
|
+
};
|
|
108
|
+
visit(node.id, []);
|
|
91
109
|
};
|
|
92
110
|
const addObjectOperation = (input, state, output) => {
|
|
93
111
|
output.push({
|
|
@@ -97,21 +115,40 @@ const addObjectOperation = (input, state, output) => {
|
|
|
97
115
|
ownerCallableId: input.ownerCallableId,
|
|
98
116
|
objectBindingId: input.objectBindingId,
|
|
99
117
|
targetBindingId: input.targetBindingId,
|
|
100
|
-
|
|
101
|
-
resolution: input.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
:
|
|
106
|
-
input.propertyName === null ||
|
|
107
|
-
(input.kind === "destructure" && input.targetBindingId === null)
|
|
108
|
-
? "partial"
|
|
109
|
-
: "complete",
|
|
118
|
+
propertyPath: input.propertyPath,
|
|
119
|
+
resolution: input.objectBindingId === null ||
|
|
120
|
+
input.propertyPath === null ||
|
|
121
|
+
(input.kind === "destructure" && input.targetBindingId === null)
|
|
122
|
+
? "partial"
|
|
123
|
+
: "complete",
|
|
110
124
|
});
|
|
111
125
|
};
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
126
|
+
const expressionObjectIdentity = (node, state) => {
|
|
127
|
+
const path = [];
|
|
128
|
+
let current = node;
|
|
129
|
+
let staticPath = true;
|
|
130
|
+
while (current !== null && current !== undefined) {
|
|
131
|
+
current = unwrapJavaScriptExpression(current).node;
|
|
132
|
+
if (t.isMemberExpression(current) ||
|
|
133
|
+
t.isOptionalMemberExpression(current)) {
|
|
134
|
+
const name = semanticStaticPropertyKey(current.property, current.computed);
|
|
135
|
+
if (name === null)
|
|
136
|
+
staticPath = false;
|
|
137
|
+
else
|
|
138
|
+
path.push(name);
|
|
139
|
+
current = current.object;
|
|
140
|
+
}
|
|
141
|
+
else
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
bindingId: t.isIdentifier(current)
|
|
146
|
+
? (resolveSemanticBindingState(state, current, current.name)?.bindingId ??
|
|
147
|
+
null)
|
|
148
|
+
: null,
|
|
149
|
+
path: staticPath ? path.reverse() : null,
|
|
150
|
+
};
|
|
151
|
+
};
|
|
115
152
|
const bindingIdentifier = (node) => {
|
|
116
153
|
if (t.isIdentifier(node))
|
|
117
154
|
return node;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { compareCodePoints } from "../canonicalOrdering.js";
|
|
1
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
3
2
|
import { semanticPrimitiveKey } from "./javascriptSemanticProvenance.js";
|
|
4
|
-
import { readExactJavaScriptLiteral } from "./javascriptAstValues.js";
|
|
5
3
|
import { SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT, exceedsSemanticPrimitiveStringByteBudget, semanticResourceLimitUnknown, } from "./javascriptSemanticResourceLimits.js";
|
|
6
|
-
/**
|
|
7
|
-
* Keep eight independent binary choices exact, while bounding the next
|
|
8
|
-
* exponential expansion before it allocates hundreds more alternatives.
|
|
9
|
-
*/
|
|
10
|
-
export const MAX_SEMANTIC_PRIMITIVE_CANDIDATES = SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT;
|
|
11
4
|
/** Normalize one bounded collection of possible primitive values. */
|
|
12
5
|
export const semanticPrimitiveSet = (values) => {
|
|
13
6
|
const uniqueValues = new Set();
|
|
@@ -17,15 +10,20 @@ export const semanticPrimitiveSet = (values) => {
|
|
|
17
10
|
status: "unknown",
|
|
18
11
|
reason: "Nonfinite numbers are outside the JSON primitive lattice.",
|
|
19
12
|
};
|
|
13
|
+
if (typeof value === "number" && Object.is(value, -0))
|
|
14
|
+
return {
|
|
15
|
+
status: "unknown",
|
|
16
|
+
reason: "Negative zero cannot be preserved by JSON primitive evidence.",
|
|
17
|
+
};
|
|
20
18
|
uniqueValues.add(value);
|
|
21
|
-
if (uniqueValues.size >
|
|
19
|
+
if (uniqueValues.size > SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT)
|
|
22
20
|
return semanticResourceLimitUnknown("primitive-candidates");
|
|
23
21
|
}
|
|
24
22
|
if (exceedsSemanticPrimitiveStringByteBudget([...uniqueValues].flatMap((value) => typeof value === "string" ? [value] : [])))
|
|
25
23
|
return semanticResourceLimitUnknown("primitive-bytes");
|
|
26
24
|
const unique = [...uniqueValues]
|
|
27
25
|
.map((value) => ({ key: semanticPrimitiveKey(value), value }))
|
|
28
|
-
.sort((left, right) =>
|
|
26
|
+
.sort((left, right) => compareUnicodeCodePoints(left.key, right.key))
|
|
29
27
|
.map(({ value }) => value);
|
|
30
28
|
const only = unique[0];
|
|
31
29
|
return unique.length === 1 && only !== undefined
|
|
@@ -38,7 +36,3 @@ export const semanticPrimitiveCandidates = (value) => value.status === "literal"
|
|
|
38
36
|
: value.status === "union"
|
|
39
37
|
? value.values
|
|
40
38
|
: null;
|
|
41
|
-
/** Parse one Babel primitive literal without evaluating code. */
|
|
42
|
-
export const semanticPrimitiveValue = (node) => {
|
|
43
|
-
return readExactJavaScriptLiteral(node);
|
|
44
|
-
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
2
|
import { resolveSemanticBindingState, semanticResolutionBlocked, isUnshadowedGlobal, } from "./javascriptSemanticState.js";
|
|
3
3
|
import { semanticRequireOrigin } from "./javascriptSemanticRequireOrigin.js";
|
|
4
|
-
import {
|
|
4
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
5
5
|
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
|
|
6
6
|
import { evaluateSemanticBinding, evaluateSemanticProvenance, } from "./javascriptSemanticValues.js";
|
|
7
|
-
import {
|
|
8
|
-
import { semanticStaticPropertyKey } from "./javascriptAstValues.js";
|
|
7
|
+
import { range } from "./javascriptStaticAnalysisHelpers.js";
|
|
8
|
+
import { propertyName, semanticStaticPropertyKey, } from "./javascriptAstValues.js";
|
|
9
9
|
/** Retain callable identity without polluting lexical bindings. */
|
|
10
10
|
export const collectSemanticCallable = (input) => {
|
|
11
11
|
const { node, parent, containerScope, bodyScope, state } = input;
|
|
@@ -43,7 +43,7 @@ export const collectSemanticModuleLink = (node, state) => {
|
|
|
43
43
|
localName: null,
|
|
44
44
|
exportedName: "*",
|
|
45
45
|
location: range(node),
|
|
46
|
-
});
|
|
46
|
+
}, node);
|
|
47
47
|
else if (t.isExportNamedDeclaration(node))
|
|
48
48
|
collectNamedExports(node, state);
|
|
49
49
|
else if (t.isExportDefaultDeclaration(node))
|
|
@@ -55,7 +55,7 @@ export const collectSemanticModuleLink = (node, state) => {
|
|
|
55
55
|
exportedName: "default",
|
|
56
56
|
callableId: semanticCallableIdForNode(node.declaration),
|
|
57
57
|
location: range(node),
|
|
58
|
-
});
|
|
58
|
+
}, node);
|
|
59
59
|
else if (t.isVariableDeclarator(node))
|
|
60
60
|
collectRequireLink(node, state);
|
|
61
61
|
else if (t.isAssignmentExpression(node))
|
|
@@ -121,7 +121,7 @@ export const immutableSemanticScopes = (state) => state.scopes.map((scope) => ({
|
|
|
121
121
|
bindingsComplete: scope.bindingsComplete,
|
|
122
122
|
bindingIds: [...scope.bindings.values()]
|
|
123
123
|
.map(({ bindingId }) => bindingId)
|
|
124
|
-
.sort(
|
|
124
|
+
.sort(compareUnicodeCodePoints),
|
|
125
125
|
}));
|
|
126
126
|
/** Evaluate and freeze bindings into deterministic IR order. */
|
|
127
127
|
export const immutableSemanticBindings = (state) => [...state.bindingsById.values()]
|
|
@@ -135,8 +135,7 @@ export const immutableSemanticBindings = (state) => [...state.bindingsById.value
|
|
|
135
135
|
value: evaluateSemanticBinding(binding, state),
|
|
136
136
|
provenance: evaluateSemanticProvenance(binding, state),
|
|
137
137
|
}))
|
|
138
|
-
.sort((left, right) =>
|
|
139
|
-
export { semanticStaticPropertyKey, semanticStaticPropertyName, } from "./javascriptAstValues.js";
|
|
138
|
+
.sort((left, right) => compareUnicodeCodePoints(left.bindingId, right.bindingId));
|
|
140
139
|
const callableKind = (node) => {
|
|
141
140
|
if (t.isClassMethod(node) ||
|
|
142
141
|
t.isClassPrivateMethod(node) ||
|
|
@@ -181,7 +180,7 @@ const collectImports = (node, state) => {
|
|
|
181
180
|
localName: null,
|
|
182
181
|
exportedName: null,
|
|
183
182
|
location: range(node),
|
|
184
|
-
});
|
|
183
|
+
}, node);
|
|
185
184
|
for (const specifier of node.specifiers)
|
|
186
185
|
addModuleLink(state, {
|
|
187
186
|
kind: "import",
|
|
@@ -194,7 +193,7 @@ const collectImports = (node, state) => {
|
|
|
194
193
|
localName: specifier.local.name,
|
|
195
194
|
exportedName: null,
|
|
196
195
|
location: range(specifier),
|
|
197
|
-
});
|
|
196
|
+
}, node);
|
|
198
197
|
};
|
|
199
198
|
const collectNamedExports = (node, state) => {
|
|
200
199
|
if (node.declaration !== null && node.declaration !== undefined)
|
|
@@ -207,7 +206,7 @@ const collectNamedExports = (node, state) => {
|
|
|
207
206
|
exportedName: localName,
|
|
208
207
|
callableId: declarationCallableId(node.declaration, localName),
|
|
209
208
|
location: range(node.declaration),
|
|
210
|
-
});
|
|
209
|
+
}, node);
|
|
211
210
|
for (const specifier of node.specifiers)
|
|
212
211
|
if (t.isExportSpecifier(specifier))
|
|
213
212
|
addModuleLink(state, {
|
|
@@ -217,7 +216,7 @@ const collectNamedExports = (node, state) => {
|
|
|
217
216
|
localName: node.source == null ? propertyName(specifier.local) : null,
|
|
218
217
|
exportedName: propertyName(specifier.exported),
|
|
219
218
|
location: range(specifier),
|
|
220
|
-
});
|
|
219
|
+
}, node);
|
|
221
220
|
};
|
|
222
221
|
const collectRequireLink = (node, state) => {
|
|
223
222
|
const origin = semanticRequireOrigin(node.init, state);
|
|
@@ -231,7 +230,7 @@ const collectRequireLink = (node, state) => {
|
|
|
231
230
|
localName: binding.localName,
|
|
232
231
|
exportedName: null,
|
|
233
232
|
location: range(node),
|
|
234
|
-
});
|
|
233
|
+
}, node);
|
|
235
234
|
};
|
|
236
235
|
const requirePatternBindings = (pattern, path) => {
|
|
237
236
|
if (t.isTSParameterProperty(pattern))
|
|
@@ -268,10 +267,16 @@ const collectCommonJsExport = (node, state) => {
|
|
|
268
267
|
exportedName,
|
|
269
268
|
callableId: semanticCallableIdForNode(node.right),
|
|
270
269
|
location: range(node),
|
|
271
|
-
});
|
|
270
|
+
}, node);
|
|
272
271
|
};
|
|
273
|
-
const addModuleLink = (state, link) => {
|
|
274
|
-
|
|
272
|
+
const addModuleLink = (state, link, referenceNode) => {
|
|
273
|
+
const collected = { ...link, callableId: link.callableId ?? null };
|
|
274
|
+
state.moduleLinks.push(collected);
|
|
275
|
+
if (link.localName !== null) {
|
|
276
|
+
const binding = resolveSemanticBindingState(state, referenceNode, link.localName);
|
|
277
|
+
if (binding !== undefined)
|
|
278
|
+
state.moduleLinkBindings.set(collected, binding);
|
|
279
|
+
}
|
|
275
280
|
};
|
|
276
281
|
/** Deterministic callable identity shared by collection and return recovery. */
|
|
277
282
|
export const semanticCallableIdForNode = (node) => {
|