rea-agents 4.1.0 → 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 +184 -86
- package/bridge/android/ReaJadxBridge.java +247 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +30 -16
- package/dist/android/AndroidTargetSnapshot.js +5 -3
- package/dist/android/JadxAnalysis.js +8 -6
- package/dist/android/JadxConfiguration.js +19 -3
- package/dist/android/JadxMcpTransport.js +43 -16
- package/dist/android/JadxProtocol.js +8 -0
- package/dist/android/JadxProvider.js +117 -28
- package/dist/android/JadxRelease.js +8 -0
- package/dist/android/JadxSession.js +32 -18
- package/dist/application/AppBundleExecutable.js +141 -0
- package/dist/application/ArtifactInventory/classify.js +1 -1
- package/dist/application/ArtifactInventory/scanCanonical.js +1 -1
- package/dist/application/ArtifactInventory/scanReader.js +1 -1
- package/dist/application/ArtifactInventory.js +1 -1
- package/dist/application/BinaryTargetResolver.js +9 -64
- package/dist/application/CapabilityInventory.js +61 -3
- package/dist/application/ClientConfigurationDocument.js +72 -12
- package/dist/application/ClientRegistrationStatus.js +7 -8
- package/dist/application/DirectAnalysis.js +12 -14
- package/dist/application/DirectAnalysisStatus.js +4 -5
- package/dist/application/DoctorDiagnostics.js +3 -3
- package/dist/application/EnhancedTools.js +4 -4
- package/dist/application/EvidenceBundleCommands.js +1 -1
- package/dist/application/FilesystemSnapshot.js +20 -5
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/LinuxHopper.js +8 -2
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ProcessCaptureCapability.js +1 -1
- package/dist/application/ProcessCaptureLifecycle.js +2 -2
- package/dist/application/ProcessCli.js +5 -1
- package/dist/application/ProcessHarness.js +20 -9
- package/dist/application/ReconstructionCoverageService.js +2 -6
- package/dist/application/ReconstructionObligationCandidates.js +5 -2
- package/dist/application/ReferenceSourceImport.js +2 -0
- package/dist/application/ReferenceSourceImportEntries.js +20 -3
- package/dist/application/ReferenceSourceImportTypes.js +5 -0
- package/dist/application/Setup.js +10 -2
- package/dist/application/SetupClientConfiguration.js +19 -16
- package/dist/application/SetupHost.js +18 -3
- package/dist/application/SetupPlan.js +1 -1
- package/dist/application/Uninstall.js +23 -17
- package/dist/application/UpdateMaintenance.js +3 -3
- 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/{AndroidAnalysisService.js → android/AndroidAnalysisService.js} +6 -6
- 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} +4 -4
- package/dist/application/{AnalysisProviderRegistry.js → binary/AnalysisProviderRegistry.js} +5 -5
- package/dist/application/{AnalysisSnapshotCache.js → binary/AnalysisSnapshotCache.js} +7 -9
- package/dist/application/{AnalysisSnapshotFiles.js → binary/AnalysisSnapshotFiles.js} +4 -4
- package/dist/application/{BinarySession.js → binary/BinarySession.js} +12 -10
- package/dist/application/{BinarySessionComposition.js → binary/BinarySessionComposition.js} +2 -1
- package/dist/application/{BinarySessionExecution.js → binary/BinarySessionExecution.js} +9 -7
- package/dist/application/{BinarySessionOpen.js → binary/BinarySessionOpen.js} +6 -6
- package/dist/application/{BinarySessionRecords.js → binary/BinarySessionRecords.js} +28 -40
- package/dist/application/{CompositeProvider.js → binary/CompositeProvider.js} +2 -2
- package/dist/application/{LazyAnalysisProvider.js → binary/LazyAnalysisProvider.js} +6 -6
- package/dist/application/{SessionProviderRouter.js → binary/SessionProviderRouter.js} +7 -7
- package/dist/application/{FirmwareAnalysisService.js → firmware/FirmwareAnalysisService.js} +5 -5
- package/dist/application/{EvidenceLedger.js → investigation/EvidenceLedger.js} +44 -7
- 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} +3 -3
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/{ElectronActiveObservationService.js → javascript/ElectronActiveObservationService.js} +3 -3
- 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 -3
- package/dist/application/{JavaScriptApplicationEvidence.js → javascript/JavaScriptApplicationEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationEvidenceGraph.js → javascript/JavaScriptApplicationEvidenceGraph.js} +5 -5
- package/dist/application/{JavaScriptApplicationService.js → javascript/JavaScriptApplicationService.js} +10 -10
- package/dist/application/{JavaScriptApplicationWorkflowEvidence.js → javascript/JavaScriptApplicationWorkflowEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationWorkflowService.js → javascript/JavaScriptApplicationWorkflowService.js} +12 -12
- package/dist/application/{JavaScriptArtifactAnalysis.js → javascript/JavaScriptArtifactAnalysis.js} +8 -24
- 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} +6 -12
- package/dist/application/{JavaScriptArtifactReconstruction.js → javascript/JavaScriptArtifactReconstruction.js} +4 -8
- package/dist/application/{JavaScriptJsonModules.js → javascript/JavaScriptJsonModules.js} +1 -1
- package/dist/application/{JavaScriptModuleRelationships.js → javascript/JavaScriptModuleRelationships.js} +2 -2
- 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 -3
- package/dist/application/{JavaScriptRuntimeReconciliationEvidence.js → javascript/JavaScriptRuntimeReconciliationEvidence.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationService.js → javascript/JavaScriptRuntimeReconciliationService.js} +6 -6
- 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 -6
- package/dist/application/{ManagedApplicationGraphService.js → managed/ManagedApplicationGraphService.js} +7 -7
- package/dist/application/{ManagedMemberComparisonService.js → managed/ManagedMemberComparisonService.js} +10 -10
- package/dist/application/{ManagedNativeVerificationService.js → managed/ManagedNativeVerificationService.js} +7 -7
- package/dist/application/{ManagedReconstructionService.js → managed/ManagedReconstructionService.js} +7 -7
- 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 -7
- 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 +7 -37
- 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 +41 -7
- package/dist/artifacts/NativeDmgArtifactReader.js +161 -9
- 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/apple/NibViewHierarchy.js +150 -0
- package/dist/{application → artifacts/javascript}/JavaScriptArtifactFiles.js +27 -6
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/readStableArtifact.js +52 -0
- package/dist/browser/BrowserScenarioSecrets.js +50 -8
- package/dist/browser/CdpAuthorizedMainFrame.js +4 -4
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +4 -15
- package/dist/browser/CdpCaptureDocuments.js +33 -21
- package/dist/browser/CdpCaptureEventBodyShapes.js +3 -3
- package/dist/browser/CdpCaptureEventHandlers.js +26 -26
- package/dist/browser/CdpCaptureEventHelpers.js +6 -6
- package/dist/browser/CdpCaptureStorage.js +10 -8
- package/dist/browser/CdpCaptureStorageFingerprints.js +24 -22
- package/dist/browser/CdpCaptureValues.js +2 -2
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +51 -11
- package/dist/browser/CdpElectronInspection.js +10 -10
- package/dist/browser/CdpElectronProvider.js +3 -6
- package/dist/browser/CdpElectronScriptEvents.js +6 -6
- package/dist/browser/CdpElectronScripts.js +2 -2
- package/dist/browser/CdpElectronWorkers.js +4 -4
- package/dist/browser/CdpObservationSession.js +18 -23
- package/dist/browser/CdpPageCapture.js +4 -4
- package/dist/browser/CdpPageCaptureScripts.js +2 -2
- package/dist/browser/CdpPageCaptureWorkers.js +9 -9
- package/dist/browser/CdpSafeMetadata.js +48 -10
- package/dist/browser/CdpScreenshot.js +5 -5
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +2 -2
- package/dist/browser/CdpWebMcpDiscovery.js +22 -16
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +7 -6
- package/dist/browser/PlaywrightElectronActiveProvider.js +3 -6
- package/dist/browser/PlaywrightScenarioEvents.js +59 -51
- package/dist/browser/PlaywrightScenarioSession.js +8 -1
- package/dist/browser/WebSourceMapFetcher.js +37 -53
- 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 +13 -3
- package/dist/cli/applicationCommands.js +39 -8
- package/dist/cli/artifactCommands.js +1 -1
- package/dist/cli/browserAdvancedCommands.js +27 -9
- package/dist/cli/coreAnalysisCommands.js +5 -493
- package/dist/cli/coreBinaryCommands.js +211 -0
- package/dist/cli/coreNativeCommands.js +293 -0
- package/dist/cli/electronCommands.js +13 -18
- package/dist/cli/firmwareCommands.js +3 -3
- package/dist/cli/javascriptApplicationAnalysis.js +1 -1
- package/dist/cli/javascriptRecoveryCommands.js +45 -0
- package/dist/cli/managedCommands.js +4 -4
- package/dist/cli/managedProjectGraphCommand.js +1 -1
- package/dist/cli/referenceSourceImportStatus.js +6 -1
- package/dist/cli/utilityCommands.js +47 -23
- 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 +10 -0
- package/dist/cliBrowserContext.js +4 -2
- package/dist/cliBrowserScenarioCommands.js +4 -3
- package/dist/cliCommandNames.js +8 -0
- package/dist/cliJavaScriptRuntimeCommands.js +6 -4
- package/dist/cliJsonInput.js +9 -2
- package/dist/cliOutput.js +37 -11
- 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/parseConfig.js +22 -3
- package/dist/contracts/{androidToolContracts.js → android/androidToolContracts.js} +5 -5
- package/dist/contracts/applicationToolContracts.js +43 -8
- package/dist/contracts/artifactToolContracts.js +2 -2
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/enhancedInputs.js +1 -1
- package/dist/contracts/{firmwareToolContracts.js → firmware/firmwareToolContracts.js} +5 -5
- package/dist/contracts/{applicationWorkflowInputContracts.js → javascript/applicationWorkflowInputContracts.js} +6 -6
- 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 +3 -3
- package/dist/contracts/sessionToolContracts.js +1 -1
- package/dist/contracts/toolContracts.js +13 -7
- package/dist/contracts/toolEffects.js +32 -0
- package/dist/contracts/toolOutputSchemaGroups.js +18 -18
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/domain/analysisErrorCore.js +4 -2
- package/dist/domain/analysisErrorProjection.js +1 -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 -314
- 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/artifactInventoryEvidence.js +12 -2
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +5 -1
- package/dist/domain/artifactPathSyntax.js +26 -0
- package/dist/domain/browserNetworkEvidence.js +82 -0
- package/dist/domain/browserObservationError.js +2 -0
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenarioCapture.js +22 -0
- package/dist/domain/browserScenarioCaptureValues.js +25 -0
- package/dist/domain/browserScenarioDiff.js +6 -3
- package/dist/domain/browserScenarioDiffEvidence.js +35 -1
- package/dist/domain/browserScenarioValues.js +12 -1
- package/dist/domain/browserSession.js +2 -7
- package/dist/domain/bundleComparison.js +2 -1
- package/dist/domain/callPath.js +52 -44
- package/dist/domain/comparisonStatus.js +39 -0
- package/dist/domain/evidenceBundle.js +98 -35
- package/dist/domain/{firmwareAnalysis.js → firmware/firmwareAnalysis.js} +2 -2
- package/dist/domain/functionComparisonNormalization.js +11 -13
- package/dist/domain/hopperValues.js +2 -2
- package/dist/domain/inputIssueProjection.js +17 -2
- package/dist/domain/{electronObservation.js → javascript/electronObservation.js} +5 -11
- package/dist/domain/{electronStaticAnalysisBrowser.js → javascript/electronStaticAnalysisBrowser.js} +4 -3
- package/dist/domain/{electronStaticAnalysisIpc.js → javascript/electronStaticAnalysisIpc.js} +2 -2
- package/dist/domain/{electronStaticAnalysisNative.js → javascript/electronStaticAnalysisNative.js} +12 -13
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/{electronStaticAnalysisValues.js → javascript/electronStaticAnalysisValues.js} +3 -3
- package/dist/domain/{javascriptApplicationAnalysis.js → javascript/javascriptApplicationAnalysis.js} +2 -2
- package/dist/domain/{javascriptApplicationChangeGraph.js → javascript/javascriptApplicationChangeGraph.js} +1 -1
- package/dist/domain/{javascriptApplicationEvidenceSchemas.js → javascript/javascriptApplicationEvidenceSchemas.js} +6 -4
- package/dist/domain/{javascriptApplicationGraph.js → javascript/javascriptApplicationGraph.js} +2 -2
- package/dist/domain/{javascriptApplicationGraphSchemas.js → javascript/javascriptApplicationGraphSchemas.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparison.js → javascript/javascriptApplicationVersionComparison.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparisonSchemas.js → javascript/javascriptApplicationVersionComparisonSchemas.js} +3 -3
- package/dist/domain/{javascriptApplicationVersionItems.js → javascript/javascriptApplicationVersionItems.js} +2 -2
- 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 -1
- 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} +1 -1
- package/dist/domain/{javascriptFeatureSeed.js → javascript/javascriptFeatureSeed.js} +4 -3
- package/dist/domain/{javascriptFeatureTrace.js → javascript/javascriptFeatureTrace.js} +2 -2
- package/dist/domain/{javascriptFeatureTraceSchemas.js → javascript/javascriptFeatureTraceSchemas.js} +32 -18
- package/dist/domain/{javascriptFeatureTraversal.js → javascript/javascriptFeatureTraversal.js} +6 -2
- package/dist/domain/{javascriptNativeHandoff.js → javascript/javascriptNativeHandoff.js} +1 -1
- package/dist/domain/javascript/javascriptRecovery.js +88 -0
- package/dist/domain/{javascriptRuntimeLoadState.js → javascript/javascriptRuntimeLoadState.js} +1 -1
- package/dist/domain/{javascriptRuntimeObservation.js → javascript/javascriptRuntimeObservation.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationActive.js → javascript/javascriptRuntimeReconciliationActive.js} +3 -3
- package/dist/domain/{javascriptRuntimeReconciliationGraph.js → javascript/javascriptRuntimeReconciliationGraph.js} +1 -1
- package/dist/domain/{javascriptRuntimeReconciliationMatching.js → javascript/javascriptRuntimeReconciliationMatching.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationParsing.js → javascript/javascriptRuntimeReconciliationParsing.js} +5 -5
- package/dist/domain/{javascriptRuntimeReconciliationResult.js → javascript/javascriptRuntimeReconciliationResult.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationSchemas.js → javascript/javascriptRuntimeReconciliationSchemas.js} +4 -4
- package/dist/domain/{javascriptRuntimeStaticCandidates.js → javascript/javascriptRuntimeStaticCandidates.js} +1 -1
- package/dist/domain/{javascriptSemanticAnalysis.js → javascript/javascriptSemanticAnalysis.js} +40 -14
- package/dist/domain/{javascriptSemanticAsyncEffects.js → javascript/javascriptSemanticAsyncEffects.js} +2 -1
- package/dist/domain/{javascriptSemanticCallResolution.js → javascript/javascriptSemanticCallResolution.js} +10 -5
- package/dist/domain/{javascriptSemanticCalls.js → javascript/javascriptSemanticCalls.js} +7 -4
- package/dist/domain/{javascriptSemanticChildProcesses.js → javascript/javascriptSemanticChildProcesses.js} +4 -2
- package/dist/domain/{javascriptSemanticDataEffectHelpers.js → javascript/javascriptSemanticDataEffectHelpers.js} +7 -6
- package/dist/domain/{javascriptSemanticDataEffects.js → javascript/javascriptSemanticDataEffects.js} +8 -6
- package/dist/domain/{javascriptSemanticFingerprints.js → javascript/javascriptSemanticFingerprints.js} +40 -16
- package/dist/domain/{javascriptSemanticGraph.js → javascript/javascriptSemanticGraph.js} +2 -2
- 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} +1 -1
- package/dist/domain/{javascriptSemanticProjection.js → javascript/javascriptSemanticProjection.js} +31 -44
- package/dist/domain/{javascriptSemanticPromises.js → javascript/javascriptSemanticPromises.js} +77 -22
- package/dist/domain/{javascriptSemanticProvenance.js → javascript/javascriptSemanticProvenance.js} +4 -1
- package/dist/domain/{javascriptSemanticQuery.js → javascript/javascriptSemanticQuery.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryAssessment.js → javascript/javascriptSemanticQueryAssessment.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryIdentity.js → javascript/javascriptSemanticQueryIdentity.js} +1 -1
- 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} +1 -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} +72 -48
- package/dist/domain/{javascriptStaticAnalysis.js → javascript/javascriptStaticAnalysis.js} +7 -4
- package/dist/domain/{javascriptStaticAnalysisBundler.js → javascript/javascriptStaticAnalysisBundler.js} +14 -11
- package/dist/domain/{javascriptStaticAnalysisCalls.js → javascript/javascriptStaticAnalysisCalls.js} +2 -2
- package/dist/domain/{javascriptStaticAnalysisHelpers.js → javascript/javascriptStaticAnalysisHelpers.js} +231 -40
- package/dist/domain/{sourceToBundleComparison.js → javascript/sourceToBundleComparison.js} +2 -2
- package/dist/domain/{sourceToBundleComparisonSchemas.js → javascript/sourceToBundleComparisonSchemas.js} +4 -4
- package/dist/domain/{sourceToBundleSignals.js → javascript/sourceToBundleSignals.js} +2 -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} +4 -4
- package/dist/domain/{managedMemberComparisonCoverage.js → managed/managedMemberComparisonCoverage.js} +2 -1
- package/dist/domain/{managedMemberComparisonItems.js → managed/managedMemberComparisonItems.js} +97 -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} +3 -3
- package/dist/domain/{managedNativeVerificationSchemas.js → managed/managedNativeVerificationSchemas.js} +6 -5
- package/dist/domain/{managedReconstruction.js → managed/managedReconstruction.js} +3 -3
- package/dist/domain/{nativeFunctionAnnotations.js → native/nativeFunctionAnnotations.js} +1 -1
- package/dist/domain/{nativeInspection.js → native/nativeInspection.js} +1 -1
- package/dist/domain/{nativeInvestigationGraph.js → native/nativeInvestigationGraph.js} +13 -4
- package/dist/domain/{nativeLoadImage.js → native/nativeLoadImage.js} +1 -1
- 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 -2
- package/dist/domain/processScenario.js +17 -17
- package/dist/domain/propertyListKeys.js +69 -0
- package/dist/domain/providerCleanupError.js +5 -2
- package/dist/domain/reconstructionCoverageEvaluation.js +46 -24
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/runtimeVersion.js +2 -0
- package/dist/domain/sourceMapEnvelope.js +38 -0
- package/dist/domain/unicodeCodePointOrder.js +11 -6
- package/dist/domain/webBundleAnalyzerAst.js +2 -34
- package/dist/domain/webBundleAnalyzerInspection.js +12 -9
- 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 +5 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +22 -16
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +56 -50
- package/dist/dotnet/ManagedStaticProvider.js +3 -33
- package/dist/dotnet/ManagedStaticProviderMetadata.js +36 -0
- package/dist/evaluation/CodexAgentEval.js +2 -1
- package/dist/firmware/FirmwareProvider.js +18 -12
- package/dist/firmware/FirmwarePublication.js +1 -1
- package/dist/firmware/FirmwareRelease.js +1 -1
- package/dist/firmware/FirmwareReports.js +12 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraFunctionValues.js +5 -5
- package/dist/ghidra/GhidraInstallation.js +38 -34
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +1 -1
- package/dist/ghidra/GhidraLauncher.js +12 -4
- package/dist/ghidra/GhidraLoadImageAttest.js +36 -0
- package/dist/ghidra/GhidraLoadImageValues.js +1 -1
- package/dist/ghidra/GhidraProvider.js +15 -233
- package/dist/ghidra/GhidraProviderCapabilities.js +7 -14
- package/dist/ghidra/GhidraProviderClient.js +209 -0
- package/dist/ghidra/GhidraResponseBuffer.js +7 -1
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +17 -1
- package/dist/hopper/HopperProvider.js +2 -48
- package/dist/hopper/HopperProviderCapabilities.js +73 -0
- package/dist/hopper/HopperResponseStream.js +7 -1
- package/dist/hopper/LinuxPrivateDisplayProbe.js +4 -4
- package/dist/ida/IdaProviderCapabilities.js +3 -11
- package/dist/ida/IdaSessionClient.js +12 -0
- package/dist/{browser → inspector}/JavaScriptRuntimeScope.js +16 -5
- package/dist/{browser → inspector}/V8InspectorCaptureProjection.js +46 -8
- package/dist/{browser → inspector}/V8InspectorEndpoint.js +1 -1
- package/dist/{browser → inspector}/V8InspectorProvider.js +10 -13
- 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 +8 -2
- package/dist/main/transport.js +24 -7
- package/dist/main.js +4 -18
- package/dist/native/AppleDispatchCoverage.js +58 -0
- package/dist/native/AppleDispatchMetadata.js +71 -509
- 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 +132 -72
- package/dist/native/NativeMacOSProviderMetadata.js +42 -0
- package/dist/native/NativeMachoInspection.js +45 -14
- package/dist/native/NativeUiHelperRuntime.js +7 -3
- package/dist/native/NativeUiObservation.js +8 -4
- 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 +13 -4
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +14 -0
- package/dist/native/parsers/otool.js +1 -1
- package/dist/native/parsers/plist.js +174 -19
- package/dist/process/ExecFileOutput.js +2 -0
- package/dist/process/ProviderProcess.js +38 -17
- package/dist/reference/ReferenceSourceReaderEntries.js +6 -1
- package/dist/server/createServer.js +48 -6
- package/dist/server/mcpClientMetadata.js +6 -3
- package/dist/server/registerAndroidTools.js +1 -1
- package/dist/server/registerApplicationTools/compareExportShapes.js +2 -2
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +2 -2
- package/dist/server/registerApplicationTools/compareVersions.js +2 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +43 -0
- package/dist/server/registerApplicationTools/traceFeature.js +1 -1
- package/dist/server/registerApplicationTools/traceSemantics.js +1 -1
- 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/registerJavaScriptRecoveryTool.js +17 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -4
- package/dist/server/registerManagedTools.js +3 -3
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -2
- package/dist/server/registerManagedWorkflowTools/contract.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/registerPrompts.js +5 -1
- package/dist/server/registerSessionTools.js +1 -1
- 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/sessionAvailabilityPolicy.js +24 -12
- package/dist/windows/WindowsOwnedProcess.js +3 -1
- package/install.sh +12 -2
- package/native/windows/README.md +5 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +40 -19
- package/scripts/hopper-demo-x11.py +67 -8
- package/scripts/rea.mjs +9 -1
- package/skills/reverse-engineer-anything/SKILL.md +3 -3
- package/skills/reverse-engineer-anything/references/android-applications.md +2 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +1 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +32 -23
- package/dist/application/runtime.js +0 -53
- package/dist/domain/appleApplication.js +0 -181
- package/dist/domain/javascriptAstValues.js +0 -13
- package/dist/domain/javascriptSemanticTraversal.js +0 -30
- package/dist/native/NativeHostCapabilities.js +0 -23
- /package/dist/application/{AndroidAnalysisPort.js → DirectAnalysisDependencies.js} +0 -0
- /package/dist/application/{BinarySessionPort.js → WebModulePorts.js} +0 -0
- /package/dist/application/{ElectronActiveObservationPort.js → WebRuntimePort.js} +0 -0
- /package/dist/application/{ElectronObservationPort.js → WebScriptArtifactPort.js} +0 -0
- /package/dist/application/{FirmwareAnalysisPort.js → WebSourceLocationPorts.js} +0 -0
- /package/dist/application/{JavaScriptArtifactAnalysisTypes.js → android/AndroidAnalysisPort.js} +0 -0
- /package/dist/application/{AbortablePromise.js → binary/AbortablePromise.js} +0 -0
- /package/dist/application/{JavaScriptRuntimeObservationPort.js → binary/BinarySessionPort.js} +0 -0
- /package/dist/application/{BinarySessionStatus.js → binary/BinarySessionStatus.js} +0 -0
- /package/dist/{domain/electronStaticAnalysisTypes.js → application/firmware/FirmwareAnalysisPort.js} +0 -0
- /package/dist/{domain/javascriptSemanticValueTypes.js → application/investigation/InvestigationRecordPort.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/artifacts/{NibArchive.js → apple/NibArchive.js} +0 -0
- /package/dist/domain/{androidAnalysis.js → android/androidAnalysis.js} +0 -0
- /package/dist/domain/{electronActiveObservation.js → javascript/electronActiveObservation.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/{javascriptSourceParser.js → javascript/javascriptSourceParser.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/{nativeDataType.js → native/nativeDataType.js} +0 -0
- /package/dist/domain/{nativeInstruction.js → native/nativeInstruction.js} +0 -0
- /package/dist/domain/{nativeMetadataRecovery.js → native/nativeMetadataRecovery.js} +0 -0
- /package/dist/domain/{nativeValueFlow.js → native/nativeValueFlow.js} +0 -0
- /package/dist/domain/{nativeValueTrace.js → native/nativeValueTrace.js} +0 -0
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { reconstructionCoverageEvaluationInputSchema } from "../domain/reconstructionCoverageInput.js";
|
|
2
2
|
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
|
3
3
|
import {} from "../domain/analysisErrorBase.js";
|
|
4
|
-
import { evaluateReconstructionClosure
|
|
4
|
+
import { evaluateReconstructionClosure } from "../domain/reconstructionCoverage.js";
|
|
5
5
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
6
6
|
import { err, ok } from "../domain/result.js";
|
|
7
|
-
export const reconstructionCoverageEvaluationInputSchema = z.strictObject({
|
|
8
|
-
coverage: reconstructionCoverageDataSchema,
|
|
9
|
-
boundary_id: z.string().min(1),
|
|
10
|
-
});
|
|
11
7
|
/** Evaluate inline reconstruction coverage against a named boundary. */
|
|
12
8
|
export const evaluateReconstructionCoverage = (rawInput, nowEpochMs = Date.now()) => {
|
|
13
9
|
const parsed = reconstructionCoverageEvaluationInputSchema.safeParse(rawInput);
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import canonicalize from "canonicalize";
|
|
3
3
|
import { parseEvidenceBundle, } from "../domain/evidenceBundle.js";
|
|
4
4
|
import { parseProcessCapture } from "../domain/processCapture.js";
|
|
5
|
-
import { parseApplicationGraphEvidence } from "./JavaScriptApplicationEvidenceGraph.js";
|
|
5
|
+
import { parseApplicationGraphEvidence } from "./javascript/JavaScriptApplicationEvidenceGraph.js";
|
|
6
6
|
import { applicationObligationPolicy, semanticObligationPolicy, } from "./ReconstructionObligationPolicies.js";
|
|
7
7
|
/** Derive conservative candidates from graph, process, and reviewed inputs. */
|
|
8
8
|
export const deriveReconstructionObligationCandidates = (bundleInput, reviewed) => {
|
|
@@ -32,8 +32,11 @@ const deriveApplicationCandidates = (evidence, records, candidates, limitations)
|
|
|
32
32
|
const source = parseApplicationGraphEvidence(evidence);
|
|
33
33
|
for (const node of source.graph.nodes) {
|
|
34
34
|
const candidatePolicy = applicationObligationPolicy(node.kind);
|
|
35
|
-
if (candidatePolicy === undefined)
|
|
35
|
+
if (candidatePolicy === undefined) {
|
|
36
|
+
if (node.kind === "unknown")
|
|
37
|
+
limitations.add(`Application graph ${source.graph.graph_id} contains unresolved node ${node.node_id}; reconstruction obligations remain unknown.`);
|
|
36
38
|
continue;
|
|
39
|
+
}
|
|
37
40
|
const reference = node.observations.map((observation) => graphReference(evidence, records, observation.evidence, `${source.graph.graph_id}/node/${node.node_id}/observation/${observation.observation_id}`));
|
|
38
41
|
addCandidate(candidates, generatedCandidate({
|
|
39
42
|
key: `application:${node.node_id}:${candidatePolicy.family}`,
|
|
@@ -106,6 +106,8 @@ export const importReferenceSource = async (options) => {
|
|
|
106
106
|
const error = readResult.error;
|
|
107
107
|
if (error.code === "cancelled")
|
|
108
108
|
return err(cancelled());
|
|
109
|
+
if (error.code === "unsupported")
|
|
110
|
+
return err(failure("unsupported", error.message));
|
|
109
111
|
return err(failure("io", error.message));
|
|
110
112
|
}
|
|
111
113
|
if (isAborted(options.signal))
|
|
@@ -3,12 +3,13 @@ import { posix } from "node:path";
|
|
|
3
3
|
import { classifyReferenceSourcePath, detectReferenceSourceLanguage, } from "../domain/referenceSourceClassification.js";
|
|
4
4
|
import { parseReferenceSourceImports } from "../domain/referenceSourceImportParsing.js";
|
|
5
5
|
import { PARSEABLE_REFERENCE_SOURCE_LANGUAGES } from "./ReferenceSourceImportTypes.js";
|
|
6
|
-
/**
|
|
7
|
-
export const projectReferenceSourceEntryFailure = (entry) => {
|
|
6
|
+
/** Preserve the observed reader failure and add entry-specific recovery guidance. */
|
|
7
|
+
export const projectReferenceSourceEntryFailure = (entry) => `${entry.message} ${entryRecoveryGuidance(entry)}`;
|
|
8
|
+
const entryRecoveryGuidance = (entry) => {
|
|
8
9
|
if (entry.code === "cancelled")
|
|
9
10
|
return "This entry was not read because the import was cancelled. Start the import again when ready.";
|
|
10
11
|
if (entry.code === "unsupported")
|
|
11
|
-
return "
|
|
12
|
+
return "Exclude this entry or replace it with a regular file.";
|
|
12
13
|
if (entry.kind === "directory")
|
|
13
14
|
return "This directory could not be read. Check its permissions, then try again.";
|
|
14
15
|
if (entry.kind === "symlink")
|
|
@@ -58,6 +59,22 @@ const resolveInternalSpecifier = (fromPath, specifier, filePaths) => {
|
|
|
58
59
|
`${normalized}${suffix}`,
|
|
59
60
|
`${normalized}/index${suffix}`,
|
|
60
61
|
]);
|
|
62
|
+
// TypeScript source commonly names the extension emitted for NodeNext.
|
|
63
|
+
// Retain present runtime files first; substitute only a missing counterpart.
|
|
64
|
+
// Counterparts cover explicit filenames, not directory/index resolution.
|
|
65
|
+
if (/\.(?:ts|tsx|mts|cts)$/u.test(fromPath)) {
|
|
66
|
+
const sourceSuffixes = normalized.endsWith(".js")
|
|
67
|
+
? [".ts", ".tsx", ".d.ts"]
|
|
68
|
+
: normalized.endsWith(".mjs")
|
|
69
|
+
? [".mts", ".d.mts"]
|
|
70
|
+
: normalized.endsWith(".cjs")
|
|
71
|
+
? [".cts", ".d.cts"]
|
|
72
|
+
: normalized.endsWith(".jsx")
|
|
73
|
+
? [".tsx", ".d.ts"]
|
|
74
|
+
: [];
|
|
75
|
+
const stem = normalized.slice(0, -posix.extname(normalized).length);
|
|
76
|
+
candidates.push(...sourceSuffixes.map((suffix) => `${stem}${suffix}`));
|
|
77
|
+
}
|
|
61
78
|
const match = candidates.find((candidate) => filePaths.has(candidate));
|
|
62
79
|
return match === undefined
|
|
63
80
|
? { to: normalized, resolution: "unresolved" }
|
|
@@ -10,6 +10,11 @@ export const projectReferenceSourceImportError = (error) => {
|
|
|
10
10
|
category: "invalid_input",
|
|
11
11
|
message: "Reference source directory could not be opened. Check that the path exists, is readable, and points to a directory.",
|
|
12
12
|
};
|
|
13
|
+
if (error.code === "unsupported")
|
|
14
|
+
return {
|
|
15
|
+
category: "unsupported_host",
|
|
16
|
+
message: "Safe no-follow file opens are unavailable on this host. Import the source tree with REA on Linux (including WSL) or macOS.",
|
|
17
|
+
};
|
|
13
18
|
if (error.code === "io")
|
|
14
19
|
return {
|
|
15
20
|
category: "execution_failure",
|
|
@@ -12,14 +12,22 @@ export const runSetup = async (options, host = systemSetupHost(), confirm) => {
|
|
|
12
12
|
const unsupported = await hostRemediation(host, false);
|
|
13
13
|
if (unsupported !== undefined)
|
|
14
14
|
return fail(unsupported);
|
|
15
|
-
|
|
16
|
-
let
|
|
15
|
+
const initialState = await host.initialSetupState?.(options.readinessScope);
|
|
16
|
+
let hopperPath = initialState === undefined
|
|
17
|
+
? await host.hopperPath()
|
|
18
|
+
: initialState.hopperPath;
|
|
19
|
+
let providerEnvironment = initialState === undefined
|
|
20
|
+
? await initialProviderEnvironment(host, hopperPath)
|
|
21
|
+
: initialState.providerEnvironment;
|
|
17
22
|
const discovery = await discoverSetupState({
|
|
18
23
|
host,
|
|
19
24
|
providerEnvironment,
|
|
20
25
|
forceHopperInstall: options.installHopper,
|
|
21
26
|
proposeHopper: options.proposeHopper ?? (confirm !== undefined && !options.structured),
|
|
22
27
|
doctorScope: options.readinessScope,
|
|
28
|
+
...(initialState === undefined
|
|
29
|
+
? {}
|
|
30
|
+
: { initialDoctor: initialState.doctor }),
|
|
23
31
|
});
|
|
24
32
|
clientStates = discovery.clientStates;
|
|
25
33
|
const clientSelectionAllowed = options.clientIds === undefined &&
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clientRegistrationEntry, clientConfigurationValuesEqual, parseClientConfiguration, serializeClientConfiguration, } from "./ClientConfigurationDocument.js";
|
|
1
|
+
import { clientRegistrationEntry, clientConfigurationValuesEqual, clientServerPath, legacyClientServerPath, parseClientConfiguration, serializeClientConfiguration, withClientServers, } from "./ClientConfigurationDocument.js";
|
|
2
2
|
import { constants as fsConstants } from "node:fs";
|
|
3
3
|
import { copyFile, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
4
|
import { dirname } from "node:path";
|
|
@@ -43,21 +43,23 @@ const configureClientDocument = async (client, environment, command, format) =>
|
|
|
43
43
|
void cause;
|
|
44
44
|
return { status: "failed", reason: "readback" };
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
if (clientConfigurationValuesEqual(servers[PRODUCT_IDENTITY.mcpServerKey], desired))
|
|
46
|
+
const desired = clientConfigurationDesired(client, environment, command, parsed.dialect);
|
|
47
|
+
if (registrationCurrent(parsed, desired))
|
|
49
48
|
return { status: "unchanged" };
|
|
50
49
|
const backupPath = original === undefined ? undefined : `${client.configPath}.rea.backup`;
|
|
51
50
|
if (backupPath !== undefined &&
|
|
52
51
|
!(await preserveConfigBackup(transactionPath, backupPath)))
|
|
53
52
|
return { status: "failed", reason: "backup" };
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
53
|
+
// A native OpenCode V2 entry replaces REA's legacy V1 entry, which would
|
|
54
|
+
// otherwise conflict with it.
|
|
55
|
+
const legacyPath = legacyClientServerPath(parsed, PRODUCT_IDENTITY.mcpServerKey);
|
|
56
|
+
const document = withClientServers(parsed, { ...parsed.servers, [PRODUCT_IDENTITY.mcpServerKey]: desired }, PRODUCT_IDENTITY.mcpServerKey);
|
|
58
57
|
try {
|
|
59
58
|
await mkdir(dirname(client.configPath), { recursive: true });
|
|
60
|
-
await writeFileAtomic(transactionPath, serializeClientConfiguration(document, format, original,
|
|
59
|
+
await writeFileAtomic(transactionPath, serializeClientConfiguration(document, format, original, [
|
|
60
|
+
clientServerPath(parsed, PRODUCT_IDENTITY.mcpServerKey),
|
|
61
|
+
...(legacyPath === undefined ? [] : [legacyPath]),
|
|
62
|
+
]), {
|
|
61
63
|
encoding: "utf8",
|
|
62
64
|
mode: 0o600,
|
|
63
65
|
});
|
|
@@ -69,7 +71,7 @@ const configureClientDocument = async (client, environment, command, format) =>
|
|
|
69
71
|
}
|
|
70
72
|
try {
|
|
71
73
|
const readback = parseClientConfiguration(await readFile(transactionPath, "utf8"), format);
|
|
72
|
-
if (!
|
|
74
|
+
if (!registrationCurrent(readback, desired)) {
|
|
73
75
|
await restoreConfig(transactionPath, original);
|
|
74
76
|
return { status: "failed", reason: "readback" };
|
|
75
77
|
}
|
|
@@ -87,11 +89,10 @@ const configureClientDocument = async (client, environment, command, format) =>
|
|
|
87
89
|
};
|
|
88
90
|
/** Determine whether an existing client configuration matches the desired registration. */
|
|
89
91
|
export const clientConfigurationAligned = async (client, providerEnvironment, command) => {
|
|
90
|
-
const desired = clientConfigurationDesired(client, providerEnvironment, command, client.format);
|
|
91
92
|
try {
|
|
92
93
|
const original = await readFile(client.configPath, "utf8");
|
|
93
|
-
const
|
|
94
|
-
return
|
|
94
|
+
const parsed = parseClientConfiguration(original, client.format);
|
|
95
|
+
return registrationCurrent(parsed, clientConfigurationDesired(client, providerEnvironment, command, parsed.dialect));
|
|
95
96
|
}
|
|
96
97
|
catch (cause) {
|
|
97
98
|
// Unreadable configuration is treated as not aligned so setup repairs it.
|
|
@@ -121,10 +122,10 @@ export const inspectClientConfiguration = async (client, providerEnvironment, co
|
|
|
121
122
|
remediation: "The configuration file could not be read. Check its permissions before rerunning setup.",
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
|
-
const desired = clientConfigurationDesired(client, providerEnvironment, command, client.format);
|
|
125
125
|
try {
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const parsed = parseClientConfiguration(original, client.format);
|
|
127
|
+
const desired = clientConfigurationDesired(client, providerEnvironment, command, parsed.dialect);
|
|
128
|
+
if (registrationCurrent(parsed, desired))
|
|
128
129
|
return { status: "already_current" };
|
|
129
130
|
}
|
|
130
131
|
catch (cause) {
|
|
@@ -162,6 +163,8 @@ const restoreConfig = async (path, original) => {
|
|
|
162
163
|
void cause;
|
|
163
164
|
}
|
|
164
165
|
};
|
|
166
|
+
/** Whether REA's entry matches and no conflicting legacy entry remains. */
|
|
167
|
+
const registrationCurrent = (parsed, desired) => clientConfigurationValuesEqual(parsed.servers[PRODUCT_IDENTITY.mcpServerKey], desired) && !Object.hasOwn(parsed.legacyServers, PRODUCT_IDENTITY.mcpServerKey);
|
|
165
168
|
const clientConfigurationDesired = (client, providerEnvironment, command, format) => {
|
|
166
169
|
const environment = Object.fromEntries(Object.entries(providerEnvironment).sort(([left], [right]) => left.localeCompare(right)));
|
|
167
170
|
const registration = clientRegistrationEntry(format ?? "json", command.length === 0 ? [PRODUCT_IDENTITY.cliBinary, "mcp"] : command, environment);
|
|
@@ -2,7 +2,7 @@ import { access } from "node:fs/promises";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
5
|
-
import { supportsNodeVersion } from "../domain/runtimeVersion.js";
|
|
5
|
+
import { SUPPORTED_NODE_VERSION_PROSE, supportsNodeVersion, } from "../domain/runtimeVersion.js";
|
|
6
6
|
import { runDoctor, systemDoctorHost } from "./Doctor.js";
|
|
7
7
|
import { installLinuxHopper, readLinuxDistribution } from "./LinuxHopper.js";
|
|
8
8
|
import { installMacHopper } from "./MacHopper.js";
|
|
@@ -31,7 +31,7 @@ export const initialProviderEnvironment = async (host, hopperPath) => ({
|
|
|
31
31
|
});
|
|
32
32
|
export const hostRemediation = async (host, installHopper) => {
|
|
33
33
|
if (!supportsNodeVersion(host.nodeVersion))
|
|
34
|
-
return
|
|
34
|
+
return `Install ${SUPPORTED_NODE_VERSION_PROSE} and rerun setup.`;
|
|
35
35
|
if (!installHopper)
|
|
36
36
|
return undefined;
|
|
37
37
|
if (host.platform !== "darwin" && host.platform !== "linux")
|
|
@@ -44,7 +44,7 @@ export const hostRemediation = async (host, installHopper) => {
|
|
|
44
44
|
}
|
|
45
45
|
if ((await host.linuxDistribution())?.supported === true)
|
|
46
46
|
return undefined;
|
|
47
|
-
return "Automated Hopper setup supports Ubuntu 24.04+, Fedora 41+,
|
|
47
|
+
return "Automated Hopper setup supports Ubuntu 24.04+, Fedora 41+, 64-bit Arch Linux, and CachyOS; configure an existing supported provider instead.";
|
|
48
48
|
};
|
|
49
49
|
/** Production setup effects for Hopper, agent configuration, and the canonical skill directory. */
|
|
50
50
|
export const systemSetupHost = (doctorHost = systemDoctorHost()) => {
|
|
@@ -55,6 +55,21 @@ export const systemSetupHost = (doctorHost = systemDoctorHost()) => {
|
|
|
55
55
|
macosVersion: () => doctorHost.macosVersion(),
|
|
56
56
|
linuxDistribution: readLinuxDistribution,
|
|
57
57
|
hopperPath: async () => (await runDoctor(undefined, doctorHost)).hopperPath,
|
|
58
|
+
initialSetupState: async (scope) => {
|
|
59
|
+
const diagnosis = await runDoctor(undefined, doctorHost, scope);
|
|
60
|
+
return {
|
|
61
|
+
...(diagnosis.hopperPath === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: { hopperPath: diagnosis.hopperPath }),
|
|
64
|
+
providerEnvironment: {
|
|
65
|
+
...providerRegistrationEnvironment(diagnosis.providerInspections ?? []),
|
|
66
|
+
...(diagnosis.hopperPath === undefined
|
|
67
|
+
? {}
|
|
68
|
+
: { HOPPER_LAUNCHER_PATH: diagnosis.hopperPath }),
|
|
69
|
+
},
|
|
70
|
+
doctor: diagnosis,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
58
73
|
providerEnvironment: async () => {
|
|
59
74
|
const diagnosis = await runDoctor(undefined, doctorHost);
|
|
60
75
|
return {
|
|
@@ -6,7 +6,7 @@ import { linuxHopperInstallDisclosure, } from "./LinuxHopper.js";
|
|
|
6
6
|
import { macHopperInstallDisclosure } from "./MacHopper.js";
|
|
7
7
|
/** Discover supported clients and current registrations without mutation. */
|
|
8
8
|
export const discoverSetupState = async (input) => {
|
|
9
|
-
const initialDoctor = await input.host.doctor(input.doctorScope);
|
|
9
|
+
const initialDoctor = input.initialDoctor ?? (await input.host.doctor(input.doctorScope));
|
|
10
10
|
const linuxHopperRepairNeeded = initialDoctor.checks.some(({ name, ok, detail }) => !ok &&
|
|
11
11
|
(name === "hopper-demo-runtime" ||
|
|
12
12
|
(name === "hopper-version" && detail === "/opt/hopper/bin/Hopper")));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseClientConfiguration, serializeClientConfiguration, } from "./ClientConfigurationDocument.js";
|
|
1
|
+
import { parseClientConfiguration, serializeClientConfiguration, clientServerPath, legacyClientServerPath, withClientServers, } from "./ClientConfigurationDocument.js";
|
|
2
2
|
import { copyFile, lstat, readFile, realpath, rm } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -76,28 +76,33 @@ const removeClient = async (client, fileSystem) => {
|
|
|
76
76
|
? item(client.name, "skipped", "Configuration does not exist.")
|
|
77
77
|
: item(client.name, "failed", "Configuration could not be read. Check file permissions, then rerun uninstall.");
|
|
78
78
|
}
|
|
79
|
-
let
|
|
80
|
-
let key;
|
|
81
|
-
let servers;
|
|
79
|
+
let parsed;
|
|
82
80
|
try {
|
|
83
|
-
(
|
|
84
|
-
document,
|
|
85
|
-
servers,
|
|
86
|
-
serversKey: key,
|
|
87
|
-
} = parseClientConfiguration(original, client.format));
|
|
81
|
+
parsed = parseClientConfiguration(original, client.format);
|
|
88
82
|
}
|
|
89
83
|
catch (cause) {
|
|
90
84
|
void cause;
|
|
91
85
|
return item(client.name, "failed", `Configuration is not valid ${client.format === "toml" ? "TOML" : client.format === "opencode" ? "JSONC" : "JSON"} and was not changed. Repair it, then rerun uninstall.`);
|
|
92
86
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
87
|
+
const name = PRODUCT_IDENTITY.mcpServerKey;
|
|
88
|
+
// Beside a native OpenCode V2 table, OpenCode also loads a V1 `mcp.rea`.
|
|
89
|
+
const legacyPath = legacyClientServerPath(parsed, name);
|
|
90
|
+
const hasNative = Object.hasOwn(parsed.servers, name);
|
|
91
|
+
if (!hasNative && legacyPath === undefined)
|
|
95
92
|
return item(client.name, "skipped", "REA registration is absent.");
|
|
96
|
-
|
|
93
|
+
const removeNative = hasNative && isOwnedRegistration(parsed.servers[name], client);
|
|
94
|
+
const removeLegacy = legacyPath !== undefined &&
|
|
95
|
+
isOwnedRegistration(parsed.legacyServers[name], client);
|
|
96
|
+
if (!removeNative && !removeLegacy)
|
|
97
97
|
return item(client.name, "retained", "The rea-named registration is not REA-owned.");
|
|
98
|
-
const remaining = { ...servers };
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
const remaining = { ...parsed.servers };
|
|
99
|
+
if (removeNative)
|
|
100
|
+
delete remaining[name];
|
|
101
|
+
const document = withClientServers(parsed, remaining, removeLegacy ? name : undefined);
|
|
102
|
+
const editedPaths = [
|
|
103
|
+
...(removeNative ? [clientServerPath(parsed, name)] : []),
|
|
104
|
+
...(removeLegacy ? [legacyPath] : []),
|
|
105
|
+
];
|
|
101
106
|
const backupPath = `${client.configPath}.rea.backup`;
|
|
102
107
|
try {
|
|
103
108
|
await fileSystem.copy(transactionPath, backupPath);
|
|
@@ -107,9 +112,10 @@ const removeClient = async (client, fileSystem) => {
|
|
|
107
112
|
return item(client.name, "failed", "Configuration could not be backed up, so no change was made. Check file permissions, then rerun uninstall.");
|
|
108
113
|
}
|
|
109
114
|
try {
|
|
110
|
-
await fileSystem.writeText(transactionPath, serializeClientConfiguration(document, client.format, original,
|
|
115
|
+
await fileSystem.writeText(transactionPath, serializeClientConfiguration(document, client.format, original, editedPaths));
|
|
111
116
|
const readback = parseClientConfiguration(await fileSystem.readText(transactionPath), client.format);
|
|
112
|
-
if (
|
|
117
|
+
if ((removeNative && Object.hasOwn(readback.servers, name)) ||
|
|
118
|
+
(removeLegacy && Object.hasOwn(readback.legacyServers, name)))
|
|
113
119
|
throw new Error("registration readback mismatch");
|
|
114
120
|
return item(client.name, "removed", `Removed registration from ${client.configPath}.`);
|
|
115
121
|
}
|
|
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
5
5
|
import { isOwnedClientRegistrationCommand } from "./ClientRegistrationIdentity.js";
|
|
6
6
|
import { readClientRegistrationStatuses } from "./ClientRegistrationStatus.js";
|
|
7
|
-
import { parseClientConfiguration } from "./ClientConfigurationDocument.js";
|
|
7
|
+
import { effectiveClientServer, parseClientConfiguration, } from "./ClientConfigurationDocument.js";
|
|
8
8
|
import { supportedClients } from "./SupportedClients.js";
|
|
9
9
|
const setupPlanSchema = z.object({
|
|
10
10
|
status: z.literal("planned"),
|
|
@@ -32,13 +32,13 @@ export const existingMaintenanceScope = async (home, entryPoint) => {
|
|
|
32
32
|
const client = supported.find(({ name }) => name === registration.client);
|
|
33
33
|
if (client === undefined)
|
|
34
34
|
continue;
|
|
35
|
-
const
|
|
35
|
+
const parsed = parseClientConfiguration(await readFile(client.configPath, "utf8"), client.format);
|
|
36
36
|
const enabled = z
|
|
37
37
|
.object({
|
|
38
38
|
enabled: z.boolean().optional(),
|
|
39
39
|
disabled: z.boolean().optional(),
|
|
40
40
|
})
|
|
41
|
-
.parse(
|
|
41
|
+
.parse(effectiveClientServer(parsed, PRODUCT_IDENTITY.mcpServerKey));
|
|
42
42
|
if (enabled.enabled !== false && enabled.disabled !== true)
|
|
43
43
|
clients.push(client.name);
|
|
44
44
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { AnalysisOutputError } from "../domain/analysisErrorCore.js";
|
|
3
|
+
import { err, ok } from "../domain/result.js";
|
|
4
|
+
/** Bind actual source text to the selected manifest entry before analysis. */
|
|
5
|
+
export const validateSelectedWebScript = (input, data, operation) => {
|
|
6
|
+
const selected = data.manifest.scripts[input.script_index];
|
|
7
|
+
if (selected === undefined ||
|
|
8
|
+
selected.content.state !== "exported" ||
|
|
9
|
+
selected.content.sha256 !== data.sourceFile.sha256 ||
|
|
10
|
+
selected.content.bytes !== data.sourceFile.bytes ||
|
|
11
|
+
Buffer.byteLength(data.source) !== data.sourceFile.bytes ||
|
|
12
|
+
createHash("sha256").update(data.source, "utf8").digest("hex") !==
|
|
13
|
+
data.sourceFile.sha256 ||
|
|
14
|
+
data.manifestFile.path !== input.manifest_path)
|
|
15
|
+
return err(new AnalysisOutputError(operation, "Artifact port changed the selected script/source identity."));
|
|
16
|
+
return ok(selected);
|
|
17
|
+
};
|
|
18
|
+
/** Carry reported capture context alongside independently verified manifest bytes. */
|
|
19
|
+
export const capturedWebManifestIdentity = (data) => ({
|
|
20
|
+
...data.manifestFile,
|
|
21
|
+
reported_output_directory: data.manifest.output_directory,
|
|
22
|
+
capture_sha256: data.manifest.capture_sha256,
|
|
23
|
+
capture_path: data.manifest.capture_path,
|
|
24
|
+
capture_kind: data.manifest.capture_kind,
|
|
25
|
+
capture_completeness: data.manifest.capture_completeness,
|
|
26
|
+
source_evidence_id: data.manifest.source_evidence_id,
|
|
27
|
+
});
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { isAbsolute } from "node:path";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisInputError, AnalysisOutputError, } from "../domain/analysisErrorCore.js";
|
|
4
|
+
import { createEvidence } from "../domain/evidence.js";
|
|
5
|
+
import { jsonObjectSchema } from "../domain/jsonValue.js";
|
|
6
|
+
import { projectInputIssues } from "../domain/inputIssueProjection.js";
|
|
7
|
+
import { err, ok } from "../domain/result.js";
|
|
8
|
+
import { collectWebModuleImports, matchCapturedModules, } from "../domain/webModuleImports.js";
|
|
9
|
+
import { webModuleTraceInputSchema, webModuleFileSchema, webModuleResolutionSchema, webModuleTraceResultSchema, } from "../domain/webModuleTrace.js";
|
|
10
|
+
import { selectedWebScriptArtifactsSchema } from "../domain/webScriptArtifacts.js";
|
|
11
|
+
import { capturedWebManifestIdentity, validateSelectedWebScript, } from "./ValidateSelectedWebScript.js";
|
|
12
|
+
const OPERATION = "trace_web_module_imports";
|
|
13
|
+
const artifactsSchema = selectedWebScriptArtifactsSchema.extend({
|
|
14
|
+
importMap: z
|
|
15
|
+
.strictObject({
|
|
16
|
+
file: webModuleFileSchema,
|
|
17
|
+
baseUrl: z.string().min(1),
|
|
18
|
+
value: jsonObjectSchema,
|
|
19
|
+
})
|
|
20
|
+
.nullable(),
|
|
21
|
+
});
|
|
22
|
+
const resolutionBatchSchema = z.strictObject({
|
|
23
|
+
engine: z.strictObject({ id: z.string().min(1), version: z.string().min(1) }),
|
|
24
|
+
resolutions: z.array(webModuleResolutionSchema),
|
|
25
|
+
diagnostics: z.array(z.string()),
|
|
26
|
+
rawResult: jsonObjectSchema,
|
|
27
|
+
});
|
|
28
|
+
const LIMITATIONS = [
|
|
29
|
+
"Resolution is derived under the selected importer URL and optional import map; it does not establish that the map was installed in the captured page.",
|
|
30
|
+
"Reported source URLs do not establish an inline script's document base. Select importer_url explicitly when that context differs or is unknown.",
|
|
31
|
+
"Captured candidates retain reported capture metadata; their bytes are not reverified by this trace unless selected as the source.",
|
|
32
|
+
"A resolved URL or captured source does not prove loading, execution, UI causality, or module namespace identity. Execution remains unknown.",
|
|
33
|
+
"Only native ES module syntax is resolved. Bundler module IDs, computed imports, workers and non-HTTP(S) importer contexts are outside this trace.",
|
|
34
|
+
"Source-map declarations do not establish retained map bytes or executed original-source coverage.",
|
|
35
|
+
"Selected application code is parsed as data and never executed. The owned resolver executes only REA's trusted stub; its page requests are locally fulfilled or blocked.",
|
|
36
|
+
"Manifest, source and import-map limits are 32 MiB, 16 MiB and 4 MiB. Native resolution has a 20-second deadline; cleanup may extend it. One renderer is requested; no aggregate host memory limit is claimed.",
|
|
37
|
+
];
|
|
38
|
+
/** Compose verified captures, inert syntax and a replaceable URL resolution engine. */
|
|
39
|
+
export class WebModuleTraceService {
|
|
40
|
+
artifacts;
|
|
41
|
+
resolver;
|
|
42
|
+
constructor(artifacts, resolver) {
|
|
43
|
+
this.artifacts = artifacts;
|
|
44
|
+
this.resolver = resolver;
|
|
45
|
+
}
|
|
46
|
+
async trace(rawInput, options) {
|
|
47
|
+
if (isAborted(options?.signal))
|
|
48
|
+
return err(new AnalysisCancelledError(OPERATION));
|
|
49
|
+
const parsed = webModuleTraceInputSchema.safeParse(rawInput);
|
|
50
|
+
if (!parsed.success)
|
|
51
|
+
return err(new AnalysisInputError(OPERATION, { cause: parsed.error }, projectInputIssues(parsed.error.issues, rawInput)));
|
|
52
|
+
const input = parsed.data;
|
|
53
|
+
for (const [path, value] of [
|
|
54
|
+
["manifest_path", input.manifest_path],
|
|
55
|
+
["import_map.path", input.import_map?.path],
|
|
56
|
+
])
|
|
57
|
+
if (value !== undefined && !isAbsolute(value))
|
|
58
|
+
return invalid(path.split("."), "Expected an absolute filesystem path on this host.");
|
|
59
|
+
for (const [path, value] of [
|
|
60
|
+
["importer_url", input.importer_url],
|
|
61
|
+
["import_map.base_url", input.import_map?.base_url],
|
|
62
|
+
])
|
|
63
|
+
if (value !== undefined) {
|
|
64
|
+
const admission = admitContext(value, path.split("."));
|
|
65
|
+
if (!admission.ok)
|
|
66
|
+
return admission;
|
|
67
|
+
}
|
|
68
|
+
const loaded = await this.artifacts.load(input, options);
|
|
69
|
+
if (!loaded.ok)
|
|
70
|
+
return loaded;
|
|
71
|
+
const verified = artifactsSchema.safeParse(loaded.value);
|
|
72
|
+
if (!verified.success)
|
|
73
|
+
return err(new AnalysisOutputError(OPERATION, "Artifact port returned a malformed source/manifest report."));
|
|
74
|
+
const data = verified.data;
|
|
75
|
+
if ((input.import_map?.path ?? null) !==
|
|
76
|
+
(data.importMap?.file.path ?? null) ||
|
|
77
|
+
(input.import_map?.base_url ?? null) !== (data.importMap?.baseUrl ?? null))
|
|
78
|
+
return err(new AnalysisOutputError(OPERATION, "Artifact port changed the selected import-map identity/context."));
|
|
79
|
+
const bound = validateSelectedWebScript(input, data, OPERATION);
|
|
80
|
+
if (!bound.ok)
|
|
81
|
+
return bound;
|
|
82
|
+
const selected = bound.value;
|
|
83
|
+
const importerUrl = input.importer_url ?? selected.url;
|
|
84
|
+
const importerAdmission = admitContext(importerUrl, ["importer_url"]);
|
|
85
|
+
if (!importerAdmission.ok)
|
|
86
|
+
return importerAdmission;
|
|
87
|
+
const syntax = collectWebModuleImports(data.source);
|
|
88
|
+
const literals = syntax.imports
|
|
89
|
+
.filter((reference) => reference.specifier !== null)
|
|
90
|
+
.map((reference) => reference.specifier ?? "");
|
|
91
|
+
let resolution = null;
|
|
92
|
+
if (literals.length > 0) {
|
|
93
|
+
const execution = await this.resolver.resolve({
|
|
94
|
+
importerUrl,
|
|
95
|
+
importMap: data.importMap === null
|
|
96
|
+
? null
|
|
97
|
+
: {
|
|
98
|
+
baseUrl: data.importMap.baseUrl,
|
|
99
|
+
value: data.importMap.value,
|
|
100
|
+
},
|
|
101
|
+
specifiers: literals,
|
|
102
|
+
}, options);
|
|
103
|
+
if (!execution.ok)
|
|
104
|
+
return execution;
|
|
105
|
+
const report = resolutionBatchSchema.safeParse(execution.value);
|
|
106
|
+
if (!report.success)
|
|
107
|
+
return err(new AnalysisOutputError(OPERATION, "Resolver returned malformed or incomplete native evidence."));
|
|
108
|
+
resolution = report.data;
|
|
109
|
+
if (resolution.resolutions.length !== literals.length)
|
|
110
|
+
return err(new AnalysisOutputError(OPERATION, "Resolver did not return every selected literal specifier."));
|
|
111
|
+
}
|
|
112
|
+
if (isAborted(options?.signal))
|
|
113
|
+
return err(new AnalysisCancelledError(OPERATION));
|
|
114
|
+
let literalIndex = 0;
|
|
115
|
+
const imports = [];
|
|
116
|
+
for (const reference of syntax.imports) {
|
|
117
|
+
let resolved;
|
|
118
|
+
if (reference.specifier === null)
|
|
119
|
+
resolved = { state: "unknown", reason: "computed-specifier" };
|
|
120
|
+
else {
|
|
121
|
+
const reported = resolution?.resolutions[literalIndex++];
|
|
122
|
+
if (reported === undefined)
|
|
123
|
+
return err(new AnalysisOutputError(OPERATION, "Resolver omitted a selected literal specifier."));
|
|
124
|
+
resolved = reported;
|
|
125
|
+
}
|
|
126
|
+
imports.push({
|
|
127
|
+
...reference,
|
|
128
|
+
resolution: resolved,
|
|
129
|
+
captured_candidates: resolved.state === "resolved"
|
|
130
|
+
? matchCapturedModules(resolved.url, data.manifest.scripts)
|
|
131
|
+
: [],
|
|
132
|
+
execution: "unknown",
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const normalized = webModuleTraceResultSchema.safeParse({
|
|
136
|
+
manifest: capturedWebManifestIdentity(data),
|
|
137
|
+
source: {
|
|
138
|
+
...data.sourceFile,
|
|
139
|
+
script_index: input.script_index,
|
|
140
|
+
script: selected,
|
|
141
|
+
},
|
|
142
|
+
importer: {
|
|
143
|
+
url: importerUrl,
|
|
144
|
+
basis: input.importer_url === undefined
|
|
145
|
+
? "reported-source-url"
|
|
146
|
+
: "caller-selected",
|
|
147
|
+
},
|
|
148
|
+
import_map: data.importMap === null
|
|
149
|
+
? null
|
|
150
|
+
: { ...data.importMap.file, base_url: data.importMap.baseUrl },
|
|
151
|
+
parser: {
|
|
152
|
+
state: syntax.state,
|
|
153
|
+
diagnostics: syntax.diagnostics,
|
|
154
|
+
location_units: "UTF-16 offsets and columns; one-based lines",
|
|
155
|
+
},
|
|
156
|
+
engine: resolution?.engine ?? null,
|
|
157
|
+
imports,
|
|
158
|
+
diagnostics: resolution?.diagnostics ?? [],
|
|
159
|
+
limitations: LIMITATIONS,
|
|
160
|
+
});
|
|
161
|
+
if (!normalized.success)
|
|
162
|
+
return err(new AnalysisOutputError(OPERATION, normalized.error.message));
|
|
163
|
+
return ok(createEvidence({
|
|
164
|
+
path: data.sourceFile.path,
|
|
165
|
+
sha256: data.sourceFile.sha256,
|
|
166
|
+
format: "file",
|
|
167
|
+
}, {
|
|
168
|
+
id: "rea-web-module-trace",
|
|
169
|
+
name: "REA captured module relationship trace",
|
|
170
|
+
version: "1",
|
|
171
|
+
}, {
|
|
172
|
+
operation: OPERATION,
|
|
173
|
+
parameters: jsonObjectSchema.parse(input),
|
|
174
|
+
result: normalized.data,
|
|
175
|
+
rawResult: resolution?.rawResult ?? null,
|
|
176
|
+
confidence: "derived",
|
|
177
|
+
authority: "historical-reference",
|
|
178
|
+
limitations: LIMITATIONS,
|
|
179
|
+
locations: [
|
|
180
|
+
{ kind: "artifact-path", path: data.sourceFile.path },
|
|
181
|
+
{ kind: "artifact-path", path: input.manifest_path },
|
|
182
|
+
],
|
|
183
|
+
evidenceLinks: data.manifest.source_evidence_id === null
|
|
184
|
+
? []
|
|
185
|
+
: [data.manifest.source_evidence_id],
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const admitContext = (value, path) => {
|
|
190
|
+
let url;
|
|
191
|
+
try {
|
|
192
|
+
url = new URL(value);
|
|
193
|
+
}
|
|
194
|
+
catch (cause) {
|
|
195
|
+
void cause;
|
|
196
|
+
return invalid(path, "Expected an absolute context URL. Select importer_url explicitly when the reported source URL is unknown.");
|
|
197
|
+
}
|
|
198
|
+
if (url.username !== "" || url.password !== "")
|
|
199
|
+
return invalid(path, "Module context URLs must not contain username/password userinfo.");
|
|
200
|
+
if (url.protocol !== "http:" && url.protocol !== "https:")
|
|
201
|
+
return err(new AnalysisCapabilityUnavailableError("web-module-resolution", OPERATION, "unsupported_context_scheme", {
|
|
202
|
+
userMessage: `${path.join(".")} ${value} uses unsupported ${url.protocol} context. This trace currently supports HTTP(S) importer/map contexts; select a supported context explicitly when appropriate.`,
|
|
203
|
+
}));
|
|
204
|
+
return ok(null);
|
|
205
|
+
};
|
|
206
|
+
const isAborted = (signal) => signal?.aborted === true;
|
|
207
|
+
const invalid = (path, message) => err(new AnalysisInputError(OPERATION, undefined, [
|
|
208
|
+
{ path, reason: "invalid_format", message },
|
|
209
|
+
]));
|