rea-agents 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -17
- package/bridge/android/ReaJadxBridge.java +14 -5
- package/bridge/ghidra/ReaGhidraBridge.java +173 -47
- package/bridge/hopper_bridge.py +310 -128
- package/bridge/mitmproxy/capture.py +0 -2
- package/bridge/native/rea_lldb_tracer.py +630 -94
- package/bridge/process/ProcessRunTokenReader.swift +39 -5
- package/bridge/pwntools/recorded_crash_impl.py +4 -0
- package/dist/android/JadxConfiguration.js +196 -33
- package/dist/android/JadxMcpTransport.js +4 -0
- package/dist/android/JadxProtocol.js +6 -0
- package/dist/android/JadxProvider.js +19 -2
- package/dist/android/JadxSession.js +23 -4
- package/dist/application/AnalysisContextQueries.js +8 -35
- package/dist/application/AnalysisDocument.js +32 -0
- package/dist/application/AppBundleExecutable.js +67 -21
- package/dist/application/CallPathTracing.js +19 -3
- package/dist/application/CapabilityInventory.js +6 -3
- package/dist/application/ClientConfigurationDocument.js +871 -6
- package/dist/application/ClientRegistrationIdentity.js +26 -5
- package/dist/application/ClientRegistrationStatus.js +29 -14
- package/dist/application/DirectAnalysis.js +27 -37
- package/dist/application/Doctor.js +4 -2
- package/dist/application/DoctorScope.js +25 -13
- package/dist/application/EnhancedLiteralTracing.js +22 -25
- package/dist/application/EnhancedTools.js +13 -11
- package/dist/application/EvidenceBundleFiles.js +23 -11
- package/dist/application/FunctionAnalysisEvidence.js +2 -3
- package/dist/application/InventoryProjectionEvidence.js +4 -3
- package/dist/application/InvestigationProviders.js +3 -2
- package/dist/application/JsonFiles.js +50 -28
- package/dist/application/ProcedureAddressResolution.js +11 -0
- package/dist/application/ReconstructionCoverageService.js +7 -4
- package/dist/application/ReconstructionObligationLedgerService.js +4 -3
- package/dist/application/Setup.js +13 -1
- package/dist/application/SetupClientConfiguration.js +10 -15
- package/dist/application/SetupHost.js +5 -2
- package/dist/application/SetupPlan.js +5 -3
- package/dist/application/SupportedClients.js +34 -1
- package/dist/application/Uninstall.js +4 -3
- package/dist/application/Update.js +18 -3
- package/dist/application/UpdateRuntime.js +46 -25
- package/dist/application/WebModuleTraceService.js +4 -2
- package/dist/application/WebNetworkCaptureService.js +4 -2
- package/dist/application/WebRuntimeService.js +5 -3
- package/dist/application/WebScriptExportService.js +2 -2
- package/dist/application/WebSourceLocationService.js +4 -2
- package/dist/application/WorkflowEvidence.js +82 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +21 -5
- package/dist/application/binary/AnalysisProviderRegistry.js +2 -0
- package/dist/application/binary/AnalysisSnapshotCache.js +3 -6
- package/dist/application/binary/BinarySession.js +95 -68
- package/dist/application/binary/BinarySessionOpen.js +3 -3
- package/dist/application/binary/BinarySessionRecords.js +25 -3
- package/dist/application/binary/BinarySessionStatus.js +17 -1
- package/dist/application/binary/CompositeProvider.js +13 -0
- package/dist/application/binary/LazyAnalysisProvider.js +3 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +4 -2
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +4 -2
- package/dist/application/evm/EvmInterfaceService.js +4 -2
- package/dist/application/investigation/EvidenceLedger.js +21 -7
- package/dist/application/investigation/InvestigationRecords.js +8 -0
- package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +24 -3
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +19 -2
- package/dist/application/javascript/JavaScriptApplicationService.js +22 -15
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +5 -5
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +5 -4
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +39 -7
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +6 -3
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +11 -3
- package/dist/application/javascript/JavaScriptModuleRelationships.js +37 -8
- package/dist/application/javascript/JavaScriptRecoveryService.js +4 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +3 -1
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +63 -61
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +23 -1
- package/dist/application/managed/ManagedApplicationGraphService.js +4 -3
- package/dist/application/managed/ManagedMemberComparisonService.js +7 -4
- package/dist/application/managed/ManagedNativeVerificationService.js +4 -3
- package/dist/application/managed/ManagedReconstructionService.js +4 -3
- package/dist/application/process/ProcessCli.js +14 -6
- package/dist/application/process/ProcessEvidence.js +4 -3
- package/dist/application/workflowInputError.js +18 -0
- package/dist/artifacts/ArtifactProvider.js +12 -2
- package/dist/artifacts/MachOSliceArtifactReader.js +98 -14
- package/dist/artifacts/NativeDmgArtifactReader.js +13 -6
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +22 -3
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +176 -56
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +195 -0
- package/dist/artifacts/apple/KeyedArchiveReader.js +36 -22
- package/dist/artifacts/apple/MachoLoadCommandReader.js +92 -31
- package/dist/artifacts/apple/NibArchive.js +81 -14
- package/dist/artifacts/apple/NibViewHierarchy.js +10 -3
- package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +13 -8
- package/dist/artifacts/inventory/scanCanonical.js +11 -14
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +6 -2
- package/dist/browser/CdpCaptureCompleteness.js +2 -0
- package/dist/browser/CdpCaptureEventHandlers.js +76 -11
- package/dist/browser/CdpCaptureEventTypes.js +5 -1
- package/dist/browser/CdpCaptureEvents.js +25 -0
- package/dist/browser/CdpConnection.js +30 -11
- package/dist/browser/CdpOptionalCommand.js +2 -3
- package/dist/browser/CdpPageCapture.js +23 -1
- package/dist/browser/PlaywrightElectronActiveActions.js +32 -23
- package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +123 -124
- package/dist/browser/WebSourceMapFetcher.js +426 -72
- package/dist/browser/assets/LocalWebScriptArtifacts.js +2 -2
- package/dist/browser/history/CaptureFailures.js +37 -1
- package/dist/browser/history/CaptureRelease.js +5 -0
- package/dist/browser/history/HarCaptureAdapter.js +3 -3
- package/dist/browser/history/HarJson.js +3 -2
- package/dist/browser/history/HistoricalCaptureDecoder.js +4 -2
- package/dist/cli/analysisSelector.js +23 -0
- package/dist/cli/applicationCommands.js +2 -3
- package/dist/cli/coreBinaryCommands.js +70 -12
- package/dist/cli/electronCommands.js +7 -6
- package/dist/cli/javascriptApplicationAnalysis.js +7 -3
- package/dist/cli/jsonOutput.js +4 -99
- package/dist/cli/nativeCallCommands.js +2 -3
- package/dist/cli/webRuntimeCommands.js +8 -8
- package/dist/cli.js +2 -1
- package/dist/cliCommandNames.js +0 -1
- package/dist/cliJsonInput.js +9 -4
- package/dist/config/environment.js +4 -0
- package/dist/config/ghidraStartupTimeout.js +17 -0
- package/dist/config/mcpResponseBudget.js +22 -0
- package/dist/config/parseConfig.js +2 -1
- package/dist/contracts/enhancedInputs.js +5 -3
- package/dist/contracts/enhancedToolContracts.js +3 -3
- package/dist/contracts/hopperMemoryContracts.js +2 -5
- package/dist/contracts/javascript/electronToolContracts.js +1 -1
- package/dist/contracts/managed/managedToolContracts.js +2 -4
- package/dist/contracts/native/nativeToolContracts.js +4 -2
- package/dist/contracts/officialToolContracts.js +14 -15
- package/dist/contracts/promptContracts.js +3 -3
- package/dist/contracts/sessionLifecycleInputs.js +3 -7
- package/dist/contracts/sessionStatusContract.js +2 -4
- package/dist/contracts/sessionToolContracts.js +4 -6
- package/dist/contracts/sessionToolSchemas.js +2 -5
- package/dist/contracts/toolContractExamples.js +0 -1
- package/dist/contracts/toolContractHelpers.js +4 -1
- package/dist/contracts/toolEffects.js +0 -1
- package/dist/contracts/toolOutputSchemaGroups.js +28 -27
- package/dist/contracts/toolOutputSchemaPrimitives.js +18 -0
- package/dist/contracts/toolSchemaMetadata.js +69 -10
- package/dist/contracts/webNetworkCaptureToolContracts.js +1 -1
- package/dist/domain/analysisErrorBase.js +8 -3
- package/dist/domain/analysisErrorCore.js +3 -1
- package/dist/domain/analysisErrorPresentation.js +72 -17
- package/dist/domain/analysisErrorProjection.js +106 -27
- package/dist/domain/android/androidAnalysis.js +2 -4
- package/dist/domain/android/androidApplication.js +17 -9
- package/dist/domain/apple/appleApplication.js +41 -14
- package/dist/domain/apple/dyldEnvironment.js +73 -0
- package/dist/domain/apple/dylibResolution.js +120 -9
- package/dist/domain/apple/dylibResolutionFindings.js +9 -7
- package/dist/domain/apple/interfaceBuilderGraph.js +25 -13
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +13 -3
- package/dist/domain/apple/keyedArchive.js +9 -1
- package/dist/domain/apple/machoContainer.js +54 -0
- package/dist/domain/apple/plistNumbers.js +76 -0
- package/dist/domain/artifactIdentity.js +29 -0
- package/dist/domain/artifactInventoryEvidence.js +19 -24
- package/dist/domain/bridgeCandidateProjection.js +71 -0
- package/dist/domain/browserCompleteness.js +1 -0
- package/dist/domain/browserObservationError.js +24 -5
- package/dist/domain/browserScenarioValues.js +2 -6
- package/dist/domain/bundleComparison.js +3 -2
- package/dist/domain/canonicalJsonDigestSteps.js +133 -0
- package/dist/domain/canonicalOrdering.js +9 -5
- package/dist/domain/changedBehavior.js +6 -6
- package/dist/domain/comparisonSourceEvidence.js +40 -0
- package/dist/domain/configurationErrors.js +1 -1
- package/dist/domain/evidence.js +64 -9
- package/dist/domain/evidenceBundle.js +42 -1
- package/dist/domain/evidenceErrors.js +12 -1
- package/dist/domain/explicitSensitiveFailure.js +17 -1
- package/dist/domain/firmware/firmwareAnalysis.js +6 -7
- package/dist/domain/hopperErrors.js +23 -2
- package/dist/domain/hopperValues.js +51 -8
- package/dist/domain/immutableJson.js +114 -0
- package/dist/domain/inputIssueProjection.js +3 -0
- package/dist/domain/javascript/electronActiveObservation.js +30 -4
- package/dist/domain/javascript/electronStaticAnalysisValues.js +6 -12
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +71 -23
- package/dist/domain/javascript/javascriptApplicationGraph.js +13 -0
- package/dist/domain/javascript/javascriptAstValues.js +20 -0
- package/dist/domain/javascript/javascriptRecovery.js +3 -8
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +97 -2
- package/dist/domain/javascript/javascriptSemanticCoverage.js +6 -5
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +9 -17
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +22 -5
- package/dist/domain/javascript/javascriptSemanticGraph.js +13 -0
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +1 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +25 -17
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -4
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
- package/dist/domain/javascript/javascriptSemanticValues.js +83 -11
- package/dist/domain/javascript/javascriptSourceParser.js +6 -2
- package/dist/domain/javascript/javascriptStaticAnalysis.js +22 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +5 -3
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +14 -4
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +66 -7
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +28 -16
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +3 -2
- package/dist/domain/jsonSerialization.js +109 -0
- package/dist/domain/jsonValue.js +90 -6
- package/dist/domain/localPath.js +6 -0
- package/dist/domain/managed/managedApplicationGraph.js +10 -10
- package/dist/domain/managed/managedInspectionEvidence.js +16 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +5 -9
- package/dist/domain/managed/managedNativeVerification.js +3 -9
- package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
- package/dist/domain/native/nativeCallObservation.js +33 -11
- package/dist/domain/native/nativeCallPartialObservation.js +33 -0
- package/dist/domain/process/processCapture.js +8 -4
- package/dist/domain/process/processComparison.js +38 -4
- package/dist/domain/process/processScenario.js +11 -10
- package/dist/domain/propertyListKeys.js +1 -1
- package/dist/domain/propertyListXmlText.js +19 -0
- package/dist/domain/providerAdapterError.js +1 -1
- package/dist/domain/providerOperationHealth.js +54 -0
- package/dist/domain/reconstructionVerification.js +6 -43
- package/dist/domain/reconstructionVerificationSchemas.js +2 -2
- package/dist/domain/staticRuntimeCorrelation.js +6 -43
- package/dist/domain/webBundleAnalysis.js +20 -8
- package/dist/domain/webBundleAnalyzerInspection.js +13 -8
- package/dist/domain/webBundleAnalyzerResult.js +41 -2
- package/dist/domain/webRuntime.js +19 -5
- package/dist/domain/webSourceLocation.js +1 -0
- package/dist/firmware/FirmwareFiles.js +1 -1
- package/dist/generatedPackageMetadata.js +1 -1
- package/dist/ghidra/GhidraAnalysisProfile.js +5 -0
- package/dist/ghidra/GhidraClient.js +47 -14
- package/dist/ghidra/GhidraDiagnostics.js +7 -7
- package/dist/ghidra/GhidraFunctionValues.js +10 -7
- package/dist/ghidra/GhidraInstallation.js +18 -21
- package/dist/ghidra/GhidraInventoryValues.js +14 -4
- package/dist/ghidra/GhidraJavaLaunch.js +62 -0
- package/dist/ghidra/GhidraLauncher.js +33 -16
- package/dist/ghidra/GhidraProviderCapabilities.js +14 -2
- package/dist/ghidra/GhidraProviderClient.js +23 -12
- package/dist/ghidra/GhidraSessionError.js +11 -7
- package/dist/ghidra/GhidraTargetSnapshot.js +47 -12
- package/dist/ghidra/GhidraTransport.js +20 -0
- package/dist/hopper/BridgeLauncher.js +31 -11
- package/dist/hopper/HopperAnalysisProfile.js +62 -4
- package/dist/hopper/HopperCleanup.js +15 -3
- package/dist/hopper/HopperClient.js +222 -14
- package/dist/hopper/HopperFileOffset.js +237 -0
- package/dist/hopper/HopperMachOImage.js +196 -0
- package/dist/hopper/HopperOperationStage.js +6 -0
- package/dist/hopper/HopperProvider.js +63 -9
- package/dist/hopper/HopperProviderCapabilities.js +19 -1
- package/dist/hopper/HopperRegexSearch.js +137 -0
- package/dist/hopper/HopperRegexWorker.js +27 -0
- package/dist/hopper/HopperRequestQueue.js +68 -19
- package/dist/hopper/HopperTargetLease.js +3 -2
- package/dist/inspector/JavaScriptRuntimeScope.js +9 -1
- package/dist/inspector/V8InspectorCaptureProjection.js +8 -3
- package/dist/inspector/V8InspectorProvider.js +47 -11
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +79 -31
- package/dist/javascript/sourceMaps/TraceSourceMap.js +14 -28
- package/dist/mcpDoctor.js +62 -2
- package/dist/native/AppleDispatchCoverage.js +47 -6
- package/dist/native/AppleDispatchDecodeFacts.js +6 -0
- package/dist/native/AppleDispatchMetadata.js +6 -3
- package/dist/native/AppleMachoFixups.js +48 -24
- package/dist/native/AppleMachoSelection.js +32 -16
- package/dist/native/AppleObjcCategories.js +6 -2
- package/dist/native/AppleObjcDispatchFacets.js +5 -2
- package/dist/native/AppleObjcProperties.js +2 -1
- package/dist/native/AppleSwiftDispatchFacets.js +27 -21
- package/dist/native/AppleSwiftVtables.js +21 -15
- package/dist/native/CommandRunner.js +81 -84
- package/dist/native/LldbCallTracer.js +365 -102
- package/dist/native/LldbRetainedObservations.js +178 -0
- package/dist/native/NativeCallObservation.js +62 -3
- package/dist/native/NativeMacOSProvider.js +98 -17
- package/dist/native/SignatureTargetBinding.js +155 -0
- package/dist/native/parsers/lipo.js +71 -1
- package/dist/native/pwndbg/PwndbgCoreContext.js +25 -5
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +2 -0
- package/dist/process/DarwinProcessRunTokenReader.js +8 -9
- package/dist/process/ExecFileOutput.js +20 -0
- package/dist/process/OwnedCommand.js +7 -2
- package/dist/process/ProcessOwnership.js +203 -53
- package/dist/process/ProcessOwnershipObservation.js +49 -4
- package/dist/process/ProviderProcess.js +38 -7
- package/dist/process/capture/ProcessCaptureError.js +2 -2
- package/dist/process/capture/ProcessCaptureLifecycle.js +100 -34
- package/dist/server/EvidenceMcpServer.js +146 -0
- package/dist/server/createServer.js +15 -8
- package/dist/server/registerAndroidTools.js +2 -4
- package/dist/server/registerApplicationTools/helpers.js +2 -4
- package/dist/server/registerArtifactComparisonTool.js +11 -7
- package/dist/server/registerBinaryDiagnosticsTools.js +2 -4
- package/dist/server/registerBrowserScenarioTool.js +2 -4
- package/dist/server/registerBrowserTools.js +2 -4
- package/dist/server/registerBundleComparisonTool.js +2 -3
- package/dist/server/registerCloseLifecycleTool.js +8 -18
- package/dist/server/registerElectronTools.js +2 -4
- package/dist/server/registerEnhancedTools.js +18 -59
- package/dist/server/registerEvidenceTools.js +2 -4
- package/dist/server/registerEvmTools.js +2 -4
- package/dist/server/registerFirmwareTools.js +2 -4
- package/dist/server/registerFunctionComparisonTool.js +10 -6
- package/dist/server/registerInvestigationTools.js +7 -7
- package/dist/server/registerJavaScriptRecoveryTool.js +2 -4
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -4
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +2 -4
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +2 -4
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +2 -4
- package/dist/server/registerOfficialTools.js +2 -4
- package/dist/server/registerProcessComparisonTool.js +71 -45
- package/dist/server/registerRecordedCrashTools.js +2 -4
- package/dist/server/registerSessionRecordTools.js +5 -6
- package/dist/server/registerSessionStatusTool.js +17 -3
- package/dist/server/registerSessionTools.js +11 -3
- package/dist/server/registerWebModuleTool.js +2 -4
- package/dist/server/registerWebNetworkCaptureTool.js +2 -4
- package/dist/server/registerWebRuntimeTools.js +3 -7
- package/dist/server/registerWebScriptTool.js +2 -4
- package/dist/server/registerWebSourceLocationTool.js +2 -4
- package/dist/server/runDerivedOperation.js +15 -3
- package/dist/server/sessionAvailabilityPolicy.js +0 -1
- package/dist/server/toolRegistrationOptions.js +2 -2
- package/dist/server/toolResult.js +62 -10
- package/dist/server/toolResultEncoding.js +33 -0
- package/install.sh +1 -1
- package/native/windows/build/manifest.json +1 -1
- package/package.json +8 -3
- package/scripts/electron-active-hook-boundaries.cjs +18 -20
- package/scripts/electron-active-hook.cjs +241 -37
- package/skills/reverse-engineer-anything/SKILL.md +11 -3
- package/skills/reverse-engineer-anything/references/javascript-applications.md +8 -1
- package/dist/ghidra/GhidraDefaults.js +0 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Caller-visible operational state for one provider bridge. */
|
|
2
|
+
export const PROVIDER_OPERATION_STATES = [
|
|
3
|
+
"idle",
|
|
4
|
+
"busy",
|
|
5
|
+
"exited",
|
|
6
|
+
"unreachable",
|
|
7
|
+
"not_started",
|
|
8
|
+
"unknown",
|
|
9
|
+
];
|
|
10
|
+
/** What the caller should do next for this provider state. */
|
|
11
|
+
export const PROVIDER_RETRY_ACTIONS = [
|
|
12
|
+
"retry",
|
|
13
|
+
"wait",
|
|
14
|
+
"restart_provider",
|
|
15
|
+
"unknown",
|
|
16
|
+
];
|
|
17
|
+
/** Stage that was in progress when the provider operation failed. */
|
|
18
|
+
export const PROVIDER_FAILURE_STAGES = [
|
|
19
|
+
"launch",
|
|
20
|
+
"connection",
|
|
21
|
+
"analysis",
|
|
22
|
+
"decompilation",
|
|
23
|
+
"unknown",
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Choose a recovery action from the observed state.
|
|
27
|
+
* Startup failures keep their existing install or configuration guidance.
|
|
28
|
+
*/
|
|
29
|
+
export const providerRetryAction = (state, startupFailure = false) => {
|
|
30
|
+
if (state === "idle")
|
|
31
|
+
return null;
|
|
32
|
+
if (startupFailure && state === "exited")
|
|
33
|
+
return "retry";
|
|
34
|
+
switch (state) {
|
|
35
|
+
case "busy":
|
|
36
|
+
return "wait";
|
|
37
|
+
case "exited":
|
|
38
|
+
case "unreachable":
|
|
39
|
+
return "restart_provider";
|
|
40
|
+
case "not_started":
|
|
41
|
+
return "retry";
|
|
42
|
+
case "unknown":
|
|
43
|
+
return "unknown";
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/** Use one stage when every retained request agrees, otherwise unknown. */
|
|
47
|
+
export const sharedProviderFailureStage = (requests) => {
|
|
48
|
+
const first = requests[0]?.stage;
|
|
49
|
+
if (first === undefined)
|
|
50
|
+
return null;
|
|
51
|
+
return requests.every((request) => request.stage === first)
|
|
52
|
+
? first
|
|
53
|
+
: "unknown";
|
|
54
|
+
};
|
|
@@ -4,6 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { artifactComparisonResultSchema } from "./artifactComparison.js";
|
|
5
5
|
import { artifactInventoryResultSchema } from "./artifactGraph.js";
|
|
6
6
|
import { uniqueSorted } from "./canonicalOrdering.js";
|
|
7
|
+
import { comparisonSourceEvidenceSides } from "./comparisonSourceEvidence.js";
|
|
7
8
|
import { parseEvidence } from "./evidence.js";
|
|
8
9
|
import { parseEvidenceBundle } from "./evidenceBundle.js";
|
|
9
10
|
import { functionComparisonResultSchema } from "./functionComparison.js";
|
|
@@ -12,9 +13,7 @@ import { functionDossierSchema } from "./hopperValues.js";
|
|
|
12
13
|
import { deriveProcessComparisonStatus, PROCESS_COMPARISON_DIMENSIONS, processCaptureComparisonSchema, parseProcessCapture, } from "./process/processCapture.js";
|
|
13
14
|
import { reconstructionClaimResultSchema, reconstructionSpecificationSchema, reconstructionVerificationResultSchema, } from "./reconstructionVerificationSchemas.js";
|
|
14
15
|
import { reconstructionClaimUnknowns, reconstructionProbes, reconstructionUnknownHeads, } from "./reconstructionUnknowns.js";
|
|
15
|
-
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
16
16
|
export { reconstructionVerificationInputSchema, reconstructionVerificationResultSchema, } from "./reconstructionVerificationSchemas.js";
|
|
17
|
-
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
18
17
|
const providers = {
|
|
19
18
|
behavioral: {
|
|
20
19
|
operation: "compare_process_captures",
|
|
@@ -78,10 +77,8 @@ const evaluateClaim = (claim, records, heads) => {
|
|
|
78
77
|
if (comparison === undefined)
|
|
79
78
|
throw new TypeError(`Missing comparison Evidence ${claim.comparison_evidence_id}`);
|
|
80
79
|
validateComparisonIdentity(claim, comparison);
|
|
81
|
-
const sides =
|
|
82
|
-
const allSourceIds = [...sides.left, ...sides.right];
|
|
83
|
-
if (new Set(allSourceIds).size !== allSourceIds.length)
|
|
84
|
-
throw new TypeError("Comparison source Evidence must be unique and two-sided");
|
|
80
|
+
const sides = comparisonSourceEvidenceSides(comparison);
|
|
81
|
+
const allSourceIds = uniqueSorted([...sides.left, ...sides.right]);
|
|
85
82
|
if (!sameSet(comparison.evidence_links, allSourceIds))
|
|
86
83
|
throw new TypeError("Comparison Evidence closure disagrees with its parameters");
|
|
87
84
|
const sources = allSourceIds.map((id) => {
|
|
@@ -147,42 +144,6 @@ const validateComparisonIdentity = (claim, evidence) => {
|
|
|
147
144
|
evidence.subject !== null)
|
|
148
145
|
throw new TypeError("Comparison Evidence identity or authority disagrees");
|
|
149
146
|
};
|
|
150
|
-
const sourceSides = (claim, evidence) => {
|
|
151
|
-
const parameters = evidence.parameters;
|
|
152
|
-
let singularSides;
|
|
153
|
-
if (claim.kind === "behavioral" ||
|
|
154
|
-
(claim.kind === "structural-function" &&
|
|
155
|
-
("left_evidence_id" in parameters || "right_evidence_id" in parameters))) {
|
|
156
|
-
const parsed = z
|
|
157
|
-
.object({
|
|
158
|
-
left_evidence_id: evidenceIdSchema,
|
|
159
|
-
right_evidence_id: evidenceIdSchema,
|
|
160
|
-
})
|
|
161
|
-
.passthrough()
|
|
162
|
-
.parse(parameters);
|
|
163
|
-
singularSides = {
|
|
164
|
-
left: [parsed.left_evidence_id],
|
|
165
|
-
right: [parsed.right_evidence_id],
|
|
166
|
-
};
|
|
167
|
-
if (claim.kind === "behavioral" ||
|
|
168
|
-
!("left_evidence_ids" in parameters || "right_evidence_ids" in parameters))
|
|
169
|
-
return singularSides;
|
|
170
|
-
}
|
|
171
|
-
const parsed = z
|
|
172
|
-
.object({
|
|
173
|
-
left_evidence_ids: z.array(evidenceIdSchema).min(1),
|
|
174
|
-
right_evidence_ids: z.array(evidenceIdSchema).min(1),
|
|
175
|
-
})
|
|
176
|
-
.passthrough()
|
|
177
|
-
.parse(parameters);
|
|
178
|
-
if (singularSides !== undefined &&
|
|
179
|
-
(parsed.left_evidence_ids.length !== 1 ||
|
|
180
|
-
parsed.right_evidence_ids.length !== 1 ||
|
|
181
|
-
parsed.left_evidence_ids[0] !== singularSides.left[0] ||
|
|
182
|
-
parsed.right_evidence_ids[0] !== singularSides.right[0]))
|
|
183
|
-
throw new TypeError("Function comparison source Evidence aliases disagree");
|
|
184
|
-
return { left: parsed.left_evidence_ids, right: parsed.right_evidence_ids };
|
|
185
|
-
};
|
|
186
147
|
const observedStatus = (claim, evidence) => {
|
|
187
148
|
if (claim.kind === "behavioral") {
|
|
188
149
|
const result = processCaptureComparisonSchema.parse(evidence.normalized_result);
|
|
@@ -215,6 +176,8 @@ const validateProcessStatus = (result) => {
|
|
|
215
176
|
const authorityLimitations = (claim, sources, sides) => {
|
|
216
177
|
const requiredAuthority = claim.kind === "behavioral" ? "controlled-replay" : "shipped-artifact";
|
|
217
178
|
const limitations = [];
|
|
179
|
+
if (sides.left.some((id) => sides.right.includes(id)))
|
|
180
|
+
limitations.push("A source observation appears on both comparison sides; independent original and reconstruction observations are unavailable.");
|
|
218
181
|
if (sources.some((source) => source.authority !== requiredAuthority ||
|
|
219
182
|
(claim.kind === "structural-function"
|
|
220
183
|
? source.confidence === "inferred"
|
|
@@ -250,5 +213,5 @@ const digest = (value) => {
|
|
|
250
213
|
return createHash("sha256").update(encoded).digest("hex");
|
|
251
214
|
};
|
|
252
215
|
const count = (items, status) => items.filter((item) => item.status === status).length;
|
|
253
|
-
const sameSet = (left, right) => left.length === right.length &&
|
|
216
|
+
const sameSet = (left, right) => uniqueSorted(left).length === uniqueSorted(right).length &&
|
|
254
217
|
uniqueSorted(left).every((id, index) => id === uniqueSorted(right)[index]);
|
|
@@ -80,7 +80,7 @@ export const reconstructionClaimResultSchema = z.object({
|
|
|
80
80
|
comparison_evidence_id: evidenceIdSchema,
|
|
81
81
|
left_evidence_ids: z.array(evidenceIdSchema).min(1),
|
|
82
82
|
right_evidence_ids: z.array(evidenceIdSchema).min(1),
|
|
83
|
-
evidence_links: z.array(evidenceIdSchema).min(
|
|
83
|
+
evidence_links: z.array(evidenceIdSchema).min(2),
|
|
84
84
|
unknown_ids: z.array(unknownIdSchema),
|
|
85
85
|
limitations: z.array(z.string()),
|
|
86
86
|
});
|
|
@@ -106,7 +106,7 @@ export const reconstructionVerificationResultSchema = z
|
|
|
106
106
|
claim_ids: z.array(claimIdSchema).min(1),
|
|
107
107
|
unknown_ids: z.array(unknownIdSchema),
|
|
108
108
|
})),
|
|
109
|
-
evidence_links: z.array(evidenceIdSchema).min(
|
|
109
|
+
evidence_links: z.array(evidenceIdSchema).min(2),
|
|
110
110
|
limitations: z.array(z.string()),
|
|
111
111
|
})
|
|
112
112
|
.superRefine((result, context) => {
|
|
@@ -3,6 +3,7 @@ import canonicalize from "canonicalize";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { artifactComparisonResultSchema } from "./artifactComparison.js";
|
|
5
5
|
import { uniqueSorted } from "./canonicalOrdering.js";
|
|
6
|
+
import { comparisonSourceEvidenceIds } from "./comparisonSourceEvidence.js";
|
|
6
7
|
import { evidenceSchema, parseEvidence } from "./evidence.js";
|
|
7
8
|
import { functionComparisonResultSchema } from "./functionComparison.js";
|
|
8
9
|
import { PROCESS_PROVIDER, isProcessEvidenceProvider, } from "./process/processEvidenceProvider.js";
|
|
@@ -289,52 +290,14 @@ const assertComparisonIdentity = (evidence) => {
|
|
|
289
290
|
evidence.provider.version !== "1") ||
|
|
290
291
|
evidence.confidence !== "derived" ||
|
|
291
292
|
evidence.authority !== "analyst-inference" ||
|
|
292
|
-
evidence.subject !== null
|
|
293
|
-
evidence.evidence_links.length < 2 ||
|
|
294
|
-
new Set(evidence.evidence_links).size !== evidence.evidence_links.length)
|
|
293
|
+
evidence.subject !== null)
|
|
295
294
|
throw new TypeError("Comparison Evidence operation, predicate, provider, or citations disagree");
|
|
296
|
-
const
|
|
297
|
-
|
|
295
|
+
const expectedLinks = comparisonSourceEvidenceIds(evidence);
|
|
296
|
+
const actualLinks = uniqueSorted(evidence.evidence_links);
|
|
297
|
+
if (expectedLinks.length !== actualLinks.length ||
|
|
298
|
+
expectedLinks.some((id, index) => id !== actualLinks[index]))
|
|
298
299
|
throw new TypeError("Comparison Evidence closure disagrees with its source parameters");
|
|
299
300
|
};
|
|
300
|
-
const comparisonParameterLinks = (evidence) => {
|
|
301
|
-
if (evidence.operation === "compare_process_captures") {
|
|
302
|
-
const parameters = z
|
|
303
|
-
.object({
|
|
304
|
-
left_evidence_id: evidenceIdSchema,
|
|
305
|
-
right_evidence_id: evidenceIdSchema,
|
|
306
|
-
})
|
|
307
|
-
.passthrough()
|
|
308
|
-
.parse(evidence.parameters);
|
|
309
|
-
return [parameters.left_evidence_id, parameters.right_evidence_id];
|
|
310
|
-
}
|
|
311
|
-
const parameters = z
|
|
312
|
-
.object({
|
|
313
|
-
left_evidence_id: evidenceIdSchema.optional(),
|
|
314
|
-
right_evidence_id: evidenceIdSchema.optional(),
|
|
315
|
-
left_evidence_ids: z.array(evidenceIdSchema).min(1).optional(),
|
|
316
|
-
right_evidence_ids: z.array(evidenceIdSchema).min(1).optional(),
|
|
317
|
-
})
|
|
318
|
-
.passthrough()
|
|
319
|
-
.parse(evidence.parameters);
|
|
320
|
-
const left = parameters.left_evidence_id === undefined
|
|
321
|
-
? (parameters.left_evidence_ids ?? [])
|
|
322
|
-
: [parameters.left_evidence_id];
|
|
323
|
-
const right = parameters.right_evidence_id === undefined
|
|
324
|
-
? (parameters.right_evidence_ids ?? [])
|
|
325
|
-
: [parameters.right_evidence_id];
|
|
326
|
-
if (left.length === 0 || right.length === 0)
|
|
327
|
-
throw new TypeError("Comparison Evidence omitted its source parameters");
|
|
328
|
-
return [...left, ...right];
|
|
329
|
-
};
|
|
330
|
-
const sameSet = (left, right) => {
|
|
331
|
-
if (left.length !== right.length)
|
|
332
|
-
return false;
|
|
333
|
-
const rightSet = new Set(right);
|
|
334
|
-
return (rightSet.size === right.length &&
|
|
335
|
-
new Set(left).size === left.length &&
|
|
336
|
-
left.every((item) => rightSet.has(item)));
|
|
337
|
-
};
|
|
338
301
|
const observedPattern = (staticStatus, runtimeStatus) => {
|
|
339
302
|
if (staticStatus === "truncated" || runtimeStatus === "truncated")
|
|
340
303
|
return "truncated";
|
|
@@ -88,24 +88,36 @@ export const webSourceMapsSchema = z
|
|
|
88
88
|
requested: z.number().int().min(0),
|
|
89
89
|
processed: z.number().int().min(0),
|
|
90
90
|
items: z.array(sourceMapSchema),
|
|
91
|
+
limitation: z.string().min(1).optional(),
|
|
91
92
|
})
|
|
92
93
|
.superRefine((sourceMaps, context) => {
|
|
93
|
-
if (sourceMaps.
|
|
94
|
+
if (sourceMaps.processed > sourceMaps.requested ||
|
|
94
95
|
sourceMaps.processed !== sourceMaps.items.length)
|
|
95
96
|
context.addIssue({
|
|
96
97
|
code: "custom",
|
|
97
98
|
message: "Source-map coverage counts are inconsistent",
|
|
98
99
|
});
|
|
100
|
+
if (sourceMaps.processed < sourceMaps.requested &&
|
|
101
|
+
sourceMaps.limitation === undefined)
|
|
102
|
+
context.addIssue({
|
|
103
|
+
code: "custom",
|
|
104
|
+
message: "Unprocessed source maps require an explicit coverage limitation",
|
|
105
|
+
path: ["limitation"],
|
|
106
|
+
});
|
|
99
107
|
const statuses = sourceMaps.items.map(({ status }) => status);
|
|
100
108
|
const retained = statuses.filter((status) => status === "included" || status === "partial").length;
|
|
101
|
-
const allowedStatuses = sourceMaps.
|
|
102
|
-
?
|
|
103
|
-
: retained === 0
|
|
109
|
+
const allowedStatuses = sourceMaps.processed < sourceMaps.requested
|
|
110
|
+
? retained === 0
|
|
104
111
|
? ["unavailable"]
|
|
105
|
-
:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
: ["partial"]
|
|
113
|
+
: sourceMaps.items.length === 0
|
|
114
|
+
? ["not_requested", "unavailable"]
|
|
115
|
+
: retained === 0
|
|
116
|
+
? ["unavailable"]
|
|
117
|
+
: retained === sourceMaps.items.length &&
|
|
118
|
+
!statuses.includes("partial")
|
|
119
|
+
? ["included"]
|
|
120
|
+
: ["partial"];
|
|
109
121
|
if (!allowedStatuses.includes(sourceMaps.status))
|
|
110
122
|
context.addIssue({
|
|
111
123
|
code: "custom",
|
|
@@ -2,6 +2,7 @@ import { parse } from "@babel/parser";
|
|
|
2
2
|
import * as t from "@babel/types";
|
|
3
3
|
import { sanitizeEndpointCandidate } from "./browserObservation.js";
|
|
4
4
|
import { traverseJavaScriptAst } from "./javascript/javascriptSemanticTraversal.js";
|
|
5
|
+
import { classifyParsedJavaScriptOpenReceivers } from "./javascript/javascriptSemanticAnalysis.js";
|
|
5
6
|
import { semanticStaticPropertyName } from "./javascript/javascriptAstValues.js";
|
|
6
7
|
import { calleeName, endpointArgument, stringValue, } from "./javascript/javascriptStaticAnalysisHelpers.js";
|
|
7
8
|
import { location, locationFields, objectString, objectValue, resolveSpecifier, isUrlLikeModuleSpecifier, } from "./webBundleAnalyzerAst.js";
|
|
@@ -22,14 +23,15 @@ export const analyzeScript = (script, accumulator) => {
|
|
|
22
23
|
}
|
|
23
24
|
accumulator.parsedScripts += 1;
|
|
24
25
|
detectVendorFingerprints(script, accumulator);
|
|
26
|
+
const openReceiverFacts = classifyParsedJavaScriptOpenReceivers(file);
|
|
25
27
|
traverseJavaScriptAst(file, {
|
|
26
28
|
enter: (node) => {
|
|
27
29
|
accumulator.visitedNodes += 1;
|
|
28
|
-
inspectNode(script, node, accumulator);
|
|
30
|
+
inspectNode(script, node, accumulator, openReceiverFacts);
|
|
29
31
|
},
|
|
30
32
|
});
|
|
31
33
|
};
|
|
32
|
-
const inspectNode = (script, node, accumulator) => {
|
|
34
|
+
const inspectNode = (script, node, accumulator, openReceiverFacts) => {
|
|
33
35
|
if ((t.isImportDeclaration(node) || t.isExportAllDeclaration(node)) &&
|
|
34
36
|
node.source !== undefined)
|
|
35
37
|
addEdge({
|
|
@@ -57,10 +59,12 @@ const inspectNode = (script, node, accumulator) => {
|
|
|
57
59
|
});
|
|
58
60
|
if (t.isObjectProperty(node))
|
|
59
61
|
inspectRouteProperty(script, node, accumulator);
|
|
60
|
-
if (t.isCallExpression(node) ||
|
|
61
|
-
|
|
62
|
+
if (t.isCallExpression(node) ||
|
|
63
|
+
t.isOptionalCallExpression(node) ||
|
|
64
|
+
t.isNewExpression(node))
|
|
65
|
+
inspectCall(script, node, accumulator, openReceiverFacts);
|
|
62
66
|
};
|
|
63
|
-
const inspectCall = (script, node, accumulator) => {
|
|
67
|
+
const inspectCall = (script, node, accumulator, openReceiverFacts) => {
|
|
64
68
|
const name = calleeName(node.callee);
|
|
65
69
|
const first = stringValue(node.arguments[0]);
|
|
66
70
|
if ((name === "require" || name.endsWith(".require")) && first !== undefined)
|
|
@@ -95,7 +99,7 @@ const inspectCall = (script, node, accumulator) => {
|
|
|
95
99
|
accumulator,
|
|
96
100
|
});
|
|
97
101
|
}
|
|
98
|
-
const endpoint = endpointArgument(name, node.arguments, node.callee);
|
|
102
|
+
const endpoint = endpointArgument(name, node.arguments, node.callee, openReceiverFacts.get(node.start ?? -1));
|
|
99
103
|
if (endpoint !== undefined)
|
|
100
104
|
addFinding({
|
|
101
105
|
collection: accumulator.endpoints,
|
|
@@ -105,8 +109,9 @@ const inspectCall = (script, node, accumulator) => {
|
|
|
105
109
|
node,
|
|
106
110
|
accumulator,
|
|
107
111
|
});
|
|
108
|
-
if (
|
|
109
|
-
name
|
|
112
|
+
if ((t.isCallExpression(node) || t.isNewExpression(node)) &&
|
|
113
|
+
(name.endsWith("modelContext.registerTool") ||
|
|
114
|
+
name === "modelContext.registerTool"))
|
|
110
115
|
addWebMcpDeclaration(script, node, accumulator);
|
|
111
116
|
};
|
|
112
117
|
const inspectRouteProperty = (script, node, accumulator) => {
|
|
@@ -3,10 +3,16 @@ export const buildWebBundleAnalysis = (inspection, sourceScripts, sourceMaps, ac
|
|
|
3
3
|
const unavailable = inspection.scripts.items
|
|
4
4
|
.filter((script) => !script.source.included)
|
|
5
5
|
.map(({ script_key }) => script_key);
|
|
6
|
+
const omittedScripts = captureBudgetOmission(inspection, "scripts");
|
|
7
|
+
const omittedSourceMaps = sourceMaps.status === "not_requested"
|
|
8
|
+
? undefined
|
|
9
|
+
: captureBudgetOmission(inspection, "source_maps");
|
|
6
10
|
const sourceMapIncomplete = sourceMaps.status === "partial" || sourceMaps.status === "unavailable";
|
|
7
11
|
const partial = accumulator.parseFailures > 0 ||
|
|
8
12
|
unavailable.length > 0 ||
|
|
9
|
-
sourceMapIncomplete
|
|
13
|
+
sourceMapIncomplete ||
|
|
14
|
+
omittedScripts !== undefined ||
|
|
15
|
+
omittedSourceMaps !== undefined;
|
|
10
16
|
return webBundleAnalysisSchema.parse({
|
|
11
17
|
capture: buildCaptureObservation(inspection, sourceScripts),
|
|
12
18
|
observations: {
|
|
@@ -25,6 +31,8 @@ export const buildWebBundleAnalysis = (inspection, sourceScripts, sourceMaps, ac
|
|
|
25
31
|
unavailable,
|
|
26
32
|
parseFailures: accumulator.parseFailures,
|
|
27
33
|
sourceMaps,
|
|
34
|
+
omittedScripts,
|
|
35
|
+
omittedSourceMaps,
|
|
28
36
|
}),
|
|
29
37
|
completeness: buildCompleteness({
|
|
30
38
|
partial,
|
|
@@ -58,6 +66,15 @@ const chunkNode = (script) => {
|
|
|
58
66
|
};
|
|
59
67
|
};
|
|
60
68
|
const buildUnknowns = (input) => [
|
|
69
|
+
...(input.omittedScripts === undefined
|
|
70
|
+
? []
|
|
71
|
+
: [
|
|
72
|
+
{
|
|
73
|
+
dimension: "script_inventory",
|
|
74
|
+
reason: captureBudgetReason("script records", input.omittedScripts),
|
|
75
|
+
affected_script_keys: [],
|
|
76
|
+
},
|
|
77
|
+
]),
|
|
61
78
|
...(input.unavailable.length === 0
|
|
62
79
|
? []
|
|
63
80
|
: [
|
|
@@ -76,13 +93,23 @@ const buildUnknowns = (input) => [
|
|
|
76
93
|
affected_script_keys: input.sourceScripts.map(({ script_key }) => script_key),
|
|
77
94
|
},
|
|
78
95
|
]),
|
|
96
|
+
...(input.omittedSourceMaps === undefined
|
|
97
|
+
? []
|
|
98
|
+
: [
|
|
99
|
+
{
|
|
100
|
+
dimension: "source_maps",
|
|
101
|
+
reason: captureBudgetReason("source-map declarations", input.omittedSourceMaps),
|
|
102
|
+
affected_script_keys: [],
|
|
103
|
+
},
|
|
104
|
+
]),
|
|
79
105
|
...(input.sourceMaps.status === "not_requested" ||
|
|
80
106
|
input.sourceMaps.status === "included"
|
|
81
107
|
? []
|
|
82
108
|
: [
|
|
83
109
|
{
|
|
84
110
|
dimension: "source_maps",
|
|
85
|
-
reason:
|
|
111
|
+
reason: input.sourceMaps.limitation ??
|
|
112
|
+
"One or more requested source maps were unavailable or incomplete",
|
|
86
113
|
affected_script_keys: input.sourceMaps.items
|
|
87
114
|
.filter(({ status }) => status !== "included")
|
|
88
115
|
.map(({ script_key }) => script_key)
|
|
@@ -90,6 +117,18 @@ const buildUnknowns = (input) => [
|
|
|
90
117
|
},
|
|
91
118
|
]),
|
|
92
119
|
];
|
|
120
|
+
const captureBudgetOmission = (inspection, section) => {
|
|
121
|
+
const exclusions = inspection.completeness.excluded.filter((exclusion) => exclusion.section === section &&
|
|
122
|
+
exclusion.reason === "resource_budget_exhausted");
|
|
123
|
+
if (exclusions.length === 0)
|
|
124
|
+
return undefined;
|
|
125
|
+
if (exclusions.some(({ count }) => count === null))
|
|
126
|
+
return null;
|
|
127
|
+
return exclusions.reduce((sum, { count }) => sum + (count ?? 0), 0);
|
|
128
|
+
};
|
|
129
|
+
const captureBudgetReason = (label, count) => count === null
|
|
130
|
+
? `Capture omitted an unknown number of ${label} because its resource budget was exhausted.`
|
|
131
|
+
: `Capture omitted ${String(count)} ${label} because its resource budget was exhausted.`;
|
|
93
132
|
const buildCompleteness = (input) => ({
|
|
94
133
|
status: input.partial ? "partial" : "complete",
|
|
95
134
|
parsed_scripts: input.parsedScripts,
|
|
@@ -2,6 +2,20 @@ import { z } from "zod";
|
|
|
2
2
|
import { browserAllowedOriginsSchema, browserEndpointSchema, } from "./browserObservation.js";
|
|
3
3
|
import { browserVersionSchema } from "./browserObservationSchemas.js";
|
|
4
4
|
import { jsonObjectSchema } from "./jsonValue.js";
|
|
5
|
+
// CDP positions are zero-based and relative to the resource named by url.
|
|
6
|
+
// With a script ID that is the script's enclosing resource: the script file,
|
|
7
|
+
// or the HTML document for an inline script. An empty script ID marks a
|
|
8
|
+
// position a request initiator reported, such as parser markup or a module
|
|
9
|
+
// import in a script file; it still locates url, but has no session-script
|
|
10
|
+
// association to join captured source or resource_start.
|
|
11
|
+
// trace_web_source_location takes one-based, script-relative lines, so the
|
|
12
|
+
// advertised units keep callers from passing a position off by one or by an
|
|
13
|
+
// inline script's offset.
|
|
14
|
+
const SCRIPT_ID = "CDP session script ID; empty for a position a request initiator reported, which has no session-script association for joining captured source or resource_start.";
|
|
15
|
+
const RESOURCE_LINE = "Zero-based line in the resource named by url, as reported by CDP: the script file for an external script (including a module-import initiator), or the HTML document for an inline script or parser markup.";
|
|
16
|
+
const RESOURCE_COLUMN = "Zero-based UTF-16 column on that line of the resource named by url, as reported by CDP.";
|
|
17
|
+
const START_LINE = "Zero-based line where the script text starts in its enclosing resource (the HTML document for an inline script).";
|
|
18
|
+
const START_COLUMN = "Zero-based UTF-16 column where the script text starts on that line of its enclosing resource.";
|
|
5
19
|
/** Scope for one externally owned page; omitted origins select its current origin. */
|
|
6
20
|
export const webRuntimeScopeSchema = z.strictObject({
|
|
7
21
|
cdp_endpoint: browserEndpointSchema,
|
|
@@ -22,8 +36,8 @@ export const webRuntimeSourceSchema = z.object({
|
|
|
22
36
|
language: z.string().nullable(),
|
|
23
37
|
resource_start: z
|
|
24
38
|
.object({
|
|
25
|
-
line_number: z.number().int().min(0),
|
|
26
|
-
column_number: z.number().int().min(0),
|
|
39
|
+
line_number: z.number().int().min(0).describe(START_LINE),
|
|
40
|
+
column_number: z.number().int().min(0).describe(START_COLUMN),
|
|
27
41
|
})
|
|
28
42
|
.nullable(),
|
|
29
43
|
source: z.discriminatedUnion("state", [
|
|
@@ -42,10 +56,10 @@ export const webRuntimeSourceSchema = z.object({
|
|
|
42
56
|
});
|
|
43
57
|
/** Producer callsite coordinates are zero-based resource lines and UTF-16 columns. */
|
|
44
58
|
export const webRuntimeLocationSchema = z.object({
|
|
45
|
-
script_id: z.string(),
|
|
59
|
+
script_id: z.string().describe(SCRIPT_ID),
|
|
46
60
|
url: z.string().nullable(),
|
|
47
|
-
line_number: z.number().int().min(0),
|
|
48
|
-
column_number: z.number().int().min(0).nullable(),
|
|
61
|
+
line_number: z.number().int().min(0).describe(RESOURCE_LINE),
|
|
62
|
+
column_number: z.number().int().min(0).nullable().describe(RESOURCE_COLUMN),
|
|
49
63
|
function_name: z.string().nullable(),
|
|
50
64
|
source_association: z.enum(["script_id", "unknown"]),
|
|
51
65
|
});
|
|
@@ -102,7 +102,7 @@ export const readFirmwareReport = async (path, operation) => {
|
|
|
102
102
|
if (bytes === undefined)
|
|
103
103
|
throw new AnalysisOutputError(operation, `Report exceeded ${FIRMWARE_LIMITS.reportBytes} bytes`);
|
|
104
104
|
try {
|
|
105
|
-
const value = JSON.parse(
|
|
105
|
+
const value = JSON.parse(new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes));
|
|
106
106
|
return value;
|
|
107
107
|
}
|
|
108
108
|
catch (cause) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Generated from package.json and package-lock.json; do not edit. */
|
|
2
2
|
export const PACKAGE_METADATA = {
|
|
3
3
|
name: "rea-agents",
|
|
4
|
-
version: "6.
|
|
4
|
+
version: "6.1.0", // x-release-please-version
|
|
5
5
|
serverSdkVersion: "2.3.1",
|
|
6
6
|
clientSdkVersion: "2.3.1",
|
|
7
7
|
coreSdkVersion: "2.3.1",
|
|
@@ -27,6 +27,11 @@ export const resolveGhidraAnalysisProfile = (target, identity, installation, sig
|
|
|
27
27
|
annotation_policy: "atomic-function-entry-metadata-v1",
|
|
28
28
|
load_image_observations: "source-mappings-entry-context-v2",
|
|
29
29
|
function_body_evidence: "complete-inclusive-ranges-v1",
|
|
30
|
+
function_references: "complete-body-and-entry-reference-manager-v2",
|
|
31
|
+
location_resolution: "explicit-address-exact-name-first-v2",
|
|
32
|
+
process_launch: installation.platform === "win32"
|
|
33
|
+
? "official-headless-script-v1"
|
|
34
|
+
: "inspected-jvm-launch-support-v1",
|
|
30
35
|
...(dos
|
|
31
36
|
? {
|
|
32
37
|
load_image_evidence: dosCom
|