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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { createAnalysisProfile } from "../domain/analysisProfile.js";
|
|
2
|
+
import { err, ok } from "../domain/result.js";
|
|
3
|
+
import { AnalysisCancelledError } from "../domain/analysisErrorCore.js";
|
|
4
|
+
import { ConfigurationError } from "../domain/configurationErrors.js";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import canonicalize from "canonicalize";
|
|
7
|
+
import { readIdaConfiguration, } from "./IdaConfiguration.js";
|
|
8
|
+
import { createIdaMcpConnection, } from "./IdaMcpConnection.js";
|
|
9
|
+
import { idaCapabilities, IDA_PROVIDER_IDENTITY, } from "./IdaProviderCapabilities.js";
|
|
10
|
+
import { IdaSessionClient } from "./IdaSessionClient.js";
|
|
11
|
+
import { privateRuntimeRootCapability } from "../process/PrivateRuntimeRoot.js";
|
|
12
|
+
export { IDA_PROVIDER_IDENTITY } from "./IdaProviderCapabilities.js";
|
|
13
|
+
/** Bring-your-own IDA MCP candidate; discovery performs no provider startup. */
|
|
14
|
+
export class IdaProvider {
|
|
15
|
+
config;
|
|
16
|
+
connectionFactory;
|
|
17
|
+
#registration;
|
|
18
|
+
constructor(config, connectionFactory = createIdaMcpConnection) {
|
|
19
|
+
this.config = config;
|
|
20
|
+
this.connectionFactory = connectionFactory;
|
|
21
|
+
}
|
|
22
|
+
identity() {
|
|
23
|
+
return IDA_PROVIDER_IDENTITY;
|
|
24
|
+
}
|
|
25
|
+
capabilities() {
|
|
26
|
+
const config = this.#configuration();
|
|
27
|
+
return idaCapabilities(config.ok ? config.value.mode : "attached", config.ok && "command" in config.value);
|
|
28
|
+
}
|
|
29
|
+
inspectAvailability() {
|
|
30
|
+
const config = this.#configuration();
|
|
31
|
+
if (config.ok && config.value.mode === "headless") {
|
|
32
|
+
const privacy = privateRuntimeRootCapability();
|
|
33
|
+
if (!privacy.available)
|
|
34
|
+
return {
|
|
35
|
+
status: "unavailable",
|
|
36
|
+
code: "unsupported_host",
|
|
37
|
+
reason: privacy.reason,
|
|
38
|
+
diagnostics: {
|
|
39
|
+
configured: true,
|
|
40
|
+
mode: "headless",
|
|
41
|
+
live_connection_probed: false,
|
|
42
|
+
private_workspace_available: false,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return config.ok
|
|
47
|
+
? {
|
|
48
|
+
status: "available",
|
|
49
|
+
code: null,
|
|
50
|
+
reason: null,
|
|
51
|
+
diagnostics: {
|
|
52
|
+
configured: true,
|
|
53
|
+
mode: config.value.mode,
|
|
54
|
+
transport: "command" in config.value ? "stdio" : "http",
|
|
55
|
+
live_connection_probed: false,
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
: {
|
|
59
|
+
status: "unavailable",
|
|
60
|
+
code: this.config.idaMcpConfigPath === undefined
|
|
61
|
+
? "not_configured"
|
|
62
|
+
: "open_options_invalid",
|
|
63
|
+
reason: config.error.message,
|
|
64
|
+
diagnostics: { configured: false, live_connection_probed: false },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
inspectTargetSupport(target) {
|
|
68
|
+
const diagnostics = {
|
|
69
|
+
target_kind: target.kind,
|
|
70
|
+
target_format: target.format,
|
|
71
|
+
};
|
|
72
|
+
return target.kind === "executable"
|
|
73
|
+
? { status: "supported", code: null, reason: null, diagnostics }
|
|
74
|
+
: {
|
|
75
|
+
status: "unsupported",
|
|
76
|
+
code: "target_kind_unsupported",
|
|
77
|
+
reason: "IDA MCP integration admits executable inputs, not analysis databases. Select the original input binary.",
|
|
78
|
+
diagnostics,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
async resolveAnalysisProfile(_target, options) {
|
|
82
|
+
if (options?.signal?.aborted === true)
|
|
83
|
+
return err(new AnalysisCancelledError("ida:profile"));
|
|
84
|
+
const config = this.#configuration();
|
|
85
|
+
if (!config.ok)
|
|
86
|
+
return config;
|
|
87
|
+
return ok({
|
|
88
|
+
profile: createAnalysisProfile(IDA_PROVIDER_IDENTITY, {
|
|
89
|
+
version_scope: "rea-ida-adapter",
|
|
90
|
+
engine_version: null,
|
|
91
|
+
upstream_distribution_version: null,
|
|
92
|
+
mode: config.value.mode,
|
|
93
|
+
compatibility_profile: config.value.mode === "attached"
|
|
94
|
+
? "legacy-1.4"
|
|
95
|
+
: "database-supervisor",
|
|
96
|
+
database_revision: null,
|
|
97
|
+
cache_policy: "live",
|
|
98
|
+
registration_digest: createHash("sha256")
|
|
99
|
+
.update(canonicalize(config.value) ?? "")
|
|
100
|
+
.digest("hex"),
|
|
101
|
+
}),
|
|
102
|
+
compatibility: {
|
|
103
|
+
mode: config.value.mode,
|
|
104
|
+
engine_version: null,
|
|
105
|
+
upstream_distribution_version: null,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
createClient(target, profile) {
|
|
110
|
+
const config = this.#configuration();
|
|
111
|
+
if (!config.ok)
|
|
112
|
+
return {
|
|
113
|
+
execute: async () => err(config.error),
|
|
114
|
+
close: async () => undefined,
|
|
115
|
+
};
|
|
116
|
+
return new IdaSessionClient(config.value, target, this.connectionFactory(config.value), profile);
|
|
117
|
+
}
|
|
118
|
+
#configuration() {
|
|
119
|
+
this.#registration ??=
|
|
120
|
+
this.config.idaMcpConfigPath === undefined
|
|
121
|
+
? readIdaConfigurationNotConfigured()
|
|
122
|
+
: readIdaConfiguration(this.config.idaMcpConfigPath);
|
|
123
|
+
return this.#registration;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const readIdaConfigurationNotConfigured = () => err(new ConfigurationError("Set REA_IDA_MCP_CONFIG to an upstream IDA MCP JSON registration; see docs/ida-provider.md."));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** This version identifies REA's adapter, not IDA or the upstream Python package. */
|
|
2
|
+
export const IDA_PROVIDER_IDENTITY = Object.freeze({
|
|
3
|
+
id: "ida",
|
|
4
|
+
name: "IDA Pro MCP adapter",
|
|
5
|
+
version: "1",
|
|
6
|
+
});
|
|
7
|
+
/** Read-only analyst outcomes supported by both upstream compatibility profiles. */
|
|
8
|
+
export const IDA_OPERATIONS = Object.freeze([
|
|
9
|
+
"list_procedures",
|
|
10
|
+
"search_procedures",
|
|
11
|
+
"list_strings",
|
|
12
|
+
"search_strings",
|
|
13
|
+
"procedure_address",
|
|
14
|
+
"procedure_pseudo_code",
|
|
15
|
+
"procedure_assembly",
|
|
16
|
+
"procedure_callers",
|
|
17
|
+
"procedure_callees",
|
|
18
|
+
"read_function_instructions",
|
|
19
|
+
"xrefs",
|
|
20
|
+
"analyze_function",
|
|
21
|
+
]);
|
|
22
|
+
/** Shared limitations of observations from an externally mutable analysis database. */
|
|
23
|
+
export const IDA_LIMITATIONS = Object.freeze([
|
|
24
|
+
"Provider version identifies the REA IDA adapter. IDA engine and upstream distribution versions are unknown unless separately observed; MCP serverInfo is reported independently.",
|
|
25
|
+
"Results describe the current IDA analysis database. Input identity does not prove an unmodified database; patches, annotations, analysis completeness, and database revision remain unknown.",
|
|
26
|
+
"Live results are never replayed from analysis snapshots. Target checks before and after a request do not provide an atomic lock against external GUI changes.",
|
|
27
|
+
"Caller cancellation drains the in-flight MCP request before cleanup; it does not prove that IDA engine work was interrupted.",
|
|
28
|
+
"Headless workers are released through the upstream database lifecycle. Abrupt termination of REA, its proxy, or the supervisor cannot prove worker cleanup; inspect upstream inventory after an interrupted process.",
|
|
29
|
+
"Complete function body ranges, typed references, unresolved indirect calls, referenced data, and basic blocks are unavailable in this adapter. Empty unsupported dossier facets are unknown, not observed absence.",
|
|
30
|
+
]);
|
|
31
|
+
/** Advertise live observations and configured lifecycle effects truthfully. */
|
|
32
|
+
export const idaCapabilities = (mode, stdio) => IDA_OPERATIONS.map((operation) => ({
|
|
33
|
+
provider: IDA_PROVIDER_IDENTITY,
|
|
34
|
+
operation,
|
|
35
|
+
...(mode === "headless" && operation === "procedure_callers"
|
|
36
|
+
? {
|
|
37
|
+
available: false,
|
|
38
|
+
reason: "The modern upstream profile reports code references without proving direct call edges.",
|
|
39
|
+
}
|
|
40
|
+
: { available: true, reason: null }),
|
|
41
|
+
cachePolicy: "live",
|
|
42
|
+
effects: {
|
|
43
|
+
mutatesArtifact: false,
|
|
44
|
+
launchesProcess: stdio || mode === "headless",
|
|
45
|
+
mayShowUi: false,
|
|
46
|
+
mayAccessNetwork: true,
|
|
47
|
+
mayWriteFilesystem: stdio || mode === "headless",
|
|
48
|
+
changesPermissions: false,
|
|
49
|
+
requiresRoot: false,
|
|
50
|
+
},
|
|
51
|
+
limitations: IDA_LIMITATIONS,
|
|
52
|
+
}));
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createAnalysisExecution, } from "../application/AnalysisProvider.js";
|
|
3
|
+
import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisProtocolError, AnalysisOutputError, AnalysisInputError, } from "../domain/analysisErrorCore.js";
|
|
4
|
+
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
|
5
|
+
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
|
|
6
|
+
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
7
|
+
import { err, ok } from "../domain/result.js";
|
|
8
|
+
import { IdaOperationRunner } from "./IdaOperationRunner.js";
|
|
9
|
+
import { IDA_LIMITATIONS, IDA_OPERATIONS, IDA_PROVIDER_IDENTITY, } from "./IdaProviderCapabilities.js";
|
|
10
|
+
import { closeDatabaseSchema, databaseListSchema, legacyMetadataSchema, modernHealthSchema, openDatabaseSchema, } from "./IdaProtocolValues.js";
|
|
11
|
+
import { idaFileDigest, IdaWorkspace, sameIdaHostPath, } from "./IdaWorkspace.js";
|
|
12
|
+
import { parseIdaInput } from "./IdaInput.js";
|
|
13
|
+
const legacyTools = [
|
|
14
|
+
"get_metadata",
|
|
15
|
+
"list_functions",
|
|
16
|
+
"list_strings",
|
|
17
|
+
"get_function_by_name",
|
|
18
|
+
"get_function_by_address",
|
|
19
|
+
"decompile_function",
|
|
20
|
+
"disassemble_function",
|
|
21
|
+
"get_callers",
|
|
22
|
+
"get_callees",
|
|
23
|
+
"get_xrefs_to",
|
|
24
|
+
];
|
|
25
|
+
const modernTools = [
|
|
26
|
+
"idb_open",
|
|
27
|
+
"idb_list",
|
|
28
|
+
"idb_close",
|
|
29
|
+
"server_health",
|
|
30
|
+
"list_funcs",
|
|
31
|
+
"lookup_funcs",
|
|
32
|
+
"find_regex",
|
|
33
|
+
"decompile",
|
|
34
|
+
"disasm",
|
|
35
|
+
"callees",
|
|
36
|
+
"xrefs_to",
|
|
37
|
+
];
|
|
38
|
+
const operationSet = new Set(IDA_OPERATIONS);
|
|
39
|
+
const isIdaOperation = (operation) => operationSet.has(operation);
|
|
40
|
+
const wasCancelled = (options) => options?.signal?.aborted === true;
|
|
41
|
+
/** A failed cleanup retains its private workspace and reports the remaining resource. */
|
|
42
|
+
class IdaCleanupError extends ProviderAdapterError {
|
|
43
|
+
cleanupIncomplete = true;
|
|
44
|
+
cleanupResources;
|
|
45
|
+
constructor(path, cause) {
|
|
46
|
+
super("ida", "close", {
|
|
47
|
+
cause,
|
|
48
|
+
diagnostics: {
|
|
49
|
+
reason: "IDA worker release could not be verified. The private workspace was retained.",
|
|
50
|
+
workspace: path,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
this.cleanupResources = [path];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Serial read-only session whose lifecycle authority excludes an attached GUI. */
|
|
57
|
+
export class IdaSessionClient {
|
|
58
|
+
config;
|
|
59
|
+
target;
|
|
60
|
+
connection;
|
|
61
|
+
profile;
|
|
62
|
+
#tail = Promise.resolve();
|
|
63
|
+
#startup;
|
|
64
|
+
#closed = false;
|
|
65
|
+
#closing = false;
|
|
66
|
+
#closePromise;
|
|
67
|
+
#workspace;
|
|
68
|
+
#database;
|
|
69
|
+
#openAttempted = false;
|
|
70
|
+
#openCompleted = false;
|
|
71
|
+
#initialIdentity;
|
|
72
|
+
#metadata = null;
|
|
73
|
+
#lifecycle = [];
|
|
74
|
+
constructor(config, target, connection, profile) {
|
|
75
|
+
this.config = config;
|
|
76
|
+
this.target = target;
|
|
77
|
+
this.connection = connection;
|
|
78
|
+
this.profile = profile;
|
|
79
|
+
}
|
|
80
|
+
execute(operation, parameters, options) {
|
|
81
|
+
const call = this.#tail.then(() => this.#execute(operation, parameters, options));
|
|
82
|
+
this.#tail = call.then(() => undefined, () => undefined);
|
|
83
|
+
return call;
|
|
84
|
+
}
|
|
85
|
+
async #execute(operation, parameters, options) {
|
|
86
|
+
if (this.#closed || this.#closing)
|
|
87
|
+
return err(new AnalysisProtocolError("IDA session is closing or closed; reopen the target."));
|
|
88
|
+
if (wasCancelled(options))
|
|
89
|
+
return err(new AnalysisCancelledError(operation));
|
|
90
|
+
if (operation !== "health" && !isIdaOperation(operation))
|
|
91
|
+
return err(new AnalysisCapabilityUnavailableError("ida", operation, "This integration admits read-only analysis operations only."));
|
|
92
|
+
if (operation === "procedure_callers" && this.config.mode === "headless")
|
|
93
|
+
return err(new AnalysisCapabilityUnavailableError("ida", operation, "The modern upstream profile does not prove direct callers."));
|
|
94
|
+
if (operation !== "health") {
|
|
95
|
+
const parsed = parseIdaInput(operation, parameters);
|
|
96
|
+
if (!parsed.ok)
|
|
97
|
+
return parsed;
|
|
98
|
+
parameters = parsed.value;
|
|
99
|
+
}
|
|
100
|
+
const document = parameters.document;
|
|
101
|
+
if (document !== undefined &&
|
|
102
|
+
document !== this.target.path &&
|
|
103
|
+
document !== this.target.sourcePath)
|
|
104
|
+
return err(new AnalysisInputError(operation, undefined, [
|
|
105
|
+
{
|
|
106
|
+
path: ["document"],
|
|
107
|
+
reason: "invalid_value",
|
|
108
|
+
expected: this.target.path,
|
|
109
|
+
message: "IDA document must be the REA-bound target; omit document or use its admitted path.",
|
|
110
|
+
},
|
|
111
|
+
]));
|
|
112
|
+
try {
|
|
113
|
+
await this.#start();
|
|
114
|
+
const before = await this.#observe();
|
|
115
|
+
if (wasCancelled(options))
|
|
116
|
+
return err(new AnalysisCancelledError(operation));
|
|
117
|
+
if (operation === "health")
|
|
118
|
+
return this.#health(before);
|
|
119
|
+
if (!isIdaOperation(operation))
|
|
120
|
+
throw new AnalysisProtocolError("IDA operation changed after validation.");
|
|
121
|
+
const runner = new IdaOperationRunner(this.connection, this.config.mode === "attached" ? "legacy" : "modern", this.#database);
|
|
122
|
+
const result = await runner.run(operation, parameters);
|
|
123
|
+
const after = await this.#observe();
|
|
124
|
+
if (wasCancelled(options))
|
|
125
|
+
return err(new AnalysisCancelledError(operation));
|
|
126
|
+
return ok(createAnalysisExecution(result, IDA_PROVIDER_IDENTITY, {
|
|
127
|
+
rawResult: {
|
|
128
|
+
upstream: this.connection.serverInfo(),
|
|
129
|
+
metadata_before: before,
|
|
130
|
+
metadata_after: after,
|
|
131
|
+
observations: jsonValueSchema.parse(runner.raw),
|
|
132
|
+
},
|
|
133
|
+
limitations: [...IDA_LIMITATIONS, ...runner.limitations],
|
|
134
|
+
locations: [
|
|
135
|
+
{ kind: "artifact-path", path: this.target.path },
|
|
136
|
+
...runner.locations,
|
|
137
|
+
],
|
|
138
|
+
...(this.profile === undefined
|
|
139
|
+
? {}
|
|
140
|
+
: { analysisProfile: this.profile }),
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
catch (cause) {
|
|
144
|
+
return this.#failure(operation, cause, options);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
#health(metadata) {
|
|
148
|
+
return ok(createAnalysisExecution({
|
|
149
|
+
ready: true,
|
|
150
|
+
mode: this.config.mode,
|
|
151
|
+
database: this.#database ?? null,
|
|
152
|
+
upstream: this.connection.serverInfo(),
|
|
153
|
+
metadata,
|
|
154
|
+
lifecycle: this.#lifecycle,
|
|
155
|
+
}, IDA_PROVIDER_IDENTITY, {
|
|
156
|
+
limitations: IDA_LIMITATIONS,
|
|
157
|
+
...(this.profile === undefined
|
|
158
|
+
? {}
|
|
159
|
+
: { analysisProfile: this.profile }),
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
#failure(operation, cause, options) {
|
|
163
|
+
if (wasCancelled(options))
|
|
164
|
+
return err(new AnalysisCancelledError(operation));
|
|
165
|
+
if (cause instanceof AnalysisError)
|
|
166
|
+
return err(cause);
|
|
167
|
+
if (cause instanceof z.ZodError)
|
|
168
|
+
return err(new AnalysisOutputError(operation, `IDA MCP returned malformed or unsupported producer data: ${cause.issues.map((issue) => `${issue.path.join(".") || "$"}: ${issue.message}`).join("; ")}`, { cause }));
|
|
169
|
+
return err(new ProviderAdapterError("ida", operation, {
|
|
170
|
+
cause,
|
|
171
|
+
diagnostics: {
|
|
172
|
+
reason: cause instanceof Error ? cause.message : "Unknown upstream failure",
|
|
173
|
+
recovery: "Check the configured upstream MCP registration and selected target; see docs/ida-provider.md.",
|
|
174
|
+
},
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
#start() {
|
|
178
|
+
this.#startup ??= this.#initialize();
|
|
179
|
+
return this.#startup;
|
|
180
|
+
}
|
|
181
|
+
async #initialize() {
|
|
182
|
+
const tools = new Set(await this.connection.connect());
|
|
183
|
+
const expected = this.config.mode === "attached" ? legacyTools : modernTools;
|
|
184
|
+
const missing = expected.filter((name) => !tools.has(name));
|
|
185
|
+
if (missing.length > 0)
|
|
186
|
+
throw new AnalysisProtocolError(`IDA MCP ${this.config.mode} compatibility profile is missing tools: ${missing.join(", ")}. Attached mode requires the legacy 1.4 profile; headless mode requires the database supervisor profile. See docs/ida-provider.md.`);
|
|
187
|
+
if (this.config.mode === "headless") {
|
|
188
|
+
this.#workspace = await IdaWorkspace.create(this.target, this.config.workspaceRoot);
|
|
189
|
+
this.#openAttempted = true;
|
|
190
|
+
const raw = await this.connection.call("idb_open", {
|
|
191
|
+
input_path: this.#workspace.inputPath,
|
|
192
|
+
mode: "force_headless",
|
|
193
|
+
run_auto_analysis: true,
|
|
194
|
+
build_caches: true,
|
|
195
|
+
init_hexrays: true,
|
|
196
|
+
preferred_session_id: this.#workspace.sessionId,
|
|
197
|
+
});
|
|
198
|
+
this.#openCompleted = true;
|
|
199
|
+
this.#lifecycle.push(raw);
|
|
200
|
+
const opened = openDatabaseSchema.parse(raw);
|
|
201
|
+
if (!sameIdaHostPath(opened.session.input_path, this.#workspace.inputPath))
|
|
202
|
+
throw new AnalysisProtocolError("IDA opened a different input than the private admitted target copy.");
|
|
203
|
+
if (opened.session.session_id !== this.#workspace.sessionId)
|
|
204
|
+
throw new AnalysisProtocolError("IDA returned an adopted or unexpected session instead of the requested private worker.");
|
|
205
|
+
const inventory = databaseListSchema.parse(await this.connection.call("idb_list", {}));
|
|
206
|
+
this.#lifecycle.push(jsonValueSchema.parse(inventory));
|
|
207
|
+
const entry = inventory.sessions.find(({ session_id }) => session_id === opened.session.session_id);
|
|
208
|
+
if (entry?.owned !== true ||
|
|
209
|
+
entry.backend !== "worker" ||
|
|
210
|
+
entry.is_active !== true ||
|
|
211
|
+
!sameIdaHostPath(entry.input_path, this.#workspace.inputPath))
|
|
212
|
+
throw new AnalysisProtocolError("IDA did not return an active owned headless worker for the private input copy.");
|
|
213
|
+
this.#database = opened.session.session_id;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
async #observe() {
|
|
217
|
+
let identity;
|
|
218
|
+
if (this.config.mode === "attached") {
|
|
219
|
+
const raw = await this.connection.call("get_metadata", {});
|
|
220
|
+
const metadata = legacyMetadataSchema.parse(raw);
|
|
221
|
+
if (metadata.sha256.toLowerCase() !== this.target.sha256.toLowerCase())
|
|
222
|
+
throw new AnalysisProtocolError(`The attached IDA input SHA-256 does not match the selected target ${this.target.path}; open that target in IDA or use headless mode.`);
|
|
223
|
+
identity = JSON.stringify([
|
|
224
|
+
metadata.path,
|
|
225
|
+
metadata.sha256.toLowerCase(),
|
|
226
|
+
metadata.base,
|
|
227
|
+
]);
|
|
228
|
+
this.#metadata = raw;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
if (this.#database === undefined || this.#workspace === undefined)
|
|
232
|
+
throw new AnalysisProtocolError("IDA headless session has no database binding.");
|
|
233
|
+
const raw = await this.connection.call("server_health", {
|
|
234
|
+
database: this.#database,
|
|
235
|
+
});
|
|
236
|
+
const metadata = modernHealthSchema.parse(raw);
|
|
237
|
+
if (!sameIdaHostPath(metadata.input_path, this.#workspace.inputPath) ||
|
|
238
|
+
(await idaFileDigest(this.#workspace.inputPath)) !== this.target.sha256)
|
|
239
|
+
throw new AnalysisProtocolError("IDA headless input identity changed after target admission.");
|
|
240
|
+
if (metadata.auto_analysis_ready !== true)
|
|
241
|
+
throw new AnalysisProtocolError("IDA auto-analysis is incomplete or readiness is unknown; retry after analysis completes.");
|
|
242
|
+
identity = JSON.stringify([
|
|
243
|
+
this.#database,
|
|
244
|
+
metadata.input_path,
|
|
245
|
+
metadata.idb_path,
|
|
246
|
+
metadata.imagebase,
|
|
247
|
+
]);
|
|
248
|
+
this.#metadata = raw;
|
|
249
|
+
}
|
|
250
|
+
if (this.#initialIdentity !== undefined &&
|
|
251
|
+
identity !== this.#initialIdentity)
|
|
252
|
+
throw new AnalysisProtocolError("The attached IDA target or image base changed during the REA session; reopen the target.");
|
|
253
|
+
this.#initialIdentity = identity;
|
|
254
|
+
return this.#metadata;
|
|
255
|
+
}
|
|
256
|
+
async closeWithOutcome() {
|
|
257
|
+
if (this.#closePromise !== undefined)
|
|
258
|
+
return this.#closePromise;
|
|
259
|
+
const closing = this.#closeOnce();
|
|
260
|
+
const shared = closing.finally(() => {
|
|
261
|
+
if (this.#closePromise === shared)
|
|
262
|
+
this.#closePromise = undefined;
|
|
263
|
+
});
|
|
264
|
+
this.#closePromise = shared;
|
|
265
|
+
return shared;
|
|
266
|
+
}
|
|
267
|
+
async #closeOnce() {
|
|
268
|
+
this.#closing = true;
|
|
269
|
+
await this.#tail;
|
|
270
|
+
if (this.#closed)
|
|
271
|
+
return ok(null);
|
|
272
|
+
try {
|
|
273
|
+
if (this.#workspace !== undefined && this.#openAttempted) {
|
|
274
|
+
if (this.#database === undefined) {
|
|
275
|
+
const inventory = databaseListSchema.parse(await this.connection.call("idb_list", {}));
|
|
276
|
+
const workspace = this.#workspace;
|
|
277
|
+
this.#database = inventory.sessions.find((entry) => entry.owned &&
|
|
278
|
+
entry.backend === "worker" &&
|
|
279
|
+
entry.session_id === workspace.sessionId &&
|
|
280
|
+
sameIdaHostPath(entry.input_path, workspace.inputPath))?.session_id;
|
|
281
|
+
if (this.#database === undefined &&
|
|
282
|
+
inventory.sessions.some((entry) => sameIdaHostPath(entry.input_path, workspace.inputPath)))
|
|
283
|
+
throw new AnalysisProtocolError("An unowned worker still uses the private workspace; it was retained.");
|
|
284
|
+
}
|
|
285
|
+
if (this.#database !== undefined) {
|
|
286
|
+
const closed = closeDatabaseSchema.parse(await this.connection.call("idb_close", {
|
|
287
|
+
database: this.#database,
|
|
288
|
+
save: false,
|
|
289
|
+
}));
|
|
290
|
+
if (closed.session_id !== this.#database ||
|
|
291
|
+
closed.saved === true ||
|
|
292
|
+
closed.owned !== true ||
|
|
293
|
+
closed.backend !== "worker")
|
|
294
|
+
throw new AnalysisProtocolError("IDA database close did not confirm the requested owned, unsaved session release.");
|
|
295
|
+
const inventory = databaseListSchema.parse(await this.connection.call("idb_list", {}));
|
|
296
|
+
if (inventory.sessions.some((entry) => entry.session_id === this.#database ||
|
|
297
|
+
sameIdaHostPath(entry.input_path, this.#workspace?.inputPath ?? "")))
|
|
298
|
+
throw new AnalysisProtocolError("IDA worker remains registered after close.");
|
|
299
|
+
}
|
|
300
|
+
if (!this.#openCompleted)
|
|
301
|
+
throw new AnalysisProtocolError("IDA database open did not return a completed response. Worker inventory cannot prove that the request has stopped; the private workspace was retained.");
|
|
302
|
+
}
|
|
303
|
+
await this.connection.close();
|
|
304
|
+
await this.#workspace?.remove();
|
|
305
|
+
this.#closed = true;
|
|
306
|
+
return ok(null);
|
|
307
|
+
}
|
|
308
|
+
catch (cause) {
|
|
309
|
+
await this.connection.close().catch(() => undefined);
|
|
310
|
+
return err(new IdaCleanupError(this.#workspace?.directory ?? "IDA MCP connection", cause));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
async close() {
|
|
314
|
+
const result = await this.closeWithOutcome();
|
|
315
|
+
if (!result.ok)
|
|
316
|
+
throw result.error;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { createReadStream, constants } from "node:fs";
|
|
3
|
+
import { copyFile } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { basename, join, normalize } from "node:path";
|
|
6
|
+
import { AnalysisProtocolError } from "../domain/analysisErrorCore.js";
|
|
7
|
+
import { PrivateRuntimeRoot } from "../process/PrivateRuntimeRoot.js";
|
|
8
|
+
/** Read a file digest with bounded memory rather than retaining binary bytes. */
|
|
9
|
+
export const idaFileDigest = async (path) => {
|
|
10
|
+
const hash = createHash("sha256");
|
|
11
|
+
for await (const chunk of createReadStream(path))
|
|
12
|
+
hash.update(chunk);
|
|
13
|
+
return hash.digest("hex");
|
|
14
|
+
};
|
|
15
|
+
/** Compare host-local paths without confusing Windows paths with POSIX coordinates. */
|
|
16
|
+
export const sameIdaHostPath = (left, right) => process.platform === "win32"
|
|
17
|
+
? normalize(left).toLowerCase() === normalize(right).toLowerCase()
|
|
18
|
+
: normalize(left) === normalize(right);
|
|
19
|
+
/** Private input copy isolates upstream database and sidecar writes from the original. */
|
|
20
|
+
export class IdaWorkspace {
|
|
21
|
+
runtime;
|
|
22
|
+
inputPath;
|
|
23
|
+
sessionId = `rea-${randomUUID()}`;
|
|
24
|
+
constructor(runtime, inputPath) {
|
|
25
|
+
this.runtime = runtime;
|
|
26
|
+
this.inputPath = inputPath;
|
|
27
|
+
}
|
|
28
|
+
/** Filesystem root owned exclusively by this headless session. */
|
|
29
|
+
get directory() {
|
|
30
|
+
return this.runtime.path;
|
|
31
|
+
}
|
|
32
|
+
/** Allocate a protected workspace and copy the admitted input with digest verification. */
|
|
33
|
+
static async create(target, root = tmpdir()) {
|
|
34
|
+
const runtime = await PrivateRuntimeRoot.create({
|
|
35
|
+
parent: normalize(root),
|
|
36
|
+
prefix: "rea-ida-",
|
|
37
|
+
});
|
|
38
|
+
const inputPath = join(runtime.path, basename(target.path));
|
|
39
|
+
try {
|
|
40
|
+
await copyFile(target.path, inputPath, constants.COPYFILE_EXCL);
|
|
41
|
+
if ((await idaFileDigest(inputPath)) !== target.sha256)
|
|
42
|
+
throw new AnalysisProtocolError("IDA target changed between admission and the private input copy; reopen the target.");
|
|
43
|
+
return new IdaWorkspace(runtime, inputPath);
|
|
44
|
+
}
|
|
45
|
+
catch (cause) {
|
|
46
|
+
await runtime.close();
|
|
47
|
+
throw cause;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** Delete only this object's privately allocated directory after worker cleanup. */
|
|
51
|
+
async remove() {
|
|
52
|
+
await this.runtime.close();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
2
|
import { browserOriginSchema, sanitizeBrowserUrl, } from "../domain/browserObservation.js";
|
|
3
|
-
import { authorizedElectronFile } from "
|
|
3
|
+
import { authorizedElectronFile } from "../browser/ElectronFileScope.js";
|
|
4
|
+
/**
|
|
5
|
+
* Wire bucket for inspector script exclusions. The V8 observation schemas
|
|
6
|
+
* fix the `unsupported_location` key, so every canonical denial reason maps
|
|
7
|
+
* onto it; the reason itself stays available on the decision for logs and
|
|
8
|
+
* limitations text.
|
|
9
|
+
*/
|
|
10
|
+
export const inspectorExclusionKey = (reason) => {
|
|
11
|
+
// Every canonical denial collapses onto the fixed V8 wire bucket.
|
|
12
|
+
void reason;
|
|
13
|
+
return "unsupported_location";
|
|
14
|
+
};
|
|
4
15
|
/** Resolve a protocol location exposed by the explicitly selected Inspector endpoint. */
|
|
5
16
|
export const authorizeRuntimeLocation = async (value) => {
|
|
6
17
|
if (value.startsWith("node:") && value.length > 0)
|
|
@@ -11,21 +22,23 @@ export const authorizeRuntimeLocation = async (value) => {
|
|
|
11
22
|
if (value.startsWith("file:")) {
|
|
12
23
|
const filePath = await authorizedElectronFile(value);
|
|
13
24
|
return filePath === undefined
|
|
14
|
-
? { allowed: false, reason: "
|
|
25
|
+
? { allowed: false, reason: "not_approved" }
|
|
15
26
|
: { allowed: true, location: { kind: "file", file_path: filePath } };
|
|
16
27
|
}
|
|
17
28
|
let url;
|
|
18
29
|
try {
|
|
19
30
|
url = new URL(value);
|
|
20
31
|
}
|
|
21
|
-
catch {
|
|
22
|
-
|
|
32
|
+
catch (cause) {
|
|
33
|
+
// Non-URL input is outside the authorized runtime scope.
|
|
34
|
+
void cause;
|
|
35
|
+
return { allowed: false, reason: "unsupported_url" };
|
|
23
36
|
}
|
|
24
37
|
if (!["http:", "https:"].includes(url.protocol))
|
|
25
|
-
return { allowed: false, reason: "
|
|
38
|
+
return { allowed: false, reason: "unsupported_url" };
|
|
26
39
|
const parsedOrigin = browserOriginSchema.safeParse(url.origin);
|
|
27
40
|
if (!parsedOrigin.success)
|
|
28
|
-
return { allowed: false, reason: "
|
|
41
|
+
return { allowed: false, reason: "unsupported_url" };
|
|
29
42
|
return {
|
|
30
43
|
allowed: true,
|
|
31
44
|
location: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { authorizeRuntimeLocation } from "./JavaScriptRuntimeScope.js";
|
|
2
|
+
import { authorizeRuntimeLocation, inspectorExclusionKey, } from "./JavaScriptRuntimeScope.js";
|
|
3
3
|
/** Empty durable-location exclusion counters. */
|
|
4
4
|
export const createInspectorExclusionCounts = () => ({
|
|
5
5
|
unsupported_location: 0,
|
|
@@ -13,18 +13,56 @@ export const describeInspectorTargetLimitations = () => [
|
|
|
13
13
|
"Every target exposed by the selected Inspector endpoint is eligible for observation; target IDs and locations are not authenticated as operating-system process identity.",
|
|
14
14
|
"No runtime graph depth is traversed because passive Inspector events do not establish require/import caller edges.",
|
|
15
15
|
];
|
|
16
|
+
const LOCATION_AUTHORIZATION_WORKERS = 8;
|
|
16
17
|
/** Canonically authorize, deduplicate, and sort one bounded raw capture. */
|
|
17
|
-
export const finalizeInspectorCapture = async ({ input, runtime, target, state, }) => {
|
|
18
|
+
export const finalizeInspectorCapture = async ({ input, runtime, target, state, authorizeLocation = authorizeRuntimeLocation, }) => {
|
|
18
19
|
const exclusions = createInspectorExclusionCounts();
|
|
19
20
|
const scripts = new Map();
|
|
21
|
+
const draftsByUrl = new Map();
|
|
20
22
|
for (const draft of state.scripts) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const drafts = draftsByUrl.get(draft.rawUrl) ?? [];
|
|
24
|
+
drafts.push(draft);
|
|
25
|
+
draftsByUrl.set(draft.rawUrl, drafts);
|
|
26
|
+
}
|
|
27
|
+
const groups = [...draftsByUrl];
|
|
28
|
+
const authorizedGroups = new Array(groups.length);
|
|
29
|
+
let nextGroup = 0;
|
|
30
|
+
let stopScheduling = false;
|
|
31
|
+
const worker = async () => {
|
|
32
|
+
try {
|
|
33
|
+
for (;;) {
|
|
34
|
+
if (stopScheduling)
|
|
35
|
+
return;
|
|
36
|
+
const index = nextGroup;
|
|
37
|
+
nextGroup += 1;
|
|
38
|
+
const group = groups[index];
|
|
39
|
+
if (group === undefined)
|
|
40
|
+
return;
|
|
41
|
+
const [rawUrl, drafts] = group;
|
|
42
|
+
authorizedGroups[index] = {
|
|
43
|
+
drafts,
|
|
44
|
+
decision: await authorizeLocation(rawUrl),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (cause) {
|
|
49
|
+
stopScheduling = true;
|
|
50
|
+
throw cause;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const workerResults = await Promise.allSettled(Array.from({ length: Math.min(LOCATION_AUTHORIZATION_WORKERS, groups.length) }, worker));
|
|
54
|
+
const failedWorker = workerResults.find((result) => result.status === "rejected");
|
|
55
|
+
if (failedWorker?.status === "rejected")
|
|
56
|
+
throw failedWorker.reason;
|
|
57
|
+
for (const { drafts, decision } of authorizedGroups) {
|
|
58
|
+
for (const draft of drafts) {
|
|
59
|
+
if (!decision.allowed) {
|
|
60
|
+
exclusions[inspectorExclusionKey(decision.reason)] += 1;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const script = scriptFromDraft(draft, decision.location);
|
|
64
|
+
scripts.set(script.script_key, script);
|
|
25
65
|
}
|
|
26
|
-
const script = scriptFromDraft(draft, decision.location);
|
|
27
|
-
scripts.set(script.script_key, script);
|
|
28
66
|
}
|
|
29
67
|
const items = [...scripts.values()].sort((left, right) => left.script_key < right.script_key
|
|
30
68
|
? -1
|