rea-agents 5.0.0 → 6.1.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 +168 -655
- package/bridge/android/ReaJadxBridge.java +14 -5
- package/bridge/ghidra/ReaGhidraBridge.java +173 -47
- package/bridge/hopper_bridge.py +310 -128
- package/bridge/mitmproxy/capture.py +208 -0
- package/bridge/native/rea_lldb_tracer.py +839 -0
- package/bridge/process/ProcessRunTokenReader.swift +297 -0
- package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
- package/bridge/pwndbg/core_context.py +101 -0
- package/bridge/pwndbg/launch.py +39 -0
- package/bridge/pwndbg/launch_impl.py +34 -0
- package/bridge/pwntools/decoder_runtime.py +59 -0
- package/bridge/pwntools/layout.py +39 -0
- package/bridge/pwntools/layout_impl.py +309 -0
- package/bridge/pwntools/recorded_crash.py +39 -0
- package/bridge/pwntools/recorded_crash_impl.py +147 -0
- package/dist/android/JadxConfiguration.js +196 -33
- package/dist/android/JadxMcpTransport.js +4 -0
- package/dist/android/JadxProtocol.js +6 -0
- package/dist/android/JadxProvider.js +20 -2
- package/dist/android/JadxSession.js +23 -4
- package/dist/application/AnalysisContextQueries.js +8 -35
- package/dist/application/AnalysisDocument.js +32 -0
- package/dist/application/AppBundleExecutable.js +67 -21
- package/dist/application/CallPathTracing.js +19 -3
- package/dist/application/CapabilityInventory.js +27 -3
- package/dist/application/ClientConfigurationDocument.js +871 -6
- package/dist/application/ClientRegistrationIdentity.js +26 -5
- package/dist/application/ClientRegistrationStatus.js +29 -14
- package/dist/application/DirectAnalysis.js +97 -33
- package/dist/application/Doctor.js +4 -2
- package/dist/application/DoctorScope.js +25 -13
- package/dist/application/EnhancedLiteralTracing.js +22 -25
- package/dist/application/EnhancedTools.js +13 -11
- package/dist/application/EvidenceBundleFiles.js +24 -12
- package/dist/application/FunctionAnalysisEvidence.js +2 -3
- package/dist/application/InventoryProjectionEvidence.js +4 -3
- package/dist/application/InvestigationProviders.js +3 -2
- package/dist/application/JsonFiles.js +50 -28
- package/dist/application/ProcedureAddressResolution.js +11 -0
- package/dist/application/ReconstructionCoverageService.js +7 -4
- package/dist/application/ReconstructionObligationCandidates.js +5 -1
- package/dist/application/ReconstructionObligationLedgerService.js +4 -3
- package/dist/application/Setup.js +13 -1
- package/dist/application/SetupClientConfiguration.js +10 -15
- package/dist/application/SetupHost.js +5 -2
- package/dist/application/SetupPlan.js +5 -3
- package/dist/application/SupportedClients.js +34 -1
- package/dist/application/Uninstall.js +4 -3
- package/dist/application/Update.js +18 -3
- package/dist/application/UpdateRuntime.js +46 -25
- package/dist/application/WebModuleTraceService.js +4 -2
- package/dist/application/WebNetworkCapturePort.js +1 -0
- package/dist/application/WebNetworkCaptureService.js +134 -0
- package/dist/application/WebRuntimeService.js +5 -3
- package/dist/application/WebScriptExportService.js +2 -2
- package/dist/application/WebSourceLocationService.js +4 -2
- package/dist/application/WindowsCapabilities.js +1 -1
- package/dist/application/WorkflowEvidence.js +82 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +21 -5
- package/dist/application/binary/AnalysisProviderRegistry.js +2 -0
- package/dist/application/binary/AnalysisSnapshotCache.js +52 -12
- package/dist/application/binary/BinarySession.js +131 -76
- package/dist/application/binary/BinarySessionOpen.js +19 -6
- package/dist/application/binary/BinarySessionRecords.js +45 -3
- package/dist/application/binary/BinarySessionStatus.js +17 -1
- package/dist/application/binary/CompositeProvider.js +13 -0
- package/dist/application/binary/LazyAnalysisProvider.js +3 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +59 -0
- package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +62 -0
- package/dist/application/evm/EvmInterfacePort.js +1 -0
- package/dist/application/evm/EvmInterfaceService.js +64 -0
- package/dist/application/investigation/EvidenceLedger.js +21 -7
- package/dist/application/investigation/InvestigationRecords.js +8 -0
- package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +25 -5
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +19 -2
- package/dist/application/javascript/JavaScriptApplicationService.js +34 -14
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +5 -5
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +47 -27
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +39 -7
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +26 -2
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +80 -27
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +33 -12
- package/dist/application/javascript/JavaScriptModuleRelationships.js +37 -8
- package/dist/application/javascript/JavaScriptRecoveryService.js +4 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +3 -1
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +7 -7
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +149 -72
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +14 -15
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +41 -1
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +7 -7
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -9
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +118 -12
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +27 -5
- package/dist/application/managed/ManagedApplicationGraphService.js +4 -3
- package/dist/application/managed/ManagedMemberComparisonService.js +7 -4
- package/dist/application/managed/ManagedNativeVerificationService.js +4 -3
- package/dist/application/managed/ManagedReconstructionService.js +4 -3
- package/dist/application/{ProcessCli.js → process/ProcessCli.js} +23 -15
- package/dist/application/{ProcessEvidence.js → process/ProcessEvidence.js} +8 -7
- package/dist/application/workflowInputError.js +18 -0
- package/dist/artifacts/ArtifactProvider.js +42 -5
- package/dist/artifacts/ArtifactProviderMetadata.js +2 -1
- package/dist/artifacts/MachOSliceArtifactReader.js +98 -14
- package/dist/artifacts/NativeDmgArtifactReader.js +13 -6
- package/dist/artifacts/ZipArtifactReader.js +3 -0
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +22 -3
- package/dist/artifacts/apple/DylibResolutionReader.js +259 -0
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +176 -56
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +195 -0
- package/dist/artifacts/apple/KeyedArchiveReader.js +36 -22
- package/dist/artifacts/apple/MachoLoadCommandReader.js +355 -0
- package/dist/artifacts/apple/NibArchive.js +81 -14
- package/dist/artifacts/apple/NibViewHierarchy.js +10 -3
- package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
- package/dist/{application → artifacts/extraction}/ArtifactExtraction.js +10 -10
- package/dist/{application → artifacts/inventory}/ArtifactGraphConstruction.js +16 -11
- package/dist/{application → artifacts/inventory}/ArtifactInventory.js +4 -4
- package/dist/{application/ArtifactInventory → artifacts/inventory}/classify.js +2 -2
- package/dist/{application/ArtifactInventory → artifacts/inventory}/reader.js +5 -5
- package/dist/{application/ArtifactInventory → artifacts/inventory}/scanCanonical.js +14 -17
- package/dist/{application/ArtifactInventory → artifacts/inventory}/scanReader.js +5 -5
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +6 -2
- package/dist/artifacts/readStableArtifact.js +20 -4
- package/dist/browser/CdpCaptureCompleteness.js +2 -0
- package/dist/browser/CdpCaptureEventHandlers.js +165 -12
- package/dist/browser/CdpCaptureEventTypes.js +5 -1
- package/dist/browser/CdpCaptureEvents.js +34 -0
- package/dist/browser/CdpConnection.js +30 -11
- package/dist/browser/CdpOptionalCommand.js +2 -3
- package/dist/browser/CdpPageCapture.js +23 -1
- package/dist/browser/PlaywrightElectronActiveActions.js +32 -23
- package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +130 -122
- package/dist/browser/WebSourceMapFetcher.js +426 -72
- package/dist/browser/assets/LocalWebScriptArtifacts.js +2 -2
- package/dist/browser/history/CaptureFailures.js +137 -0
- package/dist/browser/history/CaptureFormatError.js +10 -0
- package/dist/browser/history/CaptureRedaction.js +65 -0
- package/dist/browser/history/CaptureRelease.js +17 -0
- package/dist/browser/history/HarCapture.js +165 -0
- package/dist/browser/history/HarCaptureAdapter.js +20 -0
- package/dist/browser/history/HarCaptureProcess.js +57 -0
- package/dist/browser/history/HarJson.js +92 -0
- package/dist/browser/history/HarSchema.js +72 -0
- package/dist/browser/history/HistoricalCaptureDecoder.js +188 -0
- package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
- package/dist/browser/history/MitmproxyCaptureAdapter.js +42 -0
- package/dist/cli/analysisSelector.js +23 -0
- package/dist/cli/applicationCommands.js +2 -3
- package/dist/cli/artifactCommands.js +26 -1
- package/dist/cli/binaryDiagnosticsCommands.js +39 -0
- package/dist/cli/coreAnalysisCommands.js +2 -2
- package/dist/cli/coreBinaryCommands.js +78 -20
- package/dist/cli/electronCommands.js +21 -13
- package/dist/cli/evmCommands.js +24 -0
- package/dist/cli/firmwareCommands.js +6 -3
- package/dist/cli/javascriptApplicationAnalysis.js +20 -3
- package/dist/cli/jsonOutput.js +38 -0
- package/dist/cli/nativeCallCommands.js +34 -0
- package/dist/cli/processCommands.js +1 -1
- package/dist/cli/streamedJsonOutput.js +56 -0
- package/dist/cli/utilityCommands.js +2 -0
- package/dist/cli/webNetworkCaptureCommands.js +40 -0
- package/dist/cli/webRuntimeCommands.js +8 -8
- package/dist/cli.js +11 -4
- package/dist/cliBrowserScenarioCommands.js +2 -2
- package/dist/cliCommandNames.js +6 -1
- package/dist/cliJsonInput.js +35 -1
- package/dist/cliOutput.js +21 -6
- package/dist/composition/binaryDiagnostics.js +8 -0
- package/dist/composition/evm.js +4 -0
- package/dist/composition/webNetworkCaptures.js +6 -0
- package/dist/config/environment.js +4 -0
- package/dist/config/ghidraStartupTimeout.js +17 -0
- package/dist/config/mcpResponseBudget.js +22 -0
- package/dist/config/parseConfig.js +2 -1
- package/dist/contracts/artifactToolContracts.js +6 -0
- package/dist/contracts/browserCaptureToolInputSchema.js +43 -0
- package/dist/contracts/browserToolContracts.js +4 -3
- package/dist/contracts/enhancedInputs.js +5 -3
- package/dist/contracts/enhancedToolContracts.js +3 -3
- package/dist/contracts/errorSchemas.js +8 -1
- package/dist/contracts/evm/evmToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +2 -5
- package/dist/contracts/investigationExamples.js +2 -2
- package/dist/contracts/javascript/electronToolContracts.js +1 -1
- package/dist/contracts/managed/managedToolContracts.js +8 -6
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +42 -0
- package/dist/contracts/native/nativeToolContracts.js +21 -3
- package/dist/contracts/officialToolContracts.js +26 -24
- package/dist/contracts/process/processCaptureExample.js +2 -0
- package/dist/contracts/promptContracts.js +3 -3
- package/dist/contracts/sessionLifecycleInputs.js +18 -5
- package/dist/contracts/sessionStatusContract.js +8 -2
- package/dist/contracts/sessionToolContracts.js +8 -3
- package/dist/contracts/sessionToolSchemas.js +8 -4
- package/dist/contracts/toolContractExamples.js +1 -2
- package/dist/contracts/toolContractHelpers.js +4 -1
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +30 -1
- package/dist/contracts/toolOutputSchemaGroups.js +33 -28
- package/dist/contracts/toolOutputSchemaPrimitives.js +19 -1
- package/dist/contracts/toolSchemaMetadata.js +69 -10
- package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
- package/dist/domain/analysisErrorBase.js +22 -2
- package/dist/domain/analysisErrorCore.js +61 -5
- package/dist/domain/analysisErrorPresentation.js +95 -12
- package/dist/domain/analysisErrorProjection.js +148 -19
- package/dist/domain/analysisSnapshot.js +166 -2
- package/dist/domain/android/androidAnalysis.js +2 -4
- package/dist/domain/android/androidApplication.js +17 -9
- package/dist/domain/apple/appleApplication.js +41 -14
- package/dist/domain/apple/dyldEnvironment.js +73 -0
- package/dist/domain/apple/dyldPaths.js +81 -0
- package/dist/domain/apple/dylibResolution.js +478 -0
- package/dist/domain/apple/dylibResolutionFindings.js +77 -0
- package/dist/domain/apple/interfaceBuilderGraph.js +25 -13
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +13 -3
- package/dist/domain/apple/keyedArchive.js +9 -1
- package/dist/domain/apple/machoContainer.js +54 -0
- package/dist/domain/apple/plistNumbers.js +76 -0
- package/dist/domain/artifactIdentity.js +29 -0
- package/dist/domain/artifactInventoryEvidence.js +19 -24
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/bridgeCandidateProjection.js +71 -0
- package/dist/domain/browserCompleteness.js +1 -0
- package/dist/domain/browserObservation.js +1 -1
- package/dist/domain/browserObservationError.js +24 -5
- package/dist/domain/browserObservationSchemas.js +13 -0
- package/dist/domain/browserScenarioValues.js +5 -2
- package/dist/domain/bundleComparison.js +3 -2
- package/dist/domain/callPathSchemas.js +1 -1
- package/dist/domain/canonicalDigest.js +13 -1
- package/dist/domain/canonicalJsonDigestSteps.js +133 -0
- package/dist/domain/canonicalOrdering.js +9 -5
- package/dist/domain/changedBehavior.js +9 -9
- package/dist/domain/comparisonSourceEvidence.js +40 -0
- package/dist/domain/comparisonStatus.js +2 -30
- package/dist/domain/configurationErrors.js +1 -1
- package/dist/domain/conformanceTrustGate.js +0 -16
- package/dist/domain/evidence.js +78 -11
- package/dist/domain/evidenceBundle.js +42 -1
- package/dist/domain/evidenceErrors.js +12 -1
- package/dist/domain/evm/evmInterface.js +63 -0
- package/dist/domain/explicitSensitiveFailure.js +108 -0
- package/dist/domain/explicitSensitiveValues.js +10 -0
- package/dist/domain/firmware/firmwareAnalysis.js +10 -4
- package/dist/domain/hopperErrors.js +23 -2
- package/dist/domain/hopperValues.js +51 -8
- package/dist/domain/immutableJson.js +114 -0
- package/dist/domain/inputIssueProjection.js +3 -0
- package/dist/domain/javascript/electronActiveObservation.js +37 -6
- package/dist/domain/javascript/electronStaticAnalysisValues.js +6 -12
- package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +71 -23
- package/dist/domain/javascript/javascriptApplicationGraph.js +13 -0
- package/dist/domain/javascript/javascriptAstValues.js +20 -0
- package/dist/domain/javascript/javascriptExportShapeComparison.js +21 -5
- package/dist/domain/javascript/javascriptExportShapeVariants.js +0 -10
- package/dist/domain/javascript/javascriptRecovery.js +3 -8
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +97 -2
- package/dist/domain/javascript/javascriptSemanticCoverage.js +6 -5
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +9 -17
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +22 -5
- package/dist/domain/javascript/javascriptSemanticGraph.js +34 -5
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +1 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +25 -17
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -4
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
- package/dist/domain/javascript/javascriptSemanticValues.js +83 -11
- package/dist/domain/javascript/javascriptSourceParser.js +6 -2
- package/dist/domain/javascript/javascriptStaticAnalysis.js +22 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +5 -3
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +14 -4
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +66 -7
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +28 -16
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +3 -2
- package/dist/domain/jsonSerialization.js +109 -0
- package/dist/domain/jsonValue.js +91 -3
- package/dist/domain/localPath.js +8 -0
- package/dist/domain/managed/managedApplicationGraph.js +10 -10
- package/dist/domain/managed/managedInspectionEvidence.js +16 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +5 -9
- package/dist/domain/managed/managedNativeVerification.js +3 -9
- package/dist/domain/native/binaryLayout.js +357 -0
- package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
- package/dist/domain/native/nativeCallObservation.js +186 -0
- package/dist/domain/native/nativeCallPartialObservation.js +33 -0
- package/dist/domain/native/objcSwiftMetadata.js +0 -39
- package/dist/domain/native/recordedCrash.js +266 -0
- package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
- package/dist/domain/{processCapture.js → process/processCapture.js} +143 -2
- package/dist/domain/{processCaptureExample.js → process/processCaptureExample.js} +5 -0
- package/dist/domain/process/processCaptureParsing.js +54 -0
- package/dist/domain/{processCaptureValidation.js → process/processCaptureValidation.js} +18 -2
- package/dist/domain/{processComparison.js → process/processComparison.js} +39 -5
- package/dist/domain/{processObservation.js → process/processObservation.js} +1 -1
- package/dist/domain/{processScenario.js → process/processScenario.js} +11 -10
- package/dist/domain/{processTraceSpecification.js → process/processTraceSpecification.js} +1 -1
- package/dist/domain/propertyListKeys.js +1 -1
- package/dist/domain/propertyListXmlText.js +19 -0
- package/dist/domain/providerAdapterError.js +1 -1
- package/dist/domain/providerOperationHealth.js +54 -0
- package/dist/domain/providerSelectionError.js +4 -2
- package/dist/domain/reconstructionVerification.js +9 -46
- package/dist/domain/reconstructionVerificationSchemas.js +3 -3
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/staticRuntimeCorrelation.js +9 -46
- package/dist/domain/webBundleAnalysis.js +20 -8
- package/dist/domain/webBundleAnalyzerInspection.js +13 -8
- package/dist/domain/webBundleAnalyzerResult.js +41 -2
- package/dist/domain/webCaptureDiff.js +1 -0
- package/dist/domain/webNetworkCapture.js +118 -0
- package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
- package/dist/domain/webRuntime.js +19 -5
- package/dist/domain/webSourceLocation.js +1 -0
- package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
- package/dist/dotnet/ManagedMemberInspector.js +4 -2
- package/dist/dotnet/ManagedMemberInspectorCore.js +38 -32
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +23 -7
- package/dist/dotnet/ManagedMemberRows.js +14 -3
- package/dist/dotnet/ManagedMetadataHeaps.js +20 -2
- package/dist/dotnet/ManagedMetadataInventory.js +38 -28
- package/dist/dotnet/ManagedMetadataInventoryRows.js +24 -10
- package/dist/dotnet/ManagedMethodBodyReader.js +7 -1
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +15 -3
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +3 -1
- package/dist/dotnet/ManagedPeReader.js +11 -0
- package/dist/evm/EvmBytecodeCarrier.js +21 -0
- package/dist/evm/EvmWorkerLimits.js +40 -0
- package/dist/evm/EvmoleFailures.js +126 -0
- package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
- package/dist/evm/EvmoleInterfaceProvider.js +273 -0
- package/dist/evm/EvmoleInterfaceWorker.js +87 -0
- package/dist/evm/EvmoleRelease.js +16 -0
- package/dist/firmware/FirmwareCommand.js +1 -0
- package/dist/firmware/FirmwareFiles.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +5 -0
- package/dist/ghidra/GhidraClient.js +47 -14
- package/dist/ghidra/GhidraDiagnostics.js +7 -7
- package/dist/ghidra/GhidraFunctionValues.js +10 -7
- package/dist/ghidra/GhidraInstallation.js +18 -21
- package/dist/ghidra/GhidraInventoryValues.js +14 -4
- package/dist/ghidra/GhidraJavaLaunch.js +62 -0
- package/dist/ghidra/GhidraLauncher.js +34 -16
- package/dist/ghidra/GhidraProvider.js +2 -2
- package/dist/ghidra/GhidraProviderCapabilities.js +15 -3
- package/dist/ghidra/GhidraProviderClient.js +23 -12
- package/dist/ghidra/GhidraSessionError.js +11 -7
- package/dist/ghidra/GhidraTargetSnapshot.js +47 -12
- package/dist/ghidra/GhidraTransport.js +20 -0
- package/dist/hopper/BridgeLauncher.js +33 -11
- package/dist/hopper/HopperAnalysisProfile.js +62 -4
- package/dist/hopper/HopperCleanup.js +15 -3
- package/dist/hopper/HopperClient.js +222 -14
- package/dist/hopper/HopperFileOffset.js +237 -0
- package/dist/hopper/HopperMachOImage.js +196 -0
- package/dist/hopper/HopperOperationStage.js +6 -0
- package/dist/hopper/HopperProvider.js +63 -9
- package/dist/hopper/HopperProviderCapabilities.js +19 -1
- package/dist/hopper/HopperRegexSearch.js +137 -0
- package/dist/hopper/HopperRegexWorker.js +27 -0
- package/dist/hopper/HopperRequestQueue.js +68 -19
- package/dist/hopper/HopperTargetLease.js +3 -2
- package/dist/hopper/LinuxPrivateDisplayProbe.js +4 -2
- package/dist/inspector/JavaScriptRuntimeScope.js +9 -1
- package/dist/inspector/V8InspectorCaptureProjection.js +8 -3
- package/dist/inspector/V8InspectorProvider.js +47 -11
- package/dist/javascript/recovery/WakaruCommand.js +3 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +17 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +79 -31
- package/dist/javascript/sourceMaps/TraceSourceMap.js +14 -28
- package/dist/mcpDoctor.js +62 -2
- package/dist/native/AppleDispatchCoverage.js +47 -6
- package/dist/native/AppleDispatchDecodeFacts.js +6 -0
- package/dist/native/AppleDispatchMetadata.js +6 -3
- package/dist/native/AppleMachoFixups.js +48 -24
- package/dist/native/AppleMachoSelection.js +32 -16
- package/dist/native/AppleObjcCategories.js +6 -2
- package/dist/native/AppleObjcDispatchFacets.js +5 -2
- package/dist/native/AppleObjcProperties.js +2 -1
- package/dist/native/AppleSwiftDispatchFacets.js +27 -21
- package/dist/native/AppleSwiftVtables.js +21 -15
- package/dist/native/CommandRunner.js +82 -84
- package/dist/native/LldbCallTracer.js +541 -0
- package/dist/native/LldbRetainedObservations.js +178 -0
- package/dist/native/NativeCallObservation.js +194 -0
- package/dist/native/NativeMacOSProvider.js +117 -20
- package/dist/native/NativeMacOSProviderMetadata.js +8 -3
- package/dist/native/SignatureTargetBinding.js +155 -0
- package/dist/native/parsers/lipo.js +71 -1
- package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
- package/dist/native/pwntools/PwntoolsDecoder.js +203 -0
- package/dist/native/pwntools/PwntoolsFailures.js +180 -0
- package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
- package/dist/native/pwntools/PwntoolsRelease.js +19 -0
- package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
- package/dist/process/DarwinProcessRunTokenReader.js +293 -0
- package/dist/process/ExecFileOutput.js +20 -0
- package/dist/process/OwnedCommand.js +118 -0
- package/dist/process/ProcessOwnership.js +431 -51
- package/dist/process/ProcessOwnershipObservation.js +209 -27
- package/dist/process/ProviderProcess.js +68 -10
- package/dist/{application → process/capture}/ProcessCaptureCapability.js +15 -0
- package/dist/{application → process/capture}/ProcessCaptureError.js +18 -2
- package/dist/process/capture/ProcessCaptureLifecycle.js +681 -0
- package/dist/{application → process/capture}/ProcessHarness.js +195 -29
- package/dist/{application → process/capture}/ProcessSampling.js +2 -2
- package/dist/server/EvidenceMcpServer.js +146 -0
- package/dist/server/createServer.js +37 -8
- package/dist/server/promptCompletion.js +10 -3
- package/dist/server/registerAndroidTools.js +2 -4
- package/dist/server/registerApplicationTools/helpers.js +2 -4
- package/dist/server/registerArtifactComparisonTool.js +11 -7
- package/dist/server/registerBinaryDiagnosticsTools.js +15 -0
- package/dist/server/registerBrowserScenarioTool.js +2 -4
- package/dist/server/registerBrowserTools.js +2 -4
- package/dist/server/registerBundleComparisonTool.js +2 -3
- package/dist/server/registerCloseLifecycleTool.js +8 -18
- package/dist/server/registerElectronTools.js +2 -4
- package/dist/server/registerEnhancedTools.js +18 -59
- package/dist/server/registerEvidenceTools.js +3 -5
- package/dist/server/registerEvmTools.js +15 -0
- package/dist/server/registerFirmwareTools.js +2 -4
- package/dist/server/registerFunctionComparisonTool.js +10 -6
- package/dist/server/registerInvestigationTools.js +7 -7
- package/dist/server/registerJavaScriptRecoveryTool.js +2 -4
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -4
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +2 -4
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +2 -4
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +2 -4
- package/dist/server/registerOfficialTools.js +2 -4
- package/dist/server/registerProcessComparisonTool.js +72 -46
- package/dist/server/registerRecordedCrashTools.js +15 -0
- package/dist/server/registerSessionRecordTools.js +5 -6
- package/dist/server/registerSessionStatusTool.js +17 -3
- package/dist/server/registerSessionTools.js +13 -5
- package/dist/server/registerWebModuleTool.js +2 -4
- package/dist/server/registerWebNetworkCaptureTool.js +26 -0
- package/dist/server/registerWebRuntimeTools.js +3 -7
- package/dist/server/registerWebScriptTool.js +2 -4
- package/dist/server/registerWebSourceLocationTool.js +2 -4
- package/dist/server/runDerivedOperation.js +15 -3
- package/dist/server/sessionAvailabilityPolicy.js +3 -1
- package/dist/server/sessionToolPolicies.js +1 -1
- package/dist/server/toolRegistrationOptions.js +2 -2
- package/dist/server/toolResult.js +63 -11
- package/dist/server/toolResultEncoding.js +33 -0
- package/install.sh +1 -1
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +42 -9
- package/scripts/electron-active-hook-boundaries.cjs +18 -20
- package/scripts/electron-active-hook.cjs +241 -37
- package/scripts/rea.mjs +11 -3
- package/skills/reverse-engineer-anything/SKILL.md +32 -4
- package/skills/reverse-engineer-anything/references/javascript-applications.md +8 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +29 -0
- package/third_party/README.md +60 -0
- package/third_party/evmole/LICENSE +21 -0
- package/third_party/evmole/README.md +22 -0
- package/third_party/pwndbg/LICENSE.md +21 -0
- package/third_party/pwndbg/README.md +23 -0
- package/third_party/pwntools/README.md +40 -0
- package/dist/application/AuthorizedArtifactInventory.js +0 -7
- package/dist/application/ProcessCaptureLifecycle.js +0 -299
- package/dist/application/StoreFileLock.js +0 -124
- package/dist/contracts/processCaptureExample.js +0 -2
- package/dist/domain/bytecodeProvider.js +0 -178
- package/dist/domain/customProtocolCapture.js +0 -137
- package/dist/domain/eventProcessTree.js +0 -225
- package/dist/domain/mobileApplicationInvestigation.js +0 -159
- package/dist/domain/packageAnalysis.js +0 -123
- package/dist/domain/peInspection.js +0 -197
- package/dist/domain/processCaptureParsing.js +0 -21
- package/dist/domain/protocolCapture.js +0 -217
- package/dist/domain/runtimeIdentification.js +0 -212
- package/dist/generatedMcpToolCatalog.js +0 -37
- package/dist/ghidra/GhidraDefaults.js +0 -2
- /package/dist/application/{ArtifactExtractionDestination.js → artifacts/ArtifactExtractionDestination.js} +0 -0
- /package/dist/{application/ArtifactInventory → artifacts/inventory}/policy.js +0 -0
- /package/dist/{application/ArtifactInventory → artifacts/inventory}/types.js +0 -0
- /package/dist/domain/{processEvidenceProvider.js → process/processEvidenceProvider.js} +0 -0
- /package/dist/domain/{processTraceComparison.js → process/processTraceComparison.js} +0 -0
- /package/dist/domain/{processTraceDimensionProjection.js → process/processTraceDimensionProjection.js} +0 -0
- /package/dist/domain/{processTraceEvaluation.js → process/processTraceEvaluation.js} +0 -0
- /package/dist/{application → process/capture}/FilesystemSnapshot.js +0 -0
- /package/dist/{application → process/capture}/ProcessCaptureEnvironment.js +0 -0
- /package/dist/{application → process/capture}/ProcessCaptureJournal.js +0 -0
- /package/dist/{application → process/capture}/ProcessFilesystemEffects.js +0 -0
- /package/dist/{application → process/capture}/ProcessNormalization.js +0 -0
- /package/dist/{application → process/capture}/ProcessScenarioRuntimeValidation.js +0 -0
- /package/dist/{application → process/capture}/ProcessTimer.js +0 -0
- /package/dist/{application → process/capture}/TerminalRenderer.js +0 -0
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
2
2
|
import { valid } from "semver";
|
|
3
3
|
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
4
|
+
/** Resolve a pinned npx launcher that stdio clients can spawn on the host. */
|
|
5
|
+
export const npxRegistrationCommand = (platform = process.platform) => {
|
|
6
|
+
const command = [
|
|
7
|
+
"npx",
|
|
8
|
+
"-y",
|
|
9
|
+
PRODUCT_IDENTITY.registrationPackageSpecifier,
|
|
10
|
+
"mcp",
|
|
11
|
+
];
|
|
12
|
+
return platform === "win32" ? ["cmd.exe", "/d", "/c", ...command] : command;
|
|
13
|
+
};
|
|
14
|
+
const unwrapNpxCommand = (command) => {
|
|
15
|
+
const executable = command[0]?.toLowerCase();
|
|
16
|
+
if (executable !== "cmd" && executable !== "cmd.exe")
|
|
17
|
+
return command;
|
|
18
|
+
if (command[1]?.toLowerCase() === "/c")
|
|
19
|
+
return command.slice(2);
|
|
20
|
+
if (command[1]?.toLowerCase() === "/d" && command[2]?.toLowerCase() === "/c")
|
|
21
|
+
return command.slice(3);
|
|
22
|
+
return [];
|
|
23
|
+
};
|
|
4
24
|
/** Check that one parsed command points to REA's MCP entry point. */
|
|
5
25
|
export const isOwnedClientRegistrationCommand = (command, currentCommandPath = resolve(process.argv[1] ?? "unknown")) => {
|
|
6
26
|
if (command.length === 3 &&
|
|
@@ -16,12 +36,13 @@ export const isOwnedClientRegistrationCommand = (command, currentCommandPath = r
|
|
|
16
36
|
resolve(executable) === currentCommandPath)
|
|
17
37
|
return true;
|
|
18
38
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
39
|
+
const npxCommand = unwrapNpxCommand(command);
|
|
40
|
+
if (npxCommand.length !== 4 ||
|
|
41
|
+
npxCommand[0] !== "npx" ||
|
|
42
|
+
npxCommand[1] !== "-y" ||
|
|
43
|
+
npxCommand[3] !== "mcp")
|
|
23
44
|
return false;
|
|
24
|
-
const packageReference =
|
|
45
|
+
const packageReference = npxCommand[2] ?? "";
|
|
25
46
|
if (packageReference === PRODUCT_IDENTITY.packageName ||
|
|
26
47
|
packageReference === PRODUCT_IDENTITY.packageSpecifier ||
|
|
27
48
|
packageReference === PRODUCT_IDENTITY.registrationPackageSpecifier)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { effectiveClientServer, parseClientConfiguration, } from "./ClientConfigurationDocument.js";
|
|
1
|
+
import { effectiveClientServer, grokServerListedDisabled, parseClientConfiguration, } from "./ClientConfigurationDocument.js";
|
|
2
2
|
import { access, readFile } from "node:fs/promises";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
6
6
|
import { MCP_STARTUP_POLICY } from "../mcpStartupPolicy.js";
|
|
7
|
-
import { isOwnedClientRegistrationCommand } from "./ClientRegistrationIdentity.js";
|
|
8
|
-
import { supportedClients } from "./SupportedClients.js";
|
|
7
|
+
import { isOwnedClientRegistrationCommand, npxRegistrationCommand, } from "./ClientRegistrationIdentity.js";
|
|
8
|
+
import { manualRegistrationRemediation, supportedClients, } from "./SupportedClients.js";
|
|
9
9
|
const registrationSchema = z
|
|
10
10
|
.object({
|
|
11
11
|
command: z.string().min(1),
|
|
@@ -28,15 +28,30 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
28
28
|
CLAUDE_CONFIG_DIR: options.environment.CLAUDE_CONFIG_DIR,
|
|
29
29
|
CODEX_HOME: options.environment.CODEX_HOME,
|
|
30
30
|
COPILOT_HOME: options.environment.COPILOT_HOME,
|
|
31
|
+
GROK_HOME: options.environment.GROK_HOME,
|
|
31
32
|
OPENCODE_CONFIG: options.environment.OPENCODE_CONFIG,
|
|
33
|
+
SAND_DATA_ROOT: options.environment.SAND_DATA_ROOT,
|
|
32
34
|
XDG_CONFIG_HOME: options.environment.XDG_CONFIG_HOME,
|
|
33
35
|
})) {
|
|
34
|
-
if (client.
|
|
35
|
-
|
|
36
|
+
if (!(await exists(client.markerPath)) &&
|
|
37
|
+
!(await exists(client.configPath)))
|
|
36
38
|
continue;
|
|
39
|
+
const manualRemediation = manualRegistrationRemediation(client.name);
|
|
40
|
+
if (client.format === "unsupported") {
|
|
41
|
+
if (manualRemediation !== undefined)
|
|
42
|
+
statuses.push({
|
|
43
|
+
client: client.name,
|
|
44
|
+
config_path: client.markerPath ?? client.configPath,
|
|
45
|
+
command: [],
|
|
46
|
+
state: "manual",
|
|
47
|
+
remediation: manualRemediation,
|
|
48
|
+
});
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
37
51
|
try {
|
|
38
52
|
const content = await readFile(client.configPath, "utf8");
|
|
39
|
-
const
|
|
53
|
+
const parsed = parseClientConfiguration(content, client.format);
|
|
54
|
+
const raw = effectiveClientServer(parsed, PRODUCT_IDENTITY.mcpServerKey);
|
|
40
55
|
if (raw === undefined) {
|
|
41
56
|
statuses.push(unavailableStatus(client.name, client.configPath, "missing"));
|
|
42
57
|
continue;
|
|
@@ -46,7 +61,9 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
46
61
|
registration.command,
|
|
47
62
|
...registration.args,
|
|
48
63
|
];
|
|
49
|
-
statuses.push(configuredStatus(client.name, client.configPath, command, registrationAligned(registration, client, currentCommandPath)
|
|
64
|
+
statuses.push(configuredStatus(client.name, client.configPath, command, registrationAligned(registration, client, currentCommandPath, options.platform ?? process.platform) &&
|
|
65
|
+
!(client.format === "grok" &&
|
|
66
|
+
grokServerListedDisabled(parsed.document, PRODUCT_IDENTITY.mcpServerKey))
|
|
50
67
|
? "aligned"
|
|
51
68
|
: "stale"));
|
|
52
69
|
}
|
|
@@ -56,13 +73,13 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
56
73
|
}
|
|
57
74
|
return statuses.sort((left, right) => left.client.localeCompare(right.client));
|
|
58
75
|
};
|
|
59
|
-
const registrationAligned = (registration, client, currentCommandPath) => {
|
|
76
|
+
const registrationAligned = (registration, client, currentCommandPath, platform) => {
|
|
60
77
|
const command = [registration.command, ...registration.args];
|
|
61
78
|
if (registration.disabled === true || registration.enabled === false)
|
|
62
79
|
return false;
|
|
63
80
|
if (!isOwnedClientRegistrationCommand(command, currentCommandPath))
|
|
64
81
|
return false;
|
|
65
|
-
if (client.name === "codex" &&
|
|
82
|
+
if ((client.name === "codex" || client.name === "grok_build") &&
|
|
66
83
|
registration.startup_timeout_sec !==
|
|
67
84
|
MCP_STARTUP_POLICY.codexStartupTimeoutSeconds)
|
|
68
85
|
return false;
|
|
@@ -79,11 +96,9 @@ const registrationAligned = (registration, client, currentCommandPath) => {
|
|
|
79
96
|
resolve(command[0] ?? "") === resolve(process.execPath) &&
|
|
80
97
|
resolve(command[1] ?? "") === currentCommandPath)
|
|
81
98
|
return true;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
command
|
|
85
|
-
command[2] === PRODUCT_IDENTITY.registrationPackageSpecifier &&
|
|
86
|
-
command[3] === "mcp")
|
|
99
|
+
const npxCommand = npxRegistrationCommand(platform);
|
|
100
|
+
if (command.length === npxCommand.length &&
|
|
101
|
+
command.every((argument, index) => argument === npxCommand[index]))
|
|
87
102
|
return true;
|
|
88
103
|
return (command.length === 2 &&
|
|
89
104
|
command[1] === "mcp" &&
|
|
@@ -13,6 +13,7 @@ import { parseBinaryTarget } from "./BinaryTargetResolver.js";
|
|
|
13
13
|
import { snapshotEvidenceForQuery, snapshotMatchesTarget, } from "../domain/analysisSnapshot.js";
|
|
14
14
|
import { err, ok } from "../domain/result.js";
|
|
15
15
|
import { REA_WORKFLOW_PROVIDER, workflowAnalysisProfile, } from "./InvestigationProviders.js";
|
|
16
|
+
import { createWorkflowEvidence, workflowSnapshotRecord, recordWorkflowUnknowns, } from "./WorkflowEvidence.js";
|
|
16
17
|
import { artifactInspectionResultSchema } from "../domain/artifactInspection.js";
|
|
17
18
|
/**
|
|
18
19
|
* Open one binary, execute one tool, and always release provider resources.
|
|
@@ -82,7 +83,42 @@ const runAnalysis = async (dependencies, path, tool, arguments_, options) => {
|
|
|
82
83
|
if (!prepared.ok)
|
|
83
84
|
return cliError(prepared.error);
|
|
84
85
|
const { snapshot } = prepared.value;
|
|
85
|
-
|
|
86
|
+
let resolvedTarget;
|
|
87
|
+
if (snapshot !== undefined && prepared.value.target !== undefined) {
|
|
88
|
+
const preview = await session.previewTarget(prepared.value.target, {
|
|
89
|
+
signal,
|
|
90
|
+
snapshot,
|
|
91
|
+
...(options.formatHint === undefined
|
|
92
|
+
? {}
|
|
93
|
+
: { formatHint: options.formatHint }),
|
|
94
|
+
...(options.providerId === undefined
|
|
95
|
+
? {}
|
|
96
|
+
: { providerId: options.providerId }),
|
|
97
|
+
});
|
|
98
|
+
if (!preview.ok)
|
|
99
|
+
return cliError(preview.error);
|
|
100
|
+
resolvedTarget = preview.value;
|
|
101
|
+
const route = preview.value.route;
|
|
102
|
+
const bindingProfile = route.profile ?? undefined;
|
|
103
|
+
const evidenceProfile = analysisProfileForRoute(route, tool);
|
|
104
|
+
if (bindingProfile !== undefined &&
|
|
105
|
+
evidenceProfile !== undefined &&
|
|
106
|
+
allowsSnapshotReplay(route, tool)) {
|
|
107
|
+
const cached = snapshotEvidenceForQuery(snapshot, {
|
|
108
|
+
target: preview.value.target,
|
|
109
|
+
bindingProfile,
|
|
110
|
+
operation: tool,
|
|
111
|
+
parameters: arguments_,
|
|
112
|
+
provider: isWorkflowEvidenceTool(tool)
|
|
113
|
+
? REA_WORKFLOW_PROVIDER
|
|
114
|
+
: providerIdentityForRoute(route, tool),
|
|
115
|
+
evidenceProfile,
|
|
116
|
+
});
|
|
117
|
+
if (cached !== undefined)
|
|
118
|
+
return cached;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const openOptions = {
|
|
86
122
|
signal,
|
|
87
123
|
...(options.formatHint === undefined
|
|
88
124
|
? {}
|
|
@@ -91,26 +127,13 @@ const runAnalysis = async (dependencies, path, tool, arguments_, options) => {
|
|
|
91
127
|
...(options.providerId === undefined
|
|
92
128
|
? {}
|
|
93
129
|
: { providerId: options.providerId }),
|
|
94
|
-
}
|
|
130
|
+
};
|
|
131
|
+
const opened = resolvedTarget === undefined
|
|
132
|
+
? await session.open(path, openOptions)
|
|
133
|
+
: await session.openResolvedTarget(resolvedTarget, openOptions);
|
|
95
134
|
if (!opened.ok)
|
|
96
135
|
return cliError(opened.error);
|
|
97
136
|
const evidenceProfile = analysisProfileForEvidence(session, tool);
|
|
98
|
-
const bindingProfile = session.analysisProfile();
|
|
99
|
-
if (canReplayDirectTool(session, tool) &&
|
|
100
|
-
snapshot !== undefined &&
|
|
101
|
-
evidenceProfile !== undefined &&
|
|
102
|
-
bindingProfile !== undefined) {
|
|
103
|
-
const cached = snapshotEvidenceForQuery(snapshot, {
|
|
104
|
-
target: opened.value,
|
|
105
|
-
bindingProfile,
|
|
106
|
-
operation: tool,
|
|
107
|
-
parameters: arguments_,
|
|
108
|
-
provider: replayProviderFor(session, tool),
|
|
109
|
-
evidenceProfile,
|
|
110
|
-
});
|
|
111
|
-
if (cached !== undefined)
|
|
112
|
-
return cached;
|
|
113
|
-
}
|
|
114
137
|
const { output, evidence } = await executeAnalysisTool({
|
|
115
138
|
session,
|
|
116
139
|
openedTarget: opened.value,
|
|
@@ -119,8 +142,33 @@ const runAnalysis = async (dependencies, path, tool, arguments_, options) => {
|
|
|
119
142
|
signal,
|
|
120
143
|
evidenceProfile,
|
|
121
144
|
});
|
|
122
|
-
if (evidence !== undefined)
|
|
123
|
-
session.recordEvidence(evidence);
|
|
145
|
+
if (evidence !== undefined) {
|
|
146
|
+
const recorded = session.recordEvidence(evidence);
|
|
147
|
+
if (!recorded.ok)
|
|
148
|
+
return cliError(recorded.error);
|
|
149
|
+
if (isWorkflowEvidenceTool(tool)) {
|
|
150
|
+
const unknowns = recordWorkflowUnknowns({
|
|
151
|
+
name: tool,
|
|
152
|
+
result: evidence.normalized_result,
|
|
153
|
+
evidenceId: evidence.evidence_id,
|
|
154
|
+
recordUnknown: (unknown) => session.recordUnknown(unknown),
|
|
155
|
+
});
|
|
156
|
+
if (!unknowns.ok)
|
|
157
|
+
return cliError(unknowns.error);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (isWorkflowEvidenceTool(tool) &&
|
|
161
|
+
tool !== "trace_native_ui_action" &&
|
|
162
|
+
snapshotPath !== undefined &&
|
|
163
|
+
evidence !== undefined &&
|
|
164
|
+
session.allowsSnapshotReplay(tool)) {
|
|
165
|
+
const workflowRecord = workflowSnapshotRecord(evidence, tool);
|
|
166
|
+
if (workflowRecord !== undefined) {
|
|
167
|
+
const recorded = session.recordWorkflowSnapshot(workflowRecord);
|
|
168
|
+
if (!recorded.ok)
|
|
169
|
+
return cliError(recorded.error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
124
172
|
if (tool !== "trace_native_ui_action" &&
|
|
125
173
|
snapshotPath !== undefined &&
|
|
126
174
|
evidence !== undefined) {
|
|
@@ -137,7 +185,6 @@ const runAnalysis = async (dependencies, path, tool, arguments_, options) => {
|
|
|
137
185
|
await session.close();
|
|
138
186
|
}
|
|
139
187
|
};
|
|
140
|
-
const canReplayDirectTool = (session, tool) => tool !== "trace_native_ui_action" && session.allowsSnapshotReplay(tool);
|
|
141
188
|
const executeAnalysisTool = async (input) => {
|
|
142
189
|
const { session, tool, signal, evidenceProfile } = input;
|
|
143
190
|
if (tool === "analyze_function") {
|
|
@@ -155,15 +202,12 @@ const executeAnalysisTool = async (input) => {
|
|
|
155
202
|
const result = await new EnhancedTools(session).execute(tool, input.arguments, signal);
|
|
156
203
|
if (!result.ok)
|
|
157
204
|
return { output: cliError(result.error) };
|
|
158
|
-
const evidence =
|
|
205
|
+
const evidence = createWorkflowEvidence({
|
|
206
|
+
target: input.openedTarget,
|
|
159
207
|
operation: tool,
|
|
160
208
|
parameters: input.arguments,
|
|
161
209
|
result: result.value,
|
|
162
|
-
|
|
163
|
-
? {}
|
|
164
|
-
: { analysisProfile: evidenceProfile }),
|
|
165
|
-
confidence: "derived",
|
|
166
|
-
limitations: ["Derived by an REA composed workflow."],
|
|
210
|
+
upstreamProfile: evidenceProfile,
|
|
167
211
|
});
|
|
168
212
|
return { output: evidence, evidence };
|
|
169
213
|
}
|
|
@@ -212,16 +256,36 @@ const prepareSnapshot = async (options) => {
|
|
|
212
256
|
return target;
|
|
213
257
|
if (!snapshotMatchesTarget(loaded.value.target, target.value))
|
|
214
258
|
return err(new EvidenceIntegrityError("Analysis snapshot target does not match the requested binary"));
|
|
215
|
-
return ok({ snapshot: loaded.value });
|
|
259
|
+
return ok({ snapshot: loaded.value, target: target.value });
|
|
260
|
+
};
|
|
261
|
+
const allowsSnapshotReplay = (route, tool) => {
|
|
262
|
+
if (tool === "trace_native_ui_action")
|
|
263
|
+
return false;
|
|
264
|
+
const descriptor = route.capabilities?.get(tool);
|
|
265
|
+
return descriptor === undefined
|
|
266
|
+
? ![...(route.capabilities?.values() ?? [])].some(({ cachePolicy }) => cachePolicy === "live")
|
|
267
|
+
: descriptor.cachePolicy !== "live";
|
|
268
|
+
};
|
|
269
|
+
const analysisProfileForRoute = (route, tool) => {
|
|
270
|
+
const profile = route.profile;
|
|
271
|
+
if (profile === null || profile === undefined)
|
|
272
|
+
return undefined;
|
|
273
|
+
if (isWorkflowEvidenceTool(tool))
|
|
274
|
+
return workflowAnalysisProfile(profile, tool);
|
|
275
|
+
const provider = providerIdentityForRoute(route, tool);
|
|
276
|
+
return provider.id === profile.provider.id ? profile : undefined;
|
|
277
|
+
};
|
|
278
|
+
/** Mirror BinarySession.providerIdentity for a route not opened yet. */
|
|
279
|
+
const providerIdentityForRoute = (route, operation) => {
|
|
280
|
+
const selected = route.capabilities?.get(operation)?.provider ?? route.identity;
|
|
281
|
+
return route.profile?.provider.id === selected.id
|
|
282
|
+
? route.profile.provider
|
|
283
|
+
: selected;
|
|
216
284
|
};
|
|
217
|
-
const replayProviderFor = (session, tool) => isWorkflowEvidenceTool(tool)
|
|
218
|
-
? REA_WORKFLOW_PROVIDER
|
|
219
|
-
: session.providerIdentity(tool);
|
|
220
285
|
const analysisProfileForEvidence = (session, tool) => {
|
|
221
286
|
if (!isWorkflowEvidenceTool(tool))
|
|
222
287
|
return session.analysisProfile(tool);
|
|
223
|
-
|
|
224
|
-
return upstream === undefined ? undefined : workflowAnalysisProfile(upstream);
|
|
288
|
+
return session.analysisProfile();
|
|
225
289
|
};
|
|
226
290
|
const isWorkflowEvidenceTool = (tool) => tool === "binary_overview" ||
|
|
227
291
|
tool === "inspect_native_api" ||
|
|
@@ -7,6 +7,7 @@ import { parseBinaryTarget } from "./BinaryTargetResolver.js";
|
|
|
7
7
|
import { execFileOutput } from "../process/ExecFileOutput.js";
|
|
8
8
|
import { probeHomebrew } from "./homebrew.js";
|
|
9
9
|
import { linuxHopperBinarySupported, linuxSharedLibrariesAvailable, readLinuxDistribution, } from "./LinuxHopper.js";
|
|
10
|
+
import { canonicalSkillNeedsInstall } from "./SetupSkill.js";
|
|
10
11
|
import { CATALOG_IDENTITY } from "../catalogIdentity.js";
|
|
11
12
|
import { PRODUCT_IDENTITY, SDK_IDENTITY } from "../identity.js";
|
|
12
13
|
import { readClientRegistrationStatuses, } from "./ClientRegistrationStatus.js";
|
|
@@ -61,7 +62,7 @@ const collectDoctorIdentity = async (host) => {
|
|
|
61
62
|
checks: [
|
|
62
63
|
...(skillAligned ? [] : [skillIdentityCheck(installedSkillIdentity)]),
|
|
63
64
|
...registrations
|
|
64
|
-
.filter((registration) => registration.state !== "aligned")
|
|
65
|
+
.filter((registration) => registration.state !== "aligned" && registration.state !== "manual")
|
|
65
66
|
.map(registrationCheck),
|
|
66
67
|
],
|
|
67
68
|
value: {
|
|
@@ -96,7 +97,7 @@ const collectDoctorIdentity = async (host) => {
|
|
|
96
97
|
};
|
|
97
98
|
const skillIdentityAligned = (identity) => identity?.version === PRODUCT_IDENTITY.skillVersion &&
|
|
98
99
|
identity.toolCount === CATALOG_IDENTITY.counts.mcp_tools &&
|
|
99
|
-
identity.
|
|
100
|
+
identity.canonical;
|
|
100
101
|
const skillIdentityCheck = (identity) => ({
|
|
101
102
|
name: "skill:identity",
|
|
102
103
|
ok: false,
|
|
@@ -281,6 +282,7 @@ const installedSkillIdentity = async (home) => {
|
|
|
281
282
|
const content = await readInstalledSkill(home);
|
|
282
283
|
const countText = /^\s{2}tool_count:\s*(\d+)\s*$/mu.exec(content)?.[1];
|
|
283
284
|
return {
|
|
285
|
+
canonical: !(await canonicalSkillNeedsInstall(home)),
|
|
284
286
|
version: /^\s{2}version:\s*"([^"]+)"\s*$/mu.exec(content)?.[1] ?? null,
|
|
285
287
|
toolCount: countText === undefined ? null : Number.parseInt(countText, 10),
|
|
286
288
|
catalogDigest: /^\s{2}catalog_digest:\s*"([a-f0-9]{64})"\s*$/mu.exec(content)?.[1] ??
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { uniqueSorted } from "../domain/canonicalOrdering.js";
|
|
2
|
+
import { manualRegistrationRemediation } from "./SupportedClients.js";
|
|
2
3
|
/** Normalize a caller-selected doctor readiness boundary. */
|
|
3
4
|
export const normalizeDoctorScope = (requested, target) => ({
|
|
4
5
|
mode: requested === undefined ? "audit-wide" : "explicit",
|
|
@@ -62,22 +63,33 @@ const selectedProviderChecksFor = (providerId, checks, providers) => {
|
|
|
62
63
|
},
|
|
63
64
|
];
|
|
64
65
|
};
|
|
65
|
-
const selectedRegistrationCheck = (client, status) =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
const selectedRegistrationCheck = (client, status) => {
|
|
67
|
+
const manual = manualRegistrationRemediation(client);
|
|
68
|
+
if (status === undefined && manual !== undefined)
|
|
69
|
+
return {
|
|
70
|
+
name: `registration:${client}`,
|
|
71
|
+
ok: false,
|
|
72
|
+
classification: "config_drift",
|
|
73
|
+
detail: `${client} is not registered through a local configuration file.`,
|
|
74
|
+
remediation: manual,
|
|
75
|
+
};
|
|
76
|
+
return status === undefined
|
|
74
77
|
? {
|
|
75
78
|
name: `registration:${client}`,
|
|
76
|
-
ok:
|
|
77
|
-
classification: "
|
|
78
|
-
detail:
|
|
79
|
+
ok: false,
|
|
80
|
+
classification: "config_drift",
|
|
81
|
+
detail: `Requested client ${client} was not detected.`,
|
|
82
|
+
remediation: `Install or select ${client}, then run rea setup --client ${client}.`,
|
|
79
83
|
}
|
|
80
|
-
:
|
|
84
|
+
: status.state === "aligned"
|
|
85
|
+
? {
|
|
86
|
+
name: `registration:${client}`,
|
|
87
|
+
ok: true,
|
|
88
|
+
classification: "healthy",
|
|
89
|
+
detail: status.config_path,
|
|
90
|
+
}
|
|
91
|
+
: registrationCheck(status);
|
|
92
|
+
};
|
|
81
93
|
const registrationCheck = (status) => ({
|
|
82
94
|
name: `registration:${status.client}`,
|
|
83
95
|
ok: false,
|
|
@@ -28,32 +28,29 @@ export const traceLiteralFeature = async (call, input, signal) => {
|
|
|
28
28
|
};
|
|
29
29
|
const literalMatches = async (call, input, sources, signal) => {
|
|
30
30
|
const matches = [];
|
|
31
|
-
const needles = [...new Set(input.query.trim().split(/\s+/u))];
|
|
32
31
|
const matched = new Set();
|
|
33
|
-
for (const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
}
|
|
32
|
+
for (const [tool, type] of sources) {
|
|
33
|
+
const result = await call(tool, {
|
|
34
|
+
pattern: input.query,
|
|
35
|
+
mode: "literal",
|
|
36
|
+
case_sensitive: input.case_sensitive,
|
|
37
|
+
}, signal);
|
|
38
|
+
if (!result.ok)
|
|
39
|
+
return result;
|
|
40
|
+
const items = z
|
|
41
|
+
.array(z.object({ address: z.string(), value: z.string() }))
|
|
42
|
+
.safeParse(result.value);
|
|
43
|
+
if (!items.success)
|
|
44
|
+
return err(new AnalysisOutputError(tool, "provider returned an invalid search result"));
|
|
45
|
+
addPageMatches({
|
|
46
|
+
items: items.data.map(({ address, value: name }) => ({
|
|
47
|
+
address,
|
|
48
|
+
name,
|
|
49
|
+
})),
|
|
50
|
+
type,
|
|
51
|
+
matches,
|
|
52
|
+
matched,
|
|
53
|
+
});
|
|
57
54
|
}
|
|
58
55
|
return ok({ matches });
|
|
59
56
|
};
|
|
@@ -3,7 +3,7 @@ import { enhancedInputSchemas } from "../contracts/enhancedInputs.js";
|
|
|
3
3
|
import { AnalysisCancelledError, AnalysisOutputError, } from "../domain/analysisErrorCore.js";
|
|
4
4
|
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
5
5
|
import {} from "../domain/analysisErrorBase.js";
|
|
6
|
-
import { addressDistance, functionDossierSchema,
|
|
6
|
+
import { addressDistance, functionDossierSchema, parseFunctionDossier, parseListCount, parseRelatedAddresses, parseSegments, } from "../domain/hopperValues.js";
|
|
7
7
|
import { err, ok } from "../domain/result.js";
|
|
8
8
|
import { categorizeSwiftTypes, discoverObjcClasses, discoverObjcProtocols, } from "../domain/symbolAnalysis.js";
|
|
9
9
|
import { inspectNativeDispatch } from "./native/NativeDispatchMetadataInspection.js";
|
|
@@ -11,7 +11,9 @@ import { traceNativeValues } from "./native/NativeValueTrace.js";
|
|
|
11
11
|
import { traceNativeUiAction } from "./native/NativeUiActionTrace.js";
|
|
12
12
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
13
13
|
import { invalidEnhancedInput, } from "./EnhancedToolTypes.js";
|
|
14
|
+
import { resolveAnalysisDocument } from "./AnalysisDocument.js";
|
|
14
15
|
import { traceCallPath } from "./CallPathTracing.js";
|
|
16
|
+
import { resolveProcedureAddress } from "./ProcedureAddressResolution.js";
|
|
15
17
|
import { traceLiteralFeature } from "./EnhancedLiteralTracing.js";
|
|
16
18
|
import { projectNativeApiInspection } from "./native/NativeApiInspection.js";
|
|
17
19
|
/**
|
|
@@ -203,9 +205,12 @@ export class EnhancedTools {
|
|
|
203
205
|
async #callGraph(input, signal) {
|
|
204
206
|
const relation = input.direction === "forward" ? "callees" : "callers";
|
|
205
207
|
const tool = input.direction === "forward" ? "procedure_callees" : "procedure_callers";
|
|
206
|
-
const
|
|
208
|
+
const resolved = await resolveProcedureAddress(this.#call.bind(this), input.address, signal);
|
|
209
|
+
if (!resolved.ok)
|
|
210
|
+
return resolved;
|
|
211
|
+
const discovered = new Set([resolved.value]);
|
|
207
212
|
const queue = [
|
|
208
|
-
{ address:
|
|
213
|
+
{ address: resolved.value, depth: 0 },
|
|
209
214
|
];
|
|
210
215
|
let queueIndex = 0;
|
|
211
216
|
const graph = {};
|
|
@@ -274,16 +279,16 @@ export class EnhancedTools {
|
|
|
274
279
|
});
|
|
275
280
|
}
|
|
276
281
|
async #binaryOverview(signal) {
|
|
277
|
-
const
|
|
282
|
+
const document = await resolveAnalysisDocument(this.analysis, undefined, signal);
|
|
283
|
+
if (!document.ok)
|
|
284
|
+
return document;
|
|
285
|
+
const [segmentsResult, proceduresResult, stringsResult] = await Promise.all([
|
|
278
286
|
this.#call("list_segments", {}, signal),
|
|
279
|
-
this.#call("list_documents", {}, signal),
|
|
280
287
|
this.#call("list_procedures", {}, signal),
|
|
281
288
|
this.#call("list_strings", {}, signal),
|
|
282
289
|
]);
|
|
283
290
|
if (!segmentsResult.ok)
|
|
284
291
|
return segmentsResult;
|
|
285
|
-
if (!documentsResult.ok)
|
|
286
|
-
return documentsResult;
|
|
287
292
|
if (!proceduresResult.ok)
|
|
288
293
|
return proceduresResult;
|
|
289
294
|
if (!stringsResult.ok)
|
|
@@ -291,9 +296,6 @@ export class EnhancedTools {
|
|
|
291
296
|
const segments = parseSegments(segmentsResult.value);
|
|
292
297
|
if (!segments.ok)
|
|
293
298
|
return segments;
|
|
294
|
-
const documents = parseDocuments(documentsResult.value);
|
|
295
|
-
if (!documents.ok)
|
|
296
|
-
return documents;
|
|
297
299
|
const procedureCount = parseListCount(proceduresResult.value, "procedures");
|
|
298
300
|
if (!procedureCount.ok)
|
|
299
301
|
return procedureCount;
|
|
@@ -301,7 +303,7 @@ export class EnhancedTools {
|
|
|
301
303
|
if (!stringCount.ok)
|
|
302
304
|
return stringCount;
|
|
303
305
|
return ok({
|
|
304
|
-
document:
|
|
306
|
+
document: document.value,
|
|
305
307
|
segments: segments.value.map(({ name, start, end }) => ({
|
|
306
308
|
name,
|
|
307
309
|
start,
|
|
@@ -1,37 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { describeEvidenceBundleFailure, describeValidationFailure, parseEvidenceBundle, } from "../domain/evidenceBundle.js";
|
|
2
2
|
import { EvidenceFileError, EvidenceIntegrityError, } from "../domain/evidenceErrors.js";
|
|
3
3
|
import { err, ok } from "../domain/result.js";
|
|
4
|
-
import { parseProcessCapture } from "../domain/processCapture.js";
|
|
5
|
-
import {
|
|
4
|
+
import { parseProcessCapture } from "../domain/process/processCapture.js";
|
|
5
|
+
import { bufferedJsonParts, canonicalJsonParts, } from "../domain/jsonSerialization.js";
|
|
6
|
+
import { readJsonFile, writeTextParts } from "./JsonFiles.js";
|
|
6
7
|
/** Read and validate an evidence bundle at the caller-supplied path. */
|
|
7
8
|
export const readEvidenceBundle = async (path) => {
|
|
8
9
|
const loaded = await readJsonFile(path);
|
|
9
10
|
if (!loaded.ok)
|
|
10
11
|
return loaded;
|
|
12
|
+
let bundle;
|
|
11
13
|
try {
|
|
12
|
-
|
|
13
|
-
for (const record of bundle.records) {
|
|
14
|
-
if (record.predicate_type === "rea.process-capture")
|
|
15
|
-
parseProcessCapture(record.normalized_result);
|
|
16
|
-
}
|
|
17
|
-
return ok(bundle);
|
|
14
|
+
bundle = parseEvidenceBundle(loaded.value);
|
|
18
15
|
}
|
|
19
16
|
catch (cause) {
|
|
20
17
|
return err(new EvidenceIntegrityError("Evidence bundle validation failed", {
|
|
21
18
|
cause,
|
|
19
|
+
userMessage: describeEvidenceBundleFailure(loaded.value, cause),
|
|
22
20
|
}));
|
|
23
21
|
}
|
|
22
|
+
for (const record of bundle.records) {
|
|
23
|
+
if (record.predicate_type !== "rea.process-capture")
|
|
24
|
+
continue;
|
|
25
|
+
try {
|
|
26
|
+
parseProcessCapture(record.normalized_result);
|
|
27
|
+
}
|
|
28
|
+
catch (cause) {
|
|
29
|
+
return err(new EvidenceIntegrityError("Evidence bundle validation failed", {
|
|
30
|
+
cause,
|
|
31
|
+
userMessage: `Process capture record ${record.evidence_id} has an invalid normalized_result (${describeValidationFailure(cause)}). Recreate or re-export the bundle, then try again.`,
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return ok(bundle);
|
|
24
36
|
};
|
|
25
37
|
/** Atomically write deterministic evidence JSON at the caller-supplied path. */
|
|
26
38
|
export const writeEvidenceBundle = async (bundle, path, overwrite) => {
|
|
27
|
-
let
|
|
39
|
+
let checked;
|
|
28
40
|
try {
|
|
29
|
-
|
|
41
|
+
checked = parseEvidenceBundle(bundle);
|
|
30
42
|
}
|
|
31
43
|
catch (cause) {
|
|
32
44
|
return err(new EvidenceIntegrityError("Evidence bundle validation failed", {
|
|
33
45
|
cause,
|
|
34
46
|
}));
|
|
35
47
|
}
|
|
36
|
-
return
|
|
48
|
+
return writeTextParts(bufferedJsonParts(canonicalJsonParts(checked)), path, overwrite);
|
|
37
49
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { toolContract } from "../contracts/toolContracts.js";
|
|
2
|
-
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
|
3
2
|
import { createEvidence } from "../domain/evidence.js";
|
|
4
3
|
import { parseFunctionDossier } from "../domain/hopperValues.js";
|
|
5
4
|
import { jsonObjectSchema } from "../domain/jsonValue.js";
|
|
6
5
|
import { err, ok } from "../domain/result.js";
|
|
7
|
-
import {
|
|
6
|
+
import { analysisInputErrorFromIssues } from "../domain/inputIssueProjection.js";
|
|
8
7
|
/** Preserve the provider's observations when presenting a validated function dossier. */
|
|
9
8
|
export const executeFunctionAnalysisEvidence = async (analysis, parameters, target, options) => {
|
|
10
9
|
const input = toolContract("analyze_function").inputSchema.safeParse(parameters);
|
|
11
10
|
if (!input.success)
|
|
12
|
-
return err(
|
|
11
|
+
return err(analysisInputErrorFromIssues("analyze_function", input.error.issues, parameters, { cause: input.error }));
|
|
13
12
|
const arguments_ = jsonObjectSchema.parse(input.data);
|
|
14
13
|
const execution = await analysis.execute("analyze_function", arguments_, options);
|
|
15
14
|
if (!execution.ok)
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
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
6
|
import { err, ok } from "../domain/result.js";
|
|
7
|
+
import { requestInputError, workflowInputError } from "./workflowInputError.js";
|
|
7
8
|
/** Parse one inventory projection and wrap its deterministic result in Evidence. */
|
|
8
9
|
export const projectInventoryEvidence = (options) => {
|
|
9
10
|
const parsed = options.schema.safeParse(options.rawInput);
|
|
10
11
|
if (!parsed.success)
|
|
11
|
-
return err(
|
|
12
|
+
return err(requestInputError(options.operation, parsed.error, options.rawInput));
|
|
12
13
|
try {
|
|
13
14
|
const result = options.project(parsed.data);
|
|
14
15
|
const first = parsed.data.inventory_evidence[0];
|
|
@@ -38,7 +39,7 @@ export const projectInventoryEvidence = (options) => {
|
|
|
38
39
|
}
|
|
39
40
|
catch (cause) {
|
|
40
41
|
return err(cause instanceof TypeError || cause instanceof z.ZodError
|
|
41
|
-
?
|
|
42
|
+
? workflowInputError(options.operation, cause)
|
|
42
43
|
: new AnalysisProtocolError(options.protocolError, { cause }));
|
|
43
44
|
}
|
|
44
45
|
};
|