rea-agents 6.2.0 → 6.4.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 +24 -23
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +597 -209
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/hopper_bridge.py +2 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +186 -0
- package/dist/adb/AdbProvider.js +1190 -0
- package/dist/adb/AdbShellOutput.js +309 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxConfiguration.js +44 -24
- package/dist/android/JadxProvider.js +59 -21
- package/dist/android/JadxSession.js +51 -9
- package/dist/apktool/ApktoolConfiguration.js +84 -0
- package/dist/apktool/ApktoolDecodeOutput.js +59 -0
- package/dist/apktool/ApktoolProvider.js +506 -0
- package/dist/application/AnalysisProvider.js +8 -2
- package/dist/application/AppBundleExecutable.js +27 -22
- package/dist/application/BinaryTargetResolver.js +85 -19
- package/dist/application/BrowserScenarioEvidence.js +2 -2
- package/dist/application/CapabilityInventory.js +11 -1
- package/dist/application/ClientConfigurationDocument.js +98 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +35 -0
- package/dist/application/ClientRegistrationStatus.js +75 -27
- package/dist/application/DirectAnalysis.js +14 -8
- package/dist/application/DirectAnalysisCleanup.js +1 -2
- package/dist/application/DirectAnalysisStatus.js +3 -6
- package/dist/application/Doctor.js +27 -34
- package/dist/application/DoctorDiagnostics.js +1 -1
- package/dist/application/EvidenceBundleCommands.js +6 -12
- package/dist/application/EvidenceBundleFiles.js +1 -1
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InvestigationProviders.js +10 -4
- package/dist/application/JsonFiles.js +16 -15
- package/dist/application/JsonInputFile.js +252 -0
- package/dist/application/LinuxHopper.js +6 -13
- package/dist/application/MacHopper.js +172 -149
- package/dist/application/MipsElfAbiFlags.js +140 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/ReconstructionObligationCandidates.js +16 -3
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -1
- package/dist/application/ReferenceSourceImport.js +76 -29
- package/dist/application/ReferenceSourceImportEntries.js +18 -9
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -22
- package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
- package/dist/application/RegularFileRead.js +103 -0
- package/dist/application/Setup.js +69 -10
- package/dist/application/SetupClientConfiguration.js +134 -23
- package/dist/application/SetupHost.js +102 -22
- package/dist/application/SetupPlan.js +18 -17
- package/dist/application/SetupSkill.js +81 -13
- package/dist/application/SupportedClients.js +305 -37
- package/dist/application/Uninstall.js +172 -8
- package/dist/application/UpdateMaintenance.js +23 -23
- package/dist/application/Utf8JsonInput.js +71 -0
- package/dist/application/WebScriptExportService.js +130 -57
- package/dist/application/WebSourceLocationService.js +3 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +40 -2
- package/dist/application/android/AndroidAnalysisService.js +1 -1
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/AnalysisSnapshotCache.js +5 -4
- package/dist/application/binary/BinarySession.js +18 -1
- package/dist/application/binary/BinarySessionOpen.js +9 -1
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
- package/dist/application/evm/EvmInterfaceService.js +3 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +2 -2
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +20 -3
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +1 -0
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +107 -46
- package/dist/application/javascript/JavaScriptApplicationService.js +23 -11
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +59 -45
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -36
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +74 -36
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +53 -42
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +293 -238
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +120 -28
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -0
- package/dist/application/javascript/JavaScriptJsonModules.js +2 -2
- package/dist/application/javascript/JavaScriptModuleRelationships.js +10 -20
- package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +11 -27
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +11 -5
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +206 -66
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +18 -23
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +5 -2
- package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +2 -2
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +7 -5
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +6 -4
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +4 -4
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +29 -15
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +15 -10
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
- package/dist/application/native/NativeCallRoutes.js +2 -4
- package/dist/application/native/NativeUiActionTrace.js +16 -8
- package/dist/application/native/NativeValueTrace.js +23 -6
- package/dist/application/process/ProcessCli.js +25 -20
- package/dist/artifacts/ArtifactPaths.js +129 -8
- package/dist/artifacts/ArtifactProvider.js +34 -31
- package/dist/artifacts/ArtifactProviderMetadata.js +1 -4
- package/dist/artifacts/ArtifactReader.js +23 -0
- package/dist/artifacts/ArtifactResourceScope.js +100 -0
- package/dist/artifacts/AsarArtifactReader.js +218 -80
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +168 -65
- package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
- package/dist/artifacts/NativeDmgArtifactReader.js +179 -87
- package/dist/artifacts/NativeDmgOwnership.js +109 -0
- package/dist/artifacts/SafeOutputTree.js +245 -70
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +77 -27
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +76 -49
- package/dist/artifacts/apple/MachoLoadCommandReader.js +36 -6
- package/dist/artifacts/extraction/ArtifactExtraction.js +134 -92
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +116 -50
- package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
- package/dist/artifacts/inventory/classify.js +87 -25
- package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
- package/dist/artifacts/inventory/reader.js +13 -5
- package/dist/artifacts/inventory/scanCanonical.js +73 -30
- package/dist/artifacts/inventory/scanReader.js +43 -20
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +72 -28
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
- package/dist/browser/BrowserScenarioSecrets.js +52 -37
- package/dist/browser/CdpBrowserProvider.js +9 -3
- package/dist/browser/CdpCaptureDocuments.js +40 -6
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
- package/dist/browser/CdpCaptureEventHandlers.js +26 -9
- package/dist/browser/CdpCaptureEvents.js +4 -9
- package/dist/browser/CdpCaptureStorageFingerprints.js +3 -3
- package/dist/browser/CdpConnection.js +22 -5
- package/dist/browser/CdpElectronInspection.js +2 -2
- package/dist/browser/CdpElectronProvider.js +4 -3
- package/dist/browser/CdpElectronScripts.js +2 -2
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpTargetSession.js +30 -34
- package/dist/browser/CdpWebMcpDiscovery.js +48 -23
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +63 -7
- package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +208 -43
- package/dist/browser/PlaywrightScenarioSession.js +130 -65
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +35 -9
- package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
- package/dist/browser/assets/PublishWebScripts.js +75 -20
- package/dist/browser/assets/ScenarioScriptCapture.js +8 -12
- package/dist/browser/assets/WebArtifactReads.js +23 -1
- package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/HarCapture.js +14 -0
- package/dist/browser/history/HarCaptureProcess.js +2 -10
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/modules/WebModuleArtifacts.js +1 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/artifactCommands.js +8 -11
- package/dist/cli/binaryDiagnosticsCommands.js +19 -1
- package/dist/cli/browserAdvancedCommands.js +65 -36
- package/dist/cli/coreAnalysisCommands.js +2 -2
- package/dist/cli/coreBinaryCommands.js +12 -13
- package/dist/cli/coreNativeCommands.js +1 -14
- package/dist/cli/electronCommands.js +14 -10
- package/dist/cli/evmCommands.js +13 -4
- package/dist/cli/firmwareCommands.js +7 -2
- package/dist/cli/javascriptApplicationAnalysis.js +19 -13
- package/dist/cli/javascriptRecoveryCommands.js +22 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +12 -4
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/setupCommands.js +15 -3
- package/dist/cli/streamedJsonOutput.js +83 -4
- package/dist/cli/utilityCommands.js +68 -22
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli.js +11 -2
- package/dist/cliBrowserScenarioCommands.js +2 -1
- package/dist/cliCommandNames.js +32 -0
- package/dist/cliJsonInput.js +47 -34
- package/dist/cliObservationOptions.js +7 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +5 -4
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/browserScenario.js +2 -2
- package/dist/composition/directAnalysis.js +14 -7
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/config/environment.js +10 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/parseConfig.js +28 -1
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +10 -0
- package/dist/contracts/analysisViewToolContracts.js +17 -2
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/artifactComparisonExample.js +5 -5
- package/dist/contracts/artifactToolContracts.js +8 -5
- package/dist/contracts/browserToolContracts.js +1 -1
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/errorSchemas.js +3 -1
- package/dist/contracts/functionComparisonExample.js +8 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +104 -13
- package/dist/contracts/javascript/electronToolContracts.js +16 -3
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +3 -2
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +6 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +8 -7
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +3 -2
- package/dist/contracts/mobileApplicationGraphExamples.js +5 -5
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
- package/dist/contracts/native/nativeToolContracts.js +1 -1
- package/dist/contracts/officialToolContracts.js +5 -5
- package/dist/contracts/sessionLifecycleInputs.js +4 -3
- package/dist/contracts/sessionStatusContract.js +3 -2
- package/dist/contracts/sessionToolContracts.js +5 -4
- package/dist/contracts/sessionToolSchemas.js +9 -4
- package/dist/contracts/toolContractExamples.js +6 -0
- package/dist/contracts/toolContractTypes.js +3 -0
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +167 -0
- package/dist/contracts/toolOutputSchemaGroups.js +7 -5
- package/dist/contracts/toolOutputSchemaPrimitives.js +2 -5
- package/dist/contracts/toolSchemaMetadata.js +82 -7
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorBase.js +5 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorPresentation.js +18 -4
- package/dist/domain/analysisErrorProjection.js +4 -1
- package/dist/domain/analysisSnapshot.js +5 -2
- package/dist/domain/analysisView/analysisView.js +53 -5
- package/dist/domain/analysisView/binaryLayoutView.js +2 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/android/androidApplication.js +25 -20
- package/dist/domain/android/androidPartialObservation.js +36 -0
- package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
- package/dist/domain/apple/appleApplication.js +40 -23
- package/dist/domain/apple/appleBundleAnatomy.js +95 -28
- package/dist/domain/apple/dyldPaths.js +9 -1
- package/dist/domain/apple/dylibResolution.js +3 -3
- package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
- package/dist/domain/artifactComparison.js +39 -11
- package/dist/domain/artifactGraph.js +6 -4
- package/dist/domain/artifactIdentity.js +37 -9
- package/dist/domain/artifactInspection.js +10 -50
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +16 -17
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +16 -0
- package/dist/domain/binaryTargetTypes.js +8 -1
- package/dist/domain/browserCompleteness.js +3 -2
- package/dist/domain/browserObservationSchemas.js +8 -4
- package/dist/domain/browserScenarioCaptureValues.js +2 -2
- package/dist/domain/browserScenarioNormalization.js +3 -3
- package/dist/domain/browserScenarioValues.js +3 -2
- package/dist/domain/callPath.js +8 -10
- package/dist/domain/canonicalDigest.js +7 -1
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/canonicalOrdering.js +1 -13
- package/dist/domain/changedBehavior.js +2 -3
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSemantics.js +0 -5
- package/dist/domain/digests.js +0 -3
- package/dist/domain/evidence.js +12 -6
- package/dist/domain/evidenceBundle.js +51 -33
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/firmware/firmwareAnalysis.js +4 -3
- package/dist/domain/functionComparison.js +2 -1
- package/dist/domain/functionComparisonNormalization.js +4 -3
- package/dist/domain/functionComparisonResults.js +2 -2
- package/dist/domain/functionDossierEvidence.js +2 -1
- package/dist/domain/hopperValues.js +11 -15
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronActiveObservation.js +4 -3
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +14 -15
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +20 -21
- package/dist/domain/javascript/electronStaticAnalysisNative.js +73 -41
- package/dist/domain/javascript/electronStaticAnalysisValues.js +24 -4
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +6 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +18 -14
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +4 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +91 -28
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparison.js +4 -4
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +37 -22
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +72 -45
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +16 -8
- package/dist/domain/javascript/javascriptAstFingerprint.js +60 -33
- package/dist/domain/javascript/javascriptAstValues.js +54 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
- package/dist/domain/javascript/javascriptExportShapeComparison.js +3 -2
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +31 -23
- package/dist/domain/javascript/javascriptExportShapeSelection.js +2 -2
- package/dist/domain/javascript/javascriptExportShapeVariants.js +3 -2
- package/dist/domain/javascript/javascriptFeatureSeed.js +5 -3
- package/dist/domain/javascript/javascriptFeatureTrace.js +7 -6
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +17 -9
- package/dist/domain/javascript/javascriptFeatureTraversal.js +4 -4
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +12 -7
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
- package/dist/domain/javascript/javascriptRuntimeObservation.js +8 -5
- package/dist/domain/javascript/javascriptRuntimeReconciliation.js +12 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +9 -8
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +12 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +5 -5
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +12 -223
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +15 -17
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +379 -30
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +9 -7
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +2 -2
- package/dist/domain/javascript/javascriptSemanticCoverage.js +20 -0
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +7 -9
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +4 -11
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +43 -42
- package/dist/domain/javascript/javascriptSemanticGraph.js +205 -52
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +21 -11
- package/dist/domain/javascript/javascriptSemanticIr.js +0 -4
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +774 -136
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +98 -41
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +9 -7
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +7 -2
- package/dist/domain/javascript/javascriptSemanticProjection.js +72 -28
- package/dist/domain/javascript/javascriptSemanticPromises.js +15 -21
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +3 -3
- package/dist/domain/javascript/javascriptSemanticQuery.js +33 -29
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +4 -5
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -9
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +16 -10
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +34 -48
- package/dist/domain/javascript/javascriptSemanticState.js +22 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +25 -2
- package/dist/domain/javascript/javascriptSemanticValues.js +169 -30
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +11 -1
- package/dist/domain/javascript/javascriptSourceParser.js +34 -9
- package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +13 -12
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +26 -15
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +7 -5
- package/dist/domain/javascript/sourceToBundleSignals.js +7 -7
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonSerialization.js +109 -55
- package/dist/domain/jsonShape.js +69 -31
- package/dist/domain/jsonValue.js +3 -0
- package/dist/domain/localPath.js +10 -4
- package/dist/domain/managed/managedApplicationGraph.js +47 -6
- package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +94 -59
- package/dist/domain/managed/managedArtifact.js +1 -0
- package/dist/domain/managed/managedInspectionEvidence.js +13 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +6 -7
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeCallObservation.js +2 -4
- package/dist/domain/native/nativeInstruction.js +21 -0
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/nativeValueFlow.js +5 -11
- package/dist/domain/native/objcSwiftMetadata.js +15 -17
- package/dist/domain/native/peResources.js +94 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/process/processCapture.js +102 -11
- package/dist/domain/process/processCaptureCoverage.js +8 -5
- package/dist/domain/process/processCaptureExample.js +67 -0
- package/dist/domain/process/processCaptureValidation.js +83 -3
- package/dist/domain/process/processComparison.js +0 -23
- package/dist/domain/process/processScenario.js +62 -10
- package/dist/domain/process/processTraceEvaluation.js +4 -4
- package/dist/domain/process/processTraceSpecification.js +1 -3
- package/dist/domain/propertyListKeys.js +3 -1
- package/dist/domain/providerCleanupError.js +6 -2
- package/dist/domain/reconstructionCoverage.js +2 -1
- package/dist/domain/reconstructionUnknowns.js +4 -3
- package/dist/domain/reconstructionVerification.js +3 -2
- package/dist/domain/referenceSourceGraph.js +32 -23
- package/dist/domain/referenceSourceImportParsing.js +40 -48
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/staticRuntimeCorrelation.js +2 -1
- package/dist/domain/swiftSymbolClassification.js +6 -1
- package/dist/domain/symbolAnalysis.js +17 -2
- package/dist/domain/unicodeCodePointOrder.js +6 -0
- package/dist/domain/webBundleAnalyzerInspection.js +23 -3
- package/dist/domain/webCaptureDiff.js +170 -30
- package/dist/domain/webCaptureDiffSchemas.js +2 -8
- package/dist/domain/webInventory.js +3 -2
- package/dist/domain/webMcpDiscovery.js +4 -3
- package/dist/domain/webScriptExport.js +1 -1
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +7 -13
- package/dist/domain/zipPackageFormat.js +4 -1
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +55 -43
- package/dist/dotnet/ManagedDecodeBudget.js +80 -0
- package/dist/dotnet/ManagedMemberInspector.js +13 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +5 -4
- package/dist/dotnet/ManagedMemberRows.js +9 -4
- package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
- package/dist/dotnet/ManagedMetadataLayout.js +10 -4
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
- package/dist/dotnet/ManagedPeReader.js +41 -25
- package/dist/dotnet/ManagedReaderFailure.js +2 -1
- package/dist/dotnet/ManagedStaticProvider.js +65 -31
- package/dist/dotnet/ManagedStaticProviderMetadata.js +1 -4
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +43 -13
- package/dist/evm/EvmoleFailures.js +0 -2
- package/dist/evm/EvmoleInterfaceProvider.js +67 -2
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/RegularFile.js +73 -0
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +26 -0
- package/dist/firmware/FirmwareCommand.js +25 -3
- package/dist/firmware/FirmwareFiles.js +23 -8
- package/dist/firmware/FirmwareProvider.js +156 -32
- package/dist/firmware/FirmwarePublication.js +24 -3
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +90 -8
- package/dist/ghidra/GhidraDiagnostics.js +11 -8
- package/dist/ghidra/GhidraFunctionValues.js +26 -2
- package/dist/ghidra/GhidraInstallation.js +111 -10
- package/dist/ghidra/GhidraInventoryValues.js +23 -1
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +123 -58
- package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
- package/dist/ghidra/GhidraMipsProfile.js +79 -0
- package/dist/ghidra/GhidraProvider.js +57 -9
- package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
- package/dist/ghidra/GhidraProviderClient.js +282 -21
- package/dist/ghidra/GhidraSessionValues.js +9 -2
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperCleanup.js +1 -1
- package/dist/hopper/HopperClient.js +15 -6
- package/dist/hopper/HopperMachOImage.js +2 -0
- package/dist/hopper/HopperProvider.js +13 -2
- package/dist/ida/IdaOperationRunner.js +10 -2
- package/dist/ida/IdaProvider.js +7 -0
- package/dist/ida/IdaSessionClient.js +7 -3
- package/dist/ida/IdaWorkspace.js +4 -2
- package/dist/inspector/JavaScriptRuntimeScope.js +9 -5
- package/dist/inspector/V8InspectorCaptureProjection.js +46 -13
- package/dist/inspector/V8InspectorProvider.js +60 -8
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
- package/dist/javascript/recovery/RecoveryFiles.js +18 -7
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +11 -7
- package/dist/javascript/recovery/WakaruProvider.js +139 -16
- package/dist/javascript/recovery/WakaruPublication.js +14 -4
- package/dist/javascript/recovery/WakaruRelease.js +10 -3
- package/dist/javascript/recovery/WakaruReport.js +12 -7
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
- package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
- package/dist/jeb/JebMcpConnection.js +179 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +299 -0
- package/dist/main/shutdown.js +76 -32
- package/dist/main/transport.js +1 -1
- package/dist/mcpDoctor.js +15 -6
- package/dist/native/AppleDispatchCoverage.js +25 -12
- package/dist/native/AppleDispatchMetadata.js +14 -7
- package/dist/native/AppleMachoFixups.js +71 -15
- package/dist/native/AppleMachoSelection.js +23 -3
- package/dist/native/AppleObjcDispatchFacets.js +3 -3
- package/dist/native/AppleObjcProperties.js +17 -7
- package/dist/native/LldbCallTracer.js +241 -75
- package/dist/native/NativeMacOSProvider.js +100 -20
- package/dist/native/NativeMacOSProviderMetadata.js +1 -2
- package/dist/native/NativeMachoInspection.js +11 -7
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +4 -3
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/DarwinProcessRunTokenReader.js +8 -3
- package/dist/process/OwnedCommand.js +4 -3
- package/dist/process/ProcessOwnership.js +104 -112
- package/dist/process/ProcessOwnershipObservation.js +104 -51
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +4 -3
- package/dist/process/capture/FilesystemSnapshot.js +116 -22
- package/dist/process/capture/ProcessCaptureLifecycle.js +363 -86
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessFilesystemEffects.js +19 -4
- package/dist/process/capture/ProcessHarness.js +202 -47
- package/dist/process/capture/ProcessNormalization.js +3 -1
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
- package/dist/process/capture/TerminalRenderer.js +24 -7
- package/dist/reference/ReferenceSourceReader.js +22 -5
- package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
- package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
- package/dist/reference/ReferenceSourceReaderFile.js +50 -10
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
- package/dist/server/EvidenceMcpServer.js +36 -1
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/analysisAdmission.js +8 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +118 -47
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +4 -9
- package/dist/server/registerAndroidTools.js +3 -12
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +6 -7
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/helpers.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerArtifactTools.js +2 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +12 -9
- package/dist/server/registerBundleComparisonTool.js +16 -2
- package/dist/server/registerCloseLifecycleTool.js +36 -5
- package/dist/server/registerElectronTools.js +28 -10
- package/dist/server/registerEnhancedTools.js +78 -73
- package/dist/server/registerEvidenceTools.js +54 -46
- package/dist/server/registerEvmTools.js +4 -9
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFunctionComparisonTool.js +5 -2
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +7 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerOfficialTools.js +31 -25
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerSessionRecordTools.js +2 -1
- package/dist/server/registerSessionTools.js +58 -21
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +4 -9
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/toolResult.js +21 -2
- package/dist/windows/WindowsPrivateRuntime.js +12 -5
- package/install.sh +7 -4
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +38 -7
- package/scripts/rea.mjs +16 -1
- package/skills/reverse-engineer-anything/SKILL.md +52 -51
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +31 -1
- package/dist/artifacts/inventory/policy.js +0 -2
- package/dist/domain/managed/managedApplicationGraphNodeCoverage.js +0 -6
- package/dist/server/registerNativeTools.js +0 -6
|
@@ -1,29 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import { digestCanonicalValue } from "./canonicalDigest.js";
|
|
3
|
+
/** NFC spelling of a logical archive path. Inventory and path joins share it. */
|
|
4
|
+
export const logicalPathNfc = (value) => value.normalize("NFC");
|
|
5
|
+
/**
|
|
6
|
+
* Lexical join against an inventoried logical path. The result is NFC.
|
|
7
|
+
* `"."` is the archive root. A path that escapes the root, or that contains
|
|
8
|
+
* NUL, is left in a form the caller can report; `logicalPathEscapesRoot`
|
|
9
|
+
* is then true.
|
|
10
|
+
*/
|
|
11
|
+
export const normalizeJoinedLogicalPath = (value) => {
|
|
12
|
+
if (value.includes("\0"))
|
|
13
|
+
return value;
|
|
14
|
+
return logicalPathNfc(posix.normalize(value.replaceAll("\\", "/")).replace(/^\.\//u, ""));
|
|
15
|
+
};
|
|
16
|
+
/** Whether a joined logical path leaves the archive root. */
|
|
17
|
+
export const logicalPathEscapesRoot = (path) => path.includes("\0") ||
|
|
18
|
+
path === ".." ||
|
|
19
|
+
path.startsWith("../") ||
|
|
20
|
+
path.startsWith("/");
|
|
2
21
|
/** Content-address an artifact independently of where it was observed. */
|
|
3
|
-
export const artifactIdForContent = (sha256) => `art_${
|
|
22
|
+
export const artifactIdForContent = (sha256) => `art_${digestCanonicalValue({ sha256 }, "Artifact")}`;
|
|
4
23
|
/** Identify an occurrence by its root and exact logical location. */
|
|
5
24
|
export const occurrenceIdForLocation = (input) => input.logicalPath === "."
|
|
6
|
-
? `occ_${
|
|
7
|
-
: `occ_${
|
|
25
|
+
? `occ_${digestCanonicalValue({ root: input.rootArtifactId }, "Artifact")}`
|
|
26
|
+
: `occ_${digestCanonicalValue({
|
|
8
27
|
root_artifact_id: input.rootArtifactId,
|
|
9
28
|
logical_path: input.logicalPath,
|
|
10
29
|
entry_kind: input.entryKind,
|
|
11
30
|
}, "Artifact")}`;
|
|
12
31
|
/** Commit to graph members in the ordering established by the inventory owner. */
|
|
13
|
-
export const artifactGraphDigest = (input) =>
|
|
32
|
+
export const artifactGraphDigest = (input) => digestCanonicalValue({
|
|
14
33
|
nodes: input.nodes,
|
|
15
34
|
occurrences: input.occurrences,
|
|
16
35
|
edges: input.edges,
|
|
17
36
|
integrity_contradictions: input.contradictions,
|
|
18
37
|
}, "Artifact");
|
|
19
38
|
/** Bind a root artifact to its graph commitment. */
|
|
20
|
-
export const artifactManifestId = (rootArtifactId, graphSha256) => `agm_${
|
|
39
|
+
export const artifactManifestId = (rootArtifactId, graphSha256) => `agm_${digestCanonicalValue({ root_artifact_id: rootArtifactId, graph_sha256: graphSha256 }, "Artifact")}`;
|
|
21
40
|
/** Identify one integrity disagreement at its observed logical path. */
|
|
22
|
-
export const artifactContradictionId = (input) => `ic_${
|
|
41
|
+
export const artifactContradictionId = (input) => `ic_${digestCanonicalValue({
|
|
23
42
|
root_artifact_id: input.rootArtifactId,
|
|
24
43
|
logical_path: input.logicalPath,
|
|
25
44
|
declared_sha256: input.declaredSha256,
|
|
26
45
|
observed_sha256: input.observedSha256,
|
|
27
46
|
}, "Artifact")}`;
|
|
28
|
-
/**
|
|
29
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Identify an edge by its semantic relationship and exact occurrence. The
|
|
49
|
+
* child artifact and logical path come from that occurrence.
|
|
50
|
+
*/
|
|
51
|
+
export const artifactEdgeId = (edge, occurrence) => `edge_${digestCanonicalValue({
|
|
52
|
+
parent_artifact_id: edge.parent_artifact_id,
|
|
53
|
+
child_artifact_id: occurrence.artifact_id,
|
|
54
|
+
relation: edge.relation,
|
|
55
|
+
occurrence_id: edge.occurrence_id,
|
|
56
|
+
logical_path: occurrence.logical_path,
|
|
57
|
+
}, "Artifact")}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { artifactInventoryResultSchema, } from "./artifactGraph.js";
|
|
3
|
-
import {
|
|
3
|
+
import { digestCanonicalValue } from "./canonicalDigest.js";
|
|
4
4
|
import { uniqueSorted } from "./canonicalOrdering.js";
|
|
5
5
|
import { evidenceSchema, parseEvidence } from "./evidence.js";
|
|
6
6
|
import { jsonValueSchema } from "./jsonValue.js";
|
|
@@ -10,28 +10,11 @@ const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
|
10
10
|
const artifactIdSchema = prefixedDigestSchema("art");
|
|
11
11
|
const inspectionObservationSchema = z.strictObject({
|
|
12
12
|
observation_id: prefixedDigestSchema("aio"),
|
|
13
|
-
kind: z.enum(["root-manifest", "
|
|
13
|
+
kind: z.enum(["root-manifest", "integrity"]),
|
|
14
14
|
subject: textSchema,
|
|
15
15
|
value: jsonValueSchema,
|
|
16
16
|
evidence_id: evidenceIdSchema,
|
|
17
17
|
});
|
|
18
|
-
const inspectionRelationshipSchema = z.strictObject({
|
|
19
|
-
relationship_id: prefixedDigestSchema("air"),
|
|
20
|
-
relation: z.enum([
|
|
21
|
-
"contains",
|
|
22
|
-
"extracts",
|
|
23
|
-
"slice-of",
|
|
24
|
-
"embeds",
|
|
25
|
-
"loads",
|
|
26
|
-
"maps-source",
|
|
27
|
-
"derived-from",
|
|
28
|
-
]),
|
|
29
|
-
source_artifact_id: artifactIdSchema,
|
|
30
|
-
target_artifact_id: artifactIdSchema,
|
|
31
|
-
occurrence_id: prefixedDigestSchema("occ"),
|
|
32
|
-
logical_path: textSchema.nullable(),
|
|
33
|
-
evidence_id: evidenceIdSchema,
|
|
34
|
-
});
|
|
35
18
|
const inspectionHypothesisSchema = z.strictObject({
|
|
36
19
|
hypothesis_id: prefixedDigestSchema("aih"),
|
|
37
20
|
statement: textSchema,
|
|
@@ -83,7 +66,6 @@ export const artifactInspectionResultSchema = z.strictObject({
|
|
|
83
66
|
}))
|
|
84
67
|
.min(1),
|
|
85
68
|
observations: z.array(inspectionObservationSchema),
|
|
86
|
-
derived_relationships: z.array(inspectionRelationshipSchema),
|
|
87
69
|
hypotheses: z.array(inspectionHypothesisSchema),
|
|
88
70
|
contradictions: z.array(inspectionContradictionSchema),
|
|
89
71
|
unexplored_branches: z.array(unexploredBranchSchema),
|
|
@@ -93,8 +75,6 @@ export const artifactInspectionResultSchema = z.strictObject({
|
|
|
93
75
|
substeps_completed: z.literal(1),
|
|
94
76
|
observations_retained: z.number().int().min(0),
|
|
95
77
|
observations_omitted: z.number().int().min(0),
|
|
96
|
-
relationships_retained: z.number().int().min(0),
|
|
97
|
-
relationships_omitted: z.number().int().min(0),
|
|
98
78
|
hypotheses_retained: z.number().int().min(0),
|
|
99
79
|
hypotheses_omitted: z.number().int().min(0),
|
|
100
80
|
unexplored_branches_retained: z.number().int().min(0),
|
|
@@ -110,20 +90,17 @@ export const createArtifactInspection = (inventoryInput) => {
|
|
|
110
90
|
const inventoryEvidence = parseInventoryEvidence(inventoryInput);
|
|
111
91
|
const inventory = artifactInventoryResultSchema.parse(inventoryEvidence.normalized_result);
|
|
112
92
|
const observations = allObservations(inventory, inventoryEvidence.evidence_id);
|
|
113
|
-
const relationships = allRelationships(inventory, inventoryEvidence.evidence_id);
|
|
114
93
|
const hypotheses = allHypotheses(inventory, inventoryEvidence.evidence_id);
|
|
115
94
|
const nextProbes = probesFor(inventory);
|
|
116
95
|
const branches = allUnexploredBranches(inventory, inventoryEvidence.evidence_id, nextProbes);
|
|
117
96
|
const retained = {
|
|
118
97
|
observations,
|
|
119
|
-
relationships,
|
|
120
98
|
hypotheses,
|
|
121
99
|
branches,
|
|
122
100
|
probes: nextProbes,
|
|
123
101
|
};
|
|
124
102
|
const omissions = {
|
|
125
103
|
observations: 0,
|
|
126
|
-
relationships: 0,
|
|
127
104
|
hypotheses: 0,
|
|
128
105
|
branches: 0,
|
|
129
106
|
probes: 0,
|
|
@@ -137,7 +114,7 @@ export const createArtifactInspection = (inventoryInput) => {
|
|
|
137
114
|
},
|
|
138
115
|
substeps: [
|
|
139
116
|
{
|
|
140
|
-
substep_id: `ais_${
|
|
117
|
+
substep_id: `ais_${digestCanonicalValue({
|
|
141
118
|
operation: "inventory_artifact",
|
|
142
119
|
evidence_id: inventoryEvidence.evidence_id,
|
|
143
120
|
}, "Artifact inspection")}`,
|
|
@@ -148,7 +125,6 @@ export const createArtifactInspection = (inventoryInput) => {
|
|
|
148
125
|
},
|
|
149
126
|
],
|
|
150
127
|
observations: retained.observations,
|
|
151
|
-
derived_relationships: retained.relationships,
|
|
152
128
|
hypotheses: retained.hypotheses,
|
|
153
129
|
contradictions: contradictions(inventory, inventoryEvidence.evidence_id),
|
|
154
130
|
unexplored_branches: retained.branches,
|
|
@@ -158,8 +134,6 @@ export const createArtifactInspection = (inventoryInput) => {
|
|
|
158
134
|
substeps_completed: 1,
|
|
159
135
|
observations_retained: retained.observations.length,
|
|
160
136
|
observations_omitted: omissions.observations,
|
|
161
|
-
relationships_retained: retained.relationships.length,
|
|
162
|
-
relationships_omitted: omissions.relationships,
|
|
163
137
|
hypotheses_retained: retained.hypotheses.length,
|
|
164
138
|
hypotheses_omitted: omissions.hypotheses,
|
|
165
139
|
unexplored_branches_retained: retained.branches.length,
|
|
@@ -175,7 +149,7 @@ export const createArtifactInspection = (inventoryInput) => {
|
|
|
175
149
|
};
|
|
176
150
|
return artifactInspectionResultSchema.parse({
|
|
177
151
|
...semantic,
|
|
178
|
-
inspection_id: `ai_${
|
|
152
|
+
inspection_id: `ai_${digestCanonicalValue(semantic, "Artifact inspection")}`,
|
|
179
153
|
});
|
|
180
154
|
};
|
|
181
155
|
const parseInventoryEvidence = (input) => {
|
|
@@ -184,10 +158,10 @@ const parseInventoryEvidence = (input) => {
|
|
|
184
158
|
throw new TypeError("Artifact inspection substep requires inventory_artifact Evidence");
|
|
185
159
|
return evidence;
|
|
186
160
|
};
|
|
161
|
+
// Artifact, occurrence, and edge records stay in the nested inventory Evidence;
|
|
162
|
+
// restating each one here would repeat the complete graph in every result.
|
|
187
163
|
const allObservations = (inventory, evidenceId) => [
|
|
188
164
|
observation("root-manifest", inventory.manifest.root_artifact_id, inventory.manifest, evidenceId),
|
|
189
|
-
...inventory.nodes.map((node) => observation("artifact", node.artifact_id, node, evidenceId)),
|
|
190
|
-
...inventory.occurrences.map((occurrence) => observation("occurrence", occurrence.occurrence_id, occurrence, evidenceId)),
|
|
191
165
|
...inventory.integrity_contradictions.map((value) => observation("integrity", value.contradiction_id, value, evidenceId)),
|
|
192
166
|
];
|
|
193
167
|
const observation = (kind, subject, value, evidenceId) => {
|
|
@@ -198,24 +172,10 @@ const observation = (kind, subject, value, evidenceId) => {
|
|
|
198
172
|
evidence_id: evidenceId,
|
|
199
173
|
};
|
|
200
174
|
return {
|
|
201
|
-
observation_id: `aio_${
|
|
175
|
+
observation_id: `aio_${digestCanonicalValue(semantic, "Artifact inspection")}`,
|
|
202
176
|
...semantic,
|
|
203
177
|
};
|
|
204
178
|
};
|
|
205
|
-
const allRelationships = (inventory, evidenceId) => inventory.edges.map((edge) => {
|
|
206
|
-
const semantic = {
|
|
207
|
-
relation: edge.relation,
|
|
208
|
-
source_artifact_id: edge.parent_artifact_id,
|
|
209
|
-
target_artifact_id: edge.child_artifact_id,
|
|
210
|
-
occurrence_id: edge.occurrence_id,
|
|
211
|
-
logical_path: edge.logical_path,
|
|
212
|
-
evidence_id: evidenceId,
|
|
213
|
-
};
|
|
214
|
-
return {
|
|
215
|
-
relationship_id: `air_${canonicalDigest(semantic, "Artifact inspection")}`,
|
|
216
|
-
...semantic,
|
|
217
|
-
};
|
|
218
|
-
});
|
|
219
179
|
const allHypotheses = (inventory, evidenceId) => {
|
|
220
180
|
const statements = inventory.manifest.root_format === "pe"
|
|
221
181
|
? [
|
|
@@ -234,7 +194,7 @@ const allHypotheses = (inventory, evidenceId) => {
|
|
|
234
194
|
limitation: "Format classification proposes a bounded follow-up; it is not semantic proof.",
|
|
235
195
|
};
|
|
236
196
|
return {
|
|
237
|
-
hypothesis_id: `aih_${
|
|
197
|
+
hypothesis_id: `aih_${digestCanonicalValue(semantic, "Artifact inspection")}`,
|
|
238
198
|
...semantic,
|
|
239
199
|
};
|
|
240
200
|
});
|
|
@@ -248,7 +208,7 @@ const contradictions = (inventory, evidenceId) => inventory.integrity_contradict
|
|
|
248
208
|
evidence_id: evidenceId,
|
|
249
209
|
};
|
|
250
210
|
return {
|
|
251
|
-
contradiction_id: `aic_${
|
|
211
|
+
contradiction_id: `aic_${digestCanonicalValue(semantic, "Artifact inspection")}`,
|
|
252
212
|
...semantic,
|
|
253
213
|
};
|
|
254
214
|
});
|
|
@@ -308,7 +268,7 @@ const branch = (reason, detail, nextProbe, evidenceId) => {
|
|
|
308
268
|
evidence_id: evidenceId,
|
|
309
269
|
};
|
|
310
270
|
return {
|
|
311
|
-
branch_id: `aib_${
|
|
271
|
+
branch_id: `aib_${digestCanonicalValue(semantic, "Artifact inspection")}`,
|
|
312
272
|
...semantic,
|
|
313
273
|
};
|
|
314
274
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Caller choice for declared-versus-observed artifact integrity mismatches.
|
|
4
|
+
*
|
|
5
|
+
* `fail` rejects the operation; `record-and-continue` keeps the observed bytes
|
|
6
|
+
* as explicitly untrusted Evidence and reports each contradiction.
|
|
7
|
+
*/
|
|
8
|
+
export const artifactIntegrityPolicySchema = z
|
|
9
|
+
.enum(["fail", "record-and-continue"])
|
|
10
|
+
.default("fail");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { artifactInventoryResultSchema, } from "./artifactGraph.js";
|
|
2
|
-
import {
|
|
2
|
+
import { compareUnicodeCodePoints } from "./unicodeCodePointOrder.js";
|
|
3
3
|
import { canonicalJson } from "./comparisonSemantics.js";
|
|
4
4
|
import { artifactContradictionId, artifactEdgeId, artifactGraphDigest, artifactIdForContent, artifactManifestId, occurrenceIdForLocation, } from "./artifactIdentity.js";
|
|
5
5
|
import { parseEvidence } from "./evidence.js";
|
|
@@ -68,9 +68,9 @@ const assembleInventorySet = (pages) => {
|
|
|
68
68
|
return { evidence: pages.map(({ evidence }) => evidence), inventory };
|
|
69
69
|
};
|
|
70
70
|
const orderedInventory = (first, pages, values) => {
|
|
71
|
-
const nodes = [...values.nodes.values()].sort((left, right) =>
|
|
72
|
-
const occurrences = [...values.occurrences.values()].sort((left, right) =>
|
|
73
|
-
const edges = [...values.edges.values()].sort((left, right) =>
|
|
71
|
+
const nodes = [...values.nodes.values()].sort((left, right) => compareUnicodeCodePoints(left.artifact_id, right.artifact_id));
|
|
72
|
+
const occurrences = [...values.occurrences.values()].sort((left, right) => compareUnicodeCodePoints(left.logical_path, right.logical_path));
|
|
73
|
+
const edges = [...values.edges.values()].sort((left, right) => compareUnicodeCodePoints(left.edge_id, right.edge_id));
|
|
74
74
|
return {
|
|
75
75
|
manifest: first.manifest,
|
|
76
76
|
nodes,
|
|
@@ -79,7 +79,7 @@ const orderedInventory = (first, pages, values) => {
|
|
|
79
79
|
integrityContradictions: first.integrity_contradictions,
|
|
80
80
|
limitations: [
|
|
81
81
|
...new Set(pages.flatMap(({ inventory }) => inventory.limitations)),
|
|
82
|
-
].sort(
|
|
82
|
+
].sort(compareUnicodeCodePoints),
|
|
83
83
|
complete: nodes.length === first.manifest.node_count &&
|
|
84
84
|
occurrences.length === first.manifest.occurrence_count &&
|
|
85
85
|
edges.length === first.manifest.edge_count,
|
|
@@ -97,8 +97,12 @@ const validateCompleteInventory = (inventory) => {
|
|
|
97
97
|
throw new TypeError("Artifact root occurrence does not match its manifest representation");
|
|
98
98
|
for (const occurrence of inventory.occurrences)
|
|
99
99
|
validateOccurrence(occurrence, inventory, nodeIds, occurrenceIds);
|
|
100
|
+
const occurrencesById = new Map(inventory.occurrences.map((occurrence) => [
|
|
101
|
+
occurrence.occurrence_id,
|
|
102
|
+
occurrence,
|
|
103
|
+
]));
|
|
100
104
|
for (const edge of inventory.edges)
|
|
101
|
-
validateEdge(edge, nodeIds,
|
|
105
|
+
validateEdge(edge, nodeIds, occurrencesById);
|
|
102
106
|
for (const contradiction of inventory.integrityContradictions) {
|
|
103
107
|
if (!nodeIds.has(contradiction.parent_artifact_id) ||
|
|
104
108
|
!occurrenceIds.has(contradiction.occurrence_id))
|
|
@@ -138,19 +142,14 @@ const validateOccurrence = (occurrence, inventory, nodeIds, occurrenceIds) => {
|
|
|
138
142
|
if (occurrence.occurrence_id !== expectedId)
|
|
139
143
|
throw new TypeError("Artifact occurrence ID does not match its identity");
|
|
140
144
|
};
|
|
141
|
-
const validateEdge = (edge, nodeIds,
|
|
145
|
+
const validateEdge = (edge, nodeIds, occurrences) => {
|
|
146
|
+
const occurrence = occurrences.get(edge.occurrence_id);
|
|
142
147
|
if (!nodeIds.has(edge.parent_artifact_id) ||
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
occurrence?.artifact_id === null ||
|
|
149
|
+
occurrence === undefined ||
|
|
150
|
+
!nodeIds.has(occurrence.artifact_id))
|
|
145
151
|
throw new TypeError("Artifact edge references a missing graph member");
|
|
146
|
-
|
|
147
|
-
parent_artifact_id: edge.parent_artifact_id,
|
|
148
|
-
child_artifact_id: edge.child_artifact_id,
|
|
149
|
-
relation: edge.relation,
|
|
150
|
-
occurrence_id: edge.occurrence_id,
|
|
151
|
-
logical_path: edge.logical_path,
|
|
152
|
-
};
|
|
153
|
-
if (edge.edge_id !== artifactEdgeId(semantic))
|
|
152
|
+
if (edge.edge_id !== artifactEdgeId(edge, occurrence))
|
|
154
153
|
throw new TypeError("Artifact edge ID does not match its identity");
|
|
155
154
|
};
|
|
156
155
|
const mergeExact = (output, key, value, label) => {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Policy divergence (deliberate, not yet unified):
|
|
7
7
|
* - Local artifact paths resolve against an inventoried container root and
|
|
8
8
|
* report rejected | external | not-found. Confinement is lexical
|
|
9
|
-
* (
|
|
9
|
+
* (normalizeJoinedLogicalPath must stay inside the root).
|
|
10
10
|
* - Live DOM destinations resolve against the document base URL and report
|
|
11
11
|
* approved | outside_policy | unsupported against allowedOrigins
|
|
12
12
|
* (see CdpCaptureDocuments.domDestination).
|
|
@@ -103,6 +103,20 @@ const parseElf = (bytes, fileSize) => {
|
|
|
103
103
|
const architecture = elfArchitecture(machine);
|
|
104
104
|
if (architecture === undefined)
|
|
105
105
|
return err("unsupported ELF architecture");
|
|
106
|
+
if (architecture === "mips")
|
|
107
|
+
return ok({
|
|
108
|
+
format: "elf",
|
|
109
|
+
architecture,
|
|
110
|
+
availableArchitectures: [architecture],
|
|
111
|
+
mips: {
|
|
112
|
+
elfClass: bytes[4] === 1 ? 32 : 64,
|
|
113
|
+
byteOrder: little ? "little" : "big",
|
|
114
|
+
type: little ? bytes.readUInt16LE(16) : bytes.readUInt16BE(16),
|
|
115
|
+
flags: little
|
|
116
|
+
? bytes.readUInt32LE(bytes[4] === 1 ? 36 : 48)
|
|
117
|
+
: bytes.readUInt32BE(bytes[4] === 1 ? 36 : 48),
|
|
118
|
+
},
|
|
119
|
+
});
|
|
106
120
|
return ok({
|
|
107
121
|
format: "elf",
|
|
108
122
|
architecture,
|
|
@@ -197,6 +211,8 @@ const elfArchitecture = (machine) => {
|
|
|
197
211
|
return "x86";
|
|
198
212
|
case 62:
|
|
199
213
|
return "x86_64";
|
|
214
|
+
case 8: // EM_MIPS: ISA, ABI and byte order remain separate ELF facts.
|
|
215
|
+
return "mips";
|
|
200
216
|
case 40:
|
|
201
217
|
return "arm";
|
|
202
218
|
case 183:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { compareUnicodeCodePoints } from "./unicodeCodePointOrder.js";
|
|
2
3
|
/** Stable browser sections used by coverage and omission accounting. */
|
|
3
4
|
const browserSectionSchema = z.enum([
|
|
4
5
|
"frames",
|
|
@@ -98,5 +99,5 @@ export const classifyBrowserCompleteness = (input) => {
|
|
|
98
99
|
});
|
|
99
100
|
};
|
|
100
101
|
const sortedSections = (sections) => [...sections].sort();
|
|
101
|
-
const canonicalExclusions = (exclusions) => [...exclusions].sort((left, right) => left.section
|
|
102
|
-
left.reason
|
|
102
|
+
const canonicalExclusions = (exclusions) => [...exclusions].sort((left, right) => compareUnicodeCodePoints(left.section, right.section) ||
|
|
103
|
+
compareUnicodeCodePoints(left.reason, right.reason));
|
|
@@ -159,11 +159,10 @@ const browserConsoleEventSchema = z.object({
|
|
|
159
159
|
retained_bytes: z.number().int().min(0),
|
|
160
160
|
}),
|
|
161
161
|
});
|
|
162
|
-
const
|
|
163
|
-
request_id: z.string(),
|
|
162
|
+
const browserWebSocketFrameSchema = z.object({
|
|
164
163
|
direction: z.enum(["sent", "received"]),
|
|
165
164
|
opcode: z.number().int().min(0),
|
|
166
|
-
payload_bytes: z.number().int().min(0),
|
|
165
|
+
payload_bytes: z.number().int().min(0).nullable(),
|
|
167
166
|
payload_shape: z
|
|
168
167
|
.object({
|
|
169
168
|
format: z.enum(["json", "text", "binary"]),
|
|
@@ -171,6 +170,11 @@ const browserWebSocketEventSchema = z.object({
|
|
|
171
170
|
})
|
|
172
171
|
.nullable(),
|
|
173
172
|
});
|
|
173
|
+
const browserWebSocketConnectionSchema = z.object({
|
|
174
|
+
request_id: z.string(),
|
|
175
|
+
url: z.string(),
|
|
176
|
+
events: z.array(browserWebSocketFrameSchema),
|
|
177
|
+
});
|
|
174
178
|
const browserWorkerSchema = z.object({
|
|
175
179
|
target_id: z.string(),
|
|
176
180
|
type: z.string(),
|
|
@@ -275,7 +279,7 @@ export const webPageInspectionSchema = z.object({
|
|
|
275
279
|
resources: z.array(browserResourceSchema),
|
|
276
280
|
network: z.object({
|
|
277
281
|
requests: z.array(browserNetworkRequestSchema),
|
|
278
|
-
|
|
282
|
+
websocket_connections: z.array(browserWebSocketConnectionSchema),
|
|
279
283
|
coverage_started_at: z.iso.datetime(),
|
|
280
284
|
prior_activity_available: z.literal(false),
|
|
281
285
|
}),
|
|
@@ -103,8 +103,8 @@ const eventBase = {
|
|
|
103
103
|
const eventUrl = sanitizedBrowserUrlSchema.nullable();
|
|
104
104
|
const networkEventShape = {
|
|
105
105
|
...eventBase,
|
|
106
|
-
transaction_id: z.string().min(1)
|
|
107
|
-
redirected_from_transaction_id: z.string().min(1).nullable()
|
|
106
|
+
transaction_id: z.string().min(1),
|
|
107
|
+
redirected_from_transaction_id: z.string().min(1).nullable(),
|
|
108
108
|
method: z.string().min(1),
|
|
109
109
|
url: sanitizedBrowserUrlSchema,
|
|
110
110
|
resource_type: z.string().min(1),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { digestCanonicalValue } from "./canonicalDigest.js";
|
|
2
2
|
const BUILT_IN_RULES = [
|
|
3
3
|
"ignore_step_elapsed_ms",
|
|
4
4
|
"ignore_event_sequence",
|
|
@@ -17,11 +17,11 @@ export const commitBrowserScenarioNormalization = (input) => {
|
|
|
17
17
|
const commitment = { built_in_rules: [...BUILT_IN_RULES], rules };
|
|
18
18
|
return {
|
|
19
19
|
...commitment,
|
|
20
|
-
sha256:
|
|
20
|
+
sha256: digestCanonicalValue(commitment, "Browser scenario"),
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
/** Digest one artifact after applying committed exact-literal rules. */
|
|
24
|
-
export const digestNormalizedScenarioValue = (value, artifact, rules) =>
|
|
24
|
+
export const digestNormalizedScenarioValue = (value, artifact, rules) => digestCanonicalValue(normalize(value, artifact, rules), "Browser scenario");
|
|
25
25
|
const normalize = (value, artifact, rules) => {
|
|
26
26
|
if (artifact === "screenshot")
|
|
27
27
|
return value;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { isAbsolute } from "node:path";
|
|
2
3
|
import { IDENTIFIER_PATTERN } from "./stringPatterns.js";
|
|
3
|
-
import {
|
|
4
|
+
import { localPathStringSchema } from "./localPath.js";
|
|
4
5
|
import { browserNetworkContentSelectionSchema } from "./browserNetworkEvidence.js";
|
|
5
6
|
import { browserEndpointSchema, browserOriginSchema, } from "./browserObservation.js";
|
|
6
7
|
export const scenarioIdentifierSchema = z.string().regex(IDENTIFIER_PATTERN);
|
|
7
|
-
const browserExecutablePathSchema = localPathStringSchema.refine(
|
|
8
|
+
const browserExecutablePathSchema = localPathStringSchema.refine(isAbsolute, {
|
|
8
9
|
message: "executable_path must be an absolute local filesystem path (for example /opt/chromium/chrome or C:\\chromium\\chrome.exe)",
|
|
9
10
|
});
|
|
10
11
|
const browserScenarioBaseUrlSchema = z
|
package/dist/domain/callPath.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { callPathInputSchema, callPathResultSchema, parseCallPathAddress, } from "./callPathSchemas.js";
|
|
2
2
|
import { parseFunctionEvidence, } from "./functionDossierEvidence.js";
|
|
3
|
+
import { compareUnicodeCodePoints } from "./unicodeCodePointOrder.js";
|
|
3
4
|
/** Minimal directed caller-to-callee adjacency for call-path search. */
|
|
4
5
|
class CallGraph {
|
|
5
6
|
successors = new Map();
|
|
@@ -76,7 +77,7 @@ export const buildCallPath = (input) => {
|
|
|
76
77
|
goal: parsed.goal.address,
|
|
77
78
|
explored: summarizeSearch(graph, search.reached),
|
|
78
79
|
evidence_links: uniqueEvidence(snapshots.values()),
|
|
79
|
-
limitations: [...new Set(limitations)].sort(
|
|
80
|
+
limitations: [...new Set(limitations)].sort(compareUnicodeCodePoints),
|
|
80
81
|
};
|
|
81
82
|
const searchScope = { exhaustive };
|
|
82
83
|
if (found)
|
|
@@ -111,9 +112,9 @@ const parseSnapshots = (groups) => {
|
|
|
111
112
|
const snapshots = new Map();
|
|
112
113
|
for (const group of groups) {
|
|
113
114
|
const snapshot = parseFunctionEvidence(group);
|
|
114
|
-
const address =
|
|
115
|
+
const address = parseCallPathAddress(snapshot.dossier.procedure.address);
|
|
115
116
|
for (const callee of snapshot.dossier.callees)
|
|
116
|
-
|
|
117
|
+
parseCallPathAddress(callee.address);
|
|
117
118
|
if (snapshots.has(address))
|
|
118
119
|
throw new TypeError(`Duplicate function Evidence for ${address}`);
|
|
119
120
|
snapshots.set(address, snapshot);
|
|
@@ -141,7 +142,7 @@ const createGraph = (snapshots) => {
|
|
|
141
142
|
for (const [address, snapshot] of snapshots) {
|
|
142
143
|
graph.mergeNode(address);
|
|
143
144
|
for (const callee of snapshot.dossier.callees) {
|
|
144
|
-
const calleeAddress =
|
|
145
|
+
const calleeAddress = parseCallPathAddress(callee.address);
|
|
145
146
|
graph.mergeNode(calleeAddress);
|
|
146
147
|
graph.mergeDirectedEdge(address, calleeAddress);
|
|
147
148
|
}
|
|
@@ -174,9 +175,7 @@ const inspectSearch = ({ graph, snapshots, start, goal, }) => {
|
|
|
174
175
|
limitations.push(`No analyze_function Evidence covers reachable function ${node}`);
|
|
175
176
|
continue;
|
|
176
177
|
}
|
|
177
|
-
const neighbors = graph
|
|
178
|
-
.outNeighbors(node)
|
|
179
|
-
.sort((left, right) => left.localeCompare(right));
|
|
178
|
+
const neighbors = graph.outNeighbors(node).sort(compareUnicodeCodePoints);
|
|
180
179
|
for (const neighbor of neighbors)
|
|
181
180
|
if (!reached.has(neighbor)) {
|
|
182
181
|
reached.set(neighbor, depth + 1);
|
|
@@ -203,7 +202,7 @@ const enumeratePaths = ({ graph, start, goal, goalDistances, }) => {
|
|
|
203
202
|
.outNeighbors(node)
|
|
204
203
|
.filter((neighbor) => distance !== undefined &&
|
|
205
204
|
goalDistances.get(neighbor) === distance - 1)
|
|
206
|
-
.sort(
|
|
205
|
+
.sort(compareUnicodeCodePoints);
|
|
207
206
|
neighbors.set(node, candidates);
|
|
208
207
|
}
|
|
209
208
|
return { neighbors: candidates, nextIndex: 0 };
|
|
@@ -270,5 +269,4 @@ const snapshotLinks = (snapshot) => {
|
|
|
270
269
|
};
|
|
271
270
|
const uniqueEvidence = (snapshots) => [
|
|
272
271
|
...new Set([...snapshots].flatMap((snapshot) => snapshotLinks(snapshot))),
|
|
273
|
-
].sort(
|
|
274
|
-
const normalizeAddress = (input) => parseCallPathAddress(input);
|
|
272
|
+
].sort(compareUnicodeCodePoints);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Streaming SHA-256 over canonical JSON. Hashing owner (avoids assembling
|
|
4
|
+
* aggregate strings); `comparisonSemantics.canonicalJson` (canonicalize lib)
|
|
5
|
+
* is the string-comparison owner. JSON object keys follow RFC 8785's UTF-16
|
|
6
|
+
* code-unit order in both; entity-list ordering is a separate concern.
|
|
7
|
+
*/
|
|
3
8
|
export const digestCanonicalValue = (value, context = "Comparison") => {
|
|
4
9
|
const hash = createHash("sha256");
|
|
5
10
|
// Batch small emitted parts to cut hash.update crossings.
|
|
@@ -54,6 +59,7 @@ const emitCanonical = (value, emit, ancestors) => {
|
|
|
54
59
|
else {
|
|
55
60
|
emit("{");
|
|
56
61
|
let first = true;
|
|
62
|
+
// Match canonicalize/RFC 8785, including supplementary-plane keys.
|
|
57
63
|
for (const key of Object.keys(value).sort()) {
|
|
58
64
|
if (Reflect.get(value, key) === undefined ||
|
|
59
65
|
typeof Reflect.get(value, key) === "symbol")
|
|
@@ -4,6 +4,9 @@ export function* canonicalJsonDigestSteps(value) {
|
|
|
4
4
|
const hash = createHash("sha256");
|
|
5
5
|
const ancestors = new Set();
|
|
6
6
|
const stack = [{ kind: "value", value }];
|
|
7
|
+
const encodedKeys = new Map();
|
|
8
|
+
// Keep reusable key encodings within one existing digest-buffer quantum.
|
|
9
|
+
let remainingKeyCodeUnits = 8192;
|
|
7
10
|
let buffered = "";
|
|
8
11
|
let flushed = false;
|
|
9
12
|
const emit = (part) => {
|
|
@@ -46,21 +49,22 @@ export function* canonicalJsonDigestSteps(value) {
|
|
|
46
49
|
stack.push(frame);
|
|
47
50
|
continue;
|
|
48
51
|
}
|
|
52
|
+
let item;
|
|
49
53
|
if (frame.kind === "array") {
|
|
50
54
|
if (frame.index === frame.length) {
|
|
51
55
|
emit("]");
|
|
52
56
|
ancestors.delete(frame.value);
|
|
53
57
|
continue;
|
|
54
58
|
}
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
59
|
+
const element = frame.value[frame.index];
|
|
60
|
+
if (element === undefined)
|
|
57
61
|
throw new TypeError("Canonical JSON digest requires dense JSON arrays");
|
|
58
62
|
if (frame.index++ > 0)
|
|
59
63
|
emit(",");
|
|
60
|
-
stack.push(frame
|
|
61
|
-
|
|
64
|
+
stack.push(frame);
|
|
65
|
+
item = element;
|
|
62
66
|
}
|
|
63
|
-
if (frame.kind === "object") {
|
|
67
|
+
else if (frame.kind === "object") {
|
|
64
68
|
if (frame.index === frame.keys.length) {
|
|
65
69
|
emit("}");
|
|
66
70
|
ancestors.delete(frame.value);
|
|
@@ -69,22 +73,39 @@ export function* canonicalJsonDigestSteps(value) {
|
|
|
69
73
|
const key = frame.keys[frame.index++];
|
|
70
74
|
if (key === undefined)
|
|
71
75
|
throw new TypeError("Canonical JSON object changed during hashing");
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
76
|
+
const property = frame.value[key];
|
|
77
|
+
if (property === undefined) {
|
|
78
|
+
stack.push(frame);
|
|
74
79
|
continue;
|
|
80
|
+
}
|
|
75
81
|
if (frame.written++ > 0)
|
|
76
82
|
emit(",");
|
|
77
83
|
if (key.length > 8192) {
|
|
78
84
|
emit('"');
|
|
79
|
-
stack.push(frame, { kind: "value", value:
|
|
85
|
+
stack.push(frame, { kind: "value", value: property }, { kind: "separator" }, { kind: "string", value: key, index: 0 });
|
|
80
86
|
continue;
|
|
81
87
|
}
|
|
82
|
-
|
|
88
|
+
let encodedKey = encodedKeys.get(key);
|
|
89
|
+
if (encodedKey === undefined) {
|
|
90
|
+
encodedKey = JSON.stringify(key);
|
|
91
|
+
if (encodedKey.length <= remainingKeyCodeUnits) {
|
|
92
|
+
encodedKeys.set(key, encodedKey);
|
|
93
|
+
remainingKeyCodeUnits -= encodedKey.length;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
emit(encodedKey);
|
|
83
97
|
emit(":");
|
|
84
|
-
stack.push(frame
|
|
85
|
-
|
|
98
|
+
stack.push(frame);
|
|
99
|
+
item = property;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
item = frame.value;
|
|
103
|
+
}
|
|
104
|
+
// Resume containers directly; scalar members need no temporary value frame.
|
|
105
|
+
if (flushed) {
|
|
106
|
+
flushed = false;
|
|
107
|
+
yield;
|
|
86
108
|
}
|
|
87
|
-
const item = frame.value;
|
|
88
109
|
if (typeof item === "string" && item.length > 8192) {
|
|
89
110
|
emit('"');
|
|
90
111
|
stack.push({ kind: "string", value: item, index: 0 });
|
|
@@ -128,6 +149,7 @@ export function* canonicalJsonDigestSteps(value) {
|
|
|
128
149
|
finally {
|
|
129
150
|
stack.length = 0;
|
|
130
151
|
ancestors.clear();
|
|
152
|
+
encodedKeys.clear();
|
|
131
153
|
buffered = "";
|
|
132
154
|
}
|
|
133
155
|
}
|