rea-agents 6.5.0 → 6.7.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 +12 -3
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/bridge/android/ReaJadxBridge.java +167 -23
- package/bridge/cutter/rea_bridge.py +19 -10
- package/bridge/ghidra/ReaGhidraBridge.java +98 -66
- package/bridge/hopper_bridge.py +9 -1
- package/bridge/native/rea_lldb_tracer.py +48 -4
- package/bridge/pwndbg/core_context.py +15 -2
- package/dist/adb/AdbCommand.js +148 -0
- package/dist/adb/AdbConfiguration.js +26 -4
- package/dist/adb/AdbInputSnapshot.js +126 -0
- package/dist/adb/AdbProvider.js +765 -248
- package/dist/adb/AdbShellOutput.js +92 -21
- package/dist/android/AndroidTargetSnapshot.js +7 -7
- package/dist/android/JadxAnalysis.js +27 -32
- package/dist/android/JadxConfiguration.js +173 -125
- package/dist/android/JadxDoctor.js +11 -3
- package/dist/android/JadxFailure.js +154 -0
- package/dist/android/JadxInterruption.js +13 -0
- package/dist/android/JadxJavaProbe.js +246 -0
- package/dist/android/JadxMcpTransport.js +48 -15
- package/dist/android/JadxProtocol.js +29 -2
- package/dist/android/JadxProvider.js +171 -96
- package/dist/android/JadxRelease.js +5 -1
- package/dist/android/JadxSession.js +35 -14
- package/dist/apktool/ApktoolCommandCleanup.js +134 -0
- package/dist/apktool/ApktoolCommandOutput.js +22 -0
- package/dist/apktool/ApktoolConfiguration.js +162 -44
- package/dist/apktool/ApktoolDecodeOutput.js +29 -23
- package/dist/apktool/ApktoolDecodedInventory.js +52 -0
- package/dist/apktool/ApktoolProvider.js +254 -335
- package/dist/apktool/ApktoolStringTables.js +178 -0
- package/dist/apktool/ApktoolWorkspace.js +162 -0
- package/dist/application/AnalysisDocument.js +19 -4
- package/dist/application/AnalysisProvider.js +15 -1
- package/dist/application/AppBundleExecutable.js +11 -4
- package/dist/application/BinaryTargetResolver.js +9 -2
- package/dist/application/BrowserObservationService.js +54 -20
- package/dist/application/BrowserScenarioCaptureService.js +26 -6
- package/dist/application/CapabilityInventory.js +14 -8
- package/dist/application/ClaudeDesktopConfigLocation.js +5 -5
- package/dist/application/ClientConfigurationCleanup.js +73 -0
- package/dist/application/ClientConfigurationDocument.js +170 -128
- package/dist/application/ClientConfigurationPublication.js +167 -0
- package/dist/application/ClientRegistrationEnvironment.js +31 -1
- package/dist/application/ClientRegistrationIdentity.js +54 -39
- package/dist/application/ClientRegistrationStatus.js +123 -48
- package/dist/application/DirectAnalysis.js +15 -2
- package/dist/application/DirectAnalysisCleanup.js +5 -1
- package/dist/application/DirectAnalysisStatus.js +1 -1
- package/dist/application/Doctor.js +83 -9
- package/dist/application/DoctorDiagnostics.js +25 -4
- package/dist/application/DoctorProviderIds.js +7 -1
- package/dist/application/DshCordisPatch.js +1 -1
- package/dist/application/EnhancedTools.js +9 -21
- package/dist/application/HermesClientHome.js +20 -0
- package/dist/application/HermesConfigurationYaml.js +43 -3
- package/dist/application/HopperDownload.js +11 -3
- package/dist/application/HopperReleaseFeed.js +71 -0
- package/dist/application/InvestigationProviders.js +4 -3
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LinuxHopper.js +96 -71
- package/dist/application/LinuxHopperPublisher.js +656 -0
- package/dist/application/MacHopper.js +182 -66
- package/dist/application/MipsElfMetadata.js +1 -1
- package/dist/application/MsixPackageStorage.js +13 -6
- package/dist/application/ProviderOperationExecution.js +13 -20
- package/dist/application/ReconstructionObligationCandidates.js +17 -2
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +4 -0
- package/dist/application/ReconstructionObligationLedgerService.js +5 -3
- package/dist/application/ReconstructionObligationOriginalCases.js +8 -0
- package/dist/application/ReferenceSourceImportEntries.js +160 -18
- package/dist/application/ReferenceSourceImportPolicy.js +5 -3
- package/dist/application/ReferenceSourceVcsAdapter.js +3 -1
- package/dist/application/RegularFileRead.js +107 -88
- package/dist/application/Setup.js +23 -11
- package/dist/application/SetupClientConfiguration.js +155 -89
- package/dist/application/SetupClients.js +22 -13
- package/dist/application/SetupHost.js +90 -34
- package/dist/application/SetupInstallFailure.js +18 -3
- package/dist/application/SetupPlan.js +15 -5
- package/dist/application/SetupRecoveryBackup.js +40 -13
- package/dist/application/SetupRegistrationEnvironment.js +12 -0
- package/dist/application/SetupSkill.js +10 -30
- package/dist/application/SourceLimitations.js +35 -0
- package/dist/application/SupportedClients.js +4 -4
- package/dist/application/Uninstall.js +91 -36
- package/dist/application/UpdateCommandProgress.js +66 -0
- package/dist/application/UpdateMaintenance.js +7 -2
- package/dist/application/UpdateRuntime.js +60 -30
- package/dist/application/WebModuleTraceService.js +35 -22
- package/dist/application/WebNetworkCaptureService.js +8 -5
- package/dist/application/WebRuntimeService.js +41 -8
- package/dist/application/WebScriptExportService.js +6 -4
- package/dist/application/WebSourceLocationService.js +3 -4
- package/dist/application/WorkflowEvidence.js +11 -4
- package/dist/application/analysisView/AnalysisViewService.js +9 -52
- package/dist/application/android/AndroidAnalysisService.js +5 -4
- package/dist/application/android/AndroidSearchEvidenceSummary.js +6 -8
- package/dist/application/artifacts/ArtifactComparisonEvidence.js +32 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +14 -11
- package/dist/application/binary/AnalysisProviderRegistry.js +340 -50
- package/dist/application/binary/BinarySession.js +73 -34
- package/dist/application/binary/BinarySessionRecords.js +3 -0
- package/dist/application/binary/BinarySessionStatus.js +3 -4
- package/dist/application/binary/CompositeProvider.js +75 -30
- package/dist/application/binary/LazyAnalysisProvider.js +6 -68
- package/dist/application/binary/SessionProviderRouter.js +11 -2
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +3 -4
- package/dist/application/binaryDiagnostics/PeResourcesService.js +22 -5
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +3 -4
- package/dist/application/captures/PacketCaptureService.js +3 -2
- package/dist/application/closeOwnedWebResources.js +32 -2
- package/dist/application/electron/ElectronFuseService.js +8 -43
- package/dist/application/evm/EvmInterfaceEvidence.js +11 -0
- package/dist/application/evm/EvmInterfaceService.js +4 -15
- package/dist/application/firmware/FirmwareAnalysisService.js +4 -3
- package/dist/application/go/GoBinaryService.js +4 -5
- package/dist/application/investigation/EvidenceLedger.js +3 -4
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +14 -2
- package/dist/application/javascript/ElectronEvidence.js +1 -2
- package/dist/application/javascript/ElectronObservationService.js +41 -7
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +6 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +35 -17
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +30 -1
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +3 -2
- package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +3 -3
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +41 -11
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +18 -8
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +84 -24
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +15 -3
- package/dist/application/javascript/JavaScriptModuleRelationships.js +1 -1
- package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +1 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +33 -10
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +4 -5
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +103 -24
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +13 -4
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +23 -3
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +18 -5
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +4 -6
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +5 -8
- package/dist/application/native/NativeCallRoutes.js +40 -23
- package/dist/application/native/NativeUiActionTrace.js +8 -0
- package/dist/application/native/NativeValueTrace.js +8 -0
- package/dist/application/reverse/ReverseEngineeringService.js +2 -2
- package/dist/application/rust/RustBinaryService.js +6 -4
- package/dist/application/signals/SignalRecordingService.js +3 -2
- package/dist/application/wasm/WasmArtifactService.js +4 -5
- package/dist/artifacts/AnalysisCleanupLease.js +119 -0
- package/dist/artifacts/ArtifactFileOperation.js +150 -0
- package/dist/artifacts/ArtifactHash.js +2 -1
- package/dist/artifacts/ArtifactProvider.js +16 -5
- package/dist/artifacts/ArtifactReader.js +50 -4
- package/dist/artifacts/ArtifactResourceScope.js +80 -6
- package/dist/artifacts/AsarArtifactReader.js +12 -11
- package/dist/artifacts/AsarEntryStream.js +49 -17
- package/dist/artifacts/DirectoryArtifactReader.js +28 -7
- package/dist/artifacts/MachOSliceArtifactReader.js +70 -13
- package/dist/artifacts/NativeDmgArtifactReader.js +112 -13
- package/dist/artifacts/SafeOutputTree.js +5 -3
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +1 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +10 -16
- package/dist/artifacts/ZipArtifactReader.js +34 -14
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +3 -1
- package/dist/artifacts/apple/DylibFileAccess.js +106 -0
- package/dist/artifacts/apple/DylibResolutionReader.js +64 -155
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +52 -9
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +25 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +20 -11
- package/dist/artifacts/apple/MachoLoadCommandReader.js +17 -2
- package/dist/artifacts/apple/PlistNumberLiterals.js +104 -116
- package/dist/artifacts/extraction/ArtifactExtraction.js +15 -12
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +9 -11
- package/dist/artifacts/inventory/ArtifactInventory.js +2 -2
- package/dist/artifacts/inventory/classify.js +4 -2
- package/dist/artifacts/inventory/hashStableRootArtifact.js +14 -7
- package/dist/artifacts/inventory/scanCanonical.js +3 -4
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +3 -1
- package/dist/artifacts/readArtifactFileChunks.js +9 -0
- package/dist/artifacts/readStableArtifact.js +12 -34
- package/dist/browser/BrowserScenarioPartialObservation.js +14 -48
- package/dist/browser/CdpBrowserProvider.js +81 -30
- package/dist/browser/CdpCaptureDocuments.js +99 -131
- package/dist/browser/CdpCaptureDomSvg.js +31 -60
- package/dist/browser/CdpCaptureValues.js +12 -0
- package/dist/browser/CdpConnection.js +133 -27
- package/dist/browser/CdpElectronInspection.js +60 -60
- package/dist/browser/CdpElectronProvider.js +56 -4
- package/dist/browser/CdpElectronScriptEvents.js +4 -1
- package/dist/browser/CdpElectronScripts.js +2 -5
- package/dist/browser/CdpElectronWorkers.js +13 -2
- package/dist/browser/CdpPageCapture.js +2 -1
- package/dist/browser/CdpPageCaptureScripts.js +14 -10
- package/dist/browser/CdpPageCaptureWorkers.js +45 -14
- package/dist/browser/CdpSafeMetadata.js +23 -19
- package/dist/browser/CdpSnapshotNodes.js +103 -0
- package/dist/browser/CdpSnapshotStrings.js +0 -6
- package/dist/browser/CdpTargetSession.js +52 -10
- package/dist/browser/CdpTargetSessionOwner.js +198 -0
- package/dist/browser/ElectronCaptureCleanup.js +82 -0
- package/dist/browser/ElectronProcessCleanup.js +91 -0
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +71 -16
- package/dist/browser/PlaywrightElectronActiveActions.js +53 -5
- package/dist/browser/PlaywrightElectronActiveFuses.js +86 -0
- package/dist/browser/PlaywrightElectronActiveProjection.js +5 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +140 -151
- package/dist/browser/PlaywrightExecutionBoundary.js +4 -2
- package/dist/browser/PlaywrightScenarioBrowser.js +236 -90
- package/dist/browser/PlaywrightScenarioEvents.js +135 -48
- package/dist/browser/PlaywrightScenarioServiceWorkers.js +121 -34
- package/dist/browser/PlaywrightScenarioSession.js +95 -22
- package/dist/browser/PlaywrightScenarioStorage.js +15 -7
- package/dist/browser/StructuredFieldToken.js +53 -0
- package/dist/browser/WebArtifactCleanup.js +53 -0
- package/dist/browser/WebSourceMapFetcher.js +19 -10
- package/dist/browser/assets/WebArtifactReads.js +6 -2
- package/dist/browser/assets/WebSourceLocationArtifacts.js +12 -3
- package/dist/browser/execution/CdpRuntimeSession.js +36 -7
- package/dist/browser/execution/CdpWebRuntimeProvider.js +22 -4
- package/dist/browser/history/CaptureFailures.js +7 -2
- package/dist/browser/history/HarCapture.js +42 -11
- package/dist/browser/history/SazMetadata.js +10 -47
- package/dist/browser/modules/NativeModuleResolver.js +108 -58
- package/dist/browser/modules/WebModuleArtifacts.js +12 -3
- package/dist/browser/network/PlaywrightNetworkContent.js +40 -17
- package/dist/browser/network/PlaywrightScenarioNetwork.js +182 -73
- package/dist/captures/TsharkCaptureProvider.js +13 -6
- package/dist/catalogIdentity.js +19 -14
- package/dist/cli/adbCommands.js +18 -19
- package/dist/cli/androidCommands.js +2 -14
- package/dist/cli/apktoolCommands.js +4 -14
- package/dist/cli/binaryDiagnosticsCommands.js +5 -5
- package/dist/cli/browserAdvancedCommands.js +11 -4
- package/dist/cli/browserCommands.js +21 -12
- package/dist/cli/captureCommands.js +4 -4
- package/dist/cli/cliResultOutput.js +175 -89
- package/dist/cli/coreBinaryCommands.js +4 -3
- package/dist/cli/cutterCommands.js +51 -13
- package/dist/cli/electronCommands.js +34 -13
- package/dist/cli/evmCommands.js +6 -15
- package/dist/cli/finishAnalysisCommand.js +10 -2
- package/dist/cli/firmwareCommands.js +6 -14
- package/dist/cli/flutterCommands.js +2 -18
- package/dist/cli/fridaCommands.js +8 -0
- package/dist/cli/goCommands.js +2 -2
- package/dist/cli/javascriptRecoveryCommands.js +14 -26
- package/dist/cli/jebCommands.js +2 -14
- package/dist/cli/options.js +6 -0
- package/dist/cli/pcapCommands.js +2 -20
- package/dist/cli/rustCommands.js +6 -7
- package/dist/cli/setupCommands.js +4 -3
- package/dist/cli/signalCommands.js +4 -4
- package/dist/cli/sqliteCommands.js +17 -44
- package/dist/cli/wasmCommands.js +7 -18
- package/dist/cli/webModuleCommands.js +19 -34
- package/dist/cli/webNetworkCaptureCommands.js +3 -2
- package/dist/cli/webRuntimeCommands.js +15 -6
- package/dist/cli/webSourceLocationCommands.js +14 -33
- package/dist/cli-runtime/AnalysisCleanupLease-CWfTGYKd.js +103 -0
- package/dist/cli-runtime/{AnalysisProvider-D0Us2OTk.js → AnalysisProvider-BGrYaMVo.js} +14 -3
- package/dist/cli-runtime/{AnalysisSnapshotCache-BXS0wRd2.js → AnalysisSnapshotCache-BjRlXeUS.js} +14 -13
- package/dist/cli-runtime/ArtifactFileOperation-Dg4BcoEM.js +122 -0
- package/dist/cli-runtime/{ArtifactReader-BXkffc1D.js → ArtifactReader-DMwm42bk.js} +29 -6
- package/dist/cli-runtime/ArtifactResourceScope-CokZGcII.js +175 -0
- package/dist/cli-runtime/{AsarHeader-CnzOzYEH.js → AsarHeader-BxwU17DJ.js} +1 -1
- package/dist/cli-runtime/{BinarySessionStatus-DnMxMk-r.js → BinarySessionStatus-DRhjr7Vb.js} +4 -3
- package/dist/cli-runtime/{BinaryTargetResolver-CVIJ_s1A.js → BinaryTargetResolver-tuCTjBlQ.js} +38 -108
- package/dist/cli-runtime/{BoundedFileBytes-BU30odTm.js → BoundedFileBytes-DRtiQNAQ.js} +7 -3
- package/dist/cli-runtime/{CdpTargetSession-DGX5pV9w.js → CdpTargetSession-CQ08KHbh.js} +318 -43
- package/dist/cli-runtime/ClientConfigPath-Dn-V_GUf.js +255 -0
- package/dist/cli-runtime/{ClientConfigurationDocument-ffQ9X0Se.js → ClientConfigurationDocument-C9T8MNGc.js} +206 -142
- package/dist/cli-runtime/{ClientRegistrationStatus-DszCyPEU.js → ClientRegistrationStatus-PnD29RTX.js} +112 -36
- package/dist/cli-runtime/{CurrentEntrypointPath-D5FRNdkq.js → CurrentEntrypointPath-m7QCIVN0.js} +1 -1
- package/dist/cli-runtime/{DirectAnalysis-BgvAtpN3.js → DirectAnalysis-C5NyUryV.js} +76 -23
- package/dist/cli-runtime/DirectoryArtifactReader-CokAJ8vo.js +448 -0
- package/dist/cli-runtime/{Doctor-DIpf_I7N.js → Doctor-DrkWsav4.js} +105 -25
- package/dist/cli-runtime/{ElectronFileScope-dpHm2nrS.js → ElectronFileScope-AP7VoVr7.js} +204 -149
- package/dist/cli-runtime/ElectronFuseFailures-DsjXR7Xp.js +609 -0
- package/dist/cli-runtime/{ExecFileOutput-BEQs-lDD.js → ExecFileOutput-D6KLYTve.js} +11 -9
- package/dist/cli-runtime/{InterfaceBuilderDecodeBudget-D4omRUe4.js → InterfaceBuilderDecodeBudget-CW1IO3dG.js} +40 -21
- package/dist/cli-runtime/{InventoryProjectionEvidence-DIsI4DJ6.js → InventoryProjectionEvidence-DTH5QAqL.js} +3 -3
- package/dist/cli-runtime/{InvestigationProviders-DoQRIHii.js → InvestigationProviders-CFh4a64d.js} +3 -2
- package/dist/cli-runtime/{JavaScriptApplicationEvidenceGraph-D5aI_FSJ.js → JavaScriptApplicationEvidenceGraph-gOmPB2L6.js} +6 -6
- package/dist/cli-runtime/{JavaScriptApplicationWorkflowEvidence-Bz4-V0Ct.js → JavaScriptApplicationWorkflowEvidence-WZgtK_Ok.js} +2 -2
- package/dist/cli-runtime/JebMcpEndpoint-BEalGZh9.js +710 -0
- package/dist/cli-runtime/{JsonFiles-DQa1PRKy.js → JsonFiles-uvd6ZyQi.js} +10 -118
- package/dist/cli-runtime/KunaInstallation-P0j3x851.js +1781 -0
- package/dist/cli-runtime/MacHopperPaths-bGzqjF1Z.js +34 -0
- package/dist/cli-runtime/{MachoLoadCommandReader-C7e074Ze.js → MachoLoadCommandReader-CZm6N5vF.js} +12 -192
- package/dist/cli-runtime/{ManagedSnapshot-rqyBHcdL.js → ManagedSnapshot-CPE9C3OD.js} +406 -110
- package/dist/cli-runtime/OwnedCommandCleanup-BN_V6Erc.js +187 -0
- package/dist/cli-runtime/OwnedRegularFile-D1f5nUCx.js +256 -0
- package/dist/cli-runtime/OwnedStagedOutput-D31dOozz.js +126 -0
- package/dist/cli-runtime/{PrivateRuntimeRoot-DAy0PiBM.js → PrivateRuntimeRoot-Cd23u6jd.js} +39 -6
- package/dist/cli-runtime/ProcessOwnership-CtrNr6ee.js +545 -0
- package/dist/cli-runtime/{ProcessOwnership-DXC5-UWt.js → ProcessOwnershipObservation-C006iCtZ.js} +149 -607
- package/dist/cli-runtime/{ProviderDeadline-8m2pFRDc.js → ProviderDeadline-rSuH4Pm8.js} +27 -1
- package/dist/cli-runtime/ProviderOperationExecution-CmU-XrQr.js +38 -0
- package/dist/cli-runtime/{snapshotEnvironment-D_tWyOub.js → ProviderProcess-D87A7ctp.js} +117 -160
- package/dist/cli-runtime/RegularFileRead-mbgGYtxe.js +125 -0
- package/dist/cli-runtime/{SafeOutputTree-D6U15GXd.js → SafeOutputTree-i904hd_2.js} +21 -20
- package/dist/cli-runtime/{SetupHost-FkYWswsq.js → SetupHost-CMPmPraB.js} +365 -195
- package/dist/cli-runtime/SharedStartupAttempt-BxKyf3Uv.js +1424 -0
- package/dist/cli-runtime/StableFileHash-Ame_h3lY.js +61 -0
- package/dist/cli-runtime/{SupportedClients-DaX6Lt2d.js → SupportedClients-DMafjitv.js} +89 -72
- package/dist/cli-runtime/{Update-CbTC_eg1.js → Update-DAsASWlE.js} +1 -1
- package/dist/cli-runtime/{AbortablePromise-BVBemxbD.js → WindowsBatchCommand-Cx9kaVNf.js} +2 -28
- package/dist/cli-runtime/WindowsNativeLoader-BqyZO0ZD.js +142 -0
- package/dist/cli-runtime/{ZipArtifactReader-B8ZgNe4D.js → ZipArtifactReader-Jed69LEL.js} +20 -16
- package/dist/cli-runtime/{analysisErrorCleanup-Do6YeeoD.js → analysisErrorCleanup-COdAmDsb.js} +4 -3
- package/dist/cli-runtime/{appleArchiveFormat-tVoI2ykA.js → appleArchiveFormat-Bb3G5CCI.js} +13 -7
- package/dist/cli-runtime/{application__DirectAnalysisStatus-DpOejOf0.js → application__DirectAnalysisStatus-F74bu9oy.js} +10 -10
- package/dist/cli-runtime/{application__EnhancedTools-oFE2bOjs.js → application__EnhancedTools-Bg51b0Yp.js} +84 -51
- package/dist/cli-runtime/{application__FunctionAnalysisEvidence-B6osuhvW.js → application__FunctionAnalysisEvidence-DBWIaYCh.js} +3 -3
- package/dist/cli-runtime/{application__ReconstructionCoverageService-DN3wTFQj.js → application__ReconstructionCoverageService-AEPNpZqJ.js} +3 -3
- package/dist/cli-runtime/{application__ReconstructionObligationLedgerService-CKcTppX9.js → application__ReconstructionObligationLedgerService-Cl9cPEZf.js} +22 -9
- package/dist/cli-runtime/{application__Setup-XpMaRNjy.js → application__Setup-DwQzEewK.js} +30 -18
- package/dist/cli-runtime/{application__Uninstall-_23pU2yB.js → application__Uninstall-BOf9oyvQ.js} +78 -37
- package/dist/cli-runtime/{application__UpdateRuntime-DPvY8ohd.js → application__UpdateRuntime-CzWkRJHa.js} +119 -29
- package/dist/cli-runtime/{application__android__AndroidApplicationService-CFgIFPM4.js → application__android__AndroidApplicationService-shW_aKlj.js} +3 -3
- package/dist/cli-runtime/{application__apple__AppleApplicationService-Db6QCsun.js → application__apple__AppleApplicationService-DIv6d3wB.js} +3 -3
- package/dist/cli-runtime/{application__harmony__HarmonyApplicationService-CFjocHoK.js → application__harmony__HarmonyApplicationService-OIUFVQFV.js} +3 -3
- package/dist/cli-runtime/{application__javascript__ElectronActiveObservationService-CmVDUI_Z.js → application__javascript__ElectronActiveObservationService-wvCh72hK.js} +3 -3
- package/dist/cli-runtime/application__javascript__ElectronObservationService-SydXPCwM.js +88 -0
- package/dist/cli-runtime/{application__javascript__JavaScriptApplicationService-CCkp8KBh.js → application__javascript__JavaScriptApplicationService-o0uEsjEc.js} +1120 -316
- package/dist/cli-runtime/{application__javascript__JavaScriptApplicationWorkflowService-lPy0tzr3.js → application__javascript__JavaScriptApplicationWorkflowService-BAheG_71.js} +51 -44
- package/dist/cli-runtime/{application__javascript__JavaScriptRuntimeReconciliationService-DWleA8K9.js → application__javascript__JavaScriptRuntimeReconciliationService-Cnn4GP8q.js} +5 -5
- package/dist/cli-runtime/{application__javascript__JavaScriptSemanticTraceService-DkALH4rL.js → application__javascript__JavaScriptSemanticTraceService-CmvLfV1A.js} +6 -6
- package/dist/cli-runtime/{artifacts__ArtifactProvider-zXI0QjSL.js → artifacts__ArtifactProvider-wx2K0F2I.js} +377 -359
- package/dist/cli-runtime/{binary-BVOr2mgE.js → binary-CWVNJhAC.js} +8561 -3159
- package/dist/cli-runtime/{catalogIdentity-DLoXgfIR.js → catalogIdentity-DAEEsOdX.js} +260 -81
- package/dist/cli-runtime/cli.js +6177 -3556
- package/dist/cli-runtime/{cliOutput-BC1BdAcB.js → cliOutput-CgSuw782.js} +47 -6
- package/dist/cli-runtime/cliOutput.js +2 -2
- package/dist/cli-runtime/cliResultOutput-10sd6xGx.js +1453 -0
- package/dist/cli-runtime/cliResultOutput.js +2 -1
- package/dist/cli-runtime/{composition__browserScenario-DHXC1a8n.js → composition__browserScenario-BtPb1c1y.js} +843 -356
- package/dist/cli-runtime/{composition__electronObservation-GecK2EID.js → composition__electronObservation-Bk8R6DJo.js} +128 -69
- package/dist/cli-runtime/{composition__electronScenario-CEZnVrAL.js → composition__electronScenario-BVF0qStH.js} +398 -135
- package/dist/cli-runtime/{cutterToolContracts-TZH9EHr5.js → cutterToolContracts-BQtG_Nzo.js} +195 -62
- package/dist/cli-runtime/{doctorRuntime-BE5ZX8it.js → doctorRuntime-B__SIpm-.js} +241 -21
- package/dist/cli-runtime/{dotnet__ManagedStaticProvider-C8_yZCDc.js → dotnet__ManagedStaticProvider-DO5Yzcp4.js} +1 -1
- package/dist/cli-runtime/{errorSchemas-CTRmvMl3.js → errorSchemas-Ixz_q7qt.js} +58 -4
- package/dist/cli-runtime/homeDirectory-DC_DeJIg.js +18 -0
- package/dist/cli-runtime/{javascriptApplicationAnalysis-HgMzVMQw.js → javascriptApplicationAnalysis-Dk6yBV8g.js} +688 -668
- package/dist/cli-runtime/{javascriptExportReturnShapeProjection-Dg00g35t.js → javascriptExportReturnShapeProjection-CObOIiQ6.js} +3 -3
- package/dist/cli-runtime/{javascriptExportShapeComparisonSchemas-BYnoIqIk.js → javascriptExportShapeComparisonSchemas-DpwuBenh.js} +5 -3
- package/dist/cli-runtime/{javascriptRuntimeReconciliation-DNjDoL3S.js → javascriptRuntimeReconciliation-C6ZgWMys.js} +61 -59
- package/dist/cli-runtime/{javascriptRuntimeReconciliationSchemas-BWpGWNcI.js → javascriptRuntimeReconciliationSchemas-D6tZKUQs.js} +2 -2
- package/dist/cli-runtime/{javascriptSemanticTraceSchemas-BTCNcvbc.js → javascriptSemanticTraceSchemas-C7m0b6_w.js} +3 -3
- package/dist/cli-runtime/{lipo-DSWP6fv-.js → lipo-DPQ6qurH.js} +9 -11
- package/dist/cli-runtime/{logger-CQQCI4a2.js → logger-BuDJ9xxO.js} +2 -2
- package/dist/cli-runtime/{machoContainer-C8BIkkq3.js → machoContainer-Cy98bkFm.js} +180 -0
- package/dist/cli-runtime/{managedApplicationGraph-B08jb3jq.js → managedApplicationGraph-BazVqpJv.js} +16 -10
- package/dist/cli-runtime/{managedToolContracts-D60QmIYj.js → managedToolContracts-BuFkMBH5.js} +2 -2
- package/dist/cli-runtime/mcpDoctor.js +8 -6
- package/dist/cli-runtime/mcpStartupPolicy-imCbM3qo.js +28 -0
- package/dist/cli-runtime/{native__NativeMacOSProvider-YBTvUeJO.js → native__NativeMacOSProvider-DTcRhuGA.js} +1384 -757
- package/dist/cli-runtime/{officialToolContracts-CCFF0an9.js → officialToolContracts-CzzVLx8I.js} +74 -53
- package/dist/cli-runtime/peMachine-B9ggfSJJ.js +95 -0
- package/dist/cli-runtime/propertyListKeys-D5dSASEy.js +355 -0
- package/dist/cli-runtime/{providerCleanupError-Ceq8f0wK.js → providerCleanupError-BhsJyAhk.js} +3 -5
- package/dist/cli-runtime/readArtifactFileChunks-BbTL_PtB.js +129 -0
- package/dist/cli-runtime/{reconstructionObligationLedgerSchemas-Bao0xMr-.js → reconstructionObligationLedgerSchemas-Bi6sect1.js} +6329 -3651
- package/dist/cli-runtime/{scanCanonical-KP4T9jSl.js → scanCanonical-CcDFUr-w.js} +233 -363
- package/dist/cli-runtime/snapshotEnvironment-Yvx5qwsl.js +196 -0
- package/dist/cli-runtime/{toolContracts-D2FOG_Nb.js → toolContracts-CJzEyZ38.js} +126 -52
- package/dist/cli-runtime/{toolOutputSchemaGroups-DRiYs1je.js → toolOutputSchemaGroups-BqdSzySu.js} +768 -589
- package/dist/cli-runtime/{workflowInputError-n8Oo-bLA.js → workflowInputError-BP8z9Wxl.js} +2 -2
- package/dist/cli.js +10 -0
- package/dist/cliBrowserScenarioCommands.js +2 -3
- package/dist/cliLogging.js +22 -7
- package/dist/cliObservationOptions.js +3 -0
- package/dist/cliOutput.js +68 -3
- package/dist/composition/binary.js +15 -2
- package/dist/composition/directAnalysis.js +8 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +4 -5
- package/dist/composition/jeb.js +32 -21
- package/dist/config/environment.js +36 -2
- package/dist/config/mcpInputSchemaProfile.js +1 -1
- package/dist/config/parseConfig.js +7 -3
- package/dist/contracts/adb/adbToolContracts.js +2 -2
- package/dist/contracts/analysisViewApiSurfaceExample.js +4 -4
- package/dist/contracts/analysisViewToolContracts.js +42 -1
- package/dist/contracts/android/androidToolContracts.js +1 -1
- package/dist/contracts/apktool/apktoolToolContracts.js +5 -1
- package/dist/contracts/artifactComparisonExample.js +18 -14
- package/dist/contracts/artifactToolContracts.js +2 -1
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/browserToolContracts.js +12 -1
- package/dist/contracts/compactInputSchema.js +13 -6
- package/dist/contracts/fridaToolContracts.js +5 -4
- package/dist/contracts/gdbToolContracts.js +2 -3
- package/dist/contracts/inputSchemaPresentation.js +173 -79
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +1 -0
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +1 -0
- package/dist/contracts/jsonSchemaKeywords.js +29 -0
- package/dist/contracts/managed/managedWorkflowExamples.js +3 -0
- package/dist/contracts/managed/managedWorkflowToolContracts.js +1 -1
- package/dist/contracts/mobileApplicationGraphExamples.js +15 -12
- package/dist/contracts/officialToolContracts.js +2 -2
- package/dist/contracts/rizinDebugToolContracts.js +3 -2
- package/dist/contracts/sessionToolContracts.js +3 -3
- package/dist/contracts/toolEffects.js +6 -2
- package/dist/contracts/toolOutputSchemaGroups.js +7 -4
- package/dist/contracts/toolOutputSchemaPrimitives.js +7 -0
- package/dist/contracts/toolSchemaMetadata.js +99 -27
- package/dist/cutter/CutterBridgeClient.js +206 -67
- package/dist/cutter/CutterBridgeService.js +52 -4
- package/dist/doctorRuntime.js +25 -4
- package/dist/domain/adb/adbDeviceAnalysis.js +19 -1
- package/dist/domain/analysisErrorBase.js +59 -2
- package/dist/domain/analysisErrorCleanup.js +3 -1
- package/dist/domain/analysisErrorCore.js +13 -0
- package/dist/domain/analysisErrorPresentation.js +23 -4
- package/dist/domain/analysisErrorProjection.js +44 -28
- package/dist/domain/analysisSearch.js +26 -0
- package/dist/domain/analysisSnapshot.js +11 -11
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +4 -65
- package/dist/domain/analysisView/analysisView.js +25 -0
- package/dist/domain/analysisView/analysisViewDataAdmission.js +86 -0
- package/dist/domain/analysisView/artifactInventoryView.js +4 -18
- package/dist/domain/analysisView/javascriptApplicationCoverage.js +27 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +100 -27
- package/dist/domain/analysisView/javascriptFactsView.js +92 -0
- package/dist/domain/analysisView/javascriptModuleReferences.js +37 -0
- package/dist/domain/analysisView/managedMemberView.js +6 -0
- package/dist/domain/android/androidApplication.js +8 -7
- package/dist/domain/apktool/apktoolResourceAnalysis.js +52 -2
- package/dist/domain/apple/appleApplication.js +41 -60
- package/dist/domain/apple/appleBundleAnatomy.js +56 -68
- package/dist/domain/apple/dylibResolution.js +5 -1
- package/dist/domain/apple/interfaceBuilderGraph.js +29 -8
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +11 -4
- package/dist/domain/apple/jvmClassFile.js +226 -0
- package/dist/domain/apple/keyedArchive.js +39 -17
- package/dist/domain/apple/machoContainer.js +3 -0
- package/dist/domain/apple/plistNumbers.js +67 -5
- package/dist/domain/apple/plistValue.js +89 -18
- package/dist/domain/artifactComparison.js +7 -5
- package/dist/domain/artifactGraph.js +4 -12
- package/dist/domain/artifactInspection.js +6 -17
- package/dist/domain/artifactInventoryEvidence.js +68 -60
- package/dist/domain/binaryTarget.js +11 -26
- package/dist/domain/binaryTargetTypes.js +10 -0
- package/dist/domain/browserNetworkEvidence.js +20 -3
- package/dist/domain/browserObservation.js +5 -28
- package/dist/domain/browserObservationError.js +4 -4
- package/dist/domain/browserScenarioCapture.js +11 -2
- package/dist/domain/browserScenarioCaptureLimits.js +34 -0
- package/dist/domain/browserScenarioCaptureValues.js +50 -0
- package/dist/domain/browserScenarioDiffEvidence.js +1 -3
- package/dist/domain/browserScenarioValues.js +5 -1
- package/dist/domain/captures/packetCapture.js +2 -1
- package/dist/domain/dosMz.js +14 -5
- package/dist/domain/electron/electronFuseEvidence.js +42 -0
- package/dist/domain/elfFixedHeader.js +24 -0
- package/dist/domain/evidence.js +7 -6
- package/dist/domain/evidenceBundle.js +9 -2
- package/dist/domain/explicitSensitiveFailure.js +3 -0
- package/dist/domain/fileSnapshotObservation.js +25 -0
- package/dist/domain/fixedTupleSchema.js +9 -0
- package/dist/domain/functionCallCoverage.js +6 -6
- package/dist/domain/functionComparisonDimensions.js +38 -11
- package/dist/domain/functionComparisonNormalization.js +17 -9
- package/dist/domain/functionDossierEvidence.js +4 -3
- package/dist/domain/harmony/harmonyApplication.js +8 -8
- package/dist/domain/hopperErrors.js +4 -2
- package/dist/domain/hopperValues.js +27 -4
- package/dist/domain/javascript/electronActiveObservation.js +1 -0
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +80 -20
- package/dist/domain/javascript/electronStaticAnalysisValues.js +0 -20
- package/dist/domain/javascript/electronStaticOptionObjects.js +45 -0
- package/dist/domain/javascript/electronWrappedCallPaths.js +70 -17
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +20 -4
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +4 -0
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +3 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +3 -1
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +49 -21
- package/dist/domain/javascript/javascriptAstFingerprint.js +41 -10
- package/dist/domain/javascript/javascriptAstValues.js +83 -5
- package/dist/domain/javascript/javascriptBundledRequireOrigin.js +23 -36
- package/dist/domain/javascript/javascriptCommonJsExportReceivers.js +231 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +14 -4
- package/dist/domain/javascript/javascriptFeatureSeed.js +1 -1
- package/dist/domain/javascript/javascriptGraphqlOperations.js +382 -0
- package/dist/domain/javascript/javascriptModuleDeclaration.js +20 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +7 -11
- package/dist/domain/javascript/javascriptRpcEndpoints.js +7 -171
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +9 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +35 -12
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +50 -45
- package/dist/domain/javascript/javascriptSemanticAmbientWrites.js +284 -24
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +452 -182
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +37 -20
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +55 -27
- package/dist/domain/javascript/javascriptSemanticCalls.js +4 -4
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +134 -50
- package/dist/domain/javascript/javascriptSemanticCoverage.js +5 -1
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +7 -13
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +33 -10
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +1 -1
- package/dist/domain/javascript/javascriptSemanticEvaluationOrder.js +126 -0
- package/dist/domain/javascript/javascriptSemanticExpressionShapes.js +111 -0
- package/dist/domain/javascript/javascriptSemanticGetterQueries.js +147 -0
- package/dist/domain/javascript/javascriptSemanticGetterResults.js +264 -0
- package/dist/domain/javascript/javascriptSemanticGraph.js +18 -1
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +13 -0
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +3 -2
- package/dist/domain/javascript/javascriptSemanticMapOperations.js +51 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +215 -81
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +395 -118
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +241 -328
- package/dist/domain/javascript/javascriptSemanticObjects.js +33 -27
- package/dist/domain/javascript/javascriptSemanticOpaqueEffects.js +163 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +11 -1
- package/dist/domain/javascript/javascriptSemanticProjection.js +44 -67
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +2 -1
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +1 -1
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +45 -7
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +3 -19
- package/dist/domain/javascript/javascriptSemanticResources.js +27 -4
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +78 -37
- package/dist/domain/javascript/javascriptSemanticReturns.js +2 -2
- package/dist/domain/javascript/javascriptSemanticState.js +191 -42
- package/dist/domain/javascript/javascriptSemanticValues.js +167 -41
- package/dist/domain/javascript/javascriptSourceParser.js +54 -9
- package/dist/domain/javascript/javascriptStaticAnalysis.js +24 -13
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +276 -16
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +33 -25
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +3 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +1 -1
- package/dist/domain/javascript/javascriptSymbolicBindings.js +424 -142
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +4 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +12 -1
- package/dist/domain/javascript/sourceToBundleSignals.js +3 -0
- package/dist/domain/managed/managedApplicationGraphNodes.js +14 -9
- package/dist/domain/managed/managedArtifact.js +26 -0
- package/dist/domain/managed/managedMemberComparison.js +3 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +14 -1
- package/dist/domain/managed/managedMemberComparisonItems.js +124 -52
- package/dist/domain/managed/managedMemberComparisonMatch.js +76 -72
- package/dist/domain/managed/managedMemberSignatureIdentity.js +40 -0
- package/dist/domain/managed/managedNativeVerificationMatch.js +5 -5
- package/dist/domain/managed/managedNativeVerificationSchemas.js +2 -2
- package/dist/domain/mobileApplicationGraphProjection.js +33 -18
- package/dist/domain/native/bytePattern.js +21 -0
- package/dist/domain/native/nativeAotPe.js +29 -2
- package/dist/domain/native/nativeAotSnapshotObservation.js +18 -0
- package/dist/domain/native/nativeCallPartialObservation.js +14 -12
- package/dist/domain/native/nativeLoadImage.js +13 -0
- package/dist/domain/native/objcSwiftMetadata.js +15 -8
- package/dist/domain/native/peResources.js +6 -2
- package/dist/domain/peMachine.js +2 -0
- package/dist/domain/process/processComparison.js +3 -3
- package/dist/domain/process/processTraceDimensionProjection.js +1 -1
- package/dist/domain/process/processTraceEvaluation.js +65 -24
- package/dist/domain/propertyListKeys.js +84 -69
- package/dist/domain/propertyListXml.js +149 -0
- package/dist/domain/providerAdapterError.js +2 -0
- package/dist/domain/providerCleanupError.js +2 -4
- package/dist/domain/rawBinary.js +11 -2
- package/dist/domain/reconstructionCoverage.js +35 -23
- package/dist/domain/reconstructionCoverageEvaluation.js +36 -36
- package/dist/domain/reconstructionCoverageEvidence.js +26 -0
- package/dist/domain/reconstructionVerification.js +40 -26
- package/dist/domain/referenceSourceImportParsing.js +4 -0
- package/dist/domain/referenceSourcePathIdentity.js +2 -0
- package/dist/domain/referenceSourceRequireBindings.js +40 -101
- package/dist/domain/relationshipCoverage.js +4 -5
- package/dist/domain/sqlite/sqliteDatabase.js +2 -1
- package/dist/domain/symbolAnalysis.js +9 -8
- package/dist/domain/webBundleAnalyzerInspection.js +65 -25
- package/dist/domain/webCaptureDiff.js +124 -41
- package/dist/domain/webInventory.js +28 -14
- package/dist/domain/webModuleTrace.js +22 -0
- package/dist/domain/webScriptExportError.js +2 -3
- package/dist/domain/xmlDocument.js +41 -0
- package/dist/domain/zipPackageFormat.js +0 -4
- package/dist/dotnet/ManagedArtifactInspector.js +2 -4
- package/dist/dotnet/ManagedDecodeBudget.js +21 -1
- package/dist/dotnet/ManagedMemberInspector.js +31 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +63 -12
- package/dist/dotnet/ManagedMemberRows.js +8 -8
- package/dist/dotnet/ManagedMetadataHeaps.js +0 -1
- package/dist/dotnet/ManagedMetadataLayout.js +17 -15
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +20 -19
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +7 -8
- package/dist/dotnet/ManagedPeReader.js +5 -0
- package/dist/dotnet/ManagedSnapshot.js +25 -20
- package/dist/dotnet/ManagedTypeNameDigests.js +177 -0
- package/dist/dotnet/ManagedTypeNames.js +6 -46
- package/dist/dotnet/ManagedTypeNesting.js +25 -0
- package/dist/dotnet/ManagedTypeReferences.js +94 -0
- package/dist/electron/ElectronFuseFailures.js +105 -0
- package/dist/electron/ElectronFusePath.js +4 -3
- package/dist/electron/ElectronFuseProvider.js +67 -92
- package/dist/electron/ElectronFuseReader.js +46 -30
- package/dist/evm/EvmoleFailures.js +1 -0
- package/dist/evm/EvmoleInterfaceProvider.js +13 -16
- package/dist/filesystem/OwnedRegularFile.js +116 -0
- package/dist/filesystem/OwnedStagedOutput.js +28 -11
- package/dist/filesystem/RegularFile.js +20 -8
- package/dist/filesystem/StableFileHash.js +56 -38
- package/dist/filesystem/callerPath.js +26 -0
- package/dist/filesystem/readFileHandleChunks.js +55 -5
- package/dist/filesystem/readStableFileBytes.js +85 -0
- package/dist/firmware/FirmwareCommand.js +13 -7
- package/dist/firmware/FirmwareFailures.js +56 -0
- package/dist/firmware/FirmwareFiles.js +128 -98
- package/dist/firmware/FirmwareProvider.js +120 -65
- package/dist/firmware/FirmwarePublication.js +26 -11
- package/dist/flutter/DartElf.js +27 -0
- package/dist/flutter/FlutterBuildProvider.js +44 -4
- package/dist/gdb/GdbSessionManager.js +202 -14
- package/dist/generatedPackageMetadata.js +1 -1
- package/dist/ghidra/GhidraAnalysisProfile.js +24 -10
- package/dist/ghidra/GhidraAnalysisSeeds.js +39 -55
- package/dist/ghidra/GhidraBridgeSources.js +12 -0
- package/dist/ghidra/GhidraClient.js +362 -148
- package/dist/ghidra/GhidraClientStartup.js +5 -3
- package/dist/ghidra/GhidraClientWire.js +5 -2
- package/dist/ghidra/GhidraDiagnostics.js +16 -5
- package/dist/ghidra/GhidraDoctor.js +45 -14
- package/dist/ghidra/GhidraDosSnapshot.js +83 -0
- package/dist/ghidra/GhidraExecutableHeader.js +54 -0
- package/dist/ghidra/GhidraFileArtifacts.js +93 -0
- package/dist/ghidra/GhidraFunctionValues.js +1 -0
- package/dist/ghidra/GhidraInstallation.js +143 -142
- package/dist/ghidra/GhidraInstallationPolicy.js +20 -79
- package/dist/ghidra/GhidraInstallationProperties.js +57 -0
- package/dist/ghidra/GhidraInventoryValues.js +22 -6
- package/dist/ghidra/GhidraJavaLaunch.js +11 -4
- package/dist/ghidra/GhidraJavaProbe.js +267 -0
- package/dist/ghidra/GhidraJavaProperties.js +9 -7
- package/dist/ghidra/GhidraLanguageCatalog.js +12 -7
- package/dist/ghidra/GhidraLauncher.js +128 -65
- package/dist/ghidra/GhidraLoadImageAttest.js +75 -78
- package/dist/ghidra/GhidraLoadImageValues.js +39 -29
- package/dist/ghidra/GhidraMipsProfile.js +13 -5
- package/dist/ghidra/GhidraNativeAotSnapshotOwner.js +221 -0
- package/dist/ghidra/GhidraPeProfile.js +88 -18
- package/dist/ghidra/GhidraProvider.js +219 -32
- package/dist/ghidra/GhidraProviderCapabilities.js +17 -4
- package/dist/ghidra/GhidraProviderClient.js +199 -239
- package/dist/ghidra/GhidraPspExtension.js +104 -34
- package/dist/ghidra/GhidraPspProfile.js +4 -1
- package/dist/ghidra/GhidraRawBinaryLanguage.js +13 -4
- package/dist/ghidra/GhidraReleasePolicy.js +93 -0
- package/dist/ghidra/GhidraRequestQueue.js +64 -40
- package/dist/ghidra/GhidraSessionError.js +152 -19
- package/dist/ghidra/GhidraSessionValues.js +13 -3
- package/dist/ghidra/GhidraSocketConnection.js +25 -11
- package/dist/ghidra/GhidraTargetSnapshot.js +67 -50
- package/dist/ghidra/GhidraTransport.js +86 -63
- package/dist/ghidra/extensions/GhidraExtensions.js +30 -45
- package/dist/go/GoBinaryProvider.js +89 -60
- package/dist/go/GoElfImage.js +3 -3
- package/dist/hopper/BridgeLauncher.js +43 -4
- package/dist/hopper/HopperAnalysisProfile.js +4 -2
- package/dist/hopper/HopperCleanup.js +14 -1
- package/dist/hopper/HopperClient.js +135 -63
- package/dist/hopper/HopperProvider.js +4 -7
- package/dist/hopper/HopperProviderCapabilities.js +2 -1
- package/dist/hopper/HopperRegexSearch.js +21 -60
- package/dist/ida/IdaBusyHealth.js +36 -2
- package/dist/ida/IdaMcpConnection.js +17 -11
- package/dist/ida/IdaNativeProtocol.js +1 -9
- package/dist/ida/IdaOperationRunner.js +8 -26
- package/dist/ida/IdaProtocolValues.js +2 -1
- package/dist/ida/IdaProvider.js +18 -2
- package/dist/ida/IdaSessionClient.js +54 -12
- package/dist/inspector/V8InspectorCaptureProjection.js +7 -0
- package/dist/inspector/V8InspectorProvider.js +2 -0
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +25 -4
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +4 -3
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +3 -2
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +7 -1
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +1 -1
- package/dist/javascript/recovery/RecoveryFiles.js +57 -8
- package/dist/jeb/JebMcpConnection.js +129 -70
- package/dist/jeb/JebMcpConnectionOwner.js +116 -0
- package/dist/jeb/JebMcpDeadline.js +46 -0
- package/dist/jeb/JebProvider.js +77 -51
- package/dist/kuna/KunaAddress.js +11 -0
- package/dist/kuna/KunaCommand.js +217 -0
- package/dist/kuna/KunaConfiguration.js +90 -0
- package/dist/kuna/KunaDoctor.js +198 -0
- package/dist/kuna/KunaInstallation.js +137 -0
- package/dist/kuna/KunaJson.js +23 -0
- package/dist/kuna/KunaJsonStream.js +433 -0
- package/dist/kuna/KunaLimits.js +5 -0
- package/dist/kuna/KunaProjectCache.js +804 -0
- package/dist/kuna/KunaProjectExport.js +202 -0
- package/dist/kuna/KunaProjectFiles.js +191 -0
- package/dist/kuna/KunaProjectReader.js +115 -0
- package/dist/kuna/KunaProvider.js +217 -0
- package/dist/kuna/KunaProviderCapabilities.js +102 -0
- package/dist/kuna/KunaQueryErrors.js +12 -0
- package/dist/kuna/KunaQueryWork.js +113 -0
- package/dist/kuna/KunaReferenceFiles.js +258 -0
- package/dist/kuna/KunaReferenceQueries.js +211 -0
- package/dist/kuna/KunaRelease.js +10 -0
- package/dist/kuna/KunaRunSlots.js +56 -0
- package/dist/kuna/KunaSessionClient.js +1162 -0
- package/dist/kuna/KunaStringInventory.js +145 -0
- package/dist/kuna/KunaStringQueries.js +133 -0
- package/dist/kuna/KunaTargetCommands.js +205 -0
- package/dist/kuna/KunaUnavailable.js +11 -0
- package/dist/main/processShutdown.js +17 -0
- package/dist/main/transport.js +21 -1
- package/dist/main.js +2 -12
- package/dist/mcp/AnalysisProvider-BABWbLoM.js +38 -0
- package/dist/mcp/{AnalysisSnapshotFiles-BAbiJQOc.js → AnalysisSnapshotFiles-BXz0c37-.js} +39 -28
- package/dist/mcp/{ProcessOwnership-Bl_3ejLe.js → ArtifactFileOperation-64cQKI7B.js} +274 -72
- package/dist/mcp/{ArtifactProvider-DViCU_rn.js → ArtifactProvider-Dx6pmil1.js} +371 -354
- package/dist/mcp/ArtifactProviderMetadata-UCJr2oZW.js +167 -0
- package/dist/mcp/{ArtifactReader-OyM03Gjn.js → ArtifactReader-BrnwNaKY.js} +29 -6
- package/dist/mcp/ArtifactResourceScope-zi3Dkqzy.js +175 -0
- package/dist/mcp/{AsarHeader-WsPgoooH.js → AsarHeader-B_IbppTz.js} +1 -1
- package/dist/mcp/{BinarySessionStatus-B4P9gf-S.js → BinarySessionStatus-CZ9nnXMt.js} +5 -4
- package/dist/mcp/{BinaryTargetResolver-BMaE_0H1.js → BinaryTargetResolver-BUncASDP.js} +146 -215
- package/dist/mcp/BoundedFileBytes-DYt5q9G2.js +43 -0
- package/dist/mcp/{CdpCaptureDocuments-HDiF2O7k.js → CdpCaptureDocuments-Y2uFcBpl.js} +194 -145
- package/dist/mcp/{CdpCaptureValues-M-j6CIh1.js → CdpCaptureValues-tNIg-gQK.js} +12 -5
- package/dist/mcp/{CdpConnection-BpDfz4MK.js → CdpEndpoint-BrhMhpSi.js} +352 -281
- package/dist/mcp/{CdpOptionalCommand-BPjRD9Kz.js → CdpOptionalCommand-PZZhlqxv.js} +2 -2
- package/dist/mcp/CdpTargetSession-BmmDC3XO.js +290 -0
- package/dist/mcp/{DirectAnalysis-DrafbXke.js → DirectAnalysis-B9KuCHTG.js} +29 -21
- package/dist/mcp/{DirectAnalysisStatus-CjjeDLzW.js → DirectAnalysisStatus-BgzopkIt.js} +7 -7
- package/dist/mcp/{ElectronFileScope-BPG_YoyU.js → ElectronFileScope-FXtK0d6I.js} +1 -1
- package/dist/mcp/ElectronFuseFailures-uZ_wOV6T.js +610 -0
- package/dist/mcp/MachoLoadCommandReader-C2VGgHA3.js +330 -0
- package/dist/mcp/{ManagedStaticProvider-BthZbKyZ.js → ManagedStaticProvider-CZuoPme2.js} +429 -131
- package/dist/mcp/{NativeMacOSProvider-Bh79k8dI.js → NativeMacOSProvider-CMguKrvN.js} +1376 -748
- package/dist/mcp/{NativeMacOSProviderMetadata-N1lPOaY_.js → NativeMacOSProviderMetadata-B_RH4KXF.js} +97 -7
- package/dist/mcp/{ProviderDeadline-DskQ94YD.js → OwnedCommand-BW1jBSt9.js} +436 -127
- package/dist/mcp/ProcedureAddressResolution-H6Qwpb_Y.js +59 -0
- package/dist/mcp/{WorkflowEvidence-umWrB_wm.js → WorkflowEvidence-CO4C7ALz.js} +16 -9
- package/dist/mcp/analysisErrorCleanup-Q344SnTO.js +34 -0
- package/dist/mcp/analysisErrorCore-BIEP7tvF.js +509 -0
- package/dist/mcp/{analysisErrorProjection-BN0EPM-3.js → analysisErrorProjection-B8teQwwD.js} +80 -30
- package/dist/mcp/{artifactToolContracts-Di4qZlEt.js → artifactToolContracts-C9dRDo-D.js} +6 -4
- package/dist/mcp/{browserObservation-C0s4i8UI.js → browserObservation-DUraZs62.js} +272 -107
- package/dist/mcp/{browserObservationError-CyLugqX4.js → browserObservationError-C5okJ5el.js} +27 -4
- package/dist/mcp/{browserObservationSchemas-tgqjH7aA.js → browserObservationSchemas-DwGGxBpu.js} +3 -3
- package/dist/mcp/{browserScenario-CAQ8Fns9.js → browserScenario-BRUz7yN0.js} +844 -358
- package/dist/mcp/{browserScenarioCapture-CTNFN-FI.js → browserScenarioCapture-CiMAsMx8.js} +127 -11
- package/dist/mcp/{InterfaceBuilderDecodeBudget-5F2AkxJT.js → callerPath-CpPnMZyN.js} +91 -65
- package/dist/mcp/{electronActiveObservation-lDvQTMR0.js → electronActiveObservation-DV0Ffy9X.js} +1 -0
- package/dist/mcp/electronFuses-D5SS7XXw.js +367 -0
- package/dist/mcp/{electronObservation-i7LcILQ-.js → electronObservation-DsN-NqY1.js} +134 -75
- package/dist/mcp/{electronObservation-DFOFEood.js → electronObservation-wOYWwqgF.js} +3 -3
- package/dist/mcp/{electronScenario-nCzE6IfJ.js → electronScenario-CYrt2zBK.js} +395 -135
- package/dist/mcp/{emptyArraySchema-tL6Qymyd.js → emptyArraySchema-C0o2Sxwp.js} +2 -2
- package/dist/mcp/{enhancedInputs-DgdEnzHy.js → enhancedInputs-6CCgB3VB.js} +1 -1
- package/dist/mcp/{javascriptRuntimeObservation-61NhCf7H.js → javascriptRuntimeObservation-BVbhkO2-.js} +12 -9
- package/dist/mcp/{javascriptRuntimeObservation-PIUoLfX6.js → javascriptRuntimeObservation-Cu0Yedqq.js} +2 -2
- package/dist/mcp/{lipo-Bnkoq_6W.js → lipo-DSTgUqL1.js} +11 -118
- package/dist/mcp/{logger-BQY5ulYv.js → logger-BGdGHadX.js} +2 -2
- package/dist/mcp/machoContainer-CMSxUBlK.js +605 -0
- package/dist/mcp/{main-kBXHZ8S5.js → main-Cx-Z7m_n.js} +16788 -5902
- package/dist/mcp/main.js +1 -1
- package/dist/mcp/{managedToolContracts-CK--I_s7.js → managedToolContracts-CSlbKJP-.js} +3 -3
- package/dist/mcp/{nativeValueTrace-DR9UE62L.js → nativeValueTrace-BEZbDieM.js} +2630 -2468
- package/dist/mcp/{officialToolContracts-B67NJ2tC.js → officialToolContracts-CauCcSsc.js} +74 -55
- package/dist/mcp/peMachine-aP1iYnHq.js +95 -0
- package/dist/mcp/propertyListKeys-BfCo0k4w.js +356 -0
- package/dist/mcp/providerCleanupError-DIRHxzWo.js +125 -0
- package/dist/mcp/{providerOperationHealth-CTYa3iLf.js → providerOperationHealth-9DRSGM8N.js} +24 -1
- package/dist/mcp/{scanCanonical-CRXSpule.js → scanCanonical-CF3ATd1V.js} +269 -463
- package/dist/mcp/{serverIdentity-Cio4iFV3.js → serverIdentity-BK0Ejd_Y.js} +262 -83
- package/dist/mcp/{sourceMapEnvelope-C0uJlrOh.js → sourceMapEnvelope-DAaRUIGj.js} +4 -4
- package/dist/mcp/{toolContracts-BW05wpcr.js → toolContracts-BPoHQdlC.js} +541 -327
- package/dist/mcp/{toolOutputSchemaGroups-ColvNZ1r.js → toolOutputSchemaGroups-MJ_f-PMK.js} +2551 -2354
- package/dist/mcp/{webContentArtifact-Dzjc1z-R.js → webContentArtifact-DfGkgDcI.js} +2 -17
- package/dist/mcp/{webRuntime-K__NYzXm.js → webRuntime-ccyhkRru.js} +2 -2
- package/dist/mcp/{webSourceLocation-DbMAT2J9.js → webSourceLocation-DKIum0vJ.js} +6451 -4414
- package/dist/mcpDoctor.js +4 -2
- package/dist/mcpStartupPolicy.js +18 -3
- package/dist/native/AppleDispatchMetadata.js +76 -27
- package/dist/native/AppleMachoFixups.js +20 -10
- package/dist/native/AppleObjcCategories.js +12 -1
- package/dist/native/AppleObjcDispatchFacets.js +21 -12
- package/dist/native/AppleObjcProperties.js +61 -17
- package/dist/native/AppleObjcProtocols.js +25 -7
- package/dist/native/AppleSwiftVtables.js +2 -0
- package/dist/native/CommandRunner.js +13 -9
- package/dist/native/LldbCallTracer.js +232 -178
- package/dist/native/LldbReadbackFiles.js +70 -0
- package/dist/native/LldbRetainedObservations.js +28 -56
- package/dist/native/NativeCallObservation.js +53 -52
- package/dist/native/NativeCallTarget.js +95 -0
- package/dist/native/NativeMacOSProvider.js +240 -171
- package/dist/native/NativeMachoInspection.js +21 -7
- package/dist/native/NativePlistSource.js +179 -0
- package/dist/native/NativeUiCleanupError.js +30 -0
- package/dist/native/NativeUiHelperRuntime.js +48 -35
- package/dist/native/NativeUiObservation.js +67 -45
- package/dist/native/SignatureTargetBinding.js +72 -53
- package/dist/native/parsers/demangle.js +16 -12
- package/dist/native/parsers/machoUuid.js +4 -4
- package/dist/native/parsers/otool.js +57 -17
- package/dist/native/parsers/plist.js +40 -25
- package/dist/native/pe/PeResourceLayout.js +22 -7
- package/dist/native/pe/PeResourceParser.js +10 -9
- package/dist/native/pe/PeResourcesProvider.js +63 -16
- package/dist/native/pwndbg/CoreFileMappingAuthority.js +51 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +26 -15
- package/dist/native/pwntools/PwntoolsDecoder.js +116 -53
- package/dist/native/pwntools/PwntoolsFailures.js +17 -3
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +11 -1
- package/dist/objdump/ObjdumpCommand.js +5 -2
- package/dist/pcap/PcapOutput.js +38 -2
- package/dist/pcap/PcapProvider.js +45 -15
- package/dist/pcap/PcapSnapshot.js +24 -4
- package/dist/process/ArtifactAnalysisResources.js +145 -52
- package/dist/process/BoundedFileBytes.js +8 -3
- package/dist/process/CurrentEntrypointPath.js +3 -1
- package/dist/process/DarwinProcessRunTokenReader.js +174 -63
- package/dist/process/DetachedPgpSignature.js +57 -0
- package/dist/process/ExecFileOutput.js +14 -11
- package/dist/{hopper/HopperTargetLease.js → process/HopperLease.js} +10 -0
- package/dist/process/LinuxResourceLimits.js +4 -24
- package/dist/process/OwnedCommand.js +109 -14
- package/dist/process/ProviderProcess.js +129 -10
- package/dist/process/RegexMatcher.js +96 -0
- package/dist/process/SharedStartupAttempt.js +59 -0
- package/dist/process/WindowsAuthority.js +1 -1
- package/dist/process/capture/FilesystemSnapshot.js +3 -2
- package/dist/process/capture/ProcessCaptureError.js +55 -17
- package/dist/process/capture/ProcessCaptureLifecycle.js +17 -20
- package/dist/process/capture/ProcessCaptureProgress.js +5 -3
- package/dist/process/capture/ProcessHarness.js +17 -3
- package/dist/process/snapshotEnvironment.js +8 -8
- package/dist/{application/binary → providers}/AnalysisClientCleanup.js +3 -3
- package/dist/providers/AnalysisClientCreation.js +193 -0
- package/dist/providers/AnalysisClientFailure.js +191 -0
- package/dist/providers/DeferredAnalysisClient.js +48 -0
- package/dist/providers/OwnedCommandCleanup.js +65 -0
- package/dist/providers/ProviderInspectionScope.js +10 -0
- package/dist/recordedCatalogDigests.js +2 -0
- package/dist/reference/ReferenceSourceReader.js +64 -0
- package/dist/reference/ReferenceSourceReaderEntries.js +12 -3
- package/dist/reference/ReferenceSourceReaderFile.js +2 -1
- package/dist/rizin/RizinCommand.js +2 -2
- package/dist/rizin/RizinDebugSessionManager.js +249 -210
- package/dist/rust/RustBinaryProvider.js +55 -23
- package/dist/server/EvidenceMcpServer.js +2 -2
- package/dist/server/contractToolHandler.js +17 -11
- package/dist/server/createServer.js +27 -8
- package/dist/server/promptCompletion.js +24 -22
- package/dist/server/registerArtifactComparisonTool.js +13 -2
- package/dist/server/registerBrowserScenarioTool.js +7 -5
- package/dist/server/registerBrowserTools.js +2 -4
- package/dist/server/registerCutterTools.js +2 -3
- package/dist/server/registerElectronTools.js +2 -13
- package/dist/server/registerFridaTools.js +8 -12
- package/dist/server/registerInvestigationTools.js +20 -20
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -4
- package/dist/server/registerManagedWorkflowTools/evidence.js +14 -7
- package/dist/server/registerProcessComparisonTool.js +3 -0
- package/dist/server/registerSessionStatusTool.js +13 -6
- package/dist/server/registerSessionTools.js +16 -29
- package/dist/server/runDerivedOperation.js +2 -0
- package/dist/signals/SigrokRecordingProvider.js +13 -6
- package/dist/sqlite/SqliteDatabaseFailures.js +25 -12
- package/dist/sqlite/SqliteDatabaseInspection.js +27 -12
- package/dist/sqlite/SqliteDatabaseSnapshot.js +58 -32
- package/dist/sqlite/SqliteDatabaseWorkerExecution.js +18 -3
- package/dist/wasm/WabtArtifactProvider.js +64 -42
- package/dist/wasm/WabtFailures.js +19 -1
- package/dist/wasm/WabtRuntime.js +58 -0
- package/dist/wasm/WasmGlueAdapter.js +20 -7
- package/dist/windows/WindowsNativeLoader.js +16 -2
- package/dist/windows/WindowsPrivateRuntime.js +44 -1
- package/licenses/npm-dependencies.txt +146 -1
- package/licenses/npm-runtime-notices.txt +175 -1
- package/native/windows/README.md +44 -7
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +11 -3
- package/scripts/electron-active-hook-boundaries.cjs +15 -2
- package/scripts/electron-active-hook.cjs +408 -46
- package/scripts/hopper-demo-x11.py +12 -10
- package/scripts/rea.mjs +62 -15
- package/skills/reverse-engineer-anything/SKILL.md +21 -7
- package/skills/reverse-engineer-anything/references/android-applications.md +3 -1
- package/skills/reverse-engineer-anything/references/javascript-applications.md +44 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +30 -10
- package/dist/cli-runtime/ArtifactResourceScope-DQWTcUwE.js +0 -114
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +0 -36
- package/dist/cli-runtime/IdaConfiguration-CtGP7EKo.js +0 -1094
- package/dist/cli-runtime/JebMcpEndpoint-DUytrn5G.js +0 -428
- package/dist/cli-runtime/MacHopperPaths-CwL5lYPX.js +0 -434
- package/dist/cli-runtime/OwnedCommand-Cj9GhmPR.js +0 -112
- package/dist/cli-runtime/RegularFile-B_6KPCNQ.js +0 -139
- package/dist/cli-runtime/RegularFileRead-DVlC5faM.js +0 -125
- package/dist/cli-runtime/analysisErrorPresentation-DGt7TdsH.js +0 -497
- package/dist/cli-runtime/application__javascript__ElectronObservationService-DEsR8KDN.js +0 -63
- package/dist/cli-runtime/artifactOperationError-B7n03FbD.js +0 -27
- package/dist/cli-runtime/browserObservationError-Dx6xRTjb.js +0 -40
- package/dist/cli-runtime/cliResultOutput-DsRMI8CJ.js +0 -780
- package/dist/cli-runtime/mcpStartupPolicy-CVVSOmRc.js +0 -21
- package/dist/cli-runtime/propertyListKeys-G8e74YWb.js +0 -248
- package/dist/cli-runtime/providerAdapterError-DAjhICdr.js +0 -25
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +0 -38
- package/dist/hopper/HopperRegexWorker.js +0 -27
- package/dist/mcp/ArtifactProviderMetadata-b7pOK5_t.js +0 -76
- package/dist/mcp/ArtifactResourceScope-P3tq5z8Z.js +0 -162
- package/dist/mcp/BoundedFileBytes-DuczXiQZ.js +0 -68
- package/dist/mcp/CdpTargetSession-BsPoKhEU.js +0 -86
- package/dist/mcp/ProcedureAddressResolution-CQpuwm1h.js +0 -19
- package/dist/mcp/analysisErrorCore-DXRTvF_m.js +0 -235
- package/dist/mcp/artifactOperationError-CkHMMaf7.js +0 -27
- package/dist/mcp/digests-BFoWUT_-.js +0 -223
- package/dist/mcp/propertyListKeys-DD25WsjI.js +0 -553
- package/dist/mcp/providerAdapterError-sDxToNal.js +0 -25
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +0 -26
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { __esmMin } from "./rolldown-runtime-DXoylpqc.js";
|
|
2
|
-
import { ELECTRON_IDENTITY_LIMITATION, ELECTRON_MODULE, STATIC_ROUTE_CALL_NAMES, analysisInputErrorFromIssues, analyzeParsedJavaScriptSemanticsSteps, argumentNode, argumentValue, calleeName, childNodes, chunkRuntime,
|
|
3
|
-
import { ANALYSIS_RESOURCE_KINDS, AnalysisAccessDeniedError, AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisError, AnalysisInputError, AnalysisOutputError, AnalysisResourceConstraintError, AnalysisTimeoutError, AnalysisUnsupportedTargetError, freezeJsonSnapshot, freezeOwnedJsonSnapshotSteps, init_analysisErrorBase, init_analysisErrorCore, init_immutableJson, init_jsonValue, jsonValueSchema, jsonValueValidationSteps } from "./errorSchemas-
|
|
4
|
-
import { ArtifactReaderFailure, init_ArtifactReader } from "./ArtifactReader-
|
|
5
|
-
import { ProviderAdapterError, init_providerAdapterError } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { JAVASCRIPT_ANALYSIS_RESOURCE_DEFAULTS, JAVASCRIPT_SEMANTIC_NODE_MAXIMUM, JAVASCRIPT_SEMANTIC_RELATIONS, JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, JavaScriptSemanticEvidenceContextRegistry, analyzeJavaScriptApplicationInputSchema, artifactIntegrityPolicySchema, completeApplicationCoverage, createJavaScriptApplicationEdge, createJavaScriptApplicationGraph, createJavaScriptApplicationNode, createJavaScriptSemanticFingerprint, createJavaScriptSemanticGraph, createJavaScriptSemanticGraphNode, createJavaScriptSemanticGraphRelation, createJavaScriptSemanticGraphUnknown, init_artifactIntegrityPolicy, init_javascriptAnalysisResourceControls, init_javascriptApplicationAnalysis, init_javascriptApplicationEvidenceSchemas, init_javascriptApplicationGraph, init_javascriptSemanticGraph, init_javascriptSemanticGraphSchemas, init_javascriptSourceMapPaths, init_javascriptSourceSelection, javaScriptAnalysisCoverageLimits, javaScriptAnalysisResourceControlsSchema, javaScriptSemanticEvidenceContextSchema, javaScriptSemanticFingerprintSchema, javaScriptSemanticNodeId, javaScriptSemanticNodeSchema, javaScriptSemanticRelationSchema, javaScriptSemanticUnknownSchema, javaScriptSourcePathsSchema, parseOwnedJavaScriptApplicationAnalysisSteps, partialApplicationCoverage, resolveJavaScriptSourceMapReferences, sealTransferredJavaScriptApplicationGraphSteps, sealTransferredJavaScriptSemanticGraphSteps, truncatedApplicationCoverage } from "./javascriptApplicationAnalysis-HgMzVMQw.js";
|
|
15
|
-
import { ArtifactPathRegistry, init_ArtifactPaths, init_StreamBytes, normalizeArtifactPath, streamChunkToBuffer } from "./MachoLoadCommandReader-C7e074Ze.js";
|
|
2
|
+
import { ELECTRON_IDENTITY_LIMITATION, ELECTRON_MODULE, STATIC_ROUTE_CALL_NAMES, analysisInputErrorFromIssues, analyzeParsedJavaScriptSemanticsSteps, argumentNode, argumentValue, calleeName, childNodes, chunkRuntime, compareUnicodeCodePoints, completeSemanticSteps, compositeKey, createImmutableEvidenceSteps, createJavaScriptRpcScan, detectVendors, digestCanonicalValue, digestSchema, endpointArgument, err, evaluateSemanticExpression, evaluateSemanticExpressionProvenance, factoryRequireName, failedJavaScriptStaticAnalysis, hasUncertainTypeOnlyModuleSideEffect, indexJavaScriptBindingsWithReceiversSteps, indexJavaScriptElectronIdentitySteps, init_artifactIdentity, init_browserObservation, init_canonicalDigest, init_digests, init_evidence, init_inputIssueProjection, init_javascriptAstValues, init_javascriptBootstrap, init_javascriptElectronMemberWrites, init_javascriptModuleDeclaration, init_javascriptRpcEndpoints, init_javascriptSemanticAmbientWrites, init_javascriptSemanticAnalysis, init_javascriptSemanticCoverage, init_javascriptSemanticMapOperations, init_javascriptSemanticMutationInitializers, init_javascriptSemanticPropertyPaths, init_javascriptSemanticRequireOrigin, init_javascriptSemanticResourceLimits, init_javascriptSemanticSlots, init_javascriptSemanticState, init_javascriptSemanticTraversal, init_javascriptSemanticValues, init_javascriptSourceParser, init_javascriptStaticAnalysisHelpers, init_result, init_unicodeCodePointOrder, isIntrinsicMapLookup, isTypeOnlyExportDeclaration, isTypeOnlyExportSpecifier, isTypeOnlyImportDeclaration, isTypeOnlyImportSpecifier, isUnmodifiedGlobalReference, isUnmodifiedImportMetaUrl, javascriptBootstrapAt, javascriptDisplayText, logicalPathEscapesRoot, moduleFactory, modulePropertyName, normalizeJoinedLogicalPath, ok, parseJavaScriptSource, prefixedArgument, propertyName, range as range$1, rangeForOffsets, readExactJavaScriptLiteral, registrationKey, resolveSemanticBindingState, runtimeFunctionParameters, sanitizeEndpointCandidate, semanticArrayIndex, semanticBindingAtRead, semanticContainer, semanticCoverageResourceLimits, semanticFactoryLoaderMemberAt, semanticFactoryRequireLoaderAt, semanticImportEqualsSpecifier, semanticPropertyPointer, semanticRequireLoaderAt, semanticResolutionBlocked, semanticResourceLimitCoverage, semanticResourceLimitReason, semanticSlotAtPath, semanticStableInitializer, semanticStaticPropertyKey, semanticStaticPropertyName, semanticTopLevelEffectFollowsCapture, semanticWriteSiteTarget, semanticWriteTargets, sha256Text, sortedUnique, sourceRangesEqual, sourceSlice, staticArrayValues, staticObjectProperty, staticPath, staticPathResolutionContext, storageKind, stringValue, traverseJavaScriptAst, traverseJavaScriptAstSteps, unwrapJavaScriptExpression } from "./reconstructionObligationLedgerSchemas-Bi6sect1.js";
|
|
3
|
+
import { ANALYSIS_RESOURCE_KINDS, AnalysisAccessDeniedError, AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisError, AnalysisInputError, AnalysisOutputError, AnalysisResourceConstraintError, AnalysisTimeoutError, AnalysisUnsupportedTargetError, freezeJsonSnapshot, freezeOwnedJsonSnapshotSteps, init_analysisErrorBase, init_analysisErrorCore, init_immutableJson, init_jsonValue, jsonValueSchema, jsonValueValidationSteps } from "./errorSchemas-Ixz_q7qt.js";
|
|
4
|
+
import { ArtifactReaderFailure, init_ArtifactReader } from "./ArtifactReader-DMwm42bk.js";
|
|
5
|
+
import { ArtifactOperationError, ProviderAdapterError, init_analysisErrorProjection, init_artifactOperationError, init_providerAdapterError, projectAnalysisError } from "./cliResultOutput-10sd6xGx.js";
|
|
6
|
+
import { ProviderCleanupError, init_providerCleanupError } from "./providerCleanupError-BhsJyAhk.js";
|
|
7
|
+
import { init_ProcessOwnershipObservation, prepareProcessOwnershipInspection } from "./ProcessOwnershipObservation-C006iCtZ.js";
|
|
8
|
+
import { ProviderProcessSupervisor, init_ProviderProcess, spawnOwnedProviderProcess } from "./ProviderProcess-D87A7ctp.js";
|
|
9
|
+
import { cleanupOwnedProcessGroup, init_ProcessOwnership } from "./ProcessOwnership-CtrNr6ee.js";
|
|
10
|
+
import { ProviderStartupDeadline, init_ProviderDeadline, waitForAbortableDelay } from "./ProviderDeadline-rSuH4Pm8.js";
|
|
11
|
+
import { PrivateRuntimeRoot, PrivateRuntimeRootUnavailableError, init_PrivateRuntimeRoot, init_PrivateRuntimeRootUnavailableError } from "./PrivateRuntimeRoot-Cd23u6jd.js";
|
|
12
|
+
import { JAVASCRIPT_APPLICATION_PROVIDER, init_InvestigationProviders } from "./InvestigationProviders-CFh4a64d.js";
|
|
13
|
+
import { JAVASCRIPT_ANALYSIS_RESOURCE_DEFAULTS, JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM, JAVASCRIPT_SEMANTIC_RELATIONS, JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, JavaScriptSemanticEvidenceContextRegistry, analyzeJavaScriptApplicationInputSchema, artifactIntegrityPolicySchema, completeApplicationCoverage, createJavaScriptApplicationEdge, createJavaScriptApplicationGraph, createJavaScriptApplicationNode, createJavaScriptSemanticFingerprint, createJavaScriptSemanticGraph, createJavaScriptSemanticGraphNode, createJavaScriptSemanticGraphRelation, createJavaScriptSemanticGraphUnknown, init_artifactIntegrityPolicy, init_javascriptAnalysisResourceControls, init_javascriptApplicationAnalysis, init_javascriptApplicationEvidenceSchemas, init_javascriptApplicationGraph, init_javascriptSemanticGraph, init_javascriptSemanticGraphSchemas, init_javascriptSourceMapPaths, init_javascriptSourceSelection, javaScriptAnalysisCoverageLimits, javaScriptAnalysisResourceControlsSchema, javaScriptSemanticEvidenceContextSchema, javaScriptSemanticFingerprintSchema, javaScriptSemanticNodeId, javaScriptSemanticNodeSchema, javaScriptSemanticRelationSchema, javaScriptSemanticUnknownOmissionsSchema, javaScriptSemanticUnknownSchema, javaScriptSourcePathsSchema, parseOwnedJavaScriptApplicationAnalysisSteps, partialApplicationCoverage, resolveJavaScriptSourceMapReferences, sealTransferredJavaScriptApplicationGraphSteps, sealTransferredJavaScriptSemanticGraphSteps, truncatedApplicationCoverage } from "./javascriptApplicationAnalysis-Dk6yBV8g.js";
|
|
16
14
|
import { flattenSourceMapLeaves, init_JavaScriptWorkerMemoryLimit, init_TypeScriptEmittedSourceCandidates, init_javascriptModuleSpecifier, init_sourceMapEnvelope, isRelativeJavaScriptModuleSpecifier, javaScriptWorkerMemoryLimitBytes, sourceMapJsonText, typescriptEmittedSourceCandidates } from "./JavaScriptWorkerMemoryLimit-B1bwMM1a.js";
|
|
15
|
+
import { ArtifactPathRegistry, DirectoryArtifactReader, init_ArtifactPaths, init_DirectoryArtifactReader, init_StreamBytes, normalizeArtifactPath, streamChunkToBuffer } from "./DirectoryArtifactReader-CokAJ8vo.js";
|
|
17
16
|
import { init_runtimeVersion, javaScriptRuntime } from "./runtimeVersion-CMGd0bDu.js";
|
|
18
|
-
import { init_javascriptExportReturnShapeProjection, projectJavaScriptExportReturnShapes } from "./javascriptExportReturnShapeProjection-
|
|
19
|
-
import { init_JavaScriptApplicationEvidenceGraph, rememberOwnedApplicationGraphEvidence } from "./JavaScriptApplicationEvidenceGraph-
|
|
20
|
-
import { AsarArtifactReader,
|
|
17
|
+
import { init_javascriptExportReturnShapeProjection, projectJavaScriptExportReturnShapes } from "./javascriptExportReturnShapeProjection-CObOIiQ6.js";
|
|
18
|
+
import { init_JavaScriptApplicationEvidenceGraph, rememberOwnedApplicationGraphEvidence } from "./JavaScriptApplicationEvidenceGraph-gOmPB2L6.js";
|
|
19
|
+
import { AsarArtifactReader, hashReadable, init_ArtifactHash, init_AsarArtifactReader, init_javascriptArtifactFiles, init_scanCanonical, isJavaScriptSourcePath, scanCanonicalArtifactInventoryInScope } from "./scanCanonical-CcDFUr-w.js";
|
|
21
20
|
import { isBuiltin } from "node:module";
|
|
22
21
|
import { z } from "zod";
|
|
23
22
|
import { isAbsolute, join, posix } from "node:path";
|
|
24
23
|
import { createHash, randomUUID } from "node:crypto";
|
|
25
|
-
import { access, lstat, open, readFile, realpath, rm, stat, writeFile } from "node:fs/promises";
|
|
26
24
|
import { constants, createReadStream } from "node:fs";
|
|
25
|
+
import { access, lstat, open, readFile, realpath, rm, stat, writeFile } from "node:fs/promises";
|
|
27
26
|
import { fileURLToPath } from "node:url";
|
|
28
27
|
import { setImmediate } from "node:timers/promises";
|
|
29
28
|
import { getHeapStatistics } from "node:v8";
|
|
@@ -117,6 +116,8 @@ function init_JavaScriptApplicationEvidence() {
|
|
|
117
116
|
integrity_policy: input.integrity_policy,
|
|
118
117
|
...input.max_semantic_nodes === undefined ? {} : { max_semantic_nodes: input.max_semantic_nodes },
|
|
119
118
|
...input.max_semantic_nodes_per_file === undefined ? {} : { max_semantic_nodes_per_file: input.max_semantic_nodes_per_file },
|
|
119
|
+
...input.max_semantic_unknowns === undefined ? {} : { max_semantic_unknowns: input.max_semantic_unknowns },
|
|
120
|
+
...input.max_semantic_unknowns_per_file === undefined ? {} : { max_semantic_unknowns_per_file: input.max_semantic_unknowns_per_file },
|
|
120
121
|
...input.source_paths === undefined ? {} : { source_paths: input.source_paths },
|
|
121
122
|
...input.max_heap_mb === undefined ? {} : { max_heap_mb: input.max_heap_mb },
|
|
122
123
|
...input.analysis_timeout_ms === undefined ? {} : { analysis_timeout_ms: input.analysis_timeout_ms }
|
|
@@ -171,6 +172,7 @@ function init_javascriptSymbolicValues() {
|
|
|
171
172
|
};
|
|
172
173
|
};
|
|
173
174
|
symbolicTruth = (value) => {
|
|
175
|
+
if (value.kind === "namespace" && value.runtimeValueUnknown) return undefined;
|
|
174
176
|
if (value.kind === "union") {
|
|
175
177
|
const choices = value.values.map(symbolicTruth);
|
|
176
178
|
return choices.length > 0 && choices.every((choice) => choice === choices[0]) ? choices[0] : undefined;
|
|
@@ -181,7 +183,9 @@ function init_javascriptSymbolicValues() {
|
|
|
181
183
|
"namespace",
|
|
182
184
|
"array",
|
|
183
185
|
"record",
|
|
184
|
-
"loader"
|
|
186
|
+
"loader",
|
|
187
|
+
"promise",
|
|
188
|
+
"iterator"
|
|
185
189
|
].includes(value.kind) ? true : undefined;
|
|
186
190
|
};
|
|
187
191
|
symbolicCondition = (value, condition) => {
|
|
@@ -208,6 +212,7 @@ function init_javascriptSymbolicControlFlow() {
|
|
|
208
212
|
return (init_javascriptSymbolicControlFlow = __esmMin((() => {
|
|
209
213
|
init_javascriptSymbolicValues();
|
|
210
214
|
symbolicLogicalRight = (operator, left) => {
|
|
215
|
+
if (left.kind === "namespace" && left.runtimeValueUnknown) return undefined;
|
|
211
216
|
if (left.kind === "union") {
|
|
212
217
|
const choices = left.values.map((value) => symbolicLogicalRight(operator, value));
|
|
213
218
|
return choices.length > 0 && choices.every((choice) => choice === choices[0]) ? choices[0] : undefined;
|
|
@@ -220,7 +225,9 @@ function init_javascriptSymbolicControlFlow() {
|
|
|
220
225
|
"namespace",
|
|
221
226
|
"array",
|
|
222
227
|
"record",
|
|
223
|
-
"loader"
|
|
228
|
+
"loader",
|
|
229
|
+
"promise",
|
|
230
|
+
"iterator"
|
|
224
231
|
].includes(left.kind) ? false : undefined;
|
|
225
232
|
}
|
|
226
233
|
const truth = symbolicTruth(left);
|
|
@@ -244,6 +251,7 @@ function init_javascriptSymbolicBindings() {
|
|
|
244
251
|
init_javascriptBootstrap();
|
|
245
252
|
init_javascriptElectronMemberWrites();
|
|
246
253
|
init_javascriptSemanticAnalysis();
|
|
254
|
+
init_javascriptSemanticPropertyPaths();
|
|
247
255
|
init_javascriptSymbolicControlFlow();
|
|
248
256
|
init_javascriptStaticAnalysisHelpers();
|
|
249
257
|
init_javascriptSemanticTraversal();
|
|
@@ -270,7 +278,8 @@ function init_javascriptSymbolicBindings() {
|
|
|
270
278
|
#activeFunctions = new Set();
|
|
271
279
|
#exportAliases = new Map();
|
|
272
280
|
#moduleBindings = new Set();
|
|
273
|
-
#
|
|
281
|
+
#completedModules = new WeakMap();
|
|
282
|
+
#completionGroups = new WeakMap();
|
|
274
283
|
#propertyActive = new WeakMap();
|
|
275
284
|
#literalPropertyIndex = new WeakMap();
|
|
276
285
|
#mutated = new Set();
|
|
@@ -339,26 +348,57 @@ function init_javascriptSymbolicBindings() {
|
|
|
339
348
|
this.#depth -= 1;
|
|
340
349
|
}
|
|
341
350
|
}
|
|
342
|
-
|
|
351
|
+
#withConditions(value, source) {
|
|
352
|
+
const conditions = source.conditions ?? [];
|
|
353
|
+
if (conditions.length === 0 && !source.conditionUnresolved) return value;
|
|
354
|
+
const variants = symbolicVariants(value);
|
|
355
|
+
for (const variant of variants) {
|
|
356
|
+
const cost = 1 + (conditions.length ? conditions.length + (variant.conditions?.length ?? 0) : 0);
|
|
357
|
+
if (cost > this.#remainingEvaluations) {
|
|
358
|
+
this.#remainingEvaluations = 0;
|
|
359
|
+
this.truncated = true;
|
|
360
|
+
return symbolicUnknown("symbolic condition resource limit");
|
|
361
|
+
}
|
|
362
|
+
this.#remainingEvaluations -= cost;
|
|
363
|
+
}
|
|
364
|
+
return symbolicUnion(variants.map((variant) => ({
|
|
365
|
+
...variant,
|
|
366
|
+
...conditions.length ? { conditions: [...variant.conditions ?? [], ...conditions] } : {},
|
|
367
|
+
...source.conditionUnresolved ? { conditionUnresolved: true } : {}
|
|
368
|
+
})));
|
|
369
|
+
}
|
|
370
|
+
property(value, key, read) {
|
|
343
371
|
let result;
|
|
344
|
-
if (value.kind === "union") result = symbolicUnion(value.values.map((variant) => this.property(variant, key)));
|
|
345
|
-
else result = this.#property(value, key);
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
372
|
+
if (value.kind === "union") result = symbolicUnion([...this.#commonProperty(value.values, key, read), ...value.values.map((variant) => this.property(variant, key, read))]);
|
|
373
|
+
else result = this.#property(value, key, read);
|
|
374
|
+
return this.#withConditions(result, value);
|
|
375
|
+
}
|
|
376
|
+
#commonProperty(values, key, read) {
|
|
377
|
+
const first = values[0];
|
|
378
|
+
const group = first === undefined ? undefined : this.#completionGroups.get(first);
|
|
379
|
+
if (group === undefined || group.members.size !== values.length) return [];
|
|
380
|
+
if (values.length > this.#remainingEvaluations) {
|
|
381
|
+
this.truncated = true;
|
|
382
|
+
this.#remainingEvaluations = 0;
|
|
383
|
+
return [];
|
|
384
|
+
}
|
|
385
|
+
this.#remainingEvaluations -= values.length;
|
|
386
|
+
if (!values.every((value) => group.members.has(value))) return [];
|
|
387
|
+
const common = this.property(group.common, key, read);
|
|
388
|
+
return common.kind === "unknown" ? [] : [common];
|
|
349
389
|
}
|
|
350
|
-
#property(value, key) {
|
|
390
|
+
#property(value, key, read) {
|
|
351
391
|
const active = this.#propertyActive.get(value) ?? new Set();
|
|
352
392
|
if (active.has(key)) return symbolicUnknown("cyclic property");
|
|
353
393
|
active.add(key);
|
|
354
394
|
this.#propertyActive.set(value, active);
|
|
355
395
|
try {
|
|
356
|
-
return this.#propertyValue(value, key);
|
|
396
|
+
return this.#propertyValue(value, key, read);
|
|
357
397
|
} finally {
|
|
358
398
|
active.delete(key);
|
|
359
399
|
}
|
|
360
400
|
}
|
|
361
|
-
#propertyValue(value, key) {
|
|
401
|
+
#propertyValue(value, key, read) {
|
|
362
402
|
if (value.kind === "external") {
|
|
363
403
|
const path = [...value.path, key];
|
|
364
404
|
if (ELECTRON_MODULE.test(path[0] ?? "") && !this.#electronIdentity.intactExport(path)) {
|
|
@@ -369,12 +409,26 @@ function init_javascriptSymbolicBindings() {
|
|
|
369
409
|
path
|
|
370
410
|
};
|
|
371
411
|
}
|
|
372
|
-
if (value.kind === "record")
|
|
412
|
+
if (value.kind === "record") {
|
|
413
|
+
const property = value.values.get(key);
|
|
414
|
+
if (key === "exports" && property?.kind === "namespace" && this.#namespaceOwners.has(property.bindingId)) {
|
|
415
|
+
return {
|
|
416
|
+
...property,
|
|
417
|
+
runtimeValueUnknown: true
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
return property ?? symbolicUnknown("missing property");
|
|
421
|
+
}
|
|
373
422
|
if (value.kind === "namespace") {
|
|
374
423
|
if (this.#mutated.has(value.bindingId) || this.#unsafeExports.has(`${value.bindingId}:${key}`)) return symbolicUnknown("ambiguous export writes");
|
|
375
|
-
const
|
|
376
|
-
if (
|
|
377
|
-
|
|
424
|
+
const available = this.#namespaceWrites(value, read, key);
|
|
425
|
+
if (available === undefined) {
|
|
426
|
+
this.unresolved = true;
|
|
427
|
+
return symbolicUnknown("module export read boundary is unavailable");
|
|
428
|
+
}
|
|
429
|
+
const replacement = available.findLast((write) => write.path.length === 0);
|
|
430
|
+
if (replacement) return this.property(this.evaluate(replacement.value, value.environment), key, read);
|
|
431
|
+
const writes = available.filter((w) => w.path.length === 1 && w.path[0] === key);
|
|
378
432
|
const write = writes.at(-1);
|
|
379
433
|
return write ? this.evaluate(write.value, value.environment) : symbolicUnknown("unresolved module export");
|
|
380
434
|
}
|
|
@@ -406,7 +460,10 @@ function init_javascriptSymbolicBindings() {
|
|
|
406
460
|
for (const p of [...value.node.properties].reverse()) {
|
|
407
461
|
if (t.isSpreadElement(p)) {
|
|
408
462
|
const spread = this.evaluate(p.argument, value.environment);
|
|
409
|
-
const found = this.property(spread, key
|
|
463
|
+
const found = this.property(spread, key, {
|
|
464
|
+
node: p.argument,
|
|
465
|
+
environment: value.environment
|
|
466
|
+
});
|
|
410
467
|
if (found.kind !== "unknown") return found;
|
|
411
468
|
if (this.unknownMembers(spread) > 0 || this.members(spread).includes(key)) return found;
|
|
412
469
|
} else if (semanticStaticPropertyKey(p.key, p.computed) === key) {
|
|
@@ -414,7 +471,14 @@ function init_javascriptSymbolicBindings() {
|
|
|
414
471
|
} else if (semanticStaticPropertyKey(p.key, p.computed) === null) return symbolicUnknown("dynamic property overwrite");
|
|
415
472
|
}
|
|
416
473
|
}
|
|
417
|
-
if (value.kind === "array"
|
|
474
|
+
if (value.kind === "array") {
|
|
475
|
+
const index = semanticArrayIndex(key);
|
|
476
|
+
if (index !== null) return value.values[index] ?? symbolicUnknown("missing argument");
|
|
477
|
+
}
|
|
478
|
+
if (value.kind === "iterator" || value.kind === "promise") {
|
|
479
|
+
this.unresolved = true;
|
|
480
|
+
return symbolicUnknown(`${value.kind} members are not modeled`);
|
|
481
|
+
}
|
|
418
482
|
return symbolicUnknown("unresolved property");
|
|
419
483
|
}
|
|
420
484
|
#objectPropertyValue(property, environment) {
|
|
@@ -426,8 +490,10 @@ function init_javascriptSymbolicBindings() {
|
|
|
426
490
|
if (value.kind === "union") return [...new Set(value.values.flatMap((v) => this.members(v, active)))];
|
|
427
491
|
if (value.kind === "record") return [...value.values.keys()];
|
|
428
492
|
if (value.kind === "namespace") {
|
|
429
|
-
const
|
|
430
|
-
|
|
493
|
+
const available = this.#namespaceWrites(value);
|
|
494
|
+
if (available === undefined) return [];
|
|
495
|
+
const replacement = available.findLast((write) => write.path.length === 0);
|
|
496
|
+
return replacement ? this.members(this.evaluate(replacement.value, value.environment), active) : [...new Set(available.flatMap((w) => w.path.length === 1 ? w.path : []))];
|
|
431
497
|
}
|
|
432
498
|
if (value.kind !== "object") return [];
|
|
433
499
|
return [...new Set(value.node.properties.flatMap((p) => t.isSpreadElement(p) ? this.members(this.evaluate(p.argument, value.environment), active) : [semanticStaticPropertyKey(p.key, p.computed)].filter((k) => k !== null && !isObjectPrototypeSetter(p, k))))];
|
|
@@ -439,13 +505,19 @@ function init_javascriptSymbolicBindings() {
|
|
|
439
505
|
if (value.kind === "record") return 0;
|
|
440
506
|
if (value.kind === "namespace") {
|
|
441
507
|
if (this.#mutated.has(value.bindingId)) return 1;
|
|
442
|
-
const
|
|
443
|
-
|
|
508
|
+
const available = this.#namespaceWrites(value);
|
|
509
|
+
if (available === undefined) return 1;
|
|
510
|
+
const replacement = available.findLast((write) => write.path.length === 0);
|
|
511
|
+
return replacement ? this.unknownMembers(this.evaluate(replacement.value, value.environment), active) : 0;
|
|
444
512
|
}
|
|
445
513
|
if (value.kind !== "object") return 1;
|
|
446
514
|
return value.node.properties.reduce((sum, p) => sum + (t.isSpreadElement(p) ? this.unknownMembers(this.evaluate(p.argument, value.environment), new Set(active)) : Number(semanticStaticPropertyKey(p.key, p.computed) === null)), 0);
|
|
447
515
|
}
|
|
448
|
-
|
|
516
|
+
/** Calling a generator creates an iterator; advancing it is not modeled. */
|
|
517
|
+
callBody(fn) {
|
|
518
|
+
return fn.node.generator ? undefined : fn.node.body;
|
|
519
|
+
}
|
|
520
|
+
bind(fn, args, invocationNode, caller) {
|
|
449
521
|
const values = new Map();
|
|
450
522
|
runtimeFunctionParameters(fn.node).forEach((param, index) => {
|
|
451
523
|
const target = t.isRestElement(param) ? param.argument : param;
|
|
@@ -459,7 +531,9 @@ function init_javascriptSymbolicBindings() {
|
|
|
459
531
|
const scopeId = this.state.scopeByNode.get(fn.node)?.scopeId ?? this.state.scopeByNode.get(fn.node.body)?.scopeId;
|
|
460
532
|
return {
|
|
461
533
|
values,
|
|
534
|
+
activation: {},
|
|
462
535
|
parent: fn.environment,
|
|
536
|
+
...caller === undefined ? {} : { caller },
|
|
463
537
|
point: invocationNode ?? fn.node,
|
|
464
538
|
scopeNode: fn.node,
|
|
465
539
|
...scopeId === undefined ? {} : { scopeId }
|
|
@@ -495,11 +569,18 @@ function init_javascriptSymbolicBindings() {
|
|
|
495
569
|
if (t.isIdentifier(node)) return this.#identifier(node, env);
|
|
496
570
|
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
|
497
571
|
const key = semanticStaticPropertyKey(node.property, node.computed);
|
|
498
|
-
return key === null ? symbolicUnknown("dynamic member") : this.property(this.evaluate(node.object, env), key
|
|
572
|
+
return key === null ? symbolicUnknown("dynamic member") : this.property(this.evaluate(node.object, env), key, {
|
|
573
|
+
node,
|
|
574
|
+
environment: env
|
|
575
|
+
});
|
|
499
576
|
}
|
|
500
577
|
if (t.isSequenceExpression(node)) return this.evaluate(node.expressions.at(-1), env);
|
|
501
|
-
if (t.isAssignmentExpression(node))
|
|
502
|
-
|
|
578
|
+
if (t.isAssignmentExpression(node)) {
|
|
579
|
+
if (node.operator === "=") return this.evaluate(node.right, env);
|
|
580
|
+
if (node.operator === "&&=" || node.operator === "||=" || node.operator === "??=") return this.#logicalValue(node.operator === "&&=" ? "&&" : node.operator === "||=" ? "||" : "??", node.left, node.right, env, true);
|
|
581
|
+
return symbolicUnknown("compound assignment result");
|
|
582
|
+
}
|
|
583
|
+
if (t.isAwaitExpression(node)) return this.#awaited(this.evaluate(node.argument, env));
|
|
503
584
|
if (t.isUnaryExpression(node)) {
|
|
504
585
|
const value = this.evaluate(node.argument, env);
|
|
505
586
|
if (node.operator === "void") return {
|
|
@@ -522,23 +603,29 @@ function init_javascriptSymbolicBindings() {
|
|
|
522
603
|
positive: false
|
|
523
604
|
})]) : this.evaluate(truth ? node.consequent : node.alternate, env);
|
|
524
605
|
}
|
|
525
|
-
if (t.isLogicalExpression(node))
|
|
526
|
-
const left = this.evaluate(node.left, env);
|
|
527
|
-
const right = symbolicLogicalRight(node.operator, left);
|
|
528
|
-
if (right !== undefined) return right ? this.evaluate(node.right, env) : left;
|
|
529
|
-
const leftCondition = {
|
|
530
|
-
node: node.left,
|
|
531
|
-
positive: node.operator === "&&" ? false : node.operator === "||" ? true : "not-nullish"
|
|
532
|
-
};
|
|
533
|
-
const rightCondition = {
|
|
534
|
-
node: node.left,
|
|
535
|
-
positive: node.operator === "&&" ? true : node.operator === "||" ? false : "nullish"
|
|
536
|
-
};
|
|
537
|
-
return symbolicUnion([symbolicCondition(left, leftCondition), symbolicCondition(this.evaluate(node.right, env), rightCondition)]);
|
|
538
|
-
}
|
|
606
|
+
if (t.isLogicalExpression(node)) return this.#logicalValue(node.operator, node.left, node.right, env);
|
|
539
607
|
if (t.isCallExpression(node) || t.isOptionalCallExpression(node)) return this.#call(node, env);
|
|
540
608
|
return symbolicUnknown(`unsupported ${node.type}`);
|
|
541
609
|
}
|
|
610
|
+
#logicalValue(operator, leftNode, rightNode, env, assignment = false) {
|
|
611
|
+
const value = this.evaluate(leftNode, env);
|
|
612
|
+
let left = value;
|
|
613
|
+
if (assignment) {
|
|
614
|
+
const alternatives = symbolicUnion(symbolicVariants(value).map((variant) => variant.kind === "namespace" && variant.runtimeValueUnknown ? this.#withConditions(symbolicUnknown("mutable module exports value"), variant) : variant));
|
|
615
|
+
left = value.kind === "union" ? this.#withConditions(alternatives, value) : alternatives;
|
|
616
|
+
}
|
|
617
|
+
const right = symbolicLogicalRight(operator, left);
|
|
618
|
+
if (right !== undefined) return right ? this.evaluate(rightNode, env) : left;
|
|
619
|
+
const leftCondition = {
|
|
620
|
+
node: leftNode,
|
|
621
|
+
positive: operator === "&&" ? false : operator === "||" ? true : "not-nullish"
|
|
622
|
+
};
|
|
623
|
+
const rightCondition = {
|
|
624
|
+
node: leftNode,
|
|
625
|
+
positive: operator === "&&" ? true : operator === "||" ? false : "nullish"
|
|
626
|
+
};
|
|
627
|
+
return symbolicUnion([symbolicCondition(left, leftCondition), symbolicCondition(this.evaluate(rightNode, env), rightCondition)]);
|
|
628
|
+
}
|
|
542
629
|
#identifier(node, env) {
|
|
543
630
|
const binding = resolveSemanticBindingState(this.state, node, node.name);
|
|
544
631
|
if (!binding && node.name === "undefined" && !semanticResolutionBlocked(this.state, node, node.name)) return {
|
|
@@ -564,7 +651,8 @@ function init_javascriptSymbolicBindings() {
|
|
|
564
651
|
if (electronOrigin === undefined && this.#writes.has(binding.bindingId)) return symbolicUnknown("overwritten object members");
|
|
565
652
|
const initializer = binding.initializers.length === 1 ? binding.initializers[0] : undefined;
|
|
566
653
|
if (!initializer) return symbolicUnknown("missing or ambiguous initializer");
|
|
567
|
-
const
|
|
654
|
+
const boundary = this.#readBoundary(binding.scopeId, env, node);
|
|
655
|
+
const point = boundary === undefined ? undefined : boundary.node[boundary.edge];
|
|
568
656
|
if (!initializer.entryBody && !binding.definitions.every(({ kind }) => kind === "function") && (initializer.node.end == null || point == null || initializer.node.end > point)) {
|
|
569
657
|
this.unresolved = true;
|
|
570
658
|
return symbolicUnknown("initializer not available at this read");
|
|
@@ -573,19 +661,28 @@ function init_javascriptSymbolicBindings() {
|
|
|
573
661
|
let value = this.evaluate(initializer.node, env);
|
|
574
662
|
for (const key of initializer.projection) {
|
|
575
663
|
if (key === null) return symbolicUnknown("dynamic destructuring");
|
|
576
|
-
value = this.property(value, String(key)
|
|
664
|
+
value = this.property(value, String(key), {
|
|
665
|
+
node: initializer.node,
|
|
666
|
+
environment: env
|
|
667
|
+
});
|
|
577
668
|
}
|
|
578
669
|
return value;
|
|
579
670
|
}
|
|
580
|
-
#
|
|
671
|
+
#readBoundary(bindingScopeId, environment, readNode) {
|
|
581
672
|
let current = environment;
|
|
582
673
|
let child;
|
|
583
674
|
while (current) {
|
|
584
675
|
if (this.#scopeContains(bindingScopeId, current.scopeId)) {
|
|
585
676
|
const point = child?.point ?? readNode;
|
|
586
|
-
if (current.completedAt !== undefined) return
|
|
677
|
+
if (current.completedAt !== undefined) return {
|
|
678
|
+
node: current.completedAt,
|
|
679
|
+
edge: "end"
|
|
680
|
+
};
|
|
587
681
|
if (current.scopeNode && !this.#nodeWithin(point, current.scopeNode)) return undefined;
|
|
588
|
-
return
|
|
682
|
+
return {
|
|
683
|
+
node: point,
|
|
684
|
+
edge: "start"
|
|
685
|
+
};
|
|
589
686
|
}
|
|
590
687
|
child = current;
|
|
591
688
|
current = current.parent;
|
|
@@ -593,7 +690,10 @@ function init_javascriptSymbolicBindings() {
|
|
|
593
690
|
let outermost = environment;
|
|
594
691
|
while (outermost.parent) outermost = outermost.parent;
|
|
595
692
|
const point = outermost.point ?? environment.point ?? readNode;
|
|
596
|
-
return
|
|
693
|
+
return {
|
|
694
|
+
node: point,
|
|
695
|
+
edge: "start"
|
|
696
|
+
};
|
|
597
697
|
}
|
|
598
698
|
#scopeContains(bindingScopeId, environmentScopeId) {
|
|
599
699
|
let scopeId = bindingScopeId;
|
|
@@ -624,24 +724,162 @@ function init_javascriptSymbolicBindings() {
|
|
|
624
724
|
parent
|
|
625
725
|
};
|
|
626
726
|
}
|
|
627
|
-
#
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
727
|
+
#awaited(value) {
|
|
728
|
+
return symbolicUnion(symbolicVariants(value).map((variant) => variant.kind === "promise" ? this.#withConditions(this.#awaited(variant.value), variant) : variant));
|
|
729
|
+
}
|
|
730
|
+
#completeReturnedValue(value, activation, fallbackPoint, origins) {
|
|
731
|
+
if (value.kind === "union") return symbolicUnion(value.values.map((variant) => this.#completeReturnedValue(variant, activation, fallbackPoint, origins)));
|
|
732
|
+
if (value.kind !== "function" && value.kind !== "promise") return value;
|
|
733
|
+
const { returnPoint, ...returned } = value;
|
|
734
|
+
const point = returnPoint ?? fallbackPoint;
|
|
735
|
+
if (returned.kind === "promise") return {
|
|
736
|
+
...returned,
|
|
737
|
+
value: this.#completeReturnedValue(returned.value, activation, point, origins)
|
|
738
|
+
};
|
|
739
|
+
const environment = this.#completedEnvironment(returned.environment, activation, point);
|
|
631
740
|
return {
|
|
632
741
|
...returned,
|
|
742
|
+
environment: environment ?? returned.environment,
|
|
743
|
+
origins: [...origins, ...returned.origins]
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
#namespaceReadBoundary(value, read) {
|
|
747
|
+
const scopeId = value.environment.scopeId;
|
|
748
|
+
const activation = value.environment.activation;
|
|
749
|
+
if (scopeId === undefined || activation === undefined) return undefined;
|
|
750
|
+
const captured = this.#hasActivation(read.environment, activation);
|
|
751
|
+
if (captured && this.#owningFunction(read.node) === value.environment.scopeNode) return {
|
|
752
|
+
node: read.node,
|
|
753
|
+
edge: "start"
|
|
754
|
+
};
|
|
755
|
+
const caller = this.#namespaceCallerBoundary(value, read.environment, activation);
|
|
756
|
+
if (caller !== undefined) return caller;
|
|
757
|
+
if (!captured) return undefined;
|
|
758
|
+
const boundary = this.#readBoundary(scopeId, read.environment, read.node);
|
|
759
|
+
return boundary !== undefined && this.#owningFunction(boundary.node) === value.environment.scopeNode ? boundary : undefined;
|
|
760
|
+
}
|
|
761
|
+
#hasActivation(environment, activation) {
|
|
762
|
+
for (let current = environment; current; current = current.parent) {
|
|
763
|
+
if (--this.#remainingEvaluations < 0) {
|
|
764
|
+
this.truncated = true;
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
if (current.activation === activation) return true;
|
|
768
|
+
}
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
#namespaceCallerBoundary(value, environment, activation) {
|
|
772
|
+
for (let current = environment; current.caller !== undefined; current = current.caller) {
|
|
773
|
+
if (--this.#remainingEvaluations < 0) {
|
|
774
|
+
this.truncated = true;
|
|
775
|
+
return undefined;
|
|
776
|
+
}
|
|
777
|
+
const point = current.point;
|
|
778
|
+
if (point !== undefined && this.#owningFunction(point) === value.environment.scopeNode && this.#hasActivation(current.caller, activation)) return {
|
|
779
|
+
node: point,
|
|
780
|
+
edge: "start"
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
return undefined;
|
|
784
|
+
}
|
|
785
|
+
#owningFunction(node) {
|
|
786
|
+
let current = node;
|
|
787
|
+
while (current !== undefined && !t.isFunction(current)) current = this.state.parentsByNode.get(current);
|
|
788
|
+
return current;
|
|
789
|
+
}
|
|
790
|
+
#namespaceWrites(value, read, selectedKey) {
|
|
791
|
+
const writes = this.#writes.get(value.bindingId) ?? [];
|
|
792
|
+
const completedAt = value.environment.completedAt;
|
|
793
|
+
const boundary = read === undefined ? undefined : this.#namespaceReadBoundary(value, read);
|
|
794
|
+
if (this.#remainingEvaluations <= 0) {
|
|
795
|
+
this.truncated = true;
|
|
796
|
+
return undefined;
|
|
797
|
+
}
|
|
798
|
+
const sourcePoint = boundary?.node[boundary.edge];
|
|
799
|
+
if (boundary !== undefined && sourcePoint == null) return undefined;
|
|
800
|
+
if (completedAt !== undefined && completedAt.end == null) return undefined;
|
|
801
|
+
if (sourcePoint == null && completedAt === undefined) return read === undefined ? writes : undefined;
|
|
802
|
+
const point = Math.min(sourcePoint ?? Infinity, completedAt?.end ?? Infinity);
|
|
803
|
+
const commonThrough = value.environment.commonThrough?.end;
|
|
804
|
+
const changed = new Set();
|
|
805
|
+
if (commonThrough != null) {
|
|
806
|
+
if (writes.length > this.#remainingEvaluations) {
|
|
807
|
+
this.#remainingEvaluations = 0;
|
|
808
|
+
this.truncated = true;
|
|
809
|
+
return undefined;
|
|
810
|
+
}
|
|
811
|
+
this.#remainingEvaluations -= writes.length;
|
|
812
|
+
for (const write of writes) {
|
|
813
|
+
if (write.site.end == null) return undefined;
|
|
814
|
+
if (write.site.end > completedAt.end && write.site.end <= commonThrough) {
|
|
815
|
+
if (write.path.length === 0) return [];
|
|
816
|
+
changed.add(write.path[0]);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return writes.filter((write) => write.site.end != null && write.site.end <= point && (changed.size === 0 || (write.path.length > 0 ? !changed.has(write.path[0]) : selectedKey !== undefined && !changed.has(selectedKey))));
|
|
821
|
+
}
|
|
822
|
+
#completeNamespace(value, point, commonThrough) {
|
|
823
|
+
const values = new Map(value.environment.values);
|
|
824
|
+
const environment = {
|
|
825
|
+
...value.environment,
|
|
826
|
+
values,
|
|
827
|
+
completedAt: point,
|
|
828
|
+
...commonThrough === undefined ? {} : { commonThrough }
|
|
829
|
+
};
|
|
830
|
+
const completed = {
|
|
831
|
+
...value,
|
|
633
832
|
environment
|
|
634
833
|
};
|
|
834
|
+
for (const [bindingId, slot] of value.environment.values) {
|
|
835
|
+
if (slot === value) values.set(bindingId, completed);
|
|
836
|
+
else if (this.#moduleBindings.has(bindingId) && this.#exportAliases.get(bindingId) === value.bindingId && slot.kind === "record" && slot.values.get("exports") === value) {
|
|
837
|
+
values.set(bindingId, {
|
|
838
|
+
...slot,
|
|
839
|
+
values: new Map(slot.values).set("exports", completed)
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
return completed;
|
|
635
844
|
}
|
|
636
|
-
#
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
845
|
+
#moduleExports(value) {
|
|
846
|
+
const factory = this.#namespaceOwners.get(value.bindingId);
|
|
847
|
+
if (factory === undefined) return value;
|
|
848
|
+
const cached = this.#completedModules.get(value.environment);
|
|
849
|
+
if (cached !== undefined) return cached;
|
|
850
|
+
if (this.#activeFunctions.has(factory)) return symbolicUnknown("recursive module completion");
|
|
851
|
+
this.#activeFunctions.add(factory);
|
|
852
|
+
try {
|
|
853
|
+
const flow = this.#returnFlow(t.isBlockStatement(factory.body) ? factory.body.body : [], value.environment, (statement) => this.#completeNamespace(value, statement));
|
|
854
|
+
const completed = symbolicUnion([...flow.values, ...flow.fallsThrough ? [this.#withConditions(this.#completeNamespace(value, factory.body), flow)] : []]);
|
|
855
|
+
const variants = symbolicVariants(completed);
|
|
856
|
+
if (variants.length > 1 && variants.every((variant) => variant.kind === "namespace" && variant.environment.completedAt?.end != null && !variant.conditionUnresolved)) {
|
|
857
|
+
if (variants.length > this.#remainingEvaluations) {
|
|
858
|
+
this.#remainingEvaluations = 0;
|
|
859
|
+
this.truncated = true;
|
|
860
|
+
} else {
|
|
861
|
+
this.#remainingEvaluations -= variants.length;
|
|
862
|
+
const exits = variants;
|
|
863
|
+
let first = exits[0].environment.completedAt;
|
|
864
|
+
let last = first;
|
|
865
|
+
for (const exit of exits) {
|
|
866
|
+
const point = exit.environment.completedAt;
|
|
867
|
+
if (point.end < first.end) first = point;
|
|
868
|
+
if (point.end > last.end) last = point;
|
|
869
|
+
}
|
|
870
|
+
const common = this.#completeNamespace(value, first, last);
|
|
871
|
+
const group = {
|
|
872
|
+
members: new Set(variants),
|
|
873
|
+
common
|
|
874
|
+
};
|
|
875
|
+
for (const variant of variants) this.#completionGroups.set(variant, group);
|
|
876
|
+
}
|
|
642
877
|
}
|
|
643
|
-
|
|
644
|
-
|
|
878
|
+
this.#completedModules.set(value.environment, completed);
|
|
879
|
+
return completed;
|
|
880
|
+
} finally {
|
|
881
|
+
this.#activeFunctions.delete(factory);
|
|
882
|
+
}
|
|
645
883
|
}
|
|
646
884
|
#call(node, env) {
|
|
647
885
|
const callee = this.evaluate(node.callee, env);
|
|
@@ -651,16 +889,7 @@ function init_javascriptSymbolicBindings() {
|
|
|
651
889
|
if (value.kind === "loader") {
|
|
652
890
|
const key = args[0];
|
|
653
891
|
const loaded = key?.kind === "literal" ? value.modules.get(String(key.value)) ?? symbolicUnknown("missing module") : symbolicUnknown("dynamic module");
|
|
654
|
-
|
|
655
|
-
const factory = this.#namespaceOwners.get(loaded.bindingId);
|
|
656
|
-
result = factory === undefined ? loaded : {
|
|
657
|
-
...loaded,
|
|
658
|
-
environment: {
|
|
659
|
-
...loaded.environment,
|
|
660
|
-
completedAt: this.#moduleCompletionPoint(factory)
|
|
661
|
-
}
|
|
662
|
-
};
|
|
663
|
-
} else result = loaded;
|
|
892
|
+
result = loaded.kind === "namespace" ? this.#moduleExports(loaded) : loaded;
|
|
664
893
|
} else if (value.kind === "external" && value.path.join(".") === "require") {
|
|
665
894
|
const spec = args[0];
|
|
666
895
|
result = spec?.kind === "literal" && typeof spec.value === "string" ? {
|
|
@@ -669,44 +898,46 @@ function init_javascriptSymbolicBindings() {
|
|
|
669
898
|
} : symbolicUnknown("dynamic require");
|
|
670
899
|
} else if (value.kind !== "function" || this.#activeFunctions.has(value.node)) {
|
|
671
900
|
result = symbolicUnknown("unresolved or recursive call");
|
|
901
|
+
} else if (this.callBody(value) === undefined) {
|
|
902
|
+
result = { kind: "iterator" };
|
|
672
903
|
} else {
|
|
673
904
|
this.#activeFunctions.add(value.node);
|
|
674
905
|
try {
|
|
675
|
-
const bound = this.bind(value, args, node);
|
|
906
|
+
const bound = this.bind(value, args, node, env);
|
|
676
907
|
const returned = t.isBlockStatement(value.node.body) ? this.#returns(value.node.body.body, bound) : this.evaluate(value.node.body, bound);
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
...v.origins
|
|
683
|
-
]
|
|
684
|
-
} : v));
|
|
908
|
+
const completed = this.#completeReturnedValue(returned, bound, value.node.body, [...value.origins, node]);
|
|
909
|
+
result = value.node.async ? {
|
|
910
|
+
kind: "promise",
|
|
911
|
+
value: this.#awaited(completed)
|
|
912
|
+
} : completed;
|
|
685
913
|
} finally {
|
|
686
914
|
this.#activeFunctions.delete(value.node);
|
|
687
915
|
}
|
|
688
916
|
}
|
|
689
|
-
|
|
690
|
-
if (value.conditionUnresolved) result = symbolicConditionsUnresolved(result);
|
|
691
|
-
return result;
|
|
917
|
+
return this.#withConditions(result, value);
|
|
692
918
|
}));
|
|
693
919
|
}
|
|
694
920
|
#returns(statements, env) {
|
|
695
|
-
const flow = this.#returnFlow(statements, env)
|
|
696
|
-
|
|
921
|
+
const flow = this.#returnFlow(statements, env, (statement) => {
|
|
922
|
+
const value = this.evaluate(statement.argument, env);
|
|
923
|
+
return symbolicUnion(symbolicVariants(value).map((variant) => variant.kind === "function" || variant.kind === "promise" ? {
|
|
924
|
+
...variant,
|
|
925
|
+
returnPoint: statement
|
|
926
|
+
} : variant));
|
|
927
|
+
});
|
|
928
|
+
return symbolicUnion([...flow.values, ...flow.fallsThrough ? [this.#withConditions({
|
|
697
929
|
kind: "literal",
|
|
698
930
|
value: undefined
|
|
699
|
-
}] : []]);
|
|
931
|
+
}, flow)] : []]);
|
|
700
932
|
}
|
|
701
|
-
#returnFlow(statements, env, depth = 0) {
|
|
933
|
+
#returnFlow(statements, env, returnedValue, depth = 0) {
|
|
702
934
|
const possible = [];
|
|
703
935
|
let unresolvedFallthrough = false;
|
|
704
936
|
const continuationConditions = [];
|
|
705
|
-
const guardCurrentPath = (value) => {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
};
|
|
937
|
+
const guardCurrentPath = (value) => this.#withConditions(value, {
|
|
938
|
+
conditions: continuationConditions,
|
|
939
|
+
...unresolvedFallthrough ? { conditionUnresolved: true } : {}
|
|
940
|
+
});
|
|
710
941
|
for (const statement of statements) {
|
|
711
942
|
if (--this.#remainingEvaluations < 0 || depth >= 128) {
|
|
712
943
|
this.truncated = true;
|
|
@@ -720,28 +951,25 @@ function init_javascriptSymbolicBindings() {
|
|
|
720
951
|
fallsThrough: false
|
|
721
952
|
};
|
|
722
953
|
if (t.isReturnStatement(statement)) {
|
|
723
|
-
const value = this.evaluate(statement.argument, env);
|
|
724
|
-
const returned = symbolicUnion(symbolicVariants(value).map((variant) => variant.kind === "function" ? {
|
|
725
|
-
...variant,
|
|
726
|
-
returnPoint: statement
|
|
727
|
-
} : variant));
|
|
728
954
|
return {
|
|
729
|
-
values: [...possible, guardCurrentPath(
|
|
955
|
+
values: [...possible, guardCurrentPath(returnedValue(statement))],
|
|
730
956
|
fallsThrough: false
|
|
731
957
|
};
|
|
732
958
|
}
|
|
733
959
|
if (t.isBlockStatement(statement)) {
|
|
734
|
-
const flow = this.#returnFlow(statement.body, env, depth + 1);
|
|
960
|
+
const flow = this.#returnFlow(statement.body, env, returnedValue, depth + 1);
|
|
735
961
|
possible.push(...flow.values.map(guardCurrentPath));
|
|
736
962
|
if (!flow.fallsThrough) return {
|
|
737
963
|
values: possible,
|
|
738
964
|
fallsThrough: false
|
|
739
965
|
};
|
|
966
|
+
continuationConditions.push(...flow.conditions ?? []);
|
|
967
|
+
unresolvedFallthrough ||= flow.conditionUnresolved === true;
|
|
740
968
|
}
|
|
741
969
|
if (t.isIfStatement(statement)) {
|
|
742
970
|
const truth = symbolicTruth(this.evaluate(statement.test, env));
|
|
743
971
|
const branches = truth === undefined ? [statement.consequent, statement.alternate] : [truth ? statement.consequent : statement.alternate];
|
|
744
|
-
const flows = branches.map((branch) => this.#returnFlow(branch ? [branch] : [], env, depth + 1));
|
|
972
|
+
const flows = branches.map((branch) => this.#returnFlow(branch ? [branch] : [], env, returnedValue, depth + 1));
|
|
745
973
|
possible.push(...flows.flatMap((flow, index) => flow.values.map((value) => {
|
|
746
974
|
const guarded = guardCurrentPath(value);
|
|
747
975
|
return truth === undefined ? symbolicCondition(guarded, {
|
|
@@ -753,7 +981,10 @@ function init_javascriptSymbolicBindings() {
|
|
|
753
981
|
values: possible,
|
|
754
982
|
fallsThrough: false
|
|
755
983
|
};
|
|
756
|
-
if (truth
|
|
984
|
+
if (truth !== undefined) {
|
|
985
|
+
continuationConditions.push(...flows[0]?.conditions ?? []);
|
|
986
|
+
unresolvedFallthrough ||= flows[0]?.conditionUnresolved === true;
|
|
987
|
+
} else {
|
|
757
988
|
const fallthrough = flows.flatMap((flow, index) => flow.fallsThrough ? [{
|
|
758
989
|
flow,
|
|
759
990
|
index
|
|
@@ -765,7 +996,7 @@ function init_javascriptSymbolicBindings() {
|
|
|
765
996
|
else if (fallthrough.length > 0 && (fallthrough.length < flows.length || fallthrough.some(({ flow }) => flow.values.length > 0))) unresolvedFallthrough = true;
|
|
766
997
|
}
|
|
767
998
|
}
|
|
768
|
-
if (t.
|
|
999
|
+
if (t.isLoop(statement) || t.isSwitchStatement(statement) || t.isTryStatement(statement) || t.isLabeledStatement(statement) || t.isWithStatement(statement)) {
|
|
769
1000
|
if (containsOwnedReturn(statement)) {
|
|
770
1001
|
possible.push(symbolicUnknown(`unsupported return control flow: ${statement.type}`));
|
|
771
1002
|
unresolvedFallthrough = true;
|
|
@@ -774,7 +1005,9 @@ function init_javascriptSymbolicBindings() {
|
|
|
774
1005
|
}
|
|
775
1006
|
return {
|
|
776
1007
|
values: possible,
|
|
777
|
-
fallsThrough: true
|
|
1008
|
+
fallsThrough: true,
|
|
1009
|
+
...continuationConditions.length ? { conditions: continuationConditions } : {},
|
|
1010
|
+
...unresolvedFallthrough ? { conditionUnresolved: true } : {}
|
|
778
1011
|
};
|
|
779
1012
|
}
|
|
780
1013
|
#indexBootstrap(call) {
|
|
@@ -797,6 +1030,7 @@ function init_javascriptSymbolicBindings() {
|
|
|
797
1030
|
const values = new Map();
|
|
798
1031
|
const environment = {
|
|
799
1032
|
values,
|
|
1033
|
+
activation: {},
|
|
800
1034
|
point: factory.body,
|
|
801
1035
|
scopeNode: factory,
|
|
802
1036
|
...this.state.scopeByNode.get(factory)?.scopeId === undefined ? {} : { scopeId: this.state.scopeByNode.get(factory).scopeId }
|
|
@@ -865,7 +1099,7 @@ function init_javascriptSymbolicBindings() {
|
|
|
865
1099
|
#indexWriteSite(target, site) {
|
|
866
1100
|
const direct = unwrapJavaScriptExpression(target).node;
|
|
867
1101
|
if ((t.isIdentifier(direct) || t.isMemberExpression(direct)) && !t.isForOfStatement(site) && !t.isForInStatement(site)) {
|
|
868
|
-
this.#indexWrite(direct,
|
|
1102
|
+
this.#indexWrite(direct, site, site);
|
|
869
1103
|
return;
|
|
870
1104
|
}
|
|
871
1105
|
for (const leaf of semanticWriteTargets(target)) this.#indexWrite(leaf, site, site, false);
|
|
@@ -904,10 +1138,6 @@ function init_javascriptSymbolicBindings() {
|
|
|
904
1138
|
}
|
|
905
1139
|
}
|
|
906
1140
|
}
|
|
907
|
-
if (alias && selected.length === 0) {
|
|
908
|
-
this.#replacements.set(key, value);
|
|
909
|
-
return;
|
|
910
|
-
}
|
|
911
1141
|
const writes = this.#writes.get(key) ?? [];
|
|
912
1142
|
writes.push({
|
|
913
1143
|
path: selected,
|
|
@@ -954,7 +1184,7 @@ function handlerKind(node) {
|
|
|
954
1184
|
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) return "member-expression";
|
|
955
1185
|
return "dynamic-expression";
|
|
956
1186
|
}
|
|
957
|
-
var electronCalleePath, electronStaticValue, boundedExpression,
|
|
1187
|
+
var electronCalleePath, electronStaticValue, boundedExpression, collectContextBridgeMembers, collectMembersAt, literalValue;
|
|
958
1188
|
function init_electronStaticAnalysisValues() {
|
|
959
1189
|
return (init_electronStaticAnalysisValues = __esmMin((() => {
|
|
960
1190
|
init_unicodeCodePointOrder();
|
|
@@ -989,21 +1219,6 @@ function init_electronStaticAnalysisValues() {
|
|
|
989
1219
|
const expression = sourceSlice(source, node).trim();
|
|
990
1220
|
return expression === "" ? `[${node.type}]` : expression;
|
|
991
1221
|
};
|
|
992
|
-
objectProperty = (object, name) => {
|
|
993
|
-
if (object === undefined) return { status: "missing" };
|
|
994
|
-
if (!t.isObjectExpression(object)) return { status: "dynamic" };
|
|
995
|
-
for (const property of object.properties.toReversed()) {
|
|
996
|
-
if (t.isSpreadElement(property)) return { status: "dynamic" };
|
|
997
|
-
const key = semanticStaticPropertyName(property.key, property.computed);
|
|
998
|
-
if (key === "" && !t.isStringLiteral(property.key)) return { status: "dynamic" };
|
|
999
|
-
if (key !== name) continue;
|
|
1000
|
-
return t.isObjectProperty(property) ? {
|
|
1001
|
-
status: "explicit",
|
|
1002
|
-
property
|
|
1003
|
-
} : { status: "dynamic" };
|
|
1004
|
-
}
|
|
1005
|
-
return { status: "missing" };
|
|
1006
|
-
};
|
|
1007
1222
|
collectContextBridgeMembers = (node) => {
|
|
1008
1223
|
if (node === null || node === undefined) return {
|
|
1009
1224
|
status: "missing",
|
|
@@ -1349,7 +1564,7 @@ function init_electronStaticAnalysisIpc() {
|
|
|
1349
1564
|
|
|
1350
1565
|
//#endregion
|
|
1351
1566
|
//#region dist/domain/javascript/electronWrappedCallPaths.js
|
|
1352
|
-
var callLabel, collectElectronWrappedCallPaths;
|
|
1567
|
+
var callLabel, ipcEndpointKey, ipcInvocationKey, indexIpcFinding, collectElectronWrappedCallPaths;
|
|
1353
1568
|
function init_electronWrappedCallPaths() {
|
|
1354
1569
|
return (init_electronWrappedCallPaths = __esmMin((() => {
|
|
1355
1570
|
init_javascriptAstValues();
|
|
@@ -1363,11 +1578,32 @@ function init_electronWrappedCallPaths() {
|
|
|
1363
1578
|
init_javascriptSymbolicControlFlow();
|
|
1364
1579
|
init_unicodeCodePointOrder();
|
|
1365
1580
|
callLabel = (node) => t.isSequenceExpression(node) ? callLabel(node.expressions.at(-1) ?? node) : calleeName(node) || "local call";
|
|
1581
|
+
ipcEndpointKey = (value) => JSON.stringify([
|
|
1582
|
+
value.side,
|
|
1583
|
+
value.operation,
|
|
1584
|
+
value.channel,
|
|
1585
|
+
value.location
|
|
1586
|
+
]);
|
|
1587
|
+
ipcInvocationKey = (location) => String(JSON.stringify(location));
|
|
1588
|
+
indexIpcFinding = (index, value) => {
|
|
1589
|
+
const key = ipcEndpointKey(value);
|
|
1590
|
+
let facts = index.get(key);
|
|
1591
|
+
if (facts === undefined) {
|
|
1592
|
+
facts = {
|
|
1593
|
+
observedTransmission: false,
|
|
1594
|
+
invocations: new Set()
|
|
1595
|
+
};
|
|
1596
|
+
index.set(key, facts);
|
|
1597
|
+
}
|
|
1598
|
+
facts.observedTransmission ||= value.resolution_basis === undefined && (value.mode === "send" || value.mode === "invoke");
|
|
1599
|
+
facts.invocations.add(ipcInvocationKey(value.invocation_location));
|
|
1600
|
+
};
|
|
1366
1601
|
collectElectronWrappedCallPaths = (program, state, source, accumulator, identity) => {
|
|
1367
1602
|
let remainingVisits = 1e6;
|
|
1368
1603
|
const resolver = new JavaScriptSymbolicBindings(state, program, identity);
|
|
1369
1604
|
const paths = [];
|
|
1370
1605
|
const seen = new Set();
|
|
1606
|
+
const unconditionalRegistrations = new Set();
|
|
1371
1607
|
const step = (node, kind, label) => {
|
|
1372
1608
|
const module = accumulator.moduleRangeIndex.find(node.start);
|
|
1373
1609
|
return {
|
|
@@ -1425,6 +1661,13 @@ function init_electronWrappedCallPaths() {
|
|
|
1425
1661
|
}
|
|
1426
1662
|
return value.conditions?.reduce((current, branch) => condition(current, branch.node, branch.positive), context) ?? context;
|
|
1427
1663
|
};
|
|
1664
|
+
let ipcByEndpoint;
|
|
1665
|
+
const ipcAtEndpoint = () => {
|
|
1666
|
+
if (ipcByEndpoint !== undefined) return ipcByEndpoint;
|
|
1667
|
+
ipcByEndpoint = new Map();
|
|
1668
|
+
for (const { value } of accumulator.ipc) indexIpcFinding(ipcByEndpoint, value);
|
|
1669
|
+
return ipcByEndpoint;
|
|
1670
|
+
};
|
|
1428
1671
|
const hasConditions = (value) => symbolicVariants(value).some((variant) => variant.conditions?.length);
|
|
1429
1672
|
function* bridgeMemberFunctions(value, segments = [], active = new Set()) {
|
|
1430
1673
|
if (active.has(value)) return;
|
|
@@ -1489,14 +1732,15 @@ function init_electronWrappedCallPaths() {
|
|
|
1489
1732
|
seen.add(key);
|
|
1490
1733
|
paths.push(path);
|
|
1491
1734
|
};
|
|
1492
|
-
const functionBody = (fn, args, context, invocationNode) => {
|
|
1493
|
-
|
|
1735
|
+
const functionBody = (fn, args, context, invocationNode, caller) => {
|
|
1736
|
+
const body = resolver.callBody(fn);
|
|
1737
|
+
if (body === undefined || context.active.has(fn.node)) return;
|
|
1494
1738
|
if (fn.conditionUnresolved === true) {
|
|
1495
1739
|
accumulator.unknownFindings += 1;
|
|
1496
1740
|
return;
|
|
1497
1741
|
}
|
|
1498
1742
|
const name = (t.isFunctionExpression(fn.node) || t.isFunctionDeclaration(fn.node)) && fn.node.id ? fn.node.id.name : "closure";
|
|
1499
|
-
walk(
|
|
1743
|
+
walk(body, resolver.bind(fn, args, invocationNode, caller), {
|
|
1500
1744
|
...context,
|
|
1501
1745
|
steps: [
|
|
1502
1746
|
...context.steps,
|
|
@@ -1557,18 +1801,39 @@ function init_electronWrappedCallPaths() {
|
|
|
1557
1801
|
handler_location: null,
|
|
1558
1802
|
...findingContext
|
|
1559
1803
|
};
|
|
1560
|
-
const
|
|
1804
|
+
const recorded = ipcAtEndpoint().get(ipcEndpointKey(finding));
|
|
1805
|
+
const duplicate = recorded !== undefined && (recorded.observedTransmission || recorded.invocations.has(ipcInvocationKey(invocationLocation)));
|
|
1561
1806
|
const findingGuarded = context.conditions.length > 0 || hasConditions(first) || guardedDispatch;
|
|
1807
|
+
const registrationKey = descriptor.side === "main" ? JSON.stringify([
|
|
1808
|
+
endpoint,
|
|
1809
|
+
channel,
|
|
1810
|
+
location,
|
|
1811
|
+
range$1(context.entryNode),
|
|
1812
|
+
context.entryKind,
|
|
1813
|
+
context.entry,
|
|
1814
|
+
context.entryPath,
|
|
1815
|
+
context.steps
|
|
1816
|
+
]) : undefined;
|
|
1817
|
+
if (!findingGuarded && registrationKey !== undefined) unconditionalRegistrations.add(registrationKey);
|
|
1562
1818
|
if (!duplicate && !findingGuarded) {
|
|
1819
|
+
const value = {
|
|
1820
|
+
...finding,
|
|
1821
|
+
resolution_basis: "wrapper-substitution"
|
|
1822
|
+
};
|
|
1563
1823
|
accumulator.ipc.push({
|
|
1564
1824
|
offset: node.start ?? -1,
|
|
1565
|
-
value
|
|
1566
|
-
...finding,
|
|
1567
|
-
resolution_basis: "wrapper-substitution"
|
|
1568
|
-
}
|
|
1825
|
+
value
|
|
1569
1826
|
});
|
|
1827
|
+
indexIpcFinding(ipcAtEndpoint(), value);
|
|
1570
1828
|
if (descriptor.mode !== "send" && descriptor.mode !== "invoke" && !fn) accumulator.unknownFindings += 1;
|
|
1571
|
-
} else if (findingGuarded
|
|
1829
|
+
} else if (findingGuarded && (registrationKey === undefined || !unconditionalRegistrations.has(registrationKey))) {
|
|
1830
|
+
accumulator.unknownFindings += 1;
|
|
1831
|
+
if (descriptor.side === "main") emit({
|
|
1832
|
+
...channelContext,
|
|
1833
|
+
entryKind: channelContext.entryKind ?? "ipc-handler",
|
|
1834
|
+
entry: channelContext.entry || channel
|
|
1835
|
+
}, node, endpoint, channel);
|
|
1836
|
+
}
|
|
1572
1837
|
if (descriptor.mode === "send" || descriptor.mode === "invoke") {
|
|
1573
1838
|
emit(channelContext, node, endpoint, channel);
|
|
1574
1839
|
return;
|
|
@@ -1652,7 +1917,7 @@ function init_electronWrappedCallPaths() {
|
|
|
1652
1917
|
functionBody(callee, args, {
|
|
1653
1918
|
...branchContext,
|
|
1654
1919
|
steps: [...branchContext.steps, step(node, "call", callLabel(node.callee))]
|
|
1655
|
-
}, node);
|
|
1920
|
+
}, node, env);
|
|
1656
1921
|
} else if (callee.kind === "external") {
|
|
1657
1922
|
const path = callee.path;
|
|
1658
1923
|
const endpoint = path.join(".");
|
|
@@ -1742,9 +2007,67 @@ function init_electronWrappedCallPaths() {
|
|
|
1742
2007
|
})))();
|
|
1743
2008
|
}
|
|
1744
2009
|
|
|
2010
|
+
//#endregion
|
|
2011
|
+
//#region dist/domain/javascript/electronStaticOptionObjects.js
|
|
2012
|
+
var optionObjectCandidate, hasElectronOptionObjectCandidate, resolveElectronOptionObject;
|
|
2013
|
+
function init_electronStaticOptionObjects() {
|
|
2014
|
+
return (init_electronStaticOptionObjects = __esmMin((() => {
|
|
2015
|
+
init_javascriptAstValues();
|
|
2016
|
+
init_javascriptSemanticMutationInitializers();
|
|
2017
|
+
init_javascriptSemanticState();
|
|
2018
|
+
optionObjectCandidate = (input, index) => {
|
|
2019
|
+
if (input === undefined) return undefined;
|
|
2020
|
+
let node = unwrapJavaScriptExpression(input).node;
|
|
2021
|
+
const seen = new Set();
|
|
2022
|
+
const references = [];
|
|
2023
|
+
while (t.isIdentifier(node)) {
|
|
2024
|
+
if (seen.has(node)) return undefined;
|
|
2025
|
+
seen.add(node);
|
|
2026
|
+
const binding = index.bindingForReferenceAt(node);
|
|
2027
|
+
if (binding === undefined) return undefined;
|
|
2028
|
+
const initializer = semanticStableInitializer(binding, index.bindings);
|
|
2029
|
+
if (binding.mutable || binding.declarationKinds.size !== 1 || !binding.declarationKinds.has("const") || initializer === undefined || initializer.projection.length !== 0 || !semanticBindingAtRead(binding, node, index.bindings.parentsByNode).hasDefiniteInitializer) return undefined;
|
|
2030
|
+
references.push(node);
|
|
2031
|
+
node = unwrapJavaScriptExpression(initializer.node).node;
|
|
2032
|
+
}
|
|
2033
|
+
return t.isObjectExpression(node) ? {
|
|
2034
|
+
object: node,
|
|
2035
|
+
references
|
|
2036
|
+
} : undefined;
|
|
2037
|
+
};
|
|
2038
|
+
hasElectronOptionObjectCandidate = (input, index) => optionObjectCandidate(input, index) !== undefined;
|
|
2039
|
+
resolveElectronOptionObject = (input, site, index, propertyPath = []) => {
|
|
2040
|
+
const candidate = optionObjectCandidate(input, index);
|
|
2041
|
+
if (candidate === undefined) return undefined;
|
|
2042
|
+
for (const reference of candidate.references) {
|
|
2043
|
+
if (index.referenceMayHaveChangedAt(site, reference, propertyPath)) return undefined;
|
|
2044
|
+
}
|
|
2045
|
+
return candidate.object;
|
|
2046
|
+
};
|
|
2047
|
+
})))();
|
|
2048
|
+
}
|
|
2049
|
+
|
|
1745
2050
|
//#endregion
|
|
1746
2051
|
//#region dist/domain/javascript/electronStaticAnalysisBrowser.js
|
|
1747
|
-
|
|
2052
|
+
/** Batch deferred options after the shared mutation index can yield safely. */
|
|
2053
|
+
function* finishElectronBrowserWindowsSteps(context, index) {
|
|
2054
|
+
const pending = context.accumulator.pendingBrowserWindows;
|
|
2055
|
+
if (pending.length === 0) return;
|
|
2056
|
+
if (pending.some((node) => {
|
|
2057
|
+
const argument = argumentNode(node.arguments[0]);
|
|
2058
|
+
const options = argument && unwrapJavaScriptExpression(argument).node;
|
|
2059
|
+
if (t.isIdentifier(options)) return hasElectronOptionObjectCandidate(options, index);
|
|
2060
|
+
const lookup = staticObjectProperty(options, "webPreferences");
|
|
2061
|
+
return lookup.status === "explicit" && hasElectronOptionObjectCandidate(lookup.property.value, index);
|
|
2062
|
+
})) yield* index.indexMemberMutationFactsSteps();
|
|
2063
|
+
for (const node of pending) {
|
|
2064
|
+
inspectBrowserWindow(node, context, index);
|
|
2065
|
+
yield;
|
|
2066
|
+
}
|
|
2067
|
+
context.accumulator.browserWindows.sort((left, right) => left.offset - right.offset);
|
|
2068
|
+
pending.length = 0;
|
|
2069
|
+
}
|
|
2070
|
+
var inspectElectronBrowserNode, needsConstantOptions, inspectBrowserWindow, collectWindowOptions, collectWebPreferences, inspectContextBridge, inspectUtilityProcess;
|
|
1748
2071
|
function init_electronStaticAnalysisBrowser() {
|
|
1749
2072
|
return (init_electronStaticAnalysisBrowser = __esmMin((() => {
|
|
1750
2073
|
init_javascriptContextBridgeExposure();
|
|
@@ -1753,22 +2076,41 @@ function init_electronStaticAnalysisBrowser() {
|
|
|
1753
2076
|
init_javascriptStaticAnalysisFindings();
|
|
1754
2077
|
init_javascriptStaticAnalysisHelpers();
|
|
1755
2078
|
init_javascriptAstValues();
|
|
2079
|
+
init_electronStaticOptionObjects();
|
|
1756
2080
|
inspectElectronBrowserNode = (node, context) => {
|
|
1757
|
-
if (t.isNewExpression(node))
|
|
2081
|
+
if (t.isNewExpression(node)) {
|
|
2082
|
+
const path = electronCalleePath(node.callee, context);
|
|
2083
|
+
if (path?.length === 1 && path[0] === "BrowserWindow") {
|
|
2084
|
+
if (needsConstantOptions(node)) context.accumulator.pendingBrowserWindows.push(node);
|
|
2085
|
+
else inspectBrowserWindow(node, context);
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
1758
2088
|
if (!t.isCallExpression(node) && !t.isOptionalCallExpression(node)) return;
|
|
1759
2089
|
inspectContextBridge(node, context);
|
|
1760
2090
|
inspectUtilityProcess(node, context);
|
|
1761
2091
|
};
|
|
1762
|
-
|
|
1763
|
-
const
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
const
|
|
2092
|
+
needsConstantOptions = (node) => {
|
|
2093
|
+
const argument = argumentNode(node.arguments[0]);
|
|
2094
|
+
const options = argument && unwrapJavaScriptExpression(argument).node;
|
|
2095
|
+
if (t.isIdentifier(options)) return true;
|
|
2096
|
+
const lookup = staticObjectProperty(options, "webPreferences");
|
|
2097
|
+
return lookup.status === "explicit" && t.isIdentifier(unwrapJavaScriptExpression(lookup.property.value).node);
|
|
2098
|
+
};
|
|
2099
|
+
inspectBrowserWindow = (node, context, index) => {
|
|
2100
|
+
const argument = argumentNode(node.arguments[0]);
|
|
2101
|
+
const options = argument === undefined ? undefined : unwrapJavaScriptExpression(argument).node;
|
|
2102
|
+
const resolvedOptions = (index && resolveElectronOptionObject(options, node, index, ["webPreferences"])) ?? options;
|
|
2103
|
+
const lookup = staticObjectProperty(resolvedOptions, "webPreferences");
|
|
2104
|
+
const declaredPreferences = lookup.status === "explicit" ? unwrapJavaScriptExpression(lookup.property.value).node : undefined;
|
|
2105
|
+
const resolvedPreferences = (index && resolveElectronOptionObject(declaredPreferences, node, index)) ?? declaredPreferences;
|
|
2106
|
+
const resolutionSources = [...resolvedOptions !== options && resolvedOptions !== undefined ? [range$1(resolvedOptions)] : [], ...resolvedPreferences !== declaredPreferences && resolvedPreferences !== undefined ? [range$1(resolvedPreferences)] : []];
|
|
2107
|
+
const collected = collectWindowOptions(context.source, lookup.status, resolvedPreferences);
|
|
1767
2108
|
context.accumulator.unknownFindings += collected.unknown;
|
|
1768
2109
|
const finding = {
|
|
1769
|
-
options_status:
|
|
2110
|
+
options_status: resolvedOptions === undefined ? "missing" : t.isObjectExpression(resolvedOptions) ? "object-literal" : "dynamic",
|
|
1770
2111
|
web_preferences_status: collected.status,
|
|
1771
2112
|
web_preferences: collected.preferences,
|
|
2113
|
+
...resolutionSources.length > 0 ? { resolution_sources: resolutionSources } : {},
|
|
1772
2114
|
...collected.preload,
|
|
1773
2115
|
module_key: null,
|
|
1774
2116
|
location: range$1(node)
|
|
@@ -1780,23 +2122,22 @@ function init_electronStaticAnalysisBrowser() {
|
|
|
1780
2122
|
value: finding
|
|
1781
2123
|
});
|
|
1782
2124
|
};
|
|
1783
|
-
collectWindowOptions = (source,
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
status: lookup.status === "missing" ? "missing" : "dynamic",
|
|
2125
|
+
collectWindowOptions = (source, lookupStatus, preferences) => {
|
|
2126
|
+
if (lookupStatus !== "explicit" || !t.isObjectExpression(preferences)) return {
|
|
2127
|
+
status: lookupStatus === "missing" ? "missing" : "dynamic",
|
|
1787
2128
|
preferences: [],
|
|
1788
2129
|
preload: {
|
|
1789
2130
|
preload_path: null,
|
|
1790
2131
|
preload_resolution_context: null
|
|
1791
2132
|
},
|
|
1792
|
-
unknown:
|
|
2133
|
+
unknown: lookupStatus === "missing" ? 0 : 1
|
|
1793
2134
|
};
|
|
1794
|
-
return collectWebPreferences(source,
|
|
2135
|
+
return collectWebPreferences(source, preferences);
|
|
1795
2136
|
};
|
|
1796
2137
|
collectWebPreferences = (source, object) => {
|
|
1797
2138
|
const preferences = [];
|
|
1798
2139
|
let unknown = 0;
|
|
1799
|
-
const effectivePreload =
|
|
2140
|
+
const effectivePreload = staticObjectProperty(object, "preload");
|
|
1800
2141
|
const preloadPath = effectivePreload.status === "explicit" ? staticPath(effectivePreload.property.value) : undefined;
|
|
1801
2142
|
const preload = effectivePreload.status === "explicit" && preloadPath !== undefined ? {
|
|
1802
2143
|
preload_path: preloadPath,
|
|
@@ -1895,7 +2236,7 @@ function init_electronStaticAnalysisBrowser() {
|
|
|
1895
2236
|
const moduleNode = argumentNode(node.arguments[0]);
|
|
1896
2237
|
const modulePath = moduleNode === undefined ? undefined : staticPath(moduleNode);
|
|
1897
2238
|
const options = argumentNode(node.arguments[2]);
|
|
1898
|
-
const serviceNameProperty =
|
|
2239
|
+
const serviceNameProperty = staticObjectProperty(options, "serviceName");
|
|
1899
2240
|
const serviceName = serviceNameProperty.status === "explicit" ? staticPath(serviceNameProperty.property.value) : undefined;
|
|
1900
2241
|
if (serviceNameProperty.status !== "missing" && serviceName === undefined) context.accumulator.unknownFindings += 1;
|
|
1901
2242
|
if (modulePath === undefined) context.accumulator.unknownFindings += 1;
|
|
@@ -2176,9 +2517,20 @@ function init_electronStaticAnalysis() {
|
|
|
2176
2517
|
|
|
2177
2518
|
//#endregion
|
|
2178
2519
|
//#region dist/domain/javascript/javascriptStaticAnalysisCalls.js
|
|
2179
|
-
|
|
2520
|
+
/** Resolve deferred Source bodies after their document owners have been seen. */
|
|
2521
|
+
function* finishRpcScanSteps(context) {
|
|
2522
|
+
for (const rpc of context.rpcScan.finish()) {
|
|
2523
|
+
if (rpc !== undefined) addEndpoint$1(context, {
|
|
2524
|
+
kind: "network",
|
|
2525
|
+
...rpc
|
|
2526
|
+
});
|
|
2527
|
+
yield;
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
var inspectCall, moduleUrlSpecifier, workerConstructorKind, noteMediaElementPreloads, requireCallSpecifier, chunkLoadSpecifier, vitePreloadDependencySpecifiers, isExplicitDefaultArgument, indexVitePreloadDependencyTable, inspectEndpointCall, inspectLiteralEndpointCall, isNetworkRequestSpelling, isKnownNetworkRequest, finishPartialNetworkEndpoints, addPartialNetworkEndpoint, resolvedRequestTarget, requestInitializerPrecedesSite, requestReferenceNode, urlObjectRequestTarget, inspectRpcNode, inspectRouteProperty, inspectRoleProperty, inspectStorageCall, finishSqliteStorageCalls, addReference$1, addEndpoint$1, addSourceMapDirectives;
|
|
2180
2531
|
function init_javascriptStaticAnalysisCalls() {
|
|
2181
2532
|
return (init_javascriptStaticAnalysisCalls = __esmMin((() => {
|
|
2533
|
+
init_javascriptSemanticMapOperations();
|
|
2182
2534
|
init_javascriptSemanticTraversal();
|
|
2183
2535
|
init_artifactPathSyntax();
|
|
2184
2536
|
init_browserObservation();
|
|
@@ -2187,6 +2539,8 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2187
2539
|
init_javascriptAstValues();
|
|
2188
2540
|
init_javascriptSemanticState();
|
|
2189
2541
|
init_javascriptSemanticAmbientWrites();
|
|
2542
|
+
init_javascriptSemanticValues();
|
|
2543
|
+
init_javascriptSemanticMutationInitializers();
|
|
2190
2544
|
init_javascriptSemanticRequireOrigin();
|
|
2191
2545
|
inspectCall = (source, node, context, bindings) => {
|
|
2192
2546
|
const { accumulator } = context;
|
|
@@ -2214,14 +2568,18 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2214
2568
|
if (workerConstructor !== undefined || name === "Worker" || name.endsWith(".Worker")) addReference$1(context, {
|
|
2215
2569
|
node,
|
|
2216
2570
|
kind: "worker",
|
|
2217
|
-
specifier:
|
|
2571
|
+
specifier: workerConstructor === undefined || worker === undefined ? undefined : moduleUrlSpecifier(worker, bindings)
|
|
2218
2572
|
});
|
|
2219
|
-
if (
|
|
2573
|
+
if (!t.isNewExpression(node) && isUnmodifiedGlobalReference(node.callee, bindings, [
|
|
2574
|
+
"navigator",
|
|
2575
|
+
"serviceWorker",
|
|
2576
|
+
"register"
|
|
2577
|
+
])) addReference$1(context, {
|
|
2220
2578
|
node,
|
|
2221
2579
|
kind: "service-worker",
|
|
2222
|
-
specifier:
|
|
2580
|
+
specifier: moduleUrlSpecifier(node, bindings)
|
|
2223
2581
|
});
|
|
2224
|
-
inspectEndpointCall(node, name, first, context);
|
|
2582
|
+
inspectEndpointCall(node, name, first, context, bindings);
|
|
2225
2583
|
inspectStorageCall(node, name, first, context);
|
|
2226
2584
|
if (first === "audio" || first === "video") noteMediaElementPreloads(node, accumulator);
|
|
2227
2585
|
if ((name === "loadFile" || name.endsWith(".loadFile")) && first !== undefined) addLocatedFinding(context, {
|
|
@@ -2251,8 +2609,8 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2251
2609
|
}
|
|
2252
2610
|
});
|
|
2253
2611
|
};
|
|
2254
|
-
|
|
2255
|
-
const argumentExpression = argumentNode(
|
|
2612
|
+
moduleUrlSpecifier = (call, bindings) => {
|
|
2613
|
+
const argumentExpression = argumentNode(call.arguments[0]);
|
|
2256
2614
|
if (argumentExpression === undefined) return undefined;
|
|
2257
2615
|
const node = unwrapJavaScriptExpression(argumentExpression).node;
|
|
2258
2616
|
if (!t.isNewExpression(node)) return undefined;
|
|
@@ -2358,7 +2716,7 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2358
2716
|
});
|
|
2359
2717
|
return escapedOrMutated ? dependencies.map(() => undefined) : dependencies;
|
|
2360
2718
|
};
|
|
2361
|
-
inspectEndpointCall = (node, name, first, context) => {
|
|
2719
|
+
inspectEndpointCall = (node, name, first, context, bindings) => {
|
|
2362
2720
|
const route = STATIC_ROUTE_CALL_NAMES.some((candidate) => name === candidate || name.endsWith(`.${candidate}`));
|
|
2363
2721
|
if (route && first !== undefined) addEndpoint$1(context, {
|
|
2364
2722
|
node,
|
|
@@ -2366,6 +2724,47 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2366
2724
|
value: first,
|
|
2367
2725
|
mechanism: `call:${name}`
|
|
2368
2726
|
});
|
|
2727
|
+
if (isKnownNetworkRequest(node, bindings)) {
|
|
2728
|
+
const target = argumentNode(node.arguments[0]);
|
|
2729
|
+
if (target === undefined) return;
|
|
2730
|
+
const literal = stringValue(target);
|
|
2731
|
+
if (literal !== undefined) {
|
|
2732
|
+
addEndpoint$1(context, {
|
|
2733
|
+
node,
|
|
2734
|
+
kind: "network",
|
|
2735
|
+
value: literal,
|
|
2736
|
+
mechanism: `call:${name}`
|
|
2737
|
+
});
|
|
2738
|
+
return;
|
|
2739
|
+
}
|
|
2740
|
+
const reference = requestReferenceNode(target);
|
|
2741
|
+
const unwrapped = unwrapJavaScriptExpression(reference).node;
|
|
2742
|
+
if (t.isIdentifier(unwrapped) || t.isMemberExpression(unwrapped) || t.isOptionalMemberExpression(unwrapped)) {
|
|
2743
|
+
context.accumulator.pendingNetworkCalls.push({
|
|
2744
|
+
node,
|
|
2745
|
+
name
|
|
2746
|
+
});
|
|
2747
|
+
return;
|
|
2748
|
+
}
|
|
2749
|
+
addPartialNetworkEndpoint(context, node, name, target);
|
|
2750
|
+
return;
|
|
2751
|
+
}
|
|
2752
|
+
if (isNetworkRequestSpelling(name)) return;
|
|
2753
|
+
if (first !== undefined && /(?:^|\.)(?:get|delete)$/u.test(name)) {
|
|
2754
|
+
if (endpointArgument(name, node.arguments, node.callee, context.openReceiverFacts?.get(node.start ?? -1)) === undefined) return;
|
|
2755
|
+
const mapLookup = isIntrinsicMapLookup(node, bindings);
|
|
2756
|
+
if (mapLookup === true) return;
|
|
2757
|
+
if (mapLookup === undefined) {
|
|
2758
|
+
context.accumulator.pendingNetworkCalls.push({
|
|
2759
|
+
node,
|
|
2760
|
+
name
|
|
2761
|
+
});
|
|
2762
|
+
return;
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
inspectLiteralEndpointCall(node, name, context);
|
|
2766
|
+
};
|
|
2767
|
+
inspectLiteralEndpointCall = (node, name, context) => {
|
|
2369
2768
|
const receiverFact = context.openReceiverFacts?.get(node.start ?? -1);
|
|
2370
2769
|
const endpoint = endpointArgument(name, node.arguments, node.callee, receiverFact);
|
|
2371
2770
|
if (endpoint !== undefined) addEndpoint$1(context, {
|
|
@@ -2376,6 +2775,104 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2376
2775
|
...endpoint.kind === "candidate" ? { interpretation: "candidate" } : {}
|
|
2377
2776
|
});
|
|
2378
2777
|
};
|
|
2778
|
+
isNetworkRequestSpelling = (name) => name === "fetch" || name === "WebSocket" || name === "EventSource" || name === "sendBeacon" || name === "window.fetch" || name === "globalThis.fetch" || name === "self.fetch" || name === "navigator.sendBeacon";
|
|
2779
|
+
isKnownNetworkRequest = (node, bindings) => {
|
|
2780
|
+
if ((t.isCallExpression(node) || t.isOptionalCallExpression(node)) && isUnmodifiedGlobalReference(node.callee, bindings, "fetch")) return true;
|
|
2781
|
+
if (t.isNewExpression(node) && (isUnmodifiedGlobalReference(node.callee, bindings, "WebSocket") || isUnmodifiedGlobalReference(node.callee, bindings, "EventSource"))) return true;
|
|
2782
|
+
return (t.isCallExpression(node) || t.isOptionalCallExpression(node)) && isUnmodifiedGlobalReference(node.callee, bindings, ["navigator", "sendBeacon"]);
|
|
2783
|
+
};
|
|
2784
|
+
finishPartialNetworkEndpoints = (context, bindings, index) => {
|
|
2785
|
+
for (const { node, name } of context.accumulator.pendingNetworkCalls) {
|
|
2786
|
+
if (!isKnownNetworkRequest(node, bindings)) {
|
|
2787
|
+
if (!isIntrinsicMapLookup(node, bindings, index)) inspectLiteralEndpointCall(node, name, context);
|
|
2788
|
+
continue;
|
|
2789
|
+
}
|
|
2790
|
+
const target = argumentNode(node.arguments[0]);
|
|
2791
|
+
if (target === undefined) continue;
|
|
2792
|
+
const resolved = resolvedRequestTarget(target, node, bindings, index);
|
|
2793
|
+
if (resolved !== undefined) addEndpoint$1(context, {
|
|
2794
|
+
node,
|
|
2795
|
+
kind: "network",
|
|
2796
|
+
value: resolved,
|
|
2797
|
+
mechanism: `call:${name}`
|
|
2798
|
+
});
|
|
2799
|
+
else addPartialNetworkEndpoint(context, node, name, target);
|
|
2800
|
+
}
|
|
2801
|
+
context.accumulator.pendingNetworkCalls.length = 0;
|
|
2802
|
+
context.accumulator.endpoints.sort((left, right) => left.offset - right.offset);
|
|
2803
|
+
};
|
|
2804
|
+
addPartialNetworkEndpoint = (context, node, name, target) => addEndpoint$1(context, {
|
|
2805
|
+
node,
|
|
2806
|
+
kind: "network",
|
|
2807
|
+
value: sourceSlice(context.source, target),
|
|
2808
|
+
mechanism: `call:${name}`,
|
|
2809
|
+
resolution: "partial"
|
|
2810
|
+
});
|
|
2811
|
+
resolvedRequestTarget = (node, site, bindings, index) => {
|
|
2812
|
+
const reference = requestReferenceNode(node);
|
|
2813
|
+
const expression = unwrapJavaScriptExpression(node).node;
|
|
2814
|
+
const capture = reference === expression ? site : expression;
|
|
2815
|
+
if (index.referenceMayHaveChangedAt(capture, reference)) return undefined;
|
|
2816
|
+
if (!requestInitializerPrecedesSite(reference, capture, bindings, index)) return undefined;
|
|
2817
|
+
const evaluated = evaluateSemanticExpression(node, bindings);
|
|
2818
|
+
if (evaluated.status === "literal" && typeof evaluated.value === "string") return evaluated.value;
|
|
2819
|
+
return urlObjectRequestTarget(node, capture, bindings, index);
|
|
2820
|
+
};
|
|
2821
|
+
requestInitializerPrecedesSite = (reference, site, bindings, index) => {
|
|
2822
|
+
const binding = index.bindingForReferenceAt(reference);
|
|
2823
|
+
const initializer = semanticStableInitializer(binding, bindings);
|
|
2824
|
+
return initializer !== undefined && semanticTopLevelEffectFollowsCapture(initializer.node, site, bindings.parentsByNode);
|
|
2825
|
+
};
|
|
2826
|
+
requestReferenceNode = (node) => {
|
|
2827
|
+
const target = unwrapJavaScriptExpression(node).node;
|
|
2828
|
+
if ((t.isCallExpression(target) || t.isOptionalCallExpression(target)) && target.arguments.length === 0) {
|
|
2829
|
+
const callee = unwrapJavaScriptExpression(target.callee).node;
|
|
2830
|
+
if ((t.isMemberExpression(callee) || t.isOptionalMemberExpression(callee)) && semanticStaticPropertyName(callee.property, callee.computed) === "toString") return unwrapJavaScriptExpression(callee.object).node;
|
|
2831
|
+
}
|
|
2832
|
+
return target;
|
|
2833
|
+
};
|
|
2834
|
+
urlObjectRequestTarget = (node, site, bindings, index, seen = new Set()) => {
|
|
2835
|
+
let target = unwrapJavaScriptExpression(node).node;
|
|
2836
|
+
if ((t.isCallExpression(target) || t.isOptionalCallExpression(target)) && target.arguments.length === 0) {
|
|
2837
|
+
const callee = unwrapJavaScriptExpression(target.callee).node;
|
|
2838
|
+
if ((t.isMemberExpression(callee) || t.isOptionalMemberExpression(callee)) && semanticStaticPropertyName(callee.property, callee.computed) === "toString") target = unwrapJavaScriptExpression(callee.object).node;
|
|
2839
|
+
}
|
|
2840
|
+
if (!t.isIdentifier(target) || index.referenceMayHaveChangedAt(site, target)) return undefined;
|
|
2841
|
+
const binding = index.bindingForReferenceAt(target);
|
|
2842
|
+
if (binding === undefined || seen.has(binding.bindingId)) return undefined;
|
|
2843
|
+
seen.add(binding.bindingId);
|
|
2844
|
+
const stable = semanticStableInitializer(binding, bindings);
|
|
2845
|
+
if (stable === undefined || !semanticTopLevelEffectFollowsCapture(stable.node, site, bindings.parentsByNode)) return undefined;
|
|
2846
|
+
const initializer = stable.node;
|
|
2847
|
+
if (initializer === undefined) return undefined;
|
|
2848
|
+
const initialized = unwrapJavaScriptExpression(initializer).node;
|
|
2849
|
+
if (t.isIdentifier(initialized)) return urlObjectRequestTarget(initialized, site, bindings, index, seen);
|
|
2850
|
+
if (!t.isNewExpression(initialized)) return undefined;
|
|
2851
|
+
if (!isUnmodifiedGlobalReference(initialized.callee, bindings, "URL")) return undefined;
|
|
2852
|
+
if (["URL", "Object"].some((owner) => ["toString", "valueOf"].some((method) => bindings.ambientWrites.covers([
|
|
2853
|
+
"global",
|
|
2854
|
+
owner,
|
|
2855
|
+
"prototype",
|
|
2856
|
+
method
|
|
2857
|
+
])))) return undefined;
|
|
2858
|
+
const input = stringValue(initialized.arguments[0]);
|
|
2859
|
+
if (input === undefined) return undefined;
|
|
2860
|
+
if (initialized.arguments.length === 1) {
|
|
2861
|
+
try {
|
|
2862
|
+
return new URL(input).href;
|
|
2863
|
+
} catch {
|
|
2864
|
+
return undefined;
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
if (initialized.arguments.length !== 2) return undefined;
|
|
2868
|
+
const base = stringValue(initialized.arguments[1]);
|
|
2869
|
+
if (base === undefined) return undefined;
|
|
2870
|
+
try {
|
|
2871
|
+
return new URL(input, base).href;
|
|
2872
|
+
} catch {
|
|
2873
|
+
return undefined;
|
|
2874
|
+
}
|
|
2875
|
+
};
|
|
2379
2876
|
inspectRpcNode = (node, context) => {
|
|
2380
2877
|
const rpc = context.rpcScan.inspect(node);
|
|
2381
2878
|
if (rpc !== undefined) addEndpoint$1(context, {
|
|
@@ -2414,6 +2911,13 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2414
2911
|
});
|
|
2415
2912
|
};
|
|
2416
2913
|
inspectStorageCall = (node, name, first, context) => {
|
|
2914
|
+
if (name === "Database" || name.endsWith(".Database")) {
|
|
2915
|
+
context.accumulator.pendingSqliteCalls.push({
|
|
2916
|
+
node,
|
|
2917
|
+
name
|
|
2918
|
+
});
|
|
2919
|
+
return;
|
|
2920
|
+
}
|
|
2417
2921
|
const receiverFact = context.openReceiverFacts?.get(node.start ?? -1);
|
|
2418
2922
|
const storage = receiverFact === "local" || receiverFact === "local-indexed-db" || receiverFact === "local-cache-storage" ? undefined : receiverFact === "indexed-db" ? "indexed-db" : receiverFact === "cache-storage" ? "cache-storage" : storageKind(name);
|
|
2419
2923
|
if (storage === undefined) return;
|
|
@@ -2430,6 +2934,34 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2430
2934
|
}
|
|
2431
2935
|
});
|
|
2432
2936
|
};
|
|
2937
|
+
finishSqliteStorageCalls = (context, bindings, index) => {
|
|
2938
|
+
for (const { node, name } of context.accumulator.pendingSqliteCalls) {
|
|
2939
|
+
const callee = unwrapJavaScriptExpression(node.callee).node;
|
|
2940
|
+
const provenance = evaluateSemanticExpressionProvenance(callee, bindings);
|
|
2941
|
+
const changed = index.referenceMayHaveChangedAt(node, callee);
|
|
2942
|
+
if (!changed && t.isIdentifier(callee) && provenance.status === "local") continue;
|
|
2943
|
+
const origin = provenance.status === "module" ? provenance.origins[0] : undefined;
|
|
2944
|
+
const path = origin?.importedPath;
|
|
2945
|
+
const imported = origin?.resolutionMode !== "require";
|
|
2946
|
+
const known = !changed && origin !== undefined && (origin.specifier === "better-sqlite3" && (origin.resolutionMode === "require" && path?.length === 0 || imported && path?.length === 1 && path[0] === "default") || origin.specifier === "sqlite3" && (path?.length === 1 && path[0] === "Database" || imported && path?.length === 2 && (path[0] === "default" || path[0] === "*") && path[1] === "Database"));
|
|
2947
|
+
const first = stringValue(node.arguments[0]);
|
|
2948
|
+
addLocatedFinding(context, {
|
|
2949
|
+
collection: context.accumulator.storage,
|
|
2950
|
+
key: `storage\0sqlite\0${known ? "api" : "candidate"}\0${first ?? ""}`,
|
|
2951
|
+
node,
|
|
2952
|
+
value: {
|
|
2953
|
+
kind: "sqlite",
|
|
2954
|
+
name: first ?? null,
|
|
2955
|
+
mechanism: `call:${name}`,
|
|
2956
|
+
...known ? {} : { interpretation: "candidate" },
|
|
2957
|
+
module_key: null,
|
|
2958
|
+
location: range$1(node)
|
|
2959
|
+
}
|
|
2960
|
+
});
|
|
2961
|
+
}
|
|
2962
|
+
context.accumulator.pendingSqliteCalls.length = 0;
|
|
2963
|
+
context.accumulator.storage.sort((left, right) => left.offset - right.offset);
|
|
2964
|
+
};
|
|
2433
2965
|
addReference$1 = (context, input) => {
|
|
2434
2966
|
const specifier = input.specifier ?? null;
|
|
2435
2967
|
const reference = specifier === null ? {
|
|
@@ -2453,13 +2985,14 @@ function init_javascriptStaticAnalysisCalls() {
|
|
|
2453
2985
|
};
|
|
2454
2986
|
addEndpoint$1 = (context, input) => addLocatedFinding(context, {
|
|
2455
2987
|
collection: context.accumulator.endpoints,
|
|
2456
|
-
key: `endpoint\0${input.kind}\0${input.interpretation ?? "literal"}\0${input.value}`,
|
|
2988
|
+
key: `endpoint\0${input.kind}\0${input.interpretation ?? "literal"}\0${input.resolution ?? "exact"}\0${input.value}`,
|
|
2457
2989
|
node: input.node,
|
|
2458
2990
|
value: {
|
|
2459
2991
|
kind: input.kind,
|
|
2460
|
-
value: sanitizeEndpointCandidate(input.value),
|
|
2992
|
+
value: input.resolution === "partial" ? input.value : sanitizeEndpointCandidate(input.value),
|
|
2461
2993
|
mechanism: input.mechanism,
|
|
2462
2994
|
...input.interpretation === undefined ? {} : { interpretation: input.interpretation },
|
|
2995
|
+
...input.resolution === undefined ? {} : { resolution: input.resolution },
|
|
2463
2996
|
module_key: null,
|
|
2464
2997
|
location: range$1(input.node)
|
|
2465
2998
|
}
|
|
@@ -2534,22 +3067,38 @@ function init_javascriptAstFingerprint() {
|
|
|
2534
3067
|
semanticTokens = (node) => {
|
|
2535
3068
|
const tokens = [`node:${node.type}`];
|
|
2536
3069
|
if (t.isStringLiteral(node)) tokens.push(`string:${node.value}`);
|
|
3070
|
+
else if (t.isBigIntLiteral(node)) tokens.push(`bigint:${String(node.value)}`);
|
|
3071
|
+
else if (t.isDirectiveLiteral(node)) tokens.push(`directive:${node.value}`);
|
|
2537
3072
|
else if (t.isNumericLiteral(node)) tokens.push(`number:${String(node.value)}`);
|
|
2538
3073
|
else if (t.isBooleanLiteral(node)) tokens.push(`boolean:${String(node.value)}`);
|
|
2539
3074
|
else if (t.isRegExpLiteral(node)) tokens.push(`regexp:${node.pattern}/${node.flags}`);
|
|
2540
3075
|
else if (t.isTemplateElement(node)) tokens.push(`template:${JSON.stringify(node.value)}`);
|
|
2541
|
-
else if (t.isBinaryExpression(node) || t.isLogicalExpression(node)) tokens.push(`operator:${node.operator}`);
|
|
2542
|
-
|
|
3076
|
+
else if (t.isBinaryExpression(node) || t.isLogicalExpression(node) || t.isUnaryExpression(node) || t.isUpdateExpression(node) || t.isAssignmentExpression(node)) tokens.push(`operator:${node.operator}`);
|
|
3077
|
+
if (t.isUpdateExpression(node)) tokens.push(`prefix:${String(node.prefix)}`);
|
|
3078
|
+
if (t.isVariableDeclaration(node)) tokens.push(`kind:${node.kind}`);
|
|
3079
|
+
if (t.isFunction(node)) {
|
|
3080
|
+
tokens.push(`async:${String(node.async)}`);
|
|
3081
|
+
tokens.push(`generator:${String(node.generator)}`);
|
|
3082
|
+
}
|
|
3083
|
+
if (t.isObjectMethod(node)) tokens.push(`kind:${node.kind}`);
|
|
3084
|
+
if (t.isClassMethod(node) || t.isClassPrivateMethod(node)) {
|
|
3085
|
+
tokens.push(`kind:${node.kind}`);
|
|
3086
|
+
tokens.push(`static:${String(node.static)}`);
|
|
3087
|
+
}
|
|
3088
|
+
if (t.isClassProperty(node) || t.isClassPrivateProperty(node) || t.isClassAccessorProperty(node)) tokens.push(`static:${String(node.static)}`);
|
|
2543
3089
|
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
|
2544
3090
|
tokens.push(`computed:${String(node.computed)}`);
|
|
2545
3091
|
if (!node.computed) {
|
|
2546
|
-
const property =
|
|
2547
|
-
if (property !==
|
|
3092
|
+
const property = semanticStaticPropertyKey(node.property, false);
|
|
3093
|
+
if (property !== null) tokens.push(`property:${property}`);
|
|
2548
3094
|
}
|
|
2549
3095
|
}
|
|
2550
|
-
if (
|
|
2551
|
-
|
|
2552
|
-
if (
|
|
3096
|
+
if (t.isObjectProperty(node) || t.isObjectMethod(node) || t.isClassMethod(node) || t.isClassProperty(node) || t.isClassAccessorProperty(node)) {
|
|
3097
|
+
tokens.push(`computed:${String(node.computed)}`);
|
|
3098
|
+
if (!node.computed) {
|
|
3099
|
+
const key = semanticStaticPropertyKey(node.key, false);
|
|
3100
|
+
if (key !== null) tokens.push(`key:${key}`);
|
|
3101
|
+
}
|
|
2553
3102
|
}
|
|
2554
3103
|
return tokens;
|
|
2555
3104
|
};
|
|
@@ -2622,7 +3171,7 @@ function init_javascriptAstFingerprint() {
|
|
|
2622
3171
|
var JAVASCRIPT_AST_FINGERPRINT_ALGORITHM;
|
|
2623
3172
|
function init_javascriptStaticAnalysisTypes() {
|
|
2624
3173
|
return (init_javascriptStaticAnalysisTypes = __esmMin((() => {
|
|
2625
|
-
JAVASCRIPT_AST_FINGERPRINT_ALGORITHM = "babel-ast-
|
|
3174
|
+
JAVASCRIPT_AST_FINGERPRINT_ALGORITHM = "babel-ast-v3";
|
|
2626
3175
|
})))();
|
|
2627
3176
|
}
|
|
2628
3177
|
/** Hard bounds applied to one AST-only JavaScript analysis. */
|
|
@@ -2865,11 +3414,14 @@ function init_javascriptStaticAnalysisState() {
|
|
|
2865
3414
|
createJavaScriptAnalysisAccumulator = (sourceLength) => ({
|
|
2866
3415
|
references: [],
|
|
2867
3416
|
endpoints: [],
|
|
3417
|
+
pendingNetworkCalls: [],
|
|
2868
3418
|
storage: [],
|
|
3419
|
+
pendingSqliteCalls: [],
|
|
2869
3420
|
roles: [],
|
|
2870
3421
|
sourceMaps: [],
|
|
2871
3422
|
registrations: [],
|
|
2872
3423
|
browserWindows: [],
|
|
3424
|
+
pendingBrowserWindows: [],
|
|
2873
3425
|
contextBridgeApis: [],
|
|
2874
3426
|
ipc: [],
|
|
2875
3427
|
senderValidations: [],
|
|
@@ -2888,19 +3440,27 @@ function init_javascriptStaticAnalysisState() {
|
|
|
2888
3440
|
//#endregion
|
|
2889
3441
|
//#region dist/domain/javascript/javascriptStaticAnalysis.js
|
|
2890
3442
|
/** Static analysis that yields during its source traversal; results are unchanged. */
|
|
2891
|
-
function* analyzeParsedJavaScriptStaticSourceSteps(source, file
|
|
3443
|
+
function* analyzeParsedJavaScriptStaticSourceSteps(source, file) {
|
|
2892
3444
|
const accumulator = createJavaScriptAnalysisAccumulator(source.length);
|
|
2893
|
-
const
|
|
3445
|
+
const index = yield* indexJavaScriptBindingsWithReceiversSteps(file.program);
|
|
3446
|
+
const { bindings, receivers } = index;
|
|
3447
|
+
yield* index.indexAmbientWritesSteps();
|
|
2894
3448
|
const electronIdentity = yield* indexJavaScriptElectronIdentitySteps(file.program, bindings);
|
|
2895
|
-
const
|
|
2896
|
-
yield* traverseStaticSourceSteps(file, {
|
|
3449
|
+
const findings = {
|
|
2897
3450
|
source,
|
|
2898
3451
|
accumulator,
|
|
2899
3452
|
vitePreloadDependencyTable: indexVitePreloadDependencyTable(file.program),
|
|
2900
|
-
|
|
3453
|
+
openReceiverFacts: receivers.openReceivers,
|
|
2901
3454
|
electronBindings: electronIdentity.bindings,
|
|
2902
|
-
rpcScan: createJavaScriptRpcScan(source,
|
|
2903
|
-
}
|
|
3455
|
+
rpcScan: createJavaScriptRpcScan(source, receivers.rpcClientRoots, index)
|
|
3456
|
+
};
|
|
3457
|
+
yield* traverseStaticSourceSteps(file, findings, bindings);
|
|
3458
|
+
yield* finishElectronBrowserWindowsSteps(findings, index);
|
|
3459
|
+
if (accumulator.pendingNetworkCalls.length > 0 || accumulator.pendingSqliteCalls.length > 0) {
|
|
3460
|
+
yield* index.indexMemberMutationFactsSteps();
|
|
3461
|
+
finishPartialNetworkEndpoints(findings, bindings, index);
|
|
3462
|
+
finishSqliteStorageCalls(findings, bindings, index);
|
|
3463
|
+
}
|
|
2904
3464
|
accumulator.electronCallPaths = collectElectronWrappedCallPaths(file.program, bindings, source, accumulator, electronIdentity);
|
|
2905
3465
|
addSourceMapDirectives(source, file.comments ?? [], accumulator);
|
|
2906
3466
|
return finalizeStaticAnalysis(source, file, accumulator);
|
|
@@ -2911,6 +3471,7 @@ function* traverseStaticSourceSteps(file, findings, bindings) {
|
|
|
2911
3471
|
inspectNode(node, findings, bindings);
|
|
2912
3472
|
return undefined;
|
|
2913
3473
|
} });
|
|
3474
|
+
yield* finishRpcScanSteps(findings);
|
|
2914
3475
|
}
|
|
2915
3476
|
var analyzeJavaScriptStaticSource, analyzeParsedJavaScriptStaticSource, finalizeStaticAnalysis, inspectNode;
|
|
2916
3477
|
function init_javascriptStaticAnalysis() {
|
|
@@ -2919,6 +3480,7 @@ function init_javascriptStaticAnalysis() {
|
|
|
2919
3480
|
init_javascriptElectronMemberWrites();
|
|
2920
3481
|
init_javascriptSemanticTraversal();
|
|
2921
3482
|
init_electronStaticAnalysis();
|
|
3483
|
+
init_electronStaticAnalysisBrowser();
|
|
2922
3484
|
init_javascriptStaticAnalysisHelpers();
|
|
2923
3485
|
init_javascriptStaticAnalysisCalls();
|
|
2924
3486
|
init_javascriptStaticAnalysisBundler();
|
|
@@ -2927,13 +3489,12 @@ function init_javascriptStaticAnalysis() {
|
|
|
2927
3489
|
init_javascriptSemanticAnalysis();
|
|
2928
3490
|
init_javascriptSourceParser();
|
|
2929
3491
|
init_javascriptRpcEndpoints();
|
|
2930
|
-
init_javascriptSemanticProjection();
|
|
2931
3492
|
init_javascriptModuleDeclaration();
|
|
2932
3493
|
analyzeJavaScriptStaticSource = (source) => {
|
|
2933
3494
|
const file = parseJavaScriptSource(source);
|
|
2934
|
-
return file === null ? failedJavaScriptStaticAnalysis() : analyzeParsedJavaScriptStaticSource(source, file
|
|
3495
|
+
return file === null ? failedJavaScriptStaticAnalysis() : analyzeParsedJavaScriptStaticSource(source, file);
|
|
2935
3496
|
};
|
|
2936
|
-
analyzeParsedJavaScriptStaticSource = (source, file
|
|
3497
|
+
analyzeParsedJavaScriptStaticSource = (source, file) => completeSemanticSteps(analyzeParsedJavaScriptStaticSourceSteps(source, file));
|
|
2937
3498
|
finalizeStaticAnalysis = (source, file, accumulator) => {
|
|
2938
3499
|
const parserErrors = file.errors.length;
|
|
2939
3500
|
const limitations = [
|
|
@@ -3041,6 +3602,38 @@ function init_sourceMapContents() {
|
|
|
3041
3602
|
})))();
|
|
3042
3603
|
}
|
|
3043
3604
|
|
|
3605
|
+
//#endregion
|
|
3606
|
+
//#region dist/application/javascript/JavaScriptArtifactAnalysisTypes.js
|
|
3607
|
+
var javascriptArtifactAnalysisScopes, isSkippedJavaScriptAnalysis;
|
|
3608
|
+
function init_JavaScriptArtifactAnalysisTypes() {
|
|
3609
|
+
return (init_JavaScriptArtifactAnalysisTypes = __esmMin((() => {
|
|
3610
|
+
javascriptArtifactAnalysisScopes = {
|
|
3611
|
+
javascript: {
|
|
3612
|
+
operation: "analyze-javascript-source",
|
|
3613
|
+
authority: "ast-static-analysis"
|
|
3614
|
+
},
|
|
3615
|
+
"package-json": {
|
|
3616
|
+
operation: "parse-package-json",
|
|
3617
|
+
authority: "artifact-bytes"
|
|
3618
|
+
},
|
|
3619
|
+
json: {
|
|
3620
|
+
operation: "parse-json-module",
|
|
3621
|
+
authority: "artifact-bytes"
|
|
3622
|
+
},
|
|
3623
|
+
html: {
|
|
3624
|
+
operation: "parse-html-script-references",
|
|
3625
|
+
authority: "artifact-bytes"
|
|
3626
|
+
},
|
|
3627
|
+
"source-map": {
|
|
3628
|
+
operation: "parse-local-source-map",
|
|
3629
|
+
authority: "artifact-bytes"
|
|
3630
|
+
},
|
|
3631
|
+
"native-addon": null
|
|
3632
|
+
};
|
|
3633
|
+
isSkippedJavaScriptAnalysis = (entry) => entry.file.kind === "javascript" && entry.file.text.included && entry.javascript === null && entry.analysis_failure !== undefined;
|
|
3634
|
+
})))();
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3044
3637
|
//#endregion
|
|
3045
3638
|
//#region dist/application/javascript/JavaScriptJsonModules.js
|
|
3046
3639
|
var analyzeJavaScriptJsonModule;
|
|
@@ -3221,8 +3814,7 @@ function* analyzeArtifactFileSteps(file, context) {
|
|
|
3221
3814
|
state.parseFailures += 1;
|
|
3222
3815
|
return;
|
|
3223
3816
|
}
|
|
3224
|
-
const
|
|
3225
|
-
const analysis = yield* analyzeParsedJavaScriptStaticSourceSteps(file.text.value, parsed, openReceiverFacts);
|
|
3817
|
+
const analysis = yield* analyzeParsedJavaScriptStaticSourceSteps(file.text.value, parsed);
|
|
3226
3818
|
const staticFindings = findingCount(analysis);
|
|
3227
3819
|
yield;
|
|
3228
3820
|
const semantics = analysis.parse_status === "complete" || analysis.parse_status === "partial" ? yield* analyzeParsedJavaScriptSemanticsSteps(parsed, moduleResolutionModeForJavaScriptReference(file.path, "static-import")) : null;
|
|
@@ -3249,6 +3841,7 @@ function init_JavaScriptArtifactAnalysis() {
|
|
|
3249
3841
|
init_sourceMapContents();
|
|
3250
3842
|
init_sourceMapEnvelope();
|
|
3251
3843
|
init_javascriptStaticAnalysisHelpers();
|
|
3844
|
+
init_JavaScriptArtifactAnalysisTypes();
|
|
3252
3845
|
init_JavaScriptJsonModules();
|
|
3253
3846
|
init_JavaScriptAnalysisControl();
|
|
3254
3847
|
init_htmlArtifactReferences();
|
|
@@ -3283,6 +3876,7 @@ function init_JavaScriptArtifactAnalysis() {
|
|
|
3283
3876
|
const selectedFileCount = fileSet.files.length - (fileSet.source_selection?.unselected_files ?? 0);
|
|
3284
3877
|
let selectedFileIndex = 0;
|
|
3285
3878
|
for (const file of fileSet.files) {
|
|
3879
|
+
let analysisStarted = false;
|
|
3286
3880
|
try {
|
|
3287
3881
|
await setImmediate();
|
|
3288
3882
|
if (classifyOutsideAnalysisScope(file, state, projection)) {
|
|
@@ -3294,6 +3888,7 @@ function init_JavaScriptArtifactAnalysis() {
|
|
|
3294
3888
|
}
|
|
3295
3889
|
if (signal?.aborted === true) throw new AnalysisCancelledError("analyze_javascript_application");
|
|
3296
3890
|
await beforeFile(file, selectedFileIndex++, selectedFileCount);
|
|
3891
|
+
analysisStarted = true;
|
|
3297
3892
|
if (file.kind !== "javascript" || !file.text.included) {
|
|
3298
3893
|
const steps = analyzeArtifactFileSteps(file, {
|
|
3299
3894
|
state,
|
|
@@ -3305,13 +3900,15 @@ function init_JavaScriptArtifactAnalysis() {
|
|
|
3305
3900
|
await completeJavaScriptAnalysisSteps(steps, signal);
|
|
3306
3901
|
continue;
|
|
3307
3902
|
}
|
|
3308
|
-
const result = await worker.analyze(file, projection.
|
|
3903
|
+
const result = await worker.analyze(file, projection.remainingFileCapacity(), signal);
|
|
3309
3904
|
const facts = result.ok ? result.value : result.error;
|
|
3310
3905
|
const applicationProjectionFailure = facts.applicationProjectionFailure;
|
|
3311
3906
|
if (facts.projection !== null) projection.adoptFileProjection(facts.projection);
|
|
3312
3907
|
const error = result.ok ? null : result.error.error;
|
|
3313
3908
|
const limits = error instanceof AnalysisResourceConstraintError ? error.reportedLimits : error instanceof AnalysisTimeoutError ? { worker_timeout_ms: error.timeoutMs } : null;
|
|
3314
3909
|
const failure = error === null ? undefined : {
|
|
3910
|
+
scope: javascriptArtifactAnalysisScopes.javascript,
|
|
3911
|
+
status: "interrupted",
|
|
3315
3912
|
reason: `${file.path}: ${error.message}`,
|
|
3316
3913
|
error: projectAnalysisError(error),
|
|
3317
3914
|
limits
|
|
@@ -3342,15 +3939,18 @@ function init_JavaScriptArtifactAnalysis() {
|
|
|
3342
3939
|
if (signal?.aborted !== true && !(cause instanceof AnalysisError)) throw cause;
|
|
3343
3940
|
interruption = signal?.aborted === true ? new AnalysisCancelledError("analyze_javascript_application") : cause instanceof AnalysisError ? cause : null;
|
|
3344
3941
|
if (interruption !== null) {
|
|
3942
|
+
const scope = javascriptArtifactAnalysisScopes[file.kind];
|
|
3345
3943
|
state.files.push({
|
|
3346
3944
|
file,
|
|
3347
3945
|
javascript: null,
|
|
3348
3946
|
semantic: null,
|
|
3349
|
-
analysis_failure: {
|
|
3947
|
+
...scope === null ? {} : { analysis_failure: {
|
|
3948
|
+
scope,
|
|
3949
|
+
status: analysisStarted ? "interrupted" : "not-started",
|
|
3350
3950
|
reason: `${file.path}: ${interruption.message}`,
|
|
3351
3951
|
error: projectAnalysisError(interruption),
|
|
3352
3952
|
limits: null
|
|
3353
|
-
}
|
|
3953
|
+
} }
|
|
3354
3954
|
});
|
|
3355
3955
|
projection.recordUnavailableFile(file, interruption.message, null, "incomplete-module");
|
|
3356
3956
|
}
|
|
@@ -3364,16 +3964,27 @@ function init_JavaScriptArtifactAnalysis() {
|
|
|
3364
3964
|
error: projectAnalysisError(interruption),
|
|
3365
3965
|
limits: interruption instanceof AnalysisResourceConstraintError ? interruption.reportedLimits : interruption instanceof AnalysisTimeoutError ? { worker_timeout_ms: interruption.timeoutMs } : null
|
|
3366
3966
|
};
|
|
3967
|
+
const failures = new Map();
|
|
3367
3968
|
for (const file of fileSet.files) {
|
|
3368
3969
|
if (analyzedPaths.has(file.path)) continue;
|
|
3369
3970
|
if (classifyOutsideAnalysisScope(file, state, projection)) continue;
|
|
3971
|
+
const scope = javascriptArtifactAnalysisScopes[file.kind];
|
|
3972
|
+
let unavailable = scope === null ? undefined : failures.get(scope);
|
|
3973
|
+
if (scope !== null && unavailable === undefined) {
|
|
3974
|
+
unavailable = {
|
|
3975
|
+
...failure,
|
|
3976
|
+
scope,
|
|
3977
|
+
status: "not-started"
|
|
3978
|
+
};
|
|
3979
|
+
failures.set(scope, unavailable);
|
|
3980
|
+
}
|
|
3370
3981
|
state.files.push({
|
|
3371
3982
|
file,
|
|
3372
3983
|
javascript: null,
|
|
3373
3984
|
semantic: null,
|
|
3374
|
-
analysis_failure:
|
|
3985
|
+
...unavailable === undefined ? {} : { analysis_failure: unavailable }
|
|
3375
3986
|
});
|
|
3376
|
-
|
|
3987
|
+
projection.recordUnavailableFile(file, failure.reason, failure.limits, interruption instanceof AnalysisResourceConstraintError || interruption instanceof AnalysisTimeoutError ? "resource-limit" : "incomplete-module");
|
|
3377
3988
|
}
|
|
3378
3989
|
}
|
|
3379
3990
|
return {
|
|
@@ -3420,7 +4031,7 @@ function init_JavaScriptArtifactAnalysis() {
|
|
|
3420
4031
|
javascript: null,
|
|
3421
4032
|
semantic: null
|
|
3422
4033
|
});
|
|
3423
|
-
|
|
4034
|
+
projection?.recordUnavailableFile(file, "Source was not analyzed because it is outside the caller-selected source_paths.", null, "incomplete-module");
|
|
3424
4035
|
return true;
|
|
3425
4036
|
};
|
|
3426
4037
|
addSourceMap = (file, context) => {
|
|
@@ -3609,9 +4220,9 @@ function init_javascriptApplicationProjectionResources() {
|
|
|
3609
4220
|
var range, count, strings, pathContext, findingContext, withRuntime, staticValue, nullHandler, missingHandler, locatedHandler, ipcChannel, ipc, windowShape, bridgeShape, utilityShape, electron, referenceShape, javaScriptWorkerStaticAnalysisSchema, resourceLimit, primitive, property, semanticValue, origin, provenance, coverage, moduleLink, definitionKind, scope, binding, callable, javaScriptWorkerGraphRecordSchema, javaScriptWorkerProjectionHeaderSchema, javaScriptWorkerModuleRecordSchema, javaScriptWorkerModuleHeaderSchema;
|
|
3610
4221
|
function init_JavaScriptAnalysisWorkerSchemas() {
|
|
3611
4222
|
return (init_JavaScriptAnalysisWorkerSchemas = __esmMin((() => {
|
|
4223
|
+
init_javascriptSemanticGraphSchemas();
|
|
3612
4224
|
init_digests();
|
|
3613
4225
|
init_javascriptStaticAnalysisTypes();
|
|
3614
|
-
init_javascriptSemanticGraphSchemas();
|
|
3615
4226
|
range = javaScriptSemanticNodeSchema.shape.identity.shape.source_range.unwrap();
|
|
3616
4227
|
count = z.number().int().nonnegative();
|
|
3617
4228
|
strings = z.array(z.string());
|
|
@@ -3741,7 +4352,8 @@ function init_JavaScriptAnalysisWorkerSchemas() {
|
|
|
3741
4352
|
web_preferences: z.array(z.strictObject({
|
|
3742
4353
|
name: z.string(),
|
|
3743
4354
|
value: staticValue
|
|
3744
|
-
}))
|
|
4355
|
+
})),
|
|
4356
|
+
resolution_sources: z.array(range).exactOptional()
|
|
3745
4357
|
};
|
|
3746
4358
|
bridgeShape = {
|
|
3747
4359
|
resolution_basis: z.literal("wrapper-substitution").optional(),
|
|
@@ -3897,7 +4509,8 @@ function init_JavaScriptAnalysisWorkerSchemas() {
|
|
|
3897
4509
|
kind: z.enum(["route", "network"]),
|
|
3898
4510
|
value: z.string(),
|
|
3899
4511
|
mechanism: z.string(),
|
|
3900
|
-
interpretation: z.literal("candidate").exactOptional()
|
|
4512
|
+
interpretation: z.literal("candidate").exactOptional(),
|
|
4513
|
+
resolution: z.literal("partial").exactOptional()
|
|
3901
4514
|
})),
|
|
3902
4515
|
storage: z.array(z.strictObject({
|
|
3903
4516
|
...findingContext,
|
|
@@ -3908,6 +4521,7 @@ function init_JavaScriptAnalysisWorkerSchemas() {
|
|
|
3908
4521
|
"cache-storage",
|
|
3909
4522
|
"sqlite"
|
|
3910
4523
|
]),
|
|
4524
|
+
interpretation: z.literal("candidate").exactOptional(),
|
|
3911
4525
|
name: z.string().nullable(),
|
|
3912
4526
|
mechanism: z.string()
|
|
3913
4527
|
})),
|
|
@@ -3972,7 +4586,8 @@ function init_JavaScriptAnalysisWorkerSchemas() {
|
|
|
3972
4586
|
resourceLimit = z.enum([
|
|
3973
4587
|
"primitive-candidates",
|
|
3974
4588
|
"primitive-bytes",
|
|
3975
|
-
"expression-depth"
|
|
4589
|
+
"expression-depth",
|
|
4590
|
+
"getter-expansion"
|
|
3976
4591
|
]);
|
|
3977
4592
|
primitive = z.union([
|
|
3978
4593
|
z.string(),
|
|
@@ -4201,8 +4816,9 @@ function init_JavaScriptAnalysisWorkerSchemas() {
|
|
|
4201
4816
|
})
|
|
4202
4817
|
]);
|
|
4203
4818
|
javaScriptWorkerProjectionHeaderSchema = z.strictObject({
|
|
4819
|
+
omittedUnknownOccurrences: javaScriptSemanticUnknownOmissionsSchema.exactOptional(),
|
|
4204
4820
|
roots: z.array(javaScriptSemanticNodeSchema.shape.node_id),
|
|
4205
|
-
|
|
4821
|
+
nodesTruncated: z.boolean()
|
|
4206
4822
|
});
|
|
4207
4823
|
javaScriptWorkerModuleRecordSchema = z.discriminatedUnion("kind", [
|
|
4208
4824
|
z.strictObject({
|
|
@@ -4256,7 +4872,11 @@ function* moduleTransferRecords(module) {
|
|
|
4256
4872
|
value
|
|
4257
4873
|
};
|
|
4258
4874
|
}
|
|
4259
|
-
async function readJavaScriptAnalysisTransfer(path, descriptor, source, signal,
|
|
4875
|
+
async function readJavaScriptAnalysisTransfer(path, descriptor, source, signal, capacity = {
|
|
4876
|
+
nodes: JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM,
|
|
4877
|
+
unknowns: JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM
|
|
4878
|
+
}) {
|
|
4879
|
+
if (capacity !== null && [capacity.nodes, capacity.unknowns].some((value) => !Number.isSafeInteger(value) || value < 0 || value > 1e6)) throw new RangeError("JavaScript transfer requires valid retained capacities");
|
|
4260
4880
|
const expected = javaScriptAnalysisTransferDescriptorSchema.parse(descriptor);
|
|
4261
4881
|
if ((await stat(path)).size !== expected.bytes) throw new TypeError("JavaScript analysis transfer byte count does not match");
|
|
4262
4882
|
const scopes = [];
|
|
@@ -4329,7 +4949,7 @@ async function readJavaScriptAnalysisTransfer(path, descriptor, source, signal,
|
|
|
4329
4949
|
moduleHeader = record.value;
|
|
4330
4950
|
} else {
|
|
4331
4951
|
if (projectionHeader === undefined || moduleHeader === undefined) throw new TypeError("JavaScript transfer facts precede their headers");
|
|
4332
|
-
if (
|
|
4952
|
+
if (capacity === null && [
|
|
4333
4953
|
"evidence-context",
|
|
4334
4954
|
"node",
|
|
4335
4955
|
"relation",
|
|
@@ -4363,6 +4983,7 @@ async function readJavaScriptAnalysisTransfer(path, descriptor, source, signal,
|
|
|
4363
4983
|
case "node": {
|
|
4364
4984
|
retainIdentity(record.kind, record.value.node_id);
|
|
4365
4985
|
if (record.value.identity.artifact_sha256 !== source.sha256 || record.value.identity.module_path !== source.path) throw new TypeError("JavaScript transfer node belongs to a different artifact source");
|
|
4986
|
+
if (capacity !== null && nodes.length >= capacity.nodes) throw new TypeError("JavaScript transfer nodes exceed the offered capacity");
|
|
4366
4987
|
nodes.push(record.value);
|
|
4367
4988
|
break;
|
|
4368
4989
|
}
|
|
@@ -4372,6 +4993,7 @@ async function readJavaScriptAnalysisTransfer(path, descriptor, source, signal,
|
|
|
4372
4993
|
break;
|
|
4373
4994
|
case "unknown":
|
|
4374
4995
|
retainIdentity(record.kind, record.value.unknown_id);
|
|
4996
|
+
if (capacity !== null && unknowns.length >= capacity.unknowns) throw new TypeError("JavaScript transfer unknowns exceed the offered capacity");
|
|
4375
4997
|
unknowns.push(record.value);
|
|
4376
4998
|
break;
|
|
4377
4999
|
case "fingerprint":
|
|
@@ -4397,7 +5019,7 @@ async function readJavaScriptAnalysisTransfer(path, descriptor, source, signal,
|
|
|
4397
5019
|
callables,
|
|
4398
5020
|
moduleLinks
|
|
4399
5021
|
},
|
|
4400
|
-
projection:
|
|
5022
|
+
projection: capacity !== null ? {
|
|
4401
5023
|
...projectionHeader,
|
|
4402
5024
|
evidenceContexts,
|
|
4403
5025
|
nodes,
|
|
@@ -4411,6 +5033,7 @@ var JAVASCRIPT_ANALYSIS_TRANSFER_RECORD_BYTES, FRAME_BYTES, TRANSFER_BYTES, MAX_
|
|
|
4411
5033
|
function init_JavaScriptAnalysisTransfer() {
|
|
4412
5034
|
return (init_JavaScriptAnalysisTransfer = __esmMin((() => {
|
|
4413
5035
|
init_analysisErrorCore();
|
|
5036
|
+
init_javascriptAnalysisResourceControls();
|
|
4414
5037
|
init_digests();
|
|
4415
5038
|
init_JavaScriptAnalysisWorkerSchemas();
|
|
4416
5039
|
JAVASCRIPT_ANALYSIS_TRANSFER_RECORD_BYTES = 8 * 1024 * 1024;
|
|
@@ -4520,7 +5143,8 @@ function init_JavaScriptAnalysisTransfer() {
|
|
|
4520
5143
|
kind: "projection-header",
|
|
4521
5144
|
value: {
|
|
4522
5145
|
roots: projection.roots,
|
|
4523
|
-
|
|
5146
|
+
nodesTruncated: projection.nodesTruncated,
|
|
5147
|
+
...projection.omittedUnknownOccurrences === undefined ? {} : { omittedUnknownOccurrences: projection.omittedUnknownOccurrences }
|
|
4524
5148
|
}
|
|
4525
5149
|
});
|
|
4526
5150
|
for (const record of moduleTransferRecords(module)) await append(record);
|
|
@@ -4578,7 +5202,8 @@ function init_JavaScriptAnalysisWorkerProtocol() {
|
|
|
4578
5202
|
};
|
|
4579
5203
|
javaScriptWorkerRequestSchema = z.strictObject({
|
|
4580
5204
|
id: z.uuid(),
|
|
4581
|
-
|
|
5205
|
+
unknown_budget: z.number().int().min(0).max(JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM),
|
|
5206
|
+
node_budget: z.number().int().min(0).max(JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM),
|
|
4582
5207
|
text_sha256: digestSchema,
|
|
4583
5208
|
file: z.strictObject({
|
|
4584
5209
|
path: z.string(),
|
|
@@ -4714,7 +5339,7 @@ function init_JavaScriptAnalysisWorker() {
|
|
|
4714
5339
|
this.#resultBudgetBytes = Math.max(0, Math.floor((getHeapStatistics().heap_size_limit - process.memoryUsage().heapUsed - 24 * JAVASCRIPT_ANALYSIS_TRANSFER_RECORD_BYTES) / 2));
|
|
4715
5340
|
}
|
|
4716
5341
|
/** Analyze inert source; hard worker failure does not terminate this process. */
|
|
4717
|
-
async analyze(file,
|
|
5342
|
+
async analyze(file, capacity, signal) {
|
|
4718
5343
|
let javascript = null;
|
|
4719
5344
|
let module = null;
|
|
4720
5345
|
let projection = null;
|
|
@@ -4746,7 +5371,8 @@ function init_JavaScriptAnalysisWorker() {
|
|
|
4746
5371
|
let offeredResultBudget = 0;
|
|
4747
5372
|
const request = javaScriptWorkerRequestSchema.parse({
|
|
4748
5373
|
id,
|
|
4749
|
-
node_budget:
|
|
5374
|
+
node_budget: capacity.nodes,
|
|
5375
|
+
unknown_budget: capacity.unknowns,
|
|
4750
5376
|
text_sha256: createHash("sha256").update(file.text.value).digest("hex"),
|
|
4751
5377
|
file: metadata
|
|
4752
5378
|
});
|
|
@@ -4823,7 +5449,7 @@ function init_JavaScriptAnalysisWorker() {
|
|
|
4823
5449
|
}
|
|
4824
5450
|
const retainGraph = moduleEstimate + graphEstimate <= remaining;
|
|
4825
5451
|
this.#phase = "result-admission";
|
|
4826
|
-
const decoded = await readJavaScriptAnalysisTransfer(join(root.path, `${id}.records`), descriptor, file, deadline.signal, retainGraph);
|
|
5452
|
+
const decoded = await readJavaScriptAnalysisTransfer(join(root.path, `${id}.records`), descriptor, file, deadline.signal, retainGraph ? capacity : null);
|
|
4827
5453
|
module = decoded.module;
|
|
4828
5454
|
projection = decoded.projection;
|
|
4829
5455
|
this.#estimatedRetainedBytes += moduleEstimate + (retainGraph ? graphEstimate : 0);
|
|
@@ -5285,7 +5911,10 @@ function init_JavaScriptArtifactFiles() {
|
|
|
5285
5911
|
resource
|
|
5286
5912
|
});
|
|
5287
5913
|
if (cleanup.kind === "failed") {
|
|
5288
|
-
failure = { cause:
|
|
5914
|
+
failure = { cause: context.resources.cleanupFailure(failure === undefined ? { kind: "completed" } : {
|
|
5915
|
+
kind: "failed",
|
|
5916
|
+
cause: failure.cause
|
|
5917
|
+
}, [cleanup]) };
|
|
5289
5918
|
}
|
|
5290
5919
|
}
|
|
5291
5920
|
}
|
|
@@ -5565,7 +6194,7 @@ function init_JavaScriptArtifactGraphAccumulator() {
|
|
|
5565
6194
|
|
|
5566
6195
|
//#endregion
|
|
5567
6196
|
//#region dist/application/javascript/JavaScriptArtifactGraphEvidence.js
|
|
5568
|
-
var EXTRACTOR, artifactObservationEvidence, astObservationEvidence, staticInferenceEvidence,
|
|
6197
|
+
var EXTRACTOR, artifactObservationEvidence, astObservationEvidence, staticInferenceEvidence, unavailableStaticEvidence, artifactReference;
|
|
5569
6198
|
function init_JavaScriptArtifactGraphEvidence() {
|
|
5570
6199
|
return (init_JavaScriptArtifactGraphEvidence = __esmMin((() => {
|
|
5571
6200
|
EXTRACTOR = {
|
|
@@ -5644,8 +6273,8 @@ function init_JavaScriptArtifactGraphEvidence() {
|
|
|
5644
6273
|
limitations: ["Static syntax does not prove that this relationship executes at runtime.", ...input.limitations ?? []],
|
|
5645
6274
|
evidence_ids: []
|
|
5646
6275
|
});
|
|
5647
|
-
|
|
5648
|
-
authority:
|
|
6276
|
+
unavailableStaticEvidence = (input) => ({
|
|
6277
|
+
authority: input.authority,
|
|
5649
6278
|
state: "unavailable",
|
|
5650
6279
|
confidence: "unknown",
|
|
5651
6280
|
artifact: artifactReference(input.sha256),
|
|
@@ -5733,7 +6362,7 @@ function* packageLookupDirectories(input) {
|
|
|
5733
6362
|
directory = posix.dirname(directory);
|
|
5734
6363
|
}
|
|
5735
6364
|
}
|
|
5736
|
-
var moduleResolutionModeProperties, EXTENSIONS, PACKAGE_ARTIFACT_ROOT_URL, encodePackageMetadataUrl, packageMetadataUrl, resolveArtifactPathByContext, artifactPathResolutionProperties, conditionalResolution, resolvePath, resolveExactUrlResource, isRuntimePathDeclaration, resolveNodeRuntimeEntrypoint, resolveRuntimeEntrypoint, resolveRuntimeSourceCandidates, rejectDeclaration, declaresLiteralPercent, contextualCandidate, decodeModuleUrlPath, relativeCandidate, bareModuleCandidate, enclosingPackageMetadata, resolvePackageImportAlias, packageSelfCandidate, resolvePackageDependency, resolveLegacyEsmSubpath, resolvePackageExports, resolveExportTarget, parseBarePackageRequest, hasContainerDirectory, htmlCandidate, exactUrlPathCandidate, urlPathIsDirectory,
|
|
6365
|
+
var moduleResolutionModeProperties, EXTENSIONS, PACKAGE_ARTIFACT_ROOT_URL, encodePackageMetadataUrl, packageMetadataUrl, resolveArtifactPathByContext, artifactPathResolutionProperties, conditionalResolution, resolvePath, resolveExactUrlResource, isRuntimePathDeclaration, resolveNodeRuntimeEntrypoint, resolveRuntimeEntrypoint, resolveRuntimeSourceCandidates, rejectDeclaration, declaresLiteralPercent, contextualCandidate, decodeModuleUrlPath, relativeCandidate, urlDirectoryState, applyUrlReference, urlBaseDirectory, urlPathCandidate, urlRelativeCandidate, bareModuleCandidate, enclosingPackageMetadata, resolvePackageImportAlias, packageSelfCandidate, resolvePackageDependency, resolveLegacyEsmSubpath, resolvePackageExports, resolveExportTarget, parseBarePackageRequest, hasContainerDirectory, htmlCandidate, exactUrlPathCandidate, urlPathIsDirectory, confineCandidate, readPackageMetadata, resolveCandidate, commonJsDirectoryRequest, resolveDirectory, resolveNodePackageMain, resolveFileCandidates, findFileCandidate, isRuntimeDeclarationPath, NODE_MODULE_EXTENSIONS, NODE_PACKAGE_MAIN_SUFFIXES, fileCandidates, indexCandidates, selectPackageExport, invalidExportTarget, forbiddenExportSegment, selectStringPackageTarget, selectArrayPackageTarget, selectExportTarget, packageExportConditions, notFoundCandidate, exactPackageTargetNotFound, fileUrlPath, unresolvedCandidate;
|
|
5737
6366
|
function init_JavaScriptArtifactPathResolution() {
|
|
5738
6367
|
return (init_JavaScriptArtifactPathResolution = __esmMin((() => {
|
|
5739
6368
|
init_artifactIdentity();
|
|
@@ -5961,11 +6590,14 @@ function init_JavaScriptArtifactPathResolution() {
|
|
|
5961
6590
|
if (/^\/[A-Za-z]:(?:\/|$)/u.test(fileReference.pathname)) return unresolvedCandidate("unavailable", ["Drive-letter URL paths cannot be mapped without the source URL scheme and filesystem root."]);
|
|
5962
6591
|
const decoded = percentDecodeUrlPath(declared);
|
|
5963
6592
|
if (decoded === null) return unresolvedCandidate("rejected", ["The URL reference path percent-decodes to NUL or to bytes that are not UTF-8."]);
|
|
5964
|
-
|
|
5965
|
-
return exactUrlPathCandidate(decoded,
|
|
6593
|
+
const candidate = urlRelativeCandidate(posix.dirname(input.sourcePath), decoded);
|
|
6594
|
+
return typeof candidate === "string" ? exactUrlPathCandidate(decoded, candidate, "URL") : candidate;
|
|
5966
6595
|
}
|
|
5967
|
-
|
|
5968
|
-
|
|
6596
|
+
if (context === "module-specifier" && input.moduleKind === "import") {
|
|
6597
|
+
const candidate = urlRelativeCandidate(posix.dirname(input.sourcePath), declared);
|
|
6598
|
+
return typeof candidate === "string" ? exactUrlPathCandidate(declared, candidate, "module URL") : candidate;
|
|
6599
|
+
}
|
|
6600
|
+
return relativeCandidate(input.sourcePath, declared);
|
|
5969
6601
|
};
|
|
5970
6602
|
decodeModuleUrlPath = (declared) => {
|
|
5971
6603
|
let decoded;
|
|
@@ -5978,6 +6610,39 @@ function init_JavaScriptArtifactPathResolution() {
|
|
|
5978
6610
|
return decoded.includes("\0") ? unresolvedCandidate("rejected", ["The decoded module URL path contains NUL."]) : decoded;
|
|
5979
6611
|
};
|
|
5980
6612
|
relativeCandidate = (sourcePath, declared) => declared.startsWith("/") ? declared.slice(1) : posix.join(posix.dirname(sourcePath), declared);
|
|
6613
|
+
urlDirectoryState = (directory) => ({
|
|
6614
|
+
escapes: 0,
|
|
6615
|
+
segments: directory === "" || directory === "." ? [] : directory.split("/")
|
|
6616
|
+
});
|
|
6617
|
+
applyUrlReference = (base, reference) => {
|
|
6618
|
+
const absolute = reference.startsWith("/");
|
|
6619
|
+
const segments = absolute ? [] : [...base.segments];
|
|
6620
|
+
let escapes = absolute ? 0 : base.escapes;
|
|
6621
|
+
const parts = (absolute ? reference.slice(1) : reference).split("/");
|
|
6622
|
+
for (const [index, part] of parts.entries()) {
|
|
6623
|
+
if (part !== "." && part !== "..") {
|
|
6624
|
+
segments.push(part);
|
|
6625
|
+
continue;
|
|
6626
|
+
}
|
|
6627
|
+
if (part === "..") if (segments.length > 0) segments.pop();
|
|
6628
|
+
else escapes += 1;
|
|
6629
|
+
if (index === parts.length - 1) segments.push("");
|
|
6630
|
+
}
|
|
6631
|
+
return {
|
|
6632
|
+
escapes,
|
|
6633
|
+
segments
|
|
6634
|
+
};
|
|
6635
|
+
};
|
|
6636
|
+
urlBaseDirectory = (base) => ({
|
|
6637
|
+
escapes: base.escapes,
|
|
6638
|
+
segments: base.segments.slice(0, -1)
|
|
6639
|
+
});
|
|
6640
|
+
urlPathCandidate = (path) => {
|
|
6641
|
+
const segments = path.segments.at(-1) === "" ? path.segments.slice(0, -1) : path.segments;
|
|
6642
|
+
if (segments.includes("")) return unresolvedCandidate("unavailable", ["Repeated URL path separators cannot be mapped to an exact canonical artifact file."]);
|
|
6643
|
+
return [...Array.from({ length: path.escapes }, () => ".."), ...segments].join("/");
|
|
6644
|
+
};
|
|
6645
|
+
urlRelativeCandidate = (directory, reference) => urlPathCandidate(applyUrlReference(urlDirectoryState(directory), reference));
|
|
5981
6646
|
bareModuleCandidate = (input) => {
|
|
5982
6647
|
const request = parseBarePackageRequest(input.declaredPath, input.moduleKind);
|
|
5983
6648
|
if (request === null || isBuiltin(input.declaredPath)) return unresolvedCandidate("external", ["The bare specifier is a Node builtin or invalid package name."]);
|
|
@@ -6118,11 +6783,15 @@ function init_JavaScriptArtifactPathResolution() {
|
|
|
6118
6783
|
parseBarePackageRequest = (specifier, moduleKind) => {
|
|
6119
6784
|
const segments = specifier.split("/");
|
|
6120
6785
|
let packageName = segments[0] ?? "";
|
|
6121
|
-
if (packageName === "") return null;
|
|
6786
|
+
if (packageName === "" || packageName === "@") return null;
|
|
6122
6787
|
if (specifier.startsWith("@")) {
|
|
6123
6788
|
const packageSegment = segments[1];
|
|
6124
|
-
if (packageSegment
|
|
6125
|
-
|
|
6789
|
+
if (packageSegment !== undefined && packageSegment !== "") {
|
|
6790
|
+
packageName = `${packageName}/${packageSegment}`;
|
|
6791
|
+
} else if (moduleKind !== "require") {
|
|
6792
|
+
if (packageSegment === undefined) return null;
|
|
6793
|
+
packageName = `${packageName}/`;
|
|
6794
|
+
}
|
|
6126
6795
|
}
|
|
6127
6796
|
const dependencyExportsEligible = moduleKind !== "require" || /^((?:@[^/\\%]+\/)?[^./\\%][^/\\%]*)(\/.*)?$/.exec(specifier)?.[1] === packageName;
|
|
6128
6797
|
return {
|
|
@@ -6151,14 +6820,17 @@ function init_JavaScriptArtifactPathResolution() {
|
|
|
6151
6820
|
if (base !== undefined && base !== null && looksExternal(base)) return unresolvedCandidate("external", ["The document base href is external, so its script reference is not a local artifact path."]);
|
|
6152
6821
|
const declaredPath = percentDecodeUrlPath(declared);
|
|
6153
6822
|
if (declaredPath === null) return unresolvedCandidate("rejected", ["The HTML reference path percent-decodes to NUL or to bytes that are not UTF-8."]);
|
|
6154
|
-
if (declaredPath.startsWith("/")) return declaredPath
|
|
6155
|
-
if (base === undefined || base === null || base === "") return declaredPath === "" ? input.sourcePath :
|
|
6823
|
+
if (declaredPath.startsWith("/")) return urlRelativeCandidate("", declaredPath);
|
|
6824
|
+
if (base === undefined || base === null || base === "") return declaredPath === "" ? input.sourcePath : urlRelativeCandidate(posix.dirname(input.sourcePath), declaredPath);
|
|
6156
6825
|
if (!admitsCanonicalPathSyntax(base)) return unresolvedCandidate("rejected", ["The document base href uses NUL, backslash, or encoded dot and separator bytes that are not admitted for canonical artifact paths."]);
|
|
6157
6826
|
const decodedBase = percentDecodeUrlPath(base);
|
|
6158
6827
|
if (decodedBase === null) return unresolvedCandidate("rejected", ["The document base href path percent-decodes to NUL or to bytes that are not UTF-8."]);
|
|
6159
|
-
const
|
|
6160
|
-
if (declaredPath === "")
|
|
6161
|
-
|
|
6828
|
+
const baseState = applyUrlReference(urlDirectoryState(posix.dirname(input.sourcePath)), decodedBase);
|
|
6829
|
+
if (declaredPath === "") {
|
|
6830
|
+
const basePath = urlPathCandidate(baseState);
|
|
6831
|
+
return typeof basePath === "string" ? exactUrlPathCandidate(decodedBase, basePath, "HTML") : basePath;
|
|
6832
|
+
}
|
|
6833
|
+
return urlPathCandidate(applyUrlReference(urlBaseDirectory(baseState), declaredPath));
|
|
6162
6834
|
};
|
|
6163
6835
|
exactUrlPathCandidate = (declared, candidate, kind) => {
|
|
6164
6836
|
if (!urlPathIsDirectory(declared)) return candidate;
|
|
@@ -6167,7 +6839,6 @@ function init_JavaScriptArtifactPathResolution() {
|
|
|
6167
6839
|
return unresolvedCandidate("not-found", [`The ${kind} reference resolves to directory ${confined || "."}, not an exact selected application file.`]);
|
|
6168
6840
|
};
|
|
6169
6841
|
urlPathIsDirectory = (path) => path.endsWith("/") || path.endsWith("/.") || path.endsWith("/..") || path === "." || path === "..";
|
|
6170
|
-
htmlBaseDirectory = (base, basePath) => urlPathIsDirectory(base) ? basePath : posix.dirname(basePath);
|
|
6171
6842
|
confineCandidate = (candidate) => {
|
|
6172
6843
|
const normalized = normalizeJoinedLogicalPath(candidate);
|
|
6173
6844
|
if (logicalPathEscapesRoot(normalized)) return unresolvedCandidate("rejected", ["The resolved candidate escapes the canonical artifact root."]);
|
|
@@ -6569,7 +7240,8 @@ function init_JavaScriptArtifactGraphContext() {
|
|
|
6569
7240
|
limitation: input.limitation,
|
|
6570
7241
|
...input.failure === undefined ? {} : { analysis_failure: input.failure }
|
|
6571
7242
|
},
|
|
6572
|
-
evidence:
|
|
7243
|
+
evidence: unavailableStaticEvidence({
|
|
7244
|
+
authority: input.authority,
|
|
6573
7245
|
sha256: input.file.sha256,
|
|
6574
7246
|
path: input.file.path,
|
|
6575
7247
|
operation: input.operation,
|
|
@@ -6977,18 +7649,25 @@ function init_JavaScriptArtifactGraphFindings() {
|
|
|
6977
7649
|
const source = sourceNodeFor(context, input.file.path, input.value.module_key, input.value.module_runtime) ?? input.asset;
|
|
6978
7650
|
const key = compactStringIdentityKey(input.value.value);
|
|
6979
7651
|
const candidate = input.value.interpretation === "candidate";
|
|
7652
|
+
const partial = input.value.resolution === "partial";
|
|
6980
7653
|
const candidateLimitation = "The unbound method-like argument is only a candidate; its receiver does not establish a network call.";
|
|
7654
|
+
const partialLimitation = "The request target is not an exact literal; the endpoint value retains the unresolved source expression.";
|
|
6981
7655
|
const label = `${input.value.kind} ${candidate ? "endpoint candidate" : "endpoint"}`;
|
|
6982
7656
|
const node = context.accumulator.addNode({
|
|
6983
7657
|
kind: "endpoint",
|
|
6984
|
-
identity: artifactLocalIdentity(input.file.sha256, input.value.kind, JSON.stringify([
|
|
7658
|
+
identity: artifactLocalIdentity(input.file.sha256, input.value.kind, JSON.stringify([
|
|
7659
|
+
input.value.interpretation ?? "literal",
|
|
7660
|
+
...partial ? ["partial", input.value.location] : [],
|
|
7661
|
+
key
|
|
7662
|
+
])),
|
|
6985
7663
|
observations: [{
|
|
6986
7664
|
label: input.value.value.length <= label.length ? input.value.value : label,
|
|
6987
7665
|
properties: {
|
|
6988
7666
|
endpoint_kind: input.value.kind,
|
|
6989
7667
|
value: input.value.value,
|
|
6990
7668
|
mechanism: input.value.mechanism,
|
|
6991
|
-
...candidate ? { interpretation: input.value.interpretation } : {}
|
|
7669
|
+
...candidate ? { interpretation: input.value.interpretation } : {},
|
|
7670
|
+
...partial ? { resolution: input.value.resolution } : {}
|
|
6992
7671
|
},
|
|
6993
7672
|
evidence: candidate ? staticInferenceEvidence({
|
|
6994
7673
|
sha256: input.file.sha256,
|
|
@@ -7003,7 +7682,8 @@ function init_JavaScriptArtifactGraphFindings() {
|
|
|
7003
7682
|
path: input.file.path,
|
|
7004
7683
|
range: input.value.location,
|
|
7005
7684
|
operation: "discover-static-endpoint",
|
|
7006
|
-
coverage: input.coverage
|
|
7685
|
+
coverage: input.coverage,
|
|
7686
|
+
...partial ? { limitations: [partialLimitation] } : {}
|
|
7007
7687
|
})
|
|
7008
7688
|
}]
|
|
7009
7689
|
});
|
|
@@ -7016,27 +7696,39 @@ function init_JavaScriptArtifactGraphFindings() {
|
|
|
7016
7696
|
relation: input.value.kind === "route" ? "exposes" : "calls",
|
|
7017
7697
|
properties: {
|
|
7018
7698
|
mechanism: input.value.mechanism,
|
|
7019
|
-
...candidate ? { interpretation: input.value.interpretation } : {}
|
|
7699
|
+
...candidate ? { interpretation: input.value.interpretation } : {},
|
|
7700
|
+
...partial ? { resolution: input.value.resolution } : {}
|
|
7020
7701
|
},
|
|
7021
7702
|
...candidate ? {
|
|
7022
7703
|
confidence: "low",
|
|
7023
7704
|
limitations: [candidateLimitation]
|
|
7024
|
-
} : {}
|
|
7705
|
+
} : partial ? { limitations: [partialLimitation] } : {}
|
|
7025
7706
|
});
|
|
7026
7707
|
};
|
|
7027
7708
|
addStorage = (context, input) => {
|
|
7709
|
+
const candidate = input.value.interpretation === "candidate";
|
|
7710
|
+
const limitation = "The constructor name is only a candidate; an unchanged SQLite module API origin is unproven.";
|
|
7028
7711
|
const source = sourceNodeFor(context, input.file.path, input.value.module_key, input.value.module_runtime) ?? input.asset;
|
|
7029
7712
|
const node = context.accumulator.addNode({
|
|
7030
7713
|
kind: "storage",
|
|
7031
|
-
identity: artifactLocalIdentity(input.file.sha256, input.value.kind, input.value.name ?? input.value.mechanism),
|
|
7714
|
+
identity: artifactLocalIdentity(input.file.sha256, candidate ? `${input.value.kind}:candidate` : input.value.kind, input.value.name ?? input.value.mechanism),
|
|
7032
7715
|
observations: [{
|
|
7033
7716
|
label: input.value.name ?? input.value.kind,
|
|
7034
7717
|
properties: {
|
|
7035
7718
|
storage_kind: input.value.kind,
|
|
7036
7719
|
name: input.value.name,
|
|
7037
|
-
mechanism: input.value.mechanism
|
|
7720
|
+
mechanism: input.value.mechanism,
|
|
7721
|
+
...candidate ? { interpretation: "candidate" } : {}
|
|
7038
7722
|
},
|
|
7039
|
-
evidence:
|
|
7723
|
+
evidence: candidate ? staticInferenceEvidence({
|
|
7724
|
+
sha256: input.file.sha256,
|
|
7725
|
+
path: input.file.path,
|
|
7726
|
+
range: input.value.location,
|
|
7727
|
+
operation: "classify-static-storage-candidate",
|
|
7728
|
+
coverage: input.coverage,
|
|
7729
|
+
confidence: "low",
|
|
7730
|
+
limitations: [limitation]
|
|
7731
|
+
}) : astObservationEvidence({
|
|
7040
7732
|
sha256: input.file.sha256,
|
|
7041
7733
|
path: input.file.path,
|
|
7042
7734
|
range: input.value.location,
|
|
@@ -7052,7 +7744,14 @@ function init_JavaScriptArtifactGraphFindings() {
|
|
|
7052
7744
|
range: input.value.location,
|
|
7053
7745
|
coverage: input.coverage,
|
|
7054
7746
|
relation: "persists_to",
|
|
7055
|
-
properties: {
|
|
7747
|
+
properties: {
|
|
7748
|
+
mechanism: input.value.mechanism,
|
|
7749
|
+
...candidate ? { interpretation: "candidate" } : {}
|
|
7750
|
+
},
|
|
7751
|
+
...candidate ? {
|
|
7752
|
+
confidence: "low",
|
|
7753
|
+
limitations: [limitation]
|
|
7754
|
+
} : {}
|
|
7056
7755
|
});
|
|
7057
7756
|
};
|
|
7058
7757
|
addDiscoveredRole = (context, input) => {
|
|
@@ -7305,8 +8004,8 @@ function init_JavaScriptModuleRelationships() {
|
|
|
7305
8004
|
label: file.path,
|
|
7306
8005
|
properties: {
|
|
7307
8006
|
semantic_role: "source-module",
|
|
8007
|
+
source_sha256: file.sha256,
|
|
7308
8008
|
path: file.path,
|
|
7309
|
-
container_sha256: file.container_sha256,
|
|
7310
8009
|
logical_module_key: file.path,
|
|
7311
8010
|
module_format: moduleFormat(file.path, semantic.ir),
|
|
7312
8011
|
import_relationships: semantic.ir.moduleLinks.filter(({ kind }) => kind === "import" || kind === "require").length,
|
|
@@ -7540,6 +8239,7 @@ function init_JavaScriptArtifactGraphStructure() {
|
|
|
7540
8239
|
return (init_JavaScriptArtifactGraphStructure = __esmMin((() => {
|
|
7541
8240
|
init_JavaScriptArtifactAnalysis();
|
|
7542
8241
|
init_javascriptApplicationEvidenceSchemas();
|
|
8242
|
+
init_JavaScriptArtifactAnalysisTypes();
|
|
7543
8243
|
init_jsonValue();
|
|
7544
8244
|
init_immutableJson();
|
|
7545
8245
|
init_JavaScriptArtifactGraphContext();
|
|
@@ -7622,7 +8322,7 @@ function init_JavaScriptArtifactGraphStructure() {
|
|
|
7622
8322
|
for (const analyzed of context.analysis.files) {
|
|
7623
8323
|
const { file } = analyzed;
|
|
7624
8324
|
const jsonValue = jsonModulesByPath.get(file.path);
|
|
7625
|
-
const target = createFileTarget(context, file, analyzed.javascript, jsonValue);
|
|
8325
|
+
const target = createFileTarget(context, file, analyzed.javascript, jsonValue, isSkippedJavaScriptAnalysis(analyzed));
|
|
7626
8326
|
if (analyzed.application_projection_failure !== undefined && analyzed.javascript !== null) context.accumulator.addNode({
|
|
7627
8327
|
kind: target.kind,
|
|
7628
8328
|
identity: target.identity,
|
|
@@ -7673,30 +8373,35 @@ function init_JavaScriptArtifactGraphStructure() {
|
|
|
7673
8373
|
})
|
|
7674
8374
|
});
|
|
7675
8375
|
}
|
|
7676
|
-
|
|
8376
|
+
const analysisScope = javascriptArtifactAnalysisScopes[file.kind];
|
|
8377
|
+
if (!file.text.included && file.text.reason === "outside-analysis-scope" && analysisScope !== null) addUnavailableStaticParseScope(context, {
|
|
7677
8378
|
file,
|
|
7678
8379
|
asset: target,
|
|
7679
8380
|
operation: "select-javascript-sources",
|
|
8381
|
+
authority: analysisScope.authority,
|
|
7680
8382
|
limitation: "Source is outside the caller-selected source_paths; it was inventoried but not analyzed."
|
|
7681
8383
|
});
|
|
7682
8384
|
else if (analyzed.analysis_failure !== undefined) addUnavailableStaticParseScope(context, {
|
|
7683
8385
|
file,
|
|
7684
8386
|
asset: target,
|
|
7685
|
-
|
|
8387
|
+
...analyzed.analysis_failure.scope,
|
|
7686
8388
|
limitation: analyzed.analysis_failure.reason,
|
|
7687
8389
|
failure: analyzed.analysis_failure.error,
|
|
7688
|
-
limits: javaScriptAnalysisCoverageLimits(analyzed.analysis_failure.limits)
|
|
8390
|
+
limits: javaScriptAnalysisCoverageLimits(analyzed.analysis_failure.limits),
|
|
8391
|
+
details: { analysis_status: analyzed.analysis_failure.status }
|
|
7689
8392
|
});
|
|
7690
8393
|
else if (file.kind === "javascript" && (analyzed.javascript === null || analyzed.javascript.parse_status === "failed")) addUnavailableStaticParseScope(context, {
|
|
7691
8394
|
file,
|
|
7692
8395
|
asset: target,
|
|
7693
8396
|
operation: "parse-javascript",
|
|
8397
|
+
authority: javascriptArtifactAnalysisScopes.javascript.authority,
|
|
7694
8398
|
limitation: file.text.included ? "JavaScript syntax could not be parsed." : `JavaScript text was unavailable: ${file.text.reason}.`
|
|
7695
8399
|
});
|
|
7696
8400
|
if (analyzed.application_projection_failure !== undefined) addUnavailableStaticParseScope(context, {
|
|
7697
8401
|
file,
|
|
7698
8402
|
asset: target,
|
|
7699
8403
|
operation: "project-javascript-application",
|
|
8404
|
+
authority: javascriptArtifactAnalysisScopes.javascript.authority,
|
|
7700
8405
|
limitation: analyzed.application_projection_failure.reason,
|
|
7701
8406
|
failure: analyzed.application_projection_failure.error,
|
|
7702
8407
|
limits: javaScriptAnalysisCoverageLimits(analyzed.application_projection_failure.limits)
|
|
@@ -7705,20 +8410,20 @@ function init_JavaScriptArtifactGraphStructure() {
|
|
|
7705
8410
|
if (packageValue !== undefined && packageValue.status !== "included") addUnavailableStaticParseScope(context, {
|
|
7706
8411
|
file,
|
|
7707
8412
|
asset: target,
|
|
7708
|
-
|
|
8413
|
+
...javascriptArtifactAnalysisScopes["package-json"],
|
|
7709
8414
|
limitation: packageValue.limitation
|
|
7710
8415
|
});
|
|
7711
8416
|
if (jsonValue !== undefined && jsonValue.status !== "included") addUnavailableStaticParseScope(context, {
|
|
7712
8417
|
file,
|
|
7713
8418
|
asset: target,
|
|
7714
|
-
|
|
8419
|
+
...javascriptArtifactAnalysisScopes.json,
|
|
7715
8420
|
limitation: jsonValue.limitation
|
|
7716
8421
|
});
|
|
7717
8422
|
const sourceMap = sourceMapsByPath.get(file.path);
|
|
7718
8423
|
if (sourceMap !== undefined && sourceMap.status === "invalid") addUnavailableStaticParseScope(context, {
|
|
7719
8424
|
file,
|
|
7720
8425
|
asset: target,
|
|
7721
|
-
|
|
8426
|
+
...javascriptArtifactAnalysisScopes["source-map"],
|
|
7722
8427
|
limitation: sourceMap.limitation
|
|
7723
8428
|
});
|
|
7724
8429
|
const inlineScripts = inlineScriptsByPath.get(file.path);
|
|
@@ -7726,6 +8431,7 @@ function init_JavaScriptArtifactGraphStructure() {
|
|
|
7726
8431
|
file,
|
|
7727
8432
|
asset: target,
|
|
7728
8433
|
operation: "parse-html-inline-scripts",
|
|
8434
|
+
authority: javascriptArtifactAnalysisScopes.javascript.authority,
|
|
7729
8435
|
limitation: htmlInlineScriptLimitation(inlineScripts),
|
|
7730
8436
|
limits: inlineScripts.script_count > inlineScripts.scripts.length ? [HTML_INLINE_SCRIPT_LOCATION_COVERAGE_LIMIT] : [],
|
|
7731
8437
|
omittedCount: omittedHtmlInlineScriptLocations([inlineScripts]),
|
|
@@ -7927,7 +8633,7 @@ function init_JavaScriptArtifactGraphStructure() {
|
|
|
7927
8633
|
};
|
|
7928
8634
|
applicationManifestPath = (context) => context.analysis.packages.map(({ path }) => path).filter((path) => context.filesByPath.has(path) && !dependencyManifest(path)).sort((left, right) => left.split("/").length - right.split("/").length || compareUnicodeCodePoints(left, right))[0];
|
|
7929
8635
|
dependencyManifest = (path) => path.split("/").slice(0, -1).includes("node_modules");
|
|
7930
|
-
createFileTarget = (context, file, javascript, json) => {
|
|
8636
|
+
createFileTarget = (context, file, javascript, json, skipped) => {
|
|
7931
8637
|
const kind = artifactFileNodeKind(file.kind);
|
|
7932
8638
|
return context.accumulator.addNode({
|
|
7933
8639
|
kind,
|
|
@@ -7945,7 +8651,7 @@ function init_JavaScriptArtifactGraphStructure() {
|
|
|
7945
8651
|
unpacked: file.unpacked,
|
|
7946
8652
|
file_kind: file.kind,
|
|
7947
8653
|
text_status: file.text.included ? "included" : file.text.reason,
|
|
7948
|
-
parse_status: javascript?.parse_status ?? null,
|
|
8654
|
+
parse_status: javascript?.parse_status ?? (skipped ? "skipped" : null),
|
|
7949
8655
|
json_parse_status: json?.status ?? null,
|
|
7950
8656
|
json_top_level_keys: json?.top_level_keys ?? [],
|
|
7951
8657
|
omitted_json_top_level_keys: json?.omitted_top_level_keys ?? 0,
|
|
@@ -8822,13 +9528,17 @@ function init_ElectronBoundaryGraphWindows() {
|
|
|
8822
9528
|
web_preferences: value.web_preferences,
|
|
8823
9529
|
preload_path: value.preload_path,
|
|
8824
9530
|
preload_resolution_context: value.preload_resolution_context,
|
|
9531
|
+
...value.resolution_sources === undefined ? {} : { resolution_sources: value.resolution_sources.map((location) => ({
|
|
9532
|
+
source: file.path,
|
|
9533
|
+
...location
|
|
9534
|
+
})) },
|
|
8825
9535
|
absence_means_default: false
|
|
8826
9536
|
},
|
|
8827
|
-
evidence: astObservationEvidence({
|
|
9537
|
+
evidence: (value.resolution_sources === undefined ? astObservationEvidence : staticInferenceEvidence)({
|
|
8828
9538
|
sha256: file.sha256,
|
|
8829
9539
|
path: file.path,
|
|
8830
9540
|
range: value.location,
|
|
8831
|
-
operation: "observe-browser-window-construction",
|
|
9541
|
+
operation: value.resolution_sources === undefined ? "observe-browser-window-construction" : "resolve-browser-window-constant-options",
|
|
8832
9542
|
coverage,
|
|
8833
9543
|
limitations: ["Only explicitly present webPreferences are reported; omitted properties are not interpreted as Electron defaults."]
|
|
8834
9544
|
})
|
|
@@ -9437,7 +10147,7 @@ function init_JavaScriptSemanticGraphEvidence() {
|
|
|
9437
10147
|
|
|
9438
10148
|
//#endregion
|
|
9439
10149
|
//#region dist/application/javascript/JavaScriptSemanticGraphConstruction.js
|
|
9440
|
-
var createSemanticGraphProjectionState, bindSemanticGraphApplicationNodes, constructSemanticGraphNode, retainSemanticGraphNode, addSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, addSemanticFallbackRoot, indexApplicationNodes, addApplicationNodeIdentifier, applicationLocationKey;
|
|
10150
|
+
var createSemanticGraphProjectionState, bindSemanticGraphApplicationNodes, constructSemanticGraphNode, retainSemanticGraphNode, addSemanticGraphNode, addSemanticGraphRelation, recordSemanticUnknownOmission, addSemanticGraphUnknown, addSemanticFallbackRoot, indexApplicationNodes, addApplicationNodeIdentifier, applicationLocationKey;
|
|
9441
10151
|
function init_JavaScriptSemanticGraphConstruction() {
|
|
9442
10152
|
return (init_JavaScriptSemanticGraphConstruction = __esmMin((() => {
|
|
9443
10153
|
init_javascriptAstValues();
|
|
@@ -9447,6 +10157,8 @@ function init_JavaScriptSemanticGraphConstruction() {
|
|
|
9447
10157
|
nodes: new Map(),
|
|
9448
10158
|
relations: new Map(),
|
|
9449
10159
|
unknowns: new Map(),
|
|
10160
|
+
unknownCapacity: null,
|
|
10161
|
+
unknownOmissions: new Map(),
|
|
9450
10162
|
evidenceContexts: new JavaScriptSemanticEvidenceContextRegistry(),
|
|
9451
10163
|
roots: new Set()
|
|
9452
10164
|
});
|
|
@@ -9518,7 +10230,25 @@ function init_JavaScriptSemanticGraphConstruction() {
|
|
|
9518
10230
|
if (state.relations.has(value.relation_id)) return;
|
|
9519
10231
|
state.relations.set(value.relation_id, value);
|
|
9520
10232
|
};
|
|
9521
|
-
|
|
10233
|
+
recordSemanticUnknownOmission = (state, omission) => {
|
|
10234
|
+
const key = `${omission.family}:${omission.reason}`;
|
|
10235
|
+
const occurrences = (state.unknownOmissions.get(key)?.occurrences ?? 0) + omission.occurrences;
|
|
10236
|
+
if (!Number.isSafeInteger(occurrences)) throw new RangeError("Semantic unknown omission count overflow");
|
|
10237
|
+
state.unknownOmissions.set(key, {
|
|
10238
|
+
...omission,
|
|
10239
|
+
occurrences
|
|
10240
|
+
});
|
|
10241
|
+
};
|
|
10242
|
+
addSemanticGraphUnknown = (state, input) => {
|
|
10243
|
+
if (state.unknownCapacity !== null && state.unknowns.size >= state.unknownCapacity) {
|
|
10244
|
+
recordSemanticUnknownOmission(state, {
|
|
10245
|
+
family: input.family,
|
|
10246
|
+
reason: input.reason,
|
|
10247
|
+
occurrences: 1
|
|
10248
|
+
});
|
|
10249
|
+
return;
|
|
10250
|
+
}
|
|
10251
|
+
const unknown = createJavaScriptSemanticGraphUnknown(input, state.evidenceContexts);
|
|
9522
10252
|
if (state.unknowns.has(unknown.unknown_id)) return;
|
|
9523
10253
|
state.unknowns.set(unknown.unknown_id, unknown);
|
|
9524
10254
|
};
|
|
@@ -9581,7 +10311,6 @@ var projectSemanticEvents, addEventNode, addListenerNode, eventEmitterNode, even
|
|
|
9581
10311
|
function init_JavaScriptSemanticGraphAsyncProjection() {
|
|
9582
10312
|
return (init_JavaScriptSemanticGraphAsyncProjection = __esmMin((() => {
|
|
9583
10313
|
init_compactStringIdentity();
|
|
9584
|
-
init_javascriptSemanticGraph();
|
|
9585
10314
|
init_JavaScriptSemanticGraphConstruction();
|
|
9586
10315
|
init_JavaScriptSemanticGraphEvidence();
|
|
9587
10316
|
projectSemanticEvents = (context) => {
|
|
@@ -9636,7 +10365,7 @@ function init_JavaScriptSemanticGraphAsyncProjection() {
|
|
|
9636
10365
|
eventEmitterNode = (context, operation) => (operation.emitterBindingId === null ? undefined : context.bindingNodes.get(operation.emitterBindingId)) ?? (operation.ownerCallableId === null ? context.moduleNode : context.callableNodes.get(operation.ownerCallableId) ?? context.moduleNode);
|
|
9637
10366
|
eventRelation = (operation) => operation.kind === "register" ? "registers-listener" : operation.kind === "remove" ? "removes-listener" : "dispatches-candidate";
|
|
9638
10367
|
addEventUnknown = (context, operation, event, relation) => {
|
|
9639
|
-
addSemanticGraphUnknown(context.state,
|
|
10368
|
+
addSemanticGraphUnknown(context.state, {
|
|
9640
10369
|
node_id: event.node_id,
|
|
9641
10370
|
family: "event",
|
|
9642
10371
|
relation_kinds: [relation],
|
|
@@ -9644,7 +10373,7 @@ function init_JavaScriptSemanticGraphAsyncProjection() {
|
|
|
9644
10373
|
detail: operation.eventName === null ? `Dynamic ${operation.method} event name remains unresolved.` : `Static ${operation.method} emitter identity is partial.`,
|
|
9645
10374
|
candidate_node_ids: [],
|
|
9646
10375
|
evidence: unknownSemanticEvidence(context.file, operation.location)
|
|
9647
|
-
}
|
|
10376
|
+
});
|
|
9648
10377
|
};
|
|
9649
10378
|
projectSemanticTimers = (context) => {
|
|
9650
10379
|
const timerNodes = new Map(context.ir.timerOperations.flatMap((operation) => {
|
|
@@ -9694,7 +10423,7 @@ function init_JavaScriptSemanticGraphAsyncProjection() {
|
|
|
9694
10423
|
resolution: operation.resolution === "complete" ? "resolved" : "candidate"
|
|
9695
10424
|
});
|
|
9696
10425
|
if (operation.resolution === "complete") return;
|
|
9697
|
-
addSemanticGraphUnknown(context.state,
|
|
10426
|
+
addSemanticGraphUnknown(context.state, {
|
|
9698
10427
|
node_id: callSite?.node_id ?? null,
|
|
9699
10428
|
family: "timer",
|
|
9700
10429
|
relation_kinds: ["cancels-timer"],
|
|
@@ -9702,7 +10431,7 @@ function init_JavaScriptSemanticGraphAsyncProjection() {
|
|
|
9702
10431
|
detail: `Static ${operation.method} handle resolution was ${operation.resolution}.`,
|
|
9703
10432
|
candidate_node_ids: [],
|
|
9704
10433
|
evidence: unknownSemanticEvidence(context.file, operation.location)
|
|
9705
|
-
}
|
|
10434
|
+
});
|
|
9706
10435
|
};
|
|
9707
10436
|
})))();
|
|
9708
10437
|
}
|
|
@@ -9712,7 +10441,6 @@ function init_JavaScriptSemanticGraphAsyncProjection() {
|
|
|
9712
10441
|
var projectSemanticChildProcesses, addChildProcessNode, projectSpawn, addStdioNode, projectInteraction, addChildListenerNode, addSignalNode, addChildUnknown;
|
|
9713
10442
|
function init_JavaScriptSemanticGraphChildProcessProjection() {
|
|
9714
10443
|
return (init_JavaScriptSemanticGraphChildProcessProjection = __esmMin((() => {
|
|
9715
|
-
init_javascriptSemanticGraph();
|
|
9716
10444
|
init_JavaScriptSemanticGraphConstruction();
|
|
9717
10445
|
init_JavaScriptSemanticGraphEvidence();
|
|
9718
10446
|
projectSemanticChildProcesses = (context) => {
|
|
@@ -9779,6 +10507,15 @@ function init_JavaScriptSemanticGraphChildProcessProjection() {
|
|
|
9779
10507
|
relation: "connects-stdio",
|
|
9780
10508
|
resolution: spawn.stdioMode === "dynamic" ? "candidate" : "resolved"
|
|
9781
10509
|
});
|
|
10510
|
+
if (spawn.stdioMode === "dynamic") addChildUnknown({
|
|
10511
|
+
context,
|
|
10512
|
+
node: child,
|
|
10513
|
+
location: spawn.location,
|
|
10514
|
+
relationKinds: ["connects-stdio"],
|
|
10515
|
+
reason: "unknown-value",
|
|
10516
|
+
detail: `Static ${spawn.method} stdio options remain unresolved.`,
|
|
10517
|
+
candidateNodeIds: []
|
|
10518
|
+
});
|
|
9782
10519
|
if (spawn.resolution !== "complete") addChildUnknown({
|
|
9783
10520
|
context,
|
|
9784
10521
|
node: child,
|
|
@@ -9838,15 +10575,15 @@ function init_JavaScriptSemanticGraphChildProcessProjection() {
|
|
|
9838
10575
|
});
|
|
9839
10576
|
addChildUnknown = (input) => {
|
|
9840
10577
|
const { context, node, location, relationKinds, detail, candidateNodeIds } = input;
|
|
9841
|
-
addSemanticGraphUnknown(context.state,
|
|
10578
|
+
addSemanticGraphUnknown(context.state, {
|
|
9842
10579
|
node_id: node?.node_id ?? null,
|
|
9843
10580
|
family: "child-process",
|
|
9844
10581
|
relation_kinds: relationKinds,
|
|
9845
|
-
reason: "ambiguous-target",
|
|
10582
|
+
reason: input.reason ?? "ambiguous-target",
|
|
9846
10583
|
detail,
|
|
9847
10584
|
candidate_node_ids: candidateNodeIds,
|
|
9848
10585
|
evidence: unknownSemanticEvidence(context.file, location)
|
|
9849
|
-
}
|
|
10586
|
+
});
|
|
9850
10587
|
};
|
|
9851
10588
|
})))();
|
|
9852
10589
|
}
|
|
@@ -9856,9 +10593,9 @@ function init_JavaScriptSemanticGraphChildProcessProjection() {
|
|
|
9856
10593
|
var projectSemanticConfiguration, addConfigurationNode, configurationRelation, projectSemanticRequests, addRequestNode, projectRequestConstruction, projectResponseConsumer, projectSemanticBoundaries, addBoundaryNode, bindingOrOwner, addDataUnknown;
|
|
9857
10594
|
function init_JavaScriptSemanticGraphDataProjection() {
|
|
9858
10595
|
return (init_JavaScriptSemanticGraphDataProjection = __esmMin((() => {
|
|
9859
|
-
init_javascriptSemanticGraph();
|
|
9860
10596
|
init_JavaScriptSemanticGraphConstruction();
|
|
9861
10597
|
init_JavaScriptSemanticGraphEvidence();
|
|
10598
|
+
init_javascriptSemanticResourceLimits();
|
|
9862
10599
|
projectSemanticConfiguration = (context) => {
|
|
9863
10600
|
const configNodes = new Map(context.ir.configurationOperations.flatMap((operation) => {
|
|
9864
10601
|
const node = addConfigurationNode(context, operation);
|
|
@@ -9886,7 +10623,10 @@ function init_JavaScriptSemanticGraphDataProjection() {
|
|
|
9886
10623
|
family: "configuration",
|
|
9887
10624
|
relationKinds: [configurationRelation(operation), ...operation.kind === "default" ? ["overrides"] : []],
|
|
9888
10625
|
location: operation.location,
|
|
9889
|
-
detail: `Static ${operation.kind} configuration identity is partial
|
|
10626
|
+
...operation.valueResourceLimit === undefined ? { detail: operation.kind === "default" ? "Static default configuration value is partial." : `Static ${operation.kind} configuration identity is partial.` } : {
|
|
10627
|
+
reason: "resource-limit",
|
|
10628
|
+
detail: semanticResourceLimitReason(operation.valueResourceLimit)
|
|
10629
|
+
},
|
|
9890
10630
|
candidateNodeIds: []
|
|
9891
10631
|
});
|
|
9892
10632
|
}
|
|
@@ -9900,7 +10640,8 @@ function init_JavaScriptSemanticGraphDataProjection() {
|
|
|
9900
10640
|
properties: {
|
|
9901
10641
|
key: operation.key,
|
|
9902
10642
|
source_kind: operation.kind,
|
|
9903
|
-
value: operation.value
|
|
10643
|
+
value: operation.value,
|
|
10644
|
+
...operation.valueResourceLimit === undefined ? {} : { value_resource_limit: operation.valueResourceLimit }
|
|
9904
10645
|
}
|
|
9905
10646
|
});
|
|
9906
10647
|
configurationRelation = (operation) => operation.kind === "environment" ? "reads-environment" : operation.kind === "argv" ? "reads-argv" : operation.kind === "file" ? "reads-config" : "defaults";
|
|
@@ -10004,21 +10745,22 @@ function init_JavaScriptSemanticGraphDataProjection() {
|
|
|
10004
10745
|
functionNodeId: operation.ownerCallableId === null ? null : context.callableNodes.get(operation.ownerCallableId)?.node_id ?? null,
|
|
10005
10746
|
properties: {
|
|
10006
10747
|
boundary_kind: operation.kind,
|
|
10748
|
+
field: operation.method,
|
|
10007
10749
|
method: operation.method
|
|
10008
10750
|
}
|
|
10009
10751
|
});
|
|
10010
10752
|
bindingOrOwner = (context, bindingId, callableId) => (bindingId === null ? undefined : context.bindingNodes.get(bindingId)) ?? (callableId === null ? context.moduleNode : context.callableNodes.get(callableId) ?? context.moduleNode);
|
|
10011
10753
|
addDataUnknown = (input) => {
|
|
10012
10754
|
const { context, node, family, relationKinds, location, detail, candidateNodeIds } = input;
|
|
10013
|
-
addSemanticGraphUnknown(context.state,
|
|
10755
|
+
addSemanticGraphUnknown(context.state, {
|
|
10014
10756
|
node_id: node.node_id,
|
|
10015
10757
|
family,
|
|
10016
10758
|
relation_kinds: relationKinds,
|
|
10017
|
-
reason: "ambiguous-target",
|
|
10759
|
+
reason: input.reason ?? "ambiguous-target",
|
|
10018
10760
|
detail,
|
|
10019
10761
|
candidate_node_ids: candidateNodeIds,
|
|
10020
10762
|
evidence: unknownSemanticEvidence(context.file, location)
|
|
10021
|
-
}
|
|
10763
|
+
});
|
|
10022
10764
|
};
|
|
10023
10765
|
})))();
|
|
10024
10766
|
}
|
|
@@ -10028,7 +10770,6 @@ function init_JavaScriptSemanticGraphDataProjection() {
|
|
|
10028
10770
|
var projectSemanticResources, addResourceNode, projectRelease;
|
|
10029
10771
|
function init_JavaScriptSemanticGraphResourceProjection() {
|
|
10030
10772
|
return (init_JavaScriptSemanticGraphResourceProjection = __esmMin((() => {
|
|
10031
|
-
init_javascriptSemanticGraph();
|
|
10032
10773
|
init_JavaScriptSemanticGraphConstruction();
|
|
10033
10774
|
init_JavaScriptSemanticGraphEvidence();
|
|
10034
10775
|
projectSemanticResources = (context) => {
|
|
@@ -10066,7 +10807,7 @@ function init_JavaScriptSemanticGraphResourceProjection() {
|
|
|
10066
10807
|
resolution: operation.resolution === "complete" ? "resolved" : "candidate"
|
|
10067
10808
|
});
|
|
10068
10809
|
if (operation.resolution === "complete") return;
|
|
10069
|
-
addSemanticGraphUnknown(context.state,
|
|
10810
|
+
addSemanticGraphUnknown(context.state, {
|
|
10070
10811
|
node_id: callSite?.node_id ?? null,
|
|
10071
10812
|
family: "resource-lifecycle",
|
|
10072
10813
|
relation_kinds: ["releases"],
|
|
@@ -10074,7 +10815,7 @@ function init_JavaScriptSemanticGraphResourceProjection() {
|
|
|
10074
10815
|
detail: `Static ${operation.method} resource ownership is ambiguous.`,
|
|
10075
10816
|
candidate_node_ids: resources.map(({ node_id: identifier }) => identifier),
|
|
10076
10817
|
evidence: unknownSemanticEvidence(context.file, operation.location)
|
|
10077
|
-
}
|
|
10818
|
+
});
|
|
10078
10819
|
};
|
|
10079
10820
|
})))();
|
|
10080
10821
|
}
|
|
@@ -10086,7 +10827,6 @@ function init_JavaScriptSemanticGraphValueProjection() {
|
|
|
10086
10827
|
return (init_JavaScriptSemanticGraphValueProjection = __esmMin((() => {
|
|
10087
10828
|
init_javascriptSemanticSlots();
|
|
10088
10829
|
init_canonicalDigest();
|
|
10089
|
-
init_javascriptSemanticGraph();
|
|
10090
10830
|
init_JavaScriptSemanticGraphConstruction();
|
|
10091
10831
|
init_JavaScriptSemanticGraphEvidence();
|
|
10092
10832
|
projectSemanticValues = (context) => {
|
|
@@ -10143,7 +10883,7 @@ function init_JavaScriptSemanticGraphValueProjection() {
|
|
|
10143
10883
|
path: propertyPath
|
|
10144
10884
|
});
|
|
10145
10885
|
}
|
|
10146
|
-
if (container.coverage.status === "partial") addSemanticGraphUnknown(context.state,
|
|
10886
|
+
if (container.coverage.status === "partial") addSemanticGraphUnknown(context.state, {
|
|
10147
10887
|
node_id: target.node_id,
|
|
10148
10888
|
family: "object-flow",
|
|
10149
10889
|
relation_kinds: ["writes-property"],
|
|
@@ -10151,11 +10891,11 @@ function init_JavaScriptSemanticGraphValueProjection() {
|
|
|
10151
10891
|
detail: `Initializer container has unknown ${value.status === "object" ? "properties" : "items"}${container.coverage.omitted === null ? " with an unknown omitted count" : `; ${container.coverage.omitted} omitted`}.`,
|
|
10152
10892
|
candidate_node_ids: [target.node_id],
|
|
10153
10893
|
evidence: unknownSemanticEvidence(context.file, binding.definitions[0]?.location ?? null)
|
|
10154
|
-
}
|
|
10894
|
+
});
|
|
10155
10895
|
} else if (value.status === "unknown" || value.status === "ambiguous" || value.status === "cycle") {
|
|
10156
10896
|
const location = binding.definitions[0]?.location ?? null;
|
|
10157
10897
|
const evidence = observedSemanticEvidence(context.file, location);
|
|
10158
|
-
addSemanticGraphUnknown(context.state,
|
|
10898
|
+
addSemanticGraphUnknown(context.state, {
|
|
10159
10899
|
node_id: target.node_id,
|
|
10160
10900
|
family: "data-flow",
|
|
10161
10901
|
relation_kinds: ["defines"],
|
|
@@ -10169,7 +10909,7 @@ function init_JavaScriptSemanticGraphValueProjection() {
|
|
|
10169
10909
|
confidence: "unknown",
|
|
10170
10910
|
limitations: [value.reason]
|
|
10171
10911
|
}
|
|
10172
|
-
}
|
|
10912
|
+
});
|
|
10173
10913
|
}
|
|
10174
10914
|
};
|
|
10175
10915
|
addLiteralNode = (context, binding, value, role) => {
|
|
@@ -10228,7 +10968,6 @@ var OBJECT_RELATIONS, objectTarget, objectRelationEnds, addObjectOccurrence, add
|
|
|
10228
10968
|
function init_JavaScriptSemanticGraphObjectProjection() {
|
|
10229
10969
|
return (init_JavaScriptSemanticGraphObjectProjection = __esmMin((() => {
|
|
10230
10970
|
init_javascriptSemanticSlots();
|
|
10231
|
-
init_javascriptSemanticGraph();
|
|
10232
10971
|
init_JavaScriptSemanticGraphConstruction();
|
|
10233
10972
|
init_JavaScriptSemanticGraphEvidence();
|
|
10234
10973
|
init_JavaScriptSemanticGraphValueProjection();
|
|
@@ -10296,7 +11035,7 @@ function init_JavaScriptSemanticGraphObjectProjection() {
|
|
|
10296
11035
|
});
|
|
10297
11036
|
addObjectUnknown = (context, operation, node, target) => {
|
|
10298
11037
|
const relation = OBJECT_RELATIONS[operation.kind];
|
|
10299
|
-
addSemanticGraphUnknown(context.state,
|
|
11038
|
+
addSemanticGraphUnknown(context.state, {
|
|
10300
11039
|
node_id: node?.node_id ?? null,
|
|
10301
11040
|
family: "object-flow",
|
|
10302
11041
|
relation_kinds: [relation],
|
|
@@ -10304,7 +11043,7 @@ function init_JavaScriptSemanticGraphObjectProjection() {
|
|
|
10304
11043
|
detail: `Static ${operation.kind} property ${operation.propertyPath === null ? "path is unresolved" : semanticPropertyPointer(operation.propertyPath)} has ${target.presence} presence; its receiver is ${target.receiverResolved ? "a retained container" : "unresolved or not a retained container"}; object identity is ${operation.resolution}.`,
|
|
10305
11044
|
candidate_node_ids: [],
|
|
10306
11045
|
evidence: unknownSemanticEvidence(context.file, operation.location)
|
|
10307
|
-
}
|
|
11046
|
+
});
|
|
10308
11047
|
};
|
|
10309
11048
|
})))();
|
|
10310
11049
|
}
|
|
@@ -10346,7 +11085,7 @@ function* projectSemanticFrontiers(context) {
|
|
|
10346
11085
|
if (index % 64 === 0) yield;
|
|
10347
11086
|
const family = frontier.kind === "dynamic-call" ? "call-flow" : frontier.kind === "dynamic-scope" ? "data-flow" : "object-flow";
|
|
10348
11087
|
const relationKinds = frontier.kind === "dynamic-call" ? ["calls"] : frontier.kind === "dynamic-scope" ? ["reads", "writes"] : ["reads-property", "writes-property"];
|
|
10349
|
-
|
|
11088
|
+
addSemanticGraphUnknown(context.state, {
|
|
10350
11089
|
node_id: frontier.callableId === null ? context.moduleNode.node_id : context.callableNodes.get(frontier.callableId)?.node_id ?? context.moduleNode.node_id,
|
|
10351
11090
|
family,
|
|
10352
11091
|
relation_kinds: [...relationKinds],
|
|
@@ -10354,14 +11093,12 @@ function* projectSemanticFrontiers(context) {
|
|
|
10354
11093
|
detail: frontier.reason,
|
|
10355
11094
|
candidate_node_ids: [],
|
|
10356
11095
|
evidence: unknownSemanticEvidence(context.file, frontier.location)
|
|
10357
|
-
}
|
|
10358
|
-
addSemanticGraphUnknown(context.state, unknown);
|
|
11096
|
+
});
|
|
10359
11097
|
}
|
|
10360
11098
|
}
|
|
10361
11099
|
var projectSemanticPromises, promiseLabel, projectPromiseCreation, projectPromiseSources, projectPromiseOwnership, addPromiseUnknown, projectSemanticReturnValues, projectSemanticClosureCaptures;
|
|
10362
11100
|
function init_JavaScriptSemanticGraphFlowProjection() {
|
|
10363
11101
|
return (init_JavaScriptSemanticGraphFlowProjection = __esmMin((() => {
|
|
10364
|
-
init_javascriptSemanticGraph();
|
|
10365
11102
|
init_javascriptStaticAnalysisHelpers();
|
|
10366
11103
|
init_JavaScriptSemanticGraphConstruction();
|
|
10367
11104
|
init_JavaScriptSemanticGraphEvidence();
|
|
@@ -10452,7 +11189,7 @@ function init_JavaScriptSemanticGraphFlowProjection() {
|
|
|
10452
11189
|
};
|
|
10453
11190
|
addPromiseUnknown = (context, operation, promise, promiseNodes) => {
|
|
10454
11191
|
const relation = operation.kind === "aggregate" ? "aggregates" : "chains";
|
|
10455
|
-
addSemanticGraphUnknown(context.state,
|
|
11192
|
+
addSemanticGraphUnknown(context.state, {
|
|
10456
11193
|
node_id: promise.node_id,
|
|
10457
11194
|
family: "promise-ownership",
|
|
10458
11195
|
relation_kinds: [relation],
|
|
@@ -10463,7 +11200,7 @@ function init_JavaScriptSemanticGraphFlowProjection() {
|
|
|
10463
11200
|
return candidate === undefined ? [] : [candidate.node_id];
|
|
10464
11201
|
}),
|
|
10465
11202
|
evidence: unknownSemanticEvidence(context.file, operation.location)
|
|
10466
|
-
}
|
|
11203
|
+
});
|
|
10467
11204
|
};
|
|
10468
11205
|
projectSemanticReturnValues = (context) => {
|
|
10469
11206
|
for (const callable of context.ir.callables) for (const site of callable.returnSites) {
|
|
@@ -10672,11 +11409,12 @@ function init_JavaScriptSemanticGraphElectronProjection() {
|
|
|
10672
11409
|
|
|
10673
11410
|
//#endregion
|
|
10674
11411
|
//#region dist/application/javascript/JavaScriptSemanticGraphBuilder.js
|
|
10675
|
-
/** Project one source with the parent's remaining
|
|
10676
|
-
function* projectJavaScriptSemanticFileSteps(file, ir,
|
|
10677
|
-
if (!Number.isSafeInteger(
|
|
11412
|
+
/** Project one source with the parent's remaining retained capacities, retaining no full IR. */
|
|
11413
|
+
function* projectJavaScriptSemanticFileSteps(file, ir, capacity, paths = []) {
|
|
11414
|
+
if ([capacity.nodes, capacity.unknowns].some((value) => !Number.isSafeInteger(value) || value < 0 || value > 1e6)) throw new RangeError("File semantic projection requires valid offered retained capacities");
|
|
10678
11415
|
const state = createSemanticGraphProjectionState();
|
|
10679
|
-
state.fileNodeBudget =
|
|
11416
|
+
state.fileNodeBudget = capacity.nodes;
|
|
11417
|
+
state.unknownCapacity = capacity.unknowns;
|
|
10680
11418
|
state.fileNodesDropped = false;
|
|
10681
11419
|
const fingerprints = yield* projectFileSteps(file, ir, state, paths);
|
|
10682
11420
|
return {
|
|
@@ -10686,7 +11424,8 @@ function* projectJavaScriptSemanticFileSteps(file, ir, nodeBudget, paths = []) {
|
|
|
10686
11424
|
relations: [...state.relations.values()],
|
|
10687
11425
|
unknowns: [...state.unknowns.values()],
|
|
10688
11426
|
fingerprints,
|
|
10689
|
-
|
|
11427
|
+
...state.unknownOmissions.size > 0 ? { omittedUnknownOccurrences: [...state.unknownOmissions.values()] } : {},
|
|
11428
|
+
nodesTruncated: Boolean(state.fileNodesDropped)
|
|
10690
11429
|
};
|
|
10691
11430
|
}
|
|
10692
11431
|
function* projectFileSteps(file, ir, state, paths = []) {
|
|
@@ -10700,6 +11439,12 @@ function* projectFileSteps(file, ir, state, paths = []) {
|
|
|
10700
11439
|
});
|
|
10701
11440
|
if (moduleNode === null) return [];
|
|
10702
11441
|
state.roots.add(moduleNode.node_id);
|
|
11442
|
+
projectFileResourceLimits({
|
|
11443
|
+
file,
|
|
11444
|
+
ir,
|
|
11445
|
+
state,
|
|
11446
|
+
moduleNode
|
|
11447
|
+
});
|
|
10703
11448
|
yield* projectElectronSemanticCallPaths(file, paths, state);
|
|
10704
11449
|
const callableNodes = new Map();
|
|
10705
11450
|
for (const [index, callable] of ir.callables.entries()) {
|
|
@@ -10844,7 +11589,7 @@ function* projectDefinitionsAndReferences(context) {
|
|
|
10844
11589
|
});
|
|
10845
11590
|
}
|
|
10846
11591
|
}
|
|
10847
|
-
var SEMANTIC_GRAPH_NODE_CEILING, SEMANTIC_GRAPH_FILE_NODE_CEILING, buildJavaScriptSemanticGraph, createJavaScriptSemanticGraphProjection, projectCalls, createArgumentNode, FILE_PROJECTION_PASSES;
|
|
11592
|
+
var SEMANTIC_GRAPH_NODE_CEILING, SEMANTIC_GRAPH_FILE_NODE_CEILING, buildJavaScriptSemanticGraph, createJavaScriptSemanticGraphProjection, projectFileResourceLimits, projectCalls, createArgumentNode, FILE_PROJECTION_PASSES;
|
|
10848
11593
|
function init_JavaScriptSemanticGraphBuilder() {
|
|
10849
11594
|
return (init_JavaScriptSemanticGraphBuilder = __esmMin((() => {
|
|
10850
11595
|
init_javascriptSemanticGraph();
|
|
@@ -10857,6 +11602,8 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
10857
11602
|
init_JavaScriptSemanticGraphObjectProjection();
|
|
10858
11603
|
init_JavaScriptSemanticGraphValueProjection();
|
|
10859
11604
|
init_JavaScriptSemanticGraphEvidence();
|
|
11605
|
+
init_javascriptSemanticCoverage();
|
|
11606
|
+
init_javascriptSemanticResourceLimits();
|
|
10860
11607
|
init_javascriptApplicationEvidenceSchemas();
|
|
10861
11608
|
init_javascriptAnalysisResourceControls();
|
|
10862
11609
|
init_JavaScriptSemanticGraphFingerprintProjection();
|
|
@@ -10877,7 +11624,14 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
10877
11624
|
createJavaScriptSemanticGraphProjection = (limits = {}) => {
|
|
10878
11625
|
const nodeCeiling = limits.totalNodes ?? SEMANTIC_GRAPH_NODE_CEILING;
|
|
10879
11626
|
const fileNodeCeiling = limits.fileNodes ?? SEMANTIC_GRAPH_FILE_NODE_CEILING;
|
|
10880
|
-
|
|
11627
|
+
const unknownCeiling = limits.totalUnknowns ?? JAVASCRIPT_ANALYSIS_RESOURCE_DEFAULTS.semanticUnknowns;
|
|
11628
|
+
const fileUnknownCeiling = limits.fileUnknowns ?? JAVASCRIPT_ANALYSIS_RESOURCE_DEFAULTS.semanticUnknownsPerFile;
|
|
11629
|
+
for (const value of [
|
|
11630
|
+
nodeCeiling,
|
|
11631
|
+
fileNodeCeiling,
|
|
11632
|
+
unknownCeiling,
|
|
11633
|
+
fileUnknownCeiling
|
|
11634
|
+
]) if (!Number.isSafeInteger(value) || value < 1 || value > 1e6) throw new RangeError("Semantic graph requires valid retained capacities");
|
|
10881
11635
|
const state = createSemanticGraphProjectionState();
|
|
10882
11636
|
const fingerprints = [];
|
|
10883
11637
|
let truncatedFiles = 0;
|
|
@@ -10892,15 +11646,19 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
10892
11646
|
const remainingTreeBudget = nodeCeiling - state.nodes.size;
|
|
10893
11647
|
state.fileNodeBudget = Math.min(fileNodeCeiling, remainingTreeBudget);
|
|
10894
11648
|
state.fileNodesDropped = false;
|
|
11649
|
+
state.unknownCapacity = Math.min(unknownCeiling, state.unknowns.size + fileUnknownCeiling);
|
|
10895
11650
|
fingerprints.push(...yield* projectFileSteps(file, ir, state, paths));
|
|
10896
11651
|
if (state.fileNodesDropped) truncatedFiles += 1;
|
|
10897
11652
|
state.fileNodeBudget = null;
|
|
11653
|
+
state.unknownCapacity = null;
|
|
10898
11654
|
};
|
|
10899
11655
|
const finishWith = (factory, rootArtifactSha256, applicationGraph) => {
|
|
10900
11656
|
bindSemanticGraphApplicationNodes(state, applicationGraph);
|
|
10901
11657
|
if (state.roots.size === 0) addSemanticFallbackRoot(rootArtifactSha256, state);
|
|
10902
11658
|
const relations = [...state.relations.values()];
|
|
10903
11659
|
const unknowns = [...state.unknowns.values()];
|
|
11660
|
+
const unknownOmissions = [...state.unknownOmissions.values()];
|
|
11661
|
+
const unknownsDropped = unknownOmissions.length > 0;
|
|
10904
11662
|
const retainedByFamily = new Map();
|
|
10905
11663
|
const unknownIdsByFamily = new Map();
|
|
10906
11664
|
for (const relation of relations) {
|
|
@@ -10923,19 +11681,32 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
10923
11681
|
fingerprints: [...fingerprints],
|
|
10924
11682
|
unknowns,
|
|
10925
11683
|
coverage: {
|
|
10926
|
-
status: truncatedFiles > 0 || unavailableFiles > 0 ? "partial" : "unknown",
|
|
10927
|
-
truncated: truncatedFiles > 0 || resourceTruncatedFiles > 0,
|
|
11684
|
+
status: truncatedFiles > 0 || unavailableFiles > 0 || unknownsDropped ? "partial" : "unknown",
|
|
11685
|
+
truncated: truncatedFiles > 0 || resourceTruncatedFiles > 0 || unknownsDropped,
|
|
11686
|
+
...unknownsDropped ? { omitted_unknown_occurrences: unknownOmissions } : {},
|
|
10928
11687
|
omitted_nodes: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
|
|
10929
11688
|
omitted_relations: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
|
|
10930
|
-
limits: [
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
11689
|
+
limits: [
|
|
11690
|
+
...executionLimits.values(),
|
|
11691
|
+
...unknownsDropped ? [{
|
|
11692
|
+
name: "semantic_graph_unknown_ceiling",
|
|
11693
|
+
value: unknownCeiling,
|
|
11694
|
+
unit: "items"
|
|
11695
|
+
}, {
|
|
11696
|
+
name: "semantic_graph_file_unknown_ceiling",
|
|
11697
|
+
value: fileUnknownCeiling,
|
|
11698
|
+
unit: "items"
|
|
11699
|
+
}] : [],
|
|
11700
|
+
...truncatedFiles > 0 ? [{
|
|
11701
|
+
name: "semantic_graph_node_ceiling",
|
|
11702
|
+
value: nodeCeiling,
|
|
11703
|
+
unit: "items"
|
|
11704
|
+
}, {
|
|
11705
|
+
name: "semantic_graph_file_node_ceiling",
|
|
11706
|
+
value: fileNodeCeiling,
|
|
11707
|
+
unit: "items"
|
|
11708
|
+
}] : []
|
|
11709
|
+
],
|
|
10939
11710
|
families: JAVASCRIPT_SEMANTIC_RELATION_FAMILIES.map((family) => ({
|
|
10940
11711
|
family,
|
|
10941
11712
|
status: semanticFamilyStatus(family),
|
|
@@ -10945,6 +11716,7 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
10945
11716
|
}))
|
|
10946
11717
|
},
|
|
10947
11718
|
limitations: [
|
|
11719
|
+
...unknownsDropped ? ["Semantic unknown retention reached an effective capacity. Omission coverage counts examined emission occurrences by family and reason, including repeats; it does not count unexamined source frontiers or distinct discarded identities."] : [],
|
|
10948
11720
|
"The semantic graph contains static syntax observations and conservative relationship candidates; it does not claim runtime execution.",
|
|
10949
11721
|
"Local data flow does not claim control-flow-sensitive reaching definitions or arbitrary dynamic property resolution.",
|
|
10950
11722
|
"Promise ownership covers explicit unshadowed Promise construction, static factories, aggregation, chaining, and await syntax only.",
|
|
@@ -10961,25 +11733,33 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
10961
11733
|
state.nodes.clear();
|
|
10962
11734
|
state.relations.clear();
|
|
10963
11735
|
state.unknowns.clear();
|
|
11736
|
+
state.unknownOmissions.clear();
|
|
10964
11737
|
state.roots.clear();
|
|
10965
11738
|
state.evidenceContexts.clear();
|
|
10966
11739
|
fingerprints.length = 0;
|
|
10967
11740
|
return graph;
|
|
10968
11741
|
};
|
|
10969
11742
|
return {
|
|
10970
|
-
|
|
11743
|
+
remainingFileCapacity: () => ({
|
|
11744
|
+
nodes: Math.min(fileNodeCeiling, Math.max(0, nodeCeiling - state.nodes.size)),
|
|
11745
|
+
unknowns: Math.min(fileUnknownCeiling, Math.max(0, unknownCeiling - state.unknowns.size))
|
|
11746
|
+
}),
|
|
10971
11747
|
adoptFileProjection: (projection) => {
|
|
10972
11748
|
const newNodes = projection.nodes.filter(({ node_id }) => !state.nodes.has(node_id));
|
|
10973
11749
|
if (newNodes.length > Math.min(fileNodeCeiling, nodeCeiling - state.nodes.size)) throw new RangeError("Transferred semantic nodes exceed the offered tree capacity");
|
|
11750
|
+
const newUnknowns = projection.unknowns.filter(({ unknown_id }) => !state.unknowns.has(unknown_id));
|
|
11751
|
+
if (newUnknowns.length > Math.min(fileUnknownCeiling, unknownCeiling - state.unknowns.size)) throw new RangeError("Transferred semantic unknowns exceed the offered tree capacity");
|
|
11752
|
+
for (const omission of projection.omittedUnknownOccurrences ?? []) recordSemanticUnknownOmission(state, omission);
|
|
10974
11753
|
for (const context of projection.evidenceContexts) state.evidenceContexts.adopt(context);
|
|
10975
11754
|
for (const node of newNodes) state.nodes.set(node.node_id, node);
|
|
10976
11755
|
for (const relation of projection.relations) state.relations.set(relation.relation_id, relation);
|
|
10977
|
-
for (const unknown of
|
|
11756
|
+
for (const unknown of newUnknowns) state.unknowns.set(unknown.unknown_id, unknown);
|
|
10978
11757
|
for (const root of projection.roots) state.roots.add(root);
|
|
10979
11758
|
fingerprints.push(...projection.fingerprints);
|
|
10980
|
-
if (projection.
|
|
11759
|
+
if (projection.nodesTruncated) truncatedFiles += 1;
|
|
10981
11760
|
},
|
|
10982
11761
|
recordUnavailableFile: (file, reason, limits, unknownReason) => {
|
|
11762
|
+
if (file.kind !== "javascript") return;
|
|
10983
11763
|
const retainedLimits = javaScriptAnalysisCoverageLimits(limits);
|
|
10984
11764
|
for (const limit of retainedLimits) {
|
|
10985
11765
|
executionLimits.set(JSON.stringify([
|
|
@@ -11006,8 +11786,9 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
11006
11786
|
coverage: partialApplicationCoverage(retainedLimits, null),
|
|
11007
11787
|
limitations: [reason]
|
|
11008
11788
|
};
|
|
11789
|
+
state.unknownCapacity = Math.min(unknownCeiling, state.unknowns.size + fileUnknownCeiling);
|
|
11009
11790
|
for (const family of JAVASCRIPT_SEMANTIC_RELATION_FAMILIES) {
|
|
11010
|
-
|
|
11791
|
+
addSemanticGraphUnknown(state, {
|
|
11011
11792
|
node_id: module?.node_id ?? null,
|
|
11012
11793
|
family,
|
|
11013
11794
|
relation_kinds: JAVASCRIPT_SEMANTIC_RELATIONS.filter((relation) => JAVASCRIPT_SEMANTIC_RELATION_FAMILY[relation] === family),
|
|
@@ -11015,9 +11796,9 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
11015
11796
|
detail: reason,
|
|
11016
11797
|
candidate_node_ids: [],
|
|
11017
11798
|
evidence
|
|
11018
|
-
}
|
|
11019
|
-
state.unknowns.set(unknown.unknown_id, unknown);
|
|
11799
|
+
});
|
|
11020
11800
|
}
|
|
11801
|
+
state.unknownCapacity = null;
|
|
11021
11802
|
unavailableFiles += 1;
|
|
11022
11803
|
if (unknownReason === "resource-limit" && retainedLimits.length > 0) resourceTruncatedFiles += 1;
|
|
11023
11804
|
},
|
|
@@ -11030,6 +11811,24 @@ function init_JavaScriptSemanticGraphBuilder() {
|
|
|
11030
11811
|
finishImmutableSteps: (rootArtifactSha256, applicationGraph) => finishWith(sealTransferredJavaScriptSemanticGraphSteps, rootArtifactSha256, applicationGraph)
|
|
11031
11812
|
};
|
|
11032
11813
|
};
|
|
11814
|
+
projectFileResourceLimits = (context) => {
|
|
11815
|
+
for (const limit of semanticCoverageResourceLimits(context.ir.coverage)) {
|
|
11816
|
+
if (limit !== "getter-expansion") continue;
|
|
11817
|
+
addSemanticGraphUnknown(context.state, {
|
|
11818
|
+
node_id: context.moduleNode.node_id,
|
|
11819
|
+
family: "data-flow",
|
|
11820
|
+
relation_kinds: ["defines"],
|
|
11821
|
+
reason: "resource-limit",
|
|
11822
|
+
detail: semanticResourceLimitReason(limit),
|
|
11823
|
+
candidate_node_ids: [],
|
|
11824
|
+
evidence: {
|
|
11825
|
+
...unknownSemanticEvidence(context.file, null),
|
|
11826
|
+
coverage: partialApplicationCoverage(semanticResourceLimitCoverage([limit]), null),
|
|
11827
|
+
limitations: [semanticResourceLimitReason(limit)]
|
|
11828
|
+
}
|
|
11829
|
+
});
|
|
11830
|
+
}
|
|
11831
|
+
};
|
|
11033
11832
|
projectCalls = (context) => {
|
|
11034
11833
|
for (const call of context.ir.callSites) {
|
|
11035
11834
|
const callNode = context.callSiteNodes.get(call.callSiteId);
|
|
@@ -11116,6 +11915,7 @@ function init_JavaScriptArtifactReconstruction() {
|
|
|
11116
11915
|
init_analysisErrorBase();
|
|
11117
11916
|
init_artifactOperationError();
|
|
11118
11917
|
init_JavaScriptArtifactAnalysis();
|
|
11918
|
+
init_JavaScriptArtifactAnalysisTypes();
|
|
11119
11919
|
init_JavaScriptSourceAnalysis();
|
|
11120
11920
|
init_javascriptAnalysisResourceControls();
|
|
11121
11921
|
init_JavaScriptApplicationEvidence();
|
|
@@ -11163,8 +11963,10 @@ function init_JavaScriptArtifactReconstruction() {
|
|
|
11163
11963
|
kind: "artifact-inventory",
|
|
11164
11964
|
inventory: snapshot
|
|
11165
11965
|
});
|
|
11166
|
-
await reportPhase("parse_javascript_sources", `
|
|
11966
|
+
await reportPhase("parse_javascript_sources", `Processing ${String(files.files.length - (files.source_selection?.unselected_files ?? 0))} selected application files`);
|
|
11167
11967
|
const semanticProjection = createJavaScriptSemanticGraphProjection({
|
|
11968
|
+
...input.max_semantic_unknowns === undefined ? {} : { totalUnknowns: input.max_semantic_unknowns },
|
|
11969
|
+
...input.max_semantic_unknowns_per_file === undefined ? {} : { fileUnknowns: input.max_semantic_unknowns_per_file },
|
|
11168
11970
|
...input.max_semantic_nodes === undefined ? {} : { totalNodes: input.max_semantic_nodes },
|
|
11169
11971
|
...input.max_semantic_nodes_per_file === undefined ? {} : { fileNodes: input.max_semantic_nodes_per_file }
|
|
11170
11972
|
});
|
|
@@ -11177,11 +11979,12 @@ function init_JavaScriptArtifactReconstruction() {
|
|
|
11177
11979
|
try {
|
|
11178
11980
|
outcome = await analyzeAndAdoptJavaScriptArtifactFiles(files, worker, semanticProjection, async (file, completed, total) => {
|
|
11179
11981
|
abortIfNeeded(signal);
|
|
11982
|
+
const ast = javascriptArtifactAnalysisScopes[file.kind]?.authority === "ast-static-analysis";
|
|
11180
11983
|
await progress?.report({
|
|
11181
|
-
phase: "parse_javascript_source",
|
|
11984
|
+
phase: ast ? "parse_javascript_source" : "process_javascript_artifact_metadata",
|
|
11182
11985
|
completed: 0,
|
|
11183
11986
|
total: 1,
|
|
11184
|
-
message:
|
|
11987
|
+
message: `${ast ? "Parsing and projecting" : "Processing metadata for"} ${file.path} (${String(completed + 1)}/${String(total)})`
|
|
11185
11988
|
});
|
|
11186
11989
|
abortIfNeeded(signal);
|
|
11187
11990
|
}, signal);
|
|
@@ -11240,6 +12043,7 @@ function init_JavaScriptArtifactReconstruction() {
|
|
|
11240
12043
|
text_bytes_read: files.text_bytes_read,
|
|
11241
12044
|
invalid_utf8_files: files.invalid_utf8_files,
|
|
11242
12045
|
parsed_javascript_files: analysis.files.filter(({ javascript }) => javascript !== null).length,
|
|
12046
|
+
skipped_javascript_files: analysis.files.filter(isSkippedJavaScriptAnalysis).length,
|
|
11243
12047
|
visited_ast_nodes: analysis.visited_ast_nodes,
|
|
11244
12048
|
findings: analysis.findings,
|
|
11245
12049
|
modules: analysis.modules,
|