reverseport 0.0.0-stage → 1.2.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/DISCLAIMER.md +136 -0
- package/LICENSE +22 -0
- package/README.md +289 -2
- package/RESPONSIBLE-USE.md +22 -0
- package/THIRD_PARTY_NOTICES.md +130 -0
- package/bin/reverseport.mjs +136 -0
- package/bridge/android/ReaJadxBridge.java +270 -0
- package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +3858 -0
- package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
- package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
- package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
- package/bridge/ghidra/ReaGhidraPrepareRaw.java +36 -0
- package/bridge/hopper_bridge.py +1162 -0
- package/bridge/mitmproxy/capture.py +208 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +171 -0
- package/bridge/native/rea_lldb_tracer.py +839 -0
- package/bridge/process/ProcessRunTokenReader.swift +339 -0
- package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
- package/bridge/pwndbg/core_context.py +101 -0
- package/bridge/pwndbg/launch.py +39 -0
- package/bridge/pwndbg/launch_impl.py +34 -0
- package/bridge/pwntools/decoder_runtime.py +59 -0
- package/bridge/pwntools/layout.py +39 -0
- package/bridge/pwntools/layout_impl.py +314 -0
- package/bridge/pwntools/recorded_crash.py +39 -0
- package/bridge/pwntools/recorded_crash_impl.py +147 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +191 -0
- package/dist/adb/AdbDirectoryListing.js +80 -0
- package/dist/adb/AdbHostFileName.js +34 -0
- package/dist/adb/AdbProvider.js +1227 -0
- package/dist/adb/AdbShellOutput.js +267 -0
- package/dist/android/AndroidTargetSnapshot.js +118 -0
- package/dist/android/JadxAnalysis.js +201 -0
- package/dist/android/JadxConfiguration.js +320 -0
- package/dist/android/JadxMcpTransport.js +188 -0
- package/dist/android/JadxProtocol.js +115 -0
- package/dist/android/JadxProvider.js +337 -0
- package/dist/android/JadxRelease.js +27 -0
- package/dist/android/JadxSession.js +172 -0
- package/dist/apktool/ApktoolConfiguration.js +120 -0
- package/dist/apktool/ApktoolDecodeOutput.js +142 -0
- package/dist/apktool/ApktoolProvider.js +522 -0
- package/dist/application/AnalysisContextQueries.js +128 -0
- package/dist/application/AnalysisDocument.js +32 -0
- package/dist/application/AnalysisProvider.js +27 -0
- package/dist/application/AppBundleExecutable.js +192 -0
- package/dist/application/BinaryTargetResolver.js +356 -0
- package/dist/application/BrowserEvidence.js +127 -0
- package/dist/application/BrowserObservationPort.js +1 -0
- package/dist/application/BrowserObservationService.js +86 -0
- package/dist/application/BrowserScenarioCapturePort.js +1 -0
- package/dist/application/BrowserScenarioCaptureService.js +17 -0
- package/dist/application/BrowserScenarioEvidence.js +28 -0
- package/dist/application/CallPathTracing.js +182 -0
- package/dist/application/CapabilityClientRequirements.js +17 -0
- package/dist/application/CapabilityInventory.js +525 -0
- package/dist/application/ClientConfigPath.js +35 -0
- package/dist/application/ClientConfigurationDocument.js +1196 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +39 -0
- package/dist/application/ClientRegistrationIdentity.js +80 -0
- package/dist/application/ClientRegistrationStatus.js +233 -0
- package/dist/application/DirectAnalysis.js +371 -0
- package/dist/application/DirectAnalysisCleanup.js +71 -0
- package/dist/application/DirectAnalysisDependencies.js +1 -0
- package/dist/application/DirectAnalysisStatus.js +22 -0
- package/dist/application/Doctor.js +349 -0
- package/dist/application/DoctorDiagnostics.js +169 -0
- package/dist/application/DoctorProviderIds.js +2 -0
- package/dist/application/DoctorScope.js +113 -0
- package/dist/application/DshCordisPatch.js +342 -0
- package/dist/application/DshCordisYaml.js +155 -0
- package/dist/application/EnhancedLiteralTracing.js +88 -0
- package/dist/application/EnhancedToolTypes.js +4 -0
- package/dist/application/EnhancedTools.js +428 -0
- package/dist/application/EvidenceBundleCommands.js +70 -0
- package/dist/application/EvidenceBundleFiles.js +79 -0
- package/dist/application/EvidenceInputResolver.js +30 -0
- package/dist/application/FunctionAnalysisEvidence.js +34 -0
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InventoryProjectionEvidence.js +44 -0
- package/dist/application/InvestigationProviders.js +130 -0
- package/dist/application/JsonFiles.js +225 -0
- package/dist/application/JsonInputFile.js +410 -0
- package/dist/application/LinuxHopper.js +232 -0
- package/dist/application/MacHopper.js +235 -0
- package/dist/application/MipsElfMetadata.js +175 -0
- package/dist/application/MipsElfSharedLoad.js +164 -0
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ProcedureAddressResolution.js +11 -0
- package/dist/application/ProgressReporter.js +30 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/RealHopperAssertions.js +135 -0
- package/dist/application/ReconstructionCoverageService.js +22 -0
- package/dist/application/ReconstructionObligationAuthority.js +72 -0
- package/dist/application/ReconstructionObligationCandidates.js +286 -0
- package/dist/application/ReconstructionObligationLedgerDiagnostics.js +47 -0
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +238 -0
- package/dist/application/ReconstructionObligationLedgerProjection.js +15 -0
- package/dist/application/ReconstructionObligationLedgerService.js +54 -0
- package/dist/application/ReconstructionObligationOriginalCases.js +34 -0
- package/dist/application/ReconstructionObligationPolicies.js +132 -0
- package/dist/application/ReferenceSourceImport.js +200 -0
- package/dist/application/ReferenceSourceImportEntries.js +151 -0
- package/dist/application/ReferenceSourceImportPolicy.js +125 -0
- package/dist/application/ReferenceSourceImportTypes.js +47 -0
- package/dist/application/ReferenceSourceVcsAdapter.js +180 -0
- package/dist/application/RegularFileRead.js +120 -0
- package/dist/application/Setup.js +408 -0
- package/dist/application/SetupClientConfiguration.js +314 -0
- package/dist/application/SetupClients.js +44 -0
- package/dist/application/SetupHost.js +203 -0
- package/dist/application/SetupInstallFailure.js +77 -0
- package/dist/application/SetupPlan.js +210 -0
- package/dist/application/SetupRegistrationEnvironment.js +5 -0
- package/dist/application/SetupSkill.js +248 -0
- package/dist/application/SetupTypes.js +17 -0
- package/dist/application/SupportedClients.js +469 -0
- package/dist/application/TypeScriptEmittedSourceCandidates.js +23 -0
- package/dist/application/Uninstall.js +452 -0
- package/dist/application/UninstallFailure.js +14 -0
- package/dist/application/Update.js +137 -0
- package/dist/application/UpdateFailure.js +17 -0
- package/dist/application/UpdateMaintenance.js +111 -0
- package/dist/application/UpdateRuntime.js +264 -0
- package/dist/application/Utf8JsonInput.js +71 -0
- package/dist/application/ValidateSelectedWebScript.js +27 -0
- package/dist/application/WebModulePorts.js +1 -0
- package/dist/application/WebModuleTraceService.js +214 -0
- package/dist/application/WebNetworkCapturePort.js +1 -0
- package/dist/application/WebNetworkCaptureService.js +134 -0
- package/dist/application/WebRuntimePort.js +1 -0
- package/dist/application/WebRuntimeService.js +75 -0
- package/dist/application/WebScriptArtifactPort.js +1 -0
- package/dist/application/WebScriptExportService.js +214 -0
- package/dist/application/WebSourceLocationPorts.js +1 -0
- package/dist/application/WebSourceLocationService.js +177 -0
- package/dist/application/WindowsCapabilities.js +87 -0
- package/dist/application/WorkflowEvidence.js +105 -0
- package/dist/application/XrefsAddressResolution.js +45 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +133 -0
- package/dist/application/android/AndroidAnalysisPort.js +1 -0
- package/dist/application/android/AndroidAnalysisService.js +37 -0
- package/dist/application/android/AndroidApplicationService.js +17 -0
- package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/apple/AppleApplicationService.js +17 -0
- package/dist/application/artifacts/ArtifactExtractionDestination.js +5 -0
- package/dist/application/binary/AbortablePromise.js +28 -0
- package/dist/application/binary/AnalysisClientCleanup.js +15 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +77 -0
- package/dist/application/binary/AnalysisProviderRegistry.js +235 -0
- package/dist/application/binary/AnalysisSnapshotCache.js +232 -0
- package/dist/application/binary/AnalysisSnapshotFiles.js +96 -0
- package/dist/application/binary/BinarySession.js +605 -0
- package/dist/application/binary/BinarySessionComposition.js +9 -0
- package/dist/application/binary/BinarySessionExecution.js +66 -0
- package/dist/application/binary/BinarySessionOpen.js +66 -0
- package/dist/application/binary/BinarySessionPort.js +1 -0
- package/dist/application/binary/BinarySessionRecords.js +216 -0
- package/dist/application/binary/BinarySessionStatus.js +219 -0
- package/dist/application/binary/BinaryTargetSummary.js +9 -0
- package/dist/application/binary/CompositeProvider.js +103 -0
- package/dist/application/binary/LazyAnalysisProvider.js +105 -0
- package/dist/application/binary/SessionProviderRouter.js +118 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +60 -0
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +63 -0
- package/dist/application/evm/EvmInterfacePort.js +1 -0
- package/dist/application/evm/EvmInterfaceService.js +67 -0
- package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +38 -0
- package/dist/application/go/GoBinaryPort.js +1 -0
- package/dist/application/go/GoBinaryService.js +77 -0
- package/dist/application/harmony/HarmonyApplicationService.js +17 -0
- package/dist/application/homebrew.js +67 -0
- package/dist/application/investigation/EvidenceLedger.js +338 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/investigation/InvestigationRecordPort.js +1 -0
- package/dist/application/investigation/InvestigationRecords.js +65 -0
- package/dist/application/investigation/UnknownEvidence.js +37 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +29 -0
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/javascript/ElectronActiveObservationService.js +51 -0
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +118 -0
- package/dist/application/javascript/ElectronBoundaryGraph.js +11 -0
- package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +134 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +63 -0
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +261 -0
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +102 -0
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +224 -0
- package/dist/application/javascript/ElectronEvidence.js +37 -0
- package/dist/application/javascript/ElectronObservationPort.js +1 -0
- package/dist/application/javascript/ElectronObservationService.js +26 -0
- package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +49 -0
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +173 -0
- package/dist/application/javascript/JavaScriptApplicationService.js +170 -0
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +67 -0
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +194 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +431 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +89 -0
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +193 -0
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +229 -0
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +194 -0
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +160 -0
- package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +85 -0
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +349 -0
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +424 -0
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +836 -0
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +245 -0
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +12 -0
- package/dist/application/javascript/JavaScriptJsonModules.js +40 -0
- package/dist/application/javascript/JavaScriptModuleRelationships.js +304 -0
- package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
- package/dist/application/javascript/JavaScriptRecoveryService.js +77 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +36 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +28 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationEvidence.js +24 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +52 -0
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +163 -0
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +527 -0
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +165 -0
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +156 -0
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +216 -0
- package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +61 -0
- package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +86 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +25 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +183 -0
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +112 -0
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +144 -0
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +58 -0
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +136 -0
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +41 -0
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +55 -0
- package/dist/application/managed/ManagedMemberComparisonService.js +125 -0
- package/dist/application/managed/ManagedNativeVerificationService.js +40 -0
- package/dist/application/managed/ManagedReconstructionService.js +59 -0
- package/dist/application/native/NativeApiInspection.js +77 -0
- package/dist/application/native/NativeCallRoutes.js +73 -0
- package/dist/application/native/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/native/NativeUiActionTrace.js +427 -0
- package/dist/application/native/NativeValueTrace.js +340 -0
- package/dist/application/process/ProcessCli.js +190 -0
- package/dist/application/process/ProcessEvidence.js +30 -0
- package/dist/application/wasm/WasmArtifactPort.js +1 -0
- package/dist/application/wasm/WasmArtifactService.js +72 -0
- package/dist/application/workflowInputError.js +18 -0
- package/dist/artifacts/ArtifactHash.js +29 -0
- package/dist/artifacts/ArtifactPaths.js +167 -0
- package/dist/artifacts/ArtifactProvider.js +280 -0
- package/dist/artifacts/ArtifactProviderMetadata.js +34 -0
- package/dist/artifacts/ArtifactReader.js +77 -0
- package/dist/artifacts/ArtifactResourceScope.js +103 -0
- package/dist/artifacts/AsarArtifactReader.js +518 -0
- package/dist/artifacts/AsarEntryStream.js +76 -0
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +292 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +342 -0
- package/dist/artifacts/NativeDmgArtifactReader.js +508 -0
- package/dist/artifacts/NativeDmgOwnership.js +109 -0
- package/dist/artifacts/SafeOutputTree.js +394 -0
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/StreamBytes.js +10 -0
- package/dist/artifacts/ZipArtifactReader.js +222 -0
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +190 -0
- package/dist/artifacts/apple/DylibResolutionReader.js +269 -0
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +500 -0
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +233 -0
- package/dist/artifacts/apple/KeyedArchiveReader.js +163 -0
- package/dist/artifacts/apple/MachoLoadCommandReader.js +393 -0
- package/dist/artifacts/apple/NibArchive.js +338 -0
- package/dist/artifacts/apple/NibViewHierarchy.js +157 -0
- package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
- package/dist/artifacts/extraction/ArtifactExtraction.js +253 -0
- package/dist/artifacts/hostExecutableMarking.js +16 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +343 -0
- package/dist/artifacts/inventory/ArtifactInventory.js +16 -0
- package/dist/artifacts/inventory/classify.js +94 -0
- package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
- package/dist/artifacts/inventory/reader.js +40 -0
- package/dist/artifacts/inventory/scanCanonical.js +213 -0
- package/dist/artifacts/inventory/scanReader.js +169 -0
- package/dist/artifacts/inventory/types.js +3 -0
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +317 -0
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/artifacts/readStableArtifact.js +68 -0
- package/dist/browser/BrowserProcessStartup.js +89 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +127 -0
- package/dist/browser/BrowserScenarioSecrets.js +137 -0
- package/dist/browser/BrowserScenarioSessionPort.js +1 -0
- package/dist/browser/CdpAuthorizedMainFrame.js +16 -0
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +276 -0
- package/dist/browser/CdpCaptureCompleteness.js +92 -0
- package/dist/browser/CdpCaptureDocuments.js +375 -0
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +55 -0
- package/dist/browser/CdpCaptureEventHandlers.js +463 -0
- package/dist/browser/CdpCaptureEventHelpers.js +84 -0
- package/dist/browser/CdpCaptureEventState.js +1 -0
- package/dist/browser/CdpCaptureEventTypes.js +5 -0
- package/dist/browser/CdpCaptureEvents.js +199 -0
- package/dist/browser/CdpCaptureStorage.js +86 -0
- package/dist/browser/CdpCaptureStorageFingerprints.js +320 -0
- package/dist/browser/CdpCaptureValues.js +91 -0
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +303 -0
- package/dist/browser/CdpElectronInspection.js +253 -0
- package/dist/browser/CdpElectronProvider.js +115 -0
- package/dist/browser/CdpElectronScriptEvents.js +55 -0
- package/dist/browser/CdpElectronScripts.js +65 -0
- package/dist/browser/CdpElectronWorkers.js +57 -0
- package/dist/browser/CdpEndpoint.js +217 -0
- package/dist/browser/CdpObservationSession.js +332 -0
- package/dist/browser/CdpOptionalCommand.js +14 -0
- package/dist/browser/CdpPageCapture.js +278 -0
- package/dist/browser/CdpPageCaptureScripts.js +79 -0
- package/dist/browser/CdpPageCaptureWorkers.js +46 -0
- package/dist/browser/CdpSafeMetadata.js +284 -0
- package/dist/browser/CdpScreenshot.js +110 -0
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +65 -0
- package/dist/browser/CdpWebMcpDiscovery.js +361 -0
- package/dist/browser/ElectronFileScope.js +135 -0
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +301 -0
- package/dist/browser/PlaywrightElectronActiveActions.js +257 -0
- package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +293 -0
- package/dist/browser/PlaywrightExecutionBoundary.js +53 -0
- package/dist/browser/PlaywrightScenarioActions.js +58 -0
- package/dist/browser/PlaywrightScenarioArtifacts.js +162 -0
- package/dist/browser/PlaywrightScenarioBrowser.js +412 -0
- package/dist/browser/PlaywrightScenarioEvents.js +253 -0
- package/dist/browser/PlaywrightScenarioSession.js +279 -0
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +380 -0
- package/dist/browser/WebSourceMapFetcher.js +718 -0
- package/dist/browser/assets/LocalWebScriptArtifacts.js +89 -0
- package/dist/browser/assets/PageScriptCapture.js +32 -0
- package/dist/browser/assets/PublishWebScripts.js +140 -0
- package/dist/browser/assets/ScenarioScriptCapture.js +73 -0
- package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
- package/dist/browser/assets/WebArtifactReads.js +78 -0
- package/dist/browser/assets/WebSourceLocationArtifacts.js +41 -0
- package/dist/browser/execution/CdpEventListeners.js +79 -0
- package/dist/browser/execution/CdpExecutionCapture.js +135 -0
- package/dist/browser/execution/CdpExecutionCollection.js +57 -0
- package/dist/browser/execution/CdpExecutionWindow.js +100 -0
- package/dist/browser/execution/CdpListenerSelector.js +22 -0
- package/dist/browser/execution/CdpPreciseCoverage.js +45 -0
- package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
- package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
- package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
- package/dist/browser/execution/CdpRuntimeSession.js +163 -0
- package/dist/browser/execution/CdpRuntimeSources.js +223 -0
- package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
- package/dist/browser/history/CaptureFailures.js +153 -0
- package/dist/browser/history/CaptureFormatError.js +10 -0
- package/dist/browser/history/CaptureRedaction.js +68 -0
- package/dist/browser/history/CaptureRelease.js +23 -0
- package/dist/browser/history/HarCapture.js +179 -0
- package/dist/browser/history/HarCaptureAdapter.js +23 -0
- package/dist/browser/history/HarCaptureProcess.js +49 -0
- package/dist/browser/history/HarJson.js +92 -0
- package/dist/browser/history/HarSchema.js +72 -0
- package/dist/browser/history/HistoricalCaptureDecoder.js +198 -0
- package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
- package/dist/browser/history/MitmproxyCaptureAdapter.js +46 -0
- package/dist/browser/modules/NativeModuleResolver.js +277 -0
- package/dist/browser/modules/WebModuleArtifacts.js +41 -0
- package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
- package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
- package/dist/browser/providerIdentities.js +24 -0
- package/dist/catalogIdentity.js +65 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisSelector.js +23 -0
- package/dist/cli/analysisViewCommands.js +74 -0
- package/dist/cli/androidCommands.js +91 -0
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/applicationCommands.js +173 -0
- package/dist/cli/artifactCommands.js +160 -0
- package/dist/cli/binaryDiagnosticsCommands.js +57 -0
- package/dist/cli/browserAdvancedCommands.js +189 -0
- package/dist/cli/browserCommands.js +125 -0
- package/dist/cli/commandCancellation.js +24 -0
- package/dist/cli/coreAnalysisCommands.js +7 -0
- package/dist/cli/coreBinaryCommands.js +283 -0
- package/dist/cli/coreNativeCommands.js +269 -0
- package/dist/cli/electronCommands.js +150 -0
- package/dist/cli/evmCommands.js +33 -0
- package/dist/cli/firmwareCommands.js +61 -0
- package/dist/cli/goCommands.js +21 -0
- package/dist/cli/interactiveSetup.js +236 -0
- package/dist/cli/javascriptApplicationAnalysis.js +34 -0
- package/dist/cli/javascriptRecoveryCommands.js +59 -0
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +46 -0
- package/dist/cli/managedCommands.js +129 -0
- package/dist/cli/managedProjectGraphCommand.js +24 -0
- package/dist/cli/nativeCallCommands.js +33 -0
- package/dist/cli/omittableDefaults.js +50 -0
- package/dist/cli/options.js +33 -0
- package/dist/cli/processCommands.js +25 -0
- package/dist/cli/referenceSourceImportStatus.js +22 -0
- package/dist/cli/setupCommands.js +189 -0
- package/dist/cli/streamedJsonOutput.js +134 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utilityCommands.js +226 -0
- package/dist/cli/wasmCommands.js +44 -0
- package/dist/cli/webModuleCommands.js +60 -0
- package/dist/cli/webNetworkCaptureCommands.js +40 -0
- package/dist/cli/webRuntimeCommands.js +60 -0
- package/dist/cli/webScriptCommands.js +50 -0
- package/dist/cli/webSourceLocationCommands.js +54 -0
- package/dist/cli-runtime/AnalysisProvider-CeyX2u-b.js +25 -0
- package/dist/cli-runtime/AnalysisSnapshotFiles-BuK_ymw5.js +523 -0
- package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
- package/dist/cli-runtime/ArtifactResourceScope-CZqLEfbb.js +108 -0
- package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
- package/dist/cli-runtime/BinaryTargetResolver-CKRfFhLj.js +965 -0
- package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
- package/dist/cli-runtime/ClientConfigurationDocument-D0ZqgTCv.js +1522 -0
- package/dist/cli-runtime/ClientRegistrationStatus-DGpwJ4ry.js +422 -0
- package/dist/cli-runtime/DirectAnalysis-DW3MvxW0.js +500 -0
- package/dist/cli-runtime/Doctor-CzwYS9nB.js +862 -0
- package/dist/cli-runtime/ElectronFileScope-C1hUEp36.js +1419 -0
- package/dist/cli-runtime/ExecFileOutput-Czbj-HpV.js +106 -0
- package/dist/cli-runtime/IdaConfiguration-rEjpuRQ1.js +854 -0
- package/dist/cli-runtime/InterfaceBuilderDecodeBudget-DT74BY9z.js +225 -0
- package/dist/cli-runtime/InventoryProjectionEvidence-Dt4Og45O.js +49 -0
- package/dist/cli-runtime/InvestigationProviders-D-QCy-4c.js +117 -0
- package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-CODAjVru.js +160 -0
- package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-CCtwSg8r.js +75 -0
- package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-CJeBSMPx.js +83 -0
- package/dist/cli-runtime/JsonFiles-Ce_O5NcH.js +708 -0
- package/dist/cli-runtime/ManagedSnapshot-DthWfmy9.js +3622 -0
- package/dist/cli-runtime/OwnedCommand-CnK8-h3N.js +106 -0
- package/dist/cli-runtime/PrivateRuntimeRoot-KNg6qLwo.js +237 -0
- package/dist/cli-runtime/ProcessOwnership-AOJaszxt.js +1310 -0
- package/dist/cli-runtime/ProviderDeadline-BSbNOmuW.js +89 -0
- package/dist/cli-runtime/RegularFile-CL6meBxi.js +114 -0
- package/dist/cli-runtime/RegularFileRead-BMh5FMXd.js +115 -0
- package/dist/cli-runtime/SafeOutputTree-D8z2Zrnu.js +512 -0
- package/dist/cli-runtime/SetupHost-CzzRF89z.js +842 -0
- package/dist/cli-runtime/SupportedClients-BrZ2qZVg.js +671 -0
- package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
- package/dist/cli-runtime/Update-DF55X_N2.js +143 -0
- package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
- package/dist/cli-runtime/WindowsBatchCommand-5gT-d7O4.js +45 -0
- package/dist/cli-runtime/ZipArtifactReader-Db65WuM_.js +380 -0
- package/dist/cli-runtime/analysisErrorCleanup-DaUQNiQd.js +32 -0
- package/dist/cli-runtime/analysisErrorPresentation-DZrKL8kS.js +331 -0
- package/dist/cli-runtime/application__DirectAnalysisStatus-OZFIFjZr.js +93 -0
- package/dist/cli-runtime/application__EnhancedTools-C__HAdqG.js +1728 -0
- package/dist/cli-runtime/application__FunctionAnalysisEvidence-fWSgvV74.js +41 -0
- package/dist/cli-runtime/application__ReconstructionCoverageService-DlNt-4TY.js +32 -0
- package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CEpbUv-7.js +813 -0
- package/dist/cli-runtime/application__Setup-BExVGpqG.js +540 -0
- package/dist/cli-runtime/application__Uninstall-BVgWDCPN.js +349 -0
- package/dist/cli-runtime/application__UpdateRuntime-Dj6UIhHQ.js +358 -0
- package/dist/cli-runtime/application__android__AndroidApplicationService-CyynwW6Z.js +31 -0
- package/dist/cli-runtime/application__apple__AppleApplicationService-BNPcWeL8.js +31 -0
- package/dist/cli-runtime/application__harmony__HarmonyApplicationService-W66PwMvx.js +31 -0
- package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-D8VbeCxz.js +85 -0
- package/dist/cli-runtime/application__javascript__ElectronObservationService-FmXFG4f2.js +63 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-D-dVrmAY.js +10467 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-Cb0jmh8J.js +2284 -0
- package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-D55gO7Gq.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DivM-Ym-.js +298 -0
- package/dist/cli-runtime/artifactOperationError-Wd0PRLIZ.js +27 -0
- package/dist/cli-runtime/artifacts__ArtifactProvider-B_4h3RAw.js +2091 -0
- package/dist/cli-runtime/binary-9Gt3vJ1P.js +12990 -0
- package/dist/cli-runtime/browserObservationError-D73SM55P.js +40 -0
- package/dist/cli-runtime/browserScenario-CTNr5ISp.js +5543 -0
- package/dist/cli-runtime/catalogIdentity-EYVhBUYJ.js +339 -0
- package/dist/cli-runtime/cli.js +28528 -0
- package/dist/cli-runtime/cliOutput-CoDmWVu5.js +98 -0
- package/dist/cli-runtime/cliOutput.js +5 -0
- package/dist/cli-runtime/composition__browserScenario-DNr3A_BM.js +2318 -0
- package/dist/cli-runtime/composition__electronObservation-DNw1f38M.js +550 -0
- package/dist/cli-runtime/composition__electronScenario-Cu7PX270.js +586 -0
- package/dist/cli-runtime/configurationErrors-ByuF6gMR.js +49 -0
- package/dist/cli-runtime/doctorRuntime-D5y43lEp.js +162 -0
- package/dist/cli-runtime/dosMz-pwwUuxyC.js +65 -0
- package/dist/cli-runtime/dotnet__ManagedStaticProvider-BSnWggeb.js +5 -0
- package/dist/cli-runtime/enhancedInputs-K8C_o3b4.js +56 -0
- package/dist/cli-runtime/javascriptApplicationGraph-DUWeec4O.js +940 -0
- package/dist/cli-runtime/javascriptExportReturnShapeProjection-BVbnAdOd.js +78 -0
- package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BzSil7ft.js +1153 -0
- package/dist/cli-runtime/javascriptRuntimeObservation-9xTNoKY2.js +1215 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliation-CneBtMvx.js +1437 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D1Mrb_Y0.js +245 -0
- package/dist/cli-runtime/javascriptSemanticTraceSchemas-BHItrqIA.js +126 -0
- package/dist/cli-runtime/lipo-BCA3wVyN.js +365 -0
- package/dist/cli-runtime/logger-CKq3JfbZ.js +34 -0
- package/dist/cli-runtime/machoContainer-DxxkB2b0.js +52 -0
- package/dist/cli-runtime/managedApplicationGraph-BqOr01E6.js +1116 -0
- package/dist/cli-runtime/managedToolContracts-BSy4TRaK.js +80 -0
- package/dist/cli-runtime/mcpDoctor.js +342 -0
- package/dist/cli-runtime/mcpStartupPolicy-Bb7TMLzn.js +18 -0
- package/dist/cli-runtime/native__NativeMacOSProvider-BIG9iCcj.js +4415 -0
- package/dist/cli-runtime/plistValue-KM-SqiXe.js +47 -0
- package/dist/cli-runtime/propertyListKeys-DejfMb-U.js +86 -0
- package/dist/cli-runtime/providerAdapterError-SRSE_gzN.js +27 -0
- package/dist/cli-runtime/providerCleanupError-Do66qCEp.js +27 -0
- package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
- package/dist/cli-runtime/providerOperationHealth-DSTcYPJe.js +577 -0
- package/dist/cli-runtime/providerStartupTimeout-Be8B1Ro8.js +16 -0
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
- package/dist/cli-runtime/reconstructionObligationLedgerSchemas-dvp6PEnZ.js +15839 -0
- package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
- package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
- package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
- package/dist/cli-runtime/scanCanonical-Bi6si9nb.js +2773 -0
- package/dist/cli-runtime/snapshotEnvironment-B5Ai0mha.js +678 -0
- package/dist/cli-runtime/streamedJsonOutput-VYlQZsM7.js +654 -0
- package/dist/cli-runtime/streamedJsonOutput.js +5 -0
- package/dist/cli-runtime/toolContracts-C7pvYKxF.js +4516 -0
- package/dist/cli-runtime/toolEffects-DW31yTSx.js +7004 -0
- package/dist/cli-runtime/workflowInputError-26EGiDpx.js +26 -0
- package/dist/cli.js +91 -0
- package/dist/cliBrowserContext.js +11 -0
- package/dist/cliBrowserScenarioCommands.js +73 -0
- package/dist/cliCommandNames.js +205 -0
- package/dist/cliEvidenceCommands.js +51 -0
- package/dist/cliJavaScriptRuntimeCommands.js +69 -0
- package/dist/cliJsonInput.js +129 -0
- package/dist/cliLogging.js +48 -0
- package/dist/cliObservationOptions.js +73 -0
- package/dist/cliOutput.js +97 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/android.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +35 -0
- package/dist/composition/binary.js +25 -0
- package/dist/composition/binaryDiagnostics.js +12 -0
- package/dist/composition/browserObservation.js +3 -0
- package/dist/composition/browserScenario.js +4 -0
- package/dist/composition/directAnalysis.js +44 -0
- package/dist/composition/electronObservation.js +3 -0
- package/dist/composition/electronScenario.js +3 -0
- package/dist/composition/evm.js +4 -0
- package/dist/composition/firmware.js +3 -0
- package/dist/composition/go.js +4 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/javascriptRecovery.js +3 -0
- package/dist/composition/javascriptRuntimeObservation.js +3 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/composition/optionalObservationProviders.js +54 -0
- package/dist/composition/wasm.js +4 -0
- package/dist/composition/webModules.js +5 -0
- package/dist/composition/webNetworkCaptures.js +6 -0
- package/dist/composition/webRuntime.js +4 -0
- package/dist/composition/webSourceLocations.js +5 -0
- package/dist/config/environment.js +73 -0
- package/dist/config/ghidraDisabledAnalyzers.js +25 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/homeDirectory.js +12 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/mcpResponseBudget.js +30 -0
- package/dist/config/parseConfig.js +93 -0
- package/dist/config/parsers.js +30 -0
- package/dist/config/providerStartupTimeout.js +13 -0
- package/dist/config/types.js +1 -0
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +13 -0
- package/dist/contracts/analysisSearchContract.js +14 -0
- package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
- package/dist/contracts/analysisViewToolContracts.js +76 -0
- package/dist/contracts/android/androidToolContracts.js +77 -0
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/applicationToolContracts.js +261 -0
- package/dist/contracts/artifactComparisonExample.js +86 -0
- package/dist/contracts/artifactToolContracts.js +68 -0
- package/dist/contracts/browserProviderToolContracts.js +7 -0
- package/dist/contracts/browserScenarioToolContracts.js +32 -0
- package/dist/contracts/browserToolContracts.js +256 -0
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/enhancedInputs.js +74 -0
- package/dist/contracts/enhancedToolContracts.js +32 -0
- package/dist/contracts/errorSchemas.js +87 -0
- package/dist/contracts/evidenceInputContracts.js +13 -0
- package/dist/contracts/evm/evmToolContracts.js +20 -0
- package/dist/contracts/firmware/firmwareToolContracts.js +38 -0
- package/dist/contracts/functionComparisonExample.js +51 -0
- package/dist/contracts/functionInstructionContract.js +6 -0
- package/dist/contracts/functionWorkflowToolContracts.js +29 -0
- package/dist/contracts/go/goToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +19 -0
- package/dist/contracts/inputSchemaPresentation.js +181 -0
- package/dist/contracts/investigationExamples.js +116 -0
- package/dist/contracts/javascript/applicationWorkflowInputContracts.js +52 -0
- package/dist/contracts/javascript/electronToolContracts.js +118 -0
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +85 -0
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +35 -0
- package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +40 -0
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +242 -0
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +87 -0
- package/dist/contracts/managed/managedWorkflowExamples.js +281 -0
- package/dist/contracts/managed/managedWorkflowToolContracts.js +165 -0
- package/dist/contracts/mobileApplicationGraphExamples.js +117 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +65 -0
- package/dist/contracts/native/nativeToolContracts.js +77 -0
- package/dist/contracts/officialToolContracts.js +69 -0
- package/dist/contracts/promptContracts.js +253 -0
- package/dist/contracts/providerSelection.js +29 -0
- package/dist/contracts/reconstructionReadinessExample.js +438 -0
- package/dist/contracts/sessionLifecycleInputs.js +63 -0
- package/dist/contracts/sessionStatusContract.js +17 -0
- package/dist/contracts/sessionToolContracts.js +61 -0
- package/dist/contracts/sessionToolSchemas.js +51 -0
- package/dist/contracts/toolContractExamples.js +77 -0
- package/dist/contracts/toolContractHelpers.js +22 -0
- package/dist/contracts/toolContractTypes.js +18 -0
- package/dist/contracts/toolContracts.js +60 -0
- package/dist/contracts/toolEffects.js +544 -0
- package/dist/contracts/toolOutputSchemaGroups.js +411 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +532 -0
- package/dist/contracts/toolSchemaMetadata.js +197 -0
- package/dist/contracts/unknownContractExamples.js +31 -0
- package/dist/contracts/wasm/wasmToolContracts.js +24 -0
- package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/doctorRuntime.js +53 -0
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorBase.js +58 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorCore.js +123 -0
- package/dist/domain/analysisErrorPresentation.js +372 -0
- package/dist/domain/analysisErrorProjection.js +454 -0
- package/dist/domain/analysisProfile.js +50 -0
- package/dist/domain/analysisSnapshot.js +538 -0
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +362 -0
- package/dist/domain/analysisView/analysisView.js +340 -0
- package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
- package/dist/domain/analysisView/binaryLayoutView.js +161 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +245 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/analysisView/webNetworkApiSurfaceView.js +108 -0
- package/dist/domain/android/androidAnalysis.js +143 -0
- package/dist/domain/android/androidApplication.js +144 -0
- package/dist/domain/android/androidPartialObservation.js +36 -0
- package/dist/domain/apktool/apktoolResourceAnalysis.js +75 -0
- package/dist/domain/apple/appleApplication.js +315 -0
- package/dist/domain/apple/appleAssetCatalog.js +127 -0
- package/dist/domain/apple/appleBundleAnatomy.js +303 -0
- package/dist/domain/apple/dyldEnvironment.js +73 -0
- package/dist/domain/apple/dyldPaths.js +89 -0
- package/dist/domain/apple/dylibResolution.js +485 -0
- package/dist/domain/apple/dylibResolutionFindings.js +77 -0
- package/dist/domain/apple/interfaceBuilderGraph.js +403 -0
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +430 -0
- package/dist/domain/apple/keyedArchive.js +214 -0
- package/dist/domain/apple/machoContainer.js +54 -0
- package/dist/domain/apple/plistNumbers.js +76 -0
- package/dist/domain/apple/plistValue.js +35 -0
- package/dist/domain/artifactComparison.js +348 -0
- package/dist/domain/artifactGraph.js +213 -0
- package/dist/domain/artifactIdentity.js +57 -0
- package/dist/domain/artifactInspection.js +279 -0
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +166 -0
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +20 -0
- package/dist/domain/artifactPartialObservation.js +1 -0
- package/dist/domain/artifactPathSyntax.js +75 -0
- package/dist/domain/binaryTarget.js +233 -0
- package/dist/domain/binaryTargetTypes.js +10 -0
- package/dist/domain/bridgeCandidateProjection.js +71 -0
- package/dist/domain/browserCaptureComparison.js +21 -0
- package/dist/domain/browserCompleteness.js +103 -0
- package/dist/domain/browserNetworkEvidence.js +92 -0
- package/dist/domain/browserObservation.js +187 -0
- package/dist/domain/browserObservationError.js +44 -0
- package/dist/domain/browserObservationErrors.js +1 -0
- package/dist/domain/browserObservationSchemas.js +327 -0
- package/dist/domain/browserScenario.js +61 -0
- package/dist/domain/browserScenarioCapture.js +76 -0
- package/dist/domain/browserScenarioCaptureValues.js +292 -0
- package/dist/domain/browserScenarioDiff.js +266 -0
- package/dist/domain/browserScenarioDiffEvidence.js +73 -0
- package/dist/domain/browserScenarioDiffValues.js +140 -0
- package/dist/domain/browserScenarioNormalization.js +40 -0
- package/dist/domain/browserScenarioValues.js +268 -0
- package/dist/domain/browserSession.js +55 -0
- package/dist/domain/bundleComparison.js +243 -0
- package/dist/domain/callPath.js +301 -0
- package/dist/domain/callPathSchemas.js +89 -0
- package/dist/domain/canonicalDigest.js +83 -0
- package/dist/domain/canonicalJsonDigestSteps.js +155 -0
- package/dist/domain/canonicalOrdering.js +3 -0
- package/dist/domain/changedBehavior.js +282 -0
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSemantics.js +12 -0
- package/dist/domain/comparisonSourceEvidence.js +40 -0
- package/dist/domain/comparisonStatus.js +11 -0
- package/dist/domain/completionLedgerGeneration.js +186 -0
- package/dist/domain/configurationErrors.js +37 -0
- package/dist/domain/conformancePackage.js +200 -0
- package/dist/domain/conformanceReplay.js +132 -0
- package/dist/domain/conformanceTrustGate.js +319 -0
- package/dist/domain/digests.js +27 -0
- package/dist/domain/dosCom.js +8 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/evidence.js +305 -0
- package/dist/domain/evidenceBundle.js +413 -0
- package/dist/domain/evidenceCompletionLedger.js +113 -0
- package/dist/domain/evidenceErrors.js +46 -0
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/evm/evmInterface.js +61 -0
- package/dist/domain/explicitSensitiveFailure.js +108 -0
- package/dist/domain/explicitSensitiveValues.js +10 -0
- package/dist/domain/firmware/firmwareAnalysis.js +128 -0
- package/dist/domain/functionComparison.js +38 -0
- package/dist/domain/functionComparisonDimensions.js +199 -0
- package/dist/domain/functionComparisonNormalization.js +150 -0
- package/dist/domain/functionComparisonResults.js +54 -0
- package/dist/domain/functionComparisonSchemas.js +88 -0
- package/dist/domain/functionDossierEvidence.js +20 -0
- package/dist/domain/go/goBinary.js +96 -0
- package/dist/domain/harmony/harmonyApplication.js +169 -0
- package/dist/domain/hopperErrors.js +98 -0
- package/dist/domain/hopperStartupFailure.js +64 -0
- package/dist/domain/hopperValues.js +368 -0
- package/dist/domain/immutableJson.js +114 -0
- package/dist/domain/inputIssueProjection.js +94 -0
- package/dist/domain/javascript/electronActiveObservation.js +237 -0
- package/dist/domain/javascript/electronObservation.js +122 -0
- package/dist/domain/javascript/electronStaticAnalysis.js +9 -0
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +187 -0
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +197 -0
- package/dist/domain/javascript/electronStaticAnalysisNative.js +199 -0
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/javascript/electronStaticAnalysisValues.js +134 -0
- package/dist/domain/javascript/electronWrappedCallPaths.js +399 -0
- package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +146 -0
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +175 -0
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +400 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +378 -0
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +126 -0
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparison.js +104 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +211 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +324 -0
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +199 -0
- package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
- package/dist/domain/javascript/javascriptAstFingerprint.js +153 -0
- package/dist/domain/javascript/javascriptAstValues.js +99 -0
- package/dist/domain/javascript/javascriptBootstrap.js +94 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +119 -0
- package/dist/domain/javascript/javascriptExportReturnShapeProjection.js +81 -0
- package/dist/domain/javascript/javascriptExportShapeComparison.js +161 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +16 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +302 -0
- package/dist/domain/javascript/javascriptExportShapeSelection.js +130 -0
- package/dist/domain/javascript/javascriptExportShapeVariants.js +333 -0
- package/dist/domain/javascript/javascriptFeatureSeed.js +193 -0
- package/dist/domain/javascript/javascriptFeatureTrace.js +177 -0
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +131 -0
- package/dist/domain/javascript/javascriptFeatureTraversal.js +61 -0
- package/dist/domain/javascript/javascriptIntrinsicInvocation.js +93 -0
- package/dist/domain/javascript/javascriptModuleInterop.js +617 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +90 -0
- package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
- package/dist/domain/javascript/javascriptRecovery.js +90 -0
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +98 -0
- package/dist/domain/javascript/javascriptRuntimeObservation.js +136 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliation.js +46 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +74 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +163 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +270 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +39 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +126 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +334 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +234 -0
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +206 -0
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +910 -0
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +246 -0
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +127 -0
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +272 -0
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +224 -0
- package/dist/domain/javascript/javascriptSemanticCoverage.js +32 -0
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +182 -0
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +299 -0
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +52 -0
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +187 -0
- package/dist/domain/javascript/javascriptSemanticGraph.js +575 -0
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +316 -0
- package/dist/domain/javascript/javascriptSemanticGraphSerialization.js +12 -0
- package/dist/domain/javascript/javascriptSemanticIr.js +31 -0
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +865 -0
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +104 -0
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +164 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +38 -0
- package/dist/domain/javascript/javascriptSemanticProjection.js +571 -0
- package/dist/domain/javascript/javascriptSemanticPromises.js +321 -0
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +29 -0
- package/dist/domain/javascript/javascriptSemanticQuery.js +175 -0
- package/dist/domain/javascript/javascriptSemanticQueryAssessment.js +45 -0
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +63 -0
- package/dist/domain/javascript/javascriptSemanticQueryRelations.js +15 -0
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +95 -0
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +34 -0
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
- package/dist/domain/javascript/javascriptSemanticResources.js +129 -0
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +159 -0
- package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
- package/dist/domain/javascript/javascriptSemanticState.js +116 -0
- package/dist/domain/javascript/javascriptSemanticTraceSchemas.js +15 -0
- package/dist/domain/javascript/javascriptSemanticTraversal.js +80 -0
- package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
- package/dist/domain/javascript/javascriptSemanticValues.js +581 -0
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
- package/dist/domain/javascript/javascriptSourceParser.js +50 -0
- package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +142 -0
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +239 -0
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -0
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +86 -0
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +561 -0
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +21 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -0
- package/dist/domain/javascript/javascriptSymbolicBindings.js +795 -0
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +261 -0
- package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +109 -0
- package/dist/domain/javascript/sourceToBundleSignals.js +231 -0
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonSerialization.js +163 -0
- package/dist/domain/jsonShape.js +141 -0
- package/dist/domain/jsonValue.js +96 -0
- package/dist/domain/localPath.js +24 -0
- package/dist/domain/managed/managedApplicationGraph.js +221 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +48 -0
- package/dist/domain/managed/managedApplicationGraphNodes.js +367 -0
- package/dist/domain/managed/managedArtifact.js +465 -0
- package/dist/domain/managed/managedInspectionEvidence.js +28 -0
- package/dist/domain/managed/managedMemberComparison.js +211 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +71 -0
- package/dist/domain/managed/managedMemberComparisonItems.js +304 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +204 -0
- package/dist/domain/managed/managedNativeVerification.js +35 -0
- package/dist/domain/managed/managedNativeVerificationMatch.js +276 -0
- package/dist/domain/managed/managedNativeVerificationSchemas.js +180 -0
- package/dist/domain/managed/managedReconstruction.js +190 -0
- package/dist/domain/mobileApplicationGraphProjection.js +61 -0
- package/dist/domain/native/binaryLayout.js +354 -0
- package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeApiBoundary.js +140 -0
- package/dist/domain/native/nativeCallObservation.js +186 -0
- package/dist/domain/native/nativeCallPartialObservation.js +33 -0
- package/dist/domain/native/nativeDataType.js +53 -0
- package/dist/domain/native/nativeFunctionAnnotations.js +43 -0
- package/dist/domain/native/nativeInspection.js +174 -0
- package/dist/domain/native/nativeInstruction.js +125 -0
- package/dist/domain/native/nativeInvestigationGraph.js +364 -0
- package/dist/domain/native/nativeLoadImage.js +112 -0
- package/dist/domain/native/nativeMetadataRecovery.js +128 -0
- package/dist/domain/native/nativeUiObservation.js +137 -0
- package/dist/domain/native/nativeValueFlow.js +72 -0
- package/dist/domain/native/nativeValueTrace.js +64 -0
- package/dist/domain/native/objcSwiftMetadata.js +419 -0
- package/dist/domain/native/peResources.js +100 -0
- package/dist/domain/native/recordedCrash.js +263 -0
- package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/offsetDateTime.js +17 -0
- package/dist/domain/peMachine.js +36 -0
- package/dist/domain/process/processCapture.js +412 -0
- package/dist/domain/process/processCaptureCoverage.js +70 -0
- package/dist/domain/process/processCaptureExample.js +132 -0
- package/dist/domain/process/processCaptureParsing.js +21 -0
- package/dist/domain/process/processCaptureValidation.js +246 -0
- package/dist/domain/process/processComparison.js +315 -0
- package/dist/domain/process/processEvidenceProvider.js +11 -0
- package/dist/domain/process/processObservation.js +140 -0
- package/dist/domain/process/processScenario.js +247 -0
- package/dist/domain/process/processTraceComparison.js +34 -0
- package/dist/domain/process/processTraceDimensionProjection.js +35 -0
- package/dist/domain/process/processTraceEvaluation.js +320 -0
- package/dist/domain/process/processTraceSpecification.js +382 -0
- package/dist/domain/propertyListKeys.js +107 -0
- package/dist/domain/propertyListXmlText.js +19 -0
- package/dist/domain/providerAdapterError.js +19 -0
- package/dist/domain/providerCleanupError.js +18 -0
- package/dist/domain/providerConfigurationRefusal.js +12 -0
- package/dist/domain/providerOperationHealth.js +54 -0
- package/dist/domain/providerSelectionError.js +46 -0
- package/dist/domain/rawBinary.js +93 -0
- package/dist/domain/reconstructionCoverage.js +325 -0
- package/dist/domain/reconstructionCoverageEvaluation.js +234 -0
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
- package/dist/domain/reconstructionObligationLedgerSchemas.js +347 -0
- package/dist/domain/reconstructionReadiness.js +116 -0
- package/dist/domain/reconstructionReadinessFindingHelpers.js +17 -0
- package/dist/domain/reconstructionReadinessIntegrityFindings.js +118 -0
- package/dist/domain/reconstructionReadinessJourneyFindings.js +193 -0
- package/dist/domain/reconstructionReadinessSchemas.js +268 -0
- package/dist/domain/reconstructionUnknowns.js +91 -0
- package/dist/domain/reconstructionVerification.js +218 -0
- package/dist/domain/reconstructionVerificationSchemas.js +141 -0
- package/dist/domain/recordedTransportUrl.js +51 -0
- package/dist/domain/referenceSourceClassification.js +385 -0
- package/dist/domain/referenceSourceGraph.js +380 -0
- package/dist/domain/referenceSourceImportParsing.js +238 -0
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourcePolicy.js +1 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/relationshipCoverage.js +20 -0
- package/dist/domain/residualUnknown.js +252 -0
- package/dist/domain/result.js +4 -0
- package/dist/domain/runtimeVersion.js +15 -0
- package/dist/domain/safeJson.js +13 -0
- package/dist/domain/sourceMapContents.js +6 -0
- package/dist/domain/sourceMapEnvelope.js +44 -0
- package/dist/domain/staticRuntimeCorrelation.js +334 -0
- package/dist/domain/stringPatterns.js +6 -0
- package/dist/domain/swiftSymbolClassification.js +66 -0
- package/dist/domain/symbolAnalysis.js +122 -0
- package/dist/domain/unicodeCodePointOrder.js +23 -0
- package/dist/domain/unknownRegistryError.js +10 -0
- package/dist/domain/wasm/wasmArtifact.js +105 -0
- package/dist/domain/webBundleAnalysis.js +192 -0
- package/dist/domain/webBundleAnalyzer.js +15 -0
- package/dist/domain/webBundleAnalyzerAst.js +49 -0
- package/dist/domain/webBundleAnalyzerInspection.js +315 -0
- package/dist/domain/webBundleAnalyzerResult.js +142 -0
- package/dist/domain/webCaptureDiff.js +423 -0
- package/dist/domain/webCaptureDiffSchemas.js +84 -0
- package/dist/domain/webContentArtifact.js +38 -0
- package/dist/domain/webEventListeners.js +29 -0
- package/dist/domain/webExecution.js +75 -0
- package/dist/domain/webInventory.js +62 -0
- package/dist/domain/webMcpDiscovery.js +53 -0
- package/dist/domain/webModuleImports.js +99 -0
- package/dist/domain/webModuleTrace.js +101 -0
- package/dist/domain/webNetworkCapture.js +142 -0
- package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
- package/dist/domain/webRuntime.js +80 -0
- package/dist/domain/webScreenshot.js +132 -0
- package/dist/domain/webScriptArtifacts.js +37 -0
- package/dist/domain/webScriptExport.js +84 -0
- package/dist/domain/webScriptExportError.js +19 -0
- package/dist/domain/webScriptExportPlan.js +104 -0
- package/dist/domain/webSourceLocation.js +118 -0
- package/dist/domain/webSourcePosition.js +21 -0
- package/dist/domain/zipPackageFormat.js +52 -0
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +308 -0
- package/dist/dotnet/ManagedDecodeBudget.js +138 -0
- package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
- package/dist/dotnet/ManagedMemberInspector.js +173 -0
- package/dist/dotnet/ManagedMemberInspectorCore.js +446 -0
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +468 -0
- package/dist/dotnet/ManagedMemberOwnership.js +71 -0
- package/dist/dotnet/ManagedMemberPointers.js +62 -0
- package/dist/dotnet/ManagedMemberRows.js +227 -0
- package/dist/dotnet/ManagedMetadataHeaps.js +179 -0
- package/dist/dotnet/ManagedMetadataInventory.js +99 -0
- package/dist/dotnet/ManagedMetadataInventoryRows.js +295 -0
- package/dist/dotnet/ManagedMetadataLayout.js +270 -0
- package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +155 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +314 -0
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +128 -0
- package/dist/dotnet/ManagedPeReader.js +233 -0
- package/dist/dotnet/ManagedReaderFailure.js +27 -0
- package/dist/dotnet/ManagedSnapshot.js +88 -0
- package/dist/dotnet/ManagedStaticProvider.js +158 -0
- package/dist/dotnet/ManagedStaticProviderMetadata.js +33 -0
- package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
- package/dist/evaluation/AgentEvaluationReport.js +32 -0
- package/dist/evaluation/CodexAgentEval.js +188 -0
- package/dist/evaluation/KnownAnswerEvaluation.js +323 -0
- package/dist/evm/EvmBytecodeCarrier.js +21 -0
- package/dist/evm/EvmWorkerLimits.js +40 -0
- package/dist/evm/EvmoleFailures.js +124 -0
- package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
- package/dist/evm/EvmoleInterfaceProvider.js +339 -0
- package/dist/evm/EvmoleInterfaceWorker.js +87 -0
- package/dist/evm/EvmoleRelease.js +16 -0
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/OwnedStagedOutput.js +138 -0
- package/dist/filesystem/RegularFile.js +73 -0
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +35 -0
- package/dist/firmware/FirmwareCommand.js +190 -0
- package/dist/firmware/FirmwareFiles.js +206 -0
- package/dist/firmware/FirmwareProvider.js +388 -0
- package/dist/firmware/FirmwarePublication.js +105 -0
- package/dist/firmware/FirmwareRelease.js +33 -0
- package/dist/firmware/FirmwareReports.js +287 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedPackageMetadata.js +9 -0
- package/dist/ghidra/GhidraAnalysisProfile.js +219 -0
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +725 -0
- package/dist/ghidra/GhidraClientStartup.js +27 -0
- package/dist/ghidra/GhidraClientTypes.js +1 -0
- package/dist/ghidra/GhidraClientWire.js +38 -0
- package/dist/ghidra/GhidraDiagnostics.js +53 -0
- package/dist/ghidra/GhidraDoctor.js +88 -0
- package/dist/ghidra/GhidraFunctionValues.js +328 -0
- package/dist/ghidra/GhidraInstallation.js +443 -0
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +262 -0
- package/dist/ghidra/GhidraJavaLaunch.js +66 -0
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +490 -0
- package/dist/ghidra/GhidraLoadImageAttest.js +103 -0
- package/dist/ghidra/GhidraLoadImageValues.js +260 -0
- package/dist/ghidra/GhidraMipsProfile.js +187 -0
- package/dist/ghidra/GhidraProvider.js +250 -0
- package/dist/ghidra/GhidraProviderCapabilities.js +208 -0
- package/dist/ghidra/GhidraProviderClient.js +613 -0
- package/dist/ghidra/GhidraPspExtension.js +144 -0
- package/dist/ghidra/GhidraPspProfile.js +50 -0
- package/dist/ghidra/GhidraRawBinaryLanguage.js +18 -0
- package/dist/ghidra/GhidraRequestQueue.js +115 -0
- package/dist/ghidra/GhidraResponseBuffer.js +31 -0
- package/dist/ghidra/GhidraResponseRouter.js +24 -0
- package/dist/ghidra/GhidraSessionError.js +180 -0
- package/dist/ghidra/GhidraSessionRoot.js +39 -0
- package/dist/ghidra/GhidraSessionValues.js +86 -0
- package/dist/ghidra/GhidraSocketConnection.js +83 -0
- package/dist/ghidra/GhidraTargetSnapshot.js +79 -0
- package/dist/ghidra/GhidraTransport.js +101 -0
- package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +177 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +27 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +100 -0
- package/dist/ghidra/protocol.js +46 -0
- package/dist/go/GoBinaryContainer.js +125 -0
- package/dist/go/GoBinaryImage.js +172 -0
- package/dist/go/GoBinaryProvider.js +137 -0
- package/dist/go/GoElfImage.js +149 -0
- package/dist/go/GoMachoImage.js +113 -0
- package/dist/go/GoModuleText.js +217 -0
- package/dist/go/GoPeImage.js +102 -0
- package/dist/hopper/BridgeLauncher.js +305 -0
- package/dist/hopper/HopperAnalysisProfile.js +168 -0
- package/dist/hopper/HopperCleanup.js +245 -0
- package/dist/hopper/HopperClient.js +767 -0
- package/dist/hopper/HopperDiagnostics.js +14 -0
- package/dist/hopper/HopperFileOffset.js +237 -0
- package/dist/hopper/HopperMachOImage.js +200 -0
- package/dist/hopper/HopperOperationStage.js +6 -0
- package/dist/hopper/HopperProcessDiagnostic.js +26 -0
- package/dist/hopper/HopperProvider.js +269 -0
- package/dist/hopper/HopperProviderCapabilities.js +91 -0
- package/dist/hopper/HopperRegexSearch.js +134 -0
- package/dist/hopper/HopperRegexWorker.js +27 -0
- package/dist/hopper/HopperRequestQueue.js +261 -0
- package/dist/hopper/HopperResponseStream.js +44 -0
- package/dist/hopper/HopperSessionValues.js +30 -0
- package/dist/hopper/HopperSocketConnection.js +31 -0
- package/dist/hopper/HopperTargetLease.js +233 -0
- package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +64 -0
- package/dist/hopper/LinuxPrivateDisplayProbe.js +224 -0
- package/dist/hopper/protocol.js +88 -0
- package/dist/ida/IdaBusyHealth.js +44 -0
- package/dist/ida/IdaCallGraph.js +134 -0
- package/dist/ida/IdaConfiguration.js +61 -0
- package/dist/ida/IdaDoctor.js +53 -0
- package/dist/ida/IdaInput.js +56 -0
- package/dist/ida/IdaMcpConnection.js +115 -0
- package/dist/ida/IdaOperationRunner.js +376 -0
- package/dist/ida/IdaProtocolValues.js +208 -0
- package/dist/ida/IdaProvider.js +136 -0
- package/dist/ida/IdaProviderCapabilities.js +64 -0
- package/dist/ida/IdaSessionClient.js +444 -0
- package/dist/ida/IdaWorkspace.js +55 -0
- package/dist/identity.js +25 -0
- package/dist/inspector/JavaScriptRuntimeScope.js +89 -0
- package/dist/inspector/V8InspectorCaptureProjection.js +197 -0
- package/dist/inspector/V8InspectorEndpoint.js +70 -0
- package/dist/inspector/V8InspectorProvider.js +378 -0
- package/dist/inspector/providerIdentity.js +6 -0
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +574 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +64 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +558 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +121 -0
- package/dist/javascript/recovery/RecoveryFiles.js +175 -0
- package/dist/javascript/recovery/WakaruCommand.js +137 -0
- package/dist/javascript/recovery/WakaruExecution.js +115 -0
- package/dist/javascript/recovery/WakaruProvider.js +218 -0
- package/dist/javascript/recovery/WakaruPublication.js +126 -0
- package/dist/javascript/recovery/WakaruRelease.js +36 -0
- package/dist/javascript/recovery/WakaruReport.js +140 -0
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +223 -0
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +135 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +238 -0
- package/dist/javascript/sourceMaps/TraceSourceMap.js +152 -0
- package/dist/jeb/JebMcpConnection.js +186 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +297 -0
- package/dist/logger.js +14 -0
- package/dist/main/messages.js +4 -0
- package/dist/main/shutdown.js +102 -0
- package/dist/main/startup.js +21 -0
- package/dist/main/transport.js +72 -0
- package/dist/main/types.js +1 -0
- package/dist/main.js +92 -0
- package/dist/mcp/AnalysisSnapshotFiles-DbgHi36O.js +1225 -0
- package/dist/mcp/ArtifactProvider-BNxKlaKX.js +2090 -0
- package/dist/mcp/ArtifactProviderMetadata--hy-wyJK.js +76 -0
- package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
- package/dist/mcp/ArtifactResourceScope-CBR5q4aK.js +108 -0
- package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
- package/dist/mcp/BinaryTargetResolver-DbiUzRLh.js +1073 -0
- package/dist/mcp/BoundedFileBytes-CJPW_TzE.js +68 -0
- package/dist/mcp/CdpConnection-CM0tkVfW.js +557 -0
- package/dist/mcp/CdpOptionalCommand-H8_fL7Q_.js +120 -0
- package/dist/mcp/CdpTargetSession-OYD1d6XM.js +647 -0
- package/dist/mcp/DirectAnalysis-BWAu8Ro5.js +395 -0
- package/dist/mcp/DirectAnalysisStatus-DofNPhKd.js +33 -0
- package/dist/mcp/ElectronFileScope-DEayib6K.js +110 -0
- package/dist/mcp/InterfaceBuilderDecodeBudget-CUrOtfNo.js +401 -0
- package/dist/mcp/ManagedStaticProvider-CXE93Bow.js +4460 -0
- package/dist/mcp/NativeMacOSProvider-BbITFLHW.js +4408 -0
- package/dist/mcp/NativeMacOSProviderMetadata-mxDhaNJf.js +281 -0
- package/dist/mcp/ProcedureAddressResolution-Gnjf9Hya.js +19 -0
- package/dist/mcp/ProcessOwnership-nOFZsmD3.js +1411 -0
- package/dist/mcp/WorkflowEvidence-DJyEy3K0.js +94 -0
- package/dist/mcp/analysisErrorCore-BqyeMw3_.js +201 -0
- package/dist/mcp/analysisErrorProjection-B7pHef2y.js +724 -0
- package/dist/mcp/artifactOperationError-B_jxO8at.js +27 -0
- package/dist/mcp/artifactToolContracts-TXegBBr1.js +159 -0
- package/dist/mcp/browserObservation-BCgaDRyQ.js +4398 -0
- package/dist/mcp/browserObservationError-BKBEX85K.js +40 -0
- package/dist/mcp/browserObservationSchemas-yzRJ90-E.js +573 -0
- package/dist/mcp/browserScenario-z7jveI9P.js +2319 -0
- package/dist/mcp/browserScenarioCapture-BvnKTmtZ.js +460 -0
- package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
- package/dist/mcp/digests-Dugt3H71.js +199 -0
- package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
- package/dist/mcp/electronObservation-DjQQYGw4.js +556 -0
- package/dist/mcp/electronObservation-DuhMHCmQ.js +112 -0
- package/dist/mcp/electronScenario-9mLG6h-g.js +586 -0
- package/dist/mcp/emptyArraySchema-DEEefG2V.js +140 -0
- package/dist/mcp/enhancedInputs-CLdEXv88.js +56 -0
- package/dist/mcp/interfaceBuilderGraph-BOKqQzjK.js +2613 -0
- package/dist/mcp/javascriptRuntimeObservation-C_wglsz_.js +661 -0
- package/dist/mcp/javascriptRuntimeObservation-CxQ1UT_y.js +121 -0
- package/dist/mcp/lipo-Do-2eBrl.js +465 -0
- package/dist/mcp/localPath-AxvW9aPe.js +19 -0
- package/dist/mcp/logger-CZ4Hlc6u.js +34 -0
- package/dist/mcp/machoContainer-9En6pSkd.js +813 -0
- package/dist/mcp/main-WQSCuTNt.js +52791 -0
- package/dist/mcp/main.js +6 -0
- package/dist/mcp/managedToolContracts-o5LHFwHc.js +81 -0
- package/dist/mcp/plistValue-DsU7z4yF.js +47 -0
- package/dist/mcp/propertyListKeys-cX-BUv2y.js +197 -0
- package/dist/mcp/providerAdapterError-CdPaQ6-Z.js +27 -0
- package/dist/mcp/providerCleanupError-DvE79aUX.js +49 -0
- package/dist/mcp/providerIdentities--ptAh481.js +31 -0
- package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
- package/dist/mcp/providerOperationHealth-CUeCJZiP.js +212 -0
- package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
- package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
- package/dist/mcp/scanCanonical-2GN0h-BE.js +3647 -0
- package/dist/mcp/serverIdentity-rOY69sxc.js +633 -0
- package/dist/mcp/sourceMapEnvelope-D8Zezqyi.js +252 -0
- package/dist/mcp/toolContracts-CrfYDTUz.js +14561 -0
- package/dist/mcp/toolOutputSchemaGroups-ChxVLGoy.js +11114 -0
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
- package/dist/mcp/webContentArtifact-DUBgMzVO.js +185 -0
- package/dist/mcp/webRuntime-C2Tx-fgS.js +74 -0
- package/dist/mcp/webSourceLocation-Dnkpf0R2.js +8532 -0
- package/dist/mcpDoctor.js +360 -0
- package/dist/mcpStartupPolicy.js +14 -0
- package/dist/native/AppleDispatchCoverage.js +112 -0
- package/dist/native/AppleDispatchDecodeFacts.js +6 -0
- package/dist/native/AppleDispatchMetadata.js +176 -0
- package/dist/native/AppleMachoFixups.js +372 -0
- package/dist/native/AppleMachoSelection.js +234 -0
- package/dist/native/AppleObjcCategories.js +63 -0
- package/dist/native/AppleObjcDispatchFacets.js +260 -0
- package/dist/native/AppleObjcProperties.js +79 -0
- package/dist/native/AppleObjcProtocols.js +89 -0
- package/dist/native/AppleSwiftDispatchFacets.js +156 -0
- package/dist/native/AppleSwiftVtables.js +92 -0
- package/dist/native/CommandRunner.js +240 -0
- package/dist/native/LldbCallTracer.js +713 -0
- package/dist/native/LldbRetainedObservations.js +178 -0
- package/dist/native/NativeCallObservation.js +195 -0
- package/dist/native/NativeMacOSProvider.js +701 -0
- package/dist/native/NativeMacOSProviderMetadata.js +46 -0
- package/dist/native/NativeMachoInspection.js +273 -0
- package/dist/native/NativeUiHelperRuntime.js +66 -0
- package/dist/native/NativeUiObservation.js +183 -0
- package/dist/native/NativeUiOutputBudget.js +8 -0
- package/dist/native/SignatureTargetBinding.js +155 -0
- package/dist/native/parsers/codesign.js +93 -0
- package/dist/native/parsers/demangle.js +30 -0
- package/dist/native/parsers/dyldInfo.js +60 -0
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +177 -0
- package/dist/native/parsers/machoUuid.js +150 -0
- package/dist/native/parsers/otool.js +379 -0
- package/dist/native/parsers/plist.js +187 -0
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
- package/dist/native/pwntools/PwntoolsDecoder.js +206 -0
- package/dist/native/pwntools/PwntoolsFailures.js +180 -0
- package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
- package/dist/native/pwntools/PwntoolsRelease.js +19 -0
- package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
- package/dist/process/BoundedFileBytes.js +40 -0
- package/dist/process/DarwinProcessRunTokenReader.js +376 -0
- package/dist/process/ExecFileOutput.js +124 -0
- package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
- package/dist/process/OwnedCommand.js +131 -0
- package/dist/process/PendingOperations.js +61 -0
- package/dist/process/PrivateRuntimeRoot.js +61 -0
- package/dist/process/ProcessCommandIdentity.js +19 -0
- package/dist/process/ProcessOwnership.js +636 -0
- package/dist/process/ProcessOwnershipIdentity.js +13 -0
- package/dist/process/ProcessOwnershipObservation.js +407 -0
- package/dist/process/ProcessOwnershipProcessTree.js +35 -0
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDeadline.js +91 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +381 -0
- package/dist/process/ProviderRunLineage.js +21 -0
- package/dist/process/WindowsAuthority.js +51 -0
- package/dist/process/WindowsBatchCommand.js +46 -0
- package/dist/process/boundedUtf8Text.js +13 -0
- package/dist/process/capture/FilesystemSnapshot.js +268 -0
- package/dist/process/capture/ProcessCaptureCapability.js +65 -0
- package/dist/process/capture/ProcessCaptureEnvironment.js +9 -0
- package/dist/process/capture/ProcessCaptureError.js +74 -0
- package/dist/process/capture/ProcessCaptureJournal.js +61 -0
- package/dist/process/capture/ProcessCaptureLifecycle.js +1050 -0
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessFilesystemEffects.js +81 -0
- package/dist/process/capture/ProcessHarness.js +602 -0
- package/dist/process/capture/ProcessNormalization.js +88 -0
- package/dist/process/capture/ProcessSampling.js +415 -0
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +79 -0
- package/dist/process/capture/ProcessTimer.js +39 -0
- package/dist/process/capture/TerminalRenderer.js +124 -0
- package/dist/process/snapshotEnvironment.js +14 -0
- package/dist/reference/ReferenceSourceReader.js +73 -0
- package/dist/reference/ReferenceSourceReaderEntries.js +273 -0
- package/dist/reference/ReferenceSourceReaderErrors.js +54 -0
- package/dist/reference/ReferenceSourceReaderFile.js +147 -0
- package/dist/reference/ReferenceSourceReaderPaths.js +8 -0
- package/dist/reference/ReferenceSourceReaderTypes.js +1 -0
- package/dist/reference/ReferenceSourceReaderValidate.js +81 -0
- package/dist/server/EvidenceMcpServer.js +216 -0
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/analysisAdmission.js +8 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +344 -0
- package/dist/server/lifecycleProgress.js +10 -0
- package/dist/server/mcpClientMetadata.js +42 -0
- package/dist/server/mcpProgress.js +26 -0
- package/dist/server/promptCompletion.js +141 -0
- package/dist/server/recordDerivedEvidence.js +10 -0
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +10 -0
- package/dist/server/registerAndroidTools.js +31 -0
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +29 -0
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +29 -0
- package/dist/server/registerApplicationTools/compareVersions.js +34 -0
- package/dist/server/registerApplicationTools/coverage.js +13 -0
- package/dist/server/registerApplicationTools/helpers.js +37 -0
- package/dist/server/registerApplicationTools/obligationLedger.js +23 -0
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +50 -0
- package/dist/server/registerApplicationTools/traceFeature.js +26 -0
- package/dist/server/registerApplicationTools/traceSemantics.js +25 -0
- package/dist/server/registerApplicationTools/types.js +1 -0
- package/dist/server/registerApplicationTools.js +19 -0
- package/dist/server/registerArtifactComparisonTool.js +71 -0
- package/dist/server/registerArtifactTools.js +14 -0
- package/dist/server/registerBinaryDiagnosticsTools.js +26 -0
- package/dist/server/registerBrowserScenarioTool.js +26 -0
- package/dist/server/registerBrowserTools.js +58 -0
- package/dist/server/registerBundleComparisonTool.js +54 -0
- package/dist/server/registerCloseLifecycleTool.js +55 -0
- package/dist/server/registerElectronTools.js +70 -0
- package/dist/server/registerEnhancedTools.js +169 -0
- package/dist/server/registerEvidenceTools.js +68 -0
- package/dist/server/registerEvmTools.js +9 -0
- package/dist/server/registerFirmwareTools.js +11 -0
- package/dist/server/registerFunctionComparisonTool.js +86 -0
- package/dist/server/registerGoTools.js +9 -0
- package/dist/server/registerInvestigationTools/helpers.js +46 -0
- package/dist/server/registerInvestigationTools/types.js +1 -0
- package/dist/server/registerInvestigationTools.js +168 -0
- package/dist/server/registerJavaScriptRecoveryTool.js +9 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +27 -0
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +40 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +53 -0
- package/dist/server/registerManagedWorkflowTools/contract.js +7 -0
- package/dist/server/registerManagedWorkflowTools/evidence.js +27 -0
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +27 -0
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +41 -0
- package/dist/server/registerManagedWorkflowTools/types.js +1 -0
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +62 -0
- package/dist/server/registerManagedWorkflowTools.js +11 -0
- package/dist/server/registerOfficialTools.js +74 -0
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +156 -0
- package/dist/server/registerPrompts.js +73 -0
- package/dist/server/registerRecordedCrashTools.js +9 -0
- package/dist/server/registerSessionRecordTools.js +90 -0
- package/dist/server/registerSessionStatusTool.js +61 -0
- package/dist/server/registerSessionTools.js +217 -0
- package/dist/server/registerWasmTools.js +9 -0
- package/dist/server/registerWebModuleTool.js +9 -0
- package/dist/server/registerWebNetworkCaptureTool.js +20 -0
- package/dist/server/registerWebRuntimeTools.js +27 -0
- package/dist/server/registerWebScriptTool.js +18 -0
- package/dist/server/registerWebSourceLocationTool.js +9 -0
- package/dist/server/runDerivedOperation.js +55 -0
- package/dist/server/sessionAvailabilityPolicy.js +29 -0
- package/dist/server/sessionEvidence.js +11 -0
- package/dist/server/toolLogging.js +11 -0
- package/dist/server/toolRegistrationOptions.js +9 -0
- package/dist/server/toolResult.js +119 -0
- package/dist/server/toolResultEncoding.js +34 -0
- package/dist/serverIdentity.js +69 -0
- package/dist/wasm/WabtArtifactProvider.js +313 -0
- package/dist/wasm/WabtFailures.js +62 -0
- package/dist/wasm/WabtOutput.js +60 -0
- package/dist/wasm/WabtRelease.js +12 -0
- package/dist/wasm/WabtWat.js +184 -0
- package/dist/wasm/WasmGlueAdapter.js +51 -0
- package/dist/windows/WindowsNativeLoader.js +124 -0
- package/dist/windows/WindowsOwnedProcess.js +265 -0
- package/dist/windows/WindowsPrivateRuntime.js +143 -0
- package/hooks/hooks.json +17 -0
- package/install.sh +172 -0
- package/licenses/Apache-2.0.txt +202 -0
- package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/licenses/GPL-3.0.txt +674 -0
- package/licenses/MIT-template.txt +18 -0
- package/licenses/MinGW-w64-runtime.txt +240 -0
- package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
- package/licenses/README.md +54 -0
- package/licenses/cfworker-MIT.txt +21 -0
- package/licenses/digfox-MIT.txt +21 -0
- package/licenses/dotnet-runtime-MIT.txt +23 -0
- package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
- package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
- package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/licenses/npm-dependencies.txt +2812 -0
- package/licenses/npm-runtime-notices.txt +6632 -0
- package/licenses/rea-jev-MIT.txt +21 -0
- package/licenses/rea-lab-MIT.txt +21 -0
- package/licenses/upstream-sources.json +62 -0
- package/licenses/xterm-MIT.txt +21 -0
- package/native/windows/README.md +156 -0
- package/native/windows/build/manifest.json +9 -0
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +371 -4
- package/port/cli.mjs +210 -0
- package/port/hooks/guard.mjs +140 -0
- package/port/knowledge/engines.json +67 -0
- package/port/knowledge/footprints.json +189 -0
- package/port/knowledge/maps/godot-godot-csharp.json +38 -0
- package/port/knowledge/maps/godot-threejs.json +42 -0
- package/port/knowledge/maps/godot-unity.json +62 -0
- package/port/knowledge/maps/godot-unreal.json +48 -0
- package/port/knowledge/maps/unity-godot.json +52 -0
- package/port/knowledge/maps/unity-unreal.json +33 -0
- package/port/knowledge/systems.json +1554 -0
- package/port/mcp.mjs +62 -0
- package/port/plugin/mcp-launch.mjs +19 -0
- package/port/server.mjs +129 -0
- package/port/src/agent.mjs +257 -0
- package/port/src/archive.mjs +324 -0
- package/port/src/binary.mjs +606 -0
- package/port/src/blueprint.mjs +225 -0
- package/port/src/compare.mjs +165 -0
- package/port/src/connect.mjs +58 -0
- package/port/src/convert.mjs +134 -0
- package/port/src/formats.mjs +229 -0
- package/port/src/graph.mjs +275 -0
- package/port/src/knowledge.mjs +90 -0
- package/port/src/lookup.mjs +615 -0
- package/port/src/main-module.mjs +10 -0
- package/port/src/plan.mjs +606 -0
- package/port/src/porters.mjs +360 -0
- package/port/src/proofcase.mjs +343 -0
- package/port/src/relay.mjs +493 -0
- package/port/src/scan.mjs +189 -0
- package/port/src/scene.mjs +338 -0
- package/port/src/stashpad.mjs +114 -0
- package/port/src/symbols.mjs +201 -0
- package/port/src/tools.mjs +198 -0
- package/port/src/util.mjs +162 -0
- package/port/src/workspace.mjs +39 -0
- package/port/templates/unity/ReversePortSceneBuilder.cs +258 -0
- package/scripts/electron-active-hook-boundaries.cjs +392 -0
- package/scripts/electron-active-hook.cjs +673 -0
- package/scripts/hopper-demo-x11.py +787 -0
- package/scripts/prepack.mjs +60 -0
- package/scripts/prepare.mjs +28 -0
- package/scripts/rea.mjs +110 -0
- package/scripts/verify-windows-native-artifact.mjs +39 -0
- package/skills/build-inspector/SKILL.md +44 -0
- package/skills/godot-port/SKILL.md +42 -0
- package/skills/port-project/SKILL.md +59 -0
- package/skills/port-verify/SKILL.md +35 -0
- package/skills/proof-case/SKILL.md +52 -0
- package/skills/rebuild/SKILL.md +66 -0
- package/skills/reverse-engineer/SKILL.md +67 -0
- package/skills/reverse-engineer-anything/SKILL.md +204 -0
- package/skills/reverse-engineer-anything/references/android-applications.md +34 -0
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +130 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +54 -0
- package/skills/reverse-engineer-anything/references/godot-source.md +37 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +175 -0
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +252 -0
- package/skills/reverse-engineer-anything/references/porting-and-rebuilds.md +92 -0
- package/skills/reverse-engineer-anything/references/runtime-observation.md +28 -0
- package/skills/reverse-engineer-anything/references/unity-source.md +32 -0
- package/skills/troubleshoot/SKILL.md +27 -0
- package/skills/unity-to-godot/SKILL.md +37 -0
- package/third_party/README.md +60 -0
- package/third_party/evmole/LICENSE +21 -0
- package/third_party/evmole/README.md +22 -0
- package/third_party/pwndbg/LICENSE.md +21 -0
- package/third_party/pwndbg/README.md +23 -0
- package/third_party/pwntools/README.md +40 -0
- package/third_party/wabt/README.md +24 -0
|
@@ -0,0 +1,1411 @@
|
|
|
1
|
+
import { t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
|
|
2
|
+
import { d as init_analysisErrorCore, i as AnalysisCapabilityUnavailableError } from "./analysisErrorCore-BqyeMw3_.js";
|
|
3
|
+
import { n as safeParseJson, t as init_safeJson } from "./safeJson-NeGfpkrI.js";
|
|
4
|
+
import { r as init_unicodeCodePointOrder, t as compareUnicodeCodePoints } from "./unicodeCodePointOrder-BezCbTpg.js";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { rmSync } from "node:fs";
|
|
7
|
+
import { basename, join } from "node:path";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { tmpdir } from "node:os";
|
|
10
|
+
import { execFile } from "node:child_process";
|
|
11
|
+
import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises";
|
|
12
|
+
import { promisify } from "node:util";
|
|
13
|
+
|
|
14
|
+
//#region dist/process/ProcessCommandIdentity.js
|
|
15
|
+
var matchesOwnedProcessCommand;
|
|
16
|
+
function init_ProcessCommandIdentity() {
|
|
17
|
+
return (init_ProcessCommandIdentity = __esmMin((() => {
|
|
18
|
+
matchesOwnedProcessCommand = (actual, expected, platform = process.platform) => {
|
|
19
|
+
const actualCommand = actual.trim();
|
|
20
|
+
const expectedCommand = expected.trim();
|
|
21
|
+
if (actualCommand === expectedCommand || actualCommand.startsWith(`${expectedCommand} `)) return true;
|
|
22
|
+
if (platform !== "darwin") return false;
|
|
23
|
+
const actualExecutable = actualCommand.split(/\s+/u, 1)[0];
|
|
24
|
+
const expectedExecutable = expectedCommand.split(/\s+/u, 1)[0];
|
|
25
|
+
const normalizedActualExecutable = actualExecutable?.startsWith("(") === true && actualExecutable.endsWith(")") ? actualExecutable.slice(1, -1) : actualExecutable;
|
|
26
|
+
return normalizedActualExecutable !== undefined && expectedExecutable !== undefined && basename(normalizedActualExecutable) === basename(expectedExecutable);
|
|
27
|
+
};
|
|
28
|
+
})))();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region dist/process/ProcessOwnershipIdentity.js
|
|
33
|
+
var launcherIdentityFailure;
|
|
34
|
+
function init_ProcessOwnershipIdentity() {
|
|
35
|
+
return (init_ProcessOwnershipIdentity = __esmMin((() => {
|
|
36
|
+
init_ProcessCommandIdentity();
|
|
37
|
+
launcherIdentityFailure = (launcher, ownership) => {
|
|
38
|
+
if (launcher.processGroupId !== ownership.processGroupId) return "owned launcher process-group identity did not match";
|
|
39
|
+
if (ownership.expectedParentPid !== undefined && launcher.parentPid !== ownership.expectedParentPid) return "owned launcher parent identity did not match";
|
|
40
|
+
if (ownership.expectedCommand !== undefined && !matchesOwnedProcessCommand(launcher.command, ownership.expectedCommand)) return `owned launcher command identity did not match (observed=${launcher.command}; expected=${ownership.expectedCommand})`;
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
})))();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region dist/process/ProcessOwnershipProcessTree.js
|
|
48
|
+
var liveProcesses, descendantsOf, selectCapturedProcessGroupIds;
|
|
49
|
+
function init_ProcessOwnershipProcessTree() {
|
|
50
|
+
return (init_ProcessOwnershipProcessTree = __esmMin((() => {
|
|
51
|
+
liveProcesses = (members) => members.filter(({ state }) => !state.startsWith("Z"));
|
|
52
|
+
descendantsOf = (rootPids, processes) => {
|
|
53
|
+
const childrenByParent = new Map();
|
|
54
|
+
for (const process of processes) {
|
|
55
|
+
const siblings = childrenByParent.get(process.parentPid) ?? [];
|
|
56
|
+
siblings.push(process);
|
|
57
|
+
childrenByParent.set(process.parentPid, siblings);
|
|
58
|
+
}
|
|
59
|
+
const descendants = [];
|
|
60
|
+
const pending = rootPids.flatMap((pid) => childrenByParent.get(pid) ?? []);
|
|
61
|
+
const visited = new Set(rootPids);
|
|
62
|
+
for (const process of pending) {
|
|
63
|
+
if (visited.has(process.pid)) continue;
|
|
64
|
+
visited.add(process.pid);
|
|
65
|
+
descendants.push(process);
|
|
66
|
+
pending.push(...childrenByParent.get(process.pid) ?? []);
|
|
67
|
+
}
|
|
68
|
+
return descendants;
|
|
69
|
+
};
|
|
70
|
+
selectCapturedProcessGroupIds = (rootPid, samples) => {
|
|
71
|
+
const processGroupIds = new Set([rootPid]);
|
|
72
|
+
for (const sample of samples) {
|
|
73
|
+
if (sample.pid === sample.process_group_id) processGroupIds.add(sample.pid);
|
|
74
|
+
}
|
|
75
|
+
return [...processGroupIds];
|
|
76
|
+
};
|
|
77
|
+
})))();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region dist/process/ExecFileOutput.js
|
|
82
|
+
var STOP_GRACE_MS, abortError, timeoutError, invalidTimeout, execFileOutputFailure, execFileBytes, execFileOutput;
|
|
83
|
+
function init_ExecFileOutput() {
|
|
84
|
+
return (init_ExecFileOutput = __esmMin((() => {
|
|
85
|
+
STOP_GRACE_MS = 5e3;
|
|
86
|
+
abortError = (signal) => {
|
|
87
|
+
const error = new Error("The operation was aborted", { cause: signal.reason });
|
|
88
|
+
error.name = "AbortError";
|
|
89
|
+
Reflect.set(error, "code", "ABORT_ERR");
|
|
90
|
+
return error;
|
|
91
|
+
};
|
|
92
|
+
timeoutError = (command, timeout, exit) => {
|
|
93
|
+
const error = new Error(`Command timed out after ${String(timeout)} ms: ${command}`, exit === null ? undefined : { cause: exit });
|
|
94
|
+
Reflect.set(error, "code", "ETIMEDOUT");
|
|
95
|
+
Reflect.set(error, "killed", true);
|
|
96
|
+
Reflect.set(error, "signal", exit === null ? null : Reflect.get(exit, "signal") ?? null);
|
|
97
|
+
return error;
|
|
98
|
+
};
|
|
99
|
+
invalidTimeout = (timeout) => {
|
|
100
|
+
if (Number.isSafeInteger(timeout) && timeout >= 0) return undefined;
|
|
101
|
+
const error = new RangeError(`The value of "timeout" is out of range. It must be an unsigned integer. Received ${String(timeout)}`);
|
|
102
|
+
Reflect.set(error, "code", "ERR_OUT_OF_RANGE");
|
|
103
|
+
return error;
|
|
104
|
+
};
|
|
105
|
+
execFileOutputFailure = (cause) => {
|
|
106
|
+
if (!(cause instanceof Error)) return undefined;
|
|
107
|
+
const stdout = Reflect.get(cause, "stdout");
|
|
108
|
+
const stderr = Reflect.get(cause, "stderr");
|
|
109
|
+
const code = Reflect.get(cause, "code");
|
|
110
|
+
const signal = Reflect.get(cause, "signal");
|
|
111
|
+
const killed = Reflect.get(cause, "killed");
|
|
112
|
+
if (typeof stdout !== "string" || typeof stderr !== "string") return undefined;
|
|
113
|
+
return {
|
|
114
|
+
stdout,
|
|
115
|
+
stderr,
|
|
116
|
+
code: typeof code === "string" || typeof code === "number" ? code : null,
|
|
117
|
+
signal: typeof signal === "string" ? signal : null,
|
|
118
|
+
killed: killed === true,
|
|
119
|
+
outputTruncated: code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER"
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
execFileBytes = (command, arguments_, options = {}) => new Promise((resolve, reject) => {
|
|
123
|
+
const { stopSignal, signal, timeout, ...execOptions } = options;
|
|
124
|
+
const invalid = timeout === undefined ? undefined : invalidTimeout(timeout);
|
|
125
|
+
if (invalid !== undefined) {
|
|
126
|
+
reject(invalid);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (stopSignal !== undefined && signal?.aborted === true) {
|
|
130
|
+
reject(abortError(signal));
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
let stopped;
|
|
134
|
+
let deadline;
|
|
135
|
+
let grace;
|
|
136
|
+
const child = execFile(command, [...arguments_], {
|
|
137
|
+
...execOptions,
|
|
138
|
+
...stopSignal === undefined ? {
|
|
139
|
+
...signal === undefined ? {} : { signal },
|
|
140
|
+
...timeout === undefined ? {} : { timeout }
|
|
141
|
+
} : { killSignal: stopSignal },
|
|
142
|
+
encoding: "buffer",
|
|
143
|
+
maxBuffer: options.maxBuffer ?? Number.POSITIVE_INFINITY
|
|
144
|
+
}, (error, stdout, stderr) => {
|
|
145
|
+
signal?.removeEventListener("abort", onAbort);
|
|
146
|
+
clearTimeout(deadline);
|
|
147
|
+
clearTimeout(grace);
|
|
148
|
+
const failure = stopped === "abort" && signal !== undefined ? abortError(signal) : stopped === "timeout" && timeout !== undefined ? timeoutError(command, timeout, error) : error;
|
|
149
|
+
if (failure !== null) {
|
|
150
|
+
Reflect.set(failure, "stdout", stdout.toString("utf8"));
|
|
151
|
+
Reflect.set(failure, "stderr", stderr.toString("utf8"));
|
|
152
|
+
reject(failure);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
resolve({
|
|
156
|
+
stdout,
|
|
157
|
+
stderr
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
const stop = (reason) => {
|
|
161
|
+
if (stopped !== undefined) return;
|
|
162
|
+
stopped = reason;
|
|
163
|
+
child.kill(stopSignal);
|
|
164
|
+
grace = setTimeout(() => child.kill("SIGKILL"), STOP_GRACE_MS);
|
|
165
|
+
};
|
|
166
|
+
const onAbort = () => {
|
|
167
|
+
stop("abort");
|
|
168
|
+
};
|
|
169
|
+
if (stopSignal === undefined) return;
|
|
170
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
171
|
+
if (timeout !== undefined && timeout > 0) deadline = setTimeout(() => {
|
|
172
|
+
stop("timeout");
|
|
173
|
+
}, timeout);
|
|
174
|
+
});
|
|
175
|
+
execFileOutput = (command, arguments_, options = {}) => execFileBytes(command, arguments_, options).then(({ stdout, stderr }) => ({
|
|
176
|
+
stdout: stdout.toString("utf8"),
|
|
177
|
+
stderr: stderr.toString("utf8")
|
|
178
|
+
}));
|
|
179
|
+
})))();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region dist/process/boundedUtf8Text.js
|
|
184
|
+
var boundedUtf8Text;
|
|
185
|
+
function init_boundedUtf8Text() {
|
|
186
|
+
return (init_boundedUtf8Text = __esmMin((() => {
|
|
187
|
+
boundedUtf8Text = (value, maximumBytes) => {
|
|
188
|
+
let bytes = 0;
|
|
189
|
+
let end = 0;
|
|
190
|
+
for (const codePoint of value) {
|
|
191
|
+
const codePointBytes = Buffer.byteLength(codePoint, "utf8");
|
|
192
|
+
if (bytes + codePointBytes > maximumBytes) return {
|
|
193
|
+
text: value.slice(0, end),
|
|
194
|
+
truncated: true
|
|
195
|
+
};
|
|
196
|
+
bytes += codePointBytes;
|
|
197
|
+
end += codePoint.length;
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
text: value,
|
|
201
|
+
truncated: false
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
})))();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region dist/process/DarwinProcessRunTokenReader.js
|
|
209
|
+
var responseSchema, identityResponseSchema, sourceFiles, SWIFTC_INTERRUPT, COMPILER_TIMEOUT_MS, STDERR_EXCERPT_LIMIT, DarwinProcessOwnershipInspectionError, MAX_COMPILER_STDERR_BYTES, compilerOutcome, compilerOutcomeDescription, compilerInspectionError, abortReason, isExpectedAbort$1, waitForCompilation, createDarwinProcessRunTokenReader;
|
|
210
|
+
function init_DarwinProcessRunTokenReader() {
|
|
211
|
+
return (init_DarwinProcessRunTokenReader = __esmMin((() => {
|
|
212
|
+
init_safeJson();
|
|
213
|
+
init_boundedUtf8Text();
|
|
214
|
+
init_ExecFileOutput();
|
|
215
|
+
responseSchema = z.strictObject({ results: z.array(z.discriminatedUnion("state", [z.strictObject({
|
|
216
|
+
pid: z.number().int().positive(),
|
|
217
|
+
state: z.literal("readable"),
|
|
218
|
+
run_id: z.string().optional(),
|
|
219
|
+
reason: z.null().optional()
|
|
220
|
+
}), z.strictObject({
|
|
221
|
+
pid: z.number().int().positive(),
|
|
222
|
+
state: z.literal("unavailable"),
|
|
223
|
+
run_id: z.union([z.string(), z.null()]).optional(),
|
|
224
|
+
reason: z.string().min(1)
|
|
225
|
+
})])) });
|
|
226
|
+
identityResponseSchema = z.strictObject({ results: z.array(z.discriminatedUnion("state", [z.strictObject({
|
|
227
|
+
pid: z.number().int().positive(),
|
|
228
|
+
state: z.literal("readable"),
|
|
229
|
+
identity: z.string().min(1),
|
|
230
|
+
reason: z.null().optional()
|
|
231
|
+
}), z.strictObject({
|
|
232
|
+
pid: z.number().int().positive(),
|
|
233
|
+
state: z.literal("unavailable"),
|
|
234
|
+
identity: z.null().optional(),
|
|
235
|
+
reason: z.string().min(1)
|
|
236
|
+
})])) });
|
|
237
|
+
sourceFiles = [fileURLToPath(new URL("../../bridge/process/ProcessRunTokenReader.swift", new URL("../process/DarwinProcessRunTokenReader.js", import.meta.url).href)), fileURLToPath(new URL("../../bridge/process/ProcessRunTokenReaderMain.swift", new URL("../process/DarwinProcessRunTokenReader.js", import.meta.url).href))];
|
|
238
|
+
SWIFTC_INTERRUPT = "SIGINT";
|
|
239
|
+
COMPILER_TIMEOUT_MS = 6e4;
|
|
240
|
+
STDERR_EXCERPT_LIMIT = 512;
|
|
241
|
+
DarwinProcessOwnershipInspectionError = class extends Error {
|
|
242
|
+
constructor(message, options) {
|
|
243
|
+
const { compilerOutcome, ...errorOptions } = options ?? {};
|
|
244
|
+
super(message, errorOptions);
|
|
245
|
+
this.name = "DarwinProcessOwnershipInspectionError";
|
|
246
|
+
this.compilerOutcome = compilerOutcome;
|
|
247
|
+
}
|
|
248
|
+
compilerOutcome;
|
|
249
|
+
};
|
|
250
|
+
MAX_COMPILER_STDERR_BYTES = 8 * 1024;
|
|
251
|
+
compilerOutcome = (cause, timeoutMs) => {
|
|
252
|
+
const failure = execFileOutputFailure(cause);
|
|
253
|
+
if (failure === undefined) return undefined;
|
|
254
|
+
const stderr = boundedUtf8Text(failure.stderr, MAX_COMPILER_STDERR_BYTES);
|
|
255
|
+
const outcome = failure.code === "ETIMEDOUT" ? "timed_out" : typeof failure.code === "number" ? "exited" : failure.signal !== null ? "signaled" : failure.code === "ENOENT" ? "spawn_failed" : "failed";
|
|
256
|
+
return {
|
|
257
|
+
outcome,
|
|
258
|
+
code: failure.code,
|
|
259
|
+
signal: failure.signal,
|
|
260
|
+
stderr: stderr.text,
|
|
261
|
+
stderrBytes: Buffer.byteLength(failure.stderr, "utf8"),
|
|
262
|
+
stderrTruncated: stderr.truncated,
|
|
263
|
+
outputTruncated: failure.outputTruncated,
|
|
264
|
+
killed: failure.killed,
|
|
265
|
+
...outcome === "timed_out" ? { timeoutMs } : {}
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
compilerOutcomeDescription = (outcome, fallbackCode) => {
|
|
269
|
+
if (outcome === undefined) return `compiler result: ${String(fallbackCode)}`;
|
|
270
|
+
if (outcome.outcome === "exited") return `compiler result: exit code ${String(outcome.code)}`;
|
|
271
|
+
if (outcome.outcome === "timed_out") return `compiler result: timed out after ${String(outcome.timeoutMs)} ms`;
|
|
272
|
+
if (outcome.outcome === "signaled") return `compiler result: stopped by signal ${outcome.signal ?? "an unknown signal"}`;
|
|
273
|
+
return `compiler result: ${String(outcome.code)}`;
|
|
274
|
+
};
|
|
275
|
+
compilerInspectionError = (cause, timeoutMs) => {
|
|
276
|
+
const outcome = compilerOutcome(cause, timeoutMs);
|
|
277
|
+
const code = outcome?.code ?? "unknown";
|
|
278
|
+
const description = compilerOutcomeDescription(outcome, code);
|
|
279
|
+
const prefix = code === "ENOENT" ? "macOS process ownership inspection requires the Apple Swift compiler via xcrun" : "macOS process ownership helper compilation failed via xcrun";
|
|
280
|
+
const stderr = boundedUtf8Text(outcome?.stderr ?? "", STDERR_EXCERPT_LIMIT);
|
|
281
|
+
const diagnostics = stderr.text.trim();
|
|
282
|
+
const truncated = stderr.truncated || outcome?.stderrTruncated === true || outcome?.outputTruncated === true;
|
|
283
|
+
const suffix = diagnostics ? `: ${diagnostics}${truncated ? "… [diagnostics truncated]" : ""}` : outcome === undefined ? `: ${cause instanceof Error ? cause.message : String(cause)}` : ": no compiler diagnostics were captured";
|
|
284
|
+
return new DarwinProcessOwnershipInspectionError(`${prefix} (${description})${suffix}`, {
|
|
285
|
+
cause,
|
|
286
|
+
...outcome === undefined ? {} : { compilerOutcome: outcome }
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
abortReason = (signal) => {
|
|
290
|
+
if (signal.reason !== undefined) return signal.reason;
|
|
291
|
+
const error = new Error("The operation was aborted");
|
|
292
|
+
error.name = "AbortError";
|
|
293
|
+
return error;
|
|
294
|
+
};
|
|
295
|
+
isExpectedAbort$1 = (cause, signal) => signal.aborted && (cause === signal.reason || cause instanceof Error && cause.name === "AbortError");
|
|
296
|
+
waitForCompilation = async (promise, signal) => {
|
|
297
|
+
if (signal === undefined) return promise;
|
|
298
|
+
if (signal.aborted) throw abortReason(signal);
|
|
299
|
+
return new Promise((resolve, reject) => {
|
|
300
|
+
let completed = false;
|
|
301
|
+
const finish = (callback) => {
|
|
302
|
+
if (completed) return;
|
|
303
|
+
completed = true;
|
|
304
|
+
signal.removeEventListener("abort", onAbort);
|
|
305
|
+
callback();
|
|
306
|
+
};
|
|
307
|
+
const onAbort = () => finish(() => reject(abortReason(signal)));
|
|
308
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
309
|
+
promise.then((value) => finish(() => resolve(value)), (cause) => finish(() => reject(cause)));
|
|
310
|
+
if (signal.aborted) onAbort();
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
createDarwinProcessRunTokenReader = (options = {}) => {
|
|
314
|
+
const compilerTimeoutMs = options.compileTimeoutMs ?? COMPILER_TIMEOUT_MS;
|
|
315
|
+
let root;
|
|
316
|
+
let executable;
|
|
317
|
+
let compilation;
|
|
318
|
+
let closePromise;
|
|
319
|
+
let closed = false;
|
|
320
|
+
let exitCleanupInstalled = false;
|
|
321
|
+
const cleanupAtExit = () => {
|
|
322
|
+
if (root !== undefined) rmSync(root, {
|
|
323
|
+
recursive: true,
|
|
324
|
+
force: true
|
|
325
|
+
});
|
|
326
|
+
};
|
|
327
|
+
const cleanupRoot = async (target = root) => {
|
|
328
|
+
if (target === undefined) return;
|
|
329
|
+
await rm(target, {
|
|
330
|
+
recursive: true,
|
|
331
|
+
force: true
|
|
332
|
+
});
|
|
333
|
+
if (root !== target) return;
|
|
334
|
+
root = undefined;
|
|
335
|
+
executable = undefined;
|
|
336
|
+
if (exitCleanupInstalled) process.removeListener("exit", cleanupAtExit);
|
|
337
|
+
exitCleanupInstalled = false;
|
|
338
|
+
};
|
|
339
|
+
const runCompilation = async (signal) => {
|
|
340
|
+
let operationRoot;
|
|
341
|
+
try {
|
|
342
|
+
operationRoot = await mkdtemp(join(tmpdir(), "rea-process-token-"));
|
|
343
|
+
root = operationRoot;
|
|
344
|
+
process.once("exit", cleanupAtExit);
|
|
345
|
+
exitCleanupInstalled = true;
|
|
346
|
+
if (signal.aborted || closed) throw abortReason(signal);
|
|
347
|
+
const output = join(operationRoot, "reader");
|
|
348
|
+
const compilerTemporary = join(operationRoot, "tmp");
|
|
349
|
+
await mkdir(compilerTemporary);
|
|
350
|
+
const compilerEnvironment = {
|
|
351
|
+
...process.env,
|
|
352
|
+
TMPDIR: compilerTemporary
|
|
353
|
+
};
|
|
354
|
+
delete compilerEnvironment.CLANG_MODULE_CACHE_PATH;
|
|
355
|
+
try {
|
|
356
|
+
await execFileOutput(options.xcrun ?? "/usr/bin/xcrun", [
|
|
357
|
+
"swiftc",
|
|
358
|
+
...sourceFiles,
|
|
359
|
+
"-o",
|
|
360
|
+
output
|
|
361
|
+
], {
|
|
362
|
+
timeout: compilerTimeoutMs,
|
|
363
|
+
maxBuffer: 1024 * 1024,
|
|
364
|
+
signal,
|
|
365
|
+
stopSignal: SWIFTC_INTERRUPT,
|
|
366
|
+
env: compilerEnvironment
|
|
367
|
+
});
|
|
368
|
+
} catch (cause) {
|
|
369
|
+
if (isExpectedAbort$1(cause, signal)) throw cause;
|
|
370
|
+
throw compilerInspectionError(cause, compilerTimeoutMs);
|
|
371
|
+
}
|
|
372
|
+
if (signal.aborted || closed) throw abortReason(signal);
|
|
373
|
+
executable = output;
|
|
374
|
+
return output;
|
|
375
|
+
} catch (cause) {
|
|
376
|
+
const ownsRoot = operationRoot !== undefined && root === operationRoot;
|
|
377
|
+
if (operationRoot !== undefined) {
|
|
378
|
+
if (ownsRoot) await cleanupRoot(operationRoot);
|
|
379
|
+
else await rm(operationRoot, {
|
|
380
|
+
recursive: true,
|
|
381
|
+
force: true
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
throw cause;
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
const beginCompilation = () => {
|
|
388
|
+
const controller = new AbortController();
|
|
389
|
+
const operation = {
|
|
390
|
+
controller,
|
|
391
|
+
promise: runCompilation(controller.signal).finally(() => {
|
|
392
|
+
operation.settled = true;
|
|
393
|
+
if (compilation === operation) compilation = undefined;
|
|
394
|
+
}),
|
|
395
|
+
waiters: 0,
|
|
396
|
+
aborting: false,
|
|
397
|
+
settled: false
|
|
398
|
+
};
|
|
399
|
+
compilation = operation;
|
|
400
|
+
return operation;
|
|
401
|
+
};
|
|
402
|
+
const compile = async (signal) => {
|
|
403
|
+
if (closed) throw new Error("Darwin process token reader is closed");
|
|
404
|
+
signal?.throwIfAborted();
|
|
405
|
+
while (true) {
|
|
406
|
+
if (closed) throw new Error("Darwin process token reader is closed");
|
|
407
|
+
signal?.throwIfAborted();
|
|
408
|
+
if (executable !== undefined) return executable;
|
|
409
|
+
if (compilation === undefined && root !== undefined) {
|
|
410
|
+
await cleanupRoot();
|
|
411
|
+
continue;
|
|
412
|
+
}
|
|
413
|
+
let operation = compilation;
|
|
414
|
+
if (operation?.aborting === true) {
|
|
415
|
+
try {
|
|
416
|
+
await waitForCompilation(operation.promise, signal);
|
|
417
|
+
} catch (cause) {
|
|
418
|
+
if (signal !== undefined && isExpectedAbort$1(cause, signal)) throw cause;
|
|
419
|
+
}
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
operation ??= beginCompilation();
|
|
423
|
+
operation.waiters += 1;
|
|
424
|
+
try {
|
|
425
|
+
return await waitForCompilation(operation.promise, signal);
|
|
426
|
+
} finally {
|
|
427
|
+
operation.waiters -= 1;
|
|
428
|
+
if (operation.waiters === 0 && !operation.settled && !operation.aborting) {
|
|
429
|
+
operation.aborting = true;
|
|
430
|
+
operation.controller.abort();
|
|
431
|
+
await operation.promise.catch(() => undefined);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
const read = async (processes, signal) => {
|
|
437
|
+
signal?.throwIfAborted();
|
|
438
|
+
if (processes.length === 0) return new Map();
|
|
439
|
+
const binary = await compile(signal);
|
|
440
|
+
const pids = processes.map(({ pid }) => String(pid));
|
|
441
|
+
const { stdout } = await execFileOutput(binary, pids, {
|
|
442
|
+
timeout: 15e3,
|
|
443
|
+
...signal === undefined ? {} : { signal }
|
|
444
|
+
});
|
|
445
|
+
signal?.throwIfAborted();
|
|
446
|
+
const decoded = safeParseJson(stdout);
|
|
447
|
+
if (!decoded.ok) throw new Error(`macOS process token helper returned invalid JSON: ${decoded.error}`, { cause: decoded.cause });
|
|
448
|
+
const parsed = responseSchema.safeParse(decoded.value);
|
|
449
|
+
if (!parsed.success) throw new Error("macOS process token helper returned an invalid response", { cause: parsed.error });
|
|
450
|
+
const requested = new Set(processes.map(({ pid }) => pid));
|
|
451
|
+
const observations = new Map();
|
|
452
|
+
for (const result of parsed.data.results) {
|
|
453
|
+
if (!requested.has(result.pid) || observations.has(result.pid)) throw new Error("macOS process token helper returned an unexpected PID set");
|
|
454
|
+
observations.set(result.pid, result.state === "readable" ? {
|
|
455
|
+
state: "readable",
|
|
456
|
+
runId: result.run_id
|
|
457
|
+
} : {
|
|
458
|
+
state: "unavailable",
|
|
459
|
+
reason: result.reason ?? "process token observation is unavailable"
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
if (observations.size !== requested.size) throw new Error("macOS process token helper returned an incomplete PID set");
|
|
463
|
+
return observations;
|
|
464
|
+
};
|
|
465
|
+
const identities = async (processes, signal) => {
|
|
466
|
+
if (processes.length === 0) return new Map();
|
|
467
|
+
const binary = await compile(signal);
|
|
468
|
+
const pids = processes.map(({ pid }) => String(pid));
|
|
469
|
+
const { stdout } = await execFileOutput(binary, ["--identities", ...pids], {
|
|
470
|
+
timeout: 15e3,
|
|
471
|
+
...signal === undefined ? {} : { signal }
|
|
472
|
+
});
|
|
473
|
+
const decoded = safeParseJson(stdout);
|
|
474
|
+
if (!decoded.ok) throw new Error(`macOS process identity helper returned invalid JSON: ${decoded.error}`, { cause: decoded.cause });
|
|
475
|
+
const parsed = identityResponseSchema.safeParse(decoded.value);
|
|
476
|
+
if (!parsed.success) throw new Error("macOS process identity helper returned an invalid response", { cause: parsed.error });
|
|
477
|
+
const requested = new Set(processes.map(({ pid }) => pid));
|
|
478
|
+
const observations = new Map();
|
|
479
|
+
for (const result of parsed.data.results) {
|
|
480
|
+
if (!requested.has(result.pid) || observations.has(result.pid)) throw new Error("macOS process identity helper returned an unexpected PID set");
|
|
481
|
+
observations.set(result.pid, result.state === "readable" ? {
|
|
482
|
+
state: "readable",
|
|
483
|
+
identity: result.identity
|
|
484
|
+
} : {
|
|
485
|
+
state: "unavailable",
|
|
486
|
+
reason: result.reason
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
if (observations.size !== requested.size) throw new Error("macOS process identity helper returned an incomplete PID set");
|
|
490
|
+
return observations;
|
|
491
|
+
};
|
|
492
|
+
const close = () => {
|
|
493
|
+
if (closePromise !== undefined) return closePromise;
|
|
494
|
+
closed = true;
|
|
495
|
+
const pendingClose = (async () => {
|
|
496
|
+
const operation = compilation;
|
|
497
|
+
if (operation !== undefined && !operation.settled) {
|
|
498
|
+
operation.aborting = true;
|
|
499
|
+
operation.controller.abort();
|
|
500
|
+
await operation.promise.catch(() => undefined);
|
|
501
|
+
}
|
|
502
|
+
await cleanupRoot();
|
|
503
|
+
})().catch((cause) => {
|
|
504
|
+
if (closePromise === pendingClose) closePromise = undefined;
|
|
505
|
+
throw cause;
|
|
506
|
+
});
|
|
507
|
+
closePromise = pendingClose;
|
|
508
|
+
return closePromise;
|
|
509
|
+
};
|
|
510
|
+
return {
|
|
511
|
+
read,
|
|
512
|
+
identities,
|
|
513
|
+
prepare: compile,
|
|
514
|
+
close
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
})))();
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
//#endregion
|
|
521
|
+
//#region dist/process/ProcessRunTokenObservations.js
|
|
522
|
+
/** Read only ownership tokens, using per-process fallback for missing batch rows. */
|
|
523
|
+
async function* readProcessRunTokens(host, processes, signal) {
|
|
524
|
+
signal?.throwIfAborted();
|
|
525
|
+
if (processes.length === 0) return;
|
|
526
|
+
let batch;
|
|
527
|
+
let batchFailure;
|
|
528
|
+
if (host.runTokens !== undefined) {
|
|
529
|
+
try {
|
|
530
|
+
batch = signal === undefined ? await host.runTokens(processes) : await host.runTokens(processes, signal);
|
|
531
|
+
} catch (cause) {
|
|
532
|
+
signal?.throwIfAborted();
|
|
533
|
+
batchFailure = errorMessage$1(cause);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
for (const process of processes) {
|
|
537
|
+
signal?.throwIfAborted();
|
|
538
|
+
let observation = batch?.get(process.pid);
|
|
539
|
+
if (observation === undefined) {
|
|
540
|
+
try {
|
|
541
|
+
const environment = signal === undefined ? await host.environment(process.pid) : await host.environment(process.pid, signal);
|
|
542
|
+
observation = {
|
|
543
|
+
state: "readable",
|
|
544
|
+
runId: environment.REA_PROCESS_RUN_ID
|
|
545
|
+
};
|
|
546
|
+
} catch (cause) {
|
|
547
|
+
signal?.throwIfAborted();
|
|
548
|
+
const reason = errorMessage$1(cause);
|
|
549
|
+
observation = {
|
|
550
|
+
state: "unavailable",
|
|
551
|
+
reason: batchFailure === undefined ? reason : `${reason}; run-token batch failed: ${batchFailure}`
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
signal?.throwIfAborted();
|
|
556
|
+
yield {
|
|
557
|
+
process,
|
|
558
|
+
observation
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
var errorMessage$1;
|
|
563
|
+
function init_ProcessRunTokenObservations() {
|
|
564
|
+
return (init_ProcessRunTokenObservations = __esmMin((() => {
|
|
565
|
+
errorMessage$1 = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
566
|
+
})))();
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region dist/process/ProcessOwnershipObservation.js
|
|
571
|
+
var observeOwnedProcessGroups, observeOwnedProcessLineage, unavailableLineage, parseProcessEnvironment, parseLinuxProcessStartTime, isExpectedAbort, createSystemProcessOwnershipHost, systemProcessOwnershipHost, observeProcessStartIdentity, signalProcessWithStartIdentity, prepareProcessOwnershipInspection, processIsGone, errorMessage;
|
|
572
|
+
function init_ProcessOwnershipObservation() {
|
|
573
|
+
return (init_ProcessOwnershipObservation = __esmMin((() => {
|
|
574
|
+
init_analysisErrorCore();
|
|
575
|
+
init_ProcessOwnershipIdentity();
|
|
576
|
+
init_ProcessOwnershipProcessTree();
|
|
577
|
+
init_ExecFileOutput();
|
|
578
|
+
init_DarwinProcessRunTokenReader();
|
|
579
|
+
init_ProcessRunTokenObservations();
|
|
580
|
+
observeOwnedProcessGroups = async (runId, processGroupIds, host = systemProcessOwnershipHost, signal) => {
|
|
581
|
+
signal?.throwIfAborted();
|
|
582
|
+
const groupIds = [...new Set(processGroupIds)];
|
|
583
|
+
if (groupIds.length === 0) return new Map();
|
|
584
|
+
let processes;
|
|
585
|
+
try {
|
|
586
|
+
processes = liveProcesses(await host.listProcesses(signal));
|
|
587
|
+
} catch (cause) {
|
|
588
|
+
signal?.throwIfAborted();
|
|
589
|
+
const failure = {
|
|
590
|
+
state: "unverifiable",
|
|
591
|
+
reason: `process group could not be inspected: ${errorMessage(cause)}`
|
|
592
|
+
};
|
|
593
|
+
return new Map(groupIds.map((groupId) => [groupId, failure]));
|
|
594
|
+
}
|
|
595
|
+
signal?.throwIfAborted();
|
|
596
|
+
const membersByGroup = new Map(groupIds.map((groupId) => [groupId, []]));
|
|
597
|
+
for (const process of processes) membersByGroup.get(process.processGroupId)?.push(process);
|
|
598
|
+
const observations = new Map(groupIds.map((groupId) => [groupId, (membersByGroup.get(groupId)?.length ?? 0) > 0 ? { state: "alive" } : { state: "empty" }]));
|
|
599
|
+
const liveMembers = groupIds.flatMap((groupId) => membersByGroup.get(groupId) ?? []);
|
|
600
|
+
const pendingGroups = new Set(groupIds.filter((groupId) => (membersByGroup.get(groupId)?.length ?? 0) > 0));
|
|
601
|
+
for await (const { process: member, observation } of readProcessRunTokens(host, liveMembers, signal)) {
|
|
602
|
+
if (!pendingGroups.has(member.processGroupId)) continue;
|
|
603
|
+
if (observation.state === "readable") {
|
|
604
|
+
if (observation.runId !== runId) {
|
|
605
|
+
observations.set(member.processGroupId, {
|
|
606
|
+
state: "unverifiable",
|
|
607
|
+
reason: "process ownership did not match"
|
|
608
|
+
});
|
|
609
|
+
pendingGroups.delete(member.processGroupId);
|
|
610
|
+
}
|
|
611
|
+
} else {
|
|
612
|
+
const gone = await processIsGone(host, member.pid);
|
|
613
|
+
signal?.throwIfAborted();
|
|
614
|
+
if (!gone) {
|
|
615
|
+
observations.set(member.processGroupId, {
|
|
616
|
+
state: "unverifiable",
|
|
617
|
+
reason: `process ownership could not be revalidated for PID ${member.pid}: ${observation.reason}`
|
|
618
|
+
});
|
|
619
|
+
pendingGroups.delete(member.processGroupId);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (pendingGroups.size === 0) break;
|
|
623
|
+
}
|
|
624
|
+
signal?.throwIfAborted();
|
|
625
|
+
return observations;
|
|
626
|
+
};
|
|
627
|
+
observeOwnedProcessLineage = async (ownership, host = systemProcessOwnershipHost) => {
|
|
628
|
+
let processes;
|
|
629
|
+
try {
|
|
630
|
+
processes = liveProcesses(await host.listProcesses());
|
|
631
|
+
} catch (cause) {
|
|
632
|
+
return unavailableLineage(ownership, `process table could not be inspected: ${errorMessage(cause)}`);
|
|
633
|
+
}
|
|
634
|
+
const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
|
|
635
|
+
if (launcher === undefined) return unavailableLineage(ownership, "owned launcher is not live");
|
|
636
|
+
const identityFailure = launcherIdentityFailure(launcher, ownership);
|
|
637
|
+
if (identityFailure !== null) return unavailableLineage(ownership, identityFailure);
|
|
638
|
+
const descendants = descendantsOf([launcher.pid], processes);
|
|
639
|
+
const verifiedDescendants = [];
|
|
640
|
+
for await (const { process: member, observation } of readProcessRunTokens(host, [launcher, ...descendants])) {
|
|
641
|
+
if (observation.state === "readable") {
|
|
642
|
+
if (observation.runId !== ownership.runId) return unavailableLineage(ownership, "process lineage contains an unowned or PID-reused process");
|
|
643
|
+
if (member.pid !== launcher.pid) verifiedDescendants.push(member);
|
|
644
|
+
} else {
|
|
645
|
+
if (await processIsGone(host, member.pid)) {
|
|
646
|
+
if (member.pid === launcher.pid) return unavailableLineage(ownership, "owned launcher exited during lineage validation");
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
return unavailableLineage(ownership, `process ownership could not be revalidated for PID ${member.pid}: ${observation.reason}`);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return {
|
|
653
|
+
status: "verified",
|
|
654
|
+
observedAt: new Date().toISOString(),
|
|
655
|
+
lineage: {
|
|
656
|
+
runId: ownership.runId,
|
|
657
|
+
launcherPid: launcher.pid,
|
|
658
|
+
launcherParentPid: launcher.parentPid,
|
|
659
|
+
processGroupId: launcher.processGroupId,
|
|
660
|
+
descendants: verifiedDescendants.sort((left, right) => left.pid - right.pid).map(({ pid, parentPid, processGroupId }) => ({
|
|
661
|
+
pid,
|
|
662
|
+
parentPid,
|
|
663
|
+
processGroupId
|
|
664
|
+
}))
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
unavailableLineage = (ownership, reason) => ({
|
|
669
|
+
status: "unavailable",
|
|
670
|
+
observedAt: new Date().toISOString(),
|
|
671
|
+
runId: ownership.runId,
|
|
672
|
+
launcherPid: ownership.leaderPid,
|
|
673
|
+
processGroupId: ownership.processGroupId,
|
|
674
|
+
reason
|
|
675
|
+
});
|
|
676
|
+
parseProcessEnvironment = (value) => Object.fromEntries(value.split("\0").filter((entry) => entry.indexOf("=") > 0).map((entry) => {
|
|
677
|
+
const separator = entry.indexOf("=");
|
|
678
|
+
return [entry.slice(0, separator), entry.slice(separator + 1)];
|
|
679
|
+
}));
|
|
680
|
+
parseLinuxProcessStartTime = (value) => {
|
|
681
|
+
const commandEnd = value.lastIndexOf(")");
|
|
682
|
+
if (commandEnd < 0) return undefined;
|
|
683
|
+
const fields = value.slice(commandEnd + 1).trim().split(/\s+/u);
|
|
684
|
+
const startTime = fields[19];
|
|
685
|
+
return startTime !== undefined && /^\d+$/u.test(startTime) ? startTime : undefined;
|
|
686
|
+
};
|
|
687
|
+
isExpectedAbort = (cause, signal) => signal?.aborted === true && (cause === signal.reason || cause instanceof Error && cause.name === "AbortError");
|
|
688
|
+
createSystemProcessOwnershipHost = (platform = process.platform, hostEnvironment = process.env, options = {}) => {
|
|
689
|
+
const darwinTokens = platform === "darwin" ? createDarwinProcessRunTokenReader(options.darwinXcrun === undefined ? {} : { xcrun: options.darwinXcrun }) : undefined;
|
|
690
|
+
const listProcesses = async (signal) => {
|
|
691
|
+
if (platform === "win32") return [];
|
|
692
|
+
const { stdout } = await execFileOutput("ps", ["-axo", "pid=,ppid=,pgid=,uid=,stat=,command="], {
|
|
693
|
+
env: hostEnvironment,
|
|
694
|
+
...signal === undefined ? {} : { signal }
|
|
695
|
+
});
|
|
696
|
+
return stdout.split("\n").map((line) => /\s*(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+(.*)/u.exec(line)).filter((match) => match !== null).map((match) => ({
|
|
697
|
+
pid: Number(match[1]),
|
|
698
|
+
parentPid: Number(match[2]),
|
|
699
|
+
processGroupId: Number(match[3]),
|
|
700
|
+
uid: Number(match[4]),
|
|
701
|
+
state: match[5] ?? "",
|
|
702
|
+
command: match[6] ?? ""
|
|
703
|
+
}));
|
|
704
|
+
};
|
|
705
|
+
const processIdentities = async (processes, signal) => {
|
|
706
|
+
if (processes.length === 0) return new Map();
|
|
707
|
+
if (platform === "linux") return new Map(await Promise.all(processes.map(async ({ pid }) => {
|
|
708
|
+
try {
|
|
709
|
+
const stat = await readFile(`/proc/${String(pid)}/stat`, {
|
|
710
|
+
encoding: "utf8",
|
|
711
|
+
...signal === undefined ? {} : { signal }
|
|
712
|
+
});
|
|
713
|
+
const identity = parseLinuxProcessStartTime(stat);
|
|
714
|
+
return [pid, identity === undefined ? {
|
|
715
|
+
state: "unavailable",
|
|
716
|
+
reason: "malformed_proc_stat"
|
|
717
|
+
} : {
|
|
718
|
+
state: "readable",
|
|
719
|
+
identity: `linux-starttime:${identity}`
|
|
720
|
+
}];
|
|
721
|
+
} catch (cause) {
|
|
722
|
+
if (isExpectedAbort(cause, signal)) throw cause;
|
|
723
|
+
return [pid, {
|
|
724
|
+
state: "unavailable",
|
|
725
|
+
reason: errorMessage(cause)
|
|
726
|
+
}];
|
|
727
|
+
}
|
|
728
|
+
})));
|
|
729
|
+
if (darwinTokens === undefined) return new Map();
|
|
730
|
+
try {
|
|
731
|
+
return await darwinTokens.identities(processes, signal);
|
|
732
|
+
} catch (cause) {
|
|
733
|
+
if (isExpectedAbort(cause, signal)) throw cause;
|
|
734
|
+
const reason = errorMessage(cause);
|
|
735
|
+
return new Map(processes.map(({ pid }) => [pid, {
|
|
736
|
+
state: "unavailable",
|
|
737
|
+
reason
|
|
738
|
+
}]));
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
const captureBaseline = async (signal) => {
|
|
742
|
+
if (platform !== "linux" && darwinTokens === undefined) return [];
|
|
743
|
+
const processes = liveProcesses(await listProcesses(signal));
|
|
744
|
+
let identities = await processIdentities(processes, signal);
|
|
745
|
+
const unreadable = processes.filter(({ pid }) => identities.get(pid)?.state !== "readable");
|
|
746
|
+
if (unreadable.length > 0) {
|
|
747
|
+
const stillLive = liveProcesses(await listProcesses(signal)).filter(({ pid }) => unreadable.some((entry) => entry.pid === pid));
|
|
748
|
+
const retried = await processIdentities(stillLive, signal);
|
|
749
|
+
identities = new Map([...identities, ...retried]);
|
|
750
|
+
const unresolved = stillLive.filter(({ pid }) => identities.get(pid)?.state !== "readable");
|
|
751
|
+
const liveAfterRetry = liveProcesses(await listProcesses(signal));
|
|
752
|
+
const stillUnresolved = unresolved.filter(({ pid }) => liveAfterRetry.some((entry) => entry.pid === pid));
|
|
753
|
+
if (stillUnresolved.length > 0) throw new Error(`process identity snapshot is unavailable for ${String(stillUnresolved.length)} live processes`);
|
|
754
|
+
}
|
|
755
|
+
return processes.map(({ pid }) => {
|
|
756
|
+
const observation = identities.get(pid);
|
|
757
|
+
return {
|
|
758
|
+
pid,
|
|
759
|
+
identity: observation?.state === "readable" ? observation.identity : null
|
|
760
|
+
};
|
|
761
|
+
});
|
|
762
|
+
};
|
|
763
|
+
return {
|
|
764
|
+
platform,
|
|
765
|
+
prepare: async (signal) => {
|
|
766
|
+
await darwinTokens?.prepare(signal);
|
|
767
|
+
if (platform === "linux") {
|
|
768
|
+
try {
|
|
769
|
+
const processes = await listProcesses(signal);
|
|
770
|
+
if (!processes.some(({ pid }) => pid === process.pid)) throw new Error("ps did not report REA's current process");
|
|
771
|
+
} catch (cause) {
|
|
772
|
+
if (isExpectedAbort(cause, signal)) throw cause;
|
|
773
|
+
const reason = `Linux process ownership inspection requires a procps-compatible ps on REA's PATH before launching a child: ${errorMessage(cause)}`;
|
|
774
|
+
throw new AnalysisCapabilityUnavailableError("process-ownership", "prepare_owned_process", reason, {
|
|
775
|
+
cause,
|
|
776
|
+
userMessage: reason
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
listProcesses,
|
|
782
|
+
async environment(pid, signal) {
|
|
783
|
+
signal?.throwIfAborted();
|
|
784
|
+
if (platform === "linux") return parseProcessEnvironment(await readFile(`/proc/${pid}/environ`, {
|
|
785
|
+
encoding: "utf8",
|
|
786
|
+
signal
|
|
787
|
+
}));
|
|
788
|
+
if (platform === "darwin") {
|
|
789
|
+
const process = (await listProcesses(signal)).find((entry) => entry.pid === pid);
|
|
790
|
+
if (process === undefined) throw new Error(`process ${String(pid)} is not live`);
|
|
791
|
+
const observation = (await darwinTokens?.read([process], signal))?.get(pid);
|
|
792
|
+
if (observation === undefined || observation.state === "unavailable") throw new Error(observation?.reason ?? "process run token could not be read");
|
|
793
|
+
return observation.runId === undefined ? {} : { REA_PROCESS_RUN_ID: observation.runId };
|
|
794
|
+
}
|
|
795
|
+
const { stdout } = await execFileOutput("ps", [
|
|
796
|
+
"eww",
|
|
797
|
+
"-p",
|
|
798
|
+
String(pid)
|
|
799
|
+
], {
|
|
800
|
+
env: hostEnvironment,
|
|
801
|
+
...signal === undefined ? {} : { signal }
|
|
802
|
+
});
|
|
803
|
+
const observedEnvironment = {};
|
|
804
|
+
for (const match of stdout.matchAll(/(?:^|\s)([A-Za-z_][A-Za-z0-9_]*)=([^\s]*)/gu)) {
|
|
805
|
+
const name = match[1];
|
|
806
|
+
if (name !== undefined) observedEnvironment[name] = match[2] ?? "";
|
|
807
|
+
}
|
|
808
|
+
return observedEnvironment;
|
|
809
|
+
},
|
|
810
|
+
async runTokens(processes, signal) {
|
|
811
|
+
signal?.throwIfAborted();
|
|
812
|
+
if (platform !== "darwin" || processes.length === 0) return new Map();
|
|
813
|
+
try {
|
|
814
|
+
return await darwinTokens?.read(processes, signal) ?? new Map();
|
|
815
|
+
} catch (cause) {
|
|
816
|
+
if (isExpectedAbort(cause, signal)) throw cause;
|
|
817
|
+
void cause;
|
|
818
|
+
return new Map(processes.map(({ pid }) => [pid, {
|
|
819
|
+
state: "unavailable",
|
|
820
|
+
reason: "reader_failure"
|
|
821
|
+
}]));
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
...platform !== "linux" && darwinTokens === undefined ? {} : {
|
|
825
|
+
processIdentities,
|
|
826
|
+
captureBaseline,
|
|
827
|
+
...darwinTokens === undefined ? {} : { close: darwinTokens.close }
|
|
828
|
+
},
|
|
829
|
+
signalGroup(processGroupId, signal) {
|
|
830
|
+
process.kill(-processGroupId, signal);
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
systemProcessOwnershipHost = createSystemProcessOwnershipHost();
|
|
835
|
+
observeProcessStartIdentity = async (pid, host = systemProcessOwnershipHost, expectedRunId) => {
|
|
836
|
+
const process = (await host.listProcesses()).find((entry) => entry.pid === pid);
|
|
837
|
+
if (process === undefined || liveProcesses([process]).length === 0) return undefined;
|
|
838
|
+
if (host.processIdentities === undefined) return {
|
|
839
|
+
state: "unavailable",
|
|
840
|
+
reason: "process identity is unsupported"
|
|
841
|
+
};
|
|
842
|
+
const identity = (await host.processIdentities([process])).get(pid) ?? {
|
|
843
|
+
state: "unavailable",
|
|
844
|
+
reason: "process identity was not returned"
|
|
845
|
+
};
|
|
846
|
+
if (expectedRunId === undefined || identity.state !== "readable") return identity;
|
|
847
|
+
let owned = false;
|
|
848
|
+
for await (const { observation } of readProcessRunTokens(host, [process])) {
|
|
849
|
+
if (observation.state === "unavailable") return {
|
|
850
|
+
state: "unavailable",
|
|
851
|
+
reason: `process ownership token could not be read for PID ${String(pid)}: ${observation.reason}`
|
|
852
|
+
};
|
|
853
|
+
if (observation.runId !== expectedRunId) return {
|
|
854
|
+
state: "unavailable",
|
|
855
|
+
reason: `process ownership token did not match the captured run for PID ${String(pid)}`
|
|
856
|
+
};
|
|
857
|
+
owned = true;
|
|
858
|
+
}
|
|
859
|
+
if (!owned) return {
|
|
860
|
+
state: "unavailable",
|
|
861
|
+
reason: `process ownership token was not returned for PID ${String(pid)}`
|
|
862
|
+
};
|
|
863
|
+
const confirmed = await observeProcessStartIdentity(pid, host);
|
|
864
|
+
if (confirmed === undefined || confirmed.state !== "readable") return confirmed;
|
|
865
|
+
return confirmed.identity === identity.identity ? identity : {
|
|
866
|
+
state: "unavailable",
|
|
867
|
+
reason: `process identity changed while validating the captured run token for PID ${String(pid)}`
|
|
868
|
+
};
|
|
869
|
+
};
|
|
870
|
+
signalProcessWithStartIdentity = async (pid, expectedIdentity, signal, options = {}) => {
|
|
871
|
+
const host = options.host ?? systemProcessOwnershipHost;
|
|
872
|
+
try {
|
|
873
|
+
const observed = await observeProcessStartIdentity(pid, host);
|
|
874
|
+
if (observed === undefined) return "gone";
|
|
875
|
+
if (observed.state !== "readable") return "unverified";
|
|
876
|
+
if (observed.identity !== expectedIdentity) return "identity-changed";
|
|
877
|
+
(options.sendSignal ?? process.kill)(pid, signal);
|
|
878
|
+
return "signaled";
|
|
879
|
+
} catch {
|
|
880
|
+
return "unverified";
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
prepareProcessOwnershipInspection = async (signal) => {
|
|
884
|
+
await systemProcessOwnershipHost.prepare?.(signal);
|
|
885
|
+
};
|
|
886
|
+
processIsGone = async (host, pid) => {
|
|
887
|
+
try {
|
|
888
|
+
return !liveProcesses(await host.listProcesses()).some((process) => process.pid === pid);
|
|
889
|
+
} catch (cause) {
|
|
890
|
+
void cause;
|
|
891
|
+
return false;
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
errorMessage = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
895
|
+
})))();
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
//#endregion
|
|
899
|
+
//#region dist/process/ProcessOwnership.js
|
|
900
|
+
var execFileAsync, cleanupWindowsProcessTree, systemWindowsProcessTreeHost, readProcessRunId, cleanupOwnedProcessGroup, verifyNoTokenOwnedProcesses, readLiveProcessTable, settleLauncherExit, createOwnedCleanupPlan, revalidateOwnedProcessGroup, cleanupValidationFailure, sanitizedTokenReadFailure, processOwnershipFailures, processRunTokenFailures, recheckOwnershipFailures, TOKEN_READ_RETRY_ATTEMPTS, TOKEN_READ_RETRY_DELAY_MS, PLATFORM_BINARY_ENVIRONMENT_WITHHELD, RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD, currentProcessUid, environmentWithheldFromInspection, scanTokenOwnedProcesses, settleUnreadableTokenCandidates;
|
|
901
|
+
function init_ProcessOwnership() {
|
|
902
|
+
return (init_ProcessOwnership = __esmMin((() => {
|
|
903
|
+
init_ProcessOwnershipObservation();
|
|
904
|
+
init_ProcessOwnershipIdentity();
|
|
905
|
+
init_ProcessOwnershipProcessTree();
|
|
906
|
+
init_ProcessRunTokenObservations();
|
|
907
|
+
init_unicodeCodePointOrder();
|
|
908
|
+
execFileAsync = promisify(execFile);
|
|
909
|
+
cleanupWindowsProcessTree = async (rootPid, host = systemWindowsProcessTreeHost) => {
|
|
910
|
+
if (!Number.isSafeInteger(rootPid) || rootPid <= 0) return {
|
|
911
|
+
cleaned: false,
|
|
912
|
+
reason: "Windows process-tree PID is invalid"
|
|
913
|
+
};
|
|
914
|
+
try {
|
|
915
|
+
const result = await host.terminateTree(rootPid);
|
|
916
|
+
return {
|
|
917
|
+
cleaned: true,
|
|
918
|
+
signaled: result === "terminated"
|
|
919
|
+
};
|
|
920
|
+
} catch (cause) {
|
|
921
|
+
return {
|
|
922
|
+
cleaned: false,
|
|
923
|
+
reason: `Windows process-tree termination failed for PID ${String(rootPid)}: ${errorMessage(cause)}`
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
systemWindowsProcessTreeHost = { async terminateTree(rootPid) {
|
|
928
|
+
try {
|
|
929
|
+
await execFileAsync("taskkill.exe", [
|
|
930
|
+
"/pid",
|
|
931
|
+
String(rootPid),
|
|
932
|
+
"/t",
|
|
933
|
+
"/f"
|
|
934
|
+
], {
|
|
935
|
+
windowsHide: true,
|
|
936
|
+
timeout: 5e3
|
|
937
|
+
});
|
|
938
|
+
return "terminated";
|
|
939
|
+
} catch (cause) {
|
|
940
|
+
if (cause instanceof Error && "code" in cause && (cause.code === 128 || cause.code === "ESRCH")) return "missing";
|
|
941
|
+
throw cause;
|
|
942
|
+
}
|
|
943
|
+
} };
|
|
944
|
+
readProcessRunId = async (pid, host = systemProcessOwnershipHost, signal) => (await host.environment(pid, signal)).REA_PROCESS_RUN_ID;
|
|
945
|
+
cleanupOwnedProcessGroup = async (ownership, host = systemProcessOwnershipHost) => {
|
|
946
|
+
const processTable = await readLiveProcessTable(host);
|
|
947
|
+
if (!processTable.available) return {
|
|
948
|
+
cleaned: false,
|
|
949
|
+
reason: `process table could not be inspected: ${processTable.reason}`
|
|
950
|
+
};
|
|
951
|
+
const plan = await createOwnedCleanupPlan(ownership, processTable.processes, host);
|
|
952
|
+
if ("cleaned" in plan) return plan;
|
|
953
|
+
let signaled = false;
|
|
954
|
+
for (const processGroupId of plan.signalOrder) {
|
|
955
|
+
const revalidation = await revalidateOwnedProcessGroup(processGroupId, ownership, host, plan.tokenOwnedIdentities);
|
|
956
|
+
if ("cleaned" in revalidation) return revalidation;
|
|
957
|
+
if (revalidation.empty) continue;
|
|
958
|
+
try {
|
|
959
|
+
host.signalGroup(processGroupId, "SIGKILL");
|
|
960
|
+
signaled = true;
|
|
961
|
+
} catch (cause) {
|
|
962
|
+
const code = cause instanceof Error && "code" in cause ? cause.code : undefined;
|
|
963
|
+
if (code !== "ESRCH") return {
|
|
964
|
+
cleaned: false,
|
|
965
|
+
reason: `owned process group signal failed: ${errorMessage(cause)}`
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
if (plan.unresolved.length > 0) return cleanupValidationFailure(plan.unresolved, plan.unverified);
|
|
970
|
+
return {
|
|
971
|
+
cleaned: true,
|
|
972
|
+
signaled,
|
|
973
|
+
...plan.unverified.length === 0 ? {} : { unverified: plan.unverified }
|
|
974
|
+
};
|
|
975
|
+
};
|
|
976
|
+
verifyNoTokenOwnedProcesses = async (runId, host = systemProcessOwnershipHost, captureBaseline, relation) => {
|
|
977
|
+
const processTable = await readLiveProcessTable(host);
|
|
978
|
+
if (!processTable.available) return {
|
|
979
|
+
cleaned: false,
|
|
980
|
+
reason: `process table could not be inspected: ${processTable.reason}`
|
|
981
|
+
};
|
|
982
|
+
const scan = await scanTokenOwnedProcesses(processTable.processes, runId, host, captureBaseline, relation);
|
|
983
|
+
if (scan.failures.length > 0) return cleanupValidationFailure(scan.failures, scan.unverified);
|
|
984
|
+
if (scan.owned.length > 0) return {
|
|
985
|
+
cleaned: false,
|
|
986
|
+
reason: "token-owned process remained after cleanup",
|
|
987
|
+
...scan.unverified.length === 0 ? {} : { unverified: scan.unverified }
|
|
988
|
+
};
|
|
989
|
+
return {
|
|
990
|
+
cleaned: true,
|
|
991
|
+
signaled: false,
|
|
992
|
+
...scan.unverified.length === 0 ? {} : { unverified: scan.unverified }
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
readLiveProcessTable = async (host) => {
|
|
996
|
+
try {
|
|
997
|
+
return {
|
|
998
|
+
available: true,
|
|
999
|
+
processes: liveProcesses(await host.listProcesses())
|
|
1000
|
+
};
|
|
1001
|
+
} catch (cause) {
|
|
1002
|
+
return {
|
|
1003
|
+
available: false,
|
|
1004
|
+
reason: errorMessage(cause)
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
settleLauncherExit = async (ownership, processes, host) => {
|
|
1009
|
+
const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
|
|
1010
|
+
if (launcher === undefined) return processes;
|
|
1011
|
+
const reason = launcherIdentityFailure(launcher, ownership);
|
|
1012
|
+
if (reason === null) return processes;
|
|
1013
|
+
const refreshed = await readLiveProcessTable(host);
|
|
1014
|
+
if (refreshed.available && !refreshed.processes.some(({ pid }) => pid === launcher.pid)) {
|
|
1015
|
+
const descendants = descendantsOf([launcher.pid], processes);
|
|
1016
|
+
const descendantPids = new Set(descendants.map(({ pid }) => pid));
|
|
1017
|
+
const descendantGroupIds = new Set(descendants.map(({ processGroupId }) => processGroupId));
|
|
1018
|
+
const refreshedDescendantPids = new Set(descendantsOf(descendants.map(({ pid }) => pid), refreshed.processes).map(({ pid }) => pid));
|
|
1019
|
+
if (refreshed.processes.some((process) => process.processGroupId !== ownership.processGroupId && (refreshedDescendantPids.has(process.pid) || descendantPids.has(process.pid) || descendantGroupIds.has(process.processGroupId)))) return {
|
|
1020
|
+
cleaned: false,
|
|
1021
|
+
reason
|
|
1022
|
+
};
|
|
1023
|
+
return refreshed.processes;
|
|
1024
|
+
}
|
|
1025
|
+
return {
|
|
1026
|
+
cleaned: false,
|
|
1027
|
+
reason
|
|
1028
|
+
};
|
|
1029
|
+
};
|
|
1030
|
+
createOwnedCleanupPlan = async (ownership, initialProcesses, host) => {
|
|
1031
|
+
const processes = await settleLauncherExit(ownership, initialProcesses, host);
|
|
1032
|
+
if ("cleaned" in processes) return processes;
|
|
1033
|
+
const sampledProcessGroupIds = new Set((ownership.sampledProcessGroupIds ?? []).filter((processGroupId) => Number.isSafeInteger(processGroupId) && processGroupId > 0));
|
|
1034
|
+
const tokenOwned = ownership.sweepTokenOwnedProcesses === true ? await scanTokenOwnedProcesses(processes, ownership.runId, host, ownership.captureBaseline, {
|
|
1035
|
+
leaderPid: ownership.leaderPid,
|
|
1036
|
+
processGroupId: ownership.processGroupId,
|
|
1037
|
+
...sampledProcessGroupIds.size === 0 ? {} : { sampledProcessGroupIds: [...sampledProcessGroupIds] }
|
|
1038
|
+
}) : {
|
|
1039
|
+
owned: [],
|
|
1040
|
+
failures: [],
|
|
1041
|
+
unverified: [],
|
|
1042
|
+
identities: new Map()
|
|
1043
|
+
};
|
|
1044
|
+
const tokenOwnedGroupIds = new Set(tokenOwned.owned.map(({ processGroupId }) => processGroupId));
|
|
1045
|
+
const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
|
|
1046
|
+
const rootMembers = processes.filter(({ processGroupId }) => processGroupId === ownership.processGroupId);
|
|
1047
|
+
if (launcher === undefined && rootMembers.length === 0 && tokenOwned.owned.length === 0 && !processes.some(({ processGroupId }) => sampledProcessGroupIds.has(processGroupId))) return tokenOwned.failures.length > 0 ? {
|
|
1048
|
+
signalOrder: [],
|
|
1049
|
+
tokenOwnedIdentities: tokenOwned.identities,
|
|
1050
|
+
unresolved: tokenOwned.failures,
|
|
1051
|
+
unverified: tokenOwned.unverified
|
|
1052
|
+
} : {
|
|
1053
|
+
cleaned: true,
|
|
1054
|
+
signaled: false,
|
|
1055
|
+
...tokenOwned.unverified.length === 0 ? {} : { unverified: tokenOwned.unverified }
|
|
1056
|
+
};
|
|
1057
|
+
let descendants = [];
|
|
1058
|
+
if (launcher !== undefined) {
|
|
1059
|
+
descendants = descendantsOf([launcher.pid], processes);
|
|
1060
|
+
}
|
|
1061
|
+
const descendantPids = new Set(descendants.map(({ pid }) => pid));
|
|
1062
|
+
const processGroupIds = new Set([ownership.processGroupId]);
|
|
1063
|
+
for (const descendant of descendants) processGroupIds.add(descendant.processGroupId);
|
|
1064
|
+
for (const process of tokenOwned.owned) processGroupIds.add(process.processGroupId);
|
|
1065
|
+
for (const processGroupId of sampledProcessGroupIds) processGroupIds.add(processGroupId);
|
|
1066
|
+
const signalableGroups = new Set();
|
|
1067
|
+
const unresolved = [...tokenOwned.failures];
|
|
1068
|
+
const unverifiableSampledGroups = new Set();
|
|
1069
|
+
for (const processGroupId of processGroupIds) {
|
|
1070
|
+
if (processGroupId === ownership.processGroupId) continue;
|
|
1071
|
+
const groupLeader = processes.find(({ pid, processGroupId: observedGroupId }) => pid === processGroupId && observedGroupId === processGroupId);
|
|
1072
|
+
if ((groupLeader === undefined || !descendantPids.has(groupLeader.pid)) && !tokenOwnedGroupIds.has(processGroupId) && !sampledProcessGroupIds.has(processGroupId)) return {
|
|
1073
|
+
cleaned: false,
|
|
1074
|
+
reason: "descendant process-group leader identity could not be verified"
|
|
1075
|
+
};
|
|
1076
|
+
if ((groupLeader === undefined || !descendantPids.has(groupLeader.pid)) && !tokenOwnedGroupIds.has(processGroupId)) unverifiableSampledGroups.add(processGroupId);
|
|
1077
|
+
}
|
|
1078
|
+
const liveMembers = processes.filter(({ processGroupId }) => processGroupIds.has(processGroupId));
|
|
1079
|
+
for (const processGroupId of processGroupIds) {
|
|
1080
|
+
const members = liveMembers.filter(({ processGroupId: observedGroupId }) => observedGroupId === processGroupId);
|
|
1081
|
+
if (members.length === 0) continue;
|
|
1082
|
+
const failures = await processOwnershipFailures(members, ownership.runId, host, tokenOwned.identities);
|
|
1083
|
+
if (failures.length === 0 && unverifiableSampledGroups.has(processGroupId)) unresolved.push(...members.map(({ pid }) => ({
|
|
1084
|
+
pid,
|
|
1085
|
+
reason: "process-identity-unavailable",
|
|
1086
|
+
diagnostic: "sampled process-group leader identity could not be verified"
|
|
1087
|
+
})));
|
|
1088
|
+
const scanFailures = tokenOwned.failures.filter(({ pid }) => members.some((member) => member.pid === pid));
|
|
1089
|
+
if (failures.length > 0) unresolved.push(...failures);
|
|
1090
|
+
if (failures.length === 0 && scanFailures.length === 0 && !unverifiableSampledGroups.has(processGroupId)) signalableGroups.add(processGroupId);
|
|
1091
|
+
}
|
|
1092
|
+
if (ownership.sweepTokenOwnedProcesses !== true && unresolved.length > 0) return cleanupValidationFailure(unresolved, tokenOwned.unverified);
|
|
1093
|
+
return {
|
|
1094
|
+
signalOrder: [...signalableGroups].filter((groupId) => processGroupIds.has(groupId)).sort((left, right) => left === ownership.processGroupId ? -1 : right === ownership.processGroupId ? 1 : left - right),
|
|
1095
|
+
tokenOwnedIdentities: tokenOwned.identities,
|
|
1096
|
+
unresolved,
|
|
1097
|
+
unverified: tokenOwned.unverified
|
|
1098
|
+
};
|
|
1099
|
+
};
|
|
1100
|
+
revalidateOwnedProcessGroup = async (processGroupId, ownership, host, expectedIdentities) => {
|
|
1101
|
+
let members;
|
|
1102
|
+
try {
|
|
1103
|
+
const processes = await settleLauncherExit(ownership, liveProcesses(await host.listProcesses()), host);
|
|
1104
|
+
if ("cleaned" in processes) return processes;
|
|
1105
|
+
members = processes.filter(({ processGroupId: observedGroupId }) => observedGroupId === processGroupId);
|
|
1106
|
+
} catch (cause) {
|
|
1107
|
+
return {
|
|
1108
|
+
cleaned: false,
|
|
1109
|
+
reason: `process ownership could not be revalidated: ${errorMessage(cause)}`
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
const failures = await processOwnershipFailures(members, ownership.runId, host, expectedIdentities);
|
|
1113
|
+
if (failures.length > 0) return cleanupValidationFailure(failures);
|
|
1114
|
+
if (processGroupId !== ownership.processGroupId && members.length > 0 && !members.some(({ pid }) => pid === processGroupId) && ownership.sweepTokenOwnedProcesses !== true) return {
|
|
1115
|
+
cleaned: false,
|
|
1116
|
+
reason: "descendant process-group leader identity could not be revalidated"
|
|
1117
|
+
};
|
|
1118
|
+
return { empty: members.length === 0 };
|
|
1119
|
+
};
|
|
1120
|
+
cleanupValidationFailure = (failures, unverified = []) => {
|
|
1121
|
+
const unverifiedEntry = unverified.length === 0 ? {} : { unverified };
|
|
1122
|
+
const unreadable = failures.filter(({ reason }) => reason === "environment-unreadable");
|
|
1123
|
+
if (failures.some(({ reason }) => reason === "run-token-mismatch")) return {
|
|
1124
|
+
cleaned: false,
|
|
1125
|
+
reason: `process ownership token mismatch for PID(s): ${[...new Set(failures.filter(({ reason }) => reason === "run-token-mismatch").map(({ pid }) => pid))].sort((left, right) => left - right).join(", ")}`,
|
|
1126
|
+
failures,
|
|
1127
|
+
...unverifiedEntry
|
|
1128
|
+
};
|
|
1129
|
+
if (failures.some(({ reason }) => reason === "process-identity-unavailable")) return {
|
|
1130
|
+
cleaned: false,
|
|
1131
|
+
reason: "process identity could not be revalidated",
|
|
1132
|
+
failures,
|
|
1133
|
+
...unverifiedEntry
|
|
1134
|
+
};
|
|
1135
|
+
if (unreadable.length > 0) {
|
|
1136
|
+
const counts = new Map();
|
|
1137
|
+
for (const { diagnostic } of unreadable) {
|
|
1138
|
+
const category = sanitizedTokenReadFailure(diagnostic);
|
|
1139
|
+
counts.set(category, (counts.get(category) ?? 0) + 1);
|
|
1140
|
+
}
|
|
1141
|
+
const breakdown = [...counts].sort(([left], [right]) => compareUnicodeCodePoints(left, right)).map(([category, count]) => `${category}=${String(count)}`).join(", ");
|
|
1142
|
+
const candidates = unreadable.map(({ pid, diagnostic }) => `${String(pid)}=${sanitizedTokenReadFailure(diagnostic)}`).sort((left, right) => compareUnicodeCodePoints(left, right));
|
|
1143
|
+
return {
|
|
1144
|
+
cleaned: false,
|
|
1145
|
+
reason: `process ownership token could not be read for ${String(unreadable.length)} live process(es): ${breakdown}; live candidates ${candidates.join(", ")}`,
|
|
1146
|
+
failures,
|
|
1147
|
+
...unverifiedEntry
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
return {
|
|
1151
|
+
cleaned: false,
|
|
1152
|
+
reason: "process ownership could not be revalidated",
|
|
1153
|
+
failures,
|
|
1154
|
+
...unverifiedEntry
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1157
|
+
sanitizedTokenReadFailure = (diagnostic) => {
|
|
1158
|
+
if (diagnostic === "environment_unavailable") return diagnostic;
|
|
1159
|
+
if (diagnostic === "platform_binary_environment_withheld") return diagnostic;
|
|
1160
|
+
if (diagnostic === "restricted_process_environment_withheld") return diagnostic;
|
|
1161
|
+
const environmentErrno = /^(EACCES|EPERM|ENOENT|ESRCH):/u.exec(diagnostic ?? "");
|
|
1162
|
+
if (environmentErrno?.[1] !== undefined) return `environment_errno_${environmentErrno[1]}`;
|
|
1163
|
+
if (diagnostic === "apple_vector_unavailable") return diagnostic;
|
|
1164
|
+
if (diagnostic === "ambiguous_environment_boundary") return diagnostic;
|
|
1165
|
+
if (diagnostic === "malformed_procargs") return diagnostic;
|
|
1166
|
+
if (diagnostic === "process_identity_changed_during_token_read") return diagnostic;
|
|
1167
|
+
if (diagnostic === "process_not_in_snapshot") return diagnostic;
|
|
1168
|
+
const processTableFailure = /^process_table_failed_(\d+)$/u.exec(diagnostic ?? "");
|
|
1169
|
+
if (processTableFailure?.[1] !== undefined) return `process_table_errno_${processTableFailure[1]}`;
|
|
1170
|
+
const sysctlFailure = /^sysctl_failed_(\d+)$/u.exec(diagnostic ?? "");
|
|
1171
|
+
if (sysctlFailure?.[1] !== undefined) return `sysctl_errno_${sysctlFailure[1]}`;
|
|
1172
|
+
if (diagnostic === "reader_failure") return diagnostic;
|
|
1173
|
+
if (diagnostic === "duplicate_run_token") return diagnostic;
|
|
1174
|
+
if (diagnostic === "invalid_run_token_encoding") return diagnostic;
|
|
1175
|
+
return "other_unavailable";
|
|
1176
|
+
};
|
|
1177
|
+
processOwnershipFailures = async (members, runId, host, expectedIdentities = new Map()) => {
|
|
1178
|
+
const failures = [];
|
|
1179
|
+
if (expectedIdentities.size > 0 && host.processIdentities !== undefined) {
|
|
1180
|
+
const expectedMembers = members.filter(({ pid }) => expectedIdentities.has(pid));
|
|
1181
|
+
const observed = await host.processIdentities(expectedMembers);
|
|
1182
|
+
const identityFailures = [];
|
|
1183
|
+
for (const member of expectedMembers) {
|
|
1184
|
+
const expected = expectedIdentities.get(member.pid);
|
|
1185
|
+
const current = observed.get(member.pid);
|
|
1186
|
+
if (expected === null || current?.state !== "readable" || current.identity !== expected) {
|
|
1187
|
+
identityFailures.push({
|
|
1188
|
+
pid: member.pid,
|
|
1189
|
+
reason: "process-identity-unavailable",
|
|
1190
|
+
diagnostic: "process identity changed or became unavailable before signal"
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
failures.push(...await recheckOwnershipFailures(identityFailures, host));
|
|
1195
|
+
}
|
|
1196
|
+
failures.push(...await processRunTokenFailures(members, runId, host));
|
|
1197
|
+
if (failures.length === 0 && expectedIdentities.size > 0 && host.processIdentities !== undefined) {
|
|
1198
|
+
const expectedMembers = members.filter(({ pid }) => expectedIdentities.has(pid));
|
|
1199
|
+
const observed = await host.processIdentities(expectedMembers);
|
|
1200
|
+
const identityFailures = [];
|
|
1201
|
+
for (const member of expectedMembers) {
|
|
1202
|
+
const expected = expectedIdentities.get(member.pid);
|
|
1203
|
+
const current = observed.get(member.pid);
|
|
1204
|
+
if (expected !== null && current?.state === "readable" && current.identity === expected) continue;
|
|
1205
|
+
identityFailures.push({
|
|
1206
|
+
pid: member.pid,
|
|
1207
|
+
reason: "process-identity-unavailable",
|
|
1208
|
+
diagnostic: "process identity changed or became unavailable during token validation"
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
failures.push(...await recheckOwnershipFailures(identityFailures, host));
|
|
1212
|
+
}
|
|
1213
|
+
return failures;
|
|
1214
|
+
};
|
|
1215
|
+
processRunTokenFailures = async (members, runId, host) => {
|
|
1216
|
+
const failures = [];
|
|
1217
|
+
for await (const { process: member, observation } of readProcessRunTokens(host, members)) {
|
|
1218
|
+
if (observation.state === "readable") {
|
|
1219
|
+
if (observation.runId !== runId) failures.push({
|
|
1220
|
+
pid: member.pid,
|
|
1221
|
+
reason: "run-token-mismatch"
|
|
1222
|
+
});
|
|
1223
|
+
continue;
|
|
1224
|
+
}
|
|
1225
|
+
failures.push({
|
|
1226
|
+
pid: member.pid,
|
|
1227
|
+
reason: "environment-unreadable",
|
|
1228
|
+
diagnostic: observation.reason
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
return recheckOwnershipFailures(failures, host);
|
|
1232
|
+
};
|
|
1233
|
+
recheckOwnershipFailures = async (failures, host) => {
|
|
1234
|
+
if (!failures.some(({ reason }) => reason !== "run-token-mismatch")) return failures;
|
|
1235
|
+
try {
|
|
1236
|
+
const live = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
|
|
1237
|
+
return failures.filter(({ pid, reason }) => reason === "run-token-mismatch" || live.has(pid));
|
|
1238
|
+
} catch (cause) {
|
|
1239
|
+
return failures.map((failure) => failure.reason === "run-token-mismatch" ? failure : {
|
|
1240
|
+
...failure,
|
|
1241
|
+
diagnostic: `${failure.diagnostic}; process liveness recheck failed: ${errorMessage(cause)}`
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
TOKEN_READ_RETRY_ATTEMPTS = 3;
|
|
1246
|
+
TOKEN_READ_RETRY_DELAY_MS = 40;
|
|
1247
|
+
PLATFORM_BINARY_ENVIRONMENT_WITHHELD = "platform_binary_environment_withheld";
|
|
1248
|
+
RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD = "restricted_process_environment_withheld";
|
|
1249
|
+
currentProcessUid = () => typeof process.getuid === "function" ? process.getuid() : undefined;
|
|
1250
|
+
environmentWithheldFromInspection = (entry, diagnostic) => {
|
|
1251
|
+
const uid = currentProcessUid();
|
|
1252
|
+
if (uid !== undefined && entry.uid !== undefined && entry.uid !== uid) return true;
|
|
1253
|
+
return diagnostic === PLATFORM_BINARY_ENVIRONMENT_WITHHELD || diagnostic === RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD;
|
|
1254
|
+
};
|
|
1255
|
+
scanTokenOwnedProcesses = async (processes, runId, host, captureBaseline, relation) => {
|
|
1256
|
+
let candidates = processes;
|
|
1257
|
+
let candidateIdentities = new Map();
|
|
1258
|
+
if (host.processIdentities !== undefined) {
|
|
1259
|
+
const current = await host.processIdentities(processes);
|
|
1260
|
+
candidateIdentities = current;
|
|
1261
|
+
if (captureBaseline !== undefined) {
|
|
1262
|
+
const baseline = new Map(captureBaseline.map(({ pid, identity }) => [pid, identity]));
|
|
1263
|
+
candidates = processes.filter((process) => {
|
|
1264
|
+
const before = baseline.get(process.pid);
|
|
1265
|
+
const now = current.get(process.pid);
|
|
1266
|
+
return !(before !== undefined && before !== null && now?.state === "readable" && now.identity === before);
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
const failures = [];
|
|
1271
|
+
if (captureBaseline !== undefined && host.processIdentities !== undefined) {
|
|
1272
|
+
const stableCandidates = [];
|
|
1273
|
+
const identityFailures = [];
|
|
1274
|
+
for (const process of candidates) {
|
|
1275
|
+
if (candidateIdentities.get(process.pid)?.state === "readable") {
|
|
1276
|
+
stableCandidates.push(process);
|
|
1277
|
+
continue;
|
|
1278
|
+
}
|
|
1279
|
+
identityFailures.push({
|
|
1280
|
+
pid: process.pid,
|
|
1281
|
+
reason: "process-identity-unavailable",
|
|
1282
|
+
diagnostic: "process identity was unavailable during token scan"
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
failures.push(...await recheckOwnershipFailures(identityFailures, host));
|
|
1286
|
+
candidates = stableCandidates;
|
|
1287
|
+
}
|
|
1288
|
+
const owned = [];
|
|
1289
|
+
const ownedIdentities = new Map();
|
|
1290
|
+
const recordOwned = (process) => {
|
|
1291
|
+
owned.push(process);
|
|
1292
|
+
const identity = candidateIdentities.get(process.pid);
|
|
1293
|
+
ownedIdentities.set(process.pid, identity?.state === "readable" ? identity.identity : null);
|
|
1294
|
+
};
|
|
1295
|
+
const unreadable = [];
|
|
1296
|
+
for await (const { process, observation } of readProcessRunTokens(host, candidates)) {
|
|
1297
|
+
if (observation.state === "readable") {
|
|
1298
|
+
if (observation.runId === runId) recordOwned(process);
|
|
1299
|
+
} else unreadable.push({
|
|
1300
|
+
process,
|
|
1301
|
+
diagnostic: observation.reason
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
const remaining = await settleUnreadableTokenCandidates(unreadable, runId, host, recordOwned);
|
|
1305
|
+
const relatedPids = new Set();
|
|
1306
|
+
const relatedGroupIds = new Set();
|
|
1307
|
+
if (relation !== undefined) {
|
|
1308
|
+
relatedPids.add(relation.leaderPid);
|
|
1309
|
+
for (const descendant of descendantsOf([relation.leaderPid], processes)) relatedPids.add(descendant.pid);
|
|
1310
|
+
relatedGroupIds.add(relation.processGroupId);
|
|
1311
|
+
for (const processGroupId of relation.sampledProcessGroupIds ?? []) if (Number.isSafeInteger(processGroupId) && processGroupId > 0) relatedGroupIds.add(processGroupId);
|
|
1312
|
+
for (const process of owned) relatedGroupIds.add(process.processGroupId);
|
|
1313
|
+
}
|
|
1314
|
+
const unverified = [];
|
|
1315
|
+
const strict = [];
|
|
1316
|
+
const withheld = [];
|
|
1317
|
+
for (const candidate of remaining) {
|
|
1318
|
+
const isRelated = relation === undefined || relatedPids.has(candidate.process.pid) || relatedGroupIds.has(candidate.process.processGroupId);
|
|
1319
|
+
if (!isRelated && environmentWithheldFromInspection(candidate.process, candidate.diagnostic)) {
|
|
1320
|
+
withheld.push(candidate);
|
|
1321
|
+
continue;
|
|
1322
|
+
}
|
|
1323
|
+
strict.push(candidate);
|
|
1324
|
+
}
|
|
1325
|
+
let finalLive;
|
|
1326
|
+
try {
|
|
1327
|
+
finalLive = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
|
|
1328
|
+
} catch (cause) {
|
|
1329
|
+
void cause;
|
|
1330
|
+
finalLive = undefined;
|
|
1331
|
+
}
|
|
1332
|
+
for (const candidate of strict) {
|
|
1333
|
+
if (finalLive !== undefined && !finalLive.has(candidate.process.pid)) continue;
|
|
1334
|
+
failures.push({
|
|
1335
|
+
pid: candidate.process.pid,
|
|
1336
|
+
reason: "environment-unreadable",
|
|
1337
|
+
diagnostic: candidate.diagnostic
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
for (const candidate of withheld) {
|
|
1341
|
+
if (finalLive !== undefined && !finalLive.has(candidate.process.pid)) continue;
|
|
1342
|
+
unverified.push({
|
|
1343
|
+
pid: candidate.process.pid,
|
|
1344
|
+
diagnostic: candidate.diagnostic
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
if (candidates.length > 0 && host.processIdentities !== undefined) {
|
|
1348
|
+
const afterRead = await host.processIdentities(candidates);
|
|
1349
|
+
const stillOwned = [];
|
|
1350
|
+
const identityFailures = [];
|
|
1351
|
+
const ownedPids = new Set(owned.map(({ pid }) => pid));
|
|
1352
|
+
for (const process of candidates) {
|
|
1353
|
+
const before = candidateIdentities.get(process.pid);
|
|
1354
|
+
const current = afterRead.get(process.pid);
|
|
1355
|
+
if (before?.state === "readable" && current?.state === "readable" && current.identity === before.identity) {
|
|
1356
|
+
if (ownedPids.has(process.pid)) stillOwned.push(process);
|
|
1357
|
+
continue;
|
|
1358
|
+
}
|
|
1359
|
+
identityFailures.push({
|
|
1360
|
+
pid: process.pid,
|
|
1361
|
+
reason: "process-identity-unavailable",
|
|
1362
|
+
diagnostic: "process identity changed or became unavailable during token validation"
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
failures.push(...await recheckOwnershipFailures(identityFailures, host));
|
|
1366
|
+
return {
|
|
1367
|
+
owned: stillOwned,
|
|
1368
|
+
failures,
|
|
1369
|
+
unverified,
|
|
1370
|
+
identities: ownedIdentities
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
return {
|
|
1374
|
+
owned,
|
|
1375
|
+
failures,
|
|
1376
|
+
unverified,
|
|
1377
|
+
identities: ownedIdentities
|
|
1378
|
+
};
|
|
1379
|
+
};
|
|
1380
|
+
settleUnreadableTokenCandidates = async (pending, runId, host, recordOwned) => {
|
|
1381
|
+
let remaining = pending;
|
|
1382
|
+
for (let attempt = 0; attempt < TOKEN_READ_RETRY_ATTEMPTS && remaining.length > 0; attempt += 1) {
|
|
1383
|
+
await new Promise((resolve) => setTimeout(resolve, TOKEN_READ_RETRY_DELAY_MS));
|
|
1384
|
+
let live;
|
|
1385
|
+
try {
|
|
1386
|
+
live = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
|
|
1387
|
+
} catch (cause) {
|
|
1388
|
+
void cause;
|
|
1389
|
+
live = undefined;
|
|
1390
|
+
}
|
|
1391
|
+
const stillUnreadable = [];
|
|
1392
|
+
const candidates = remaining.map(({ process }) => process).filter(({ pid }) => live === undefined || live.has(pid));
|
|
1393
|
+
for await (const { process, observation } of readProcessRunTokens(host, candidates)) {
|
|
1394
|
+
if (observation.state === "readable") {
|
|
1395
|
+
if (observation.runId === runId) recordOwned(process);
|
|
1396
|
+
continue;
|
|
1397
|
+
}
|
|
1398
|
+
stillUnreadable.push({
|
|
1399
|
+
process,
|
|
1400
|
+
diagnostic: observation.reason
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
remaining = stillUnreadable;
|
|
1404
|
+
}
|
|
1405
|
+
return remaining;
|
|
1406
|
+
};
|
|
1407
|
+
})))();
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
//#endregion
|
|
1411
|
+
export { selectCapturedProcessGroupIds as C, init_ProcessOwnershipProcessTree as S, init_boundedUtf8Text as _, verifyNoTokenOwnedProcesses as a, execFileOutputFailure as b, observeOwnedProcessLineage as c, signalProcessWithStartIdentity as d, systemProcessOwnershipHost as f, boundedUtf8Text as g, init_DarwinProcessRunTokenReader as h, readProcessRunId as i, observeProcessStartIdentity as l, SWIFTC_INTERRUPT as m, cleanupWindowsProcessTree as n, init_ProcessOwnershipObservation as o, DarwinProcessOwnershipInspectionError as p, init_ProcessOwnership as r, observeOwnedProcessGroups as s, cleanupOwnedProcessGroup as t, prepareProcessOwnershipInspection as u, execFileBytes as v, init_ExecFileOutput as x, execFileOutput as y };
|