rea-agents 4.0.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +257 -96
- package/bridge/android/ReaJadxBridge.java +247 -0
- package/bridge/ghidra/ReaGhidraBridge.java +358 -15
- package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
- package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +30 -16
- package/dist/android/AndroidTargetSnapshot.js +36 -0
- package/dist/android/JadxAnalysis.js +193 -0
- package/dist/android/JadxConfiguration.js +57 -0
- package/dist/android/JadxMcpTransport.js +172 -0
- package/dist/android/JadxProtocol.js +109 -0
- package/dist/android/JadxProvider.js +259 -0
- package/dist/android/JadxRelease.js +27 -0
- package/dist/android/JadxSession.js +111 -0
- package/dist/application/AnalysisContextQueries.js +2 -1
- package/dist/application/AppBundleExecutable.js +141 -0
- package/dist/application/ArtifactExtraction.js +7 -4
- package/dist/application/ArtifactGraphConstruction.js +10 -17
- package/dist/application/ArtifactInventory/classify.js +1 -1
- package/dist/application/ArtifactInventory/scanCanonical.js +9 -8
- package/dist/application/ArtifactInventory/scanReader.js +1 -1
- package/dist/application/ArtifactInventory.js +1 -1
- package/dist/application/BinaryTargetResolver.js +32 -68
- package/dist/application/BrowserObservationService.js +2 -1
- package/dist/application/BrowserScenarioCaptureService.js +2 -1
- package/dist/application/BrowserScenarioEvidence.js +2 -2
- package/dist/application/CallPathTracing.js +2 -1
- package/dist/application/CapabilityInventory.js +78 -2
- package/dist/application/ClientConfigPath.js +3 -1
- package/dist/application/ClientConfigurationDocument.js +83 -13
- package/dist/application/ClientRegistrationStatus.js +15 -9
- package/dist/application/DirectAnalysis.js +35 -21
- package/dist/application/DirectAnalysisStatus.js +7 -8
- package/dist/application/Doctor.js +48 -8
- package/dist/application/DoctorDiagnostics.js +9 -7
- package/dist/application/DoctorScope.js +1 -1
- package/dist/application/EnhancedLiteralTracing.js +2 -1
- package/dist/application/EnhancedToolTypes.js +2 -1
- package/dist/application/EnhancedTools.js +7 -5
- package/dist/application/EvidenceBundleCommands.js +3 -2
- package/dist/application/EvidenceBundleFiles.js +1 -1
- package/dist/application/EvidenceInputResolver.js +30 -0
- package/dist/application/FilesystemSnapshot.js +20 -5
- package/dist/application/FunctionAnalysisEvidence.js +32 -0
- package/dist/application/InventoryProjectionEvidence.js +2 -1
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LinuxHopper.js +20 -6
- package/dist/application/MacHopper.js +20 -7
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ProcessCaptureCapability.js +1 -1
- package/dist/application/ProcessCaptureError.js +1 -1
- package/dist/application/ProcessCaptureJournal.js +3 -1
- package/dist/application/ProcessCaptureLifecycle.js +8 -5
- package/dist/application/ProcessCli.js +14 -6
- package/dist/application/ProcessEvidence.js +2 -6
- package/dist/application/ProcessHarness.js +23 -11
- package/dist/application/ProcessNormalization.js +12 -5
- package/dist/application/ProcessSampling.js +3 -1
- package/dist/application/ReconstructionCoverageService.js +4 -7
- package/dist/application/ReconstructionObligationCandidates.js +5 -2
- package/dist/application/ReconstructionObligationLedgerService.js +2 -1
- package/dist/application/ReferenceSourceImport.js +2 -0
- package/dist/application/ReferenceSourceImportEntries.js +22 -3
- package/dist/application/ReferenceSourceImportPolicy.js +4 -2
- package/dist/application/ReferenceSourceImportTypes.js +5 -0
- package/dist/application/ReferenceSourceVcsAdapter.js +35 -4
- package/dist/application/Setup.js +11 -130
- package/dist/application/SetupClientConfiguration.js +36 -22
- package/dist/application/SetupHost.js +126 -0
- package/dist/application/SetupPlan.js +1 -1
- package/dist/application/SetupRegistrationEnvironment.js +1 -2
- package/dist/application/SetupSkill.js +9 -3
- package/dist/application/SetupTypes.js +17 -0
- package/dist/application/StoreFileLock.js +7 -2
- package/dist/application/SupportedClients.js +8 -0
- package/dist/application/Uninstall.js +32 -21
- package/dist/application/UpdateMaintenance.js +3 -3
- package/dist/application/UpdateRuntime.js +5 -2
- package/dist/application/ValidateSelectedWebScript.js +27 -0
- package/dist/application/WebModuleTraceService.js +209 -0
- package/dist/application/WebRuntimeService.js +73 -0
- package/dist/application/WebScriptExportService.js +115 -0
- package/dist/application/WebSourceLocationService.js +160 -0
- package/dist/application/WindowsCapabilities.js +7 -7
- package/dist/application/android/AndroidAnalysisService.js +37 -0
- package/dist/application/{AndroidApplicationService.js → android/AndroidApplicationService.js} +3 -3
- package/dist/application/{AppleApplicationService.js → apple/AppleApplicationService.js} +5 -5
- package/dist/application/{AnalysisClientCleanup.js → binary/AnalysisClientCleanup.js} +2 -2
- package/dist/application/{AnalysisProviderEvaluation.js → binary/AnalysisProviderEvaluation.js} +8 -6
- package/dist/application/{AnalysisProviderRegistry.js → binary/AnalysisProviderRegistry.js} +5 -4
- package/dist/application/{AnalysisSnapshotCache.js → binary/AnalysisSnapshotCache.js} +8 -7
- package/dist/application/{AnalysisSnapshotFiles.js → binary/AnalysisSnapshotFiles.js} +4 -4
- package/dist/application/{BinarySession.js → binary/BinarySession.js} +26 -11
- package/dist/application/{BinarySessionComposition.js → binary/BinarySessionComposition.js} +2 -1
- package/dist/application/{BinarySessionExecution.js → binary/BinarySessionExecution.js} +9 -4
- package/dist/application/{BinarySessionOpen.js → binary/BinarySessionOpen.js} +7 -6
- package/dist/application/{BinarySessionRecords.js → binary/BinarySessionRecords.js} +34 -40
- package/dist/application/{CompositeProvider.js → binary/CompositeProvider.js} +2 -2
- package/dist/application/{LazyAnalysisProvider.js → binary/LazyAnalysisProvider.js} +6 -4
- package/dist/application/{SessionProviderRouter.js → binary/SessionProviderRouter.js} +7 -4
- package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +35 -0
- package/dist/application/{EvidenceLedger.js → investigation/EvidenceLedger.js} +44 -6
- package/dist/application/investigation/InvestigationRecordPort.js +1 -0
- package/dist/application/investigation/InvestigationRecords.js +69 -0
- package/dist/application/{UnknownEvidence.js → investigation/UnknownEvidence.js} +1 -1
- package/dist/application/{ElectronActiveEvidence.js → javascript/ElectronActiveEvidence.js} +4 -4
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/{ElectronActiveObservationService.js → javascript/ElectronActiveObservationService.js} +3 -2
- package/dist/application/{ElectronBoundaryAnalysis.js → javascript/ElectronBoundaryAnalysis.js} +1 -1
- package/dist/application/{ElectronBoundaryGraphContext.js → javascript/ElectronBoundaryGraphContext.js} +1 -1
- package/dist/application/{ElectronEvidence.js → javascript/ElectronEvidence.js} +2 -2
- package/dist/application/javascript/ElectronObservationPort.js +1 -0
- package/dist/application/{ElectronObservationService.js → javascript/ElectronObservationService.js} +3 -2
- package/dist/application/{JavaScriptApplicationEvidence.js → javascript/JavaScriptApplicationEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationEvidenceGraph.js → javascript/JavaScriptApplicationEvidenceGraph.js} +5 -5
- package/dist/application/javascript/JavaScriptApplicationService.js +99 -0
- package/dist/application/{JavaScriptApplicationWorkflowEvidence.js → javascript/JavaScriptApplicationWorkflowEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationWorkflowService.js → javascript/JavaScriptApplicationWorkflowService.js} +12 -11
- package/dist/application/{JavaScriptArtifactAnalysis.js → javascript/JavaScriptArtifactAnalysis.js} +12 -26
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
- package/dist/application/{JavaScriptArtifactGraphAccumulator.js → javascript/JavaScriptArtifactGraphAccumulator.js} +16 -2
- package/dist/application/{JavaScriptArtifactGraphBuilder.js → javascript/JavaScriptArtifactGraphBuilder.js} +2 -2
- package/dist/application/{JavaScriptArtifactGraphContext.js → javascript/JavaScriptArtifactGraphContext.js} +1 -1
- package/dist/application/{JavaScriptArtifactGraphDocuments.js → javascript/JavaScriptArtifactGraphDocuments.js} +1 -1
- package/dist/application/{JavaScriptArtifactGraphFindings.js → javascript/JavaScriptArtifactGraphFindings.js} +20 -7
- package/dist/application/{JavaScriptArtifactGraphStructure.js → javascript/JavaScriptArtifactGraphStructure.js} +1 -1
- package/dist/application/{JavaScriptArtifactPathResolution.js → javascript/JavaScriptArtifactPathResolution.js} +12 -14
- package/dist/application/{JavaScriptArtifactReconstruction.js → javascript/JavaScriptArtifactReconstruction.js} +4 -8
- package/dist/application/{JavaScriptJsonModules.js → javascript/JavaScriptJsonModules.js} +3 -2
- package/dist/application/{JavaScriptModuleRelationships.js → javascript/JavaScriptModuleRelationships.js} +5 -3
- package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
- package/dist/application/javascript/JavaScriptRecoveryService.js +52 -0
- package/dist/application/{JavaScriptReturnShapeProjection.js → javascript/JavaScriptReturnShapeProjection.js} +3 -3
- package/dist/application/{JavaScriptRuntimeObservationEvidence.js → javascript/JavaScriptRuntimeObservationEvidence.js} +2 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
- package/dist/application/{JavaScriptRuntimeObservationService.js → javascript/JavaScriptRuntimeObservationService.js} +3 -2
- package/dist/application/{JavaScriptRuntimeReconciliationEvidence.js → javascript/JavaScriptRuntimeReconciliationEvidence.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationService.js → javascript/JavaScriptRuntimeReconciliationService.js} +6 -5
- package/dist/application/{JavaScriptSemanticGraphAsyncProjection.js → javascript/JavaScriptSemanticGraphAsyncProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphBuilder.js → javascript/JavaScriptSemanticGraphBuilder.js} +5 -3
- package/dist/application/{JavaScriptSemanticGraphChildProcessProjection.js → javascript/JavaScriptSemanticGraphChildProcessProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphConstruction.js → javascript/JavaScriptSemanticGraphConstruction.js} +3 -2
- package/dist/application/{JavaScriptSemanticGraphDataProjection.js → javascript/JavaScriptSemanticGraphDataProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphFingerprintProjection.js → javascript/JavaScriptSemanticGraphFingerprintProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphFlowProjection.js → javascript/JavaScriptSemanticGraphFlowProjection.js} +2 -2
- package/dist/application/{JavaScriptSemanticGraphObjectProjection.js → javascript/JavaScriptSemanticGraphObjectProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphProjection.js → javascript/JavaScriptSemanticGraphProjection.js} +2 -2
- package/dist/application/{JavaScriptSemanticGraphResourceProjection.js → javascript/JavaScriptSemanticGraphResourceProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticTraceService.js → javascript/JavaScriptSemanticTraceService.js} +6 -5
- package/dist/application/{ManagedApplicationGraphService.js → managed/ManagedApplicationGraphService.js} +7 -6
- package/dist/application/{ManagedMemberComparisonService.js → managed/ManagedMemberComparisonService.js} +10 -8
- package/dist/application/{ManagedNativeVerificationService.js → managed/ManagedNativeVerificationService.js} +7 -6
- package/dist/application/{ManagedReconstructionService.js → managed/ManagedReconstructionService.js} +7 -6
- package/dist/application/{NativeApiInspection.js → native/NativeApiInspection.js} +1 -1
- package/dist/application/{NativeCallRoutes.js → native/NativeCallRoutes.js} +3 -3
- package/dist/application/{NativeDispatchMetadataInspection.js → native/NativeDispatchMetadataInspection.js} +4 -4
- package/dist/application/{NativeUiActionTrace.js → native/NativeUiActionTrace.js} +7 -6
- package/dist/application/{NativeValueTrace.js → native/NativeValueTrace.js} +6 -6
- package/dist/{application/ArtifactInventory/hash.js → artifacts/ArtifactHash.js} +4 -2
- package/dist/artifacts/ArtifactPaths.js +3 -3
- package/dist/artifacts/ArtifactProvider.js +10 -38
- package/dist/artifacts/ArtifactProviderMetadata.js +36 -0
- package/dist/artifacts/AsarArtifactReader.js +195 -23
- package/dist/artifacts/AsarEntryStream.js +76 -0
- package/dist/artifacts/DirectoryArtifactReader.js +43 -7
- package/dist/artifacts/NativeDmgArtifactReader.js +171 -12
- package/dist/artifacts/SafeOutputTree.js +26 -10
- package/dist/artifacts/ZipArtifactReader.js +1 -0
- package/dist/{application → artifacts/apple}/AppleAssetCatalogAnalysis.js +4 -4
- package/dist/{application → artifacts/apple}/InterfaceBuilderAnalysis.js +125 -51
- package/dist/artifacts/{KeyedArchiveReader.js → apple/KeyedArchiveReader.js} +21 -27
- package/dist/artifacts/{NibArchive.js → apple/NibArchive.js} +4 -2
- package/dist/artifacts/apple/NibViewHierarchy.js +150 -0
- package/dist/{application → artifacts/javascript}/JavaScriptArtifactFiles.js +30 -7
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/readStableArtifact.js +52 -0
- package/dist/browser/BrowserProcessStartup.js +3 -1
- package/dist/browser/BrowserScenarioSecrets.js +50 -8
- package/dist/browser/CdpAuthorizedMainFrame.js +5 -5
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +8 -16
- package/dist/browser/CdpCaptureDocuments.js +36 -22
- package/dist/browser/CdpCaptureEventBodyShapes.js +3 -3
- package/dist/browser/CdpCaptureEventHandlers.js +32 -28
- package/dist/browser/CdpCaptureEventHelpers.js +6 -6
- package/dist/browser/CdpCaptureStorage.js +10 -8
- package/dist/browser/CdpCaptureStorageFingerprints.js +25 -23
- package/dist/browser/CdpCaptureValues.js +8 -4
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +59 -17
- package/dist/browser/CdpElectronInspection.js +13 -13
- package/dist/browser/CdpElectronProvider.js +7 -7
- package/dist/browser/CdpElectronScriptEvents.js +6 -6
- package/dist/browser/CdpElectronScripts.js +4 -4
- package/dist/browser/CdpElectronWorkers.js +4 -4
- package/dist/browser/CdpEndpoint.js +22 -10
- package/dist/browser/CdpObservationSession.js +20 -24
- package/dist/browser/CdpOptionalCommand.js +1 -1
- package/dist/browser/CdpPageCapture.js +6 -5
- package/dist/browser/CdpPageCaptureScripts.js +2 -2
- package/dist/browser/CdpPageCaptureWorkers.js +9 -9
- package/dist/browser/CdpSafeMetadata.js +101 -18
- package/dist/browser/CdpScreenshot.js +6 -6
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +10 -7
- package/dist/browser/CdpWebMcpDiscovery.js +23 -17
- package/dist/browser/ElectronFileScope.js +9 -3
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +10 -7
- package/dist/browser/PlaywrightElectronActiveActions.js +1 -1
- package/dist/browser/PlaywrightElectronActiveProvider.js +9 -8
- package/dist/browser/PlaywrightExecutionBoundary.js +1 -1
- package/dist/browser/PlaywrightScenarioArtifacts.js +10 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +3 -1
- package/dist/browser/PlaywrightScenarioEvents.js +65 -53
- package/dist/browser/PlaywrightScenarioSession.js +13 -3
- package/dist/browser/WebSourceMapFetcher.js +55 -58
- package/dist/browser/assets/LocalWebScriptArtifacts.js +87 -0
- package/dist/browser/assets/PageScriptCapture.js +32 -0
- package/dist/browser/assets/PublishWebScripts.js +74 -0
- package/dist/browser/assets/ScenarioScriptCapture.js +76 -0
- package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
- package/dist/browser/assets/WebArtifactReads.js +56 -0
- package/dist/browser/assets/WebSourceLocationArtifacts.js +40 -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 +48 -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/modules/NativeModuleResolver.js +210 -0
- package/dist/browser/modules/WebModuleArtifacts.js +40 -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 +23 -15
- package/dist/cli/androidCommands.js +91 -0
- package/dist/{cliApplicationCommands.js → cli/applicationCommands.js} +49 -16
- package/dist/cli/artifactCommands.js +1 -1
- package/dist/{cliBrowserAdvancedCommands.js → cli/browserAdvancedCommands.js} +39 -24
- package/dist/{cliBrowserCommands.js → cli/browserCommands.js} +9 -9
- package/dist/cli/commandCancellation.js +24 -0
- package/dist/cli/coreAnalysisCommands.js +5 -400
- package/dist/cli/coreBinaryCommands.js +211 -0
- package/dist/cli/coreNativeCommands.js +293 -0
- package/dist/{cliElectronCommands.js → cli/electronCommands.js} +20 -24
- package/dist/cli/firmwareCommands.js +75 -0
- package/dist/{cliSetup.js → cli/interactiveSetup.js} +1 -1
- package/dist/cli/javascriptApplicationAnalysis.js +2 -2
- package/dist/cli/javascriptRecoveryCommands.js +45 -0
- package/dist/cli/managedCommands.js +5 -5
- package/dist/cli/managedProjectGraphCommand.js +2 -2
- package/dist/cli/options.js +7 -1
- package/dist/{cliProcessCommands.js → cli/processCommands.js} +3 -3
- package/dist/cli/referenceSourceImportStatus.js +15 -0
- package/dist/cli/setupCommands.js +4 -2
- package/dist/cli/utilityCommands.js +50 -25
- package/dist/cli/webModuleCommands.js +56 -0
- package/dist/cli/webRuntimeCommands.js +60 -0
- package/dist/cli/webScriptCommands.js +31 -0
- package/dist/cli/webSourceLocationCommands.js +42 -0
- package/dist/cli.js +20 -15
- package/dist/cliBrowserContext.js +5 -3
- package/dist/cliBrowserScenarioCommands.js +6 -4
- package/dist/cliCommandNames.js +19 -2
- package/dist/cliEvidenceCommands.js +2 -1
- package/dist/cliJavaScriptRuntimeCommands.js +8 -5
- package/dist/cliJsonInput.js +35 -13
- package/dist/cliLogging.js +2 -1
- package/dist/cliOutput.js +52 -27
- package/dist/composition/android.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +30 -0
- package/dist/composition/binary.js +25 -0
- package/dist/composition/browserObservation.js +3 -0
- package/dist/composition/browserScenario.js +3 -0
- package/dist/composition/directAnalysis.js +17 -0
- package/dist/composition/electronObservation.js +3 -0
- package/dist/composition/electronScenario.js +3 -0
- package/dist/composition/firmware.js +3 -0
- package/dist/composition/javascriptRecovery.js +3 -0
- package/dist/composition/javascriptRuntimeObservation.js +3 -0
- package/dist/composition/optionalObservationProviders.js +49 -0
- package/dist/composition/webModules.js +5 -0
- package/dist/composition/webRuntime.js +4 -0
- package/dist/composition/webSourceLocations.js +5 -0
- package/dist/config/environment.js +11 -1
- package/dist/config/parseConfig.js +29 -4
- package/dist/config/parsers.js +1 -1
- package/dist/contracts/android/androidToolContracts.js +77 -0
- package/dist/contracts/applicationToolContracts.js +75 -13
- package/dist/contracts/artifactComparisonExample.js +7 -14
- package/dist/contracts/artifactToolContracts.js +2 -2
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/enhancedInputs.js +1 -1
- package/dist/contracts/enhancedToolContracts.js +31 -0
- package/dist/contracts/errorSchemas.js +4 -2
- package/dist/contracts/evidenceInputContracts.js +13 -0
- package/dist/contracts/firmware/firmwareToolContracts.js +38 -0
- package/dist/contracts/{applicationWorkflowInputContracts.js → javascript/applicationWorkflowInputContracts.js} +18 -18
- package/dist/contracts/{electronToolContracts.js → javascript/electronToolContracts.js} +6 -6
- package/dist/contracts/{javascriptApplicationWorkflowExamples.js → javascript/javascriptApplicationWorkflowExamples.js} +3 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +23 -0
- package/dist/contracts/{javascriptRuntimeObservationToolContracts.js → javascript/javascriptRuntimeObservationToolContracts.js} +3 -3
- package/dist/contracts/{javascriptRuntimeReconciliationExample.js → javascript/javascriptRuntimeReconciliationExample.js} +5 -5
- package/dist/contracts/{managedToolContracts.js → managed/managedToolContracts.js} +3 -3
- package/dist/contracts/{managedWorkflowExamples.js → managed/managedWorkflowExamples.js} +1 -1
- package/dist/contracts/{managedWorkflowToolContracts.js → managed/managedWorkflowToolContracts.js} +6 -6
- package/dist/contracts/mobileApplicationGraphExamples.js +105 -0
- package/dist/contracts/{nativeToolContracts.js → native/nativeToolContracts.js} +14 -7
- package/dist/contracts/officialToolContracts.js +66 -0
- package/dist/contracts/promptContracts.js +1 -1
- package/dist/contracts/sessionLifecycleInputs.js +4 -0
- package/dist/contracts/sessionToolContracts.js +43 -0
- package/dist/contracts/sessionToolSchemas.js +1 -1
- package/dist/contracts/toolContractExamples.js +5 -0
- package/dist/contracts/toolContractTypes.js +2 -0
- package/dist/contracts/toolContracts.js +18 -135
- package/dist/contracts/toolEffects.js +75 -0
- package/dist/contracts/toolOutputSchemaGroups.js +20 -16
- package/dist/contracts/toolOutputSchemaPrimitives.js +1 -0
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/doctorRuntime.js +5 -1
- package/dist/domain/analysisErrorBase.js +33 -0
- package/dist/domain/analysisErrorCore.js +62 -0
- package/dist/domain/analysisErrorPresentation.js +22 -2
- package/dist/domain/analysisErrorProjection.js +25 -3
- package/dist/domain/analysisSnapshot.js +1 -0
- package/dist/domain/android/androidAnalysis.js +141 -0
- package/dist/domain/{androidApplication.js → android/androidApplication.js} +7 -6
- package/dist/domain/apple/appleApplication.js +277 -0
- package/dist/domain/{appleAssetCatalog.js → apple/appleAssetCatalog.js} +2 -2
- package/dist/domain/apple/appleBundleAnatomy.js +236 -0
- package/dist/domain/{interfaceBuilderGraph.js → apple/interfaceBuilderGraph.js} +47 -312
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +411 -0
- package/dist/domain/{keyedArchive.js → apple/keyedArchive.js} +10 -9
- package/dist/domain/apple/plistValue.js +35 -0
- package/dist/domain/artifactGraph.js +1 -0
- package/dist/domain/artifactInspection.js +19 -17
- package/dist/domain/artifactInventoryEvidence.js +32 -27
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +20 -0
- package/dist/domain/artifactPathSyntax.js +26 -0
- package/dist/domain/browserNetworkEvidence.js +82 -0
- package/dist/domain/browserObservation.js +12 -4
- package/dist/domain/browserObservationError.js +25 -0
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenario.js +1 -1
- package/dist/domain/browserScenarioCapture.js +23 -1
- package/dist/domain/browserScenarioCaptureValues.js +25 -0
- package/dist/domain/browserScenarioDiff.js +7 -4
- package/dist/domain/browserScenarioDiffEvidence.js +35 -1
- package/dist/domain/browserScenarioNormalization.js +6 -11
- package/dist/domain/browserScenarioValues.js +15 -2
- package/dist/domain/browserSession.js +2 -7
- package/dist/domain/bundleComparison.js +2 -1
- package/dist/domain/callPath.js +86 -38
- package/dist/domain/canonicalDigest.js +65 -0
- package/dist/domain/canonicalOrdering.js +11 -0
- package/dist/domain/changedBehavior.js +8 -7
- package/dist/domain/comparisonSemantics.js +2 -4
- package/dist/domain/comparisonStatus.js +39 -0
- package/dist/domain/configurationErrors.js +25 -0
- package/dist/domain/dosCom.js +8 -0
- package/dist/domain/evidence.js +3 -11
- package/dist/domain/evidenceBundle.js +98 -35
- package/dist/domain/evidenceErrors.js +30 -0
- package/dist/domain/firmware/firmwareAnalysis.js +121 -0
- package/dist/domain/functionComparison.js +4 -2
- package/dist/domain/functionComparisonDimensions.js +6 -4
- package/dist/domain/functionComparisonNormalization.js +13 -8
- package/dist/domain/functionComparisonResults.js +1 -4
- package/dist/domain/hopperErrors.js +78 -0
- package/dist/domain/hopperValues.js +4 -3
- package/dist/domain/inputIssueProjection.js +17 -2
- package/dist/domain/{electronActiveObservation.js → javascript/electronActiveObservation.js} +3 -1
- package/dist/domain/{electronObservation.js → javascript/electronObservation.js} +5 -11
- package/dist/domain/{electronStaticAnalysisBrowser.js → javascript/electronStaticAnalysisBrowser.js} +15 -24
- package/dist/domain/{electronStaticAnalysisIpc.js → javascript/electronStaticAnalysisIpc.js} +2 -2
- package/dist/domain/{electronStaticAnalysisNative.js → javascript/electronStaticAnalysisNative.js} +12 -12
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/{electronStaticAnalysisValues.js → javascript/electronStaticAnalysisValues.js} +24 -4
- package/dist/domain/{javascriptApplicationAnalysis.js → javascript/javascriptApplicationAnalysis.js} +2 -2
- package/dist/domain/{javascriptApplicationChangeGraph.js → javascript/javascriptApplicationChangeGraph.js} +2 -2
- package/dist/domain/{javascriptApplicationEvidenceSchemas.js → javascript/javascriptApplicationEvidenceSchemas.js} +6 -4
- package/dist/domain/{javascriptApplicationGraph.js → javascript/javascriptApplicationGraph.js} +13 -22
- package/dist/domain/{javascriptApplicationGraphSchemas.js → javascript/javascriptApplicationGraphSchemas.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparison.js → javascript/javascriptApplicationVersionComparison.js} +3 -11
- package/dist/domain/{javascriptApplicationVersionComparisonSchemas.js → javascript/javascriptApplicationVersionComparisonSchemas.js} +3 -3
- package/dist/domain/{javascriptApplicationVersionItems.js → javascript/javascriptApplicationVersionItems.js} +4 -4
- package/dist/domain/{javascriptApplicationVersionKeys.js → javascript/javascriptApplicationVersionKeys.js} +16 -9
- package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
- package/dist/domain/{javascriptAstFingerprint.js → javascript/javascriptAstFingerprint.js} +38 -22
- package/dist/domain/javascript/javascriptAstValues.js +23 -0
- package/dist/domain/{javascriptExportShapeComparison.js → javascript/javascriptExportShapeComparison.js} +1 -2
- package/dist/domain/{javascriptExportShapeComparisonSchemas.js → javascript/javascriptExportShapeComparisonSchemas.js} +2 -2
- package/dist/domain/{javascriptExportShapeSelection.js → javascript/javascriptExportShapeSelection.js} +1 -1
- package/dist/domain/{javascriptExportShapeVariants.js → javascript/javascriptExportShapeVariants.js} +7 -3
- package/dist/domain/{javascriptFeatureSeed.js → javascript/javascriptFeatureSeed.js} +32 -11
- package/dist/domain/{javascriptFeatureTrace.js → javascript/javascriptFeatureTrace.js} +9 -13
- package/dist/domain/{javascriptFeatureTraceSchemas.js → javascript/javascriptFeatureTraceSchemas.js} +32 -18
- package/dist/domain/{javascriptFeatureTraversal.js → javascript/javascriptFeatureTraversal.js} +7 -2
- package/dist/domain/{javascriptNativeHandoff.js → javascript/javascriptNativeHandoff.js} +2 -1
- package/dist/domain/javascript/javascriptRecovery.js +88 -0
- package/dist/domain/{javascriptRuntimeLoadState.js → javascript/javascriptRuntimeLoadState.js} +2 -2
- package/dist/domain/{javascriptRuntimeObservation.js → javascript/javascriptRuntimeObservation.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationActive.js → javascript/javascriptRuntimeReconciliationActive.js} +5 -12
- package/dist/domain/{javascriptRuntimeReconciliationGraph.js → javascript/javascriptRuntimeReconciliationGraph.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationMatching.js → javascript/javascriptRuntimeReconciliationMatching.js} +4 -3
- package/dist/domain/{javascriptRuntimeReconciliationParsing.js → javascript/javascriptRuntimeReconciliationParsing.js} +11 -17
- package/dist/domain/{javascriptRuntimeReconciliationResult.js → javascript/javascriptRuntimeReconciliationResult.js} +4 -4
- package/dist/domain/{javascriptRuntimeReconciliationSchemas.js → javascript/javascriptRuntimeReconciliationSchemas.js} +8 -5
- package/dist/domain/{javascriptRuntimeStaticCandidates.js → javascript/javascriptRuntimeStaticCandidates.js} +8 -4
- package/dist/domain/{javascriptSemanticAnalysis.js → javascript/javascriptSemanticAnalysis.js} +80 -17
- package/dist/domain/{javascriptSemanticAsyncEffects.js → javascript/javascriptSemanticAsyncEffects.js} +2 -1
- package/dist/domain/{javascriptSemanticCallResolution.js → javascript/javascriptSemanticCallResolution.js} +11 -5
- package/dist/domain/{javascriptSemanticCalls.js → javascript/javascriptSemanticCalls.js} +7 -4
- package/dist/domain/{javascriptSemanticChildProcesses.js → javascript/javascriptSemanticChildProcesses.js} +5 -2
- package/dist/domain/{javascriptSemanticDataEffectHelpers.js → javascript/javascriptSemanticDataEffectHelpers.js} +7 -6
- package/dist/domain/{javascriptSemanticDataEffects.js → javascript/javascriptSemanticDataEffects.js} +9 -6
- package/dist/domain/{javascriptSemanticFingerprints.js → javascript/javascriptSemanticFingerprints.js} +40 -16
- package/dist/domain/{javascriptSemanticGraph.js → javascript/javascriptSemanticGraph.js} +23 -28
- package/dist/domain/{javascriptSemanticGraphSchemas.js → javascript/javascriptSemanticGraphSchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +116 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +53 -0
- package/dist/domain/{javascriptSemanticObjects.js → javascript/javascriptSemanticObjects.js} +5 -5
- package/dist/domain/{javascriptSemanticPrimitives.js → javascript/javascriptSemanticPrimitives.js} +9 -2
- package/dist/domain/{javascriptSemanticProjection.js → javascript/javascriptSemanticProjection.js} +32 -44
- package/dist/domain/{javascriptSemanticPromises.js → javascript/javascriptSemanticPromises.js} +77 -21
- package/dist/domain/{javascriptSemanticProvenance.js → javascript/javascriptSemanticProvenance.js} +4 -1
- package/dist/domain/{javascriptSemanticQuery.js → javascript/javascriptSemanticQuery.js} +7 -8
- package/dist/domain/{javascriptSemanticQueryAssessment.js → javascript/javascriptSemanticQueryAssessment.js} +1 -2
- package/dist/domain/{javascriptSemanticQueryIdentity.js → javascript/javascriptSemanticQueryIdentity.js} +1 -2
- package/dist/domain/{javascriptSemanticQuerySchemas.js → javascript/javascriptSemanticQuerySchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +25 -0
- package/dist/domain/{javascriptSemanticResources.js → javascript/javascriptSemanticResources.js} +2 -1
- package/dist/domain/{javascriptSemanticReturns.js → javascript/javascriptSemanticReturns.js} +2 -1
- package/dist/domain/{javascriptSemanticTraceSchemas.js → javascript/javascriptSemanticTraceSchemas.js} +2 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +55 -0
- package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
- package/dist/domain/{javascriptSemanticValues.js → javascript/javascriptSemanticValues.js} +118 -60
- package/dist/domain/{javascriptSourceParser.js → javascript/javascriptSourceParser.js} +4 -2
- package/dist/domain/{javascriptStaticAnalysis.js → javascript/javascriptStaticAnalysis.js} +8 -5
- package/dist/domain/{javascriptStaticAnalysisBundler.js → javascript/javascriptStaticAnalysisBundler.js} +15 -11
- package/dist/domain/{javascriptStaticAnalysisCalls.js → javascript/javascriptStaticAnalysisCalls.js} +16 -8
- package/dist/domain/{javascriptStaticAnalysisHelpers.js → javascript/javascriptStaticAnalysisHelpers.js} +261 -43
- package/dist/domain/{sourceToBundleComparison.js → javascript/sourceToBundleComparison.js} +6 -8
- package/dist/domain/{sourceToBundleComparisonSchemas.js → javascript/sourceToBundleComparisonSchemas.js} +4 -4
- package/dist/domain/{sourceToBundleSignals.js → javascript/sourceToBundleSignals.js} +7 -7
- package/dist/domain/jsonShape.js +6 -2
- package/dist/domain/{managedApplicationGraph.js → managed/managedApplicationGraph.js} +4 -4
- package/dist/domain/{managedApplicationGraphNodes.js → managed/managedApplicationGraphNodes.js} +1 -1
- package/dist/domain/{managedArtifact.js → managed/managedArtifact.js} +1 -1
- package/dist/domain/{managedMemberComparison.js → managed/managedMemberComparison.js} +5 -4
- package/dist/domain/{managedMemberComparisonCoverage.js → managed/managedMemberComparisonCoverage.js} +2 -1
- package/dist/domain/{managedMemberComparisonItems.js → managed/managedMemberComparisonItems.js} +99 -40
- package/dist/domain/{managedMemberComparisonMatch.js → managed/managedMemberComparisonMatch.js} +22 -11
- package/dist/domain/{managedNativeVerification.js → managed/managedNativeVerification.js} +1 -1
- package/dist/domain/{managedNativeVerificationMatch.js → managed/managedNativeVerificationMatch.js} +8 -6
- package/dist/domain/{managedNativeVerificationSchemas.js → managed/managedNativeVerificationSchemas.js} +6 -5
- package/dist/domain/{managedReconstruction.js → managed/managedReconstruction.js} +3 -3
- package/dist/domain/{nativeDataType.js → native/nativeDataType.js} +2 -0
- package/dist/domain/native/nativeFunctionAnnotations.js +43 -0
- package/dist/domain/{nativeInspection.js → native/nativeInspection.js} +1 -1
- package/dist/domain/{nativeInvestigationGraph.js → native/nativeInvestigationGraph.js} +13 -4
- package/dist/domain/native/nativeLoadImage.js +95 -0
- package/dist/domain/native/nativeMetadataRecovery.js +55 -0
- package/dist/domain/{nativeUiObservation.js → native/nativeUiObservation.js} +20 -6
- package/dist/domain/{objcSwiftMetadata.js → native/objcSwiftMetadata.js} +17 -0
- package/dist/domain/processCapture.js +4 -3
- package/dist/domain/processEvidenceProvider.js +11 -0
- package/dist/domain/processScenario.js +17 -17
- package/dist/domain/processTraceComparison.js +1 -1
- package/dist/domain/propertyListKeys.js +69 -0
- package/dist/domain/providerAdapterError.js +17 -0
- package/dist/domain/providerCleanupError.js +6 -3
- package/dist/domain/providerSelectionError.js +44 -0
- package/dist/domain/reconstructionCoverageEvaluation.js +46 -24
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/reconstructionUnknowns.js +1 -1
- package/dist/domain/reconstructionVerification.js +22 -8
- package/dist/domain/referenceSourceClassification.js +5 -6
- package/dist/domain/referenceSourceGraph.js +9 -17
- package/dist/domain/referenceSourceImportParsing.js +38 -23
- package/dist/domain/runtimeIdentification.js +1 -1
- package/dist/domain/runtimeVersion.js +6 -7
- package/dist/domain/safeJson.js +13 -0
- package/dist/domain/sourceMapEnvelope.js +38 -0
- package/dist/domain/staticRuntimeCorrelation.js +9 -7
- package/dist/domain/unicodeCodePointOrder.js +11 -6
- package/dist/domain/unknownRegistryError.js +10 -0
- package/dist/domain/webBundleAnalyzerAst.js +23 -38
- package/dist/domain/webBundleAnalyzerInspection.js +29 -20
- package/dist/domain/webEventListeners.js +28 -0
- package/dist/domain/webExecution.js +74 -0
- package/dist/domain/webMcpDiscovery.js +1 -7
- package/dist/domain/webModuleImports.js +104 -0
- package/dist/domain/webModuleTrace.js +106 -0
- package/dist/domain/webRuntime.js +69 -0
- package/dist/domain/webScreenshot.js +1 -7
- package/dist/domain/webScriptArtifacts.js +39 -0
- package/dist/domain/webScriptExport.js +86 -0
- package/dist/domain/webScriptExportError.js +13 -0
- package/dist/domain/webScriptExportPlan.js +108 -0
- package/dist/domain/webSourceLocation.js +106 -0
- package/dist/domain/webSourcePosition.js +21 -0
- package/dist/dotnet/ManagedArtifactInspector.js +1 -1
- package/dist/dotnet/ManagedMemberInspector.js +1 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +34 -0
- package/dist/dotnet/ManagedMemberRows.js +6 -4
- package/dist/dotnet/ManagedMetadataHeaps.js +3 -2
- package/dist/dotnet/ManagedMetadataInventoryRows.js +4 -2
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -1
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +22 -16
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +56 -50
- package/dist/dotnet/ManagedStaticProvider.js +6 -34
- package/dist/dotnet/ManagedStaticProviderMetadata.js +36 -0
- package/dist/evaluation/CodexAgentEval.js +2 -1
- package/dist/firmware/FirmwareCommand.js +163 -0
- package/dist/firmware/FirmwareFiles.js +190 -0
- package/dist/firmware/FirmwareProvider.js +264 -0
- package/dist/firmware/FirmwarePublication.js +84 -0
- package/dist/firmware/FirmwareRelease.js +32 -0
- package/dist/firmware/FirmwareReports.js +235 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +5 -5
- package/dist/ghidra/GhidraAnalysisProfile.js +37 -8
- package/dist/ghidra/GhidraClient.js +52 -6
- package/dist/ghidra/GhidraDiagnostics.js +3 -0
- package/dist/ghidra/GhidraDoctor.js +38 -14
- package/dist/ghidra/GhidraFunctionValues.js +14 -8
- package/dist/ghidra/GhidraInstallation.js +48 -38
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +39 -2
- package/dist/ghidra/GhidraLauncher.js +102 -29
- package/dist/ghidra/GhidraLoadImageAttest.js +36 -0
- package/dist/ghidra/GhidraLoadImageValues.js +199 -0
- package/dist/ghidra/GhidraProvider.js +47 -149
- package/dist/ghidra/GhidraProviderCapabilities.js +58 -28
- package/dist/ghidra/GhidraProviderClient.js +209 -0
- package/dist/ghidra/GhidraRequestQueue.js +2 -2
- package/dist/ghidra/GhidraResponseBuffer.js +7 -1
- package/dist/ghidra/GhidraSessionError.js +31 -4
- package/dist/ghidra/GhidraSessionValues.js +10 -7
- package/dist/ghidra/GhidraTargetSnapshot.js +16 -2
- package/dist/ghidra/GhidraTransport.js +12 -0
- package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +170 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +21 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +100 -0
- package/dist/hopper/BridgeLauncher.js +4 -2
- package/dist/hopper/HopperAnalysisProfile.js +7 -2
- package/dist/hopper/HopperCleanup.js +55 -9
- package/dist/hopper/HopperClient.js +14 -4
- package/dist/hopper/HopperProcessDiagnostic.js +1 -1
- package/dist/hopper/HopperProvider.js +8 -50
- package/dist/hopper/HopperProviderCapabilities.js +73 -0
- package/dist/hopper/HopperRequestQueue.js +7 -3
- package/dist/hopper/HopperResponseStream.js +7 -1
- package/dist/hopper/HopperSessionValues.js +1 -1
- package/dist/hopper/HopperSocketConnection.js +1 -1
- package/dist/hopper/HopperTargetLease.js +23 -15
- package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +7 -8
- package/dist/hopper/LinuxPrivateDisplayProbe.js +10 -6
- package/dist/hopper/protocol.js +8 -8
- package/dist/ida/IdaConfiguration.js +56 -0
- package/dist/ida/IdaDoctor.js +53 -0
- package/dist/ida/IdaInput.js +62 -0
- package/dist/ida/IdaMcpConnection.js +111 -0
- package/dist/ida/IdaOperationRunner.js +299 -0
- package/dist/ida/IdaProtocolValues.js +178 -0
- package/dist/ida/IdaProvider.js +126 -0
- package/dist/ida/IdaProviderCapabilities.js +52 -0
- package/dist/ida/IdaSessionClient.js +318 -0
- package/dist/ida/IdaWorkspace.js +54 -0
- package/dist/{browser → inspector}/JavaScriptRuntimeScope.js +19 -6
- package/dist/{browser → inspector}/V8InspectorCaptureProjection.js +46 -8
- package/dist/{browser → inspector}/V8InspectorEndpoint.js +3 -2
- package/dist/{browser → inspector}/V8InspectorProvider.js +16 -14
- package/dist/inspector/providerIdentity.js +6 -0
- package/dist/javascript/recovery/RecoveryFiles.js +122 -0
- package/dist/javascript/recovery/WakaruCommand.js +116 -0
- package/dist/javascript/recovery/WakaruExecution.js +100 -0
- package/dist/javascript/recovery/WakaruProvider.js +96 -0
- package/dist/javascript/recovery/WakaruPublication.js +102 -0
- package/dist/javascript/recovery/WakaruRelease.js +29 -0
- package/dist/javascript/recovery/WakaruReport.js +134 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +176 -0
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +61 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +185 -0
- package/dist/javascript/sourceMaps/TraceSourceMap.js +138 -0
- package/dist/main/shutdown.js +29 -3
- package/dist/main/startup.js +1 -1
- package/dist/main/transport.js +32 -11
- package/dist/main.js +9 -20
- package/dist/native/AppleDispatchCoverage.js +58 -0
- package/dist/native/AppleDispatchMetadata.js +73 -490
- package/dist/native/AppleMachoFixups.js +292 -0
- package/dist/native/AppleMachoSelection.js +188 -0
- package/dist/native/AppleObjcCategories.js +59 -0
- package/dist/native/AppleObjcDispatchFacets.js +257 -0
- package/dist/native/AppleObjcProperties.js +68 -0
- package/dist/native/AppleObjcProtocols.js +2 -1
- package/dist/native/AppleSwiftDispatchFacets.js +150 -0
- package/dist/native/NativeMacOSProvider.js +204 -72
- package/dist/native/NativeMacOSProviderMetadata.js +42 -0
- package/dist/native/NativeMachoInspection.js +87 -26
- package/dist/native/NativeUiHelperRuntime.js +14 -4
- package/dist/native/NativeUiObservation.js +14 -6
- package/dist/native/NativeUiOutputBudget.js +8 -0
- package/dist/native/parsers/codesign.js +40 -5
- package/dist/native/parsers/demangle.js +6 -2
- package/dist/native/parsers/dyldInfo.js +16 -7
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +14 -0
- package/dist/native/parsers/otool.js +5 -2
- package/dist/native/parsers/plist.js +174 -11
- package/dist/process/ExecFileOutput.js +2 -0
- package/dist/process/PrivateRuntimeRoot.js +13 -3
- package/dist/process/ProcessOwnership.js +5 -73
- package/dist/process/ProcessOwnershipObservation.js +62 -2
- package/dist/process/ProcessOwnershipProcessTree.js +13 -0
- package/dist/process/ProviderProcess.js +62 -24
- package/dist/process/ProviderRunLineage.js +1 -1
- package/dist/process/WindowsAuthority.js +20 -1
- package/dist/reference/ReferenceSourceReaderEntries.js +11 -2
- package/dist/reference/ReferenceSourceReaderFile.js +1 -0
- package/dist/server/createServer.js +67 -2
- package/dist/server/mcpClientMetadata.js +6 -3
- package/dist/server/mcpProgress.js +2 -1
- package/dist/server/promptCompletion.js +3 -3
- package/dist/server/registerAndroidTools.js +30 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +7 -3
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +9 -4
- package/dist/server/registerApplicationTools/compareVersions.js +7 -3
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +43 -0
- package/dist/server/registerApplicationTools/traceFeature.js +8 -3
- package/dist/server/registerApplicationTools/traceSemantics.js +8 -3
- package/dist/server/registerApplicationTools.js +2 -0
- package/dist/server/registerBrowserScenarioTool.js +6 -2
- package/dist/server/registerBrowserTools.js +13 -2
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +21 -7
- package/dist/server/registerEnhancedTools.js +28 -1
- package/dist/server/registerFirmwareTools.js +22 -0
- package/dist/server/registerFunctionComparisonTool.js +1 -1
- package/dist/server/registerInvestigationTools/helpers.js +2 -1
- package/dist/server/registerJavaScriptRecoveryTool.js +17 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -4
- package/dist/server/registerManagedTools.js +4 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -2
- package/dist/server/registerManagedWorkflowTools/contract.js +1 -1
- package/dist/server/registerManagedWorkflowTools/evidence.js +1 -1
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +1 -1
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +1 -1
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +2 -2
- package/dist/server/registerNativeTools.js +1 -1
- package/dist/server/registerOfficialTools.js +4 -1
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerPrompts.js +5 -1
- package/dist/server/registerSessionTools.js +4 -2
- package/dist/server/registerWebModuleTool.js +17 -0
- package/dist/server/registerWebRuntimeTools.js +31 -0
- package/dist/server/registerWebScriptTool.js +18 -0
- package/dist/server/registerWebSourceLocationTool.js +17 -0
- package/dist/server/runDerivedOperation.js +1 -1
- package/dist/server/sessionAvailabilityPolicy.js +24 -9
- package/dist/server/sessionEvidence.js +1 -1
- package/dist/server/toolResult.js +2 -1
- package/dist/windows/WindowsNativeLoader.js +108 -0
- package/dist/windows/WindowsOwnedProcess.js +170 -0
- package/dist/windows/WindowsPrivateRuntime.js +137 -0
- package/install.sh +16 -8
- package/native/windows/README.md +107 -0
- package/native/windows/build/manifest.json +9 -0
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +70 -35
- package/scripts/hopper-demo-x11.py +67 -8
- package/scripts/rea.mjs +10 -2
- package/scripts/verify-windows-native-artifact.mjs +39 -0
- package/skills/reverse-engineer-anything/SKILL.md +92 -24
- package/skills/reverse-engineer-anything/references/android-applications.md +31 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +19 -2
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +61 -4
- package/dist/application/JavaScriptApplicationService.js +0 -52
- package/dist/application/runtime.js +0 -51
- package/dist/browser/CdpCanonicalJsonDigest.js +0 -9
- package/dist/domain/appleApplication.js +0 -181
- package/dist/domain/errors.js +0 -324
- package/dist/domain/javascriptAstValues.js +0 -13
- package/dist/domain/javascriptSemanticTraversal.js +0 -30
- package/dist/native/NativeHostCapabilities.js +0 -23
- /package/dist/application/{BinarySessionPort.js → DirectAnalysisDependencies.js} +0 -0
- /package/dist/application/{ElectronActiveObservationPort.js → WebModulePorts.js} +0 -0
- /package/dist/application/{ElectronObservationPort.js → WebRuntimePort.js} +0 -0
- /package/dist/application/{JavaScriptArtifactAnalysisTypes.js → WebScriptArtifactPort.js} +0 -0
- /package/dist/application/{JavaScriptRuntimeObservationPort.js → WebSourceLocationPorts.js} +0 -0
- /package/dist/{domain/electronStaticAnalysisTypes.js → application/android/AndroidAnalysisPort.js} +0 -0
- /package/dist/application/{AbortablePromise.js → binary/AbortablePromise.js} +0 -0
- /package/dist/{domain/javascriptSemanticValueTypes.js → application/binary/BinarySessionPort.js} +0 -0
- /package/dist/application/{BinarySessionStatus.js → binary/BinarySessionStatus.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraph.js → javascript/ElectronBoundaryGraph.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphIpc.js → javascript/ElectronBoundaryGraphIpc.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphNative.js → javascript/ElectronBoundaryGraphNative.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphWindows.js → javascript/ElectronBoundaryGraphWindows.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphBundlers.js → javascript/JavaScriptArtifactGraphBundlers.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphEvidence.js → javascript/JavaScriptArtifactGraphEvidence.js} +0 -0
- /package/dist/application/{JavaScriptArtifactReconstructionInput.js → javascript/JavaScriptArtifactReconstructionInput.js} +0 -0
- /package/dist/application/{JavaScriptSemanticGraphEvidence.js → javascript/JavaScriptSemanticGraphEvidence.js} +0 -0
- /package/dist/application/{JavaScriptSemanticGraphValueProjection.js → javascript/JavaScriptSemanticGraphValueProjection.js} +0 -0
- /package/dist/domain/{electronStaticAnalysis.js → javascript/electronStaticAnalysis.js} +0 -0
- /package/dist/domain/{javascriptExportShapeComparisonIdentity.js → javascript/javascriptExportShapeComparisonIdentity.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliation.js → javascript/javascriptRuntimeReconciliation.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliationRuntime.js → javascript/javascriptRuntimeReconciliationRuntime.js} +0 -0
- /package/dist/domain/{javascriptSemanticCoverage.js → javascript/javascriptSemanticCoverage.js} +0 -0
- /package/dist/domain/{javascriptSemanticDerivedAnalysis.js → javascript/javascriptSemanticDerivedAnalysis.js} +0 -0
- /package/dist/domain/{javascriptSemanticGraphSerialization.js → javascript/javascriptSemanticGraphSerialization.js} +0 -0
- /package/dist/domain/{javascriptSemanticIr.js → javascript/javascriptSemanticIr.js} +0 -0
- /package/dist/domain/{javascriptSemanticQueryRelations.js → javascript/javascriptSemanticQueryRelations.js} +0 -0
- /package/dist/domain/{javascriptSemanticState.js → javascript/javascriptSemanticState.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisFindings.js → javascript/javascriptStaticAnalysisFindings.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisState.js → javascript/javascriptStaticAnalysisState.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisTypes.js → javascript/javascriptStaticAnalysisTypes.js} +0 -0
- /package/dist/domain/{managedApplicationGraphCoverage.js → managed/managedApplicationGraphCoverage.js} +0 -0
- /package/dist/domain/{managedApplicationGraphNodeCoverage.js → managed/managedApplicationGraphNodeCoverage.js} +0 -0
- /package/dist/domain/{nativeApiBoundary.js → native/nativeApiBoundary.js} +0 -0
- /package/dist/domain/{nativeInstruction.js → native/nativeInstruction.js} +0 -0
- /package/dist/domain/{nativeValueFlow.js → native/nativeValueFlow.js} +0 -0
- /package/dist/domain/{nativeValueTrace.js → native/nativeValueTrace.js} +0 -0
|
@@ -1,65 +1,33 @@
|
|
|
1
|
+
import { NATIVE_MACOS_PROVIDER_IDENTITY as IDENTITY, nativeMacOSCapabilities, } from "./NativeMacOSProviderMetadata.js";
|
|
2
|
+
export { NATIVE_MACOS_PROVIDER_IDENTITY } from "./NativeMacOSProviderMetadata.js";
|
|
1
3
|
import { inspectAppleDispatchMetadata } from "./AppleDispatchMetadata.js";
|
|
2
4
|
import { observeNativeUi } from "./NativeUiObservation.js";
|
|
3
5
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
4
|
-
import { stat } from "node:fs/promises";
|
|
5
|
-
import { parse as parseXmlPlist } from "plist";
|
|
6
|
+
import { open, realpath, stat } from "node:fs/promises";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
import { createAnalysisExecution, } from "../application/AnalysisProvider.js";
|
|
8
|
-
import { NATIVE_TOOL_CONTRACTS, } from "../contracts/nativeToolContracts.js";
|
|
9
|
-
import { AnalysisCancelledError, AnalysisCapabilityUnavailableError,
|
|
9
|
+
import { NATIVE_TOOL_CONTRACTS, } from "../contracts/native/nativeToolContracts.js";
|
|
10
|
+
import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisInputError, AnalysisOutputError, } from "../domain/analysisErrorCore.js";
|
|
11
|
+
import { BinaryTargetError } from "../domain/configurationErrors.js";
|
|
12
|
+
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
|
|
13
|
+
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
|
10
14
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
11
|
-
import {
|
|
15
|
+
import { omittedPrototypeKeysLimitation, parseXmlPropertyList, } from "../domain/propertyListKeys.js";
|
|
16
|
+
import { demangleSwiftSchema, inspectPlistSchema, inspectSignatureSchema, listArchitecturesSchema, } from "../domain/native/nativeInspection.js";
|
|
12
17
|
import { err, ok } from "../domain/result.js";
|
|
13
18
|
import { NativeCommandFailure, XcrunCommandRunner, } from "./CommandRunner.js";
|
|
14
19
|
import { parseCodeSignature } from "./parsers/codesign.js";
|
|
15
20
|
import { parseDemangledSymbols } from "./parsers/demangle.js";
|
|
16
21
|
import { parseLipoArchitectures } from "./parsers/lipo.js";
|
|
17
|
-
import { parsePlistJson } from "./parsers/plist.js";
|
|
22
|
+
import { parsePlistJson, parsePlistXml, plistJsonNeedsNumberTypes, } from "./parsers/plist.js";
|
|
18
23
|
import { architectureLocations, inspectNativeMacho, } from "./NativeMachoInspection.js";
|
|
19
|
-
/** Public identity committed by macOS-native inspection observations. */
|
|
20
|
-
export const NATIVE_MACOS_PROVIDER_IDENTITY = Object.freeze({
|
|
21
|
-
id: "native-macos",
|
|
22
|
-
name: "macOS native inspection utilities",
|
|
23
|
-
version: null,
|
|
24
|
-
});
|
|
25
|
-
const IDENTITY = NATIVE_MACOS_PROVIDER_IDENTITY;
|
|
26
24
|
/** Read-only semantic provider composed from Xcode command-line utilities. */
|
|
27
25
|
export class NativeMacOSProvider {
|
|
28
26
|
runner;
|
|
29
27
|
#capabilities;
|
|
30
28
|
constructor(runner = new XcrunCommandRunner(), platform = process.platform) {
|
|
31
29
|
this.runner = runner;
|
|
32
|
-
|
|
33
|
-
this.#capabilities = Object.freeze([
|
|
34
|
-
...NATIVE_TOOL_CONTRACTS,
|
|
35
|
-
{ name: "inspect_native_dispatch_metadata" },
|
|
36
|
-
].map((contract) => {
|
|
37
|
-
const availability = available
|
|
38
|
-
? { available: true, reason: null }
|
|
39
|
-
: {
|
|
40
|
-
available: false,
|
|
41
|
-
availabilityCode: "unsupported_host",
|
|
42
|
-
reason: "Native macOS utilities require macOS.",
|
|
43
|
-
};
|
|
44
|
-
return Object.freeze({
|
|
45
|
-
provider: IDENTITY,
|
|
46
|
-
operation: contract.name,
|
|
47
|
-
...availability,
|
|
48
|
-
effects: Object.freeze({
|
|
49
|
-
mutatesArtifact: false,
|
|
50
|
-
launchesProcess: contract.name !== "inspect_native_dispatch_metadata",
|
|
51
|
-
mayShowUi: contract.name === "capture_native_ui_scenario",
|
|
52
|
-
mayAccessNetwork: contract.name === "capture_native_ui_scenario",
|
|
53
|
-
mayWriteFilesystem: contract.name === "capture_native_ui_scenario" ||
|
|
54
|
-
contract.name === "observe_native_ui",
|
|
55
|
-
changesPermissions: false,
|
|
56
|
-
requiresRoot: false,
|
|
57
|
-
}),
|
|
58
|
-
limitations: Object.freeze([
|
|
59
|
-
"Availability and textual formats depend on the installed macOS/Xcode toolchain.",
|
|
60
|
-
]),
|
|
61
|
-
});
|
|
62
|
-
}));
|
|
30
|
+
this.#capabilities = nativeMacOSCapabilities(platform);
|
|
63
31
|
}
|
|
64
32
|
identity() {
|
|
65
33
|
return IDENTITY;
|
|
@@ -189,7 +157,9 @@ class NativeMacOSClient {
|
|
|
189
157
|
const symbols = z.array(z.string()).safeParse(parameters.symbols);
|
|
190
158
|
if (!symbols.success)
|
|
191
159
|
return err(new AnalysisOutputError("demangle_swift", "symbols were not parsed strings"));
|
|
192
|
-
const capture = await this.#run("demangle_swift", "swift-demangle",
|
|
160
|
+
const capture = await this.#run("demangle_swift", "swift-demangle",
|
|
161
|
+
// `--` keeps symbols that begin with `-` from selecting demangler options.
|
|
162
|
+
["--compact", "--", ...symbols.data], { signal });
|
|
193
163
|
if (!capture.ok)
|
|
194
164
|
return capture;
|
|
195
165
|
const provenance = [invocation(capture.value, this.target.path)];
|
|
@@ -209,28 +179,57 @@ class NativeMacOSClient {
|
|
|
209
179
|
const display = await this.#run("inspect_signature", "codesign", ["-d", "--verbose=4", this.target.path], { signal, acceptNonZero: true });
|
|
210
180
|
if (!display.ok)
|
|
211
181
|
return display;
|
|
212
|
-
const unsigned =
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
182
|
+
const unsigned = isNonzeroUnsignedObservation(display.value);
|
|
183
|
+
const displayFailure = codeSignCaptureFailure(display.value);
|
|
184
|
+
if (displayFailure !== null)
|
|
185
|
+
return err(displayFailure);
|
|
186
|
+
const requirements = await this.#run("inspect_signature", "codesign", ["-d", "-r-", this.target.path], { signal, acceptNonZero: true });
|
|
216
187
|
if (!requirements.ok)
|
|
217
188
|
return requirements;
|
|
218
|
-
const
|
|
189
|
+
const requirementsFailure = codeSignCaptureFailure(requirements.value);
|
|
190
|
+
if (requirementsFailure !== null)
|
|
191
|
+
return err(requirementsFailure);
|
|
192
|
+
const entitlements = await this.#run("inspect_signature", "codesign", ["-d", "--entitlements", ":-", this.target.path], { signal, acceptNonZero: true });
|
|
219
193
|
if (!entitlements.ok)
|
|
220
194
|
return entitlements;
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
]
|
|
195
|
+
const entitlementsFailure = codeSignCaptureFailure(entitlements.value);
|
|
196
|
+
if (entitlementsFailure !== null)
|
|
197
|
+
return err(entitlementsFailure);
|
|
198
|
+
// codesign echoes the resolved executable path in its diagnostics.
|
|
199
|
+
const parsed = parseCodeSignature(display.value.stderr, unsigned, [
|
|
200
|
+
this.target.path,
|
|
201
|
+
...(await canonicalPath(this.target.path)),
|
|
202
|
+
]);
|
|
203
|
+
// The requirement is printed to stdout; stderr echoes the path.
|
|
204
|
+
const requirementText = /designated\s*=>\s*(.+)$/mu.exec(requirements.value.stdout)?.[1] ?? null;
|
|
205
|
+
// Entitlements XML is printed to stdout; stderr echoes the path.
|
|
206
|
+
const entitlementValue = parseEntitlements(entitlements.value.stdout);
|
|
207
|
+
const captures = [display.value, requirements.value, entitlements.value];
|
|
208
|
+
const limitations = [
|
|
209
|
+
...parsed.limitations,
|
|
210
|
+
...(entitlementValue.omittedPrototypeKeys === 0
|
|
211
|
+
? []
|
|
212
|
+
: [
|
|
213
|
+
`Entitlements: ${omittedPrototypeKeysLimitation(entitlementValue.omittedPrototypeKeys)}`,
|
|
214
|
+
]),
|
|
215
|
+
];
|
|
216
|
+
const mixedSigning = !unsigned &&
|
|
217
|
+
(isNonzeroUnsignedObservation(requirements.value) ||
|
|
218
|
+
isNonzeroUnsignedObservation(entitlements.value));
|
|
219
|
+
if (mixedSigning) {
|
|
220
|
+
const slices = await this.#inspectMixedSignatureSlices(parsed.format, requirements.value.exitCode !== 0, entitlements.value.exitCode !== 0, signal);
|
|
221
|
+
if (!slices.ok)
|
|
222
|
+
return slices;
|
|
223
|
+
captures.push(...slices.value.captures);
|
|
224
|
+
limitations.push(...slices.value.limitations);
|
|
225
|
+
}
|
|
226
|
+
const provenance = captures.map((capture) => invocation(capture, this.target.path));
|
|
229
227
|
const result = inspectSignatureSchema.parse({
|
|
230
228
|
...parsed,
|
|
231
229
|
designated_requirement: requirementText,
|
|
232
|
-
entitlements: entitlementValue,
|
|
230
|
+
entitlements: entitlementValue.value,
|
|
233
231
|
provenance,
|
|
232
|
+
limitations,
|
|
234
233
|
});
|
|
235
234
|
return ok({
|
|
236
235
|
result: jsonValueSchema.parse(result),
|
|
@@ -239,6 +238,35 @@ class NativeMacOSClient {
|
|
|
239
238
|
locations: [],
|
|
240
239
|
});
|
|
241
240
|
}
|
|
241
|
+
async #inspectMixedSignatureSlices(format, requirementsUnavailable, entitlementsUnavailable, signal) {
|
|
242
|
+
const captures = [];
|
|
243
|
+
const unsigned = [];
|
|
244
|
+
const unclassified = [];
|
|
245
|
+
for (const architecture of codeSignArchitectures(format, this.target)) {
|
|
246
|
+
const slice = await this.#run("inspect_signature", "codesign", ["-d", "-a", architecture, "--verbose=4", this.target.path], { signal, acceptNonZero: true });
|
|
247
|
+
if (!slice.ok)
|
|
248
|
+
return slice;
|
|
249
|
+
captures.push(slice.value);
|
|
250
|
+
if (slice.value.exitCode === 0)
|
|
251
|
+
continue;
|
|
252
|
+
if (isNonzeroUnsignedObservation(slice.value))
|
|
253
|
+
unsigned.push(architecture);
|
|
254
|
+
else
|
|
255
|
+
unclassified.push(architecture);
|
|
256
|
+
}
|
|
257
|
+
const limitations = [
|
|
258
|
+
unsigned.length > 0
|
|
259
|
+
? `Unsigned Mach-O slices: ${unsigned.join(", ")}.`
|
|
260
|
+
: "One or more Mach-O slices are unsigned, but their architectures could not be classified.",
|
|
261
|
+
];
|
|
262
|
+
if (unclassified.length > 0)
|
|
263
|
+
limitations.push(`Signature state could not be classified for Mach-O slices: ${unclassified.join(", ")}.`);
|
|
264
|
+
if (requirementsUnavailable)
|
|
265
|
+
limitations.push("The aggregate designated requirement is unavailable because Mach-O slices have mixed signing states.");
|
|
266
|
+
if (entitlementsUnavailable)
|
|
267
|
+
limitations.push("The aggregate entitlements are unavailable because Mach-O slices have mixed signing states.");
|
|
268
|
+
return ok({ captures, limitations });
|
|
269
|
+
}
|
|
242
270
|
async #inspectPlist(parameters, signal) {
|
|
243
271
|
const requested = parameters.path;
|
|
244
272
|
if (requested !== undefined && typeof requested !== "string")
|
|
@@ -246,29 +274,55 @@ class NativeMacOSClient {
|
|
|
246
274
|
const plist = await resolvePlistPath(this.target, requested);
|
|
247
275
|
if (!plist.ok)
|
|
248
276
|
return plist;
|
|
277
|
+
const selected = await requireRegularPlist(plist.value, requested);
|
|
278
|
+
if (!selected.ok)
|
|
279
|
+
return selected;
|
|
249
280
|
const classified = await this.#run("inspect_plist", "file", ["-b", plist.value], { signal });
|
|
250
281
|
if (!classified.ok)
|
|
251
282
|
return classified;
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
|
|
283
|
+
const json = await this.#run("inspect_plist", "plutil", ["-convert", "json", "-o", "-", "--", plist.value], { signal, acceptNonZero: true });
|
|
284
|
+
if (!json.ok)
|
|
285
|
+
return json;
|
|
286
|
+
// JSON cannot express data, dates, or non-finite reals; plutil rejects
|
|
287
|
+
// such plists, so decode its lossless XML conversion instead. JSON also
|
|
288
|
+
// prints an integral <real> like an <integer>, so a number beyond the
|
|
289
|
+
// exact JSON range takes its element type from the XML conversion.
|
|
290
|
+
const jsonDecoded = json.value.exitCode === 0;
|
|
291
|
+
const xml = jsonDecoded && !plistJsonNeedsNumberTypes(json.value.stdout)
|
|
292
|
+
? undefined
|
|
293
|
+
: await this.#run("inspect_plist", "plutil", ["-convert", "xml1", "-o", "-", "--", plist.value], { signal, acceptNonZero: !jsonDecoded });
|
|
294
|
+
if (xml !== undefined && !xml.ok)
|
|
295
|
+
return xml;
|
|
296
|
+
if (xml !== undefined && xml.value.exitCode !== 0)
|
|
297
|
+
return err(unreadablePlist(plist.value, requested, `plutil could not decode it as a property list (${plutilDiagnostic(xml.value.stderr, plist.value)})`));
|
|
298
|
+
const parsed = xml === undefined
|
|
299
|
+
? parsePlistJson(json.value.stdout)
|
|
300
|
+
: jsonDecoded
|
|
301
|
+
? parsePlistJson(json.value.stdout, xml.value.stdout)
|
|
302
|
+
: parsePlistXml(xml.value.stdout);
|
|
303
|
+
if (!parsed.ok)
|
|
304
|
+
return parsed;
|
|
305
|
+
const provenance = [
|
|
306
|
+
classified.value,
|
|
307
|
+
json.value,
|
|
308
|
+
...(xml === undefined ? [] : [xml.value]),
|
|
309
|
+
].map((item) => invocation(item, plist.value, "$PLIST"));
|
|
257
310
|
const result = inspectPlistSchema.parse({
|
|
258
311
|
format: /binary property list/iu.test(classified.value.stdout)
|
|
259
312
|
? "binary"
|
|
260
313
|
: /XML|text/iu.test(classified.value.stdout)
|
|
261
314
|
? "xml"
|
|
262
315
|
: "unknown",
|
|
263
|
-
|
|
316
|
+
value: parsed.value.value,
|
|
317
|
+
bundle: parsed.value.bundle,
|
|
264
318
|
source_path: plist.value,
|
|
265
319
|
provenance,
|
|
266
|
-
limitations:
|
|
320
|
+
limitations: parsed.value.limitations,
|
|
267
321
|
});
|
|
268
322
|
return ok({
|
|
269
323
|
result: jsonValueSchema.parse(result),
|
|
270
324
|
provenance,
|
|
271
|
-
limitations:
|
|
325
|
+
limitations: parsed.value.limitations,
|
|
272
326
|
locations: [{ kind: "artifact-path", path: plist.value }],
|
|
273
327
|
});
|
|
274
328
|
}
|
|
@@ -302,6 +356,39 @@ const translateCommandFailure = (operation, failure) => {
|
|
|
302
356
|
return new AnalysisCancelledError(operation);
|
|
303
357
|
return new ProviderAdapterError(IDENTITY.id, operation, { cause: failure });
|
|
304
358
|
};
|
|
359
|
+
const translateCodeSignExitFailure = (capture) => translateCommandFailure("inspect_signature", new NativeCommandFailure("codesign", "nonzero-exit", capture.exitCode));
|
|
360
|
+
const commandOutput = (capture) => `${capture.stdout}\n${capture.stderr}`;
|
|
361
|
+
/**
|
|
362
|
+
* A signed artifact exits zero; its diagnostics can still contain this text
|
|
363
|
+
* through the echoed path or identifier.
|
|
364
|
+
*/
|
|
365
|
+
const isNonzeroUnsignedObservation = (capture) => capture.exitCode !== null &&
|
|
366
|
+
capture.exitCode !== 0 &&
|
|
367
|
+
/not signed at all|code object is not signed/iu.test(commandOutput(capture));
|
|
368
|
+
const canonicalPath = async (path) => {
|
|
369
|
+
try {
|
|
370
|
+
return [await realpath(path)];
|
|
371
|
+
}
|
|
372
|
+
catch {
|
|
373
|
+
return [];
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
const codeSignCaptureFailure = (capture) => capture.exitCode === 0 || isNonzeroUnsignedObservation(capture)
|
|
377
|
+
? null
|
|
378
|
+
: translateCodeSignExitFailure(capture);
|
|
379
|
+
const codeSignArchitectures = (format, target) => {
|
|
380
|
+
const universal = /^Mach-O universal \(([^)\r\n]+)\)$/u.exec(format ?? "")?.[1];
|
|
381
|
+
if (universal !== undefined) {
|
|
382
|
+
const architectures = universal
|
|
383
|
+
.split(/\s+/u)
|
|
384
|
+
.filter((architecture) => /^(?:i386|x86_64|armv7|arm64|arm64e)$/u.test(architecture));
|
|
385
|
+
if (architectures.length > 0)
|
|
386
|
+
return [...new Set(architectures)];
|
|
387
|
+
}
|
|
388
|
+
if (target.kind !== "executable" || target.format !== "mach-o")
|
|
389
|
+
return [];
|
|
390
|
+
return target.availableArchitectures.map((architecture) => architecture === "x86" ? "i386" : architecture);
|
|
391
|
+
};
|
|
305
392
|
const invocation = (capture, artifactPath, alias = "$ARTIFACT") => ({
|
|
306
393
|
tool: capture.tool,
|
|
307
394
|
command: [
|
|
@@ -319,8 +406,51 @@ const parseEntitlements = (output) => {
|
|
|
319
406
|
const start = output.indexOf("<?xml");
|
|
320
407
|
const end = output.lastIndexOf("</plist>");
|
|
321
408
|
if (start < 0 || end < start)
|
|
322
|
-
return null;
|
|
323
|
-
|
|
409
|
+
return { value: null, omittedPrototypeKeys: 0 };
|
|
410
|
+
const { value, omittedPrototypeKeys } = parseXmlPropertyList(output.slice(start, end + "</plist>".length));
|
|
411
|
+
return { value: jsonValueSchema.parse(value), omittedPrototypeKeys };
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Report a plist that cannot be decoded as the caller's selection, or as the
|
|
415
|
+
* target's missing default, rather than as a failed tool run.
|
|
416
|
+
*/
|
|
417
|
+
const unreadablePlist = (path, requested, reason) => {
|
|
418
|
+
const sentence = reason.endsWith(".") ? reason : `${reason}.`;
|
|
419
|
+
return requested === undefined
|
|
420
|
+
? new AnalysisCapabilityUnavailableError(IDENTITY.id, "inspect_plist", `The target has no readable Contents/Info.plist at ${path}: ${sentence} Pass path to inspect another plist.`)
|
|
421
|
+
: new AnalysisInputError("inspect_plist", undefined, [
|
|
422
|
+
{
|
|
423
|
+
path: ["path"],
|
|
424
|
+
reason: "invalid_value",
|
|
425
|
+
message: `Cannot inspect ${path}: ${sentence}`,
|
|
426
|
+
},
|
|
427
|
+
]);
|
|
428
|
+
};
|
|
429
|
+
/** plutil prefixes its diagnostic with the path the message already names. */
|
|
430
|
+
const plutilDiagnostic = (stderr, path) => {
|
|
431
|
+
const text = stderr.trim();
|
|
432
|
+
return text.startsWith(`${path}: `) ? text.slice(path.length + 2) : text;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Admit a readable regular file before plutil runs, so a later plutil failure
|
|
436
|
+
* reflects the bytes rather than a missing path or a host permission denial.
|
|
437
|
+
*/
|
|
438
|
+
const requireRegularPlist = async (path, requested) => {
|
|
439
|
+
try {
|
|
440
|
+
if (!(await stat(path)).isFile())
|
|
441
|
+
return err(unreadablePlist(path, requested, "it is not a regular file"));
|
|
442
|
+
// Opening also observes ACL and macOS privacy denials that stat permits.
|
|
443
|
+
await (await open(path, "r")).close();
|
|
444
|
+
return ok(null);
|
|
445
|
+
}
|
|
446
|
+
catch (cause) {
|
|
447
|
+
const code = cause instanceof Error && "code" in cause ? cause.code : undefined;
|
|
448
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
449
|
+
return err(unreadablePlist(path, requested, "no file exists there"));
|
|
450
|
+
if (code === "EACCES" || code === "EPERM")
|
|
451
|
+
return err(new BinaryTargetError(path, `permission denied while reading plist (${code})`, { cause }));
|
|
452
|
+
return err(new ProviderAdapterError(IDENTITY.id, "inspect_plist", { cause }));
|
|
453
|
+
}
|
|
324
454
|
};
|
|
325
455
|
const resolvePlistPath = async (target, requested) => {
|
|
326
456
|
try {
|
|
@@ -329,9 +459,11 @@ const resolvePlistPath = async (target, requested) => {
|
|
|
329
459
|
return ok(resolve(requested));
|
|
330
460
|
const sourceMetadata = await stat(source);
|
|
331
461
|
const root = sourceMetadata.isDirectory() ? source : dirname(target.path);
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
462
|
+
if (requested !== undefined)
|
|
463
|
+
return ok(resolve(root, requested));
|
|
464
|
+
// A bundle target records the Info.plist its program file was declared
|
|
465
|
+
// in: Contents/Info.plist, or the root plist of an iOS-style bundle.
|
|
466
|
+
return ok(target.bundleInfoPlist ?? resolve(root, "Contents/Info.plist"));
|
|
335
467
|
}
|
|
336
468
|
catch (cause) {
|
|
337
469
|
return err(new ProviderAdapterError(IDENTITY.id, "inspect_plist", { cause }));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { NATIVE_TOOL_CONTRACTS } from "../contracts/native/nativeToolContracts.js";
|
|
2
|
+
/** Public identity committed by macOS-native inspection observations. */
|
|
3
|
+
export const NATIVE_MACOS_PROVIDER_IDENTITY = Object.freeze({
|
|
4
|
+
id: "native-macos",
|
|
5
|
+
name: "macOS native inspection utilities",
|
|
6
|
+
version: null,
|
|
7
|
+
});
|
|
8
|
+
const IDENTITY = NATIVE_MACOS_PROVIDER_IDENTITY;
|
|
9
|
+
/** Declare native host coverage without creating a command runner. */
|
|
10
|
+
export const nativeMacOSCapabilities = (platform = process.platform) => {
|
|
11
|
+
const available = platform === "darwin";
|
|
12
|
+
return Object.freeze([
|
|
13
|
+
...NATIVE_TOOL_CONTRACTS,
|
|
14
|
+
{ name: "inspect_native_dispatch_metadata" },
|
|
15
|
+
].map((contract) => {
|
|
16
|
+
const availability = available
|
|
17
|
+
? { available: true, reason: null }
|
|
18
|
+
: {
|
|
19
|
+
available: false,
|
|
20
|
+
availabilityCode: "unsupported_host",
|
|
21
|
+
reason: "Native macOS utilities require macOS.",
|
|
22
|
+
};
|
|
23
|
+
return Object.freeze({
|
|
24
|
+
provider: IDENTITY,
|
|
25
|
+
operation: contract.name,
|
|
26
|
+
...availability,
|
|
27
|
+
effects: Object.freeze({
|
|
28
|
+
mutatesArtifact: false,
|
|
29
|
+
launchesProcess: contract.name !== "inspect_native_dispatch_metadata",
|
|
30
|
+
mayShowUi: contract.name === "capture_native_ui_scenario",
|
|
31
|
+
mayAccessNetwork: contract.name === "capture_native_ui_scenario",
|
|
32
|
+
mayWriteFilesystem: contract.name === "capture_native_ui_scenario" ||
|
|
33
|
+
contract.name === "observe_native_ui",
|
|
34
|
+
changesPermissions: false,
|
|
35
|
+
requiresRoot: false,
|
|
36
|
+
}),
|
|
37
|
+
limitations: Object.freeze([
|
|
38
|
+
"Availability and textual formats depend on the installed macOS/Xcode toolchain.",
|
|
39
|
+
]),
|
|
40
|
+
});
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { inspectMachoSchema, } from "../domain/nativeInspection.js";
|
|
1
|
+
import { inspectMachoSchema, } from "../domain/native/nativeInspection.js";
|
|
2
2
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
3
3
|
import { err, ok } from "../domain/result.js";
|
|
4
4
|
import { parseDyldSymbols } from "./parsers/dyldInfo.js";
|
|
5
5
|
import { parseLipoArchitectures } from "./parsers/lipo.js";
|
|
6
|
+
import { withoutEchoedPathHeader } from "./parsers/echoedPath.js";
|
|
6
7
|
import { parseOtoolLoadCommands } from "./parsers/otool.js";
|
|
7
|
-
const
|
|
8
|
+
const DISCOVERY_COMMANDS = [
|
|
8
9
|
["file", ["-b"]],
|
|
9
10
|
["lipo", ["-detailed_info"]],
|
|
11
|
+
];
|
|
12
|
+
const REQUIRED_SLICE_COMMANDS = [
|
|
10
13
|
["otool", ["-h", "-l"]],
|
|
11
14
|
["nm", ["-gjU"]],
|
|
12
15
|
["dyld_info", ["-imports"]],
|
|
@@ -18,10 +21,20 @@ const VTOOL_UNAVAILABLE_LIMITATION = "vtool is unavailable; build metadata is no
|
|
|
18
21
|
/** Inspect one Mach-O with the required native commands and normalized output. */
|
|
19
22
|
export const inspectNativeMacho = async (context) => {
|
|
20
23
|
const captures = [];
|
|
21
|
-
for (const [tool, prefix] of
|
|
24
|
+
for (const [tool, prefix] of DISCOVERY_COMMANDS) {
|
|
25
|
+
const captured = await context.run(tool, [...prefix, context.target.path], context.signal);
|
|
26
|
+
if (!captured.ok)
|
|
27
|
+
return err(captured.error);
|
|
28
|
+
captures.push(captured.value);
|
|
29
|
+
}
|
|
30
|
+
const lipo = captures.find(({ tool }) => tool === "lipo");
|
|
31
|
+
if (lipo === undefined)
|
|
32
|
+
throw new TypeError("Missing lipo capture");
|
|
33
|
+
const selectedArchitecture = selectArchitecture(context.target, parseLipoArchitectures(lipo.stdout).map(({ name }) => name));
|
|
34
|
+
for (const [tool, prefix] of REQUIRED_SLICE_COMMANDS) {
|
|
22
35
|
const captured = await context.run(tool, [
|
|
23
36
|
...prefix,
|
|
24
|
-
...selectedArchitectureArguments(tool,
|
|
37
|
+
...selectedArchitectureArguments(tool, selectedArchitecture),
|
|
25
38
|
context.target.path,
|
|
26
39
|
], context.signal);
|
|
27
40
|
if (!captured.ok)
|
|
@@ -32,7 +45,7 @@ export const inspectNativeMacho = async (context) => {
|
|
|
32
45
|
const [tool, prefix] = OPTIONAL_VTOOL_COMMAND;
|
|
33
46
|
const optional = await context.run(tool, [
|
|
34
47
|
...prefix,
|
|
35
|
-
...selectedArchitectureArguments(tool,
|
|
48
|
+
...selectedArchitectureArguments(tool, selectedArchitecture),
|
|
36
49
|
context.target.path,
|
|
37
50
|
], context.signal);
|
|
38
51
|
if (optional.ok)
|
|
@@ -41,25 +54,33 @@ export const inspectNativeMacho = async (context) => {
|
|
|
41
54
|
limitations.push(VTOOL_UNAVAILABLE_LIMITATION);
|
|
42
55
|
else
|
|
43
56
|
return err(optional.error);
|
|
44
|
-
const
|
|
57
|
+
const normalized = normalizeMacho(captures, context.invocation, limitations);
|
|
58
|
+
const segmentOffset = segmentContainerOffset(normalized, selectedArchitecture, /^Non-fat file:/mu.test(lipo.stdout));
|
|
59
|
+
const result = segmentOffset === undefined
|
|
60
|
+
? inspectMachoSchema.parse({
|
|
61
|
+
...normalized,
|
|
62
|
+
limitations: [
|
|
63
|
+
...normalized.limitations,
|
|
64
|
+
"Segment evidence file offsets are unavailable because the selected Mach-O slice's container offset was not observed.",
|
|
65
|
+
],
|
|
66
|
+
})
|
|
67
|
+
: normalized;
|
|
45
68
|
return ok({
|
|
46
69
|
result: jsonValueSchema.parse(result),
|
|
47
70
|
provenance: result.provenance,
|
|
48
71
|
limitations: result.limitations,
|
|
49
|
-
locations: fileOffsetLocations(result),
|
|
72
|
+
locations: fileOffsetLocations(result, segmentOffset),
|
|
50
73
|
});
|
|
51
74
|
};
|
|
52
75
|
const normalizeMacho = (captures, toInvocation, additionalLimitations) => {
|
|
53
76
|
const byTool = captureLookup(captures);
|
|
54
77
|
const architectures = parseLipoArchitectures(byTool("lipo").stdout);
|
|
55
|
-
const load = parseOtoolLoadCommands(byTool("otool")
|
|
56
|
-
const imports = parseDyldSymbols(byTool("dyld_info", 0)
|
|
78
|
+
const load = parseOtoolLoadCommands(sliceOutput(byTool("otool")));
|
|
79
|
+
const imports = parseDyldSymbols(sliceOutput(byTool("dyld_info", 0)), "imports");
|
|
57
80
|
const imageBase = load.segments.find((segment) => segment.file_offset === 0 && (segment.file_size ?? 0) > 0)?.vm_address ?? null;
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
...parseNmExports(byTool("nm").stdout),
|
|
62
|
-
]);
|
|
81
|
+
const nmExports = parseNmExports(byTool("nm").stdout);
|
|
82
|
+
const dyldExports = parseDyldSymbols(sliceOutput(byTool("dyld_info", 1)), "exports", imageBase, new Set(nmExports.map(({ name }) => name)));
|
|
83
|
+
const exports = uniqueSymbols([...dyldExports, ...nmExports]);
|
|
63
84
|
const uuid = /UUID:\s*([A-Fa-f0-9-]+)/u.exec(byTool("dwarfdump").stdout)?.[1] ??
|
|
64
85
|
load.uuid;
|
|
65
86
|
const provenance = captures.map(toInvocation);
|
|
@@ -78,7 +99,7 @@ const normalizeMacho = (captures, toInvocation, additionalLimitations) => {
|
|
|
78
99
|
...additionalLimitations,
|
|
79
100
|
...(threadEntrypoint ? [threadEntrypointLimitation] : []),
|
|
80
101
|
...(imageBase === null &&
|
|
81
|
-
/^\s*offset\s+symbol\s*$/mu.test(byTool("dyld_info", 1)
|
|
102
|
+
/^\s*offset\s+symbol\s*$/mu.test(sliceOutput(byTool("dyld_info", 1)))
|
|
82
103
|
? [
|
|
83
104
|
"Export virtual addresses are unavailable because no file-backed image base was observed.",
|
|
84
105
|
]
|
|
@@ -110,6 +131,8 @@ const normalizeMacho = (captures, toInvocation, additionalLimitations) => {
|
|
|
110
131
|
limitations,
|
|
111
132
|
});
|
|
112
133
|
};
|
|
134
|
+
/** Slice output without the echoed operand path, which can contain any text. */
|
|
135
|
+
const sliceOutput = (capture) => withoutEchoedPathHeader(capture.stdout, capture.arguments.at(-1));
|
|
113
136
|
const captureLookup = (captures) => (tool, occurrence = 0) => {
|
|
114
137
|
const capture = captures.filter((item) => item.tool === tool)[occurrence];
|
|
115
138
|
if (capture === undefined)
|
|
@@ -145,19 +168,39 @@ const uniqueSymbols = (items) => {
|
|
|
145
168
|
unique.set(item.name, item);
|
|
146
169
|
return [...unique.values()].sort((left, right) => left.name.localeCompare(right.name));
|
|
147
170
|
};
|
|
148
|
-
const fileOffsetLocations = (macho) => {
|
|
171
|
+
const fileOffsetLocations = (macho, segmentOffset) => {
|
|
149
172
|
const locations = architectureLocations(macho.architectures.items);
|
|
173
|
+
if (segmentOffset === undefined)
|
|
174
|
+
return locations;
|
|
150
175
|
for (const segment of macho.segments.items) {
|
|
151
176
|
if (segment.file_offset === null || segment.file_size === null)
|
|
152
177
|
continue;
|
|
153
178
|
locations.push({
|
|
154
179
|
kind: "file-offset-range",
|
|
155
|
-
start: segment.file_offset,
|
|
156
|
-
end: segment.file_offset + segment.file_size,
|
|
180
|
+
start: segmentOffset + segment.file_offset,
|
|
181
|
+
end: segmentOffset + segment.file_offset + segment.file_size,
|
|
157
182
|
});
|
|
158
183
|
}
|
|
159
184
|
return locations;
|
|
160
185
|
};
|
|
186
|
+
/** otool segment offsets are slice-relative; evidence addresses the input file. */
|
|
187
|
+
const segmentContainerOffset = (macho, selectedArchitecture, thinInput) => {
|
|
188
|
+
const architectures = macho.architectures.items;
|
|
189
|
+
const slice = selectedArchitecture === null
|
|
190
|
+
? architectures.length === 1
|
|
191
|
+
? architectures[0]
|
|
192
|
+
: undefined
|
|
193
|
+
: architectures.find(({ name }) => name === selectedArchitecture);
|
|
194
|
+
if (slice?.file_offset !== null && slice?.file_offset !== undefined)
|
|
195
|
+
return slice.file_offset;
|
|
196
|
+
// A thin lipo observation has no separate slice offset. Unknown FAT slice
|
|
197
|
+
// offsets must not silently become zero and identify unrelated container bytes.
|
|
198
|
+
return thinInput &&
|
|
199
|
+
selectedArchitecture === null &&
|
|
200
|
+
architectures.length === 1
|
|
201
|
+
? 0
|
|
202
|
+
: undefined;
|
|
203
|
+
};
|
|
161
204
|
/** Project architecture slices into evidence file-offset locations. */
|
|
162
205
|
export const architectureLocations = (architectures) => {
|
|
163
206
|
const locations = [];
|
|
@@ -170,14 +213,32 @@ export const architectureLocations = (architectures) => {
|
|
|
170
213
|
}
|
|
171
214
|
return locations;
|
|
172
215
|
};
|
|
173
|
-
const selectedArchitectureArguments = (tool,
|
|
174
|
-
if (
|
|
175
|
-
target.availableArchitectures.length < 2 ||
|
|
176
|
-
tool === "file" ||
|
|
177
|
-
tool === "lipo")
|
|
216
|
+
const selectedArchitectureArguments = (tool, architecture) => {
|
|
217
|
+
if (architecture === null)
|
|
178
218
|
return [];
|
|
179
|
-
const
|
|
219
|
+
const baseArchitecture = architecture.split(".")[0] ?? architecture;
|
|
220
|
+
// dyld_info distinguishes arm64e ABI variants; the other Apple tools use
|
|
221
|
+
// the base CPU-family spelling for the same slice.
|
|
222
|
+
const toolArchitecture = tool === "dyld_info" ? architecture : baseArchitecture;
|
|
180
223
|
return tool === "dwarfdump"
|
|
181
|
-
? [`--arch=${
|
|
182
|
-
: ["-arch",
|
|
224
|
+
? [`--arch=${toolArchitecture}`]
|
|
225
|
+
: ["-arch", toolArchitecture];
|
|
226
|
+
};
|
|
227
|
+
const selectArchitecture = (target, available) => {
|
|
228
|
+
if (target.kind !== "executable" || target.availableArchitectures.length < 2)
|
|
229
|
+
return null;
|
|
230
|
+
const normalized = target.architecture === "x86" ? "i386" : target.architecture;
|
|
231
|
+
if (available.includes(normalized))
|
|
232
|
+
return normalized;
|
|
233
|
+
// BinaryTarget intentionally normalizes ARM64 CPU subtypes. Recover the
|
|
234
|
+
// concrete arm64e slice name from lipo before invoking slice-aware tools.
|
|
235
|
+
if (normalized === "arm64") {
|
|
236
|
+
const arm64e = available.find((architecture) => architecture === "arm64e");
|
|
237
|
+
if (arm64e !== undefined)
|
|
238
|
+
return arm64e;
|
|
239
|
+
const variant = available.find((architecture) => /^arm64e\.[A-Za-z0-9_]+$/u.test(architecture));
|
|
240
|
+
if (variant !== undefined)
|
|
241
|
+
return variant;
|
|
242
|
+
}
|
|
243
|
+
return normalized;
|
|
183
244
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { mkdtemp, rm } from "node:fs/promises";
|
|
1
|
+
import { mkdtemp, rm, symlink } from "node:fs/promises";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { execFileOutput } from "../process/ExecFileOutput.js";
|
|
6
|
+
import { safeParseJson } from "../domain/safeJson.js";
|
|
7
|
+
import { NATIVE_UI_HELPER_MAX_BUFFER } from "./NativeUiOutputBudget.js";
|
|
6
8
|
/** Lazily compile one owned helper per observation/scenario and remove its compiler cache. */
|
|
7
9
|
export const createNativeUiHelperRuntime = () => {
|
|
8
10
|
let root;
|
|
@@ -11,11 +13,14 @@ export const createNativeUiHelperRuntime = () => {
|
|
|
11
13
|
if (executable === undefined) {
|
|
12
14
|
root = await mkdtemp(join(tmpdir(), "rea-native-ui-"));
|
|
13
15
|
const output = join(root, "observer");
|
|
16
|
+
const main = join(root, "main.swift");
|
|
17
|
+
await symlink(fileURLToPath(new URL("../../bridge/native/ReaNativeUI.swift", import.meta.url)), main);
|
|
14
18
|
await execFileOutput("/usr/bin/xcrun", [
|
|
15
19
|
"swiftc",
|
|
16
20
|
"-module-cache-path",
|
|
17
21
|
join(root, "modules"),
|
|
18
|
-
fileURLToPath(new URL("../../bridge/native/
|
|
22
|
+
fileURLToPath(new URL("../../bridge/native/NativeUIChildren.swift", import.meta.url)),
|
|
23
|
+
main,
|
|
19
24
|
"-o",
|
|
20
25
|
output,
|
|
21
26
|
], {
|
|
@@ -27,10 +32,15 @@ export const createNativeUiHelperRuntime = () => {
|
|
|
27
32
|
}
|
|
28
33
|
const output = await execFileOutput(executable, [JSON.stringify(parameters)], {
|
|
29
34
|
timeout: 30_000,
|
|
30
|
-
maxBuffer:
|
|
35
|
+
maxBuffer: NATIVE_UI_HELPER_MAX_BUFFER,
|
|
31
36
|
...(signal === undefined ? {} : { signal }),
|
|
32
37
|
});
|
|
33
|
-
|
|
38
|
+
const parsed = safeParseJson(output.stdout);
|
|
39
|
+
if (!parsed.ok)
|
|
40
|
+
throw new Error(`Native helper returned invalid JSON: ${parsed.error}`, {
|
|
41
|
+
cause: parsed.cause,
|
|
42
|
+
});
|
|
43
|
+
return parsed.value;
|
|
34
44
|
};
|
|
35
45
|
return {
|
|
36
46
|
invoke,
|