rea-agents 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/bridge/ghidra/ReaGhidraBridge.java +32 -4
- package/bridge/hopper_bridge.py +6 -1
- package/dist/android/JadxConfiguration.js +87 -7
- package/dist/android/JadxMcpTransport.js +14 -2
- package/dist/android/JadxProvider.js +57 -35
- package/dist/application/BinaryTargetResolver.js +5 -3
- package/dist/application/BrowserEvidence.js +3 -8
- package/dist/application/BrowserScenarioEvidence.js +2 -18
- package/dist/application/CapabilityInventory.js +43 -9
- package/dist/application/ClientConfigurationDocument.js +69 -25
- package/dist/application/DirectAnalysis.js +29 -14
- package/dist/application/DirectAnalysisCleanup.js +72 -0
- package/dist/application/DirectAnalysisStatus.js +4 -5
- package/dist/application/Doctor.js +15 -19
- package/dist/application/DoctorDiagnostics.js +1 -2
- package/dist/application/EnhancedTools.js +51 -6
- package/dist/application/EvidenceBundleFiles.js +8 -3
- package/dist/application/InvestigationProviders.js +9 -1
- package/dist/application/JsonFiles.js +42 -9
- package/dist/application/LinuxHopper.js +9 -6
- package/dist/application/MacHopper.js +15 -18
- package/dist/application/RealHopperAssertions.js +0 -11
- package/dist/application/ReconstructionObligationCandidates.js +1 -1
- package/dist/application/ReferenceSourceImportEntries.js +1 -1
- package/dist/application/Setup.js +8 -16
- package/dist/application/SetupHost.js +16 -27
- package/dist/application/SetupPlan.js +6 -6
- package/dist/application/Uninstall.js +81 -29
- package/dist/application/UpdateMaintenance.js +7 -5
- package/dist/application/UpdateRuntime.js +12 -12
- package/dist/application/WebScriptExportService.js +30 -4
- package/dist/application/WorkflowEvidence.js +25 -2
- package/dist/application/XrefsAddressResolution.js +45 -0
- package/dist/application/analysisView/AnalysisViewService.js +76 -0
- package/dist/application/binary/AnalysisClientCleanup.js +30 -5
- package/dist/application/binary/AnalysisProviderEvaluation.js +1 -2
- package/dist/application/binary/AnalysisProviderRegistry.js +2 -6
- package/dist/application/binary/AnalysisSnapshotCache.js +10 -8
- package/dist/application/binary/BinarySession.js +70 -29
- package/dist/application/binary/BinarySessionComposition.js +1 -3
- package/dist/application/binary/BinarySessionExecution.js +3 -5
- package/dist/application/binary/BinarySessionOpen.js +1 -1
- package/dist/application/binary/BinarySessionRecords.js +1 -1
- package/dist/application/binary/BinarySessionStatus.js +1 -6
- package/dist/application/binary/CompositeProvider.js +4 -18
- package/dist/application/binary/LazyAnalysisProvider.js +5 -5
- package/dist/application/binary/SessionProviderRouter.js +27 -135
- package/dist/application/homebrew.js +48 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +9 -13
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +2 -6
- package/dist/application/javascript/JavaScriptApplicationService.js +6 -1
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +5 -3
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +11 -9
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +11 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +9 -0
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +8 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +12 -3
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +0 -1
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +43 -16
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +46 -6
- package/dist/application/javascript/JavaScriptModuleRelationships.js +1 -1
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +1 -2
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +1 -5
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +75 -46
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +42 -19
- package/dist/application/managed/ManagedMemberComparisonService.js +2 -1
- package/dist/application/managed/ManagedNativeVerificationService.js +2 -1
- package/dist/application/process/ProcessCli.js +11 -11
- package/dist/application/process/ProcessEvidence.js +0 -1
- package/dist/artifacts/ArtifactProvider.js +39 -14
- package/dist/artifacts/ArtifactReader.js +31 -0
- package/dist/artifacts/DirectoryArtifactReader.js +2 -1
- package/dist/artifacts/MachOSliceArtifactReader.js +9 -2
- package/dist/artifacts/NativeDmgArtifactReader.js +65 -20
- package/dist/artifacts/SafeOutputTree.js +16 -2
- package/dist/artifacts/ZipArtifactReader.js +11 -4
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +4 -2
- package/dist/artifacts/apple/DylibResolutionReader.js +17 -7
- package/dist/artifacts/apple/KeyedArchiveReader.js +21 -3
- package/dist/artifacts/extraction/ArtifactExtraction.js +78 -21
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +67 -61
- package/dist/artifacts/inventory/ArtifactInventory.js +0 -1
- package/dist/artifacts/inventory/reader.js +3 -3
- package/dist/artifacts/inventory/scanCanonical.js +48 -24
- package/dist/artifacts/inventory/scanReader.js +5 -9
- package/dist/browser/BrowserScenarioPartialObservation.js +106 -0
- package/dist/browser/CdpBrowserProvider.js +2 -3
- package/dist/browser/CdpCaptureEventHandlers.js +2 -4
- package/dist/browser/CdpCaptureEvents.js +0 -1
- package/dist/browser/CdpCaptureValues.js +20 -0
- package/dist/browser/CdpElectronProvider.js +0 -2
- package/dist/browser/CdpElectronScriptEvents.js +2 -8
- package/dist/browser/CdpElectronScripts.js +2 -3
- package/dist/browser/CdpPageCaptureScripts.js +2 -3
- package/dist/browser/CdpSafeMetadata.js +10 -10
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +59 -44
- package/dist/browser/PlaywrightElectronActiveActions.js +2 -56
- package/dist/browser/PlaywrightElectronActiveProvider.js +10 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +1 -1
- package/dist/browser/PlaywrightScenarioBrowser.js +139 -39
- package/dist/browser/PlaywrightScenarioEvents.js +1 -1
- package/dist/browser/PlaywrightScenarioSession.js +39 -22
- package/dist/browser/assets/ScriptCaptureAdapters.js +1 -1
- package/dist/browser/history/CaptureFailures.js +6 -2
- package/dist/browser/history/MitmproxyCaptureAdapter.js +4 -2
- package/dist/catalogIdentity.js +0 -1
- package/dist/cli/analysisViewCommands.js +36 -0
- package/dist/cli/artifactCommands.js +11 -12
- package/dist/cli/coreAnalysisCommands.js +3 -3
- package/dist/cli/coreBinaryCommands.js +32 -27
- package/dist/cli/coreNativeCommands.js +9 -10
- package/dist/cli/electronCommands.js +4 -4
- package/dist/cli/interactiveSetup.js +6 -6
- package/dist/cli/managedCommands.js +7 -8
- package/dist/cli/nativeCallCommands.js +1 -2
- package/dist/cli/omittableDefaults.js +50 -0
- package/dist/cli/processCommands.js +3 -2
- package/dist/cli/setupCommands.js +16 -15
- package/dist/cli/utilityCommands.js +9 -9
- package/dist/cli.js +16 -8
- package/dist/cliBrowserScenarioCommands.js +2 -2
- package/dist/cliCommandNames.js +1 -0
- package/dist/cliJsonInput.js +15 -1
- package/dist/cliOutput.js +0 -38
- package/dist/composition/auxiliaryAnalysisProviders.js +27 -23
- package/dist/composition/binary.js +9 -9
- package/dist/composition/browserScenario.js +2 -1
- package/dist/composition/directAnalysis.js +20 -13
- package/dist/composition/electronScenario.js +1 -1
- package/dist/composition/optionalObservationProviders.js +12 -7
- package/dist/config/environment.js +6 -0
- package/dist/config/ghidraStartupTimeout.js +4 -9
- package/dist/config/homeDirectory.js +12 -0
- package/dist/config/mcpResponseBudget.js +9 -1
- package/dist/config/parseConfig.js +7 -3
- package/dist/config/parsers.js +19 -22
- package/dist/contracts/analysisViewToolContracts.js +56 -0
- package/dist/contracts/applicationToolContracts.js +5 -4
- package/dist/contracts/artifactComparisonExample.js +2 -2
- package/dist/contracts/artifactToolContracts.js +1 -1
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/browserToolContracts.js +19 -15
- package/dist/contracts/enhancedInputs.js +2 -2
- package/dist/contracts/enhancedToolContracts.js +4 -3
- package/dist/contracts/evm/evmToolContracts.js +1 -1
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +90 -0
- package/dist/contracts/investigationExamples.js +4 -3
- package/dist/contracts/javascript/electronToolContracts.js +1 -1
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +0 -20
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +245 -0
- package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +1 -1
- package/dist/contracts/managed/managedToolContracts.js +5 -10
- package/dist/contracts/managed/managedWorkflowToolContracts.js +1 -1
- package/dist/contracts/mobileApplicationGraphExamples.js +3 -3
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +1 -1
- package/dist/contracts/native/nativeToolContracts.js +2 -2
- package/dist/contracts/officialToolContracts.js +2 -1
- package/dist/contracts/promptContracts.js +2 -2
- package/dist/contracts/providerSelection.js +1 -1
- package/dist/contracts/sessionToolContracts.js +14 -2
- package/dist/contracts/sessionToolSchemas.js +1 -14
- package/dist/contracts/toolContracts.js +2 -0
- package/dist/contracts/toolEffects.js +1 -0
- package/dist/contracts/toolOutputSchemaGroups.js +136 -92
- package/dist/contracts/toolOutputSchemaPrimitives.js +11 -21
- package/dist/contracts/toolSchemaMetadata.js +18 -69
- package/dist/contracts/webNetworkCaptureToolContracts.js +1 -1
- package/dist/contracts/webRuntimeToolContracts.js +1 -1
- package/dist/contracts/webScriptToolContracts.js +1 -1
- package/dist/doctorRuntime.js +7 -5
- package/dist/domain/analysisErrorCore.js +3 -0
- package/dist/domain/analysisErrorPresentation.js +18 -3
- package/dist/domain/analysisErrorProjection.js +24 -5
- package/dist/domain/analysisSnapshot.js +29 -31
- package/dist/domain/analysisView/analysisView.js +243 -0
- package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
- package/dist/domain/analysisView/binaryLayoutView.js +159 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +238 -0
- package/dist/domain/android/androidApplication.js +1 -1
- package/dist/domain/apple/appleApplication.js +1 -1
- package/dist/domain/apple/dylibResolution.js +10 -3
- package/dist/domain/apple/interfaceBuilderGraph.js +0 -1
- package/dist/domain/apple/keyedArchive.js +26 -2
- package/dist/domain/artifactComparison.js +15 -6
- package/dist/domain/artifactGraph.js +16 -3
- package/dist/domain/artifactInventoryEvidence.js +9 -16
- package/dist/domain/artifactOperationError.js +3 -3
- package/dist/domain/artifactPartialObservation.js +1 -0
- package/dist/domain/artifactPathSyntax.js +49 -0
- package/dist/domain/binaryTarget.js +39 -13
- package/dist/domain/browserCaptureComparison.js +13 -49
- package/dist/domain/browserNetworkEvidence.js +10 -4
- package/dist/domain/browserObservation.js +0 -1
- package/dist/domain/browserObservationSchemas.js +14 -3
- package/dist/domain/browserScenario.js +0 -1
- package/dist/domain/browserScenarioCapture.js +1 -2
- package/dist/domain/browserScenarioDiff.js +0 -2
- package/dist/domain/browserScenarioDiffEvidence.js +0 -12
- package/dist/domain/browserScenarioDiffValues.js +2 -2
- package/dist/domain/browserScenarioValues.js +3 -4
- package/dist/domain/callPath.js +8 -9
- package/dist/domain/callPathSchemas.js +2 -2
- package/dist/domain/changedBehavior.js +3 -3
- package/dist/domain/completionLedgerGeneration.js +2 -1
- package/dist/domain/configurationErrors.js +12 -0
- package/dist/domain/conformancePackage.js +4 -3
- package/dist/domain/evidence.js +10 -36
- package/dist/domain/evidenceBundle.js +7 -9
- package/dist/domain/evidenceCompletionLedger.js +2 -1
- package/dist/domain/functionComparison.js +4 -5
- package/dist/domain/functionComparisonDimensions.js +120 -87
- package/dist/domain/functionComparisonNormalization.js +23 -34
- package/dist/domain/functionComparisonResults.js +1 -4
- package/dist/domain/functionComparisonSchemas.js +2 -8
- package/dist/domain/functionDossierEvidence.js +2 -37
- package/dist/domain/javascript/electronActiveObservation.js +26 -69
- package/dist/domain/javascript/electronObservation.js +14 -3
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +10 -9
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +2 -1
- package/dist/domain/javascript/electronStaticAnalysisNative.js +2 -1
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +2 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +26 -3
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +9 -2
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +5 -2
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +2 -1
- package/dist/{application/javascript/JavaScriptReturnShapeProjection.js → domain/javascript/javascriptExportReturnShapeProjection.js} +4 -4
- package/dist/domain/javascript/javascriptExportShapeComparison.js +7 -1
- package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +6 -1
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +29 -1
- package/dist/domain/javascript/javascriptExportShapeSelection.js +5 -5
- package/dist/domain/javascript/javascriptExportShapeVariants.js +67 -14
- package/dist/domain/javascript/javascriptFeatureSeed.js +20 -0
- package/dist/domain/javascript/javascriptFeatureTraversal.js +0 -1
- package/dist/domain/javascript/javascriptNativeHandoff.js +1 -1
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +0 -1
- package/dist/domain/javascript/javascriptRuntimeObservation.js +10 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +1 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +3 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +0 -1
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +9 -3
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +2 -1
- package/dist/domain/javascript/javascriptSemanticCalls.js +2 -1
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +2 -1
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +1 -1
- package/dist/domain/javascript/javascriptSemanticGraph.js +88 -46
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +77 -20
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +21 -27
- package/dist/domain/javascript/javascriptSemanticObjects.js +83 -42
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +1 -12
- package/dist/domain/javascript/javascriptSemanticProjection.js +2 -3
- package/dist/domain/javascript/javascriptSemanticPromises.js +2 -1
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +1 -1
- package/dist/domain/javascript/javascriptSemanticResources.js +1 -1
- package/dist/domain/javascript/javascriptSemanticReturns.js +32 -17
- package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
- package/dist/domain/javascript/javascriptSemanticValues.js +47 -54
- package/dist/domain/javascript/javascriptSourceMapPaths.js +104 -0
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +2 -1
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +0 -1
- package/dist/domain/javascript/sourceToBundleComparison.js +12 -3
- package/dist/domain/javascript/sourceToBundleSignals.js +47 -19
- package/dist/domain/localPath.js +1 -1
- package/dist/domain/managed/managedArtifact.js +6 -4
- package/dist/domain/managed/managedMemberComparison.js +2 -9
- package/dist/domain/managed/managedNativeVerification.js +0 -2
- package/dist/domain/managed/managedNativeVerificationMatch.js +9 -3
- package/dist/domain/native/binaryLayout.js +2 -3
- package/dist/domain/native/nativeApiBoundary.js +1 -1
- package/dist/domain/native/nativeCallObservation.js +5 -3
- package/dist/domain/native/nativeInstruction.js +7 -0
- package/dist/domain/native/recordedCrash.js +2 -3
- package/dist/domain/offsetDateTime.js +17 -0
- package/dist/domain/process/processCapture.js +13 -12
- package/dist/domain/process/processCaptureCoverage.js +67 -0
- package/dist/domain/process/processCaptureExample.js +2 -1
- package/dist/domain/process/processCaptureParsing.js +1 -34
- package/dist/domain/process/processCaptureValidation.js +81 -13
- package/dist/domain/process/processComparison.js +41 -22
- package/dist/domain/process/processObservation.js +10 -2
- package/dist/domain/process/processScenario.js +24 -2
- package/dist/domain/process/processTraceComparison.js +0 -2
- package/dist/domain/process/processTraceDimensionProjection.js +1 -1
- package/dist/domain/process/processTraceEvaluation.js +15 -11
- package/dist/domain/process/processTraceSpecification.js +3 -4
- package/dist/domain/providerAdapterError.js +2 -0
- package/dist/domain/reconstructionCoverage.js +5 -2
- package/dist/domain/reconstructionObligationLedgerSchemas.js +2 -1
- package/dist/domain/reconstructionReadinessSchemas.js +2 -1
- package/dist/domain/reconstructionVerification.js +3 -3
- package/dist/domain/reconstructionVerificationSchemas.js +2 -1
- package/dist/domain/referenceSourceGraph.js +20 -21
- package/dist/domain/staticRuntimeCorrelation.js +2 -2
- package/dist/domain/stringPatterns.js +6 -0
- package/dist/domain/swiftSymbolClassification.js +61 -0
- package/dist/domain/symbolAnalysis.js +66 -18
- package/dist/domain/webCaptureDiff.js +0 -1
- package/dist/domain/webCaptureDiffSchemas.js +6 -3
- package/dist/domain/webEventListeners.js +3 -2
- package/dist/domain/webExecution.js +3 -2
- package/dist/domain/webRuntime.js +0 -2
- package/dist/domain/webScriptExport.js +1 -1
- package/dist/dotnet/ManagedArtifactInspector.js +2 -19
- package/dist/dotnet/ManagedMemberInspector.js +12 -18
- package/dist/dotnet/ManagedMemberInspectorCore.js +47 -44
- package/dist/dotnet/ManagedMemberRows.js +75 -62
- package/dist/dotnet/ManagedMetadataInventory.js +16 -22
- package/dist/dotnet/ManagedMethodBodyReader.js +4 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +109 -94
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +12 -21
- package/dist/dotnet/ManagedReaderFailure.js +16 -0
- package/dist/dotnet/ManagedStaticProvider.js +3 -5
- package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
- package/dist/evaluation/AgentEvaluationReport.js +28 -0
- package/dist/evaluation/CodexAgentEval.js +12 -8
- package/dist/evaluation/KnownAnswerEvaluation.js +281 -0
- package/dist/evm/EvmoleInterfaceProvider.js +2 -1
- package/dist/firmware/FirmwareCommand.js +9 -5
- package/dist/firmware/FirmwareProvider.js +4 -4
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +3 -6
- package/dist/ghidra/GhidraClient.js +91 -32
- package/dist/ghidra/GhidraClientStartup.js +0 -2
- package/dist/ghidra/GhidraDoctor.js +6 -5
- package/dist/ghidra/GhidraFunctionValues.js +3 -5
- package/dist/ghidra/GhidraInstallation.js +40 -12
- package/dist/ghidra/GhidraJavaLaunch.js +6 -2
- package/dist/ghidra/GhidraLauncher.js +15 -7
- package/dist/ghidra/GhidraProvider.js +6 -2
- package/dist/ghidra/GhidraProviderCapabilities.js +6 -0
- package/dist/ghidra/GhidraProviderClient.js +13 -3
- package/dist/ghidra/GhidraSessionError.js +2 -0
- package/dist/ghidra/GhidraSessionRoot.js +39 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +17 -10
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +8 -2
- package/dist/hopper/BridgeLauncher.js +34 -45
- package/dist/hopper/HopperAnalysisProfile.js +3 -8
- package/dist/hopper/HopperCleanup.js +56 -27
- package/dist/hopper/HopperClient.js +86 -65
- package/dist/hopper/HopperMachOImage.js +3 -2
- package/dist/hopper/HopperProvider.js +16 -18
- package/dist/hopper/HopperRegexSearch.js +3 -6
- package/dist/hopper/HopperTargetLease.js +132 -49
- package/dist/hopper/LinuxPrivateDisplayProbe.js +6 -0
- package/dist/ida/IdaConfiguration.js +8 -3
- package/dist/ida/IdaInput.js +1 -7
- package/dist/ida/IdaMcpConnection.js +8 -4
- package/dist/ida/IdaOperationRunner.js +3 -3
- package/dist/ida/IdaProvider.js +8 -12
- package/dist/ida/IdaSessionClient.js +20 -18
- package/dist/ida/IdaWorkspace.js +12 -13
- package/dist/inspector/V8InspectorCaptureProjection.js +1 -1
- package/dist/inspector/V8InspectorProvider.js +38 -28
- package/dist/javascript/recovery/WakaruCommand.js +7 -2
- package/dist/javascript/recovery/WakaruExecution.js +5 -2
- package/dist/main/shutdown.js +11 -3
- package/dist/main/startup.js +9 -2
- package/dist/main/transport.js +22 -2
- package/dist/main.js +11 -18
- package/dist/native/AppleMachoSelection.js +16 -6
- package/dist/native/CommandRunner.js +9 -7
- package/dist/native/LldbCallTracer.js +8 -2
- package/dist/native/NativeMacOSProvider.js +25 -15
- package/dist/native/NativeUiHelperRuntime.js +11 -2
- package/dist/native/NativeUiObservation.js +2 -2
- package/dist/native/pwntools/PwntoolsDecoder.js +2 -1
- package/dist/process/DarwinProcessRunTokenReader.js +16 -2
- package/dist/process/ExecFileOutput.js +88 -6
- package/dist/process/PrivateRuntimeRoot.js +10 -5
- package/dist/process/ProcessOwnership.js +1 -4
- package/dist/process/ProcessOwnershipObservation.js +11 -5
- package/dist/process/ProviderProcess.js +1 -3
- package/dist/process/capture/FilesystemSnapshot.js +50 -13
- package/dist/process/capture/ProcessCaptureError.js +13 -0
- package/dist/process/capture/ProcessCaptureLifecycle.js +158 -70
- package/dist/process/capture/ProcessFilesystemEffects.js +33 -3
- package/dist/process/capture/ProcessHarness.js +21 -25
- package/dist/process/capture/ProcessNormalization.js +20 -2
- package/dist/process/capture/ProcessSampling.js +25 -2
- package/dist/process/capture/TerminalRenderer.js +14 -0
- package/dist/process/snapshotEnvironment.js +14 -0
- package/dist/server/EvidenceMcpServer.js +25 -14
- package/dist/server/createServer.js +49 -36
- package/dist/server/mcpClientMetadata.js +12 -5
- package/dist/server/promptCompletion.js +3 -8
- package/dist/server/registerAnalysisViewTool.js +15 -0
- package/dist/server/registerAndroidTools.js +2 -3
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -5
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +4 -5
- package/dist/server/registerApplicationTools/coverage.js +1 -2
- package/dist/server/registerApplicationTools/helpers.js +1 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +4 -5
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -4
- package/dist/server/registerApplicationTools/traceFeature.js +4 -5
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +4 -5
- package/dist/server/registerBinaryDiagnosticsTools.js +2 -3
- package/dist/server/registerBrowserScenarioTool.js +3 -4
- package/dist/server/registerBrowserTools.js +13 -16
- package/dist/server/registerBundleComparisonTool.js +5 -6
- package/dist/server/registerCloseLifecycleTool.js +2 -3
- package/dist/server/registerElectronTools.js +10 -13
- package/dist/server/registerEnhancedTools.js +23 -23
- package/dist/server/registerEvidenceTools.js +3 -4
- package/dist/server/registerEvmTools.js +2 -3
- package/dist/server/registerFirmwareTools.js +2 -3
- package/dist/server/registerFunctionComparisonTool.js +7 -8
- package/dist/server/registerInvestigationTools.js +14 -15
- package/dist/server/registerJavaScriptRecoveryTool.js +2 -3
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +6 -6
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +5 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +4 -5
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +6 -7
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +6 -7
- package/dist/server/registerOfficialTools.js +4 -19
- package/dist/server/registerProcessComparisonTool.js +8 -8
- package/dist/server/registerRecordedCrashTools.js +2 -3
- package/dist/server/registerSessionRecordTools.js +15 -19
- package/dist/server/registerSessionStatusTool.js +3 -4
- package/dist/server/registerSessionTools.js +12 -18
- package/dist/server/registerWebModuleTool.js +2 -3
- package/dist/server/registerWebNetworkCaptureTool.js +2 -3
- package/dist/server/registerWebRuntimeTools.js +4 -5
- package/dist/server/registerWebScriptTool.js +2 -3
- package/dist/server/registerWebSourceLocationTool.js +2 -3
- package/dist/server/toolResult.js +66 -94
- package/dist/server/toolResultEncoding.js +11 -10
- package/dist/windows/WindowsNativeLoader.js +1 -0
- package/dist/windows/WindowsOwnedProcess.js +60 -15
- package/dist/windows/WindowsPrivateRuntime.js +7 -8
- package/native/windows/README.md +3 -1
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +39 -30
- package/scripts/rea.mjs +3 -6
- package/skills/reverse-engineer-anything/SKILL.md +9 -8
- package/skills/reverse-engineer-anything/references/android-applications.md +6 -3
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -4
- package/skills/reverse-engineer-anything/references/javascript-applications.md +16 -6
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +9 -0
- package/dist/config.js +0 -1
- package/dist/contracts/browserCaptureToolInputSchema.js +0 -43
- package/dist/contracts/process/processCaptureExample.js +0 -2
- package/dist/contracts/toolOutputSchemas.js +0 -2
- package/dist/main/reload.js +0 -12
- package/dist/main/state.js +0 -3
- package/dist/server/sessionToolPolicies.js +0 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createJavaScriptSemanticGraphUnknown } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
2
2
|
import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, } from "./JavaScriptSemanticGraphConstruction.js";
|
|
3
3
|
import { unknownSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
|
|
4
|
-
import { semanticCallSiteAt, } from "./JavaScriptSemanticGraphFlowProjection.js";
|
|
5
4
|
/** Project child creation, argv/env/stdio, listeners, and signals. */
|
|
6
5
|
export const projectSemanticChildProcesses = (context) => {
|
|
7
6
|
const processNodes = new Map(context.ir.childProcessSpawns.flatMap((spawn) => {
|
|
@@ -34,7 +33,7 @@ const addChildProcessNode = (context, spawn) => retainSemanticGraphNode(context.
|
|
|
34
33
|
},
|
|
35
34
|
});
|
|
36
35
|
const projectSpawn = (context, spawn, child) => {
|
|
37
|
-
const callSite =
|
|
36
|
+
const callSite = context.callSiteAt(spawn.location);
|
|
38
37
|
addSemanticGraphRelation(context.state, {
|
|
39
38
|
source: callSite,
|
|
40
39
|
target: child,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createJavaScriptSemanticGraphUnknown } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
2
2
|
import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, } from "./JavaScriptSemanticGraphConstruction.js";
|
|
3
3
|
import { unknownSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
|
|
4
|
-
import { semanticCallSiteAt, } from "./JavaScriptSemanticGraphFlowProjection.js";
|
|
5
4
|
/** Project environment, argv, file, default, and precedence candidates. */
|
|
6
5
|
export const projectSemanticConfiguration = (context) => {
|
|
7
6
|
const configNodes = new Map(context.ir.configurationOperations.flatMap((operation) => {
|
|
@@ -110,7 +109,7 @@ const addRequestNode = (context, operation) => retainSemanticGraphNode(context.s
|
|
|
110
109
|
},
|
|
111
110
|
});
|
|
112
111
|
const projectRequestConstruction = (context, operation, request) => {
|
|
113
|
-
const callSite =
|
|
112
|
+
const callSite = context.callSiteAt(operation.location);
|
|
114
113
|
addSemanticGraphRelation(context.state, {
|
|
115
114
|
source: callSite,
|
|
116
115
|
target: request,
|
|
@@ -142,7 +141,7 @@ const projectRequestConstruction = (context, operation, request) => {
|
|
|
142
141
|
const projectResponseConsumer = (context, operation, response) => {
|
|
143
142
|
addSemanticGraphRelation(context.state, {
|
|
144
143
|
source: response,
|
|
145
|
-
target:
|
|
144
|
+
target: context.callSiteAt(operation.location),
|
|
146
145
|
relation: "consumed-by",
|
|
147
146
|
resolution: operation.resolution === "complete" ? "resolved" : "candidate",
|
|
148
147
|
properties: { method: operation.method },
|
|
@@ -2,10 +2,6 @@ import { createJavaScriptSemanticGraphUnknown } from "../../domain/javascript/ja
|
|
|
2
2
|
import { sourceRangesEqual } from "../../domain/javascript/javascriptStaticAnalysisHelpers.js";
|
|
3
3
|
import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, } from "./JavaScriptSemanticGraphConstruction.js";
|
|
4
4
|
import { inferredSemanticEvidenceAt, unknownSemanticEvidence, } from "./JavaScriptSemanticGraphEvidence.js";
|
|
5
|
-
/** Find the retained call-site node at one exact semantic source range. */
|
|
6
|
-
export const semanticCallSiteAt = (context, location) => {
|
|
7
|
-
return context.callSiteAt(location);
|
|
8
|
-
};
|
|
9
5
|
/** Project explicit static Promise/task ownership without runtime claims. */
|
|
10
6
|
export const projectSemanticPromises = (context) => {
|
|
11
7
|
const promiseNodes = new Map(context.ir.promiseOperations.flatMap((operation) => {
|
|
@@ -46,7 +42,7 @@ const projectPromiseCreation = (context, operation, promise) => {
|
|
|
46
42
|
if (operation.kind === "awaited-expression")
|
|
47
43
|
return;
|
|
48
44
|
addSemanticGraphRelation(context.state, {
|
|
49
|
-
source:
|
|
45
|
+
source: context.callSiteAt(operation.location),
|
|
50
46
|
target: promise,
|
|
51
47
|
relation: "creates-promise",
|
|
52
48
|
resolution: operation.kind === "chain" || operation.sourceResolution !== "complete"
|
|
@@ -1,80 +1,109 @@
|
|
|
1
|
+
import { semanticSlotAtPath, semanticContainer, semanticPropertyPointer, } from "../../domain/javascript/javascriptSemanticSlots.js";
|
|
1
2
|
import { createJavaScriptSemanticGraphUnknown } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
2
3
|
import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, } from "./JavaScriptSemanticGraphConstruction.js";
|
|
3
4
|
import { unknownSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
|
|
4
5
|
import { semanticPropertySlot } from "./JavaScriptSemanticGraphValueProjection.js";
|
|
5
6
|
/** Project static object reads, writes, spreads, and destructuring. */
|
|
6
7
|
export const projectSemanticObjects = (context) => {
|
|
8
|
+
const values = new Map(context.ir.bindings.map((binding) => [binding.bindingId, binding.value]));
|
|
7
9
|
for (const operation of context.ir.objectOperations) {
|
|
8
10
|
const occurrence = addObjectOccurrence(context, operation);
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
const target = objectTarget(context, values, operation);
|
|
12
|
+
const ends = objectRelationEnds(context, operation, occurrence, target);
|
|
13
|
+
const resolved = operation.resolution === "complete" &&
|
|
14
|
+
(operation.kind === "write"
|
|
15
|
+
? target.receiverResolved
|
|
16
|
+
: target.presence === "present");
|
|
17
|
+
addSemanticGraphRelation(context.state, {
|
|
18
|
+
...ends,
|
|
19
|
+
relation: OBJECT_RELATIONS[operation.kind],
|
|
20
|
+
resolution: resolved ? "resolved" : "candidate",
|
|
21
|
+
});
|
|
22
|
+
if (!resolved)
|
|
23
|
+
addObjectUnknown(context, operation, target.slot ?? occurrence, target);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const OBJECT_RELATIONS = {
|
|
27
|
+
read: "reads-property",
|
|
28
|
+
write: "writes-property",
|
|
29
|
+
destructure: "destructures",
|
|
30
|
+
spread: "spreads",
|
|
31
|
+
};
|
|
32
|
+
const objectTarget = (context, values, operation) => {
|
|
33
|
+
const binding = operation.objectBindingId === null
|
|
34
|
+
? undefined
|
|
35
|
+
: context.bindingNodes.get(operation.objectBindingId);
|
|
36
|
+
const value = operation.objectBindingId === null
|
|
37
|
+
? undefined
|
|
38
|
+
: values.get(operation.objectBindingId);
|
|
39
|
+
if (operation.objectBindingId === null ||
|
|
40
|
+
operation.propertyPath === null ||
|
|
41
|
+
value === undefined)
|
|
42
|
+
return {
|
|
43
|
+
objectNode: binding,
|
|
44
|
+
slot: null,
|
|
45
|
+
presence: "unknown-coverage",
|
|
46
|
+
receiverResolved: false,
|
|
47
|
+
};
|
|
48
|
+
const fact = semanticSlotAtPath(value, operation.propertyPath);
|
|
49
|
+
if (operation.propertyPath.length === 0)
|
|
50
|
+
return {
|
|
51
|
+
objectNode: binding,
|
|
52
|
+
slot: null,
|
|
53
|
+
presence: fact.presence,
|
|
54
|
+
receiverResolved: semanticContainer(value) !== null,
|
|
55
|
+
};
|
|
56
|
+
const slot = semanticPropertySlot(context, operation.objectBindingId, operation.propertyPath, fact);
|
|
57
|
+
const receiver = semanticSlotAtPath(value, operation.propertyPath.slice(0, -1));
|
|
58
|
+
return {
|
|
59
|
+
objectNode: slot,
|
|
60
|
+
slot,
|
|
61
|
+
presence: fact.presence,
|
|
62
|
+
receiverResolved: receiver.presence === "present" &&
|
|
63
|
+
semanticContainer(receiver.value) !== null,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const objectRelationEnds = (context, operation, occurrence, target) => {
|
|
67
|
+
switch (operation.kind) {
|
|
68
|
+
case "read":
|
|
69
|
+
return { source: target.slot, target: occurrence };
|
|
70
|
+
case "write":
|
|
71
|
+
return { source: occurrence, target: target.slot };
|
|
72
|
+
case "destructure":
|
|
73
|
+
return {
|
|
74
|
+
source: target.slot,
|
|
29
75
|
target: operation.targetBindingId === null
|
|
30
76
|
? undefined
|
|
31
77
|
: context.bindingNodes.get(operation.targetBindingId),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
else
|
|
36
|
-
addSemanticGraphRelation(context.state, {
|
|
37
|
-
source: operation.objectBindingId === null
|
|
38
|
-
? undefined
|
|
39
|
-
: context.bindingNodes.get(operation.objectBindingId),
|
|
40
|
-
target: occurrence,
|
|
41
|
-
relation: "spreads",
|
|
42
|
-
resolution: operation.resolution === "complete" ? "resolved" : "candidate",
|
|
43
|
-
});
|
|
44
|
-
if (operation.resolution !== "complete")
|
|
45
|
-
addObjectUnknown(context, operation, slot ?? occurrence);
|
|
78
|
+
};
|
|
79
|
+
case "spread":
|
|
80
|
+
return { source: target.objectNode, target: occurrence };
|
|
46
81
|
}
|
|
47
82
|
};
|
|
48
83
|
const addObjectOccurrence = (context, operation) => retainSemanticGraphNode(context.state, context.file, {
|
|
49
84
|
kind: "expression",
|
|
50
85
|
roleKey: operation.objectOperationId,
|
|
51
86
|
location: operation.location,
|
|
52
|
-
label: operation.
|
|
87
|
+
label: operation.propertyPath === null
|
|
53
88
|
? operation.kind
|
|
54
|
-
: `${operation.kind}:${operation.
|
|
89
|
+
: `${operation.kind}:${semanticPropertyPointer(operation.propertyPath)}`,
|
|
55
90
|
functionNodeId: operation.ownerCallableId === null
|
|
56
91
|
? null
|
|
57
92
|
: (context.callableNodes.get(operation.ownerCallableId)?.node_id ??
|
|
58
93
|
null),
|
|
59
94
|
properties: {
|
|
60
95
|
operation_kind: operation.kind,
|
|
61
|
-
|
|
96
|
+
property_path: operation.propertyPath === null ? null : [...operation.propertyPath],
|
|
62
97
|
},
|
|
63
98
|
});
|
|
64
|
-
const addObjectUnknown = (context, operation, node) => {
|
|
65
|
-
const relation = operation.kind
|
|
66
|
-
? "reads-property"
|
|
67
|
-
: operation.kind === "write"
|
|
68
|
-
? "writes-property"
|
|
69
|
-
: operation.kind === "spread"
|
|
70
|
-
? "spreads"
|
|
71
|
-
: "destructures";
|
|
99
|
+
const addObjectUnknown = (context, operation, node, target) => {
|
|
100
|
+
const relation = OBJECT_RELATIONS[operation.kind];
|
|
72
101
|
addSemanticGraphUnknown(context.state, createJavaScriptSemanticGraphUnknown({
|
|
73
102
|
node_id: node?.node_id ?? null,
|
|
74
103
|
family: "object-flow",
|
|
75
104
|
relation_kinds: [relation],
|
|
76
105
|
reason: "ambiguous-target",
|
|
77
|
-
detail: `Static ${operation.kind} object identity is
|
|
106
|
+
detail: `Static ${operation.kind} property ${operation.propertyPath === null ? "path is unresolved" : semanticPropertyPointer(operation.propertyPath)} has ${target.presence} presence; its receiver is ${target.receiverResolved ? "a retained container" : "unresolved or not a retained container"}; object identity is ${operation.resolution}.`,
|
|
78
107
|
candidate_node_ids: [],
|
|
79
108
|
evidence: unknownSemanticEvidence(context.file, operation.location),
|
|
80
109
|
}));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createJavaScriptSemanticGraphUnknown } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
2
2
|
import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, } from "./JavaScriptSemanticGraphConstruction.js";
|
|
3
3
|
import { unknownSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
|
|
4
|
-
import { semanticCallSiteAt, } from "./JavaScriptSemanticGraphFlowProjection.js";
|
|
5
4
|
/** Project built-in resource acquisition and exact local release handles. */
|
|
6
5
|
export const projectSemanticResources = (context) => {
|
|
7
6
|
const resourceNodes = new Map(context.ir.resourceOperations.flatMap((operation) => {
|
|
@@ -13,7 +12,7 @@ export const projectSemanticResources = (context) => {
|
|
|
13
12
|
for (const operation of context.ir.resourceOperations)
|
|
14
13
|
if (operation.kind === "acquire")
|
|
15
14
|
addSemanticGraphRelation(context.state, {
|
|
16
|
-
source:
|
|
15
|
+
source: context.callSiteAt(operation.location),
|
|
17
16
|
target: resourceNodes.get(operation.resourceId),
|
|
18
17
|
relation: "acquires",
|
|
19
18
|
resolution: "resolved",
|
|
@@ -33,7 +32,7 @@ const addResourceNode = (context, operation) => retainSemanticGraphNode(context.
|
|
|
33
32
|
properties: { method: operation.method },
|
|
34
33
|
});
|
|
35
34
|
const projectRelease = (context, operation, resourceNodes) => {
|
|
36
|
-
const callSite =
|
|
35
|
+
const callSite = context.callSiteAt(operation.location);
|
|
37
36
|
const resources = operation.linkedResourceIds.flatMap((identifier) => {
|
|
38
37
|
const resource = resourceNodes.get(identifier);
|
|
39
38
|
return resource === undefined ? [] : [resource];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { semanticContainer, semanticPropertyPointer, } from "../../domain/javascript/javascriptSemanticSlots.js";
|
|
1
2
|
import { createJavaScriptSemanticGraphUnknown } from "../../domain/javascript/javascriptSemanticGraph.js";
|
|
2
3
|
import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnknown, } from "./JavaScriptSemanticGraphConstruction.js";
|
|
3
|
-
import { observedSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
|
|
4
|
+
import { observedSemanticEvidence, unknownSemanticEvidence, } from "./JavaScriptSemanticGraphEvidence.js";
|
|
4
5
|
/** Project bounded literal values and object slots for exact query seeds. */
|
|
5
6
|
export const projectSemanticValues = (context) => {
|
|
6
7
|
for (const binding of context.ir.bindings) {
|
|
@@ -12,12 +13,13 @@ export const projectSemanticValues = (context) => {
|
|
|
12
13
|
binding,
|
|
13
14
|
value: binding.value,
|
|
14
15
|
target: bindingNode,
|
|
15
|
-
|
|
16
|
+
path: [],
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
const projectValue = (input) => {
|
|
20
|
-
const { context, binding, value, target,
|
|
21
|
+
const { context, binding, value, target, path } = input;
|
|
22
|
+
const role = path.length === 0 ? "binding" : `property:${semanticPropertyPointer(path)}`;
|
|
21
23
|
if (target === null)
|
|
22
24
|
return;
|
|
23
25
|
if (value.status === "literal") {
|
|
@@ -39,23 +41,39 @@ const projectValue = (input) => {
|
|
|
39
41
|
resolution: "candidate",
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
|
-
else if (value.status === "object")
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
else if (value.status === "object" || value.status === "array") {
|
|
45
|
+
const container = semanticContainer(value);
|
|
46
|
+
for (const property of container.slots) {
|
|
47
|
+
const propertyPath = [...path, property.name];
|
|
48
|
+
const slot = semanticPropertySlot(context, binding.bindingId, propertyPath, property);
|
|
49
|
+
if (property.presence === "absent")
|
|
50
|
+
continue;
|
|
45
51
|
addSemanticGraphRelation(context.state, {
|
|
46
52
|
source: target,
|
|
47
53
|
target: slot,
|
|
48
54
|
relation: "writes-property",
|
|
49
|
-
resolution:
|
|
50
|
-
});
|
|
51
|
-
projectValue({
|
|
52
|
-
context,
|
|
53
|
-
binding,
|
|
54
|
-
value: property.value,
|
|
55
|
-
target: slot,
|
|
56
|
-
role: `property:${property.name}`,
|
|
55
|
+
resolution: property.presence === "present" ? "resolved" : "candidate",
|
|
57
56
|
});
|
|
57
|
+
if (property.presence === "present")
|
|
58
|
+
projectValue({
|
|
59
|
+
context,
|
|
60
|
+
binding,
|
|
61
|
+
value: property.value,
|
|
62
|
+
target: slot,
|
|
63
|
+
path: propertyPath,
|
|
64
|
+
});
|
|
58
65
|
}
|
|
66
|
+
if (container.coverage.status === "partial")
|
|
67
|
+
addSemanticGraphUnknown(context.state, createJavaScriptSemanticGraphUnknown({
|
|
68
|
+
node_id: target.node_id,
|
|
69
|
+
family: "object-flow",
|
|
70
|
+
relation_kinds: ["writes-property"],
|
|
71
|
+
reason: "ambiguous-target",
|
|
72
|
+
detail: `Initializer container has unknown ${value.status === "object" ? "properties" : "items"}${container.coverage.omitted === null ? " with an unknown omitted count" : `; ${container.coverage.omitted} omitted`}.`,
|
|
73
|
+
candidate_node_ids: [target.node_id],
|
|
74
|
+
evidence: unknownSemanticEvidence(context.file, binding.definitions[0]?.location ?? null),
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
59
77
|
else if (value.status === "unknown" && value.resourceLimit !== undefined) {
|
|
60
78
|
const location = binding.definitions[0]?.location ?? null;
|
|
61
79
|
const evidence = observedSemanticEvidence(context.file, location);
|
|
@@ -85,15 +103,20 @@ const addLiteralNode = (context, binding, value, role) => retainSemanticGraphNod
|
|
|
85
103
|
functionNodeId: context.bindingNodes.get(binding.bindingId)?.function_node_id ?? null,
|
|
86
104
|
properties: { value },
|
|
87
105
|
});
|
|
88
|
-
/** Create one canonical
|
|
89
|
-
export const semanticPropertySlot = (context, objectBindingId,
|
|
106
|
+
/** Create one canonical slot for a root binding and exact static property path. */
|
|
107
|
+
export const semanticPropertySlot = (context, objectBindingId, path, fact) => retainSemanticGraphNode(context.state, context.file, {
|
|
90
108
|
kind: "property-slot",
|
|
91
|
-
roleKey: `property:${objectBindingId}
|
|
109
|
+
roleKey: `property:${JSON.stringify([objectBindingId, path])}`,
|
|
92
110
|
location: null,
|
|
93
|
-
label: name,
|
|
111
|
+
label: fact.name,
|
|
94
112
|
functionNodeId: context.bindingNodes.get(objectBindingId)?.function_node_id ?? null,
|
|
95
113
|
properties: {
|
|
96
|
-
name,
|
|
114
|
+
name: fact.name,
|
|
115
|
+
property_path: [...path],
|
|
116
|
+
property_pointer: semanticPropertyPointer(path),
|
|
97
117
|
object_binding_id: objectBindingId,
|
|
118
|
+
presence: fact.presence,
|
|
119
|
+
value_status: fact.value.status,
|
|
120
|
+
value_coverage: semanticContainer(fact.value)?.coverage ?? null,
|
|
98
121
|
},
|
|
99
122
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { compareManagedMembers, managedMemberComparisonResultSchema,
|
|
4
|
+
import { compareManagedMembers, managedMemberComparisonResultSchema, } from "../../domain/managed/managedMemberComparison.js";
|
|
5
|
+
import { parseManagedMemberEvidence } from "../../domain/managed/managedMemberComparisonMatch.js";
|
|
5
6
|
import { AnalysisProtocolError } from "../../domain/analysisErrorCore.js";
|
|
6
7
|
import { EvidenceIntegrityError } from "../../domain/evidenceErrors.js";
|
|
7
8
|
import {} from "../../domain/analysisErrorBase.js";
|
|
@@ -3,10 +3,11 @@ import { AnalysisProtocolError } from "../../domain/analysisErrorCore.js";
|
|
|
3
3
|
import {} from "../../domain/analysisErrorBase.js";
|
|
4
4
|
import { createEvidence } from "../../domain/evidence.js";
|
|
5
5
|
import { jsonValueSchema } from "../../domain/jsonValue.js";
|
|
6
|
-
import { managedNativeVerificationInputSchema,
|
|
6
|
+
import { managedNativeVerificationInputSchema, } from "../../domain/managed/managedNativeVerificationSchemas.js";
|
|
7
7
|
import { err, ok } from "../../domain/result.js";
|
|
8
8
|
import { MANAGED_WORKFLOW_PROVIDER } from "../InvestigationProviders.js";
|
|
9
9
|
import { requestInputError, workflowInputError, } from "../workflowInputError.js";
|
|
10
|
+
import { verifyManagedNativeBoundaries } from "../../domain/managed/managedNativeVerification.js";
|
|
10
11
|
const OPERATION = "verify_managed_native_boundaries";
|
|
11
12
|
/** Verify managed/native boundary declarations against native Evidence. */
|
|
12
13
|
export const verifyManagedNativeBoundariesEvidence = (rawInput) => {
|
|
@@ -7,11 +7,13 @@ import { createEvidence, parseEvidence } from "../../domain/evidence.js";
|
|
|
7
7
|
import { describeValidationFailure } from "../../domain/evidenceBundle.js";
|
|
8
8
|
import { jsonValueSchema } from "../../domain/jsonValue.js";
|
|
9
9
|
import { analysisInputErrorFromIssues, projectInputIssues, } from "../../domain/inputIssueProjection.js";
|
|
10
|
-
import { processTraceSpecificationSchema } from "../../domain/process/
|
|
10
|
+
import { processTraceSpecificationSchema } from "../../domain/process/processTraceSpecification.js";
|
|
11
11
|
import { processScenarioSchema } from "../../domain/process/processScenario.js";
|
|
12
|
-
import { compareProcessCaptures
|
|
12
|
+
import { compareProcessCaptures } from "../../domain/process/processComparison.js";
|
|
13
|
+
import { parseProcessCapture } from "../../domain/process/processCaptureParsing.js";
|
|
13
14
|
import { captureProcessScenario } from "../../process/capture/ProcessHarness.js";
|
|
14
|
-
import { PROCESS_PROVIDER
|
|
15
|
+
import { PROCESS_PROVIDER } from "../../domain/process/processEvidenceProvider.js";
|
|
16
|
+
import { createProcessCaptureEvidence } from "./ProcessEvidence.js";
|
|
15
17
|
/** Identify the process workflow's typed diagnostic result for CLI exit status. */
|
|
16
18
|
export const isProcessCliFailure = (value) => typeof value === "object" &&
|
|
17
19
|
value !== null &&
|
|
@@ -22,13 +24,13 @@ export const isProcessCliFailure = (value) => typeof value === "object" &&
|
|
|
22
24
|
"message" in value &&
|
|
23
25
|
typeof value.message === "string";
|
|
24
26
|
/** Capture one JSON scenario through the shared process harness and Evidence contract. */
|
|
25
|
-
export const captureProcessScenarioFile = async (path, environment = process.env) => {
|
|
27
|
+
export const captureProcessScenarioFile = async (path, environment = process.env, signal) => {
|
|
26
28
|
try {
|
|
27
29
|
const input = await readJson(path);
|
|
28
30
|
const parsed = processScenarioSchema.safeParse(input);
|
|
29
31
|
if (!parsed.success)
|
|
30
32
|
throw analysisInputErrorFromIssues("capture_process_scenario", parsed.error.issues, input, { cause: parsed.error });
|
|
31
|
-
const captured = await captureProcessScenario(parsed.data,
|
|
33
|
+
const captured = await captureProcessScenario(parsed.data, signal, process.platform, environment);
|
|
32
34
|
if (!captured.ok)
|
|
33
35
|
return cliAnalysisError(captured.error);
|
|
34
36
|
return createProcessCaptureEvidence(parsed.data, captured.value);
|
|
@@ -118,8 +120,7 @@ const readJson = async (path) => {
|
|
|
118
120
|
bytes = await readFile(path);
|
|
119
121
|
}
|
|
120
122
|
catch (cause) {
|
|
121
|
-
|
|
122
|
-
throw new ProcessCliFailure("invalid_input", "Process input file could not be read. Check that the path exists and is readable.");
|
|
123
|
+
throw new ProcessCliFailure("invalid_input", `Process input file could not be read: ${path} (${describeValidationFailure(cause)}). Check the reported filesystem constraint and retry.`);
|
|
123
124
|
}
|
|
124
125
|
try {
|
|
125
126
|
const text = new TextDecoder("utf-8", {
|
|
@@ -130,8 +131,7 @@ const readJson = async (path) => {
|
|
|
130
131
|
return parsed;
|
|
131
132
|
}
|
|
132
133
|
catch (cause) {
|
|
133
|
-
|
|
134
|
-
throw new ProcessCliFailure("invalid_input", "Process input file is not valid JSON. Repair the file, then try again.");
|
|
134
|
+
throw new ProcessCliFailure("invalid_input", `Process input file is not valid UTF-8 JSON: ${path} (${describeValidationFailure(cause)}). Repair the file, then try again.`);
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
class ProcessCliFailure extends Error {
|
|
@@ -147,7 +147,7 @@ const cliAnalysisError = (error) => ({
|
|
|
147
147
|
error: "Process command failed",
|
|
148
148
|
...projectAnalysisError(error),
|
|
149
149
|
});
|
|
150
|
-
/**
|
|
150
|
+
/** Preserve typed failures and local diagnostics at the process CLI boundary. */
|
|
151
151
|
export const projectProcessCliError = (cause) => {
|
|
152
152
|
if (cause instanceof ProcessCliFailure)
|
|
153
153
|
return {
|
|
@@ -160,6 +160,6 @@ export const projectProcessCliError = (cause) => {
|
|
|
160
160
|
return {
|
|
161
161
|
error: "Process command failed",
|
|
162
162
|
category: "execution_failure",
|
|
163
|
-
message:
|
|
163
|
+
message: `Process command could not complete: ${describeValidationFailure(cause)}`,
|
|
164
164
|
};
|
|
165
165
|
};
|
|
@@ -2,7 +2,6 @@ import { posix, win32 } from "node:path";
|
|
|
2
2
|
import { createEvidence } from "../../domain/evidence.js";
|
|
3
3
|
import { PROCESS_PROVIDER } from "../../domain/process/processEvidenceProvider.js";
|
|
4
4
|
import { jsonValueSchema } from "../../domain/jsonValue.js";
|
|
5
|
-
export { PROCESS_PROVIDER } from "../../domain/process/processEvidenceProvider.js";
|
|
6
5
|
/** Project one process scenario into secret-free Evidence parameters. */
|
|
7
6
|
const processEvidenceParameters = (scenario, platform) => ({
|
|
8
7
|
executable_name: (platform === "win32" ? win32 : posix).basename(scenario.executable),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { snapshotEnvironment } from "../process/snapshotEnvironment.js";
|
|
1
2
|
import { createAnalysisExecution, } from "../application/AnalysisProvider.js";
|
|
2
3
|
import { inspectBundleKeyedArchive } from "./apple/KeyedArchiveReader.js";
|
|
3
4
|
import { traceDylibResolution } from "./apple/DylibResolutionReader.js";
|
|
@@ -7,7 +8,7 @@ import { extractArtifact } from "./extraction/ArtifactExtraction.js";
|
|
|
7
8
|
import { analyzeInterfaceBuilderBundle } from "./apple/InterfaceBuilderAnalysis.js";
|
|
8
9
|
import { analyzeAppleAssetCatalogs } from "./apple/AppleAssetCatalogAnalysis.js";
|
|
9
10
|
import { ARTIFACT_ANALYSIS_OPERATIONS, artifactInventoryInputSchema, artifactExtractionExecutionSchema, } from "../contracts/artifactToolContracts.js";
|
|
10
|
-
import { AnalysisCapabilityUnavailableError, AnalysisInputError, } from "../domain/analysisErrorCore.js";
|
|
11
|
+
import { AnalysisCapabilityUnavailableError, AnalysisInputError, AnalysisUnsupportedTargetError, } from "../domain/analysisErrorCore.js";
|
|
11
12
|
import { ArtifactOperationError } from "../domain/artifactOperationError.js";
|
|
12
13
|
import {} from "../domain/analysisErrorBase.js";
|
|
13
14
|
import { interfaceBuilderLimitsSchema } from "../domain/apple/interfaceBuilderGraph.js";
|
|
@@ -20,8 +21,12 @@ import { resolveArtifactIntegrityPolicy } from "./inventory/policy.js";
|
|
|
20
21
|
/** Read-only inventory and exclusively owned extraction provider. */
|
|
21
22
|
export class ArtifactProvider {
|
|
22
23
|
#capabilities;
|
|
23
|
-
|
|
24
|
+
#platform;
|
|
25
|
+
environment;
|
|
26
|
+
constructor(environment, platform = process.platform) {
|
|
27
|
+
this.environment = snapshotEnvironment(environment, platform);
|
|
24
28
|
this.#capabilities = artifactCapabilities(platform);
|
|
29
|
+
this.#platform = platform;
|
|
25
30
|
}
|
|
26
31
|
identity() {
|
|
27
32
|
return IDENTITY;
|
|
@@ -30,13 +35,17 @@ export class ArtifactProvider {
|
|
|
30
35
|
return this.#capabilities;
|
|
31
36
|
}
|
|
32
37
|
createClient(target) {
|
|
33
|
-
return new ArtifactClient(target);
|
|
38
|
+
return new ArtifactClient(target, this.environment, this.#platform);
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
class ArtifactClient {
|
|
37
42
|
target;
|
|
38
|
-
|
|
43
|
+
environment;
|
|
44
|
+
platform;
|
|
45
|
+
constructor(target, environment, platform) {
|
|
39
46
|
this.target = target;
|
|
47
|
+
this.environment = environment;
|
|
48
|
+
this.platform = platform;
|
|
40
49
|
}
|
|
41
50
|
async execute(operation, parameters, options) {
|
|
42
51
|
if (operation === "health")
|
|
@@ -52,7 +61,7 @@ class ArtifactClient {
|
|
|
52
61
|
if (this.target.kind !== "executable" ||
|
|
53
62
|
this.target.sourcePath === undefined ||
|
|
54
63
|
!this.target.sourcePath.toLowerCase().endsWith(".app"))
|
|
55
|
-
throw
|
|
64
|
+
throw this.unsupportedTarget(operation, "decode_interface_builder requires an active .app bundle target");
|
|
56
65
|
const limits = interfaceBuilderLimitsSchema.parse(parameters);
|
|
57
66
|
const result = await analyzeInterfaceBuilderBundle({
|
|
58
67
|
bundlePath: this.target.sourcePath,
|
|
@@ -87,13 +96,14 @@ class ArtifactClient {
|
|
|
87
96
|
: this.target.sourcePath;
|
|
88
97
|
if (bundlePath === undefined ||
|
|
89
98
|
(!standalone && !bundlePath.toLowerCase().endsWith(".app")))
|
|
90
|
-
throw
|
|
99
|
+
throw this.unsupportedTarget(operation, "inspect_keyed_archive requires an active plist or .app bundle");
|
|
91
100
|
const result = await inspectBundleKeyedArchive({
|
|
92
101
|
bundlePath,
|
|
93
102
|
targetSha256: this.target.sha256,
|
|
94
103
|
parameters: standalone
|
|
95
104
|
? { ...parameters, path: basename(this.target.path) }
|
|
96
105
|
: parameters,
|
|
106
|
+
platform: this.platform,
|
|
97
107
|
...(options?.signal === undefined ? {} : { signal: options.signal }),
|
|
98
108
|
});
|
|
99
109
|
if (standalone && result.archive_sha256 !== this.target.sha256)
|
|
@@ -114,6 +124,7 @@ class ArtifactClient {
|
|
|
114
124
|
inputPath: this.target.sourcePath ?? this.target.path,
|
|
115
125
|
inputFormat: this.target.format,
|
|
116
126
|
outputRoot: parsed.output_root,
|
|
127
|
+
environment: this.environment,
|
|
117
128
|
}, options?.signal);
|
|
118
129
|
return ok(createAnalysisExecution(result, IDENTITY, {
|
|
119
130
|
rawResult: null,
|
|
@@ -138,19 +149,24 @@ class ArtifactClient {
|
|
|
138
149
|
}));
|
|
139
150
|
}
|
|
140
151
|
catch (cause) {
|
|
141
|
-
return err(
|
|
152
|
+
return err(translateArtifactFailure(operation, cause));
|
|
142
153
|
}
|
|
143
154
|
}
|
|
144
155
|
close() {
|
|
145
|
-
return Promise.resolve();
|
|
156
|
+
return Promise.resolve(ok(null));
|
|
157
|
+
}
|
|
158
|
+
/** The active target's kind is outside this operation's supported targets. */
|
|
159
|
+
unsupportedTarget(operation, reason) {
|
|
160
|
+
return new AnalysisUnsupportedTargetError(operation, this.target.sourcePath ?? this.target.path, reason);
|
|
146
161
|
}
|
|
147
162
|
async inspectAssetCatalog(parameters, options) {
|
|
148
163
|
const bundlePath = this.target.sourcePath;
|
|
149
164
|
if (this.target.kind !== "executable" ||
|
|
150
165
|
bundlePath === undefined ||
|
|
151
166
|
!bundlePath.toLowerCase().endsWith(".app"))
|
|
152
|
-
throw
|
|
167
|
+
throw this.unsupportedTarget("inspect_asset_catalog", "inspect_asset_catalog requires an active .app bundle target");
|
|
153
168
|
const result = await analyzeAppleAssetCatalogs({
|
|
169
|
+
environment: this.environment,
|
|
154
170
|
bundlePath,
|
|
155
171
|
targetSha256: this.target.sha256,
|
|
156
172
|
page: parameters,
|
|
@@ -166,7 +182,7 @@ class ArtifactClient {
|
|
|
166
182
|
}
|
|
167
183
|
async traceDylibResolution(parameters, options) {
|
|
168
184
|
if (this.target.kind !== "executable" || this.target.format !== "mach-o")
|
|
169
|
-
throw
|
|
185
|
+
throw this.unsupportedTarget("trace_dylib_resolution", "trace_dylib_resolution requires an active Mach-O or .app bundle target");
|
|
170
186
|
// Only a target opened from an app bundle directory carries its Info.plist;
|
|
171
187
|
// a regular file whose name ends in .app is a standalone image.
|
|
172
188
|
const bundle = this.target.bundleInfoPlist === undefined
|
|
@@ -229,6 +245,7 @@ class ArtifactClient {
|
|
|
229
245
|
}
|
|
230
246
|
inventory(parsed, options) {
|
|
231
247
|
return inventoryArtifact(this.target.sourcePath ?? this.target.path, {
|
|
248
|
+
environment: this.environment,
|
|
232
249
|
...(options?.signal === undefined ? {} : { signal: options.signal }),
|
|
233
250
|
integrity: resolveArtifactIntegrityPolicy({
|
|
234
251
|
mode: parsed.integrity_policy,
|
|
@@ -237,11 +254,19 @@ class ArtifactClient {
|
|
|
237
254
|
}
|
|
238
255
|
}
|
|
239
256
|
const isArtifactOperation = (operation) => ARTIFACT_ANALYSIS_OPERATIONS.includes(operation);
|
|
240
|
-
|
|
257
|
+
/** Translate one artifact boundary failure while retaining cleanup evidence. */
|
|
258
|
+
export const translateArtifactFailure = (operation, cause) => {
|
|
241
259
|
if (cause instanceof ArtifactReaderFailure)
|
|
242
|
-
return new ArtifactOperationError(operation, cause.reason, cause.details, cause.message
|
|
243
|
-
|
|
244
|
-
|
|
260
|
+
return new ArtifactOperationError(operation, cause.reason, cause.details, cause.message, {
|
|
261
|
+
...(cause.cleanup === undefined ? {} : { cleanup: cause.cleanup }),
|
|
262
|
+
...(cause.partialObservation === undefined
|
|
263
|
+
? {}
|
|
264
|
+
: { partialObservation: cause.partialObservation }),
|
|
265
|
+
});
|
|
266
|
+
// Caller-selection and unsupported-target failures are already typed; keep
|
|
267
|
+
// their correction details instead of reducing them to an I/O failure.
|
|
268
|
+
if (cause instanceof AnalysisInputError ||
|
|
269
|
+
cause instanceof AnalysisUnsupportedTargetError)
|
|
245
270
|
return cause;
|
|
246
271
|
return new ArtifactOperationError(operation, "io");
|
|
247
272
|
};
|
|
@@ -2,10 +2,41 @@
|
|
|
2
2
|
export class ArtifactReaderFailure extends Error {
|
|
3
3
|
reason;
|
|
4
4
|
details;
|
|
5
|
+
cleanup;
|
|
6
|
+
partialObservation;
|
|
5
7
|
constructor(reason, message, options, details) {
|
|
6
8
|
super(message, options);
|
|
7
9
|
this.reason = reason;
|
|
8
10
|
this.details = details;
|
|
9
11
|
this.name = "ArtifactReaderFailure";
|
|
12
|
+
this.cleanup = options?.cleanup;
|
|
13
|
+
this.partialObservation = options?.partialObservation;
|
|
14
|
+
}
|
|
15
|
+
/** Preserve the primary failure while attaching cleanup and any complete observation. */
|
|
16
|
+
static withCleanup(cause, cleanup, partialObservation) {
|
|
17
|
+
const primary = cause instanceof ArtifactReaderFailure
|
|
18
|
+
? cause
|
|
19
|
+
: new ArtifactReaderFailure("io", errorMessage(cause), { cause });
|
|
20
|
+
const mergedObservation = partialObservation ?? primary.partialObservation;
|
|
21
|
+
return new ArtifactReaderFailure(primary.reason, primary.message, {
|
|
22
|
+
cause: primary,
|
|
23
|
+
cleanup: combineCleanup(primary.cleanup, cleanup),
|
|
24
|
+
...(mergedObservation === undefined
|
|
25
|
+
? {}
|
|
26
|
+
: { partialObservation: mergedObservation }),
|
|
27
|
+
}, primary.details);
|
|
28
|
+
}
|
|
29
|
+
/** Give otherwise opaque cleanup failures a concrete owned resource. */
|
|
30
|
+
static cleanupObservation(cause, resource) {
|
|
31
|
+
if (cause instanceof ArtifactReaderFailure && cause.cleanup !== undefined)
|
|
32
|
+
return cause.cleanup;
|
|
33
|
+
return { reason: errorMessage(cause), resources: [resource] };
|
|
10
34
|
}
|
|
11
35
|
}
|
|
36
|
+
const combineCleanup = (primary, cleanup) => primary === undefined || primary === cleanup
|
|
37
|
+
? cleanup
|
|
38
|
+
: {
|
|
39
|
+
reason: `${primary.reason}; ${cleanup.reason}`,
|
|
40
|
+
resources: [...new Set([...primary.resources, ...cleanup.resources])],
|
|
41
|
+
};
|
|
42
|
+
const errorMessage = (cause) => cause instanceof Error ? cause.message : String(cause);
|