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,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { lstat, readdir, readFile, realpath, stat } from "node:fs/promises";
|
|
1
|
+
import { lstat, opendir, readFile, realpath, stat } from "node:fs/promises";
|
|
3
2
|
import { join } from "node:path";
|
|
4
|
-
import {
|
|
3
|
+
import { parseBinary } from "plist";
|
|
5
4
|
import { z } from "zod";
|
|
5
|
+
import { preflightPropertyListDecode } from "../artifacts/apple/InterfaceBuilderDecodeBudget.js";
|
|
6
6
|
import { BinaryTargetError } from "../domain/configurationErrors.js";
|
|
7
7
|
import { isPathWithinRoot } from "../domain/localPath.js";
|
|
8
|
-
import { parseXmlPropertyList } from "../domain/propertyListKeys.js";
|
|
8
|
+
import { omitPrototypeKeys, parseXmlPropertyList, } from "../domain/propertyListKeys.js";
|
|
9
9
|
import { decodeXmlPlistText } from "../domain/propertyListXmlText.js";
|
|
10
10
|
import { err, ok } from "../domain/result.js";
|
|
11
|
-
|
|
11
|
+
/** Decoded representation bound for one binary Info.plist. */
|
|
12
|
+
const BINARY_PLIST_DECODE_BYTES = 16 * 1024 * 1024;
|
|
12
13
|
const BUNDLE_LAYOUTS = [
|
|
13
14
|
// macOS bundles keep both under Contents.
|
|
14
15
|
{
|
|
@@ -105,11 +106,15 @@ const wrappedBundle = async (bundle) => {
|
|
|
105
106
|
return undefined;
|
|
106
107
|
throw cause;
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
let app;
|
|
110
|
+
for await (const entry of await opendir(wrapper)) {
|
|
111
|
+
if (!entry.isDirectory() || !entry.name.toLowerCase().endsWith(".app"))
|
|
112
|
+
continue;
|
|
113
|
+
if (app !== undefined)
|
|
114
|
+
return undefined;
|
|
115
|
+
app = join(wrapper, entry.name);
|
|
116
|
+
}
|
|
117
|
+
return app;
|
|
113
118
|
};
|
|
114
119
|
const resolveLayoutExecutable = async (bundle, layout, fileSystem) => {
|
|
115
120
|
const plistPath = join(bundle, ...layout.plist);
|
|
@@ -128,7 +133,8 @@ const resolveLayoutExecutable = async (bundle, layout, fileSystem) => {
|
|
|
128
133
|
try {
|
|
129
134
|
name =
|
|
130
135
|
plist.subarray(0, 6).toString("ascii") === "bplist"
|
|
131
|
-
? await (fileSystem.decodeBinaryPlist
|
|
136
|
+
? await (fileSystem.decodeBinaryPlist?.(plistPath) ??
|
|
137
|
+
parseBinaryPlistExecutable(plist))
|
|
132
138
|
: parseXmlPlistExecutable(decodeXmlPlistText(plist));
|
|
133
139
|
}
|
|
134
140
|
catch (cause) {
|
|
@@ -163,23 +169,22 @@ const resolveLayoutExecutable = async (bundle, layout, fileSystem) => {
|
|
|
163
169
|
const parseXmlPlistExecutable = (plist) => {
|
|
164
170
|
// An unrelated `__proto__` entry must not make the bundle unreadable.
|
|
165
171
|
const { value } = parseXmlPropertyList(plist);
|
|
172
|
+
return executableName(value);
|
|
173
|
+
};
|
|
174
|
+
const executableName = (value) => {
|
|
166
175
|
const executable = executableEntrySchema.safeParse(value);
|
|
167
176
|
if (!executable.success)
|
|
168
177
|
throw new Error("CFBundleExecutable is missing");
|
|
169
178
|
return executable.data.CFBundleExecutable;
|
|
170
179
|
};
|
|
171
180
|
const executableEntrySchema = z.looseObject({ CFBundleExecutable: z.string() });
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"-o",
|
|
180
|
-
"-",
|
|
181
|
-
plistPath,
|
|
182
|
-
])).stdout;
|
|
181
|
+
/** Decode a binary plist in-process, so no host plist tool is required. */
|
|
182
|
+
const parseBinaryPlistExecutable = (plist) => {
|
|
183
|
+
preflightPropertyListDecode(plist, BINARY_PLIST_DECODE_BYTES);
|
|
184
|
+
// `plist` assigns a `__proto__` key as the prototype; copying drops it, as
|
|
185
|
+
// the XML path does.
|
|
186
|
+
return executableName(omitPrototypeKeys(parseBinary(plist)).value);
|
|
187
|
+
};
|
|
183
188
|
const isSafeExecutableName = (name) => name.length > 0 &&
|
|
184
189
|
name !== "." &&
|
|
185
190
|
name !== ".." &&
|
|
@@ -6,6 +6,7 @@ import { BinaryTargetError } from "../domain/configurationErrors.js";
|
|
|
6
6
|
import { openRegularFile, sameRegularFileState, } from "../filesystem/RegularFile.js";
|
|
7
7
|
import { AnalysisCancelledError } from "../domain/analysisErrorCore.js";
|
|
8
8
|
import { err, ok } from "../domain/result.js";
|
|
9
|
+
import { readMipsElfAbiFlags } from "./MipsElfAbiFlags.js";
|
|
9
10
|
import { resolveAppBundleExecutable, } from "./AppBundleExecutable.js";
|
|
10
11
|
import { validateDosComLength, } from "../domain/dosCom.js";
|
|
11
12
|
import { mzWindowsHeaderOffset } from "../domain/dosMz.js";
|
|
@@ -178,12 +179,14 @@ const sha256Handle = async (handle, path, initial, signal) => {
|
|
|
178
179
|
let position = 0;
|
|
179
180
|
while (true) {
|
|
180
181
|
throwIfTargetResolutionCancelled(signal);
|
|
181
|
-
const observed = await handle.read(chunk, 0, chunk.length, position);
|
|
182
|
+
const observed = await handle.read(chunk, 0, Math.min(chunk.length, initial.size - position + 1), position);
|
|
182
183
|
throwIfTargetResolutionCancelled(signal);
|
|
183
184
|
if (observed.bytesRead === 0)
|
|
184
185
|
break;
|
|
185
186
|
hash.update(chunk.subarray(0, observed.bytesRead));
|
|
186
187
|
position += observed.bytesRead;
|
|
188
|
+
if (position > initial.size)
|
|
189
|
+
throw new BinaryTargetError(path, "target grew while being read");
|
|
187
190
|
}
|
|
188
191
|
throwIfTargetResolutionCancelled(signal);
|
|
189
192
|
const [opened, currentPath] = await Promise.all([handle.stat(), lstat(path)]);
|
|
@@ -250,7 +253,24 @@ const readExecutableMetadata = async (handle, hostArchitecture, signal) => {
|
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
}
|
|
253
|
-
|
|
256
|
+
const parsed = parseExecutableHeader(bytes, hostArchitecture, fileSize);
|
|
257
|
+
if (!parsed.ok ||
|
|
258
|
+
parsed.value.architecture !== "mips" ||
|
|
259
|
+
parsed.value.mips.elfClass !== 32)
|
|
260
|
+
return parsed;
|
|
261
|
+
const abiFlags = await readMipsElfAbiFlags(handle, parsed.value.mips, () => throwIfTargetResolutionCancelled(signal));
|
|
262
|
+
if (!abiFlags.ok)
|
|
263
|
+
return abiFlags;
|
|
264
|
+
return ok({
|
|
265
|
+
...parsed.value,
|
|
266
|
+
mips: {
|
|
267
|
+
...parsed.value.mips,
|
|
268
|
+
abiFlags: abiFlags.value.abiFlags,
|
|
269
|
+
...(abiFlags.value.limitations.length === 0
|
|
270
|
+
? {}
|
|
271
|
+
: { limitations: abiFlags.value.limitations }),
|
|
272
|
+
},
|
|
273
|
+
});
|
|
254
274
|
};
|
|
255
275
|
const readPeMetadata = async (handle, offset, signal) => {
|
|
256
276
|
throwIfTargetResolutionCancelled(signal);
|
|
@@ -203,7 +203,7 @@ const workflowAvailabilityFor = ({ name, kind, policy, }) => {
|
|
|
203
203
|
? { reason: "available", remediation: null }
|
|
204
204
|
: {
|
|
205
205
|
reason: "provider_missing",
|
|
206
|
-
remediation: "On Linux x64, provide an absolute REA_WAKARU_COMMAND for Wakaru 1.13.0 and util-linux prlimit. No binary target is required.",
|
|
206
|
+
remediation: "On Linux x64, provide an absolute REA_WAKARU_COMMAND for Wakaru ^1.13.0 (verified with 1.14.0) and util-linux prlimit; see docs/javascript-recovery.md#install-wakaru. No binary target is required.",
|
|
207
207
|
};
|
|
208
208
|
if (name === "inspect_binary_layout")
|
|
209
209
|
return policy.binaryLayoutEnabled === true
|
|
@@ -212,6 +212,8 @@ const workflowAvailabilityFor = ({ name, kind, policy, }) => {
|
|
|
212
212
|
reason: "provider_missing",
|
|
213
213
|
remediation: "On Linux x64, set absolute REA_PWNTOOLS_PYTHON to caller-supplied Python with pwntools 4.15.0. No active binary target is required.",
|
|
214
214
|
};
|
|
215
|
+
if (name === "inspect_pe_resources")
|
|
216
|
+
return { reason: "available", remediation: null };
|
|
215
217
|
if (name === "inspect_evm_interface")
|
|
216
218
|
return policy.evmInterfaceEnabled === true
|
|
217
219
|
? { reason: "available", remediation: null }
|
|
@@ -247,6 +249,14 @@ const workflowAvailabilityFor = ({ name, kind, policy, }) => {
|
|
|
247
249
|
remediation: policy.androidAnalysisAvailability?.reason ??
|
|
248
250
|
"Set REA_JADX_MCP_JAR to a caller-supplied jadx-headless-mcp 0.7.1 JAR and provide a full JDK on Linux, macOS, or Windows x64 with its matching bundled native controls.",
|
|
249
251
|
};
|
|
252
|
+
if (kind === "jeb-provider")
|
|
253
|
+
return policy.jebAnalysisAvailability?.status === "available"
|
|
254
|
+
? { reason: "available", remediation: null }
|
|
255
|
+
: {
|
|
256
|
+
reason: "provider_missing",
|
|
257
|
+
remediation: policy.jebAnalysisAvailability?.reason ??
|
|
258
|
+
"Start a JEB client serving MCP (GUI client, or headless via its programmatic launcher) and point REA_JEB_MCP_URL at it (default http://127.0.0.1:8425/mcp). REA does not install or launch JEB.",
|
|
259
|
+
};
|
|
250
260
|
const browser = browserProviderAvailability(name, kind, policy);
|
|
251
261
|
if (browser !== null)
|
|
252
262
|
return browser;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
2
|
+
import { parse as parseYaml, parseDocument as parseYamlDocument, stringify as stringifyYaml, } from "yaml";
|
|
2
3
|
import { isDeepStrictEqual } from "node:util";
|
|
3
4
|
import { applyEdits, findNodeAtLocation, modify, parse as parseJsonc, parseTree, printParseErrorCode, } from "jsonc-parser";
|
|
4
5
|
import { z } from "zod";
|
|
@@ -20,6 +21,7 @@ export const clientConfigurationServersKey = (format) => {
|
|
|
20
21
|
switch (format) {
|
|
21
22
|
case "toml":
|
|
22
23
|
case "grok":
|
|
24
|
+
case "hermes":
|
|
23
25
|
return "mcp_servers";
|
|
24
26
|
case "opencode":
|
|
25
27
|
return "mcp";
|
|
@@ -37,6 +39,14 @@ const isEmptyClientConfigurationText = (text) => text.replace(/^\uFEFF/, "").tri
|
|
|
37
39
|
const parseDocument = (text, format) => {
|
|
38
40
|
if (format === "toml" || format === "grok")
|
|
39
41
|
return objectSchema.parse(parseToml(text));
|
|
42
|
+
// Pi loads `mcp.json` with a strict `JSON.parse` and no BOM tolerance, so
|
|
43
|
+
// comments, trailing commas, a BOM, or an empty existing file must be
|
|
44
|
+
// rejected instead of registering into a document Pi cannot load.
|
|
45
|
+
if (format === "pi")
|
|
46
|
+
return objectSchema.parse(JSON.parse(text));
|
|
47
|
+
// Hermes stores MCP servers in `mcp_servers` inside a YAML document.
|
|
48
|
+
if (format === "hermes")
|
|
49
|
+
return objectSchema.parse(parseYaml(text));
|
|
40
50
|
// An empty file, which some clients create before any server is added,
|
|
41
51
|
// holds no settings to preserve.
|
|
42
52
|
if (isEmptyClientConfigurationText(text))
|
|
@@ -1031,6 +1041,8 @@ export const serializeClientConfiguration = (document, format, originalText, edi
|
|
|
1031
1041
|
return serializeCodexConfiguration(document, originalText);
|
|
1032
1042
|
if (format === "grok")
|
|
1033
1043
|
return serializeGrokConfiguration(document, originalText);
|
|
1044
|
+
if (format === "hermes")
|
|
1045
|
+
return serializeHermesConfiguration(document, originalText);
|
|
1034
1046
|
// An empty original holds no comments or settings to preserve. Writing a
|
|
1035
1047
|
// fresh document also keeps a lone BOM from shifting past the closing brace.
|
|
1036
1048
|
if (originalText !== undefined &&
|
|
@@ -1055,6 +1067,28 @@ export const clientServerPath = (parsed, name) => [...parsed.serversPath, name];
|
|
|
1055
1067
|
export const legacyClientServerPath = (parsed, name) => Object.hasOwn(parsed.legacyServers, name)
|
|
1056
1068
|
? [parsed.serversPath[0] ?? "mcp", name]
|
|
1057
1069
|
: undefined;
|
|
1070
|
+
/**
|
|
1071
|
+
* Keep an existing Hermes `config.yaml` intact aside from the REA server entry.
|
|
1072
|
+
* Hermes config files carry user comments and unrelated settings, so the rea
|
|
1073
|
+
* entry is upserted into the parsed YAML document (which retains formatting and
|
|
1074
|
+
* comments) rather than re-serializing the whole object.
|
|
1075
|
+
*/
|
|
1076
|
+
const serializeHermesConfiguration = (document, originalText) => {
|
|
1077
|
+
if (originalText === undefined ||
|
|
1078
|
+
isEmptyClientConfigurationText(originalText))
|
|
1079
|
+
return stringifyYaml(document);
|
|
1080
|
+
const serversKey = clientConfigurationServersKey("hermes");
|
|
1081
|
+
const servers = document[serversKey];
|
|
1082
|
+
const entry = typeof servers === "object" && servers !== null
|
|
1083
|
+
? servers[PRODUCT_IDENTITY.mcpServerKey]
|
|
1084
|
+
: undefined;
|
|
1085
|
+
const yamlDocument = parseYamlDocument(originalText);
|
|
1086
|
+
if (entry === undefined)
|
|
1087
|
+
yamlDocument.deleteIn([serversKey, PRODUCT_IDENTITY.mcpServerKey]);
|
|
1088
|
+
else
|
|
1089
|
+
yamlDocument.setIn([serversKey, PRODUCT_IDENTITY.mcpServerKey], entry);
|
|
1090
|
+
return yamlDocument.toString();
|
|
1091
|
+
};
|
|
1058
1092
|
/** Build the stdio entry shape expected by one client's configuration dialect. */
|
|
1059
1093
|
export const clientRegistrationEntry = (format, command, environment) => {
|
|
1060
1094
|
const [executable = "rea", ...args] = command;
|
|
@@ -1079,6 +1113,7 @@ export const clientRegistrationEntry = (format, command, environment) => {
|
|
|
1079
1113
|
};
|
|
1080
1114
|
case "vscode":
|
|
1081
1115
|
case "omp":
|
|
1116
|
+
case "pi":
|
|
1082
1117
|
return {
|
|
1083
1118
|
type: "stdio",
|
|
1084
1119
|
command: executable,
|
|
@@ -1101,6 +1136,15 @@ export const clientRegistrationEntry = (format, command, environment) => {
|
|
|
1101
1136
|
args,
|
|
1102
1137
|
...(Object.keys(environment).length === 0 ? {} : { env: environment }),
|
|
1103
1138
|
};
|
|
1139
|
+
case "hermes":
|
|
1140
|
+
// Hermes reads stdio servers from `mcp_servers.<name>` and connects them
|
|
1141
|
+
// unless `enabled` is false, so the entry states it explicitly.
|
|
1142
|
+
return {
|
|
1143
|
+
command: executable,
|
|
1144
|
+
args,
|
|
1145
|
+
...(Object.keys(environment).length === 0 ? {} : { env: environment }),
|
|
1146
|
+
enabled: true,
|
|
1147
|
+
};
|
|
1104
1148
|
default:
|
|
1105
1149
|
return {
|
|
1106
1150
|
command: executable,
|
|
@@ -1109,3 +1153,29 @@ export const clientRegistrationEntry = (format, command, environment) => {
|
|
|
1109
1153
|
};
|
|
1110
1154
|
}
|
|
1111
1155
|
};
|
|
1156
|
+
/** Parse one Gemini policy at its source boundary before consolidating scopes. */
|
|
1157
|
+
export const parseGeminiMcpPolicy = (parsed) => z
|
|
1158
|
+
.object({
|
|
1159
|
+
allowed: z.array(z.string()).optional(),
|
|
1160
|
+
excluded: z.array(z.string()).optional(),
|
|
1161
|
+
})
|
|
1162
|
+
.passthrough()
|
|
1163
|
+
.parse(parsed.document.mcp ?? {});
|
|
1164
|
+
/** Gemini consolidates excludes by union and allowlists by normalized intersection. */
|
|
1165
|
+
export const geminiServerPolicyBlock = (policies, serverKey) => {
|
|
1166
|
+
if (policies.some(({ excluded }) => excluded?.includes(serverKey)))
|
|
1167
|
+
return `Gemini mcp.excluded blocks ${serverKey}. Review the selected settings policies before rerunning setup.`;
|
|
1168
|
+
const allowlists = policies.flatMap(({ allowed }) => allowed === undefined ? [] : [allowed]);
|
|
1169
|
+
const allowed = allowlists.reduce((previous, current) => {
|
|
1170
|
+
if (previous === undefined)
|
|
1171
|
+
return current;
|
|
1172
|
+
const normalized = new Set(current.map((name) => name.toLowerCase().trim()));
|
|
1173
|
+
return previous.filter((name) => normalized.has(name.toLowerCase().trim()));
|
|
1174
|
+
}, undefined);
|
|
1175
|
+
// Gemini's manager applies the consolidated allowlist only when nonempty.
|
|
1176
|
+
if (allowed !== undefined &&
|
|
1177
|
+
allowed.length > 0 &&
|
|
1178
|
+
!allowed.includes(serverKey))
|
|
1179
|
+
return `Gemini mcp.allowed does not include ${serverKey}. Review the selected settings policies before rerunning setup.`;
|
|
1180
|
+
return undefined;
|
|
1181
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { err, ok } from "../domain/result.js";
|
|
2
|
+
import { RegularFileCleanupFailure, readRegularFileText, } from "./RegularFileRead.js";
|
|
3
|
+
import { effectiveClientServer, parseClientConfiguration, } from "./ClientConfigurationDocument.js";
|
|
4
|
+
import { clientRegistrationEnvironment } from "./ClientRegistrationEnvironment.js";
|
|
5
|
+
/** Preserve named read failures and distinguish a missing source from an empty file. */
|
|
6
|
+
export const readConfigurationText = async (path) => {
|
|
7
|
+
try {
|
|
8
|
+
return ok(await readRegularFileText(path));
|
|
9
|
+
}
|
|
10
|
+
catch (cause) {
|
|
11
|
+
if (cause instanceof Error && "code" in cause && cause.code === "ENOENT")
|
|
12
|
+
return ok(undefined);
|
|
13
|
+
return err({
|
|
14
|
+
kind: "unreadable",
|
|
15
|
+
path,
|
|
16
|
+
detail: `Configuration ${path} could not be read: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
17
|
+
...(cause instanceof RegularFileCleanupFailure
|
|
18
|
+
? { cleanupFailure: cause }
|
|
19
|
+
: {}),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
/** Read and parse one configuration at its source boundary. */
|
|
24
|
+
export const readConfigurationFile = async (path, format) => {
|
|
25
|
+
const source = await readConfigurationText(path);
|
|
26
|
+
if (!source.ok)
|
|
27
|
+
return source;
|
|
28
|
+
const content = source.value;
|
|
29
|
+
if (content === undefined)
|
|
30
|
+
return ok(undefined);
|
|
31
|
+
try {
|
|
32
|
+
return ok(parseClientConfiguration(content, format));
|
|
33
|
+
}
|
|
34
|
+
catch (cause) {
|
|
35
|
+
return err({
|
|
36
|
+
kind: "malformed",
|
|
37
|
+
path,
|
|
38
|
+
detail: `Configuration ${path} is malformed: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/** Read every applicable user file; malformed lower-priority files also stop setup. */
|
|
43
|
+
export const readClientConfigurationFiles = async (client) => {
|
|
44
|
+
const documents = [];
|
|
45
|
+
for (const path of client.configPaths ?? [client.configPath]) {
|
|
46
|
+
const document = await readConfigurationFile(path, client.format);
|
|
47
|
+
if (!document.ok)
|
|
48
|
+
return document;
|
|
49
|
+
if (document.value !== undefined) {
|
|
50
|
+
const environment = clientRegistrationEnvironment(document.value);
|
|
51
|
+
if (!environment.ok)
|
|
52
|
+
return err({
|
|
53
|
+
kind: "malformed",
|
|
54
|
+
path,
|
|
55
|
+
detail: `Configuration ${path} has an invalid REA server environment: ${environment.error.settings.map(({ setting, constraint }) => `${setting}: ${constraint}`).join("; ")}. Repair it before rerunning setup.`,
|
|
56
|
+
});
|
|
57
|
+
documents.push(document.value);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return ok(documents);
|
|
61
|
+
};
|
|
62
|
+
/** OpenCode merges server objects in file order, replacing arrays and scalar values. */
|
|
63
|
+
const mergeConfigurationValue = (previous, next) => {
|
|
64
|
+
if (!isObject(previous) || !isObject(next))
|
|
65
|
+
return next;
|
|
66
|
+
return Object.fromEntries([...new Set([...Object.keys(previous), ...Object.keys(next)])].map((key) => [
|
|
67
|
+
key,
|
|
68
|
+
Object.hasOwn(next, key)
|
|
69
|
+
? mergeConfigurationValue(previous[key], next[key])
|
|
70
|
+
: previous[key],
|
|
71
|
+
]));
|
|
72
|
+
};
|
|
73
|
+
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
74
|
+
/** Project a client's effective user registration without modifying its source files. */
|
|
75
|
+
export const effectiveClientConfiguration = (documents) => {
|
|
76
|
+
const last = documents.at(-1);
|
|
77
|
+
if (last === undefined)
|
|
78
|
+
return undefined;
|
|
79
|
+
if (documents.length === 1)
|
|
80
|
+
return last;
|
|
81
|
+
const servers = {};
|
|
82
|
+
for (const document of documents) {
|
|
83
|
+
const names = new Set([
|
|
84
|
+
...Object.keys(document.legacyServers),
|
|
85
|
+
...Object.keys(document.servers),
|
|
86
|
+
]);
|
|
87
|
+
for (const name of names)
|
|
88
|
+
servers[name] = mergeConfigurationValue(servers[name], effectiveClientServer(document, name));
|
|
89
|
+
}
|
|
90
|
+
return { ...last, servers, legacyServers: {} };
|
|
91
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { parseEnvironment } from "../config/environment.js";
|
|
3
|
+
import { ConfigurationError } from "../domain/configurationErrors.js";
|
|
4
|
+
import { err, ok } from "../domain/result.js";
|
|
5
|
+
import { effectiveClientServer, } from "./ClientConfigurationDocument.js";
|
|
6
|
+
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
7
|
+
/** Read explicit REA overrides without dropping peers when one value is invalid. */
|
|
8
|
+
export const clientRegistrationEnvironment = (parsed, overrides = {}) => {
|
|
9
|
+
const key = parsed?.dialect === "opencode" || parsed?.dialect === "opencode_v2"
|
|
10
|
+
? "environment"
|
|
11
|
+
: "env";
|
|
12
|
+
const registration = parsed === undefined
|
|
13
|
+
? undefined
|
|
14
|
+
: effectiveClientServer(parsed, PRODUCT_IDENTITY.mcpServerKey);
|
|
15
|
+
const raw = typeof registration === "object" && registration !== null
|
|
16
|
+
? Reflect.get(registration, key)
|
|
17
|
+
: undefined;
|
|
18
|
+
const existing = z
|
|
19
|
+
.record(z.string(), z.string())
|
|
20
|
+
.safeParse(raw === undefined ? {} : raw);
|
|
21
|
+
if (!existing.success)
|
|
22
|
+
return err(new ConfigurationError("Invalid REA server environment", {
|
|
23
|
+
settings: existing.error.issues.map((issue) => ({
|
|
24
|
+
setting: [key, ...issue.path].join("."),
|
|
25
|
+
constraint: "Server environment must be an object containing only string values",
|
|
26
|
+
})),
|
|
27
|
+
}));
|
|
28
|
+
// Validate known settings with the runtime's parser, but retain the original
|
|
29
|
+
// string overrides, including unknown client-specific keys and no defaults.
|
|
30
|
+
const environment = { ...existing.data, ...overrides };
|
|
31
|
+
const validated = parseEnvironment(environment);
|
|
32
|
+
if (!validated.ok)
|
|
33
|
+
return validated;
|
|
34
|
+
return ok(Object.fromEntries(Object.entries(environment).sort(([left], [right]) => left.localeCompare(right))));
|
|
35
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { readClientPolicyBlock } from "./GeminiClientSettings.js";
|
|
2
|
+
import { effectiveClientConfiguration, readClientConfigurationFiles, } from "./ClientConfigurationFiles.js";
|
|
3
|
+
import { clientServerForcedEnabled, clientServerListedDisabled, effectiveClientServer, } from "./ClientConfigurationDocument.js";
|
|
4
|
+
import { access } from "node:fs/promises";
|
|
3
5
|
import { resolve } from "node:path";
|
|
4
6
|
import { z } from "zod";
|
|
5
7
|
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
6
8
|
import { MCP_STARTUP_POLICY } from "../mcpStartupPolicy.js";
|
|
7
9
|
import { isOwnedClientRegistrationCommand, npxRegistrationCommand, } from "./ClientRegistrationIdentity.js";
|
|
8
|
-
import { manualRegistrationRemediation, supportedClients, } from "./SupportedClients.js";
|
|
10
|
+
import { clientEvidencePaths, manualRegistrationRemediation, supportedClients, } from "./SupportedClients.js";
|
|
9
11
|
const registrationSchema = z
|
|
10
12
|
.object({
|
|
11
13
|
command: z.string().min(1),
|
|
@@ -21,24 +23,18 @@ const registrationSchema = z
|
|
|
21
23
|
/** Inspect supported client registrations without reading their environment. */
|
|
22
24
|
export const readClientRegistrationStatuses = async (home, currentCommandPath = resolve(process.argv[1] ?? "unknown"), options = {}) => {
|
|
23
25
|
const statuses = [];
|
|
24
|
-
for (const client of supportedClients(home, options.platform, options.environment
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
PI_PROFILE: options.environment.PI_PROFILE,
|
|
37
|
-
SAND_DATA_ROOT: options.environment.SAND_DATA_ROOT,
|
|
38
|
-
XDG_CONFIG_HOME: options.environment.XDG_CONFIG_HOME,
|
|
39
|
-
})) {
|
|
40
|
-
if (!(await exists(client.markerPath)) &&
|
|
41
|
-
!(await exists(client.configPath)))
|
|
26
|
+
for (const client of supportedClients(home, options.platform, options.environment)) {
|
|
27
|
+
if (client.configPathError !== undefined) {
|
|
28
|
+
statuses.push({
|
|
29
|
+
client: client.name,
|
|
30
|
+
config_path: client.configPath,
|
|
31
|
+
command: [],
|
|
32
|
+
state: "invalid",
|
|
33
|
+
remediation: client.configPathError,
|
|
34
|
+
});
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (!(await clientEvidencePresent(client)))
|
|
42
38
|
continue;
|
|
43
39
|
const manualRemediation = manualRegistrationRemediation(client.name);
|
|
44
40
|
if (client.format === "unsupported") {
|
|
@@ -53,8 +49,34 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
53
49
|
continue;
|
|
54
50
|
}
|
|
55
51
|
try {
|
|
56
|
-
const
|
|
57
|
-
|
|
52
|
+
const files = await readClientConfigurationFiles(client);
|
|
53
|
+
if (!files.ok) {
|
|
54
|
+
statuses.push({
|
|
55
|
+
client: client.name,
|
|
56
|
+
config_path: client.configPath,
|
|
57
|
+
command: [],
|
|
58
|
+
state: "invalid",
|
|
59
|
+
remediation: files.error.detail,
|
|
60
|
+
});
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const parsed = effectiveClientConfiguration(files.value);
|
|
64
|
+
if (parsed === undefined) {
|
|
65
|
+
statuses.push(unavailableStatus(client.name, client.configPath, "missing"));
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const policy = await readClientPolicyBlock(client, parsed);
|
|
69
|
+
if (!policy.ok) {
|
|
70
|
+
statuses.push({
|
|
71
|
+
client: client.name,
|
|
72
|
+
config_path: client.configPath,
|
|
73
|
+
command: [],
|
|
74
|
+
state: "invalid",
|
|
75
|
+
remediation: policy.error.detail,
|
|
76
|
+
});
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const policyBlock = policy.value;
|
|
58
80
|
const raw = effectiveClientServer(parsed, PRODUCT_IDENTITY.mcpServerKey);
|
|
59
81
|
if (raw === undefined) {
|
|
60
82
|
statuses.push(unavailableStatus(client.name, client.configPath, "missing"));
|
|
@@ -66,9 +88,10 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
66
88
|
...registration.args,
|
|
67
89
|
];
|
|
68
90
|
statuses.push(configuredStatus(client.name, client.configPath, command, registrationAligned(registration, client, currentCommandPath, options.platform ?? process.platform, clientServerForcedEnabled(parsed, PRODUCT_IDENTITY.mcpServerKey)) &&
|
|
69
|
-
!clientServerListedDisabled(parsed, PRODUCT_IDENTITY.mcpServerKey)
|
|
91
|
+
!clientServerListedDisabled(parsed, PRODUCT_IDENTITY.mcpServerKey) &&
|
|
92
|
+
policyBlock === undefined
|
|
70
93
|
? "aligned"
|
|
71
|
-
: "stale"));
|
|
94
|
+
: "stale", policyBlock));
|
|
72
95
|
}
|
|
73
96
|
catch (cause) {
|
|
74
97
|
statuses.push(unavailableStatus(client.name, client.configPath, isMissing(cause) ? "missing" : "invalid"));
|
|
@@ -78,7 +101,7 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
78
101
|
};
|
|
79
102
|
const registrationAligned = (registration, client, currentCommandPath, platform, forcedEnabled = false) => {
|
|
80
103
|
const command = [registration.command, ...registration.args];
|
|
81
|
-
if (registration.disabled === true ||
|
|
104
|
+
if ((client.format !== "grok" && registration.disabled === true) ||
|
|
82
105
|
(registration.enabled === false && !forcedEnabled))
|
|
83
106
|
return false;
|
|
84
107
|
if (!isOwnedClientRegistrationCommand(command, currentCommandPath))
|
|
@@ -89,8 +112,8 @@ const registrationAligned = (registration, client, currentCommandPath, platform,
|
|
|
89
112
|
return false;
|
|
90
113
|
if (client.format === "vscode" && registration.type !== "stdio")
|
|
91
114
|
return false;
|
|
92
|
-
// OMP
|
|
93
|
-
if (client.format === "omp" &&
|
|
115
|
+
// OMP and Pi infer stdio for a command entry without an explicit type.
|
|
116
|
+
if ((client.format === "omp" || client.format === "pi") &&
|
|
94
117
|
registration.type !== undefined &&
|
|
95
118
|
registration.type !== "stdio")
|
|
96
119
|
return false;
|
|
@@ -136,16 +159,22 @@ const parseRegistration = (value, client) => {
|
|
|
136
159
|
throw new TypeError("Expected an stdio registration");
|
|
137
160
|
if (client.format === "commandcode" && registration.transport !== "stdio")
|
|
138
161
|
throw new TypeError("Expected an stdio registration");
|
|
139
|
-
if (client.format === "omp" &&
|
|
162
|
+
if ((client.format === "omp" || client.format === "pi") &&
|
|
140
163
|
registration.type !== undefined &&
|
|
141
164
|
registration.type !== "stdio")
|
|
142
165
|
throw new TypeError("Expected an stdio registration");
|
|
143
166
|
return registration;
|
|
144
167
|
};
|
|
145
168
|
const remediation = "Run rea setup to refresh this registration, then restart the client.";
|
|
146
|
-
const configuredStatus = (client, configPath, command, state) => state === "aligned"
|
|
169
|
+
const configuredStatus = (client, configPath, command, state, policyRemediation) => state === "aligned"
|
|
147
170
|
? { client, config_path: configPath, command, state, remediation: null }
|
|
148
|
-
: {
|
|
171
|
+
: {
|
|
172
|
+
client,
|
|
173
|
+
config_path: configPath,
|
|
174
|
+
command,
|
|
175
|
+
state,
|
|
176
|
+
remediation: policyRemediation ?? remediation,
|
|
177
|
+
};
|
|
149
178
|
const unavailableStatus = (client, configPath, state) => ({
|
|
150
179
|
client,
|
|
151
180
|
config_path: configPath,
|
|
@@ -153,6 +182,12 @@ const unavailableStatus = (client, configPath, state) => ({
|
|
|
153
182
|
state,
|
|
154
183
|
remediation,
|
|
155
184
|
});
|
|
185
|
+
const clientEvidencePresent = async (client) => {
|
|
186
|
+
for (const path of clientEvidencePaths(client))
|
|
187
|
+
if (await exists(path))
|
|
188
|
+
return true;
|
|
189
|
+
return false;
|
|
190
|
+
};
|
|
156
191
|
const exists = async (path) => {
|
|
157
192
|
if (path === undefined)
|
|
158
193
|
return false;
|
|
@@ -43,7 +43,7 @@ export const runProviderAnalysis = async (dependencies, ...[path, tool, argument
|
|
|
43
43
|
}));
|
|
44
44
|
/** Execute managed metadata inspection in an isolated managed-only session. */
|
|
45
45
|
export const runManagedProviderExecution = async (dependencies, path, tool, signal) => withProcessCancellation(signal, async (operationSignal) => {
|
|
46
|
-
const session = dependencies.createManagedBinarySession();
|
|
46
|
+
const session = await dependencies.createManagedBinarySession();
|
|
47
47
|
return withSessionCleanup(session, async () => {
|
|
48
48
|
const opened = await session.open(path, { signal: operationSignal });
|
|
49
49
|
if (!opened.ok)
|
|
@@ -70,7 +70,7 @@ const runAnalysis = async (dependencies, path, tool, arguments_, options) => {
|
|
|
70
70
|
const config = dependencies.readConfiguration();
|
|
71
71
|
if (!config.ok)
|
|
72
72
|
return cliError(config.error);
|
|
73
|
-
const session = dependencies.createBinarySession(config.value, logger);
|
|
73
|
+
const session = await dependencies.createBinarySession(config.value, logger);
|
|
74
74
|
return withSessionCleanup(session, async () => {
|
|
75
75
|
const prepared = await prepareSnapshot({
|
|
76
76
|
path,
|
|
@@ -3,7 +3,7 @@ import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
|
3
3
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
4
4
|
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
|
|
5
5
|
import { err } from "../domain/result.js";
|
|
6
|
-
import { analysisErrorWithCleanupFailure } from "
|
|
6
|
+
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
|
|
7
7
|
/** Await one-shot cleanup and retain either the outcome or both failures. */
|
|
8
8
|
export const withSessionCleanup = async (session, operation, onCleanupFailure) => {
|
|
9
9
|
let value;
|
|
@@ -7,7 +7,7 @@ export const runSessionStatus = async (dependencies, logger = silentLogger) => {
|
|
|
7
7
|
const config = dependencies.readConfiguration();
|
|
8
8
|
if (!config.ok)
|
|
9
9
|
return { error: projectAnalysisError(config.error) };
|
|
10
|
-
const session = dependencies.createBinarySession(config.value, logger);
|
|
10
|
+
const session = await dependencies.createBinarySession(config.value, logger);
|
|
11
11
|
try {
|
|
12
12
|
return {
|
|
13
13
|
...jsonObjectSchema.parse(session.status()),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { constants } from "node:fs";
|
|
2
|
-
import { access, readdir } from "node:fs/promises";
|
|
2
|
+
import { access, readdir, stat } from "node:fs/promises";
|
|
3
3
|
import { homeDirectoryFromEnvironment } from "../config/homeDirectory.js";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { analysisErrorRemediationAction } from "../domain/analysisErrorPresentation.js";
|
|
@@ -8,7 +8,7 @@ import { parseBinaryTarget } from "./BinaryTargetResolver.js";
|
|
|
8
8
|
import { execFileOutput } from "../process/ExecFileOutput.js";
|
|
9
9
|
import { installedCaskAppdir, probeHomebrew } from "./homebrew.js";
|
|
10
10
|
import { linuxHopperBinarySupported, linuxSharedLibrariesAvailable, readLinuxDistribution, } from "./LinuxHopper.js";
|
|
11
|
-
import {
|
|
11
|
+
import { readInstalledSkillIdentity, } from "./SetupSkill.js";
|
|
12
12
|
import { CATALOG_IDENTITY } from "../catalogIdentity.js";
|
|
13
13
|
import { PRODUCT_IDENTITY, SDK_IDENTITY } from "../identity.js";
|
|
14
14
|
import { readClientRegistrationStatuses, } from "./ClientRegistrationStatus.js";
|
|
@@ -228,7 +228,7 @@ export const systemDoctorHost = (options = {}) => {
|
|
|
228
228
|
return [];
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
|
-
installedSkillIdentity: (clientIds) => readInstalledSkillIdentity(homeDirectory, clientIds,
|
|
231
|
+
installedSkillIdentity: (clientIds) => readInstalledSkillIdentity(homeDirectory, clientIds, environment, platform),
|
|
232
232
|
clientRegistrations: () => readClientRegistrationStatuses(homeDirectory, undefined, {
|
|
233
233
|
platform,
|
|
234
234
|
environment,
|
|
@@ -248,6 +248,8 @@ const readMacosVersion = async (run, options) => {
|
|
|
248
248
|
const executableAvailable = async (path, platform, run, options) => {
|
|
249
249
|
try {
|
|
250
250
|
await access(path, constants.X_OK);
|
|
251
|
+
if (!(await stat(path)).isFile())
|
|
252
|
+
return false;
|
|
251
253
|
if (platform !== "linux")
|
|
252
254
|
return true;
|
|
253
255
|
const linked = await run("ldd", [path], options);
|