rea-agents 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +597 -209
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +186 -0
- package/dist/adb/AdbProvider.js +1190 -0
- package/dist/adb/AdbShellOutput.js +309 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxConfiguration.js +44 -24
- package/dist/android/JadxProvider.js +51 -19
- package/dist/apktool/ApktoolConfiguration.js +84 -0
- package/dist/apktool/ApktoolDecodeOutput.js +59 -0
- package/dist/apktool/ApktoolProvider.js +506 -0
- package/dist/application/AnalysisProvider.js +8 -2
- package/dist/application/AppBundleExecutable.js +27 -22
- package/dist/application/BinaryTargetResolver.js +22 -2
- package/dist/application/CapabilityInventory.js +11 -1
- package/dist/application/ClientConfigurationDocument.js +70 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +35 -0
- package/dist/application/ClientRegistrationStatus.js +66 -31
- package/dist/application/DirectAnalysis.js +2 -2
- package/dist/application/DirectAnalysisCleanup.js +1 -1
- package/dist/application/DirectAnalysisStatus.js +1 -1
- package/dist/application/Doctor.js +5 -3
- package/dist/application/DoctorDiagnostics.js +1 -1
- package/dist/application/EvidenceBundleCommands.js +6 -12
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/JsonFiles.js +6 -5
- package/dist/{cliJsonFile.js → application/JsonInputFile.js} +108 -35
- package/dist/application/LinuxHopper.js +4 -12
- package/dist/application/MacHopper.js +172 -149
- package/dist/application/MipsElfAbiFlags.js +140 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/ReconstructionObligationCandidates.js +9 -3
- package/dist/application/ReferenceSourceImport.js +76 -29
- package/dist/application/ReferenceSourceImportEntries.js +18 -9
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -22
- package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
- package/dist/application/RegularFileRead.js +93 -7
- package/dist/application/Setup.js +54 -6
- package/dist/application/SetupClientConfiguration.js +116 -16
- package/dist/application/SetupHost.js +102 -24
- package/dist/application/SetupPlan.js +5 -8
- package/dist/application/SetupSkill.js +58 -39
- package/dist/application/SupportedClients.js +290 -65
- package/dist/application/Uninstall.js +158 -10
- package/dist/application/UpdateMaintenance.js +17 -21
- package/dist/application/Utf8JsonInput.js +7 -0
- package/dist/application/WebScriptExportService.js +131 -65
- package/dist/application/WebSourceLocationService.js +3 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +40 -2
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/BinarySession.js +2 -1
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
- package/dist/application/evm/EvmInterfaceService.js +3 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +19 -6
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
- package/dist/application/javascript/JavaScriptApplicationService.js +22 -11
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -30
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +67 -19
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +19 -16
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +258 -235
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +115 -26
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -1
- package/dist/application/javascript/JavaScriptModuleRelationships.js +6 -4
- package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +199 -61
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
- package/dist/application/native/NativeUiActionTrace.js +16 -8
- package/dist/application/native/NativeValueTrace.js +23 -6
- package/dist/application/process/ProcessCli.js +25 -20
- package/dist/artifacts/ArtifactPaths.js +129 -8
- package/dist/artifacts/ArtifactProvider.js +20 -15
- package/dist/artifacts/ArtifactReader.js +23 -0
- package/dist/artifacts/ArtifactResourceScope.js +100 -0
- package/dist/artifacts/AsarArtifactReader.js +176 -102
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +168 -65
- package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
- package/dist/artifacts/NativeDmgArtifactReader.js +29 -22
- package/dist/artifacts/SafeOutputTree.js +245 -70
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +77 -27
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +32 -13
- package/dist/artifacts/extraction/ArtifactExtraction.js +110 -86
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +110 -43
- package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
- package/dist/artifacts/inventory/classify.js +75 -32
- package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
- package/dist/artifacts/inventory/reader.js +13 -5
- package/dist/artifacts/inventory/scanCanonical.js +62 -25
- package/dist/artifacts/inventory/scanReader.js +38 -11
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +15 -9
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
- package/dist/browser/BrowserScenarioSecrets.js +52 -37
- package/dist/browser/CdpBrowserProvider.js +5 -0
- package/dist/browser/CdpCaptureDocuments.js +40 -6
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
- package/dist/browser/CdpCaptureEventHandlers.js +26 -9
- package/dist/browser/CdpCaptureEvents.js +4 -9
- package/dist/browser/CdpConnection.js +22 -5
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpTargetSession.js +30 -34
- package/dist/browser/CdpWebMcpDiscovery.js +32 -10
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +60 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +69 -7
- package/dist/browser/PlaywrightScenarioSession.js +127 -54
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +3 -3
- package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
- package/dist/browser/assets/PublishWebScripts.js +75 -20
- package/dist/browser/assets/WebArtifactReads.js +23 -1
- package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/HarCapture.js +14 -0
- package/dist/browser/history/HarCaptureProcess.js +2 -10
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/modules/WebModuleArtifacts.js +1 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/artifactCommands.js +8 -11
- package/dist/cli/binaryDiagnosticsCommands.js +19 -1
- package/dist/cli/browserAdvancedCommands.js +65 -36
- package/dist/cli/coreBinaryCommands.js +0 -5
- package/dist/cli/coreNativeCommands.js +1 -14
- package/dist/cli/electronCommands.js +6 -1
- package/dist/cli/evmCommands.js +13 -4
- package/dist/cli/firmwareCommands.js +7 -2
- package/dist/cli/javascriptApplicationAnalysis.js +17 -1
- package/dist/cli/javascriptRecoveryCommands.js +22 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +11 -4
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/setupCommands.js +15 -3
- package/dist/cli/utilityCommands.js +66 -18
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli.js +6 -0
- package/dist/cliBrowserScenarioCommands.js +2 -1
- package/dist/cliCommandNames.js +32 -0
- package/dist/cliJsonInput.js +2 -2
- package/dist/cliObservationOptions.js +3 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/directAnalysis.js +12 -4
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/config/environment.js +10 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/parseConfig.js +28 -1
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +10 -0
- package/dist/contracts/analysisViewToolContracts.js +17 -2
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/artifactToolContracts.js +8 -5
- package/dist/contracts/browserToolContracts.js +1 -1
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +10 -10
- package/dist/contracts/javascript/electronToolContracts.js +15 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
- package/dist/contracts/officialToolContracts.js +5 -5
- package/dist/contracts/sessionToolContracts.js +2 -2
- package/dist/contracts/sessionToolSchemas.js +6 -2
- package/dist/contracts/toolContractExamples.js +6 -0
- package/dist/contracts/toolContractTypes.js +3 -0
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +167 -0
- package/dist/contracts/toolOutputSchemaGroups.js +5 -3
- package/dist/contracts/toolSchemaMetadata.js +82 -7
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorPresentation.js +18 -6
- package/dist/domain/analysisErrorProjection.js +4 -1
- package/dist/domain/analysisSnapshot.js +2 -1
- package/dist/domain/analysisView/analysisView.js +52 -2
- package/dist/domain/analysisView/binaryLayoutView.js +2 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/android/androidApplication.js +25 -20
- package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
- package/dist/domain/apple/appleApplication.js +40 -23
- package/dist/domain/apple/appleBundleAnatomy.js +95 -28
- package/dist/domain/apple/dyldPaths.js +9 -1
- package/dist/domain/apple/dylibResolution.js +2 -2
- package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
- package/dist/domain/artifactComparison.js +35 -7
- package/dist/domain/artifactGraph.js +5 -3
- package/dist/domain/artifactIdentity.js +30 -2
- package/dist/domain/artifactInspection.js +3 -43
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +11 -12
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +16 -0
- package/dist/domain/binaryTargetTypes.js +8 -1
- package/dist/domain/browserObservationSchemas.js +8 -4
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/evidence.js +2 -1
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +12 -13
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +11 -20
- package/dist/domain/javascript/electronStaticAnalysisNative.js +70 -40
- package/dist/domain/javascript/electronStaticAnalysisValues.js +16 -0
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +4 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +6 -6
- package/dist/domain/javascript/javascriptApplicationGraph.js +79 -18
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +9 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +58 -31
- package/dist/domain/javascript/javascriptAstValues.js +32 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +6 -1
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +8 -11
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +190 -33
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +42 -41
- package/dist/domain/javascript/javascriptSemanticGraph.js +69 -23
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -10
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +40 -7
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +341 -87
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +7 -1
- package/dist/domain/javascript/javascriptSemanticProjection.js +52 -14
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
- package/dist/domain/javascript/javascriptSemanticQuery.js +27 -29
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +13 -23
- package/dist/domain/javascript/javascriptSemanticState.js +22 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +19 -1
- package/dist/domain/javascript/javascriptSemanticValues.js +47 -19
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +8 -6
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonShape.js +63 -52
- package/dist/domain/jsonValue.js +3 -0
- package/dist/domain/managed/managedApplicationGraph.js +37 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +32 -22
- package/dist/domain/managed/managedArtifact.js +1 -0
- package/dist/domain/managed/managedInspectionEvidence.js +13 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeInstruction.js +21 -0
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/peResources.js +94 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/process/processCapture.js +91 -1
- package/dist/domain/process/processCaptureExample.js +24 -0
- package/dist/domain/process/processCaptureValidation.js +79 -0
- package/dist/domain/process/processScenario.js +59 -7
- package/dist/domain/propertyListKeys.js +3 -1
- package/dist/domain/referenceSourceGraph.js +25 -16
- package/dist/domain/referenceSourceImportParsing.js +6 -3
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/webBundleAnalyzerInspection.js +14 -2
- package/dist/domain/webCaptureDiff.js +102 -4
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +7 -13
- package/dist/domain/zipPackageFormat.js +4 -1
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +55 -43
- package/dist/dotnet/ManagedDecodeBudget.js +80 -0
- package/dist/dotnet/ManagedMemberInspector.js +13 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +4 -2
- package/dist/dotnet/ManagedMemberRows.js +9 -4
- package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
- package/dist/dotnet/ManagedMetadataLayout.js +10 -4
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
- package/dist/dotnet/ManagedPeReader.js +41 -25
- package/dist/dotnet/ManagedReaderFailure.js +2 -1
- package/dist/dotnet/ManagedStaticProvider.js +55 -24
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +43 -13
- package/dist/evm/EvmoleFailures.js +0 -2
- package/dist/evm/EvmoleInterfaceProvider.js +67 -2
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/RegularFile.js +33 -1
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +26 -0
- package/dist/firmware/FirmwareCommand.js +25 -3
- package/dist/firmware/FirmwareFiles.js +23 -8
- package/dist/firmware/FirmwareProvider.js +156 -32
- package/dist/firmware/FirmwarePublication.js +24 -3
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +76 -4
- package/dist/ghidra/GhidraDiagnostics.js +11 -8
- package/dist/ghidra/GhidraFunctionValues.js +26 -2
- package/dist/ghidra/GhidraInstallation.js +1 -1
- package/dist/ghidra/GhidraInventoryValues.js +23 -1
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +80 -39
- package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
- package/dist/ghidra/GhidraMipsProfile.js +79 -0
- package/dist/ghidra/GhidraProvider.js +57 -9
- package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
- package/dist/ghidra/GhidraProviderClient.js +282 -21
- package/dist/ghidra/GhidraSessionValues.js +9 -2
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperClient.js +15 -6
- package/dist/hopper/HopperMachOImage.js +2 -0
- package/dist/hopper/HopperProvider.js +13 -2
- package/dist/ida/IdaOperationRunner.js +8 -2
- package/dist/ida/IdaProvider.js +7 -0
- package/dist/ida/IdaSessionClient.js +3 -1
- package/dist/ida/IdaWorkspace.js +4 -2
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
- package/dist/javascript/recovery/RecoveryFiles.js +18 -7
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +11 -7
- package/dist/javascript/recovery/WakaruProvider.js +139 -16
- package/dist/javascript/recovery/WakaruPublication.js +14 -4
- package/dist/javascript/recovery/WakaruRelease.js +10 -3
- package/dist/javascript/recovery/WakaruReport.js +12 -7
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
- package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
- package/dist/jeb/JebMcpConnection.js +179 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +299 -0
- package/dist/mcpDoctor.js +15 -6
- package/dist/native/AppleDispatchCoverage.js +25 -12
- package/dist/native/AppleDispatchMetadata.js +14 -7
- package/dist/native/AppleMachoFixups.js +71 -15
- package/dist/native/AppleMachoSelection.js +23 -3
- package/dist/native/NativeMacOSProvider.js +91 -16
- package/dist/native/NativeMachoInspection.js +11 -7
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +4 -3
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/DarwinProcessRunTokenReader.js +8 -3
- package/dist/process/OwnedCommand.js +4 -3
- package/dist/process/ProcessOwnership.js +104 -112
- package/dist/process/ProcessOwnershipObservation.js +96 -39
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +4 -3
- package/dist/process/capture/FilesystemSnapshot.js +28 -4
- package/dist/process/capture/ProcessCaptureLifecycle.js +350 -59
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessHarness.js +194 -26
- package/dist/process/capture/ProcessNormalization.js +3 -1
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
- package/dist/process/capture/TerminalRenderer.js +24 -7
- package/dist/reference/ReferenceSourceReader.js +22 -5
- package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
- package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
- package/dist/reference/ReferenceSourceReaderFile.js +50 -10
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
- package/dist/server/EvidenceMcpServer.js +36 -1
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +97 -25
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +4 -9
- package/dist/server/registerAndroidTools.js +3 -12
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +12 -9
- package/dist/server/registerBundleComparisonTool.js +16 -2
- package/dist/server/registerCloseLifecycleTool.js +32 -3
- package/dist/server/registerElectronTools.js +28 -10
- package/dist/server/registerEvmTools.js +4 -9
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFunctionComparisonTool.js +5 -2
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerSessionRecordTools.js +2 -1
- package/dist/server/registerSessionTools.js +49 -18
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +4 -9
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/toolResult.js +21 -2
- package/dist/windows/WindowsPrivateRuntime.js +12 -5
- package/install.sh +7 -4
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +33 -5
- package/scripts/rea.mjs +16 -1
- package/skills/reverse-engineer-anything/SKILL.md +52 -51
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +22 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { constants } from "node:fs";
|
|
3
|
-
import { access, realpath } from "node:fs/promises";
|
|
3
|
+
import { access, realpath, stat } from "node:fs/promises";
|
|
4
4
|
import { isAbsolute } from "node:path";
|
|
5
5
|
import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisOutputError, } from "../../domain/analysisErrorCore.js";
|
|
6
6
|
import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
|
|
@@ -10,7 +10,24 @@ import { ProviderProcessSupervisor, spawnOwnedProviderProcess, } from "../../pro
|
|
|
10
10
|
import { checkRecoveryDeadline, inventoryRecoveryFiles, fingerprintRecoveryFile, recoveryFailureMessage, } from "./RecoveryFiles.js";
|
|
11
11
|
import { RECOVERY_LIMITS } from "./WakaruRelease.js";
|
|
12
12
|
const OPERATION = "recover_javascript_sources";
|
|
13
|
-
const WAKARU_REQUIREMENT = "Provide an absolute REA_WAKARU_COMMAND pointing to Wakaru 1.13.0
|
|
13
|
+
const WAKARU_REQUIREMENT = "Provide an absolute REA_WAKARU_COMMAND pointing to a Wakaru ^1.13.0 Linux x64 binary (verified with 1.14.0); no tool is installed by REA. See docs/javascript-recovery.md#install-wakaru.";
|
|
14
|
+
/** Cleanup failure carrying the live supervisor so the provider can retry it. */
|
|
15
|
+
export class WakaruCleanupFailure extends ProviderCleanupError {
|
|
16
|
+
cleanupOwner;
|
|
17
|
+
runId;
|
|
18
|
+
cwd;
|
|
19
|
+
constructor(cleanupOwner, runId, cwd, reason, previousError, snapshot) {
|
|
20
|
+
super("wakaru", [runId, cwd], {
|
|
21
|
+
reason,
|
|
22
|
+
previous_error: previousError instanceof Error ? previousError.message : null,
|
|
23
|
+
exit_code: snapshot.exitCode ?? null,
|
|
24
|
+
signal: snapshot.signal ?? null,
|
|
25
|
+
}, { operation: OPERATION, cause: previousError });
|
|
26
|
+
this.cleanupOwner = cleanupOwner;
|
|
27
|
+
this.runId = runId;
|
|
28
|
+
this.cwd = cwd;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
14
31
|
/** Resolve and fingerprint explicitly configured tools; acquire nothing at startup. */
|
|
15
32
|
export const resolveWakaruCommand = async (environment) => {
|
|
16
33
|
const configured = environment.REA_WAKARU_COMMAND;
|
|
@@ -27,6 +44,8 @@ export const resolveWakaruCommand = async (environment) => {
|
|
|
27
44
|
if (!isAbsolute(limiter))
|
|
28
45
|
throw new TypeError("REA_JAVASCRIPT_PRLIMIT_COMMAND must be absolute");
|
|
29
46
|
await access(limiter, constants.X_OK);
|
|
47
|
+
if (!(await stat(limiter)).isFile())
|
|
48
|
+
throw new TypeError(`Resource limiter is not a regular file: ${limiter}`);
|
|
30
49
|
return { command, limiter, ...fingerprint };
|
|
31
50
|
}
|
|
32
51
|
catch (cause) {
|
|
@@ -100,14 +119,8 @@ export const runWakaruCommand = async (context) => {
|
|
|
100
119
|
}
|
|
101
120
|
const stopped = await supervisor.stop();
|
|
102
121
|
const snapshot = supervisor.snapshot();
|
|
103
|
-
supervisor.dispose();
|
|
104
122
|
if (stopped.status === "incomplete")
|
|
105
|
-
throw new
|
|
106
|
-
reason: stopped.reason,
|
|
107
|
-
previous_error: failure instanceof Error ? failure.message : null,
|
|
108
|
-
exit_code: snapshot.exitCode ?? null,
|
|
109
|
-
signal: snapshot.signal ?? null,
|
|
110
|
-
});
|
|
123
|
+
throw new WakaruCleanupFailure(supervisor, runId, context.cwd, stopped.reason, failure, snapshot);
|
|
111
124
|
if (failure !== undefined)
|
|
112
125
|
throw failure;
|
|
113
126
|
if (context.signal?.aborted === true)
|
|
@@ -6,7 +6,8 @@ import { fingerprintRecoveryFile, inventoryRecoveryFiles, readRecoveryFile, reco
|
|
|
6
6
|
import { runWakaruCommand, } from "./WakaruCommand.js";
|
|
7
7
|
import { parseWakaruReports } from "./WakaruReport.js";
|
|
8
8
|
import { publishWakaruArtifacts } from "./WakaruPublication.js";
|
|
9
|
-
import { RECOVERY_LIMITS,
|
|
9
|
+
import { RECOVERY_LIMITS, WAKARU_PROVIDER_IDENTITY } from "./WakaruRelease.js";
|
|
10
|
+
import { admitWakaruVersion } from "./WakaruVersion.js";
|
|
10
11
|
const OPERATION = "recover_javascript_sources";
|
|
11
12
|
const MODES = {
|
|
12
13
|
structural: "strict",
|
|
@@ -29,10 +30,12 @@ const executeWakaruRecovery = async (context) => {
|
|
|
29
30
|
...commandContext,
|
|
30
31
|
arguments: ["--version"],
|
|
31
32
|
});
|
|
32
|
-
|
|
33
|
-
version.stdout.trim()
|
|
33
|
+
const admitted = version.exit_code === 0
|
|
34
|
+
? admitWakaruVersion(version.stdout.trim())
|
|
35
|
+
: undefined;
|
|
36
|
+
if (admitted === undefined || admitted.status === "unsupported") {
|
|
34
37
|
// The message names the mismatch; the reason also keeps the tool's stderr.
|
|
35
|
-
const mismatch =
|
|
38
|
+
const mismatch = `${admitted?.message ?? `Wakaru --version failed; reported version: ${version.stdout.trim()}`}; exit: ${String(version.exit_code)}`;
|
|
36
39
|
throw new AnalysisCapabilityUnavailableError("wakaru", OPERATION, `${mismatch}; stderr: ${version.stderr}`, { userMessage: `${mismatch}.` });
|
|
37
40
|
}
|
|
38
41
|
const run = await runWakaruCommand({
|
|
@@ -58,19 +61,20 @@ const executeWakaruRecovery = async (context) => {
|
|
|
58
61
|
sourceBytes: snapshot,
|
|
59
62
|
files,
|
|
60
63
|
});
|
|
61
|
-
return { version, run, parsed };
|
|
64
|
+
return { version, admitted, run, parsed };
|
|
62
65
|
};
|
|
63
66
|
/** Publish validated recovery and retain exact source and engine bindings. */
|
|
64
67
|
export const prepareWakaruExecution = async (context) => {
|
|
65
68
|
const { root, tree, input, source, engine, options } = context;
|
|
66
69
|
const staging = join(root, "modules");
|
|
67
|
-
const { version, run, parsed } = await executeWakaruRecovery(context);
|
|
70
|
+
const { version, admitted, run, parsed } = await executeWakaruRecovery(context);
|
|
68
71
|
const result = await publishWakaruArtifacts({
|
|
69
72
|
tree,
|
|
70
73
|
staging,
|
|
71
74
|
input,
|
|
72
75
|
source,
|
|
73
76
|
engine,
|
|
77
|
+
admitted,
|
|
74
78
|
parsed,
|
|
75
79
|
execution: run,
|
|
76
80
|
...(options?.signal === undefined ? {} : { signal: options.signal }),
|
|
@@ -79,7 +83,7 @@ export const prepareWakaruExecution = async (context) => {
|
|
|
79
83
|
throw new AnalysisOutputError(OPERATION, `Original input changed during recovery: ${input.path}`);
|
|
80
84
|
if ((await fingerprintRecoveryFile(engine.command, RECOVERY_LIMITS.outputBytes, options?.signal)).sha256 !== engine.sha256)
|
|
81
85
|
throw new AnalysisOutputError(OPERATION, "Configured engine bytes changed during recovery");
|
|
82
|
-
return createAnalysisExecution(result, WAKARU_PROVIDER_IDENTITY, {
|
|
86
|
+
return createAnalysisExecution(result, { ...WAKARU_PROVIDER_IDENTITY, version: admitted.version }, {
|
|
83
87
|
rawResult: jsonValueSchema.parse({
|
|
84
88
|
version,
|
|
85
89
|
execution: run,
|
|
@@ -3,29 +3,47 @@ import { tmpdir } from "node:os";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import {} from "../../application/AnalysisProvider.js";
|
|
5
5
|
import { SafeOutputTree } from "../../artifacts/SafeOutputTree.js";
|
|
6
|
+
import { SafeOutputTreeCreationFailure } from "../../artifacts/SafeOutputTreeCreationFailure.js";
|
|
6
7
|
import { AnalysisError } from "../../domain/analysisErrorBase.js";
|
|
7
8
|
import { AnalysisOutputError } from "../../domain/analysisErrorCore.js";
|
|
9
|
+
import { javascriptRecoveryResultSchema, } from "../../domain/javascript/javascriptRecovery.js";
|
|
8
10
|
import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
|
|
9
11
|
import { ProviderCleanupError } from "../../domain/providerCleanupError.js";
|
|
10
12
|
import { err, ok } from "../../domain/result.js";
|
|
11
13
|
import { checkRecoveryCancellation, checkRecoveryDeadline, recoveryFailureMessage, recoveryInputFailure, snapshotRecoveryInput, } from "./RecoveryFiles.js";
|
|
12
|
-
import { resolveWakaruCommand } from "./WakaruCommand.js";
|
|
14
|
+
import { resolveWakaruCommand, WakaruCleanupFailure, } from "./WakaruCommand.js";
|
|
13
15
|
import { prepareWakaruExecution } from "./WakaruExecution.js";
|
|
14
16
|
import { RECOVERY_LIMITS } from "./WakaruRelease.js";
|
|
15
17
|
const OPERATION = "recover_javascript_sources";
|
|
16
|
-
/**
|
|
18
|
+
/** Serialized recovery adapter retaining failed process, workspace and publication cleanup. */
|
|
17
19
|
export class WakaruProvider {
|
|
18
20
|
environment;
|
|
19
21
|
launcher;
|
|
22
|
+
#tail = Promise.resolve();
|
|
23
|
+
#closing = false;
|
|
24
|
+
#closePromise;
|
|
25
|
+
#pendingCleanup;
|
|
20
26
|
constructor(environment = process.env, launcher) {
|
|
21
27
|
this.environment = environment;
|
|
22
28
|
this.launcher = launcher;
|
|
23
29
|
}
|
|
24
30
|
/** Recover one script using validated upstream reports and verified output bytes. */
|
|
25
|
-
|
|
31
|
+
recover(input, options) {
|
|
32
|
+
if (this.#closing)
|
|
33
|
+
return Promise.resolve(err(new ProviderCleanupError("wakaru", [], { reason: "Provider is closing" }, { operation: OPERATION })));
|
|
34
|
+
const operation = this.#tail.then(() => this.#closing
|
|
35
|
+
? err(new ProviderCleanupError("wakaru", [], { reason: "Provider is closing" }, { operation: OPERATION }))
|
|
36
|
+
: this.#recover(input, options));
|
|
37
|
+
this.#tail = operation.then(() => undefined, () => undefined);
|
|
38
|
+
return operation;
|
|
39
|
+
}
|
|
40
|
+
async #recover(input, options) {
|
|
41
|
+
const pending = await this.#retire();
|
|
42
|
+
if (pending !== undefined)
|
|
43
|
+
return err(pending);
|
|
26
44
|
let root;
|
|
27
45
|
let tree;
|
|
28
|
-
let
|
|
46
|
+
let failed;
|
|
29
47
|
let execution;
|
|
30
48
|
const deadline = Date.now() + RECOVERY_LIMITS.timeoutMs;
|
|
31
49
|
try {
|
|
@@ -37,9 +55,14 @@ export class WakaruProvider {
|
|
|
37
55
|
await mkdir(inputs, { mode: 0o700 });
|
|
38
56
|
await mkdir(staging, { mode: 0o700 });
|
|
39
57
|
const source = await snapshotRecoveryInput(input.path, join(inputs, "bundle.js"), options?.signal);
|
|
40
|
-
|
|
58
|
+
try {
|
|
59
|
+
tree = await SafeOutputTree.create(input.output_directory);
|
|
60
|
+
}
|
|
61
|
+
catch (cause) {
|
|
62
|
+
if (cause instanceof SafeOutputTreeCreationFailure)
|
|
63
|
+
tree = cause.tree;
|
|
41
64
|
throw recoveryInputFailure("output_directory", `Cannot create new recovery directory ${input.output_directory}: ${recoveryFailureMessage(cause)}`, cause);
|
|
42
|
-
}
|
|
65
|
+
}
|
|
43
66
|
execution = await prepareWakaruExecution({
|
|
44
67
|
root,
|
|
45
68
|
tree,
|
|
@@ -58,30 +81,80 @@ export class WakaruProvider {
|
|
|
58
81
|
await tree.commit();
|
|
59
82
|
}
|
|
60
83
|
catch (cause) {
|
|
61
|
-
|
|
84
|
+
failed = { cause };
|
|
62
85
|
}
|
|
63
|
-
if (
|
|
86
|
+
if (failed !== undefined) {
|
|
87
|
+
const failure = failed.cause;
|
|
64
88
|
const residuals = [];
|
|
89
|
+
const cleanupFailures = [];
|
|
90
|
+
const cleanupOwner = failure instanceof WakaruCleanupFailure
|
|
91
|
+
? failure.cleanupOwner
|
|
92
|
+
: undefined;
|
|
93
|
+
let failedTree;
|
|
65
94
|
try {
|
|
66
95
|
await tree?.rollback();
|
|
67
96
|
}
|
|
68
|
-
catch {
|
|
69
|
-
if (tree !== undefined)
|
|
97
|
+
catch (cause) {
|
|
98
|
+
if (tree !== undefined) {
|
|
99
|
+
failedTree = tree;
|
|
70
100
|
residuals.push(tree.outputRoot);
|
|
101
|
+
cleanupFailures.push({
|
|
102
|
+
resource: tree.outputRoot,
|
|
103
|
+
reason: recoveryFailureMessage(cause),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
71
106
|
}
|
|
72
|
-
if (
|
|
73
|
-
|
|
107
|
+
if (cleanupOwner !== undefined)
|
|
108
|
+
residuals.push(cleanupOwner.launch.ownership?.runId ?? "wakaru-worker");
|
|
109
|
+
if (root !== undefined && cleanupOwner === undefined) {
|
|
110
|
+
const failedRoot = root;
|
|
74
111
|
try {
|
|
75
|
-
await rm(
|
|
112
|
+
await rm(failedRoot, { recursive: true, force: true });
|
|
113
|
+
root = undefined;
|
|
76
114
|
}
|
|
77
|
-
catch {
|
|
78
|
-
residuals.push(
|
|
115
|
+
catch (cause) {
|
|
116
|
+
residuals.push(failedRoot);
|
|
117
|
+
cleanupFailures.push({
|
|
118
|
+
resource: failedRoot,
|
|
119
|
+
reason: recoveryFailureMessage(cause),
|
|
120
|
+
});
|
|
79
121
|
}
|
|
80
122
|
}
|
|
123
|
+
if (cleanupOwner !== undefined ||
|
|
124
|
+
failedTree !== undefined ||
|
|
125
|
+
root !== undefined) {
|
|
126
|
+
this.#pendingCleanup = {
|
|
127
|
+
root,
|
|
128
|
+
process: cleanupOwner,
|
|
129
|
+
tree: failedTree,
|
|
130
|
+
};
|
|
131
|
+
if (root !== undefined)
|
|
132
|
+
residuals.push(root);
|
|
133
|
+
root = undefined;
|
|
134
|
+
}
|
|
81
135
|
if (residuals.length > 0)
|
|
82
136
|
return err(new ProviderCleanupError("wakaru", residuals, {
|
|
83
|
-
|
|
137
|
+
...(failure instanceof WakaruCleanupFailure
|
|
138
|
+
? failure.diagnostics
|
|
139
|
+
: {}),
|
|
140
|
+
previous_error: failure instanceof WakaruCleanupFailure
|
|
141
|
+
? (failure.diagnostics?.previous_error ?? null)
|
|
142
|
+
: recoveryFailureMessage(failure),
|
|
143
|
+
cleanup_failures: cleanupFailures,
|
|
144
|
+
}, {
|
|
145
|
+
operation: OPERATION,
|
|
146
|
+
cause: failure,
|
|
147
|
+
...(tree?.published && execution !== undefined
|
|
148
|
+
? {
|
|
149
|
+
partialObservation: {
|
|
150
|
+
kind: "javascript-recovery",
|
|
151
|
+
result: javascriptRecoveryResultSchema.parse(execution.result),
|
|
152
|
+
},
|
|
153
|
+
}
|
|
154
|
+
: {}),
|
|
84
155
|
}));
|
|
156
|
+
if (tree?.published === true && execution !== undefined)
|
|
157
|
+
return ok(execution);
|
|
85
158
|
return err(failure instanceof AnalysisError
|
|
86
159
|
? failure
|
|
87
160
|
: new ProviderAdapterError("wakaru", OPERATION, {
|
|
@@ -93,4 +166,54 @@ export class WakaruProvider {
|
|
|
93
166
|
? err(new AnalysisOutputError(OPERATION, "Recovery returned no execution"))
|
|
94
167
|
: ok(execution);
|
|
95
168
|
}
|
|
169
|
+
async close() {
|
|
170
|
+
this.#closing = true;
|
|
171
|
+
this.#closePromise ??= this.#tail
|
|
172
|
+
.then(async () => {
|
|
173
|
+
const failure = await this.#retire();
|
|
174
|
+
if (failure !== undefined)
|
|
175
|
+
throw failure;
|
|
176
|
+
})
|
|
177
|
+
.catch((cause) => {
|
|
178
|
+
this.#closePromise = undefined;
|
|
179
|
+
throw cause;
|
|
180
|
+
});
|
|
181
|
+
return this.#closePromise;
|
|
182
|
+
}
|
|
183
|
+
async #retire() {
|
|
184
|
+
const pending = this.#pendingCleanup;
|
|
185
|
+
if (pending === undefined)
|
|
186
|
+
return undefined;
|
|
187
|
+
if (pending.process !== undefined) {
|
|
188
|
+
const stopped = await pending.process.stop();
|
|
189
|
+
if (stopped.status === "incomplete")
|
|
190
|
+
return new ProviderCleanupError("wakaru", [
|
|
191
|
+
pending.process.launch.ownership?.runId ?? "wakaru-worker",
|
|
192
|
+
...(pending.root === undefined ? [] : [pending.root]),
|
|
193
|
+
], { reason: stopped.reason }, { operation: OPERATION });
|
|
194
|
+
pending.process = undefined;
|
|
195
|
+
}
|
|
196
|
+
if (pending.tree !== undefined) {
|
|
197
|
+
const tree = pending.tree;
|
|
198
|
+
try {
|
|
199
|
+
await tree.rollback();
|
|
200
|
+
pending.tree = undefined;
|
|
201
|
+
}
|
|
202
|
+
catch (cause) {
|
|
203
|
+
return new ProviderCleanupError("wakaru", [tree.outputRoot], { reason: recoveryFailureMessage(cause) }, { operation: OPERATION, cause });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (pending.root !== undefined) {
|
|
207
|
+
const root = pending.root;
|
|
208
|
+
try {
|
|
209
|
+
await rm(root, { recursive: true, force: true });
|
|
210
|
+
pending.root = undefined;
|
|
211
|
+
}
|
|
212
|
+
catch (cause) {
|
|
213
|
+
return new ProviderCleanupError("wakaru", [root], { reason: recoveryFailureMessage(cause) }, { operation: OPERATION, cause });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
this.#pendingCleanup = undefined;
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
96
219
|
}
|
|
@@ -10,7 +10,7 @@ export const publishWakaruArtifacts = async (context) => {
|
|
|
10
10
|
const { tree, source, parsed, staging, signal } = context;
|
|
11
11
|
const write = async (path, bytes) => {
|
|
12
12
|
const sha256 = recoveryDigest(bytes);
|
|
13
|
-
const file = await tree.write(path, Readable.from([bytes]), sha256, signal);
|
|
13
|
+
const file = await tree.write(path, Readable.from([bytes]), { sha256, bytes: bytes.byteLength }, signal);
|
|
14
14
|
return {
|
|
15
15
|
path: join(tree.outputRoot, file.relativePath),
|
|
16
16
|
sha256: file.sha256,
|
|
@@ -31,7 +31,7 @@ export const publishWakaruArtifacts = async (context) => {
|
|
|
31
31
|
source: { ...source, published_copy: publishedCopy },
|
|
32
32
|
engine: {
|
|
33
33
|
id: "wakaru",
|
|
34
|
-
version:
|
|
34
|
+
version: context.admitted.version,
|
|
35
35
|
executable: {
|
|
36
36
|
path: context.engine.command,
|
|
37
37
|
sha256: context.engine.sha256,
|
|
@@ -52,7 +52,12 @@ export const publishWakaruArtifacts = async (context) => {
|
|
|
52
52
|
total: parsed.report.total,
|
|
53
53
|
failed: parsed.report.failed,
|
|
54
54
|
modules,
|
|
55
|
-
warnings: parsed.report.warnings,
|
|
55
|
+
warnings: parsed.report.warnings.map(({ filename, kind, is_error, message }) => ({
|
|
56
|
+
filename,
|
|
57
|
+
kind,
|
|
58
|
+
is_error,
|
|
59
|
+
message,
|
|
60
|
+
})),
|
|
56
61
|
report,
|
|
57
62
|
provenance,
|
|
58
63
|
analysis_input: modules.length === 0
|
|
@@ -62,7 +67,12 @@ export const publishWakaruArtifacts = async (context) => {
|
|
|
62
67
|
format: "directory",
|
|
63
68
|
},
|
|
64
69
|
runtime_equivalence: "unknown",
|
|
65
|
-
limitations: [
|
|
70
|
+
limitations: [
|
|
71
|
+
...RECOVERY_LIMITATIONS,
|
|
72
|
+
...(context.admitted.status === "compatible"
|
|
73
|
+
? [context.admitted.limitation]
|
|
74
|
+
: []),
|
|
75
|
+
],
|
|
66
76
|
};
|
|
67
77
|
const manifest = await write("manifest.json", Buffer.from(`${JSON.stringify(details, null, 2)}\n`));
|
|
68
78
|
return javascriptRecoveryResultSchema.parse({ ...details, manifest });
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/** Unchanged upstream source pin; executed bytes are identified separately. */
|
|
2
2
|
export const WAKARU_RELEASE = {
|
|
3
|
-
version: "1.
|
|
4
|
-
revision: "
|
|
3
|
+
version: "1.14.0",
|
|
4
|
+
revision: "8219bf5016a063d7fb215101a8c45d5959ec733f",
|
|
5
5
|
repository: "https://github.com/pionxzh/wakaru",
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Releases the report parser accepts. Wakaru changes `--version`, `--json`
|
|
9
|
+
* and `provenance.json` only by addition within a major version
|
|
10
|
+
* (https://github.com/pionxzh/wakaru/blob/v1.14.0/docs/cli.md#machine-readable-output-compatibility);
|
|
11
|
+
* 1.13.0 is the first release this adapter verified.
|
|
12
|
+
*/
|
|
13
|
+
export const WAKARU_ACCEPTED_RANGE = "^1.13.0";
|
|
14
|
+
/** Catalog identity for the verified Wakaru release. Evidence replaces version with the observed banner. */
|
|
8
15
|
export const WAKARU_PROVIDER_IDENTITY = {
|
|
9
16
|
id: "wakaru",
|
|
10
17
|
name: "Wakaru",
|
|
@@ -4,19 +4,19 @@ import { AnalysisOutputError } from "../../domain/analysisErrorCore.js";
|
|
|
4
4
|
import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
|
|
5
5
|
import { readRecoveryFile, recoveryFailureMessage } from "./RecoveryFiles.js";
|
|
6
6
|
import { RECOVERY_LIMITS } from "./WakaruRelease.js";
|
|
7
|
-
const warningSchema = z.
|
|
7
|
+
const warningSchema = z.looseObject({
|
|
8
8
|
filename: z.string(),
|
|
9
9
|
kind: z.string(),
|
|
10
10
|
is_error: z.boolean(),
|
|
11
11
|
message: z.string(),
|
|
12
12
|
});
|
|
13
|
-
const reportSchema = z.
|
|
13
|
+
const reportSchema = z.looseObject({
|
|
14
14
|
detected_formats: z.array(z.string()),
|
|
15
15
|
safety: z.string(),
|
|
16
|
-
modules: z.array(z.
|
|
16
|
+
modules: z.array(z.looseObject({
|
|
17
17
|
filename: z.string().min(1),
|
|
18
18
|
kind: z.literal("javascript"),
|
|
19
|
-
status: z.
|
|
19
|
+
status: z.string().min(1),
|
|
20
20
|
})),
|
|
21
21
|
warnings: z.array(warningSchema),
|
|
22
22
|
total: z.number().int().nonnegative(),
|
|
@@ -27,10 +27,10 @@ const rangeSchema = z.tuple([
|
|
|
27
27
|
z.number().int().nonnegative(),
|
|
28
28
|
z.number().int().nonnegative(),
|
|
29
29
|
]);
|
|
30
|
-
const provenanceSchema = z.
|
|
30
|
+
const provenanceSchema = z.looseObject({
|
|
31
31
|
format: z.string(),
|
|
32
32
|
strategy: z.string(),
|
|
33
|
-
modules: z.record(z.string(), z.
|
|
33
|
+
modules: z.record(z.string(), z.looseObject({
|
|
34
34
|
input: z.string(),
|
|
35
35
|
ranges: z.array(rangeSchema),
|
|
36
36
|
extraction: z.string(),
|
|
@@ -38,7 +38,12 @@ const provenanceSchema = z.strictObject({
|
|
|
38
38
|
})),
|
|
39
39
|
});
|
|
40
40
|
const OPERATION = "recover_javascript_sources";
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Parse producer JSON before projecting provider-neutral artifacts. Wakaru adds
|
|
43
|
+
* fields and category values within a major version, so unknown keys are kept
|
|
44
|
+
* and `status` stays the reported string; identity, path, range and file-set
|
|
45
|
+
* checks below remain exact.
|
|
46
|
+
*/
|
|
42
47
|
export const parseWakaruReports = async (context) => {
|
|
43
48
|
const { execution, provenancePath } = context;
|
|
44
49
|
try {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { satisfies, valid } from "semver";
|
|
2
|
+
import { WAKARU_ACCEPTED_RANGE, WAKARU_RELEASE } from "./WakaruRelease.js";
|
|
3
|
+
/** Caller-facing accepted releases, naming the verified build. */
|
|
4
|
+
export const wakaruReleaseLine = () => `Wakaru ${WAKARU_ACCEPTED_RANGE} (verified with ${WAKARU_RELEASE.version})`;
|
|
5
|
+
/** Classify a `wakaru <version>` banner against the accepted release range. */
|
|
6
|
+
export const admitWakaruVersion = (banner) => {
|
|
7
|
+
const token = banner.startsWith("wakaru ")
|
|
8
|
+
? banner.slice("wakaru ".length)
|
|
9
|
+
: undefined;
|
|
10
|
+
if (token === undefined ||
|
|
11
|
+
valid(token) !== token ||
|
|
12
|
+
!satisfies(token, WAKARU_ACCEPTED_RANGE))
|
|
13
|
+
return {
|
|
14
|
+
status: "unsupported",
|
|
15
|
+
message: `Unsupported Wakaru version ${banner.length === 0 ? "missing" : banner}; accepted releases are ${wakaruReleaseLine()}`,
|
|
16
|
+
};
|
|
17
|
+
if (token === WAKARU_RELEASE.version)
|
|
18
|
+
return { status: "verified", version: token };
|
|
19
|
+
return {
|
|
20
|
+
status: "compatible",
|
|
21
|
+
version: token,
|
|
22
|
+
limitation: `This session uses Wakaru ${token}. The report parser is verified against ${WAKARU_RELEASE.version}; other ${WAKARU_ACCEPTED_RANGE} releases are accepted and the observed version is reported.`,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -15,6 +15,13 @@ import { ProviderProcessSupervisor, spawnOwnedProviderProcess, } from "../../pro
|
|
|
15
15
|
import { prepareProcessOwnershipInspection } from "../../process/ProcessOwnershipObservation.js";
|
|
16
16
|
const OPERATION = "trace_web_source_location";
|
|
17
17
|
const PROVIDER = "source-map-decoder";
|
|
18
|
+
export class SourceMapCleanupFailure extends ProviderCleanupError {
|
|
19
|
+
cleanupOwner;
|
|
20
|
+
constructor(cleanupOwner, resources, diagnostics) {
|
|
21
|
+
super(PROVIDER, resources, diagnostics, { operation: OPERATION });
|
|
22
|
+
this.cleanupOwner = cleanupOwner;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
18
25
|
/** Run a trusted codec command and release its process/root before returning output. */
|
|
19
26
|
export const runSourceMapCommand = async (request, path, options, dependencies) => {
|
|
20
27
|
try {
|
|
@@ -164,14 +171,20 @@ class OwnedCodec {
|
|
|
164
171
|
}
|
|
165
172
|
async close(previousError) {
|
|
166
173
|
const failures = [];
|
|
174
|
+
let processReleased = this.#supervisor === undefined;
|
|
167
175
|
if (this.#supervisor !== undefined) {
|
|
168
176
|
const stopped = await this.#supervisor.stop();
|
|
169
177
|
if (stopped.status === "incomplete")
|
|
170
178
|
failures.push(stopped.reason);
|
|
179
|
+
else {
|
|
180
|
+
processReleased = true;
|
|
181
|
+
this.#supervisor = undefined;
|
|
182
|
+
}
|
|
171
183
|
}
|
|
172
|
-
if (this.#runtime !== undefined) {
|
|
184
|
+
if (processReleased && this.#runtime !== undefined) {
|
|
173
185
|
try {
|
|
174
186
|
await this.#runtime.close();
|
|
187
|
+
this.#runtime = undefined;
|
|
175
188
|
}
|
|
176
189
|
catch (cause) {
|
|
177
190
|
failures.push(message(cause));
|
|
@@ -179,7 +192,7 @@ class OwnedCodec {
|
|
|
179
192
|
}
|
|
180
193
|
return failures.length === 0
|
|
181
194
|
? undefined
|
|
182
|
-
: new
|
|
195
|
+
: new SourceMapCleanupFailure(this, [
|
|
183
196
|
this.#runId,
|
|
184
197
|
...(this.#runtime === undefined ? [] : [this.#runtime.path]),
|
|
185
198
|
], {
|
|
@@ -187,7 +200,7 @@ class OwnedCodec {
|
|
|
187
200
|
cleanup_failures: failures,
|
|
188
201
|
previous_error: previousError,
|
|
189
202
|
codec_pid: this.#supervisor?.launch.process.pid ?? null,
|
|
190
|
-
}
|
|
203
|
+
});
|
|
191
204
|
}
|
|
192
205
|
}
|
|
193
206
|
const message = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
@@ -3,16 +3,34 @@ import { ArtifactOperationError } from "../../domain/artifactOperationError.js";
|
|
|
3
3
|
import { err, ok } from "../../domain/result.js";
|
|
4
4
|
import { WEB_SOURCE_MAP_LIMITS, } from "../../domain/webSourceLocation.js";
|
|
5
5
|
import { sourceMapCodecInputSchema, sourceMapCodecReplySchema, } from "./SourceMapCodecProtocol.js";
|
|
6
|
-
import { runSourceMapCommand, } from "./SourceMapCommand.js";
|
|
6
|
+
import { SourceMapCleanupFailure, runSourceMapCommand, } from "./SourceMapCommand.js";
|
|
7
|
+
import { ProviderCleanupError } from "../../domain/providerCleanupError.js";
|
|
8
|
+
import { jsonParts } from "../../domain/jsonSerialization.js";
|
|
7
9
|
const OPERATION = "trace_web_source_location";
|
|
8
10
|
/** Integrate the pinned upstream codec through an independently bounded owned process. */
|
|
9
11
|
export class SourceMapDecoder {
|
|
10
12
|
dependencies;
|
|
13
|
+
#tail = Promise.resolve();
|
|
14
|
+
#closing = false;
|
|
15
|
+
#closePromise;
|
|
16
|
+
#pendingCleanup;
|
|
11
17
|
constructor(dependencies = {}) {
|
|
12
18
|
this.dependencies = dependencies;
|
|
13
19
|
}
|
|
14
20
|
/** Return complete point evidence after process and private-root cleanup. */
|
|
15
|
-
|
|
21
|
+
trace(input, options) {
|
|
22
|
+
if (this.#closing)
|
|
23
|
+
return Promise.resolve(err(new ProviderCleanupError("source-map-decoder", [], { reason: "Provider is closing" }, { operation: OPERATION })));
|
|
24
|
+
const operation = this.#tail.then(() => this.#closing
|
|
25
|
+
? err(new ProviderCleanupError("source-map-decoder", [], { reason: "Provider is closing" }, { operation: OPERATION }))
|
|
26
|
+
: this.#trace(input, options));
|
|
27
|
+
this.#tail = operation.then(() => undefined, () => undefined);
|
|
28
|
+
return operation;
|
|
29
|
+
}
|
|
30
|
+
async #trace(input, options) {
|
|
31
|
+
const cleanupFailure = await this.#retryCleanup();
|
|
32
|
+
if (cleanupFailure !== undefined)
|
|
33
|
+
return err(cleanupFailure);
|
|
16
34
|
if (options?.signal?.aborted)
|
|
17
35
|
return err(new AnalysisCancelledError(OPERATION));
|
|
18
36
|
const request = sourceMapCodecInputSchema.safeParse({
|
|
@@ -22,13 +40,27 @@ export class SourceMapDecoder {
|
|
|
22
40
|
});
|
|
23
41
|
if (!request.success)
|
|
24
42
|
return err(new AnalysisInputError(OPERATION, { cause: request.error }));
|
|
25
|
-
const
|
|
26
|
-
if (Buffer.byteLength(input.text) > WEB_SOURCE_MAP_LIMITS.mapBytes
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
const capacityFailure = () => new ArtifactOperationError(OPERATION, "limit", undefined, `${input.path}: Source-map input exceeds the 4 MiB map or 32 MiB encoded request budget.`);
|
|
44
|
+
if (Buffer.byteLength(input.text) > WEB_SOURCE_MAP_LIMITS.mapBytes)
|
|
45
|
+
return err(capacityFailure());
|
|
46
|
+
const encoded = [];
|
|
47
|
+
let encodedBytes = 0;
|
|
48
|
+
for (const part of jsonParts(request.data)) {
|
|
49
|
+
const bytes = Buffer.byteLength(part);
|
|
50
|
+
if (bytes > WEB_SOURCE_MAP_LIMITS.outputBytes - encodedBytes)
|
|
51
|
+
return err(capacityFailure());
|
|
52
|
+
encoded.push(part);
|
|
53
|
+
encodedBytes += bytes;
|
|
54
|
+
}
|
|
55
|
+
if (options?.signal?.aborted)
|
|
56
|
+
return err(new AnalysisCancelledError(OPERATION));
|
|
57
|
+
const serialized = encoded.join("");
|
|
29
58
|
const response = await runSourceMapCommand(serialized, input.path, options, this.dependencies);
|
|
30
|
-
if (!response.ok)
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
if (response.error instanceof SourceMapCleanupFailure)
|
|
61
|
+
this.#pendingCleanup = response.error.cleanupOwner;
|
|
31
62
|
return response;
|
|
63
|
+
}
|
|
32
64
|
let value;
|
|
33
65
|
try {
|
|
34
66
|
value = JSON.parse(response.value);
|
|
@@ -47,6 +79,30 @@ export class SourceMapDecoder {
|
|
|
47
79
|
return err(new AnalysisOutputError(OPERATION, "Codec reported a V8 heap limit exceeding its independent process budget."));
|
|
48
80
|
return ok(reply.data.report);
|
|
49
81
|
}
|
|
82
|
+
async close() {
|
|
83
|
+
this.#closing = true;
|
|
84
|
+
this.#closePromise ??= this.#tail
|
|
85
|
+
.then(async () => {
|
|
86
|
+
const failure = await this.#retryCleanup();
|
|
87
|
+
if (failure !== undefined)
|
|
88
|
+
throw failure;
|
|
89
|
+
})
|
|
90
|
+
.catch((cause) => {
|
|
91
|
+
this.#closePromise = undefined;
|
|
92
|
+
throw cause;
|
|
93
|
+
});
|
|
94
|
+
return this.#closePromise;
|
|
95
|
+
}
|
|
96
|
+
async #retryCleanup() {
|
|
97
|
+
const pending = this.#pendingCleanup;
|
|
98
|
+
if (pending === undefined)
|
|
99
|
+
return undefined;
|
|
100
|
+
const failure = await pending.close(null);
|
|
101
|
+
if (failure !== undefined)
|
|
102
|
+
return failure;
|
|
103
|
+
this.#pendingCleanup = undefined;
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
50
106
|
}
|
|
51
107
|
const codecFailure = (path, reason, detail) => err(reason === "limit"
|
|
52
108
|
? new ArtifactOperationError(OPERATION, "limit", undefined, `${path}: ${detail}`)
|
|
@@ -168,12 +168,23 @@ const inspectLeaf = (node, budget, options) => {
|
|
|
168
168
|
throw new SourceMapFormatFailure("limit", "Source-map layout exceeds the 262144 segment/generated-row decoder budget.");
|
|
169
169
|
return leaf;
|
|
170
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
* Return the JSON view of source-map text without changing the source evidence.
|
|
173
|
+
* ECMA-426 §11.2.1 permits HTTP(S) responses to start with `)]}'`; the line
|
|
174
|
+
* through the first HTTP newline is transport framing, not map content. Local
|
|
175
|
+
* point tracing shares this parser and has historically accepted the same
|
|
176
|
+
* framing. https://tc39.es/ecma426/#sec-fetchsourcemap
|
|
177
|
+
*/
|
|
178
|
+
export const sourceMapJsonText = (text) => {
|
|
179
|
+
const withoutBom = text.replace(/^\uFEFF/u, "");
|
|
180
|
+
if (!withoutBom.startsWith(")]}'"))
|
|
181
|
+
return withoutBom;
|
|
182
|
+
const newline = withoutBom.search(/[\r\n]/u);
|
|
183
|
+
return newline === -1 ? "" : withoutBom.slice(newline);
|
|
184
|
+
};
|
|
171
185
|
/** Validate structure before allocation, retaining raw declarations and section boundaries. */
|
|
172
186
|
export const inspectSourceMap = (text) => {
|
|
173
|
-
const
|
|
174
|
-
const jsonText = withoutBom.startsWith(")]}'")
|
|
175
|
-
? withoutBom.slice(withoutBom.indexOf("\n") + 1)
|
|
176
|
-
: withoutBom;
|
|
187
|
+
const jsonText = sourceMapJsonText(text);
|
|
177
188
|
const value = JSON.parse(jsonText);
|
|
178
189
|
const inspected = inspectSourceMapValue(value);
|
|
179
190
|
const normalized = inspected.format === "regular"
|