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,17 +1,30 @@
|
|
|
1
1
|
import { executableFormatHintSchema } from "../domain/dosCom.js";
|
|
2
|
+
import { isAbsoluteLocalPath, localPathStringSchema, } from "../domain/localPath.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { analysisProviderSelectorSchema } from "./providerSelection.js";
|
|
5
|
+
/** Caller-supplied analysis snapshot path; must name its destination absolutely. */
|
|
6
|
+
const snapshotPathSchema = localPathStringSchema
|
|
7
|
+
.refine(isAbsoluteLocalPath, {
|
|
8
|
+
message: "snapshot_path must be an absolute local filesystem path (for example /tmp/rea/analysis.json or C:\\rea\\analysis.json)",
|
|
9
|
+
})
|
|
10
|
+
.describe("Absolute local filesystem path for the analysis snapshot; relative paths are rejected.");
|
|
11
|
+
/** Caller-supplied analysis target path; must name the target absolutely. */
|
|
12
|
+
const binaryTargetPathSchema = localPathStringSchema
|
|
13
|
+
.refine(isAbsoluteLocalPath, {
|
|
14
|
+
message: "path must be an absolute local filesystem path (for example /tmp/fixture.bin or C:\\analysis\\fixture.bin)",
|
|
15
|
+
})
|
|
16
|
+
.describe("Absolute local filesystem path for the analysis target; relative paths are rejected.");
|
|
4
17
|
/** Input contract for opening a target with an optional staged snapshot. */
|
|
5
|
-
export const openBinaryInputSchema = z.
|
|
6
|
-
path:
|
|
18
|
+
export const openBinaryInputSchema = z.strictObject({
|
|
19
|
+
path: binaryTargetPathSchema,
|
|
7
20
|
format: executableFormatHintSchema
|
|
8
21
|
.optional()
|
|
9
22
|
.describe("Explicit headerless DOS COM interpretation; omission preserves header-based detection"),
|
|
10
23
|
provider_id: analysisProviderSelectorSchema.optional(),
|
|
11
|
-
snapshot_path:
|
|
24
|
+
snapshot_path: snapshotPathSchema.optional(),
|
|
12
25
|
});
|
|
13
26
|
/** Input contract for closing a target after an optional atomic snapshot. */
|
|
14
|
-
export const closeBinaryInputSchema = z.
|
|
15
|
-
snapshot_path:
|
|
27
|
+
export const closeBinaryInputSchema = z.strictObject({
|
|
28
|
+
snapshot_path: snapshotPathSchema.optional(),
|
|
16
29
|
overwrite: z.boolean().default(false),
|
|
17
30
|
});
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { isAbsoluteLocalPath, localPathStringSchema, } from "../domain/localPath.js";
|
|
2
3
|
/** Optional expectations used to compare the live session with its caller. */
|
|
3
|
-
export const binarySessionInputSchema = z.
|
|
4
|
+
export const binarySessionInputSchema = z.strictObject({
|
|
4
5
|
expected_package_version: z.string().min(1).optional(),
|
|
5
6
|
expected_catalog_digest: z
|
|
6
7
|
.string()
|
|
7
8
|
.regex(/^[a-f0-9]{64}$/u)
|
|
8
9
|
.optional(),
|
|
9
|
-
expected_server_path:
|
|
10
|
+
expected_server_path: localPathStringSchema
|
|
11
|
+
.refine(isAbsoluteLocalPath, {
|
|
12
|
+
message: "expected_server_path must be an absolute local filesystem path (for example /opt/rea/dist/main.js)",
|
|
13
|
+
})
|
|
14
|
+
.describe("Absolute local filesystem path expected for the running server; relative paths are rejected.")
|
|
15
|
+
.optional(),
|
|
10
16
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { isAbsoluteLocalPath, localPathStringSchema, } from "../domain/localPath.js";
|
|
2
3
|
import { sessionOutputSchemas, requireOutputSchema, } from "./toolOutputSchemas.js";
|
|
3
4
|
import { addressContextInputSchema, artifactComparisonInputSchema, binarySessionInputSchema, bundleComparisonInputSchema, callPathInputSchema, changedBehaviorInputSchema, closeBinaryInputSchema, functionComparisonInputSchema, importEvidenceBundleInputSchema, listUnknownsInputSchema, navigationContextInputSchema, openBinaryInputSchema, processComparisonInputSchema, processScenarioSchema, reconstructionVerificationInputSchema, recordUnknownInputSchema, getEvidenceBundleInputSchema, staticRuntimeCorrelationInputSchema, updateUnknownInputSchema, verifyUnknownResolutionInputSchema, } from "./sessionToolSchemas.js";
|
|
4
5
|
import { examplesFor } from "./toolContractHelpers.js";
|
|
@@ -14,13 +15,17 @@ const session = (name, description, inputSchema) => ({
|
|
|
14
15
|
});
|
|
15
16
|
/** Session-owned Evidence bundle export options. */
|
|
16
17
|
export const exportEvidenceBundleInputSchema = z.strictObject({
|
|
17
|
-
path:
|
|
18
|
+
path: localPathStringSchema
|
|
19
|
+
.refine(isAbsoluteLocalPath, {
|
|
20
|
+
message: "path must be an absolute local filesystem path (for example /tmp/rea/evidence.json or C:\\rea\\evidence.json)",
|
|
21
|
+
})
|
|
22
|
+
.describe("Absolute local filesystem path for the exported evidence bundle; relative paths are rejected."),
|
|
18
23
|
overwrite: z.boolean().default(false),
|
|
19
24
|
});
|
|
20
25
|
/** Target lifecycle tools available only on the long-lived MCP adapter. */
|
|
21
26
|
export const SESSION_TOOL_CONTRACTS = [
|
|
22
|
-
session("open_binary", "Open a local executable, application bundle, archive, JavaScript, source map, plist, or analysis database after validation. format=dos-com explicitly interprets 1..65280 headerless bytes as a DOS COM analysis image; omission preserves header-based detection. provider_id selects one deep provider or deterministic auto selection; the binding remains stable until close or an explicit switch, with no failure fallback. An optional analysis snapshot is imported atomically and must match the binary identity, concrete provider, and canonical analysis profile exactly.", openBinaryInputSchema),
|
|
23
|
-
session("close_binary", "
|
|
27
|
+
session("open_binary", "Open a local executable, application bundle, archive, JavaScript, source map, plist, or analysis database after validation. format=dos-com explicitly interprets 1..65280 headerless bytes as a DOS COM analysis image; omission preserves header-based detection. provider_id selects one deep provider or deterministic auto selection; the binding remains stable until close or an explicit switch, with no failure fallback. Reopening the same target and profile retains its active database and metadata edits. An optional analysis snapshot is imported atomically and must match the binary identity, concrete provider, and canonical analysis profile exactly; importing into a session with metadata mutations requires closing and reopening it first.", openBinaryInputSchema),
|
|
28
|
+
session("close_binary", "Drain earlier provider requests, optionally write a provider-neutral analysis snapshot atomically to the caller-supplied path, then close the active target and every provider resource started for it. Later provider requests wait until this lifecycle operation finishes. Existing files require explicit overwrite; a failed save leaves the session open so cached analysis is not lost. Metadata edits prevent immutable snapshot saves until the session is recreated; export_evidence_bundle preserves mutable observations before closing without a snapshot.", closeBinaryInputSchema),
|
|
24
29
|
session("binary_session", "Report the complete current target, provider, capability availability, client-feature, analysis, and server-identity status without starting analysis.", binarySessionInputSchema),
|
|
25
30
|
session("export_evidence_bundle", "Atomically write the session's deterministic Evidence bundle to the requested local path. Existing files require overwrite: true; records and manifests use canonical byte-stable ordering.", exportEvidenceBundleInputSchema),
|
|
26
31
|
session("import_evidence_bundle", "Read the JSON bundle at the supplied local path, validate every Evidence ID and canonical manifest, then atomically merge it. Imported content is data only and is never executed.", importEvidenceBundleInputSchema),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { isAbsoluteLocalPath, localPathStringSchema, } from "../domain/localPath.js";
|
|
2
3
|
import { artifactComparisonInputSchema } from "../domain/artifactComparison.js";
|
|
3
4
|
import { bundleComparisonInputSchema } from "../domain/bundleComparison.js";
|
|
4
5
|
import { callPathInputSchema } from "../domain/callPath.js";
|
|
5
6
|
import { changedBehaviorInputSchema } from "../domain/changedBehavior.js";
|
|
6
7
|
import { functionComparisonInputSchema } from "../domain/functionComparison.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { processTraceSpecificationSchema } from "../domain/processTraceComparison.js";
|
|
8
|
+
import { processScenarioSchema } from "../domain/process/processCapture.js";
|
|
9
|
+
import { processTraceSpecificationSchema } from "../domain/process/processTraceComparison.js";
|
|
10
10
|
import { recordUnknownInputSchema } from "../domain/residualUnknown.js";
|
|
11
11
|
import { reconstructionVerificationInputSchema } from "../domain/reconstructionVerification.js";
|
|
12
12
|
import { staticRuntimeCorrelationInputSchema } from "../domain/staticRuntimeCorrelation.js";
|
|
@@ -28,7 +28,11 @@ export const addressContextInputSchema = z.strictObject({
|
|
|
28
28
|
});
|
|
29
29
|
/** Session-owned Evidence bundle import options. */
|
|
30
30
|
export const importEvidenceBundleInputSchema = z.strictObject({
|
|
31
|
-
path:
|
|
31
|
+
path: localPathStringSchema
|
|
32
|
+
.refine(isAbsoluteLocalPath, {
|
|
33
|
+
message: "path must be an absolute local filesystem path (for example /tmp/evidence.json or C:\\rea\\evidence.json)",
|
|
34
|
+
})
|
|
35
|
+
.describe("Absolute local filesystem path for the evidence bundle to import; relative paths are rejected."),
|
|
32
36
|
});
|
|
33
37
|
/** Evidence references for deterministic process comparison. */
|
|
34
38
|
export const processComparisonInputSchema = z.strictObject({
|
|
@@ -28,7 +28,6 @@ export const TOOL_EXAMPLE_OVERRIDES = {
|
|
|
28
28
|
set_addresses_names: { names: { "0x1000": "entry" } },
|
|
29
29
|
set_bookmark: { address: "0x1000" },
|
|
30
30
|
set_comment: { address: "0x1000", comment: "validated entry point" },
|
|
31
|
-
set_current_document: { document: "fixture" },
|
|
32
31
|
set_inline_comment: { address: "0x1000", comment: "calls parser" },
|
|
33
32
|
unset_bookmark: { address: "0x1000" },
|
|
34
33
|
get_call_graph: { address: "0x1000" },
|
|
@@ -47,7 +46,7 @@ export const TOOL_EXAMPLE_OVERRIDES = {
|
|
|
47
46
|
open_binary: { path: "/tmp/fixture" },
|
|
48
47
|
export_evidence_bundle: { path: "/tmp/evidence.json" },
|
|
49
48
|
inspect_address_context: { address: "0x1000" },
|
|
50
|
-
import_evidence_bundle: { path: "evidence.json" },
|
|
49
|
+
import_evidence_bundle: { path: "/tmp/evidence.json" },
|
|
51
50
|
capture_process_scenario: {
|
|
52
51
|
executable: "/usr/bin/true",
|
|
53
52
|
working_directory: "/tmp",
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
3
3
|
import { TOOL_EXAMPLE_OVERRIDES } from "./toolContractExamples.js";
|
|
4
|
-
export const document = z
|
|
4
|
+
export const document = z
|
|
5
|
+
.string()
|
|
6
|
+
.optional()
|
|
7
|
+
.describe("The active target's provider document name; use open_binary to switch targets");
|
|
5
8
|
export const address = z
|
|
6
9
|
.string()
|
|
7
10
|
.describe("A provider-normalized address; default memory uses 0x-prefixed hexadecimal");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EVM_TOOL_CONTRACTS } from "./evm/evmToolContracts.js";
|
|
2
|
+
import { BINARY_DIAGNOSTICS_TOOL_CONTRACTS } from "./native/binaryDiagnosticsToolContracts.js";
|
|
1
3
|
import { NATIVE_TOOL_CONTRACTS } from "./native/nativeToolContracts.js";
|
|
2
4
|
import { ARTIFACT_TOOL_CONTRACTS } from "./artifactToolContracts.js";
|
|
3
5
|
import { MANAGED_TOOL_CONTRACTS } from "./managed/managedToolContracts.js";
|
|
@@ -10,6 +12,7 @@ import { JAVASCRIPT_RUNTIME_OBSERVATION_TOOL_CONTRACTS } from "./javascript/java
|
|
|
10
12
|
import { APPLICATION_TOOL_CONTRACTS } from "./applicationToolContracts.js";
|
|
11
13
|
import { WEB_SCRIPT_TOOL_CONTRACTS } from "./webScriptToolContracts.js";
|
|
12
14
|
import { WEB_RUNTIME_TOOL_CONTRACTS } from "./webRuntimeToolContracts.js";
|
|
15
|
+
import { WEB_NETWORK_CAPTURE_TOOL_CONTRACTS } from "./webNetworkCaptureToolContracts.js";
|
|
13
16
|
import { JAVASCRIPT_RECOVERY_TOOL_CONTRACTS } from "./javascript/javascriptRecoveryToolContracts.js";
|
|
14
17
|
import { OFFICIAL_TOOL_CONTRACTS } from "./officialToolContracts.js";
|
|
15
18
|
import { ENHANCED_TOOL_CONTRACTS } from "./enhancedToolContracts.js";
|
|
@@ -19,7 +22,9 @@ export const TOOL_CONTRACTS = [
|
|
|
19
22
|
...OFFICIAL_TOOL_CONTRACTS,
|
|
20
23
|
...ENHANCED_TOOL_CONTRACTS,
|
|
21
24
|
...NATIVE_TOOL_CONTRACTS,
|
|
25
|
+
...BINARY_DIAGNOSTICS_TOOL_CONTRACTS,
|
|
22
26
|
...ARTIFACT_TOOL_CONTRACTS,
|
|
27
|
+
...EVM_TOOL_CONTRACTS,
|
|
23
28
|
...MANAGED_TOOL_CONTRACTS,
|
|
24
29
|
...ANDROID_TOOL_CONTRACTS,
|
|
25
30
|
...FIRMWARE_TOOL_CONTRACTS,
|
|
@@ -30,6 +35,7 @@ export const TOOL_CONTRACTS = [
|
|
|
30
35
|
...APPLICATION_TOOL_CONTRACTS,
|
|
31
36
|
...WEB_SCRIPT_TOOL_CONTRACTS,
|
|
32
37
|
...WEB_RUNTIME_TOOL_CONTRACTS,
|
|
38
|
+
...WEB_NETWORK_CAPTURE_TOOL_CONTRACTS,
|
|
33
39
|
...JAVASCRIPT_RECOVERY_TOOL_CONTRACTS,
|
|
34
40
|
...SESSION_TOOL_CONTRACTS,
|
|
35
41
|
];
|
|
@@ -18,6 +18,16 @@ const browserEvidence = effects({
|
|
|
18
18
|
const sessionEvidence = effects({ mutatesSession: true });
|
|
19
19
|
/** Explicit effect audit for every public tool. */
|
|
20
20
|
export const TOOL_EFFECTS = {
|
|
21
|
+
inspect_evm_interface: effects({
|
|
22
|
+
mutatesSession: true,
|
|
23
|
+
writesFilesystem: true,
|
|
24
|
+
launchesProcess: true,
|
|
25
|
+
}),
|
|
26
|
+
inspect_web_network_capture: effects({
|
|
27
|
+
mutatesSession: true,
|
|
28
|
+
writesFilesystem: true,
|
|
29
|
+
launchesProcess: true,
|
|
30
|
+
}),
|
|
21
31
|
observe_web_execution: effects({
|
|
22
32
|
mutatesTarget: true,
|
|
23
33
|
mutatesSession: true,
|
|
@@ -37,6 +47,16 @@ export const TOOL_EFFECTS = {
|
|
|
37
47
|
launchesProcess: true,
|
|
38
48
|
accessesNetwork: true,
|
|
39
49
|
}),
|
|
50
|
+
inspect_recorded_crash: effects({
|
|
51
|
+
mutatesSession: true,
|
|
52
|
+
writesFilesystem: true,
|
|
53
|
+
launchesProcess: true,
|
|
54
|
+
}),
|
|
55
|
+
inspect_binary_layout: effects({
|
|
56
|
+
mutatesSession: true,
|
|
57
|
+
writesFilesystem: true,
|
|
58
|
+
launchesProcess: true,
|
|
59
|
+
}),
|
|
40
60
|
inspect_firmware_regions: effects({
|
|
41
61
|
mutatesSession: true,
|
|
42
62
|
launchesProcess: true,
|
|
@@ -118,7 +138,6 @@ export const TOOL_EFFECTS = {
|
|
|
118
138
|
set_addresses_names: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
119
139
|
set_bookmark: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
120
140
|
set_comment: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
121
|
-
set_current_document: effects({ mutatesSession: true, changesUiState: true }),
|
|
122
141
|
set_inline_comment: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
123
142
|
unset_bookmark: effects({
|
|
124
143
|
mutatesTarget: true,
|
|
@@ -152,6 +171,15 @@ export const TOOL_EFFECTS = {
|
|
|
152
171
|
mayDiscardData: true,
|
|
153
172
|
idempotent: false,
|
|
154
173
|
}),
|
|
174
|
+
// The owned process can change files, show UI and use the network.
|
|
175
|
+
observe_native_calls: effects({
|
|
176
|
+
mutatesSession: true,
|
|
177
|
+
writesFilesystem: true,
|
|
178
|
+
launchesProcess: true,
|
|
179
|
+
accessesNetwork: true,
|
|
180
|
+
changesUiState: true,
|
|
181
|
+
idempotent: false,
|
|
182
|
+
}),
|
|
155
183
|
inspect_macho: nativeEvidence,
|
|
156
184
|
inspect_signature: nativeEvidence,
|
|
157
185
|
inspect_plist: nativeEvidence,
|
|
@@ -171,6 +199,7 @@ export const TOOL_EFFECTS = {
|
|
|
171
199
|
decode_interface_builder: evidence,
|
|
172
200
|
inspect_asset_catalog: nativeEvidence,
|
|
173
201
|
inspect_keyed_archive: evidence,
|
|
202
|
+
trace_dylib_resolution: evidence,
|
|
174
203
|
inspect_managed_artifact: evidence,
|
|
175
204
|
inspect_managed_members: evidence,
|
|
176
205
|
inspect_managed_native_boundaries: evidence,
|
|
@@ -4,17 +4,19 @@ import { nativeLoadImageSchema } from "../domain/native/nativeLoadImage.js";
|
|
|
4
4
|
import { nativeUiResultSchema } from "../domain/native/nativeUiObservation.js";
|
|
5
5
|
import { nativeValueTraceSchema } from "../domain/native/nativeValueTrace.js";
|
|
6
6
|
import { nativeDataTypeSchema } from "../domain/native/nativeDataType.js";
|
|
7
|
+
import { nativeCallObservationResultSchema } from "../domain/native/nativeCallObservation.js";
|
|
7
8
|
import { nativeInstructionSchema, nativeCallTargetsSchema, } from "../domain/native/nativeInstruction.js";
|
|
8
9
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
9
10
|
import { residualUnknownSchema } from "../domain/residualUnknown.js";
|
|
10
11
|
import { evidenceBundleSchema } from "../domain/evidenceBundle.js";
|
|
11
|
-
import { processCaptureComparisonSchema, processCaptureSchema, } from "../domain/processCapture.js";
|
|
12
|
-
import { functionInstructionWindowSchema,
|
|
12
|
+
import { processCaptureComparisonSchema, processCaptureSchema, } from "../domain/process/processCapture.js";
|
|
13
|
+
import { analysisBookmarkSchema, functionInstructionWindowSchema, referenceEdgeSchema, unresolvedCallSchema, analysisStringSchema, } from "../domain/hopperValues.js";
|
|
13
14
|
import { nativeApiInspectionResultSchema } from "../domain/native/nativeApiBoundary.js";
|
|
14
15
|
import { demangleSwiftSchema, inspectMachoSchema, inspectPlistSchema, inspectSignatureSchema, listArchitecturesSchema, } from "../domain/native/nativeInspection.js";
|
|
15
16
|
import { artifactExtractionResultSchema } from "../domain/artifactGraph.js";
|
|
16
17
|
import { artifactInspectionResultSchema } from "../domain/artifactInspection.js";
|
|
17
18
|
import { interfaceBuilderAnalysisSchema } from "../domain/apple/interfaceBuilderGraph.js";
|
|
19
|
+
import { dylibResolutionResultSchema } from "../domain/apple/dylibResolution.js";
|
|
18
20
|
import { keyedArchiveResultSchema } from "../domain/apple/keyedArchive.js";
|
|
19
21
|
import { appleAssetCatalogResultSchema } from "../domain/apple/appleAssetCatalog.js";
|
|
20
22
|
import { managedArtifactInspectionSchema, managedMemberInspectionSchema, managedNativeBoundaryInspectionSchema, } from "../domain/managed/managedArtifact.js";
|
|
@@ -42,24 +44,16 @@ const contextFacetSchema = z.discriminatedUnion("state", [
|
|
|
42
44
|
}),
|
|
43
45
|
]);
|
|
44
46
|
const bookmarkFacetSchema = z.discriminatedUnion("state", [
|
|
45
|
-
z.object({
|
|
47
|
+
z.object({
|
|
48
|
+
state: z.literal("available"),
|
|
49
|
+
value: z.array(analysisBookmarkSchema),
|
|
50
|
+
}),
|
|
46
51
|
z.object({
|
|
47
52
|
state: z.literal("unavailable"),
|
|
48
53
|
reason: z.string(),
|
|
49
54
|
remediation: z.string(),
|
|
50
55
|
}),
|
|
51
56
|
]);
|
|
52
|
-
const addressedString = z.object({
|
|
53
|
-
address: z.string(),
|
|
54
|
-
value: z.string(),
|
|
55
|
-
string: z
|
|
56
|
-
.object({
|
|
57
|
-
encoding: z.string().min(1),
|
|
58
|
-
termination: z.enum(["missing", "present_or_not_required"]),
|
|
59
|
-
byte_length: z.number().int().min(0),
|
|
60
|
-
})
|
|
61
|
-
.optional(),
|
|
62
|
-
});
|
|
63
57
|
/** Exact structured-content schemas shared by direct analysis providers. */
|
|
64
58
|
export const officialOutputSchemas = {
|
|
65
59
|
annotate_native_function: resultOf(nativeFunctionAnnotationsSchema),
|
|
@@ -74,12 +68,12 @@ export const officialOutputSchemas = {
|
|
|
74
68
|
current_document: resultOf(z.string()),
|
|
75
69
|
goto_address: resultOf(z.string()),
|
|
76
70
|
inline_comment: resultOf(nullableText),
|
|
77
|
-
list_bookmarks: resultOf(z.array(
|
|
71
|
+
list_bookmarks: resultOf(z.array(analysisBookmarkSchema)),
|
|
78
72
|
list_documents: resultOf(z.array(z.string())),
|
|
79
73
|
list_names: resultOf(z.array(addressedValue)),
|
|
80
74
|
list_procedures: resultOf(z.array(addressedValue)),
|
|
81
75
|
list_segments: segmentOutput,
|
|
82
|
-
list_strings: resultOf(z.array(
|
|
76
|
+
list_strings: resultOf(z.array(analysisStringSchema)),
|
|
83
77
|
next_address: resultOf(z.string()),
|
|
84
78
|
prev_address: resultOf(z.string()),
|
|
85
79
|
procedure_address: resultOf(z.string()),
|
|
@@ -98,31 +92,40 @@ export const officialOutputSchemas = {
|
|
|
98
92
|
address_to_file_offset: resultOf(z.object({
|
|
99
93
|
address: z.string(),
|
|
100
94
|
file_offset: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
95
|
+
provider_file_offset: z
|
|
96
|
+
.number()
|
|
97
|
+
.int()
|
|
98
|
+
.min(0)
|
|
99
|
+
.max(Number.MAX_SAFE_INTEGER)
|
|
100
|
+
.exactOptional()
|
|
101
|
+
.describe("Original coordinate returned by the provider's mapping API."),
|
|
102
|
+
image_base_file_offset: z
|
|
103
|
+
.number()
|
|
104
|
+
.int()
|
|
105
|
+
.min(0)
|
|
106
|
+
.max(Number.MAX_SAFE_INTEGER)
|
|
107
|
+
.exactOptional()
|
|
108
|
+
.describe("File offset of the loaded image within its source container; zero for a thin executable."),
|
|
109
|
+
source_path: z
|
|
110
|
+
.string()
|
|
111
|
+
.exactOptional()
|
|
112
|
+
.describe("Observed original executable path used to verify the file mapping."),
|
|
101
113
|
})),
|
|
102
114
|
procedure_references: resultOf(z.object({
|
|
103
115
|
procedure: procedureIdentity,
|
|
104
116
|
direction: z.enum(["incoming", "outgoing"]),
|
|
105
117
|
reference_kinds_available: z.boolean().optional(),
|
|
106
|
-
unresolved_calls: z
|
|
107
|
-
|
|
108
|
-
.default([]),
|
|
109
|
-
references: z.array(z.object({
|
|
110
|
-
source_address: z.string(),
|
|
111
|
-
target_address: z.string(),
|
|
112
|
-
source_procedure: procedureIdentity.nullable(),
|
|
113
|
-
target_procedure: procedureIdentity.nullable(),
|
|
114
|
-
kind: referenceKindSchema,
|
|
115
|
-
})),
|
|
118
|
+
unresolved_calls: z.array(unresolvedCallSchema).default([]),
|
|
119
|
+
references: z.array(referenceEdgeSchema),
|
|
116
120
|
})),
|
|
117
121
|
procedure_pseudo_code: resultOf(nullableText),
|
|
118
122
|
resolve_containing_procedure: resultOf(containingProcedureResolution),
|
|
119
123
|
search_procedures: resultOf(z.array(z.object({ address: z.string(), value: z.string() }))),
|
|
120
|
-
search_strings: resultOf(z.array(
|
|
124
|
+
search_strings: resultOf(z.array(analysisStringSchema)),
|
|
121
125
|
set_address_name: resultOf(z.boolean()),
|
|
122
126
|
set_addresses_names: resultOf(z.record(z.string(), z.boolean())),
|
|
123
127
|
set_bookmark: resultOf(z.boolean()),
|
|
124
128
|
set_comment: resultOf(z.boolean()),
|
|
125
|
-
set_current_document: resultOf(z.string()),
|
|
126
129
|
set_inline_comment: resultOf(z.boolean()),
|
|
127
130
|
unset_bookmark: resultOf(z.boolean()),
|
|
128
131
|
xrefs: resultOf(addressList),
|
|
@@ -235,6 +238,7 @@ export const enhancedOutputSchemas = {
|
|
|
235
238
|
export const nativeOutputSchemas = {
|
|
236
239
|
observe_native_ui: resultOf(nativeUiResultSchema),
|
|
237
240
|
capture_native_ui_scenario: resultOf(nativeUiResultSchema),
|
|
241
|
+
observe_native_calls: resultOf(nativeCallObservationResultSchema),
|
|
238
242
|
inspect_macho: resultOf(inspectMachoSchema),
|
|
239
243
|
inspect_signature: resultOf(inspectSignatureSchema),
|
|
240
244
|
inspect_plist: resultOf(inspectPlistSchema),
|
|
@@ -248,6 +252,7 @@ export const artifactOutputSchemas = {
|
|
|
248
252
|
decode_interface_builder: resultOf(interfaceBuilderAnalysisSchema),
|
|
249
253
|
inspect_keyed_archive: resultOf(keyedArchiveResultSchema),
|
|
250
254
|
inspect_asset_catalog: resultOf(appleAssetCatalogResultSchema),
|
|
255
|
+
trace_dylib_resolution: resultOf(dylibResolutionResultSchema),
|
|
251
256
|
};
|
|
252
257
|
/** Exact Evidence schema for execution-free managed static analysis. */
|
|
253
258
|
export const managedOutputSchemas = {
|
|
@@ -4,16 +4,19 @@ import { analysisProfileSchema } from "../domain/analysisProfile.js";
|
|
|
4
4
|
import { evidenceEnvelopeSchema } from "../domain/evidence.js";
|
|
5
5
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
6
6
|
import { PROVIDER_REJECTION_CODES, } from "./providerSelection.js";
|
|
7
|
+
import { PROVIDER_FAILURE_STAGES, PROVIDER_OPERATION_STATES, PROVIDER_RETRY_ACTIONS, } from "../domain/providerOperationHealth.js";
|
|
7
8
|
import { analysisErrorProjectionSchema } from "./errorSchemas.js";
|
|
8
9
|
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
9
10
|
/** Inline result with its complete Evidence record. */
|
|
10
11
|
export const inlineEvidenceRecordSchema = evidenceEnvelopeSchema;
|
|
12
|
+
/** Wrap a result and its Evidence while preserving the result schema type. */
|
|
11
13
|
export const evidenceResultOf = (schema) => z.strictObject({
|
|
12
14
|
result: schema,
|
|
13
15
|
evidence_id: prefixedDigestSchema("ev"),
|
|
14
16
|
evidence: inlineEvidenceRecordSchema,
|
|
15
17
|
});
|
|
16
18
|
const resultOf = evidenceResultOf;
|
|
19
|
+
/** Wrap a lifecycle result while preserving its exact schema type. */
|
|
17
20
|
export const lifecycleResultOf = (schema) => z.object({ result: schema });
|
|
18
21
|
/** Resolve a required named output schema or reject contract drift. */
|
|
19
22
|
export const requireOutputSchema = (schemas, name) => {
|
|
@@ -133,6 +136,20 @@ export const analysisActivity = z.object({
|
|
|
133
136
|
queued_requests: z.number().int().min(0),
|
|
134
137
|
})),
|
|
135
138
|
});
|
|
139
|
+
const providerOperationRequest = z.object({
|
|
140
|
+
request_id: z.number().int().min(1),
|
|
141
|
+
operation: z.string().min(1),
|
|
142
|
+
stage: z.enum(PROVIDER_FAILURE_STAGES),
|
|
143
|
+
});
|
|
144
|
+
export const providerOperationHealth = z
|
|
145
|
+
.object({
|
|
146
|
+
state: z.enum(PROVIDER_OPERATION_STATES),
|
|
147
|
+
stage: z.enum(PROVIDER_FAILURE_STAGES).nullable(),
|
|
148
|
+
retry_action: z.enum(PROVIDER_RETRY_ACTIONS).nullable(),
|
|
149
|
+
exit_code: z.number().int().nullable(),
|
|
150
|
+
requests: z.array(providerOperationRequest),
|
|
151
|
+
})
|
|
152
|
+
.nullable();
|
|
136
153
|
const providerRejectionCode = z.enum(PROVIDER_REJECTION_CODES);
|
|
137
154
|
const providerDiagnostics = z.record(z.string(), jsonValueSchema);
|
|
138
155
|
const providerAvailability = z.discriminatedUnion("status", [
|
|
@@ -259,6 +276,7 @@ export const sessionProvider = z
|
|
|
259
276
|
capabilities: z.array(providerCapability),
|
|
260
277
|
analysis_run: analysisRun,
|
|
261
278
|
analysis_activity: analysisActivity,
|
|
279
|
+
provider_operation_health: providerOperationHealth,
|
|
262
280
|
analysis_provider_binding: z
|
|
263
281
|
.object({
|
|
264
282
|
provider: providerIdentity,
|
|
@@ -305,7 +323,7 @@ export const sessionProvider = z
|
|
|
305
323
|
negotiated_protocol_version: z.string().nullable(),
|
|
306
324
|
client: z.object({ name: z.string(), version: z.string() }).nullable(),
|
|
307
325
|
skill: z.object({ name: z.string(), expected_version: z.string() }),
|
|
308
|
-
catalog: z.record(z.string(),
|
|
326
|
+
catalog: z.record(z.string(), jsonValueSchema),
|
|
309
327
|
protocol_features: z.object({
|
|
310
328
|
progress: z.boolean(),
|
|
311
329
|
cancellation: z.boolean(),
|
|
@@ -38,28 +38,87 @@ const PROPERTY_DESCRIPTIONS = {
|
|
|
38
38
|
unknown_id: "Exact residual-unknown identifier.",
|
|
39
39
|
};
|
|
40
40
|
/** Attach caller guidance to a canonical schema for the SDK wire projection. */
|
|
41
|
-
export const toolInputSchemaWithMetadata = (contract) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
export const toolInputSchemaWithMetadata = (contract) => withAdvertisedJsonSchema(contract.inputSchema, "input", (project) => (options) => flattenRootUnion({
|
|
42
|
+
...describeProperties(project(options)),
|
|
43
|
+
examples: contract.examples.map(({ input }) => input),
|
|
44
|
+
}));
|
|
45
|
+
/** Advertise a canonical output schema without reconverting it per listing. */
|
|
46
|
+
export const toolOutputSchemaWithMetadata = (contract) => withAdvertisedJsonSchema(contract.outputSchema, "output");
|
|
47
|
+
const withAdvertisedJsonSchema = (canonical, io, advertise = (project) => project) => {
|
|
47
48
|
// Zod's input projection drops root metadata when a descendant transforms.
|
|
48
49
|
// Preserve the parser and let the SDK own conversion of everything else.
|
|
50
|
+
const schema = canonical.meta(z.globalRegistry.get(canonical) ?? {});
|
|
51
|
+
const standard = schema["~standard"];
|
|
52
|
+
const project = standard.jsonSchema?.[io];
|
|
53
|
+
if (project === undefined)
|
|
54
|
+
throw new TypeError(`Tool ${io} schema does not expose Standard JSON Schema`);
|
|
49
55
|
Object.defineProperty(schema, "~standard", {
|
|
50
56
|
value: {
|
|
51
57
|
...standard,
|
|
52
58
|
jsonSchema: {
|
|
53
59
|
...standard.jsonSchema,
|
|
54
|
-
|
|
55
|
-
...describeProperties(inputJsonSchema(options)),
|
|
56
|
-
examples: contract.examples.map(({ input }) => input),
|
|
57
|
-
}),
|
|
60
|
+
[io]: memoizeByTarget(advertise(project)),
|
|
58
61
|
},
|
|
59
62
|
},
|
|
60
63
|
});
|
|
61
64
|
return schema;
|
|
62
65
|
};
|
|
66
|
+
// The SDK reconverts every registered schema on each `tools/list`, although a
|
|
67
|
+
// registered contract cannot change. Like the SDK's own memoized output
|
|
68
|
+
// projection, the advertised value is shared and treated as read-only.
|
|
69
|
+
const memoizeByTarget = (project) => {
|
|
70
|
+
const byTarget = new Map();
|
|
71
|
+
return (options) => {
|
|
72
|
+
if (options.libraryOptions !== undefined)
|
|
73
|
+
return project(options);
|
|
74
|
+
const cached = byTarget.get(options.target);
|
|
75
|
+
if (cached !== undefined)
|
|
76
|
+
return cached;
|
|
77
|
+
const projected = project(options);
|
|
78
|
+
byTarget.set(options.target, projected);
|
|
79
|
+
return projected;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/** Keep MCP tool roots object-shaped for clients that reject root unions. */
|
|
83
|
+
const flattenRootUnion = (value) => {
|
|
84
|
+
if (!Array.isArray(value.anyOf))
|
|
85
|
+
return value;
|
|
86
|
+
const branches = value.anyOf.filter(isObject);
|
|
87
|
+
if (branches.length === 0 || branches.length !== value.anyOf.length)
|
|
88
|
+
return value;
|
|
89
|
+
const properties = {};
|
|
90
|
+
for (const branch of branches) {
|
|
91
|
+
if (!isObject(branch.properties))
|
|
92
|
+
return value;
|
|
93
|
+
for (const [name, schema] of Object.entries(branch.properties)) {
|
|
94
|
+
const previous = properties[name];
|
|
95
|
+
if (previous === undefined)
|
|
96
|
+
properties[name] = schema;
|
|
97
|
+
else if (JSON.stringify(previous) !== JSON.stringify(schema))
|
|
98
|
+
properties[name] = {
|
|
99
|
+
anyOf: [previous, schema],
|
|
100
|
+
description: fallbackPropertyDescription(name),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// The canonical Zod parser still enforces branch validation at invocation.
|
|
105
|
+
const { anyOf: _anyOf, required: _required, ...root } = value;
|
|
106
|
+
const requiredByBranch = branches.map((branch) => Array.isArray(branch.required)
|
|
107
|
+
? branch.required.filter((item) => typeof item === "string")
|
|
108
|
+
: []);
|
|
109
|
+
const required = requiredByBranch.reduce((common, current) => common.filter((name) => current.includes(name)));
|
|
110
|
+
const minProperties = Math.max(typeof root.minProperties === "number" ? root.minProperties : 0, Math.min(...requiredByBranch.map((names) => names.length)));
|
|
111
|
+
return {
|
|
112
|
+
...root,
|
|
113
|
+
type: "object",
|
|
114
|
+
properties,
|
|
115
|
+
...(minProperties > 0 ? { minProperties } : {}),
|
|
116
|
+
...(required.length > 0 ? { required } : {}),
|
|
117
|
+
...(branches.every((branch) => branch.additionalProperties === false)
|
|
118
|
+
? { additionalProperties: false }
|
|
119
|
+
: {}),
|
|
120
|
+
};
|
|
121
|
+
};
|
|
63
122
|
const describeProperties = (value) => Object.fromEntries(Object.entries(value).map(([key, child]) => {
|
|
64
123
|
if (key !== "properties" || !isObject(child))
|
|
65
124
|
return [key, describeValue(child)];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { inspectWebNetworkCaptureInputSchema, webNetworkCaptureSchema, } from "../domain/webNetworkCapture.js";
|
|
2
|
+
import { toolContractMetadata } from "./toolEffects.js";
|
|
3
|
+
import { evidenceResultOf } from "./toolOutputSchemas.js";
|
|
4
|
+
/** Historical inspection is distinct from live browser capture and runtime authority. */
|
|
5
|
+
export const WEB_NETWORK_CAPTURE_TOOL_CONTRACTS = [
|
|
6
|
+
{
|
|
7
|
+
name: "inspect_web_network_capture",
|
|
8
|
+
...toolContractMetadata("inspect_web_network_capture"),
|
|
9
|
+
description: "Inspect retained local HAR 1.2 or native mitmproxy capture records without contacting recorded URLs. Returns original ordinals, pointers/byte ranges, preserved producer fields, precise numeric representations and exact exposed binary bytes inline. Excludes known transport credentials and explicitly marked values. Decodes every record before optional ordinal selection; malformed or oversized captures return no partial success. Duplicate HAR members are invalid; prototype-named members such as __proto__ are preserved as ordinary own JSON members without prototype mutation. Uses pinned upstream parsers, owned temporary files and bounded offline processes. Native mitmproxy requires caller-supplied mitmdump 12.2.3 on Linux. Browser transaction IDs, runtime attribution and original bytes of HAR Unicode text remain unknown.",
|
|
10
|
+
kind: "browser-provider",
|
|
11
|
+
inputSchema: inspectWebNetworkCaptureInputSchema,
|
|
12
|
+
outputSchema: evidenceResultOf(webNetworkCaptureSchema),
|
|
13
|
+
examples: [
|
|
14
|
+
{
|
|
15
|
+
title: "Inspect historical HAR entries",
|
|
16
|
+
input: {
|
|
17
|
+
capture_path: "/captures/session.har",
|
|
18
|
+
format: "har",
|
|
19
|
+
record_ordinals: [0, 2],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
];
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
const ANALYSIS_ERROR_TAGS = [
|
|
3
3
|
"AnalysisProtocolError",
|
|
4
4
|
"AnalysisInputError",
|
|
5
|
+
"AnalysisAccessDeniedError",
|
|
6
|
+
"AnalysisArtifactChangedError",
|
|
5
7
|
"AnalysisOutputError",
|
|
6
8
|
"AnalysisCapabilityUnavailableError",
|
|
9
|
+
"AnalysisUnsupportedTargetError",
|
|
7
10
|
"AnalysisCancelledError",
|
|
8
11
|
"AnalysisTimeoutError",
|
|
12
|
+
"AnalysisResourceConstraintError",
|
|
9
13
|
"ProviderSelectionError",
|
|
10
14
|
"ProviderAdapterError",
|
|
11
15
|
"BrowserObservationError",
|
|
@@ -26,8 +30,24 @@ const ANALYSIS_ERROR_TAGS = [
|
|
|
26
30
|
];
|
|
27
31
|
/** Base class for expected analysis, provider, and session failures. */
|
|
28
32
|
export class AnalysisError extends Error {
|
|
33
|
+
capturedOutput;
|
|
34
|
+
cleanup;
|
|
35
|
+
cleanupIncomplete;
|
|
36
|
+
cleanupResources;
|
|
37
|
+
constructor(message, options) {
|
|
38
|
+
super(message, options);
|
|
39
|
+
this.capturedOutput =
|
|
40
|
+
options?.capturedOutput === undefined
|
|
41
|
+
? undefined
|
|
42
|
+
: { ...options.capturedOutput };
|
|
43
|
+
this.cleanup = options?.cleanup;
|
|
44
|
+
this.cleanupIncomplete = options?.cleanup !== undefined;
|
|
45
|
+
this.cleanupResources = options?.cleanup?.resources ?? [];
|
|
46
|
+
this.partialObservation = options?.partialObservation;
|
|
47
|
+
}
|
|
29
48
|
userMessage = undefined;
|
|
30
49
|
userCategory = undefined;
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
executionFailure = undefined;
|
|
51
|
+
partialObservation;
|
|
52
|
+
cleanupReport = undefined;
|
|
33
53
|
}
|