rea-agents 3.2.1 → 4.0.1
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 +183 -332
- package/bridge/ghidra/ReaGhidraBridge.java +561 -74
- package/bridge/hopper_bridge.py +70 -27
- package/bridge/native/ReaNativeUI.swift +157 -0
- package/dist/application/AnalysisContextQueries.js +19 -5
- package/dist/application/AnalysisSnapshotCache.js +30 -11
- package/dist/application/AppleAssetCatalogAnalysis.js +171 -0
- package/dist/application/ArtifactExtractionDestination.js +0 -12
- package/dist/application/ArtifactGraphConstruction.js +44 -11
- package/dist/application/ArtifactInventory/classify.js +7 -15
- package/dist/application/ArtifactInventory/hash.js +4 -2
- package/dist/application/ArtifactInventory/policy.js +2 -17
- package/dist/application/ArtifactInventory/reader.js +3 -3
- package/dist/application/ArtifactInventory/scanCanonical.js +2 -2
- package/dist/application/ArtifactInventory/scanReader.js +12 -4
- package/dist/application/ArtifactInventory/types.js +0 -3
- package/dist/application/BinarySession.js +28 -43
- package/dist/application/BinarySessionExecution.js +37 -1
- package/dist/application/BinaryTargetResolver.js +50 -4
- package/dist/application/BrowserEvidence.js +36 -7
- package/dist/application/BrowserObservationService.js +17 -44
- package/dist/application/BrowserScenarioCaptureService.js +2 -35
- package/dist/application/BrowserScenarioEvidence.js +13 -9
- package/dist/application/CapabilityClientRequirements.js +2 -11
- package/dist/application/CapabilityInventory.js +21 -35
- package/dist/application/ClientConfigurationDocument.js +84 -7
- package/dist/application/ClientRegistrationIdentity.js +32 -0
- package/dist/application/ClientRegistrationStatus.js +59 -6
- package/dist/application/DirectAnalysis.js +37 -58
- package/dist/application/DirectAnalysisStatus.js +4 -4
- package/dist/application/Doctor.js +89 -80
- package/dist/application/DoctorDiagnostics.js +2 -26
- package/dist/application/DoctorScope.js +8 -14
- package/dist/application/ElectronActiveEvidence.js +10 -27
- package/dist/application/ElectronActiveObservationService.js +9 -36
- package/dist/application/ElectronBoundaryAnalysis.js +2 -0
- package/dist/application/ElectronBoundaryGraphNative.js +1 -1
- package/dist/application/ElectronEvidence.js +8 -3
- package/dist/application/ElectronObservationService.js +9 -25
- package/dist/application/EnhancedLiteralTracing.js +4 -8
- package/dist/application/EnhancedTools.js +15 -35
- package/dist/application/FilesystemSnapshot.js +7 -8
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +2 -1
- package/dist/application/JavaScriptApplicationWorkflowService.js +31 -7
- package/dist/application/JavaScriptArtifactAnalysis.js +6 -4
- package/dist/application/JavaScriptArtifactFiles.js +5 -0
- package/dist/application/JavaScriptArtifactPathResolution.js +179 -47
- package/dist/application/JavaScriptRuntimeObservationEvidence.js +6 -3
- package/dist/application/JavaScriptRuntimeObservationService.js +9 -25
- package/dist/application/JavaScriptRuntimeReconciliationService.js +45 -4
- package/dist/application/JavaScriptSemanticGraphAsyncProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphChildProcessProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphDataProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphFlowProjection.js +14 -5
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LazyAnalysisProvider.js +27 -6
- package/dist/application/ManagedMemberComparisonService.js +19 -6
- package/dist/application/NativeApiInspection.js +2 -0
- package/dist/application/NativeCallRoutes.js +72 -0
- package/dist/application/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/NativeUiActionTrace.js +73 -49
- package/dist/application/NativeValueTrace.js +320 -0
- package/dist/application/ProcessCaptureCapability.js +32 -5
- package/dist/application/ProcessCaptureEnvironment.js +9 -26
- package/dist/application/ProcessCaptureError.js +1 -5
- package/dist/application/ProcessCaptureJournal.js +3 -40
- package/dist/application/ProcessCaptureLifecycle.js +102 -111
- package/dist/application/ProcessCli.js +18 -25
- package/dist/application/ProcessEvidence.js +5 -7
- package/dist/application/ProcessFilesystemEffects.js +36 -0
- package/dist/application/ProcessHarness.js +41 -120
- package/dist/application/ProcessNormalization.js +2 -17
- package/dist/application/ProcessScenarioRuntimeValidation.js +76 -0
- package/dist/application/ReferenceSourceImport.js +3 -4
- package/dist/application/Setup.js +236 -84
- package/dist/application/SetupClientConfiguration.js +14 -9
- package/dist/application/SetupPlan.js +138 -86
- package/dist/application/SetupSkill.js +0 -1
- package/dist/application/SupportedClients.js +102 -21
- package/dist/application/Uninstall.js +31 -20
- package/dist/application/Update.js +93 -0
- package/dist/application/UpdateMaintenance.js +108 -0
- package/dist/application/UpdateRuntime.js +126 -0
- package/dist/application/runtime.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +6 -8
- package/dist/artifacts/ArtifactProvider.js +94 -41
- package/dist/artifacts/AsarArtifactReader.js +19 -4
- package/dist/artifacts/KeyedArchiveReader.js +110 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +53 -5
- package/dist/artifacts/ZipArtifactReader.js +18 -1
- package/dist/browser/BrowserScenarioSecrets.js +28 -1
- package/dist/browser/CdpBrowserProvider.js +36 -15
- package/dist/browser/CdpCaptureDocuments.js +22 -8
- package/dist/browser/CdpCaptureEventHandlers.js +14 -5
- package/dist/browser/CdpCaptureEventHelpers.js +13 -0
- package/dist/browser/CdpCaptureEvents.js +10 -1
- package/dist/browser/CdpElectronInspection.js +5 -10
- package/dist/browser/CdpElectronProvider.js +1 -5
- package/dist/browser/CdpElectronScripts.js +1 -1
- package/dist/browser/CdpEndpoint.js +3 -2
- package/dist/browser/CdpObservationSession.js +14 -10
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpPageCaptureScripts.js +1 -1
- package/dist/browser/CdpSafeMetadata.js +5 -4
- package/dist/browser/CdpScreenshot.js +16 -5
- package/dist/browser/CdpTargetSession.js +25 -4
- package/dist/browser/CdpWebMcpDiscovery.js +93 -20
- package/dist/browser/JavaScriptRuntimeScope.js +28 -2
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +9 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +3 -10
- package/dist/browser/PlaywrightElectronActiveProvider.js +5 -5
- package/dist/browser/PlaywrightScenarioActions.js +1 -1
- package/dist/browser/PlaywrightScenarioArtifacts.js +13 -25
- package/dist/browser/PlaywrightScenarioBrowser.js +28 -25
- package/dist/browser/PlaywrightScenarioEvents.js +82 -93
- package/dist/browser/PlaywrightScenarioSession.js +27 -123
- package/dist/browser/PngVisualDiff.js +22 -3
- package/dist/browser/V8InspectorCaptureProjection.js +7 -1
- package/dist/browser/V8InspectorProvider.js +60 -7
- package/dist/browser/WebSourceMapFetcher.js +99 -53
- package/dist/cli/artifactCommands.js +56 -12
- package/dist/cli/coreAnalysisCommands.js +110 -0
- package/dist/cli/managedCommands.js +1 -31
- package/dist/cli/setupCommands.js +16 -14
- package/dist/cli/utilityCommands.js +61 -4
- package/dist/cli.js +5 -7
- package/dist/cliApplicationCommands.js +0 -83
- package/dist/cliBrowserAdvancedCommands.js +7 -11
- package/dist/cliBrowserCommands.js +15 -23
- package/dist/cliBrowserContext.js +3 -24
- package/dist/cliBrowserScenarioCommands.js +2 -10
- package/dist/cliCommandNames.js +82 -7
- package/dist/cliElectronCommands.js +10 -36
- package/dist/cliJavaScriptRuntimeCommands.js +6 -30
- package/dist/cliJsonInput.js +4 -2
- package/dist/cliLogging.js +16 -7
- package/dist/cliObservationOptions.js +1 -1
- package/dist/cliOutput.js +2 -4
- package/dist/cliProcessCommands.js +6 -33
- package/dist/cliSetup.js +90 -160
- package/dist/config/environment.js +2 -78
- package/dist/config/parseConfig.js +18 -109
- package/dist/config/parsers.js +0 -23
- package/dist/contracts/applicationToolContracts.js +1 -118
- package/dist/contracts/artifactToolContracts.js +11 -19
- package/dist/contracts/browserScenarioToolContracts.js +1 -5
- package/dist/contracts/browserToolContracts.js +9 -16
- package/dist/contracts/electronToolContracts.js +5 -6
- package/dist/contracts/enhancedInputs.js +3 -2
- package/dist/contracts/errorSchemas.js +16 -40
- package/dist/contracts/functionWorkflowToolContracts.js +2 -2
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +2 -2
- package/dist/contracts/javascriptRuntimeObservationToolContracts.js +4 -4
- package/dist/contracts/javascriptRuntimeReconciliationExample.js +1 -1
- package/dist/contracts/managedToolContracts.js +7 -4
- package/dist/contracts/managedWorkflowExamples.js +0 -22
- package/dist/contracts/managedWorkflowToolContracts.js +16 -31
- package/dist/contracts/nativeToolContracts.js +9 -0
- package/dist/contracts/promptContracts.js +6 -6
- package/dist/contracts/sessionToolSchemas.js +3 -3
- package/dist/contracts/toolContractExamples.js +4 -3
- package/dist/contracts/toolContracts.js +18 -7
- package/dist/contracts/toolEffects.js +34 -21
- package/dist/contracts/toolOutputSchemaGroups.js +18 -5
- package/dist/contracts/toolOutputSchemaPrimitives.js +9 -6
- package/dist/contracts/toolSchemaMetadata.js +5 -8
- package/dist/doctorRuntime.js +0 -41
- package/dist/domain/analysisErrorPresentation.js +4 -28
- package/dist/domain/analysisErrorProjection.js +33 -50
- package/dist/domain/analysisProfile.js +1 -1
- package/dist/domain/analysisSnapshot.js +77 -3
- package/dist/domain/androidApplication.js +5 -4
- package/dist/domain/appleApplication.js +5 -4
- package/dist/domain/appleAssetCatalog.js +127 -0
- package/dist/domain/artifactComparison.js +7 -11
- package/dist/domain/artifactGraph.js +8 -6
- package/dist/domain/artifactInspection.js +13 -12
- package/dist/domain/binaryTarget.js +23 -9
- package/dist/domain/browserObservation.js +43 -24
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenario.js +7 -107
- package/dist/domain/browserScenarioCapture.js +0 -1
- package/dist/domain/browserScenarioCaptureValues.js +5 -4
- package/dist/domain/browserScenarioDiff.js +1 -3
- package/dist/domain/browserScenarioValues.js +16 -107
- package/dist/domain/bundleComparison.js +18 -17
- package/dist/domain/callPathSchemas.js +17 -7
- package/dist/domain/changedBehavior.js +2 -3
- package/dist/domain/comparisonSemantics.js +19 -0
- package/dist/domain/completionLedgerGeneration.js +3 -2
- package/dist/domain/conformancePackage.js +2 -1
- package/dist/domain/conformanceTrustGate.js +3 -5
- package/dist/domain/customProtocolCapture.js +2 -2
- package/dist/domain/digests.js +30 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/electronActiveObservation.js +7 -5
- package/dist/domain/electronObservation.js +3 -2
- package/dist/domain/electronStaticAnalysisNative.js +15 -6
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/errors.js +10 -28
- package/dist/domain/evidence.js +5 -3
- package/dist/domain/evidenceCompletionLedger.js +3 -2
- package/dist/domain/functionComparisonNormalization.js +24 -18
- package/dist/domain/functionComparisonResults.js +3 -7
- package/dist/domain/functionComparisonSchemas.js +3 -2
- package/dist/domain/hopperValues.js +108 -8
- package/dist/domain/javascriptApplicationAnalysis.js +4 -7
- package/dist/domain/javascriptApplicationEvidenceSchemas.js +4 -3
- package/dist/domain/javascriptApplicationGraphSchemas.js +8 -7
- package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +9 -7
- package/dist/domain/javascriptApplicationVersionItems.js +12 -18
- package/dist/domain/javascriptAstValues.js +4 -0
- package/dist/domain/javascriptExportShapeComparison.js +1 -6
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +6 -10
- package/dist/domain/javascriptExportShapeVariants.js +15 -2
- package/dist/domain/javascriptFeatureTraceSchemas.js +8 -7
- package/dist/domain/javascriptRuntimeObservation.js +14 -2
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +8 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +4 -2
- package/dist/domain/javascriptRuntimeReconciliationResult.js +6 -4
- package/dist/domain/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +19 -18
- package/dist/domain/javascriptRuntimeStaticCandidates.js +18 -6
- package/dist/domain/javascriptSemanticAnalysis.js +57 -19
- package/dist/domain/javascriptSemanticAsyncEffects.js +39 -40
- package/dist/domain/javascriptSemanticCalls.js +46 -27
- package/dist/domain/javascriptSemanticChildProcesses.js +43 -50
- package/dist/domain/javascriptSemanticDataEffectHelpers.js +91 -18
- package/dist/domain/javascriptSemanticDataEffects.js +22 -10
- package/dist/domain/javascriptSemanticGraphSchemas.js +8 -6
- package/dist/domain/javascriptSemanticObjects.js +13 -3
- package/dist/domain/javascriptSemanticProjection.js +144 -38
- package/dist/domain/javascriptSemanticPromises.js +14 -27
- package/dist/domain/javascriptSemanticQuerySchemas.js +6 -9
- package/dist/domain/javascriptSemanticResources.js +2 -5
- package/dist/domain/javascriptSemanticState.js +4 -0
- package/dist/domain/javascriptSemanticTraceSchemas.js +2 -1
- package/dist/domain/javascriptSemanticTraversal.js +13 -5
- package/dist/domain/javascriptSemanticValues.js +10 -9
- package/dist/domain/javascriptSourceParser.js +5 -1
- package/dist/domain/javascriptStaticAnalysisCalls.js +8 -5
- package/dist/domain/javascriptStaticAnalysisHelpers.js +16 -7
- package/dist/domain/keyedArchive.js +181 -0
- package/dist/domain/managedApplicationGraph.js +4 -3
- package/dist/domain/managedArtifact.js +2 -1
- package/dist/domain/managedMemberComparison.js +18 -13
- package/dist/domain/managedMemberComparisonCoverage.js +2 -1
- package/dist/domain/managedMemberComparisonItems.js +27 -7
- package/dist/domain/managedMemberComparisonMatch.js +22 -6
- package/dist/domain/managedNativeVerificationMatch.js +2 -2
- package/dist/domain/managedNativeVerificationSchemas.js +7 -5
- package/dist/domain/managedReconstruction.js +6 -5
- package/dist/domain/nativeApiBoundary.js +7 -0
- package/dist/domain/nativeDataType.js +51 -0
- package/dist/domain/nativeInspection.js +0 -1
- package/dist/domain/nativeInstruction.js +82 -0
- package/dist/domain/nativeInvestigationGraph.js +9 -5
- package/dist/domain/nativeUiObservation.js +123 -0
- package/dist/domain/nativeValueFlow.js +17 -0
- package/dist/domain/nativeValueTrace.js +64 -0
- package/dist/domain/objcSwiftMetadata.js +39 -0
- package/dist/domain/peInspection.js +1 -0
- package/dist/domain/processCapture.js +5 -55
- package/dist/domain/processCaptureExample.js +0 -9
- package/dist/domain/processCaptureValidation.js +13 -144
- package/dist/domain/processComparison.js +3 -25
- package/dist/domain/processObservation.js +0 -29
- package/dist/domain/processScenario.js +28 -228
- package/dist/domain/processTraceDimensionProjection.js +0 -15
- package/dist/domain/processTraceEvaluation.js +0 -6
- package/dist/domain/protocolCapture.js +8 -36
- package/dist/domain/reconstructionCoverage.js +3 -2
- package/dist/domain/reconstructionObligationLedgerSchemas.js +4 -12
- package/dist/domain/reconstructionReadinessSchemas.js +4 -3
- package/dist/domain/reconstructionVerification.js +2 -1
- package/dist/domain/reconstructionVerificationSchemas.js +6 -13
- package/dist/domain/referenceSourceClassification.js +0 -110
- package/dist/domain/referenceSourceGraph.js +15 -5
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/runtimeIdentification.js +6 -5
- package/dist/domain/sourceMapContents.js +5 -0
- package/dist/domain/sourceToBundleComparison.js +3 -10
- package/dist/domain/sourceToBundleComparisonSchemas.js +7 -6
- package/dist/domain/sourceToBundleSignals.js +9 -3
- package/dist/domain/staticRuntimeCorrelation.js +5 -11
- package/dist/domain/webBundleAnalysis.js +17 -9
- package/dist/domain/webBundleAnalyzer.js +1 -1
- package/dist/domain/webCaptureDiff.js +5 -11
- package/dist/domain/webCaptureDiffSchemas.js +2 -1
- package/dist/domain/webMcpDiscovery.js +2 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +15 -7
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +57 -40
- package/dist/dotnet/ManagedMemberRows.js +2 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +15 -8
- package/dist/dotnet/ManagedPeReader.js +2 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +15 -5
- package/dist/ghidra/GhidraClient.js +38 -8
- package/dist/ghidra/GhidraFunctionValues.js +56 -20
- package/dist/ghidra/GhidraInstallation.js +7 -4
- package/dist/ghidra/GhidraInventoryValues.js +44 -9
- package/dist/ghidra/GhidraLauncher.js +18 -3
- package/dist/ghidra/GhidraProvider.js +23 -2
- package/dist/ghidra/GhidraRequestQueue.js +45 -4
- package/dist/ghidra/GhidraSessionValues.js +5 -0
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperProvider.js +29 -6
- package/dist/hopper/HopperTargetLease.js +18 -4
- package/dist/logger.js +0 -13
- package/dist/main/messages.js +0 -1
- package/dist/main/reload.js +3 -32
- package/dist/main/shutdown.js +1 -2
- package/dist/main/transport.js +0 -17
- package/dist/main.js +0 -10
- package/dist/native/AppleDispatchMetadata.js +582 -0
- package/dist/native/AppleObjcProtocols.js +88 -0
- package/dist/native/AppleSwiftVtables.js +86 -0
- package/dist/native/CommandRunner.js +1 -1
- package/dist/native/NativeHostCapabilities.js +23 -0
- package/dist/native/NativeMacOSProvider.js +61 -9
- package/dist/native/NativeMachoInspection.js +39 -6
- package/dist/native/NativeUiHelperRuntime.js +42 -0
- package/dist/native/NativeUiObservation.js +174 -0
- package/dist/native/parsers/codesign.js +4 -1
- package/dist/native/parsers/dyldInfo.js +51 -25
- package/dist/native/parsers/lipo.js +13 -4
- package/dist/native/parsers/otool.js +84 -39
- package/dist/native/parsers/plist.js +2 -1
- package/dist/process/ExecFileOutput.js +5 -1
- package/dist/process/ProcessOwnership.js +69 -33
- package/dist/process/ProcessOwnershipObservation.js +31 -12
- package/dist/process/ProviderProcess.js +4 -2
- package/dist/reference/ReferenceSourceReaderEntries.js +48 -31
- package/dist/reference/ReferenceSourceReaderErrors.js +24 -0
- package/dist/reference/ReferenceSourceReaderFile.js +11 -5
- package/dist/reference/ReferenceSourceReaderValidate.js +22 -8
- package/dist/server/createServer.js +7 -62
- package/dist/server/registerApplicationTools/helpers.js +2 -9
- package/dist/server/registerApplicationTools.js +0 -4
- package/dist/server/registerArtifactComparisonTool.js +1 -1
- package/dist/server/registerBrowserScenarioTool.js +4 -2
- package/dist/server/registerBrowserTools.js +7 -7
- package/dist/server/registerBundleComparisonTool.js +1 -1
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +10 -4
- package/dist/server/registerEnhancedTools.js +20 -12
- package/dist/server/registerEvidenceTools.js +4 -28
- package/dist/server/registerFunctionComparisonTool.js +1 -1
- package/dist/server/registerInvestigationTools.js +6 -6
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -2
- package/dist/server/registerManagedTools.js +28 -14
- package/dist/server/registerManagedWorkflowTools.js +0 -2
- package/dist/server/registerProcessComparisonTool.js +1 -3
- package/dist/server/registerSessionRecordTools.js +9 -9
- package/dist/server/registerSessionStatusTool.js +1 -1
- package/dist/server/registerSessionTools.js +28 -57
- package/dist/server/sessionAvailabilityPolicy.js +2 -3
- package/dist/server/sessionToolPolicies.js +0 -4
- package/dist/server/toolResult.js +8 -10
- package/package.json +32 -22
- package/skills/reverse-engineer-anything/SKILL.md +15 -11
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +3 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +3 -2
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +8 -6
- package/skills/reverse-engineer-anything/references/runtime-observation.md +15 -11
- package/dist/application/CommandShimReplay.js +0 -152
- package/dist/application/ConfiguredRoots.js +0 -19
- package/dist/application/InstrumentedJavaScriptReplayHost.js +0 -36
- package/dist/application/JavaScriptReplayPermission.js +0 -16
- package/dist/application/JavaScriptReplayPlanning.js +0 -207
- package/dist/application/JavaScriptReplayService.js +0 -274
- package/dist/application/LoopbackReplay.js +0 -389
- package/dist/application/LoopbackReplayRecorder.js +0 -129
- package/dist/application/ManagedRuntimeCorrelationService.js +0 -104
- package/dist/application/NodeRuntimeCharacterizationService.js +0 -191
- package/dist/application/PermissionAuthority.js +0 -268
- package/dist/application/PermissionConfiguration.js +0 -26
- package/dist/application/PermissionFailure.js +0 -5
- package/dist/application/ProcessCaptureAuthority.js +0 -24
- package/dist/application/ProcessCapturePermission.js +0 -13
- package/dist/application/ProcessCheckpoints.js +0 -178
- package/dist/application/ProcessReactiveCoordinator.js +0 -223
- package/dist/application/ProcessReactiveEffects.js +0 -153
- package/dist/application/ProcessReactiveHarness.js +0 -106
- package/dist/application/ProcessReactiveObservations.js +0 -105
- package/dist/application/ProjectPermissionStore.js +0 -199
- package/dist/application/RuntimeExecutableDiagnostics.js +0 -198
- package/dist/application/Upgrade.js +0 -134
- package/dist/browser/SensitiveTextCapture.js +0 -8
- package/dist/cliPolicyCommands.js +0 -185
- package/dist/config/browserScenario.js +0 -77
- package/dist/config/electronAutomation.js +0 -35
- package/dist/config/javascriptReplay.js +0 -41
- package/dist/config/managedRuntime.js +0 -25
- package/dist/config/passiveObservation.js +0 -87
- package/dist/config/permissions.js +0 -23
- package/dist/config/processCapture.js +0 -47
- package/dist/contracts/replayMachineExample.js +0 -37
- package/dist/domain/javascriptExportInstrumentation.js +0 -95
- package/dist/domain/javascriptReplay.js +0 -360
- package/dist/domain/managedRuntimeCorrelation.js +0 -181
- package/dist/domain/nodeRuntimeCharacterization.js +0 -63
- package/dist/domain/permissionPolicy.js +0 -176
- package/dist/domain/processCaptureReactiveSchema.js +0 -68
- package/dist/domain/processCaptureReactiveValidation.js +0 -180
- package/dist/domain/processReactiveCheckpointDataflow.js +0 -32
- package/dist/domain/processReactiveMatching.js +0 -196
- package/dist/domain/processReactiveRuntime.js +0 -116
- package/dist/domain/processReactiveScenario.js +0 -296
- package/dist/domain/processReactiveScenarioPreflight.js +0 -95
- package/dist/domain/processReactiveTransition.js +0 -187
- package/dist/domain/replayMachine.js +0 -320
- package/dist/domain/replayMachineRun.js +0 -168
- package/dist/domain/replayMachineRuntime.js +0 -296
- package/dist/domain/replayMachineValues.js +0 -84
- package/dist/domain/runtimeCharacterization.js +0 -84
- package/dist/replay/JavaScriptReplayWorker.js +0 -382
- package/dist/replay/JavaScriptReplayWorkerTypes.js +0 -1
- package/dist/replay/LinuxJavaScriptReplayRunner.js +0 -216
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +0 -121
- package/dist/replay/LinuxRuntimeClosure.js +0 -44
- package/dist/replay/LinuxSeccompPolicy.js +0 -40
- package/dist/replay/ReplayOutcome.js +0 -104
- package/dist/replay/ReplayProcessLifecycle.js +0 -96
- package/dist/replay/ReplaySeccompFile.js +0 -29
- package/dist/replay/ReplayWorkerProtocol.js +0 -58
- package/dist/replay/SystemJavaScriptReplayHost.js +0 -153
- package/dist/server/ProcessCaptureElicitation.js +0 -153
- package/dist/server/registerApplicationTools/characterization.js +0 -46
- package/dist/server/registerApplicationTools/controlledReplay.js +0 -31
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +0 -29
- package/dist/server/registerReplayMachineTool.js +0 -14
- package/skills/reverse-engineer-anything/references/controlled-replay.md +0 -12
|
@@ -3,15 +3,16 @@ import canonicalize from "canonicalize";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { evidenceSchema, parseEvidence } from "./evidence.js";
|
|
5
5
|
import { cliMetadataGuidSchema, managedMemberInspectionSchema, } from "./managedArtifact.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
7
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
8
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
8
9
|
const tokenSchema = z.string().regex(/^0x[0-9a-f]{8}$/u);
|
|
9
10
|
const textSchema = z.string().min(1);
|
|
10
11
|
const decompilerSchema = z.strictObject({
|
|
11
12
|
name: textSchema,
|
|
12
|
-
version: textSchema.nullable(),
|
|
13
|
+
version: textSchema.nullable().default(null),
|
|
13
14
|
family: z.enum(["ilspy", "dnspy", "dnlib", "mono-cecil", "other"]),
|
|
14
|
-
executable_sha256: digestSchema.nullable(),
|
|
15
|
+
executable_sha256: digestSchema.nullable().default(null),
|
|
15
16
|
options: z.array(z.string()).default([]),
|
|
16
17
|
});
|
|
17
18
|
const managedReconstructionMethodInputSchema = z.strictObject({
|
|
@@ -61,7 +62,7 @@ const importedMethodSchema = z.strictObject({
|
|
|
61
62
|
}),
|
|
62
63
|
});
|
|
63
64
|
export const managedReconstructionImportResultSchema = z.strictObject({
|
|
64
|
-
reconstruction_id:
|
|
65
|
+
reconstruction_id: prefixedDigestSchema("mre"),
|
|
65
66
|
phase: z.literal("reconstruction-import"),
|
|
66
67
|
executed: z.literal(false),
|
|
67
68
|
static_observation: z.strictObject({
|
|
@@ -45,6 +45,7 @@ const jumpTableDataSourceSchema = z
|
|
|
45
45
|
"ghidra-decompiler-load-table",
|
|
46
46
|
"ghidra-dispatch-block-data-reference",
|
|
47
47
|
"ghidra-aarch64-byte-table",
|
|
48
|
+
"ghidra-aarch64-halfword-table",
|
|
48
49
|
]),
|
|
49
50
|
entry_size_bytes: z.number().int().min(1).nullable(),
|
|
50
51
|
entry_count: z.number().int().min(0).nullable(),
|
|
@@ -60,11 +61,17 @@ const jumpTableMappingSchema = z
|
|
|
60
61
|
evidence: z.array(inferenceEvidenceSchema).min(1),
|
|
61
62
|
})
|
|
62
63
|
.strict();
|
|
64
|
+
const jumpTableDefaultTargetSchema = z.strictObject({
|
|
65
|
+
target_address: z.string().min(1),
|
|
66
|
+
confidence: inferenceConfidenceSchema,
|
|
67
|
+
evidence: z.array(inferenceEvidenceSchema).min(1),
|
|
68
|
+
});
|
|
63
69
|
const inferredJumpTableSchema = z
|
|
64
70
|
.object({
|
|
65
71
|
dispatch_address: z.string().min(1),
|
|
66
72
|
data_sources: z.array(jumpTableDataSourceSchema),
|
|
67
73
|
mappings: z.array(jumpTableMappingSchema),
|
|
74
|
+
default_targets: z.array(jumpTableDefaultTargetSchema).default([]),
|
|
68
75
|
limitations: z.array(z.string()),
|
|
69
76
|
})
|
|
70
77
|
.strict();
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Select a database type by exact category path or a defined typed data address. */
|
|
3
|
+
export const nativeDataTypeInputSchema = z
|
|
4
|
+
.strictObject({
|
|
5
|
+
type: z.string().min(1).optional(),
|
|
6
|
+
address: z.string().min(1).optional(),
|
|
7
|
+
document: z.string().optional(),
|
|
8
|
+
})
|
|
9
|
+
.refine((value) => (value.type === undefined) !== (value.address === undefined), "Supply exactly one of type or address");
|
|
10
|
+
/** Types remain analysis database observations; child identities can be inspected separately. */
|
|
11
|
+
export const nativeDataTypeSchema = z.strictObject({
|
|
12
|
+
status: z.enum(["available", "unavailable"]),
|
|
13
|
+
reason: z.string().nullable(),
|
|
14
|
+
id: z.string().nullable(),
|
|
15
|
+
name: z.string().nullable(),
|
|
16
|
+
kind: z.enum([
|
|
17
|
+
"struct",
|
|
18
|
+
"union",
|
|
19
|
+
"enum",
|
|
20
|
+
"pointer",
|
|
21
|
+
"array",
|
|
22
|
+
"typedef",
|
|
23
|
+
"scalar",
|
|
24
|
+
"unsupported",
|
|
25
|
+
"unavailable",
|
|
26
|
+
]),
|
|
27
|
+
source: z.literal("analysis-database"),
|
|
28
|
+
source_archive: z.string().nullable(),
|
|
29
|
+
address: z.string().nullable(),
|
|
30
|
+
size_bytes: z.number().int().nonnegative().nullable(),
|
|
31
|
+
alignment_bytes: z.number().int().positive().nullable(),
|
|
32
|
+
packing_enabled: z.boolean().nullable(),
|
|
33
|
+
referenced_type: z.string().nullable(),
|
|
34
|
+
array_count: z.number().int().nonnegative().nullable(),
|
|
35
|
+
array_stride_bytes: z.number().int().nonnegative().nullable(),
|
|
36
|
+
fields: z.array(z.strictObject({
|
|
37
|
+
ordinal: z.number().int().nonnegative(),
|
|
38
|
+
name: z.string().nullable(),
|
|
39
|
+
offset_bytes: z.number().int().nonnegative(),
|
|
40
|
+
size_bytes: z.number().int().nonnegative().nullable(),
|
|
41
|
+
type_id: z.string(),
|
|
42
|
+
bit_size: z.number().int().nonnegative().nullable(),
|
|
43
|
+
bit_offset: z.number().int().nonnegative().nullable(),
|
|
44
|
+
status: z.enum(["observed", "unsupported"]),
|
|
45
|
+
flexible_tail: z.literal("unknown"),
|
|
46
|
+
})),
|
|
47
|
+
members: z.array(z.strictObject({ name: z.string(), value: z.string() })),
|
|
48
|
+
total_fields: z.number().int().nonnegative(),
|
|
49
|
+
truncated: z.boolean(),
|
|
50
|
+
limitations: z.array(z.string()),
|
|
51
|
+
});
|
|
@@ -69,7 +69,6 @@ const dependencySchema = z.object({
|
|
|
69
69
|
const loadCommandSchema = z.object({
|
|
70
70
|
index: z.number().int().min(0),
|
|
71
71
|
kind: z.string(),
|
|
72
|
-
file_offset: z.number().int().min(0).nullable(),
|
|
73
72
|
fields: z.record(z.string(), z.union([z.string(), z.number(), z.null()])),
|
|
74
73
|
});
|
|
75
74
|
const buildMetadataSchema = z.object({
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Exact instruction location within the active analysis program. */
|
|
3
|
+
export const nativeInstructionInputSchema = z.strictObject({
|
|
4
|
+
address: z.string().min(1),
|
|
5
|
+
document: z.string().optional(),
|
|
6
|
+
});
|
|
7
|
+
const reference = z.strictObject({
|
|
8
|
+
target_address: z.string(),
|
|
9
|
+
type: z.string(),
|
|
10
|
+
call: z.boolean(),
|
|
11
|
+
jump: z.boolean(),
|
|
12
|
+
indirect: z.boolean(),
|
|
13
|
+
computed: z.boolean(),
|
|
14
|
+
operand_index: z.number().int(),
|
|
15
|
+
});
|
|
16
|
+
/** Provider-decoded facts for one instruction; operand tokens preserve their native ordering. */
|
|
17
|
+
export const nativeInstructionSchema = z.strictObject({
|
|
18
|
+
address: z.string(),
|
|
19
|
+
status: z.enum([
|
|
20
|
+
"decoded",
|
|
21
|
+
"not-instruction-boundary",
|
|
22
|
+
"data",
|
|
23
|
+
"undecodable",
|
|
24
|
+
"outside-memory",
|
|
25
|
+
]),
|
|
26
|
+
procedure: z.string().nullable(),
|
|
27
|
+
architecture: z.string(),
|
|
28
|
+
mode: z.string(),
|
|
29
|
+
bytes: z.string().nullable(),
|
|
30
|
+
length: z.number().int().positive().nullable(),
|
|
31
|
+
mnemonic: z.string().nullable(),
|
|
32
|
+
raw_disassembly: z.string().nullable(),
|
|
33
|
+
operands: z.array(z.strictObject({
|
|
34
|
+
index: z.number().int().nonnegative(),
|
|
35
|
+
raw: z.string(),
|
|
36
|
+
provider_type: z.number().int(),
|
|
37
|
+
components: z.array(z.strictObject({
|
|
38
|
+
kind: z.enum(["register", "immediate", "address", "unknown"]),
|
|
39
|
+
text: z.string(),
|
|
40
|
+
value: z.string().nullable(),
|
|
41
|
+
bit_width: z.number().int().nonnegative().nullable(),
|
|
42
|
+
})),
|
|
43
|
+
memory_addressing: z.literal("unavailable"),
|
|
44
|
+
})),
|
|
45
|
+
flow: z.strictObject({
|
|
46
|
+
kind: z.enum([
|
|
47
|
+
"call",
|
|
48
|
+
"jump",
|
|
49
|
+
"return",
|
|
50
|
+
"fallthrough",
|
|
51
|
+
"terminal",
|
|
52
|
+
"unavailable",
|
|
53
|
+
]),
|
|
54
|
+
conditional: z.boolean(),
|
|
55
|
+
computed: z.boolean(),
|
|
56
|
+
direct_destinations: z.array(z.string()),
|
|
57
|
+
}),
|
|
58
|
+
references: z.array(reference),
|
|
59
|
+
limitations: z.array(z.string()),
|
|
60
|
+
});
|
|
61
|
+
/** Static target resolution preserves provider references as evidence, never runtime certainty. */
|
|
62
|
+
export const nativeCallTargetsSchema = z.strictObject({
|
|
63
|
+
call_site: z.string(),
|
|
64
|
+
procedure: z.string().nullable(),
|
|
65
|
+
status: z.enum([
|
|
66
|
+
"direct",
|
|
67
|
+
"resolved-indirect",
|
|
68
|
+
"ambiguous",
|
|
69
|
+
"unresolved",
|
|
70
|
+
"not-call",
|
|
71
|
+
"unavailable",
|
|
72
|
+
]),
|
|
73
|
+
mechanism: z.enum(["direct", "computed", "indirect", "unavailable"]),
|
|
74
|
+
targets: z.array(z.strictObject({
|
|
75
|
+
address: z.string(),
|
|
76
|
+
procedure: z.string().nullable(),
|
|
77
|
+
status: z.enum(["direct", "resolved-indirect", "candidate"]),
|
|
78
|
+
basis: z.literal("provider-reference"),
|
|
79
|
+
references: z.array(reference),
|
|
80
|
+
})),
|
|
81
|
+
limitations: z.array(z.string()),
|
|
82
|
+
});
|
|
@@ -51,6 +51,8 @@ export const nativeInvestigationRelationSchema = z.enum([
|
|
|
51
51
|
"swift_vtable_dispatch",
|
|
52
52
|
"thunk_to",
|
|
53
53
|
"direct_call",
|
|
54
|
+
"indirect_call",
|
|
55
|
+
"provider_call",
|
|
54
56
|
"reads",
|
|
55
57
|
"writes",
|
|
56
58
|
"flows_to",
|
|
@@ -63,7 +65,7 @@ export const nativeInvestigationEdgeSchema = z.discriminatedUnion("resolution",
|
|
|
63
65
|
from: z.string().min(1),
|
|
64
66
|
to: z.string().min(1),
|
|
65
67
|
relation: nativeInvestigationRelationSchema,
|
|
66
|
-
resolution: z.enum(["observed", "inferred"]),
|
|
68
|
+
resolution: z.enum(["observed", "inferred", "resolved", "ambiguous"]),
|
|
67
69
|
evidence: z.array(nativeMetadataEvidenceSchema).min(1),
|
|
68
70
|
limitations: z.array(z.string()),
|
|
69
71
|
}),
|
|
@@ -275,7 +277,7 @@ export const joinInterfaceBuilderDispatch = (graph, metadata) => {
|
|
|
275
277
|
resolution: "unresolved",
|
|
276
278
|
reason: candidates.length > 1
|
|
277
279
|
? "selector_has_multiple_candidate_implementations"
|
|
278
|
-
: "
|
|
280
|
+
: "implementation_not_resolved_from_binary_metadata_or_provider_symbols",
|
|
279
281
|
evidence: [
|
|
280
282
|
...action.evidence,
|
|
281
283
|
...candidates.flatMap(({ evidence }) => evidence),
|
|
@@ -308,14 +310,16 @@ export const joinInterfaceBuilderDispatch = (graph, metadata) => {
|
|
|
308
310
|
from: selectorNodeId,
|
|
309
311
|
to: functionId,
|
|
310
312
|
relation: "objc_dispatch",
|
|
311
|
-
resolution: "
|
|
313
|
+
resolution: className !== null && implementation.decode.status === "decoded"
|
|
314
|
+
? "resolved"
|
|
315
|
+
: "inferred",
|
|
312
316
|
evidence: [...action.evidence, ...implementation.evidence],
|
|
313
317
|
limitations: className === null
|
|
314
318
|
? [
|
|
315
|
-
"The selector uniquely matches a symbolized method, but the Interface Builder receiver is an unresolved placeholder; runtime dispatch was not observed.",
|
|
319
|
+
"The selector uniquely matches a encoded or symbolized method, but the Interface Builder receiver is an unresolved placeholder; runtime dispatch was not observed.",
|
|
316
320
|
]
|
|
317
321
|
: [
|
|
318
|
-
"The Interface Builder target and symbolized method agree on class and selector; runtime dispatch and dynamically supplied targets were not observed.",
|
|
322
|
+
"The Interface Builder target and encoded or symbolized method agree on class and selector; runtime dispatch and dynamically supplied targets were not observed.",
|
|
319
323
|
],
|
|
320
324
|
});
|
|
321
325
|
resolved += 1;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { decodeCanonicalBase64 } from "./webScreenshot.js";
|
|
4
|
+
const scope = {
|
|
5
|
+
pid: z.number().int().positive(),
|
|
6
|
+
window_id: z.number().int().positive(),
|
|
7
|
+
screenshot: z.boolean().default(true),
|
|
8
|
+
accessibility: z.boolean().default(true),
|
|
9
|
+
max_nodes: z
|
|
10
|
+
.number()
|
|
11
|
+
.int()
|
|
12
|
+
.positive()
|
|
13
|
+
.safe()
|
|
14
|
+
.default(500)
|
|
15
|
+
.describe("Maximum accessibility nodes per capture; increase for large windows."),
|
|
16
|
+
};
|
|
17
|
+
/** Opt-in passive observation binds one already-running process and window. */
|
|
18
|
+
export const nativeUiObservationInputSchema = z.strictObject(scope);
|
|
19
|
+
/** Active scenarios use explicit actions and leave application state as-is. */
|
|
20
|
+
export const nativeUiScenarioInputSchema = z.strictObject({
|
|
21
|
+
...scope,
|
|
22
|
+
steps: z
|
|
23
|
+
.array(z.discriminatedUnion("kind", [
|
|
24
|
+
z.strictObject({
|
|
25
|
+
kind: z.literal("click"),
|
|
26
|
+
path: z.array(z.number().int().nonnegative()).max(32),
|
|
27
|
+
}),
|
|
28
|
+
z.strictObject({
|
|
29
|
+
kind: z.literal("scroll"),
|
|
30
|
+
path: z.array(z.number().int().nonnegative()).max(32),
|
|
31
|
+
direction: z.enum(["increment", "decrement"]),
|
|
32
|
+
}),
|
|
33
|
+
z.strictObject({
|
|
34
|
+
kind: z.literal("key-entry"),
|
|
35
|
+
path: z.array(z.number().int().nonnegative()).max(32),
|
|
36
|
+
text: z.string(),
|
|
37
|
+
}),
|
|
38
|
+
z.strictObject({
|
|
39
|
+
kind: z.literal("wait"),
|
|
40
|
+
milliseconds: z
|
|
41
|
+
.number()
|
|
42
|
+
.int()
|
|
43
|
+
.min(0)
|
|
44
|
+
.max(180_000)
|
|
45
|
+
.describe("Wait duration in milliseconds, within the 180-second operation deadline."),
|
|
46
|
+
}),
|
|
47
|
+
]))
|
|
48
|
+
.min(1),
|
|
49
|
+
});
|
|
50
|
+
/** Ordered captures and failures distinguish missing observation from a failed action. */
|
|
51
|
+
const nativeUiScreenshotSchema = z
|
|
52
|
+
.strictObject({
|
|
53
|
+
mime_type: z.literal("image/png"),
|
|
54
|
+
base64: z.string().min(4),
|
|
55
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
56
|
+
width: z.number().int().positive(),
|
|
57
|
+
height: z.number().int().positive(),
|
|
58
|
+
})
|
|
59
|
+
.superRefine((screenshot, context) => {
|
|
60
|
+
const bytes = decodeCanonicalBase64(screenshot.base64);
|
|
61
|
+
if (bytes === undefined) {
|
|
62
|
+
context.addIssue({
|
|
63
|
+
code: "custom",
|
|
64
|
+
message: "Invalid canonical PNG base64",
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (createHash("sha256").update(bytes).digest("hex") !== screenshot.sha256)
|
|
69
|
+
context.addIssue({
|
|
70
|
+
code: "custom",
|
|
71
|
+
message: "PNG screenshot digest mismatch",
|
|
72
|
+
});
|
|
73
|
+
if (bytes.byteLength < 24 ||
|
|
74
|
+
!bytes.subarray(0, 8).equals(PNG_SIGNATURE) ||
|
|
75
|
+
bytes.subarray(12, 16).toString("ascii") !== "IHDR") {
|
|
76
|
+
context.addIssue({
|
|
77
|
+
code: "custom",
|
|
78
|
+
message: "Screenshot bytes are not a PNG image",
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (bytes.readUInt32BE(16) !== screenshot.width ||
|
|
83
|
+
bytes.readUInt32BE(20) !== screenshot.height)
|
|
84
|
+
context.addIssue({
|
|
85
|
+
code: "custom",
|
|
86
|
+
message: "PNG screenshot dimensions mismatch",
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
const PNG_SIGNATURE = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
90
|
+
export const nativeUiSnapshotSchema = z.strictObject({
|
|
91
|
+
window: z.strictObject({
|
|
92
|
+
pid: z.number().int().positive(),
|
|
93
|
+
window_id: z.number().int().positive(),
|
|
94
|
+
executable: z.string(),
|
|
95
|
+
launch_time: z.number(),
|
|
96
|
+
title: z.string(),
|
|
97
|
+
}),
|
|
98
|
+
nodes: z.array(z.strictObject({
|
|
99
|
+
path: z.array(z.number().int().nonnegative()),
|
|
100
|
+
role: z.string().nullable(),
|
|
101
|
+
title: z.string().nullable(),
|
|
102
|
+
value: z.string().nullable(),
|
|
103
|
+
actions: z.array(z.string()),
|
|
104
|
+
children_count: z.number().int().nonnegative(),
|
|
105
|
+
})),
|
|
106
|
+
truncated: z.boolean(),
|
|
107
|
+
screenshot: nativeUiScreenshotSchema.nullable(),
|
|
108
|
+
gaps: z.array(z.string()),
|
|
109
|
+
});
|
|
110
|
+
export const nativeUiResultSchema = z.strictObject({
|
|
111
|
+
target_sha256: z.string(),
|
|
112
|
+
initial: nativeUiSnapshotSchema,
|
|
113
|
+
steps: z.array(z.strictObject({
|
|
114
|
+
index: z.number().int().nonnegative(),
|
|
115
|
+
kind: z.string(),
|
|
116
|
+
before: nativeUiSnapshotSchema,
|
|
117
|
+
after: nativeUiSnapshotSchema.nullable(),
|
|
118
|
+
outcome: z.enum(["completed", "failed", "cancelled"]),
|
|
119
|
+
reason: z.string().nullable(),
|
|
120
|
+
})),
|
|
121
|
+
restore: z.literal("leave-as-is"),
|
|
122
|
+
limitations: z.array(z.string()),
|
|
123
|
+
});
|
|
@@ -16,6 +16,9 @@ export const nativePcodeOperationSchema = z.strictObject({
|
|
|
16
16
|
sequence: z.number().int().nonnegative(),
|
|
17
17
|
opcode: z.string().min(1),
|
|
18
18
|
is_dead: z.boolean(),
|
|
19
|
+
block_membership: z
|
|
20
|
+
.enum(["member", "detached", "unavailable"])
|
|
21
|
+
.default("unavailable"),
|
|
19
22
|
inputs: z.array(nativeVarnodeSchema),
|
|
20
23
|
output: nativeVarnodeSchema.nullable(),
|
|
21
24
|
});
|
|
@@ -47,6 +50,20 @@ export const nativeValueFlowSchema = z.discriminatedUnion("available", [
|
|
|
47
50
|
operations: z.array(nativePcodeOperationSchema),
|
|
48
51
|
def_use: z.array(nativePcodeDefUseSchema),
|
|
49
52
|
effects: z.array(nativePcodeEffectSchema),
|
|
53
|
+
parameters: z
|
|
54
|
+
.array(z.strictObject({
|
|
55
|
+
ordinal: z.number().int().nonnegative(),
|
|
56
|
+
name: z.string(),
|
|
57
|
+
data_type: z.string(),
|
|
58
|
+
}))
|
|
59
|
+
.default([]),
|
|
60
|
+
parameter_uses: z
|
|
61
|
+
.array(z.strictObject({
|
|
62
|
+
ordinal: z.number().int().nonnegative(),
|
|
63
|
+
use: z.string(),
|
|
64
|
+
input_index: z.number().int().nonnegative(),
|
|
65
|
+
}))
|
|
66
|
+
.default([]),
|
|
50
67
|
truncated: z.boolean(),
|
|
51
68
|
omitted_operations_lower_bound: z.number().int().nonnegative(),
|
|
52
69
|
known_omitted_inputs: z.number().int().nonnegative(),
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { nativePcodeOperationSchema } from "./nativeValueFlow.js";
|
|
3
|
+
/** Work and output budgets for a static procedure-seeded dependency graph. */
|
|
4
|
+
export const nativeValueTraceInputSchema = z.strictObject({
|
|
5
|
+
procedure: z.string().min(1),
|
|
6
|
+
max_depth: z.number().int().min(0).max(16).default(3),
|
|
7
|
+
max_functions: z.number().int().min(1).max(64).default(16),
|
|
8
|
+
max_call_sites: z.number().int().min(1).max(4096).default(256),
|
|
9
|
+
max_nodes: z.number().int().min(1).max(20_000).default(5_000),
|
|
10
|
+
max_edges: z.number().int().min(1).max(40_000).default(10_000),
|
|
11
|
+
offset: z.number().int().min(0).default(0),
|
|
12
|
+
limit: z.number().int().min(1).max(5_000).default(1_000),
|
|
13
|
+
});
|
|
14
|
+
/** Def-use observations and call relationships retain separate authority. */
|
|
15
|
+
export const nativeValueTraceSchema = z.strictObject({
|
|
16
|
+
seed: z.string(),
|
|
17
|
+
target_sha256: z.string(),
|
|
18
|
+
nodes: z.array(z.strictObject({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
procedure: z.string(),
|
|
21
|
+
evidence_id: z.string(),
|
|
22
|
+
kind: z.enum(["operation", "parameter"]),
|
|
23
|
+
operation: nativePcodeOperationSchema.nullable(),
|
|
24
|
+
parameter: z
|
|
25
|
+
.strictObject({
|
|
26
|
+
ordinal: z.number().int().nonnegative(),
|
|
27
|
+
name: z.string(),
|
|
28
|
+
data_type: z.string(),
|
|
29
|
+
})
|
|
30
|
+
.nullable(),
|
|
31
|
+
})),
|
|
32
|
+
edges: z.array(z.strictObject({
|
|
33
|
+
source: z.string(),
|
|
34
|
+
target: z.string(),
|
|
35
|
+
input_index: z.number().int().nonnegative().nullable(),
|
|
36
|
+
kind: z.enum([
|
|
37
|
+
"def-use",
|
|
38
|
+
"call",
|
|
39
|
+
"parameter-use",
|
|
40
|
+
"argument-binding",
|
|
41
|
+
"return-binding",
|
|
42
|
+
]),
|
|
43
|
+
status: z.enum(["derived", "direct", "resolved-indirect", "candidate"]),
|
|
44
|
+
evidence_id: z.string(),
|
|
45
|
+
})),
|
|
46
|
+
procedures: z.array(z.strictObject({
|
|
47
|
+
address: z.string(),
|
|
48
|
+
depth: z.number().int().nonnegative(),
|
|
49
|
+
evidence_id: z.string(),
|
|
50
|
+
provider: z.string(),
|
|
51
|
+
analysis_profile_digest: z.string().nullable(),
|
|
52
|
+
})),
|
|
53
|
+
unknowns: z.array(z.strictObject({
|
|
54
|
+
procedure: z.string(),
|
|
55
|
+
address: z.string().nullable(),
|
|
56
|
+
reason: z.string(),
|
|
57
|
+
})),
|
|
58
|
+
total_nodes: z.number().int().nonnegative(),
|
|
59
|
+
total_edges: z.number().int().nonnegative(),
|
|
60
|
+
decompilations: z.number().int().nonnegative(),
|
|
61
|
+
next_offset: z.number().int().nonnegative().nullable(),
|
|
62
|
+
truncated: z.boolean(),
|
|
63
|
+
limitations: z.array(z.string()),
|
|
64
|
+
});
|
|
@@ -50,6 +50,32 @@ export const objcClassSchema = z.strictObject({
|
|
|
50
50
|
protocols: z.array(z.string()).default([]),
|
|
51
51
|
ivar_count: z.number().int().nonnegative().default(0),
|
|
52
52
|
instance_size: z.number().int().nonnegative().nullable(),
|
|
53
|
+
location: z
|
|
54
|
+
.object({
|
|
55
|
+
address: z.string().nullable(),
|
|
56
|
+
file_offset: z.number().int().nonnegative().nullable(),
|
|
57
|
+
})
|
|
58
|
+
.optional(),
|
|
59
|
+
superclass_address: z.string().nullable().optional(),
|
|
60
|
+
metaclass_address: z.string().nullable().optional(),
|
|
61
|
+
decode: z
|
|
62
|
+
.object({
|
|
63
|
+
status: z.enum(["decoded", "partial", "unsupported", "invalid"]),
|
|
64
|
+
reason: z.string().nullable(),
|
|
65
|
+
})
|
|
66
|
+
.optional(),
|
|
67
|
+
evidence: z
|
|
68
|
+
.array(z.object({
|
|
69
|
+
kind: z.literal("binary_metadata"),
|
|
70
|
+
description: z.string(),
|
|
71
|
+
location: z.object({
|
|
72
|
+
address: z.string().nullable(),
|
|
73
|
+
file_offset: z.number().int().nonnegative().nullable(),
|
|
74
|
+
}),
|
|
75
|
+
artifact_path: z.string(),
|
|
76
|
+
artifact_sha256: z.string(),
|
|
77
|
+
}))
|
|
78
|
+
.optional(),
|
|
53
79
|
});
|
|
54
80
|
/** Exact location of a decoded native metadata value when the provider knows it. */
|
|
55
81
|
export const nativeMetadataLocationSchema = z.strictObject({
|
|
@@ -85,6 +111,18 @@ export const objcIvarSchema = z.strictObject({
|
|
|
85
111
|
name: z.string().min(1),
|
|
86
112
|
type_encoding: z.string().nullable(),
|
|
87
113
|
offset: z.number().int().nonnegative().nullable(),
|
|
114
|
+
size: z.number().int().nonnegative().nullable().default(null),
|
|
115
|
+
alignment: z.number().int().positive().nullable().default(null),
|
|
116
|
+
location: nativeMetadataLocationSchema,
|
|
117
|
+
decode: nativeMetadataDecodeSchema,
|
|
118
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1),
|
|
119
|
+
});
|
|
120
|
+
/** Encoded Objective-C protocol declaration with required and optional method facts. */
|
|
121
|
+
export const objcProtocolRecordSchema = z.strictObject({
|
|
122
|
+
name: z.string(),
|
|
123
|
+
adopted_protocols: z.array(z.string()),
|
|
124
|
+
methods: z.array(objcMethodSchema),
|
|
125
|
+
optional_methods: z.array(objcMethodSchema),
|
|
88
126
|
location: nativeMetadataLocationSchema,
|
|
89
127
|
decode: nativeMetadataDecodeSchema,
|
|
90
128
|
evidence: z.array(nativeMetadataEvidenceSchema).min(1),
|
|
@@ -204,6 +242,7 @@ export const objcSwiftMetadataSchema = z.strictObject({
|
|
|
204
242
|
objc_protocols: z.array(objcProtocolSchema).default([]),
|
|
205
243
|
swift_decls: z.array(swiftDeclSchema).default([]),
|
|
206
244
|
objc_ivars: z.array(objcIvarSchema).default([]),
|
|
245
|
+
objc_protocol_records: z.array(objcProtocolRecordSchema).default([]),
|
|
207
246
|
objc_dispatch_implementations: z
|
|
208
247
|
.array(objcDispatchImplementationSchema)
|
|
209
248
|
.default([]),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { jsonValueSchema } from "./jsonValue.js";
|
|
3
3
|
import { normalizationSchema } from "./processScenario.js";
|
|
4
|
-
import { processReactiveRunSchema } from "./processCaptureReactiveSchema.js";
|
|
5
4
|
import { collectProcessCaptureIssues } from "./processCaptureValidation.js";
|
|
6
5
|
export * from "./processScenario.js";
|
|
7
6
|
/** Capture collection whose members participate in global observation order. */
|
|
@@ -12,9 +11,6 @@ export const PROCESS_CAPTURE_EVENT_COLLECTIONS = [
|
|
|
12
11
|
"lifecycle",
|
|
13
12
|
"process_samples",
|
|
14
13
|
"filesystem_checkpoints",
|
|
15
|
-
"shim_events",
|
|
16
|
-
"protocol_events",
|
|
17
|
-
"replay_transitions",
|
|
18
14
|
];
|
|
19
15
|
const fileStateShape = {
|
|
20
16
|
path: z.string(),
|
|
@@ -65,8 +61,8 @@ const fileEffectSchema = z.discriminatedUnion("status", [
|
|
|
65
61
|
}),
|
|
66
62
|
]);
|
|
67
63
|
/** Exact serialized shape of a process capture. */
|
|
68
|
-
const processCaptureShapeSchema = z.
|
|
69
|
-
manifest: z.
|
|
64
|
+
const processCaptureShapeSchema = z.strictObject({
|
|
65
|
+
manifest: z.strictObject({
|
|
70
66
|
rea_version: z.string().min(1),
|
|
71
67
|
provider_version: z.string().min(1),
|
|
72
68
|
platform: z.string().min(1),
|
|
@@ -76,14 +72,10 @@ const processCaptureShapeSchema = z.object({
|
|
|
76
72
|
completed_at: z.iso.datetime(),
|
|
77
73
|
scenario: z.record(z.string(), jsonValueSchema),
|
|
78
74
|
comparison_contract: z.record(z.string(), jsonValueSchema),
|
|
79
|
-
shim_plan: z.array(jsonValueSchema),
|
|
80
|
-
replay_plan: z.record(z.string(), jsonValueSchema),
|
|
81
75
|
full_scenario_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
82
76
|
comparison_contract_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
83
77
|
executable_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
84
78
|
normalization_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
85
|
-
shim_plan_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
86
|
-
replay_plan_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
87
79
|
}),
|
|
88
80
|
normalization: normalizationSchema,
|
|
89
81
|
frames: z.array(z.object({
|
|
@@ -106,7 +98,7 @@ const processCaptureShapeSchema = z.object({
|
|
|
106
98
|
sequence: z.number().int().nonnegative(),
|
|
107
99
|
scheduled_at_ms: z.number().int().nonnegative(),
|
|
108
100
|
dispatched_at_ms: z.number().int().nonnegative(),
|
|
109
|
-
type: z.enum(["input", "resize", "
|
|
101
|
+
type: z.enum(["input", "resize", "signal"]),
|
|
110
102
|
data: z.string(),
|
|
111
103
|
outcome: z.enum(["dispatched", "target_exited", "failed"]),
|
|
112
104
|
})),
|
|
@@ -136,53 +128,12 @@ const processCaptureShapeSchema = z.object({
|
|
|
136
128
|
session_id: z.number().int().nonnegative().nullable(),
|
|
137
129
|
})),
|
|
138
130
|
filesystem_checkpoints: z.array(z.object({
|
|
139
|
-
name: z.
|
|
131
|
+
name: z.enum(["before", "after_settlement"]),
|
|
140
132
|
at_ms: z.number().int().nonnegative(),
|
|
141
133
|
files: z.array(fileStateSchema),
|
|
142
134
|
effects: z.array(fileEffectSchema),
|
|
143
135
|
truncated: z.boolean(),
|
|
144
136
|
})),
|
|
145
|
-
shim_events: z.array(z.object({
|
|
146
|
-
sequence: z.number().int().nonnegative(),
|
|
147
|
-
at_ms: z.number().int().nonnegative(),
|
|
148
|
-
command: z.string(),
|
|
149
|
-
route_index: z.number().int().nonnegative().nullable(),
|
|
150
|
-
arguments: z.array(z.string()),
|
|
151
|
-
working_directory: z.string(),
|
|
152
|
-
outcome: z.enum(["matched", "unmatched", "exhausted"]),
|
|
153
|
-
})),
|
|
154
|
-
protocol_events: z.array(z.object({
|
|
155
|
-
sequence: z.number().int().nonnegative(),
|
|
156
|
-
at_ms: z.number().int().nonnegative(),
|
|
157
|
-
protocol: z.enum(["http", "websocket"]),
|
|
158
|
-
direction: z.enum(["request", "response", "received", "sent"]),
|
|
159
|
-
method: z.string().nullable(),
|
|
160
|
-
path: z.string().nullable(),
|
|
161
|
-
data: z.string(),
|
|
162
|
-
outcome: z.enum([
|
|
163
|
-
"matched",
|
|
164
|
-
"unmatched",
|
|
165
|
-
"script_exhausted",
|
|
166
|
-
"disconnected",
|
|
167
|
-
"invalid_state",
|
|
168
|
-
"guard_failed",
|
|
169
|
-
"transition_exhausted",
|
|
170
|
-
"invalid_capture",
|
|
171
|
-
"unexpected_reconnect",
|
|
172
|
-
"limit_exhausted",
|
|
173
|
-
]),
|
|
174
|
-
})),
|
|
175
|
-
replay_transitions: z
|
|
176
|
-
.array(z.object({
|
|
177
|
-
sequence: z.number().int().nonnegative(),
|
|
178
|
-
at_ms: z.number().int().nonnegative(),
|
|
179
|
-
transition_id: z.string().min(1),
|
|
180
|
-
state_before: z.string().min(1),
|
|
181
|
-
state_after: z.string().min(1),
|
|
182
|
-
sensitive_aliases: z.array(z.string().min(1)),
|
|
183
|
-
}))
|
|
184
|
-
.default([]),
|
|
185
|
-
reactive_run: processReactiveRunSchema.nullable().default(null),
|
|
186
137
|
event_journal: z
|
|
187
138
|
.array(z.object({
|
|
188
139
|
capture_order: z.number().int().nonnegative(),
|
|
@@ -202,10 +153,9 @@ const processCaptureShapeSchema = z.object({
|
|
|
202
153
|
"exit",
|
|
203
154
|
"process",
|
|
204
155
|
"filesystem",
|
|
205
|
-
"protocol",
|
|
206
|
-
"shim",
|
|
207
156
|
"cleanup",
|
|
208
157
|
"network",
|
|
158
|
+
"environment",
|
|
209
159
|
]),
|
|
210
160
|
reason: z.string(),
|
|
211
161
|
})),
|