rea-agents 3.2.0 → 4.0.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 +183 -332
- package/bridge/ghidra/ReaGhidraBridge.java +561 -74
- package/bridge/hopper_bridge.py +70 -27
- package/bridge/native/ReaNativeUI.swift +157 -0
- package/dist/application/AnalysisContextQueries.js +19 -5
- package/dist/application/AnalysisSnapshotCache.js +30 -11
- package/dist/application/AppleAssetCatalogAnalysis.js +171 -0
- package/dist/application/ArtifactExtractionDestination.js +0 -12
- package/dist/application/ArtifactGraphConstruction.js +44 -11
- package/dist/application/ArtifactInventory/classify.js +7 -15
- package/dist/application/ArtifactInventory/hash.js +4 -2
- package/dist/application/ArtifactInventory/policy.js +2 -17
- package/dist/application/ArtifactInventory/reader.js +3 -3
- package/dist/application/ArtifactInventory/scanCanonical.js +2 -2
- package/dist/application/ArtifactInventory/scanReader.js +12 -4
- package/dist/application/ArtifactInventory/types.js +0 -3
- package/dist/application/BinarySession.js +28 -43
- package/dist/application/BinarySessionExecution.js +37 -1
- package/dist/application/BinaryTargetResolver.js +50 -4
- package/dist/application/BrowserEvidence.js +36 -7
- package/dist/application/BrowserObservationService.js +17 -44
- package/dist/application/BrowserScenarioCaptureService.js +2 -35
- package/dist/application/BrowserScenarioEvidence.js +13 -9
- package/dist/application/CapabilityClientRequirements.js +2 -11
- package/dist/application/CapabilityInventory.js +21 -35
- package/dist/application/ClientConfigurationDocument.js +84 -7
- package/dist/application/ClientRegistrationIdentity.js +32 -0
- package/dist/application/ClientRegistrationStatus.js +59 -6
- package/dist/application/DirectAnalysis.js +37 -58
- package/dist/application/DirectAnalysisStatus.js +4 -4
- package/dist/application/Doctor.js +89 -80
- package/dist/application/DoctorDiagnostics.js +2 -26
- package/dist/application/DoctorScope.js +8 -14
- package/dist/application/ElectronActiveEvidence.js +10 -27
- package/dist/application/ElectronActiveObservationService.js +9 -36
- package/dist/application/ElectronBoundaryAnalysis.js +2 -0
- package/dist/application/ElectronBoundaryGraphNative.js +1 -1
- package/dist/application/ElectronEvidence.js +8 -3
- package/dist/application/ElectronObservationService.js +9 -25
- package/dist/application/EnhancedLiteralTracing.js +4 -8
- package/dist/application/EnhancedTools.js +15 -35
- package/dist/application/FilesystemSnapshot.js +7 -8
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +2 -1
- package/dist/application/JavaScriptApplicationWorkflowService.js +31 -7
- package/dist/application/JavaScriptArtifactAnalysis.js +6 -4
- package/dist/application/JavaScriptArtifactFiles.js +5 -0
- package/dist/application/JavaScriptArtifactPathResolution.js +179 -47
- package/dist/application/JavaScriptRuntimeObservationEvidence.js +6 -3
- package/dist/application/JavaScriptRuntimeObservationService.js +9 -25
- package/dist/application/JavaScriptRuntimeReconciliationService.js +45 -4
- package/dist/application/JavaScriptSemanticGraphAsyncProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphChildProcessProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphDataProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphFlowProjection.js +14 -5
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LazyAnalysisProvider.js +27 -6
- package/dist/application/ManagedMemberComparisonService.js +19 -6
- package/dist/application/NativeApiInspection.js +2 -0
- package/dist/application/NativeCallRoutes.js +72 -0
- package/dist/application/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/NativeUiActionTrace.js +73 -49
- package/dist/application/NativeValueTrace.js +320 -0
- package/dist/application/ProcessCaptureCapability.js +32 -5
- package/dist/application/ProcessCaptureEnvironment.js +9 -26
- package/dist/application/ProcessCaptureError.js +1 -5
- package/dist/application/ProcessCaptureJournal.js +3 -40
- package/dist/application/ProcessCaptureLifecycle.js +102 -111
- package/dist/application/ProcessCli.js +18 -25
- package/dist/application/ProcessEvidence.js +5 -7
- package/dist/application/ProcessFilesystemEffects.js +36 -0
- package/dist/application/ProcessHarness.js +41 -120
- package/dist/application/ProcessNormalization.js +2 -17
- package/dist/application/ProcessScenarioRuntimeValidation.js +76 -0
- package/dist/application/ReferenceSourceImport.js +3 -4
- package/dist/application/Setup.js +236 -84
- package/dist/application/SetupClientConfiguration.js +14 -9
- package/dist/application/SetupPlan.js +138 -86
- package/dist/application/SetupSkill.js +0 -1
- package/dist/application/SupportedClients.js +102 -21
- package/dist/application/Uninstall.js +31 -20
- package/dist/application/Update.js +93 -0
- package/dist/application/UpdateMaintenance.js +108 -0
- package/dist/application/UpdateRuntime.js +126 -0
- package/dist/application/runtime.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +6 -8
- package/dist/artifacts/ArtifactProvider.js +94 -41
- package/dist/artifacts/AsarArtifactReader.js +19 -4
- package/dist/artifacts/KeyedArchiveReader.js +110 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +53 -5
- package/dist/artifacts/ZipArtifactReader.js +18 -1
- package/dist/browser/BrowserScenarioSecrets.js +28 -1
- package/dist/browser/CdpBrowserProvider.js +36 -15
- package/dist/browser/CdpCaptureDocuments.js +22 -8
- package/dist/browser/CdpCaptureEventHandlers.js +14 -5
- package/dist/browser/CdpCaptureEventHelpers.js +13 -0
- package/dist/browser/CdpCaptureEvents.js +10 -1
- package/dist/browser/CdpElectronInspection.js +5 -10
- package/dist/browser/CdpElectronProvider.js +1 -5
- package/dist/browser/CdpElectronScripts.js +1 -1
- package/dist/browser/CdpEndpoint.js +3 -2
- package/dist/browser/CdpObservationSession.js +14 -10
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpPageCaptureScripts.js +1 -1
- package/dist/browser/CdpSafeMetadata.js +5 -4
- package/dist/browser/CdpScreenshot.js +16 -5
- package/dist/browser/CdpTargetSession.js +25 -4
- package/dist/browser/CdpWebMcpDiscovery.js +93 -20
- package/dist/browser/JavaScriptRuntimeScope.js +28 -2
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +9 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +3 -10
- package/dist/browser/PlaywrightElectronActiveProvider.js +5 -5
- package/dist/browser/PlaywrightScenarioActions.js +1 -1
- package/dist/browser/PlaywrightScenarioArtifacts.js +13 -25
- package/dist/browser/PlaywrightScenarioBrowser.js +28 -25
- package/dist/browser/PlaywrightScenarioEvents.js +82 -93
- package/dist/browser/PlaywrightScenarioSession.js +27 -123
- package/dist/browser/PngVisualDiff.js +22 -3
- package/dist/browser/V8InspectorCaptureProjection.js +7 -1
- package/dist/browser/V8InspectorProvider.js +60 -7
- package/dist/browser/WebSourceMapFetcher.js +99 -53
- package/dist/cli/artifactCommands.js +56 -12
- package/dist/cli/coreAnalysisCommands.js +110 -0
- package/dist/cli/managedCommands.js +1 -31
- package/dist/cli/setupCommands.js +16 -14
- package/dist/cli/utilityCommands.js +61 -4
- package/dist/cli.js +5 -7
- package/dist/cliApplicationCommands.js +0 -83
- package/dist/cliBrowserAdvancedCommands.js +7 -11
- package/dist/cliBrowserCommands.js +15 -23
- package/dist/cliBrowserContext.js +3 -24
- package/dist/cliBrowserScenarioCommands.js +2 -10
- package/dist/cliCommandNames.js +82 -7
- package/dist/cliElectronCommands.js +10 -36
- package/dist/cliJavaScriptRuntimeCommands.js +6 -30
- package/dist/cliJsonInput.js +4 -2
- package/dist/cliLogging.js +16 -7
- package/dist/cliObservationOptions.js +1 -1
- package/dist/cliOutput.js +2 -4
- package/dist/cliProcessCommands.js +6 -33
- package/dist/cliSetup.js +90 -160
- package/dist/config/environment.js +2 -78
- package/dist/config/parseConfig.js +18 -109
- package/dist/config/parsers.js +0 -23
- package/dist/contracts/applicationToolContracts.js +1 -118
- package/dist/contracts/artifactToolContracts.js +11 -19
- package/dist/contracts/browserScenarioToolContracts.js +1 -5
- package/dist/contracts/browserToolContracts.js +9 -16
- package/dist/contracts/electronToolContracts.js +5 -6
- package/dist/contracts/enhancedInputs.js +3 -2
- package/dist/contracts/errorSchemas.js +16 -40
- package/dist/contracts/functionWorkflowToolContracts.js +2 -2
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +2 -2
- package/dist/contracts/javascriptRuntimeObservationToolContracts.js +4 -4
- package/dist/contracts/javascriptRuntimeReconciliationExample.js +1 -1
- package/dist/contracts/managedToolContracts.js +7 -4
- package/dist/contracts/managedWorkflowExamples.js +0 -22
- package/dist/contracts/managedWorkflowToolContracts.js +16 -31
- package/dist/contracts/nativeToolContracts.js +9 -0
- package/dist/contracts/promptContracts.js +6 -6
- package/dist/contracts/sessionToolSchemas.js +3 -3
- package/dist/contracts/toolContractExamples.js +4 -3
- package/dist/contracts/toolContracts.js +18 -7
- package/dist/contracts/toolEffects.js +34 -21
- package/dist/contracts/toolOutputSchemaGroups.js +18 -5
- package/dist/contracts/toolOutputSchemaPrimitives.js +9 -6
- package/dist/contracts/toolSchemaMetadata.js +5 -8
- package/dist/doctorRuntime.js +0 -41
- package/dist/domain/analysisErrorPresentation.js +4 -28
- package/dist/domain/analysisErrorProjection.js +33 -50
- package/dist/domain/analysisProfile.js +1 -1
- package/dist/domain/analysisSnapshot.js +77 -3
- package/dist/domain/androidApplication.js +5 -4
- package/dist/domain/appleApplication.js +5 -4
- package/dist/domain/appleAssetCatalog.js +127 -0
- package/dist/domain/artifactComparison.js +7 -11
- package/dist/domain/artifactGraph.js +8 -6
- package/dist/domain/artifactInspection.js +13 -12
- package/dist/domain/binaryTarget.js +23 -9
- package/dist/domain/browserObservation.js +43 -24
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenario.js +7 -107
- package/dist/domain/browserScenarioCapture.js +0 -1
- package/dist/domain/browserScenarioCaptureValues.js +5 -4
- package/dist/domain/browserScenarioDiff.js +1 -3
- package/dist/domain/browserScenarioValues.js +16 -107
- package/dist/domain/bundleComparison.js +18 -17
- package/dist/domain/callPathSchemas.js +17 -7
- package/dist/domain/changedBehavior.js +2 -3
- package/dist/domain/comparisonSemantics.js +19 -0
- package/dist/domain/completionLedgerGeneration.js +3 -2
- package/dist/domain/conformancePackage.js +2 -1
- package/dist/domain/conformanceTrustGate.js +3 -5
- package/dist/domain/customProtocolCapture.js +2 -2
- package/dist/domain/digests.js +30 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/electronActiveObservation.js +7 -5
- package/dist/domain/electronObservation.js +3 -2
- package/dist/domain/electronStaticAnalysisNative.js +15 -6
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/errors.js +10 -28
- package/dist/domain/evidence.js +5 -3
- package/dist/domain/evidenceCompletionLedger.js +3 -2
- package/dist/domain/functionComparisonNormalization.js +24 -18
- package/dist/domain/functionComparisonResults.js +3 -7
- package/dist/domain/functionComparisonSchemas.js +3 -2
- package/dist/domain/hopperValues.js +108 -8
- package/dist/domain/javascriptApplicationAnalysis.js +4 -7
- package/dist/domain/javascriptApplicationEvidenceSchemas.js +4 -3
- package/dist/domain/javascriptApplicationGraphSchemas.js +8 -7
- package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +9 -7
- package/dist/domain/javascriptApplicationVersionItems.js +12 -18
- package/dist/domain/javascriptAstValues.js +4 -0
- package/dist/domain/javascriptExportShapeComparison.js +1 -6
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +6 -10
- package/dist/domain/javascriptExportShapeVariants.js +15 -2
- package/dist/domain/javascriptFeatureTraceSchemas.js +8 -7
- package/dist/domain/javascriptRuntimeObservation.js +14 -2
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +8 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +4 -2
- package/dist/domain/javascriptRuntimeReconciliationResult.js +6 -4
- package/dist/domain/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +19 -18
- package/dist/domain/javascriptRuntimeStaticCandidates.js +18 -6
- package/dist/domain/javascriptSemanticAnalysis.js +57 -19
- package/dist/domain/javascriptSemanticAsyncEffects.js +39 -40
- package/dist/domain/javascriptSemanticCalls.js +46 -27
- package/dist/domain/javascriptSemanticChildProcesses.js +43 -50
- package/dist/domain/javascriptSemanticDataEffectHelpers.js +91 -18
- package/dist/domain/javascriptSemanticDataEffects.js +22 -10
- package/dist/domain/javascriptSemanticGraphSchemas.js +8 -6
- package/dist/domain/javascriptSemanticObjects.js +13 -3
- package/dist/domain/javascriptSemanticProjection.js +144 -38
- package/dist/domain/javascriptSemanticPromises.js +14 -27
- package/dist/domain/javascriptSemanticQuerySchemas.js +6 -9
- package/dist/domain/javascriptSemanticResources.js +2 -5
- package/dist/domain/javascriptSemanticState.js +4 -0
- package/dist/domain/javascriptSemanticTraceSchemas.js +2 -1
- package/dist/domain/javascriptSemanticTraversal.js +13 -5
- package/dist/domain/javascriptSemanticValues.js +10 -9
- package/dist/domain/javascriptSourceParser.js +5 -1
- package/dist/domain/javascriptStaticAnalysisCalls.js +8 -5
- package/dist/domain/javascriptStaticAnalysisHelpers.js +16 -7
- package/dist/domain/keyedArchive.js +181 -0
- package/dist/domain/managedApplicationGraph.js +4 -3
- package/dist/domain/managedArtifact.js +2 -1
- package/dist/domain/managedMemberComparison.js +18 -13
- package/dist/domain/managedMemberComparisonCoverage.js +2 -1
- package/dist/domain/managedMemberComparisonItems.js +27 -7
- package/dist/domain/managedMemberComparisonMatch.js +22 -6
- package/dist/domain/managedNativeVerificationMatch.js +2 -2
- package/dist/domain/managedNativeVerificationSchemas.js +7 -5
- package/dist/domain/managedReconstruction.js +6 -5
- package/dist/domain/nativeApiBoundary.js +7 -0
- package/dist/domain/nativeDataType.js +51 -0
- package/dist/domain/nativeInspection.js +0 -1
- package/dist/domain/nativeInstruction.js +82 -0
- package/dist/domain/nativeInvestigationGraph.js +9 -5
- package/dist/domain/nativeUiObservation.js +123 -0
- package/dist/domain/nativeValueFlow.js +17 -0
- package/dist/domain/nativeValueTrace.js +64 -0
- package/dist/domain/objcSwiftMetadata.js +39 -0
- package/dist/domain/peInspection.js +1 -0
- package/dist/domain/processCapture.js +5 -55
- package/dist/domain/processCaptureExample.js +0 -9
- package/dist/domain/processCaptureValidation.js +13 -144
- package/dist/domain/processComparison.js +3 -25
- package/dist/domain/processObservation.js +0 -29
- package/dist/domain/processScenario.js +28 -228
- package/dist/domain/processTraceDimensionProjection.js +0 -15
- package/dist/domain/processTraceEvaluation.js +0 -6
- package/dist/domain/protocolCapture.js +8 -36
- package/dist/domain/reconstructionCoverage.js +3 -2
- package/dist/domain/reconstructionObligationLedgerSchemas.js +4 -12
- package/dist/domain/reconstructionReadinessSchemas.js +4 -3
- package/dist/domain/reconstructionVerification.js +2 -1
- package/dist/domain/reconstructionVerificationSchemas.js +6 -13
- package/dist/domain/referenceSourceClassification.js +0 -110
- package/dist/domain/referenceSourceGraph.js +15 -5
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/runtimeIdentification.js +6 -5
- package/dist/domain/sourceMapContents.js +5 -0
- package/dist/domain/sourceToBundleComparison.js +3 -10
- package/dist/domain/sourceToBundleComparisonSchemas.js +7 -6
- package/dist/domain/sourceToBundleSignals.js +9 -3
- package/dist/domain/staticRuntimeCorrelation.js +5 -11
- package/dist/domain/webBundleAnalysis.js +17 -9
- package/dist/domain/webBundleAnalyzer.js +1 -1
- package/dist/domain/webCaptureDiff.js +5 -11
- package/dist/domain/webCaptureDiffSchemas.js +2 -1
- package/dist/domain/webMcpDiscovery.js +2 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +15 -7
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +57 -40
- package/dist/dotnet/ManagedMemberRows.js +2 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +15 -8
- package/dist/dotnet/ManagedPeReader.js +2 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +15 -5
- package/dist/ghidra/GhidraClient.js +38 -8
- package/dist/ghidra/GhidraFunctionValues.js +56 -20
- package/dist/ghidra/GhidraInstallation.js +7 -4
- package/dist/ghidra/GhidraInventoryValues.js +44 -9
- package/dist/ghidra/GhidraLauncher.js +18 -3
- package/dist/ghidra/GhidraProvider.js +23 -2
- package/dist/ghidra/GhidraRequestQueue.js +45 -4
- package/dist/ghidra/GhidraSessionValues.js +5 -0
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperProvider.js +29 -6
- package/dist/hopper/HopperTargetLease.js +18 -4
- package/dist/logger.js +0 -13
- package/dist/main/messages.js +0 -1
- package/dist/main/reload.js +3 -32
- package/dist/main/shutdown.js +1 -2
- package/dist/main/transport.js +0 -17
- package/dist/main.js +0 -10
- package/dist/native/AppleDispatchMetadata.js +582 -0
- package/dist/native/AppleObjcProtocols.js +88 -0
- package/dist/native/AppleSwiftVtables.js +86 -0
- package/dist/native/CommandRunner.js +1 -1
- package/dist/native/NativeHostCapabilities.js +23 -0
- package/dist/native/NativeMacOSProvider.js +61 -9
- package/dist/native/NativeMachoInspection.js +39 -6
- package/dist/native/NativeUiHelperRuntime.js +42 -0
- package/dist/native/NativeUiObservation.js +174 -0
- package/dist/native/parsers/codesign.js +4 -1
- package/dist/native/parsers/dyldInfo.js +51 -25
- package/dist/native/parsers/lipo.js +13 -4
- package/dist/native/parsers/otool.js +84 -39
- package/dist/native/parsers/plist.js +2 -1
- package/dist/process/ExecFileOutput.js +5 -1
- package/dist/process/ProcessOwnership.js +69 -33
- package/dist/process/ProcessOwnershipObservation.js +31 -12
- package/dist/process/ProviderProcess.js +4 -2
- package/dist/reference/ReferenceSourceReaderEntries.js +48 -31
- package/dist/reference/ReferenceSourceReaderErrors.js +24 -0
- package/dist/reference/ReferenceSourceReaderFile.js +11 -5
- package/dist/reference/ReferenceSourceReaderValidate.js +22 -8
- package/dist/server/createServer.js +7 -62
- package/dist/server/registerApplicationTools/helpers.js +2 -9
- package/dist/server/registerApplicationTools.js +0 -4
- package/dist/server/registerArtifactComparisonTool.js +1 -1
- package/dist/server/registerBrowserScenarioTool.js +4 -2
- package/dist/server/registerBrowserTools.js +7 -7
- package/dist/server/registerBundleComparisonTool.js +1 -1
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +10 -4
- package/dist/server/registerEnhancedTools.js +20 -12
- package/dist/server/registerEvidenceTools.js +4 -28
- package/dist/server/registerFunctionComparisonTool.js +1 -1
- package/dist/server/registerInvestigationTools.js +6 -6
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -2
- package/dist/server/registerManagedTools.js +28 -14
- package/dist/server/registerManagedWorkflowTools.js +0 -2
- package/dist/server/registerProcessComparisonTool.js +1 -3
- package/dist/server/registerSessionRecordTools.js +9 -9
- package/dist/server/registerSessionStatusTool.js +1 -1
- package/dist/server/registerSessionTools.js +28 -57
- package/dist/server/sessionAvailabilityPolicy.js +2 -3
- package/dist/server/sessionToolPolicies.js +0 -4
- package/dist/server/toolResult.js +8 -10
- package/package.json +32 -22
- package/skills/reverse-engineer-anything/SKILL.md +15 -11
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +3 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +3 -2
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +8 -6
- package/skills/reverse-engineer-anything/references/runtime-observation.md +15 -11
- package/dist/application/CommandShimReplay.js +0 -152
- package/dist/application/ConfiguredRoots.js +0 -19
- package/dist/application/InstrumentedJavaScriptReplayHost.js +0 -36
- package/dist/application/JavaScriptReplayPermission.js +0 -16
- package/dist/application/JavaScriptReplayPlanning.js +0 -207
- package/dist/application/JavaScriptReplayService.js +0 -274
- package/dist/application/LoopbackReplay.js +0 -389
- package/dist/application/LoopbackReplayRecorder.js +0 -129
- package/dist/application/ManagedRuntimeCorrelationService.js +0 -104
- package/dist/application/NodeRuntimeCharacterizationService.js +0 -191
- package/dist/application/PermissionAuthority.js +0 -268
- package/dist/application/PermissionConfiguration.js +0 -26
- package/dist/application/PermissionFailure.js +0 -5
- package/dist/application/ProcessCaptureAuthority.js +0 -24
- package/dist/application/ProcessCapturePermission.js +0 -13
- package/dist/application/ProcessCheckpoints.js +0 -178
- package/dist/application/ProcessReactiveCoordinator.js +0 -223
- package/dist/application/ProcessReactiveEffects.js +0 -153
- package/dist/application/ProcessReactiveHarness.js +0 -106
- package/dist/application/ProcessReactiveObservations.js +0 -105
- package/dist/application/ProjectPermissionStore.js +0 -199
- package/dist/application/RuntimeExecutableDiagnostics.js +0 -198
- package/dist/application/Upgrade.js +0 -134
- package/dist/browser/SensitiveTextCapture.js +0 -8
- package/dist/cliPolicyCommands.js +0 -185
- package/dist/config/browserScenario.js +0 -77
- package/dist/config/electronAutomation.js +0 -35
- package/dist/config/javascriptReplay.js +0 -41
- package/dist/config/managedRuntime.js +0 -25
- package/dist/config/passiveObservation.js +0 -87
- package/dist/config/permissions.js +0 -23
- package/dist/config/processCapture.js +0 -47
- package/dist/contracts/replayMachineExample.js +0 -37
- package/dist/domain/javascriptExportInstrumentation.js +0 -95
- package/dist/domain/javascriptReplay.js +0 -360
- package/dist/domain/managedRuntimeCorrelation.js +0 -181
- package/dist/domain/nodeRuntimeCharacterization.js +0 -63
- package/dist/domain/permissionPolicy.js +0 -176
- package/dist/domain/processCaptureReactiveSchema.js +0 -68
- package/dist/domain/processCaptureReactiveValidation.js +0 -180
- package/dist/domain/processReactiveCheckpointDataflow.js +0 -32
- package/dist/domain/processReactiveMatching.js +0 -196
- package/dist/domain/processReactiveRuntime.js +0 -116
- package/dist/domain/processReactiveScenario.js +0 -296
- package/dist/domain/processReactiveScenarioPreflight.js +0 -95
- package/dist/domain/processReactiveTransition.js +0 -187
- package/dist/domain/replayMachine.js +0 -320
- package/dist/domain/replayMachineRun.js +0 -168
- package/dist/domain/replayMachineRuntime.js +0 -296
- package/dist/domain/replayMachineValues.js +0 -84
- package/dist/domain/runtimeCharacterization.js +0 -84
- package/dist/replay/JavaScriptReplayWorker.js +0 -382
- package/dist/replay/JavaScriptReplayWorkerTypes.js +0 -1
- package/dist/replay/LinuxJavaScriptReplayRunner.js +0 -216
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +0 -121
- package/dist/replay/LinuxRuntimeClosure.js +0 -44
- package/dist/replay/LinuxSeccompPolicy.js +0 -40
- package/dist/replay/ReplayOutcome.js +0 -104
- package/dist/replay/ReplayProcessLifecycle.js +0 -96
- package/dist/replay/ReplaySeccompFile.js +0 -29
- package/dist/replay/ReplayWorkerProtocol.js +0 -58
- package/dist/replay/SystemJavaScriptReplayHost.js +0 -153
- package/dist/server/ProcessCaptureElicitation.js +0 -153
- package/dist/server/registerApplicationTools/characterization.js +0 -46
- package/dist/server/registerApplicationTools/controlledReplay.js +0 -31
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +0 -29
- package/dist/server/registerReplayMachineTool.js +0 -14
- package/skills/reverse-engineer-anything/references/controlled-replay.md +0 -12
|
@@ -264,75 +264,6 @@ const DOCUMENTATION_DIRECTORY_NAMES = new Set([
|
|
|
264
264
|
"wiki",
|
|
265
265
|
"man",
|
|
266
266
|
]);
|
|
267
|
-
const SECRET_BASENAMES = new Set([
|
|
268
|
-
"id_rsa",
|
|
269
|
-
"id_ed25519",
|
|
270
|
-
"pgpass",
|
|
271
|
-
".netrc",
|
|
272
|
-
".npmrc",
|
|
273
|
-
".pypirc",
|
|
274
|
-
".envrc",
|
|
275
|
-
".env.local",
|
|
276
|
-
".env.production",
|
|
277
|
-
".env.development",
|
|
278
|
-
".env.test",
|
|
279
|
-
".env.staging",
|
|
280
|
-
".env.example",
|
|
281
|
-
"auth.json",
|
|
282
|
-
"auth.yaml",
|
|
283
|
-
"auth.yml",
|
|
284
|
-
"token.json",
|
|
285
|
-
"tokens.json",
|
|
286
|
-
"credentials.json",
|
|
287
|
-
"secrets.json",
|
|
288
|
-
"google-services.json",
|
|
289
|
-
"service-account.json",
|
|
290
|
-
".htpasswd",
|
|
291
|
-
]);
|
|
292
|
-
const SECRET_BASENAME_PREFIXES = [
|
|
293
|
-
".env",
|
|
294
|
-
".env.",
|
|
295
|
-
"private",
|
|
296
|
-
"secret",
|
|
297
|
-
"secrets",
|
|
298
|
-
"credential",
|
|
299
|
-
"credentials",
|
|
300
|
-
"token",
|
|
301
|
-
"tokens",
|
|
302
|
-
"password",
|
|
303
|
-
"passwords",
|
|
304
|
-
"auth",
|
|
305
|
-
"apikey",
|
|
306
|
-
"api-key",
|
|
307
|
-
"api_key",
|
|
308
|
-
"service-account",
|
|
309
|
-
"kubeconfig",
|
|
310
|
-
];
|
|
311
|
-
const SECRET_BASENAME_SUFFIXES = [
|
|
312
|
-
".pem",
|
|
313
|
-
".key",
|
|
314
|
-
".p12",
|
|
315
|
-
".gpg",
|
|
316
|
-
".pgp",
|
|
317
|
-
".keystore",
|
|
318
|
-
];
|
|
319
|
-
const SECRET_PATH_SEGMENTS = new Set([
|
|
320
|
-
".ssh",
|
|
321
|
-
".aws",
|
|
322
|
-
".gnupg",
|
|
323
|
-
".pki",
|
|
324
|
-
".docker",
|
|
325
|
-
".secrets",
|
|
326
|
-
"secrets",
|
|
327
|
-
"secret",
|
|
328
|
-
"private",
|
|
329
|
-
"credentials",
|
|
330
|
-
"tokens",
|
|
331
|
-
"passwords",
|
|
332
|
-
"passphrase",
|
|
333
|
-
"kubernetes",
|
|
334
|
-
"k8s",
|
|
335
|
-
]);
|
|
336
267
|
const filenameIsTest = (filename) => {
|
|
337
268
|
const lower = filename.toLowerCase();
|
|
338
269
|
if (lower.includes(".test.") || lower.includes(".spec."))
|
|
@@ -378,47 +309,6 @@ const isPathUnderAny = (path, names) => {
|
|
|
378
309
|
}
|
|
379
310
|
return false;
|
|
380
311
|
};
|
|
381
|
-
const secretPrefixMatches = (filename) => {
|
|
382
|
-
const lower = filename.toLowerCase();
|
|
383
|
-
for (const prefix of SECRET_BASENAME_PREFIXES) {
|
|
384
|
-
const prefixLower = prefix.toLowerCase();
|
|
385
|
-
if (!lower.startsWith(prefixLower))
|
|
386
|
-
continue;
|
|
387
|
-
const nextIndex = prefixLower.length;
|
|
388
|
-
if (nextIndex < lower.length) {
|
|
389
|
-
const next = lower[nextIndex];
|
|
390
|
-
if (next !== "." && next !== "_" && next !== "-")
|
|
391
|
-
continue;
|
|
392
|
-
}
|
|
393
|
-
const extension = basenameParts(filename).ext.toLowerCase();
|
|
394
|
-
if (CODE_EXTENSIONS.has(extension))
|
|
395
|
-
continue;
|
|
396
|
-
return true;
|
|
397
|
-
}
|
|
398
|
-
return false;
|
|
399
|
-
};
|
|
400
|
-
/** Return true when a path or any parent segment matches common secret patterns. */
|
|
401
|
-
export const isSecretLikePath = (path) => {
|
|
402
|
-
const parts = path.split("/").filter((segment) => segment !== "");
|
|
403
|
-
for (const segment of parts) {
|
|
404
|
-
const lower = segment.toLowerCase();
|
|
405
|
-
if (SECRET_PATH_SEGMENTS.has(lower))
|
|
406
|
-
return true;
|
|
407
|
-
}
|
|
408
|
-
const filename = parts[parts.length - 1];
|
|
409
|
-
if (filename === undefined)
|
|
410
|
-
return false;
|
|
411
|
-
const lower = filename.toLowerCase();
|
|
412
|
-
if (SECRET_BASENAMES.has(lower))
|
|
413
|
-
return true;
|
|
414
|
-
if (secretPrefixMatches(filename))
|
|
415
|
-
return true;
|
|
416
|
-
for (const suffix of SECRET_BASENAME_SUFFIXES) {
|
|
417
|
-
if (lower.endsWith(suffix.toLowerCase()))
|
|
418
|
-
return true;
|
|
419
|
-
}
|
|
420
|
-
return false;
|
|
421
|
-
};
|
|
422
312
|
/** Detect a source language from a POSIX path. */
|
|
423
313
|
export const detectReferenceSourceLanguage = (path) => {
|
|
424
314
|
const filename = posix.basename(path);
|
|
@@ -3,7 +3,8 @@ import { posix } from "node:path";
|
|
|
3
3
|
import canonicalize from "canonicalize";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { compareUnicodeCodePoints } from "./unicodeCodePointOrder.js";
|
|
6
|
-
|
|
6
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
7
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
7
8
|
const boundedTextSchema = z.string().min(1);
|
|
8
9
|
const relativePathSchema = z
|
|
9
10
|
.string()
|
|
@@ -67,9 +68,13 @@ const symlinkTargetSchema = z
|
|
|
67
68
|
.string()
|
|
68
69
|
.min(1)
|
|
69
70
|
.refine((target) => target === "<outside-root>" ||
|
|
71
|
+
isPortableAbsoluteSymlinkTarget(target) ||
|
|
70
72
|
(!target.startsWith("/") &&
|
|
71
73
|
!target.includes("\\") &&
|
|
72
74
|
posix.normalize(target) === target), "Expected a normalized POSIX symlink target");
|
|
75
|
+
const isPortableAbsoluteSymlinkTarget = (target) => target.startsWith("/") ||
|
|
76
|
+
/^[A-Za-z]:[\\/]/u.test(target) ||
|
|
77
|
+
/^\\\\[^\\/]+[\\/][^\\/]+/u.test(target);
|
|
73
78
|
const sourceSymlinkSchema = z.strictObject({
|
|
74
79
|
...entryBaseShape,
|
|
75
80
|
kind: z.literal("symlink"),
|
|
@@ -170,7 +175,7 @@ const historicalSourceGraphInputSchema = z.strictObject({
|
|
|
170
175
|
const historicalSourceManifestBaseSchema = z.strictObject({
|
|
171
176
|
schema: z.literal("HistoricalSourceManifest"),
|
|
172
177
|
authority: z.literal("historical-reference"),
|
|
173
|
-
manifest_id:
|
|
178
|
+
manifest_id: prefixedDigestSchema("hsm"),
|
|
174
179
|
graph_sha256: digestSchema,
|
|
175
180
|
root_sha256: digestSchema,
|
|
176
181
|
inventory_state: z.enum(["complete", "partial", "unknown"]),
|
|
@@ -235,11 +240,16 @@ const checkSymlinks = (graph, paths, context) => {
|
|
|
235
240
|
for (const [index, entry] of graph.entries.entries()) {
|
|
236
241
|
if (entry.kind !== "symlink")
|
|
237
242
|
continue;
|
|
238
|
-
|
|
239
|
-
|
|
243
|
+
const absolute = isPortableAbsoluteSymlinkTarget(entry.target);
|
|
244
|
+
if ((entry.target_state === "external" &&
|
|
245
|
+
entry.target !== "<outside-root>" &&
|
|
246
|
+
!absolute) ||
|
|
247
|
+
(entry.target_state === "internal" &&
|
|
248
|
+
(entry.target === "<outside-root>" || absolute)) ||
|
|
249
|
+
(entry.target_state === "missing" && entry.target === "<outside-root>"))
|
|
240
250
|
context.addIssue({
|
|
241
251
|
code: "custom",
|
|
242
|
-
message: "
|
|
252
|
+
message: "Symlink target path does not match its target state",
|
|
243
253
|
path: ["entries", index, "target"],
|
|
244
254
|
});
|
|
245
255
|
if (entry.target_state !== "internal")
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import canonicalize from "canonicalize";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
const
|
|
4
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
5
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
6
|
+
const unknownIdSchema = prefixedDigestSchema("unk");
|
|
6
7
|
const text = z.string().trim().min(1);
|
|
7
8
|
const environmentRequirementSchema = z.object({
|
|
8
9
|
id: z.string().min(1).nullable(),
|
|
@@ -3,8 +3,9 @@ import canonicalize from "canonicalize";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { parseArtifactInventoryEvidence } from "./artifactInventoryEvidence.js";
|
|
5
5
|
import { evidenceSchema } from "./evidence.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
7
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
8
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
8
9
|
const runtimeFamilySchema = z.enum([
|
|
9
10
|
"android",
|
|
10
11
|
"apple",
|
|
@@ -15,7 +16,7 @@ const runtimeFamilySchema = z.enum([
|
|
|
15
16
|
]);
|
|
16
17
|
const observationSchema = z.strictObject({
|
|
17
18
|
path: z.string().min(1),
|
|
18
|
-
artifact_id:
|
|
19
|
+
artifact_id: prefixedDigestSchema("art"),
|
|
19
20
|
sha256: digestSchema,
|
|
20
21
|
format: z.string().min(1),
|
|
21
22
|
});
|
|
@@ -49,7 +50,7 @@ const runtimeIdentificationInputSchema = z.strictObject({
|
|
|
49
50
|
});
|
|
50
51
|
/** Provider-neutral runtime identification with explicit tooling availability. */
|
|
51
52
|
export const runtimeIdentificationResultSchema = z.strictObject({
|
|
52
|
-
identification_id:
|
|
53
|
+
identification_id: prefixedDigestSchema("rid"),
|
|
53
54
|
root_sha256: digestSchema,
|
|
54
55
|
root_format: z.string().min(1),
|
|
55
56
|
source_evidence_ids: z.array(evidenceIdSchema).min(1),
|
|
@@ -193,7 +194,7 @@ const familiesFor = (format, path) => {
|
|
|
193
194
|
families.add("javascript");
|
|
194
195
|
if (format === "jvm-class" || /(?:^|\/)[^/]+\.class$/iu.test(path))
|
|
195
196
|
families.add("jvm");
|
|
196
|
-
if (["elf", "mach-o", "mach-o-universal", "pe"].includes(format))
|
|
197
|
+
if (["elf", "mach-o", "mach-o-universal", "pe", "dos-mz"].includes(format))
|
|
197
198
|
families.add("native");
|
|
198
199
|
if (format === "webassembly" || /(?:^|\/)[^/]+\.wasm$/iu.test(path))
|
|
199
200
|
families.add("webassembly");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Validate optional source-map content against its source inventory. */
|
|
2
|
+
export const hasValidSourceMapContents = (sourceCount, contents) => contents === undefined ||
|
|
3
|
+
(Array.isArray(contents) &&
|
|
4
|
+
contents.length === sourceCount &&
|
|
5
|
+
contents.every((content) => content === null || typeof content === "string"));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import canonicalize from "canonicalize";
|
|
1
|
+
import { absenceClaimable, canonicalDigest } from "./comparisonSemantics.js";
|
|
3
2
|
import { SOURCE_TO_BUNDLE_SIGNAL_WEIGHTS, sourceToBundleComparisonResultSchema, } from "./sourceToBundleComparisonSchemas.js";
|
|
4
3
|
import { buildSourceToBundleCandidateIndex, candidateIdsForSource, historicalSourceFiles, scoreSourceToBundleCandidate, sourceBearingNodes, } from "./sourceToBundleSignals.js";
|
|
5
4
|
/** Compare historical source files to static source-bearing application nodes. */
|
|
@@ -47,8 +46,7 @@ const projectComparison = (input) => {
|
|
|
47
46
|
currentNodes,
|
|
48
47
|
index,
|
|
49
48
|
absenceComplete: input.reference.inventory_state === "complete" &&
|
|
50
|
-
input.application.graph.coverage
|
|
51
|
-
!input.application.graph.coverage.truncated,
|
|
49
|
+
absenceClaimable(input.application.graph.coverage),
|
|
52
50
|
factors: {
|
|
53
51
|
input,
|
|
54
52
|
},
|
|
@@ -249,11 +247,6 @@ const comparisonLimitations = (factors) => uniqueSorted([
|
|
|
249
247
|
const hasSignal = (candidate, kind) => candidate.signals.some((signal) => signal.kind === kind);
|
|
250
248
|
const compareCandidates = (left, right) => right.score - left.score ||
|
|
251
249
|
compareText(left.current_node_id, right.current_node_id);
|
|
252
|
-
const digestCanonical = (value) =>
|
|
253
|
-
const encoded = canonicalize(value);
|
|
254
|
-
if (encoded === undefined)
|
|
255
|
-
throw new TypeError("Source-to-bundle comparison could not canonicalize");
|
|
256
|
-
return createHash("sha256").update(encoded).digest("hex");
|
|
257
|
-
};
|
|
250
|
+
const digestCanonical = (value) => canonicalDigest(value, "Source-to-bundle comparison");
|
|
258
251
|
const uniqueSorted = (values) => [...new Set(values)].sort(compareText);
|
|
259
252
|
const compareText = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
@@ -2,9 +2,10 @@ import { z } from "zod";
|
|
|
2
2
|
import { evidenceSchema } from "./evidence.js";
|
|
3
3
|
import { JAVASCRIPT_APPLICATION_NODE_KINDS } from "./javascriptApplicationGraphSchemas.js";
|
|
4
4
|
import { historicalSourceGraphSchema } from "./referenceSourceGraph.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
5
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
6
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
7
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
8
|
+
const nodeIdSchema = prefixedDigestSchema("jag_node");
|
|
8
9
|
const textSchema = z.string().min(1);
|
|
9
10
|
export const SOURCE_TO_BUNDLE_SIGNAL_WEIGHTS = [
|
|
10
11
|
["exact-source-digest", 100],
|
|
@@ -41,7 +42,7 @@ const sourceToBundleCandidateSchema = z.strictObject({
|
|
|
41
42
|
signals: z.array(sourceToBundleSignalSchema).min(1),
|
|
42
43
|
});
|
|
43
44
|
const sourceToBundleItemSchema = z.strictObject({
|
|
44
|
-
mapping_id:
|
|
45
|
+
mapping_id: prefixedDigestSchema("stbc_item"),
|
|
45
46
|
source_path: textSchema,
|
|
46
47
|
source_sha256: digestSchema.nullable(),
|
|
47
48
|
source_language: textSchema.nullable(),
|
|
@@ -61,14 +62,14 @@ const sourceToBundleItemSchema = z.strictObject({
|
|
|
61
62
|
});
|
|
62
63
|
/** Deterministic, evidence-bearing historical-source to shipped-bundle comparison. */
|
|
63
64
|
export const sourceToBundleComparisonResultSchema = z.strictObject({
|
|
64
|
-
comparison_id:
|
|
65
|
+
comparison_id: prefixedDigestSchema("stbc"),
|
|
65
66
|
reference: z.strictObject({
|
|
66
67
|
root_sha256: digestSchema,
|
|
67
68
|
inventory_state: z.enum(["complete", "partial", "unknown"]),
|
|
68
69
|
}),
|
|
69
70
|
application: z.strictObject({
|
|
70
71
|
evidence_id: evidenceIdSchema,
|
|
71
|
-
graph_id:
|
|
72
|
+
graph_id: prefixedDigestSchema("jag"),
|
|
72
73
|
root_artifact_sha256: digestSchema,
|
|
73
74
|
}),
|
|
74
75
|
scoring: z.strictObject({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import { SOURCE_TO_BUNDLE_SIGNAL_WEIGHTS, } from "./sourceToBundleComparisonSchemas.js";
|
|
3
|
+
import { isDigest } from "./digests.js";
|
|
3
4
|
const RELEVANT_NODE_KINDS = new Set([
|
|
4
5
|
"javascript-asset",
|
|
5
6
|
"javascript-module",
|
|
@@ -170,9 +171,15 @@ const addPath = (paths, kind, raw) => {
|
|
|
170
171
|
if (value !== null)
|
|
171
172
|
paths.push({ kind, value });
|
|
172
173
|
};
|
|
174
|
+
/** Matches a `scheme://...` URL prefix; bare filesystem paths keep `?`/`#`. */
|
|
175
|
+
const SCHEME_URL = /^[a-z][a-z0-9+.-]*:\/\//iu;
|
|
176
|
+
/** Matches a `scheme://...` URL prefix with any run of slashes, for stripping. */
|
|
177
|
+
const SCHEME_URL_PREFIX = /^[a-z][a-z0-9+.-]*:\/\/+/iu;
|
|
173
178
|
const normalizeCurrentPath = (raw) => {
|
|
174
|
-
const withoutQuery =
|
|
175
|
-
|
|
179
|
+
const withoutQuery = SCHEME_URL.test(raw)
|
|
180
|
+
? (raw.split(/[?#]/u, 1)[0] ?? "")
|
|
181
|
+
: raw;
|
|
182
|
+
const withoutScheme = withoutQuery.replace(SCHEME_URL_PREFIX, "");
|
|
176
183
|
const parts = withoutScheme
|
|
177
184
|
.replaceAll("\\", "/")
|
|
178
185
|
.split("/")
|
|
@@ -193,5 +200,4 @@ const addIndexValue = (index, key, nodeId) => {
|
|
|
193
200
|
values.add(nodeId);
|
|
194
201
|
index.set(key, values);
|
|
195
202
|
};
|
|
196
|
-
const isDigest = (value) => /^[a-f0-9]{64}$/u.test(value);
|
|
197
203
|
const compareText = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
@@ -5,7 +5,9 @@ import { artifactComparisonResultSchema } from "./artifactComparison.js";
|
|
|
5
5
|
import { evidenceSchema, parseEvidence } from "./evidence.js";
|
|
6
6
|
import { functionComparisonResultSchema } from "./functionComparison.js";
|
|
7
7
|
import { comparisonStatusSchema, processCaptureComparisonSchema, } from "./processCapture.js";
|
|
8
|
-
|
|
8
|
+
import { PROCESS_COMPARISON_DIMENSIONS } from "./processComparison.js";
|
|
9
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
10
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
9
11
|
const functionDimensionSchema = z.enum([
|
|
10
12
|
"identity",
|
|
11
13
|
"pseudocode",
|
|
@@ -16,15 +18,7 @@ const functionDimensionSchema = z.enum([
|
|
|
16
18
|
"strings_names",
|
|
17
19
|
"cfg",
|
|
18
20
|
]);
|
|
19
|
-
const runtimeDimensionSchema = z.enum(
|
|
20
|
-
"terminal",
|
|
21
|
-
"interaction",
|
|
22
|
-
"exit",
|
|
23
|
-
"filesystem",
|
|
24
|
-
"protocol",
|
|
25
|
-
"process",
|
|
26
|
-
"shim",
|
|
27
|
-
]);
|
|
21
|
+
const runtimeDimensionSchema = z.enum(PROCESS_COMPARISON_DIMENSIONS);
|
|
28
22
|
const expectedPatternSchema = z.enum([
|
|
29
23
|
"cochanged",
|
|
30
24
|
"static_only",
|
|
@@ -81,7 +75,7 @@ export const staticRuntimeCorrelationInputSchema = z
|
|
|
81
75
|
})
|
|
82
76
|
.strict();
|
|
83
77
|
const correlationItemSchema = z.object({
|
|
84
|
-
correlation_id:
|
|
78
|
+
correlation_id: prefixedDigestSchema("cor"),
|
|
85
79
|
static: z.object({
|
|
86
80
|
comparison_evidence_id: evidenceIdSchema,
|
|
87
81
|
selector: staticSelectorSchema,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { emptyArraySchema } from "./emptyArraySchema.js";
|
|
2
3
|
import { inspectWebPageWithSourceInputSchema } from "./browserObservation.js";
|
|
3
4
|
import { webTextArtifactSchema } from "./webContentArtifact.js";
|
|
4
5
|
/** Capture-and-analyze input with optional source-map fetching. */
|
|
@@ -57,14 +58,20 @@ const sourceMapSchema = z.union([
|
|
|
57
58
|
status: z.literal("included"),
|
|
58
59
|
limitation: z.null(),
|
|
59
60
|
}),
|
|
61
|
+
z.object({
|
|
62
|
+
...sourceMapContextShape,
|
|
63
|
+
...parsedSourceMapShape,
|
|
64
|
+
status: z.literal("partial"),
|
|
65
|
+
limitation: z.string(),
|
|
66
|
+
}),
|
|
60
67
|
z.object({
|
|
61
68
|
...sourceMapContextShape,
|
|
62
69
|
...parsedSourceMapShape,
|
|
63
70
|
status: z.enum(["fetch_failed", "invalid", "policy_filtered"]),
|
|
64
71
|
artifact: z.null(),
|
|
65
|
-
original_sources:
|
|
66
|
-
original_module_edges:
|
|
67
|
-
mappings:
|
|
72
|
+
original_sources: emptyArraySchema,
|
|
73
|
+
original_module_edges: emptyArraySchema,
|
|
74
|
+
mappings: emptyArraySchema,
|
|
68
75
|
limitation: z.string(),
|
|
69
76
|
}),
|
|
70
77
|
]);
|
|
@@ -90,14 +97,15 @@ export const webSourceMapsSchema = z
|
|
|
90
97
|
message: "Source-map coverage counts are inconsistent",
|
|
91
98
|
});
|
|
92
99
|
const statuses = sourceMaps.items.map(({ status }) => status);
|
|
93
|
-
const
|
|
100
|
+
const retained = statuses.filter((status) => status === "included" || status === "partial").length;
|
|
94
101
|
const allowedStatuses = sourceMaps.items.length === 0
|
|
95
102
|
? ["not_requested", "unavailable"]
|
|
96
|
-
:
|
|
97
|
-
? ["
|
|
98
|
-
:
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
: retained === 0
|
|
104
|
+
? ["unavailable"]
|
|
105
|
+
: retained === sourceMaps.items.length &&
|
|
106
|
+
!statuses.includes("partial")
|
|
107
|
+
? ["included"]
|
|
108
|
+
: ["partial"];
|
|
101
109
|
if (!allowedStatuses.includes(sourceMaps.status))
|
|
102
110
|
context.addIssue({
|
|
103
111
|
code: "custom",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { analyzeScript, emptyAccumulator, isIncludedScript, } from "./webBundleAnalyzerInspection.js";
|
|
2
2
|
import { buildWebBundleAnalysis } from "./webBundleAnalyzerResult.js";
|
|
3
|
-
/** Analyze captured
|
|
3
|
+
/** Analyze selected captured JavaScript source without execution. */
|
|
4
4
|
export const analyzeCapturedWebBundle = (inspection, sourceMaps = {
|
|
5
5
|
status: "not_requested",
|
|
6
6
|
requested: 0,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import canonicalize from "canonicalize";
|
|
1
|
+
import { canonicalDigest } from "./comparisonSemantics.js";
|
|
3
2
|
import { webCaptureDiffSchema, } from "./webCaptureDiffSchemas.js";
|
|
4
3
|
export { captureSnapshotSchema, compareWebCapturesInputSchema, webCaptureDiffSchema, } from "./webCaptureDiffSchemas.js";
|
|
5
4
|
/** Compare normalized observations without treating incomplete absence as proof. */
|
|
@@ -26,8 +25,8 @@ export const compareWebCaptures = (input) => {
|
|
|
26
25
|
limitations: [
|
|
27
26
|
"A changed status proves an observed difference; an unknown status means absence could not be established from capture completeness.",
|
|
28
27
|
"Network comparison covers only activity observed after each CDP attachment.",
|
|
29
|
-
"Accessibility roles, ignored state, text, and hierarchy are compared only when the accessibility tree was fully captured and text capture was
|
|
30
|
-
"Storage key inventories are compared only when
|
|
28
|
+
"Accessibility roles, ignored state, text, and hierarchy are compared only when the accessibility tree was fully captured and text capture was selected and not truncated.",
|
|
29
|
+
"Storage key inventories are compared only when selected and complete; usage and quota are compared only when reported. Redacted content is compared through complete SHA-256 fingerprints.",
|
|
31
30
|
],
|
|
32
31
|
});
|
|
33
32
|
};
|
|
@@ -47,7 +46,7 @@ const compareIdentities = (before, after) => {
|
|
|
47
46
|
left.change.localeCompare(right.change));
|
|
48
47
|
};
|
|
49
48
|
const compareDimension = (before, after, complete, reason) => {
|
|
50
|
-
const all = compareIdentities(before, after);
|
|
49
|
+
const all = compareIdentities(before, after).filter(({ change }) => complete || change === "modified");
|
|
51
50
|
if (all.length > 0)
|
|
52
51
|
return {
|
|
53
52
|
status: "changed",
|
|
@@ -173,12 +172,7 @@ const metadataProjection = (inspection) => ({
|
|
|
173
172
|
headers_allowlisted: inspection.metadata.headers_allowlisted,
|
|
174
173
|
});
|
|
175
174
|
const singleton = (key, value) => new Map([[key, value]]);
|
|
176
|
-
const digest = (value) =>
|
|
177
|
-
const encoded = canonicalize(value);
|
|
178
|
-
if (encoded === undefined)
|
|
179
|
-
throw new TypeError("Expected canonical JSON");
|
|
180
|
-
return createHash("sha256").update(encoded).digest("hex");
|
|
181
|
-
};
|
|
175
|
+
const digest = (value) => canonicalDigest(value);
|
|
182
176
|
const accessibilityComparable = (inspection) => {
|
|
183
177
|
const text = inspection.accessibility.text_capture.status === "included" &&
|
|
184
178
|
inspection.accessibility.text_capture.excluded_fields === 0;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { emptyArraySchema } from "./emptyArraySchema.js";
|
|
2
3
|
import { webPageInspectionSchema } from "./browserObservation.js";
|
|
3
4
|
import { webMcpDiscoverySchema } from "./webMcpDiscovery.js";
|
|
4
5
|
/** One normalized passive page snapshot accepted by capture comparison. */
|
|
@@ -17,7 +18,7 @@ const changeSchema = z.object({
|
|
|
17
18
|
});
|
|
18
19
|
const emptyDimensionShape = {
|
|
19
20
|
total_changes: z.literal(0),
|
|
20
|
-
changes:
|
|
21
|
+
changes: emptyArraySchema,
|
|
21
22
|
};
|
|
22
23
|
const dimensionSchema = z.union([
|
|
23
24
|
z
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { browserCompletenessSchema } from "./browserCompleteness.js";
|
|
3
3
|
import { browserAllowedOriginsSchema, browserEndpointSchema, } from "./browserObservation.js";
|
|
4
4
|
import { jsonShapeSchema } from "./jsonShape.js";
|
|
5
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
5
6
|
/** Input for passive discovery of page-registered WebMCP tools. */
|
|
6
7
|
export const discoverWebMcpToolsInputSchema = z.strictObject({
|
|
7
8
|
cdp_endpoint: browserEndpointSchema,
|
|
@@ -17,7 +18,7 @@ const browserVersionSchema = z.object({
|
|
|
17
18
|
js_version: z.string(),
|
|
18
19
|
});
|
|
19
20
|
const webMcpToolSchema = z.object({
|
|
20
|
-
tool_key:
|
|
21
|
+
tool_key: prefixedDigestSchema("webmcp"),
|
|
21
22
|
name: z.string(),
|
|
22
23
|
description: z.string(),
|
|
23
24
|
frame_id: z.string(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { managedFailure, ManagedReaderFailure, } from "./ManagedReaderFailure.js";
|
|
1
2
|
import {} from "./ManagedMetadataLayout.js";
|
|
2
3
|
import { metadataRowCursor, metadataCodedToken, metadataToken, readMetadataString, sha256Bytes, } from "./ManagedMetadataHeaps.js";
|
|
3
4
|
const rowRange = (table, start, nextStart) => {
|
|
@@ -98,7 +99,7 @@ export const parseTypes = (bytes, layout, ranges) => {
|
|
|
98
99
|
const readCompressed = (bytes, offset) => {
|
|
99
100
|
const first = bytes[offset];
|
|
100
101
|
if (first === undefined)
|
|
101
|
-
throw
|
|
102
|
+
throw managedFailure("invalid-blob", "signature", "truncated compressed integer", offset);
|
|
102
103
|
if ((first & 0x80) === 0)
|
|
103
104
|
return { value: first, next: offset + 1 };
|
|
104
105
|
const second = bytes[offset + 1];
|
|
@@ -115,7 +116,7 @@ const readCompressed = (bytes, offset) => {
|
|
|
115
116
|
value: (first & 0x1f) * 0x01_00_00_00 + b1 * 0x01_00_00 + b2 * 0x0100 + b3,
|
|
116
117
|
next: offset + 4,
|
|
117
118
|
};
|
|
118
|
-
throw
|
|
119
|
+
throw managedFailure("invalid-blob", "signature", "reserved compressed integer", offset);
|
|
119
120
|
};
|
|
120
121
|
const ELEMENT_TYPES = new Map([
|
|
121
122
|
[0x01, "void"],
|
|
@@ -143,7 +144,7 @@ const ELEMENT_TYPE_SUFFIXES = new Map([
|
|
|
143
144
|
const readTypeSignature = (blob, offset) => {
|
|
144
145
|
const kind = blob[offset];
|
|
145
146
|
if (kind === undefined)
|
|
146
|
-
throw
|
|
147
|
+
throw managedFailure("invalid-blob", "signature", "truncated type signature", offset);
|
|
147
148
|
const named = ELEMENT_TYPES.get(kind);
|
|
148
149
|
if (named !== undefined)
|
|
149
150
|
return { value: named, next: offset + 1 };
|
|
@@ -171,7 +172,7 @@ const readTypeSignature = (blob, offset) => {
|
|
|
171
172
|
const variable = readCompressed(blob, offset + 1);
|
|
172
173
|
return { value: `var:${String(variable.value)}`, next: variable.next };
|
|
173
174
|
}
|
|
174
|
-
throw
|
|
175
|
+
throw managedFailure("unsupported-signature", "signature", `unsupported element type 0x${kind.toString(16)}`, offset);
|
|
175
176
|
};
|
|
176
177
|
const callingConvention = (value) => {
|
|
177
178
|
const base = value & 0x0f;
|
|
@@ -196,7 +197,7 @@ export const signature = (blob) => {
|
|
|
196
197
|
};
|
|
197
198
|
try {
|
|
198
199
|
if (blob.length === 0)
|
|
199
|
-
throw
|
|
200
|
+
throw managedFailure("invalid-blob", "signature", "empty signature", 0);
|
|
200
201
|
const first = blob[0] ?? 0;
|
|
201
202
|
if ((first & 0x0f) === 6) {
|
|
202
203
|
const fieldType = readTypeSignature(blob, 1);
|
|
@@ -244,17 +245,24 @@ export const signature = (blob) => {
|
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
247
|
catch (cause) {
|
|
248
|
+
if (!(cause instanceof ManagedReaderFailure))
|
|
249
|
+
throw cause;
|
|
250
|
+
if (cause.issue.code !== "invalid-blob" &&
|
|
251
|
+
cause.issue.code !== "unsupported-signature")
|
|
252
|
+
throw cause;
|
|
247
253
|
return {
|
|
248
254
|
...raw,
|
|
249
255
|
kind: "unknown",
|
|
250
|
-
parse_status: cause
|
|
256
|
+
parse_status: cause.issue.code === "unsupported-signature"
|
|
257
|
+
? "unsupported"
|
|
258
|
+
: "malformed",
|
|
251
259
|
calling_convention: null,
|
|
252
260
|
generic_parameter_count: null,
|
|
253
261
|
parameter_count: null,
|
|
254
262
|
return_type: null,
|
|
255
263
|
parameter_types: [],
|
|
256
264
|
field_type: null,
|
|
257
|
-
issue: cause
|
|
265
|
+
issue: cause.issue.detail,
|
|
258
266
|
};
|
|
259
267
|
}
|
|
260
268
|
};
|