rea-agents 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -332
- package/bridge/ghidra/ReaGhidraBridge.java +561 -74
- package/bridge/hopper_bridge.py +70 -27
- package/bridge/native/ReaNativeUI.swift +157 -0
- package/dist/application/AnalysisContextQueries.js +19 -5
- package/dist/application/AnalysisSnapshotCache.js +30 -11
- package/dist/application/AppleAssetCatalogAnalysis.js +171 -0
- package/dist/application/ArtifactExtractionDestination.js +0 -12
- package/dist/application/ArtifactGraphConstruction.js +44 -11
- package/dist/application/ArtifactInventory/classify.js +7 -15
- package/dist/application/ArtifactInventory/hash.js +4 -2
- package/dist/application/ArtifactInventory/policy.js +2 -17
- package/dist/application/ArtifactInventory/reader.js +3 -3
- package/dist/application/ArtifactInventory/scanCanonical.js +2 -2
- package/dist/application/ArtifactInventory/scanReader.js +12 -4
- package/dist/application/ArtifactInventory/types.js +0 -3
- package/dist/application/BinarySession.js +28 -43
- package/dist/application/BinarySessionExecution.js +37 -1
- package/dist/application/BinaryTargetResolver.js +50 -4
- package/dist/application/BrowserEvidence.js +36 -7
- package/dist/application/BrowserObservationService.js +17 -44
- package/dist/application/BrowserScenarioCaptureService.js +2 -35
- package/dist/application/BrowserScenarioEvidence.js +13 -9
- package/dist/application/CapabilityClientRequirements.js +2 -11
- package/dist/application/CapabilityInventory.js +21 -35
- package/dist/application/ClientConfigurationDocument.js +84 -7
- package/dist/application/ClientRegistrationIdentity.js +32 -0
- package/dist/application/ClientRegistrationStatus.js +59 -6
- package/dist/application/DirectAnalysis.js +37 -58
- package/dist/application/DirectAnalysisStatus.js +4 -4
- package/dist/application/Doctor.js +89 -80
- package/dist/application/DoctorDiagnostics.js +2 -26
- package/dist/application/DoctorScope.js +8 -14
- package/dist/application/ElectronActiveEvidence.js +10 -27
- package/dist/application/ElectronActiveObservationService.js +9 -36
- package/dist/application/ElectronBoundaryAnalysis.js +2 -0
- package/dist/application/ElectronBoundaryGraphNative.js +1 -1
- package/dist/application/ElectronEvidence.js +8 -3
- package/dist/application/ElectronObservationService.js +9 -25
- package/dist/application/EnhancedLiteralTracing.js +4 -8
- package/dist/application/EnhancedTools.js +15 -35
- package/dist/application/FilesystemSnapshot.js +7 -8
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +2 -1
- package/dist/application/JavaScriptApplicationWorkflowService.js +31 -7
- package/dist/application/JavaScriptArtifactAnalysis.js +6 -4
- package/dist/application/JavaScriptArtifactFiles.js +5 -0
- package/dist/application/JavaScriptArtifactPathResolution.js +179 -47
- package/dist/application/JavaScriptRuntimeObservationEvidence.js +6 -3
- package/dist/application/JavaScriptRuntimeObservationService.js +9 -25
- package/dist/application/JavaScriptRuntimeReconciliationService.js +45 -4
- package/dist/application/JavaScriptSemanticGraphAsyncProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphChildProcessProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphDataProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphFlowProjection.js +14 -5
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LazyAnalysisProvider.js +27 -6
- package/dist/application/ManagedMemberComparisonService.js +19 -6
- package/dist/application/NativeApiInspection.js +2 -0
- package/dist/application/NativeCallRoutes.js +72 -0
- package/dist/application/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/NativeUiActionTrace.js +73 -49
- package/dist/application/NativeValueTrace.js +320 -0
- package/dist/application/ProcessCaptureCapability.js +32 -5
- package/dist/application/ProcessCaptureEnvironment.js +9 -26
- package/dist/application/ProcessCaptureError.js +1 -5
- package/dist/application/ProcessCaptureJournal.js +3 -40
- package/dist/application/ProcessCaptureLifecycle.js +102 -111
- package/dist/application/ProcessCli.js +18 -25
- package/dist/application/ProcessEvidence.js +5 -7
- package/dist/application/ProcessFilesystemEffects.js +36 -0
- package/dist/application/ProcessHarness.js +41 -120
- package/dist/application/ProcessNormalization.js +2 -17
- package/dist/application/ProcessScenarioRuntimeValidation.js +76 -0
- package/dist/application/ReferenceSourceImport.js +3 -4
- package/dist/application/Setup.js +236 -84
- package/dist/application/SetupClientConfiguration.js +14 -9
- package/dist/application/SetupPlan.js +138 -86
- package/dist/application/SetupSkill.js +0 -1
- package/dist/application/SupportedClients.js +102 -21
- package/dist/application/Uninstall.js +31 -20
- package/dist/application/Update.js +93 -0
- package/dist/application/UpdateMaintenance.js +108 -0
- package/dist/application/UpdateRuntime.js +126 -0
- package/dist/application/runtime.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +6 -8
- package/dist/artifacts/ArtifactProvider.js +94 -41
- package/dist/artifacts/AsarArtifactReader.js +19 -4
- package/dist/artifacts/KeyedArchiveReader.js +110 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +53 -5
- package/dist/artifacts/ZipArtifactReader.js +18 -1
- package/dist/browser/BrowserScenarioSecrets.js +28 -1
- package/dist/browser/CdpBrowserProvider.js +36 -15
- package/dist/browser/CdpCaptureDocuments.js +22 -8
- package/dist/browser/CdpCaptureEventHandlers.js +14 -5
- package/dist/browser/CdpCaptureEventHelpers.js +13 -0
- package/dist/browser/CdpCaptureEvents.js +10 -1
- package/dist/browser/CdpElectronInspection.js +5 -10
- package/dist/browser/CdpElectronProvider.js +1 -5
- package/dist/browser/CdpElectronScripts.js +1 -1
- package/dist/browser/CdpEndpoint.js +3 -2
- package/dist/browser/CdpObservationSession.js +14 -10
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpPageCaptureScripts.js +1 -1
- package/dist/browser/CdpSafeMetadata.js +5 -4
- package/dist/browser/CdpScreenshot.js +16 -5
- package/dist/browser/CdpTargetSession.js +25 -4
- package/dist/browser/CdpWebMcpDiscovery.js +93 -20
- package/dist/browser/JavaScriptRuntimeScope.js +28 -2
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +9 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +3 -10
- package/dist/browser/PlaywrightElectronActiveProvider.js +5 -5
- package/dist/browser/PlaywrightScenarioActions.js +1 -1
- package/dist/browser/PlaywrightScenarioArtifacts.js +13 -25
- package/dist/browser/PlaywrightScenarioBrowser.js +28 -25
- package/dist/browser/PlaywrightScenarioEvents.js +82 -93
- package/dist/browser/PlaywrightScenarioSession.js +27 -123
- package/dist/browser/PngVisualDiff.js +22 -3
- package/dist/browser/V8InspectorCaptureProjection.js +7 -1
- package/dist/browser/V8InspectorProvider.js +60 -7
- package/dist/browser/WebSourceMapFetcher.js +99 -53
- package/dist/cli/artifactCommands.js +56 -12
- package/dist/cli/coreAnalysisCommands.js +110 -0
- package/dist/cli/managedCommands.js +1 -31
- package/dist/cli/setupCommands.js +16 -14
- package/dist/cli/utilityCommands.js +61 -4
- package/dist/cli.js +5 -7
- package/dist/cliApplicationCommands.js +0 -83
- package/dist/cliBrowserAdvancedCommands.js +7 -11
- package/dist/cliBrowserCommands.js +15 -23
- package/dist/cliBrowserContext.js +3 -24
- package/dist/cliBrowserScenarioCommands.js +2 -10
- package/dist/cliCommandNames.js +82 -7
- package/dist/cliElectronCommands.js +10 -36
- package/dist/cliJavaScriptRuntimeCommands.js +6 -30
- package/dist/cliJsonInput.js +4 -2
- package/dist/cliLogging.js +16 -7
- package/dist/cliObservationOptions.js +1 -1
- package/dist/cliOutput.js +2 -4
- package/dist/cliProcessCommands.js +6 -33
- package/dist/cliSetup.js +90 -160
- package/dist/config/environment.js +2 -78
- package/dist/config/parseConfig.js +18 -109
- package/dist/config/parsers.js +0 -23
- package/dist/contracts/applicationToolContracts.js +1 -118
- package/dist/contracts/artifactToolContracts.js +11 -19
- package/dist/contracts/browserScenarioToolContracts.js +1 -5
- package/dist/contracts/browserToolContracts.js +9 -16
- package/dist/contracts/electronToolContracts.js +5 -6
- package/dist/contracts/enhancedInputs.js +3 -2
- package/dist/contracts/errorSchemas.js +16 -40
- package/dist/contracts/functionWorkflowToolContracts.js +2 -2
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +2 -2
- package/dist/contracts/javascriptRuntimeObservationToolContracts.js +4 -4
- package/dist/contracts/javascriptRuntimeReconciliationExample.js +1 -1
- package/dist/contracts/managedToolContracts.js +7 -4
- package/dist/contracts/managedWorkflowExamples.js +0 -22
- package/dist/contracts/managedWorkflowToolContracts.js +16 -31
- package/dist/contracts/nativeToolContracts.js +9 -0
- package/dist/contracts/promptContracts.js +6 -6
- package/dist/contracts/sessionToolSchemas.js +3 -3
- package/dist/contracts/toolContractExamples.js +4 -3
- package/dist/contracts/toolContracts.js +18 -7
- package/dist/contracts/toolEffects.js +34 -21
- package/dist/contracts/toolOutputSchemaGroups.js +18 -5
- package/dist/contracts/toolOutputSchemaPrimitives.js +9 -6
- package/dist/contracts/toolSchemaMetadata.js +5 -8
- package/dist/doctorRuntime.js +0 -41
- package/dist/domain/analysisErrorPresentation.js +4 -28
- package/dist/domain/analysisErrorProjection.js +33 -50
- package/dist/domain/analysisProfile.js +1 -1
- package/dist/domain/analysisSnapshot.js +77 -3
- package/dist/domain/androidApplication.js +5 -4
- package/dist/domain/appleApplication.js +5 -4
- package/dist/domain/appleAssetCatalog.js +127 -0
- package/dist/domain/artifactComparison.js +7 -11
- package/dist/domain/artifactGraph.js +8 -6
- package/dist/domain/artifactInspection.js +13 -12
- package/dist/domain/binaryTarget.js +23 -9
- package/dist/domain/browserObservation.js +43 -24
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenario.js +7 -107
- package/dist/domain/browserScenarioCapture.js +0 -1
- package/dist/domain/browserScenarioCaptureValues.js +5 -4
- package/dist/domain/browserScenarioDiff.js +1 -3
- package/dist/domain/browserScenarioValues.js +16 -107
- package/dist/domain/bundleComparison.js +18 -17
- package/dist/domain/callPathSchemas.js +17 -7
- package/dist/domain/changedBehavior.js +2 -3
- package/dist/domain/comparisonSemantics.js +19 -0
- package/dist/domain/completionLedgerGeneration.js +3 -2
- package/dist/domain/conformancePackage.js +2 -1
- package/dist/domain/conformanceTrustGate.js +3 -5
- package/dist/domain/customProtocolCapture.js +2 -2
- package/dist/domain/digests.js +30 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/electronActiveObservation.js +7 -5
- package/dist/domain/electronObservation.js +3 -2
- package/dist/domain/electronStaticAnalysisNative.js +15 -6
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/errors.js +10 -28
- package/dist/domain/evidence.js +5 -3
- package/dist/domain/evidenceCompletionLedger.js +3 -2
- package/dist/domain/functionComparisonNormalization.js +24 -18
- package/dist/domain/functionComparisonResults.js +3 -7
- package/dist/domain/functionComparisonSchemas.js +3 -2
- package/dist/domain/hopperValues.js +108 -8
- package/dist/domain/javascriptApplicationAnalysis.js +4 -7
- package/dist/domain/javascriptApplicationEvidenceSchemas.js +4 -3
- package/dist/domain/javascriptApplicationGraphSchemas.js +8 -7
- package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +9 -7
- package/dist/domain/javascriptApplicationVersionItems.js +12 -18
- package/dist/domain/javascriptAstValues.js +4 -0
- package/dist/domain/javascriptExportShapeComparison.js +1 -6
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +6 -10
- package/dist/domain/javascriptExportShapeVariants.js +15 -2
- package/dist/domain/javascriptFeatureTraceSchemas.js +8 -7
- package/dist/domain/javascriptRuntimeObservation.js +14 -2
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +8 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +4 -2
- package/dist/domain/javascriptRuntimeReconciliationResult.js +6 -4
- package/dist/domain/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +19 -18
- package/dist/domain/javascriptRuntimeStaticCandidates.js +18 -6
- package/dist/domain/javascriptSemanticAnalysis.js +57 -19
- package/dist/domain/javascriptSemanticAsyncEffects.js +39 -40
- package/dist/domain/javascriptSemanticCalls.js +46 -27
- package/dist/domain/javascriptSemanticChildProcesses.js +43 -50
- package/dist/domain/javascriptSemanticDataEffectHelpers.js +91 -18
- package/dist/domain/javascriptSemanticDataEffects.js +22 -10
- package/dist/domain/javascriptSemanticGraphSchemas.js +8 -6
- package/dist/domain/javascriptSemanticObjects.js +13 -3
- package/dist/domain/javascriptSemanticProjection.js +144 -38
- package/dist/domain/javascriptSemanticPromises.js +14 -27
- package/dist/domain/javascriptSemanticQuerySchemas.js +6 -9
- package/dist/domain/javascriptSemanticResources.js +2 -5
- package/dist/domain/javascriptSemanticState.js +4 -0
- package/dist/domain/javascriptSemanticTraceSchemas.js +2 -1
- package/dist/domain/javascriptSemanticTraversal.js +13 -5
- package/dist/domain/javascriptSemanticValues.js +10 -9
- package/dist/domain/javascriptSourceParser.js +5 -1
- package/dist/domain/javascriptStaticAnalysisCalls.js +8 -5
- package/dist/domain/javascriptStaticAnalysisHelpers.js +16 -7
- package/dist/domain/keyedArchive.js +181 -0
- package/dist/domain/managedApplicationGraph.js +4 -3
- package/dist/domain/managedArtifact.js +2 -1
- package/dist/domain/managedMemberComparison.js +18 -13
- package/dist/domain/managedMemberComparisonCoverage.js +2 -1
- package/dist/domain/managedMemberComparisonItems.js +27 -7
- package/dist/domain/managedMemberComparisonMatch.js +22 -6
- package/dist/domain/managedNativeVerificationMatch.js +2 -2
- package/dist/domain/managedNativeVerificationSchemas.js +7 -5
- package/dist/domain/managedReconstruction.js +6 -5
- package/dist/domain/nativeApiBoundary.js +7 -0
- package/dist/domain/nativeDataType.js +51 -0
- package/dist/domain/nativeInspection.js +0 -1
- package/dist/domain/nativeInstruction.js +82 -0
- package/dist/domain/nativeInvestigationGraph.js +9 -5
- package/dist/domain/nativeUiObservation.js +123 -0
- package/dist/domain/nativeValueFlow.js +17 -0
- package/dist/domain/nativeValueTrace.js +64 -0
- package/dist/domain/objcSwiftMetadata.js +39 -0
- package/dist/domain/peInspection.js +1 -0
- package/dist/domain/processCapture.js +5 -55
- package/dist/domain/processCaptureExample.js +0 -9
- package/dist/domain/processCaptureValidation.js +13 -144
- package/dist/domain/processComparison.js +3 -25
- package/dist/domain/processObservation.js +0 -29
- package/dist/domain/processScenario.js +28 -228
- package/dist/domain/processTraceDimensionProjection.js +0 -15
- package/dist/domain/processTraceEvaluation.js +0 -6
- package/dist/domain/protocolCapture.js +8 -36
- package/dist/domain/reconstructionCoverage.js +3 -2
- package/dist/domain/reconstructionObligationLedgerSchemas.js +4 -12
- package/dist/domain/reconstructionReadinessSchemas.js +4 -3
- package/dist/domain/reconstructionVerification.js +2 -1
- package/dist/domain/reconstructionVerificationSchemas.js +6 -13
- package/dist/domain/referenceSourceClassification.js +0 -110
- package/dist/domain/referenceSourceGraph.js +15 -5
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/runtimeIdentification.js +6 -5
- package/dist/domain/sourceMapContents.js +5 -0
- package/dist/domain/sourceToBundleComparison.js +3 -10
- package/dist/domain/sourceToBundleComparisonSchemas.js +7 -6
- package/dist/domain/sourceToBundleSignals.js +9 -3
- package/dist/domain/staticRuntimeCorrelation.js +5 -11
- package/dist/domain/webBundleAnalysis.js +17 -9
- package/dist/domain/webBundleAnalyzer.js +1 -1
- package/dist/domain/webCaptureDiff.js +5 -11
- package/dist/domain/webCaptureDiffSchemas.js +2 -1
- package/dist/domain/webMcpDiscovery.js +2 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +15 -7
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +57 -40
- package/dist/dotnet/ManagedMemberRows.js +2 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +15 -8
- package/dist/dotnet/ManagedPeReader.js +2 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +15 -5
- package/dist/ghidra/GhidraClient.js +38 -8
- package/dist/ghidra/GhidraFunctionValues.js +56 -20
- package/dist/ghidra/GhidraInstallation.js +7 -4
- package/dist/ghidra/GhidraInventoryValues.js +44 -9
- package/dist/ghidra/GhidraLauncher.js +18 -3
- package/dist/ghidra/GhidraProvider.js +23 -2
- package/dist/ghidra/GhidraRequestQueue.js +45 -4
- package/dist/ghidra/GhidraSessionValues.js +5 -0
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperProvider.js +29 -6
- package/dist/hopper/HopperTargetLease.js +18 -4
- package/dist/logger.js +0 -13
- package/dist/main/messages.js +0 -1
- package/dist/main/reload.js +3 -32
- package/dist/main/shutdown.js +1 -2
- package/dist/main/transport.js +0 -17
- package/dist/main.js +0 -10
- package/dist/native/AppleDispatchMetadata.js +582 -0
- package/dist/native/AppleObjcProtocols.js +88 -0
- package/dist/native/AppleSwiftVtables.js +86 -0
- package/dist/native/CommandRunner.js +1 -1
- package/dist/native/NativeHostCapabilities.js +23 -0
- package/dist/native/NativeMacOSProvider.js +61 -9
- package/dist/native/NativeMachoInspection.js +39 -6
- package/dist/native/NativeUiHelperRuntime.js +42 -0
- package/dist/native/NativeUiObservation.js +174 -0
- package/dist/native/parsers/codesign.js +4 -1
- package/dist/native/parsers/dyldInfo.js +51 -25
- package/dist/native/parsers/lipo.js +13 -4
- package/dist/native/parsers/otool.js +84 -39
- package/dist/native/parsers/plist.js +2 -1
- package/dist/process/ExecFileOutput.js +5 -1
- package/dist/process/ProcessOwnership.js +69 -33
- package/dist/process/ProcessOwnershipObservation.js +31 -12
- package/dist/process/ProviderProcess.js +4 -2
- package/dist/reference/ReferenceSourceReaderEntries.js +48 -31
- package/dist/reference/ReferenceSourceReaderErrors.js +24 -0
- package/dist/reference/ReferenceSourceReaderFile.js +11 -5
- package/dist/reference/ReferenceSourceReaderValidate.js +22 -8
- package/dist/server/createServer.js +7 -62
- package/dist/server/registerApplicationTools/helpers.js +2 -9
- package/dist/server/registerApplicationTools.js +0 -4
- package/dist/server/registerArtifactComparisonTool.js +1 -1
- package/dist/server/registerBrowserScenarioTool.js +4 -2
- package/dist/server/registerBrowserTools.js +7 -7
- package/dist/server/registerBundleComparisonTool.js +1 -1
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +10 -4
- package/dist/server/registerEnhancedTools.js +20 -12
- package/dist/server/registerEvidenceTools.js +4 -28
- package/dist/server/registerFunctionComparisonTool.js +1 -1
- package/dist/server/registerInvestigationTools.js +6 -6
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -2
- package/dist/server/registerManagedTools.js +28 -14
- package/dist/server/registerManagedWorkflowTools.js +0 -2
- package/dist/server/registerProcessComparisonTool.js +1 -3
- package/dist/server/registerSessionRecordTools.js +9 -9
- package/dist/server/registerSessionStatusTool.js +1 -1
- package/dist/server/registerSessionTools.js +28 -57
- package/dist/server/sessionAvailabilityPolicy.js +2 -3
- package/dist/server/sessionToolPolicies.js +0 -4
- package/dist/server/toolResult.js +8 -10
- package/package.json +32 -22
- package/skills/reverse-engineer-anything/SKILL.md +15 -11
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +3 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +3 -2
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +8 -6
- package/skills/reverse-engineer-anything/references/runtime-observation.md +15 -11
- package/dist/application/CommandShimReplay.js +0 -152
- package/dist/application/ConfiguredRoots.js +0 -19
- package/dist/application/InstrumentedJavaScriptReplayHost.js +0 -36
- package/dist/application/JavaScriptReplayPermission.js +0 -16
- package/dist/application/JavaScriptReplayPlanning.js +0 -207
- package/dist/application/JavaScriptReplayService.js +0 -274
- package/dist/application/LoopbackReplay.js +0 -389
- package/dist/application/LoopbackReplayRecorder.js +0 -129
- package/dist/application/ManagedRuntimeCorrelationService.js +0 -104
- package/dist/application/NodeRuntimeCharacterizationService.js +0 -191
- package/dist/application/PermissionAuthority.js +0 -268
- package/dist/application/PermissionConfiguration.js +0 -26
- package/dist/application/PermissionFailure.js +0 -5
- package/dist/application/ProcessCaptureAuthority.js +0 -24
- package/dist/application/ProcessCapturePermission.js +0 -13
- package/dist/application/ProcessCheckpoints.js +0 -178
- package/dist/application/ProcessReactiveCoordinator.js +0 -223
- package/dist/application/ProcessReactiveEffects.js +0 -153
- package/dist/application/ProcessReactiveHarness.js +0 -106
- package/dist/application/ProcessReactiveObservations.js +0 -105
- package/dist/application/ProjectPermissionStore.js +0 -199
- package/dist/application/RuntimeExecutableDiagnostics.js +0 -198
- package/dist/application/Upgrade.js +0 -134
- package/dist/browser/SensitiveTextCapture.js +0 -8
- package/dist/cliPolicyCommands.js +0 -185
- package/dist/config/browserScenario.js +0 -77
- package/dist/config/electronAutomation.js +0 -35
- package/dist/config/javascriptReplay.js +0 -41
- package/dist/config/managedRuntime.js +0 -25
- package/dist/config/passiveObservation.js +0 -87
- package/dist/config/permissions.js +0 -23
- package/dist/config/processCapture.js +0 -47
- package/dist/contracts/replayMachineExample.js +0 -37
- package/dist/domain/javascriptExportInstrumentation.js +0 -95
- package/dist/domain/javascriptReplay.js +0 -360
- package/dist/domain/managedRuntimeCorrelation.js +0 -181
- package/dist/domain/nodeRuntimeCharacterization.js +0 -63
- package/dist/domain/permissionPolicy.js +0 -176
- package/dist/domain/processCaptureReactiveSchema.js +0 -68
- package/dist/domain/processCaptureReactiveValidation.js +0 -180
- package/dist/domain/processReactiveCheckpointDataflow.js +0 -32
- package/dist/domain/processReactiveMatching.js +0 -196
- package/dist/domain/processReactiveRuntime.js +0 -116
- package/dist/domain/processReactiveScenario.js +0 -296
- package/dist/domain/processReactiveScenarioPreflight.js +0 -95
- package/dist/domain/processReactiveTransition.js +0 -187
- package/dist/domain/replayMachine.js +0 -320
- package/dist/domain/replayMachineRun.js +0 -168
- package/dist/domain/replayMachineRuntime.js +0 -296
- package/dist/domain/replayMachineValues.js +0 -84
- package/dist/domain/runtimeCharacterization.js +0 -84
- package/dist/replay/JavaScriptReplayWorker.js +0 -382
- package/dist/replay/JavaScriptReplayWorkerTypes.js +0 -1
- package/dist/replay/LinuxJavaScriptReplayRunner.js +0 -216
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +0 -121
- package/dist/replay/LinuxRuntimeClosure.js +0 -44
- package/dist/replay/LinuxSeccompPolicy.js +0 -40
- package/dist/replay/ReplayOutcome.js +0 -104
- package/dist/replay/ReplayProcessLifecycle.js +0 -96
- package/dist/replay/ReplaySeccompFile.js +0 -29
- package/dist/replay/ReplayWorkerProtocol.js +0 -58
- package/dist/replay/SystemJavaScriptReplayHost.js +0 -153
- package/dist/server/ProcessCaptureElicitation.js +0 -153
- package/dist/server/registerApplicationTools/characterization.js +0 -46
- package/dist/server/registerApplicationTools/controlledReplay.js +0 -31
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +0 -29
- package/dist/server/registerReplayMachineTool.js +0 -14
- package/skills/reverse-engineer-anything/references/controlled-replay.md +0 -12
|
@@ -4,19 +4,34 @@ import { resolve } from "node:path";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
6
6
|
import { MCP_STARTUP_POLICY } from "../mcpStartupPolicy.js";
|
|
7
|
+
import { isOwnedClientRegistrationCommand } from "./ClientRegistrationIdentity.js";
|
|
7
8
|
import { supportedClients } from "./SupportedClients.js";
|
|
8
9
|
const registrationSchema = z
|
|
9
10
|
.object({
|
|
10
11
|
command: z.string().min(1),
|
|
11
12
|
args: z.array(z.string()).default([]),
|
|
12
13
|
startup_timeout_sec: z.number().positive().optional(),
|
|
14
|
+
type: z.string().optional(),
|
|
15
|
+
tools: z.array(z.string()).optional(),
|
|
16
|
+
disabled: z.boolean().optional(),
|
|
17
|
+
enabled: z.boolean().optional(),
|
|
13
18
|
})
|
|
14
19
|
.passthrough();
|
|
15
20
|
/** Inspect supported client registrations without reading their environment. */
|
|
16
|
-
export const readClientRegistrationStatuses = async (home, currentCommandPath = resolve(process.argv[1] ?? "unknown")) => {
|
|
21
|
+
export const readClientRegistrationStatuses = async (home, currentCommandPath = resolve(process.argv[1] ?? "unknown"), options = {}) => {
|
|
17
22
|
const statuses = [];
|
|
18
|
-
for (const client of supportedClients(home
|
|
19
|
-
|
|
23
|
+
for (const client of supportedClients(home, options.platform, options.environment === undefined
|
|
24
|
+
? undefined
|
|
25
|
+
: {
|
|
26
|
+
APPDATA: options.environment.APPDATA,
|
|
27
|
+
CLAUDE_CONFIG_DIR: options.environment.CLAUDE_CONFIG_DIR,
|
|
28
|
+
CODEX_HOME: options.environment.CODEX_HOME,
|
|
29
|
+
COPILOT_HOME: options.environment.COPILOT_HOME,
|
|
30
|
+
OPENCODE_CONFIG: options.environment.OPENCODE_CONFIG,
|
|
31
|
+
XDG_CONFIG_HOME: options.environment.XDG_CONFIG_HOME,
|
|
32
|
+
})) {
|
|
33
|
+
if (client.format === "unsupported" ||
|
|
34
|
+
(!(await exists(client.markerPath)) && !(await exists(client.configPath))))
|
|
20
35
|
continue;
|
|
21
36
|
try {
|
|
22
37
|
const content = await readFile(client.configPath, "utf8");
|
|
@@ -26,12 +41,12 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
26
41
|
statuses.push(unavailableStatus(client.name, client.configPath, "missing"));
|
|
27
42
|
continue;
|
|
28
43
|
}
|
|
29
|
-
const registration =
|
|
44
|
+
const registration = parseRegistration(raw, client);
|
|
30
45
|
const command = [
|
|
31
46
|
registration.command,
|
|
32
47
|
...registration.args,
|
|
33
48
|
];
|
|
34
|
-
statuses.push(configuredStatus(client.name, client.configPath, command, registrationAligned(registration, client
|
|
49
|
+
statuses.push(configuredStatus(client.name, client.configPath, command, registrationAligned(registration, client, currentCommandPath)
|
|
35
50
|
? "aligned"
|
|
36
51
|
: "stale"));
|
|
37
52
|
}
|
|
@@ -43,10 +58,25 @@ export const readClientRegistrationStatuses = async (home, currentCommandPath =
|
|
|
43
58
|
};
|
|
44
59
|
const registrationAligned = (registration, client, currentCommandPath) => {
|
|
45
60
|
const command = [registration.command, ...registration.args];
|
|
46
|
-
if (
|
|
61
|
+
if (registration.disabled === true || registration.enabled === false)
|
|
62
|
+
return false;
|
|
63
|
+
if (!isOwnedClientRegistrationCommand(command, currentCommandPath))
|
|
64
|
+
return false;
|
|
65
|
+
if (command.length === 3 &&
|
|
66
|
+
command[2] === "mcp" &&
|
|
67
|
+
resolve(command[0] ?? "") === resolve(process.execPath) &&
|
|
68
|
+
resolve(command[1] ?? "") === currentCommandPath)
|
|
69
|
+
return true;
|
|
70
|
+
if (client.name === "codex" &&
|
|
47
71
|
registration.startup_timeout_sec !==
|
|
48
72
|
MCP_STARTUP_POLICY.codexStartupTimeoutSeconds)
|
|
49
73
|
return false;
|
|
74
|
+
if (client.format === "vscode" && registration.type !== "stdio")
|
|
75
|
+
return false;
|
|
76
|
+
if (client.format === "copilot_cli" &&
|
|
77
|
+
(registration.type !== "stdio" ||
|
|
78
|
+
JSON.stringify(registration.tools) !== JSON.stringify(["*"])))
|
|
79
|
+
return false;
|
|
50
80
|
if (command.length === 4 &&
|
|
51
81
|
command[0] === "npx" &&
|
|
52
82
|
command[1] === "-y" &&
|
|
@@ -57,6 +87,29 @@ const registrationAligned = (registration, client, currentCommandPath) => {
|
|
|
57
87
|
command[1] === "mcp" &&
|
|
58
88
|
resolve(command[0] ?? "") === currentCommandPath);
|
|
59
89
|
};
|
|
90
|
+
const parseRegistration = (value, client) => {
|
|
91
|
+
if (client.format === "opencode") {
|
|
92
|
+
const entry = z
|
|
93
|
+
.object({
|
|
94
|
+
type: z.literal("local"),
|
|
95
|
+
command: z.array(z.string()).min(1),
|
|
96
|
+
environment: z.record(z.string(), z.string()).optional(),
|
|
97
|
+
})
|
|
98
|
+
.passthrough()
|
|
99
|
+
.parse(value);
|
|
100
|
+
const [command = "", ...args] = entry.command;
|
|
101
|
+
return registrationSchema.parse({
|
|
102
|
+
...entry,
|
|
103
|
+
command,
|
|
104
|
+
args,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
const registration = registrationSchema.parse(value);
|
|
108
|
+
if ((client.format === "vscode" || client.format === "copilot_cli") &&
|
|
109
|
+
registration.type !== "stdio")
|
|
110
|
+
throw new TypeError("Expected an stdio registration");
|
|
111
|
+
return registration;
|
|
112
|
+
};
|
|
60
113
|
const remediation = "Run rea setup to refresh this registration, then restart the client.";
|
|
61
114
|
const configuredStatus = (client, configPath, command, state) => state === "aligned"
|
|
62
115
|
? { client, config_path: configPath, command, state, remediation: null }
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { projectPermissionFailure } from "./PermissionFailure.js";
|
|
2
|
-
import { artifactExtractionPermissionRequest } from "./ArtifactExtractionDestination.js";
|
|
3
1
|
import { parseConfig } from "../config.js";
|
|
4
2
|
import { EnhancedTools } from "./EnhancedTools.js";
|
|
5
|
-
import { createBinarySession } from "./runtime.js";
|
|
3
|
+
import { createBinarySession, createManagedBinarySession } from "./runtime.js";
|
|
6
4
|
import { silentLogger } from "../logger.js";
|
|
7
5
|
import { createEvidence } from "../domain/evidence.js";
|
|
6
|
+
import { isManagedToolName, } from "../contracts/managedToolContracts.js";
|
|
8
7
|
import { EvidenceIntegrityError, projectAnalysisError, } from "../domain/errors.js";
|
|
9
8
|
import { access } from "node:fs/promises";
|
|
10
9
|
import { readAnalysisSnapshot, writeAnalysisSnapshot, } from "./AnalysisSnapshotFiles.js";
|
|
11
10
|
import { parseBinaryTarget } from "./BinaryTargetResolver.js";
|
|
12
11
|
import { snapshotEvidenceForQuery, snapshotMatchesTarget, } from "../domain/analysisSnapshot.js";
|
|
13
12
|
import { err, ok } from "../domain/result.js";
|
|
14
|
-
import { loadConfiguredPermissionAuthority } from "./PermissionConfiguration.js";
|
|
15
13
|
import { REA_WORKFLOW_PROVIDER, workflowAnalysisProfile, } from "./InvestigationProviders.js";
|
|
16
14
|
import { artifactInspectionResultSchema } from "../domain/artifactInspection.js";
|
|
17
15
|
export { runCapabilityStatus, runProviderStatus, } from "./DirectAnalysisStatus.js";
|
|
@@ -27,69 +25,47 @@ export const runDirectAnalysis = async (path, tool, arguments_, options = {}) =>
|
|
|
27
25
|
...(options.providerId === undefined
|
|
28
26
|
? {}
|
|
29
27
|
: { providerId: options.providerId }),
|
|
30
|
-
...(options.permissionAuthority === undefined
|
|
31
|
-
? {}
|
|
32
|
-
: { permissionAuthority: options.permissionAuthority }),
|
|
33
28
|
}));
|
|
34
29
|
/** Execute one provider-native semantic operation with atomic provenance. */
|
|
35
|
-
export const runProviderAnalysis = async (...[path, tool, arguments_, logger = silentLogger, signal]) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return err(projectPermissionFailure(result.error));
|
|
30
|
+
export const runProviderAnalysis = async (...[path, tool, arguments_, logger = silentLogger, signal]) => isManagedToolName(tool)
|
|
31
|
+
? runManagedProviderAnalysis(path, tool, signal)
|
|
32
|
+
: withProcessCancellation(signal, (operationSignal) => runAnalysis(path, tool, arguments_, {
|
|
33
|
+
logger,
|
|
34
|
+
snapshotPath: undefined,
|
|
35
|
+
signal: operationSignal,
|
|
36
|
+
}));
|
|
37
|
+
/** Execute managed metadata inspection in an isolated managed-only session. */
|
|
38
|
+
export const runManagedProviderExecution = async (path, tool, signal) => withProcessCancellation(signal, async (operationSignal) => {
|
|
39
|
+
const session = createManagedBinarySession();
|
|
40
|
+
try {
|
|
41
|
+
const opened = await session.open(path, { signal: operationSignal });
|
|
42
|
+
if (!opened.ok)
|
|
43
|
+
return opened;
|
|
44
|
+
return await session.execute(tool, {}, { signal: operationSignal });
|
|
51
45
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const result = await authority.authorize({
|
|
55
|
-
capability: "native_mount",
|
|
56
|
-
roots: [],
|
|
57
|
-
executables: [],
|
|
58
|
-
environment_names: [],
|
|
59
|
-
network: "none",
|
|
60
|
-
mount: true,
|
|
61
|
-
operation_identity: `${tool}:native_mount`,
|
|
62
|
-
}, "read");
|
|
63
|
-
if (!result.ok)
|
|
64
|
-
return err(projectPermissionFailure(result.error));
|
|
46
|
+
finally {
|
|
47
|
+
await session.close();
|
|
65
48
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
49
|
+
});
|
|
50
|
+
const runManagedProviderAnalysis = async (path, tool, signal) => {
|
|
51
|
+
const execution = await runManagedProviderExecution(path, tool, signal);
|
|
52
|
+
if (!execution.ok)
|
|
53
|
+
return cliError(execution.error);
|
|
54
|
+
const value = execution.value;
|
|
55
|
+
return createEvidence(value.subject ?? undefined, value.provider, {
|
|
56
|
+
operation: tool,
|
|
57
|
+
parameters: {},
|
|
58
|
+
result: value.result,
|
|
59
|
+
rawResult: value.rawResult,
|
|
60
|
+
limitations: value.limitations,
|
|
61
|
+
locations: value.locations,
|
|
62
|
+
});
|
|
79
63
|
};
|
|
80
64
|
const runAnalysis = async (path, tool, arguments_, options) => {
|
|
81
65
|
const { logger, signal, snapshotPath } = options;
|
|
82
|
-
const config = parseConfig(process.env);
|
|
66
|
+
const config = parseConfig(options.environment ?? process.env);
|
|
83
67
|
if (!config.ok)
|
|
84
68
|
return cliError(config.error);
|
|
85
|
-
const authorization = await authorizeAnalysisRun({
|
|
86
|
-
config: config.value,
|
|
87
|
-
suppliedAuthority: options.permissionAuthority,
|
|
88
|
-
tool,
|
|
89
|
-
arguments: arguments_,
|
|
90
|
-
});
|
|
91
|
-
if (!authorization.ok)
|
|
92
|
-
return cliError(authorization.error);
|
|
93
69
|
const session = createBinarySession(config.value, logger);
|
|
94
70
|
try {
|
|
95
71
|
const prepared = await prepareSnapshot({
|
|
@@ -158,6 +134,7 @@ const executeAnalysisTool = async (input) => {
|
|
|
158
134
|
tool === "inspect_native_api" ||
|
|
159
135
|
tool === "inspect_native_dispatch_metadata" ||
|
|
160
136
|
tool === "trace_feature" ||
|
|
137
|
+
tool === "trace_native_values" ||
|
|
161
138
|
tool === "trace_native_ui_action") {
|
|
162
139
|
const result = await new EnhancedTools(session).execute(tool, input.arguments, signal);
|
|
163
140
|
if (!result.ok)
|
|
@@ -234,7 +211,9 @@ const analysisProfileForEvidence = (session, tool) => {
|
|
|
234
211
|
};
|
|
235
212
|
const isWorkflowEvidenceTool = (tool) => tool === "binary_overview" ||
|
|
236
213
|
tool === "inspect_native_api" ||
|
|
214
|
+
tool === "inspect_native_dispatch_metadata" ||
|
|
237
215
|
tool === "trace_feature" ||
|
|
216
|
+
tool === "trace_native_values" ||
|
|
238
217
|
tool === "trace_native_ui_action";
|
|
239
218
|
const fileExists = async (path) => {
|
|
240
219
|
try {
|
|
@@ -4,8 +4,8 @@ import { jsonObjectSchema } from "../domain/jsonValue.js";
|
|
|
4
4
|
import { createServerIdentity } from "../serverIdentity.js";
|
|
5
5
|
import { silentLogger } from "../logger.js";
|
|
6
6
|
import { createBinarySession } from "./runtime.js";
|
|
7
|
-
const runSessionStatus = async (logger = silentLogger) => {
|
|
8
|
-
const config = parseConfig(
|
|
7
|
+
const runSessionStatus = async (logger = silentLogger, environment = process.env) => {
|
|
8
|
+
const config = parseConfig(environment);
|
|
9
9
|
if (!config.ok)
|
|
10
10
|
return { error: projectAnalysisError(config.error) };
|
|
11
11
|
const session = createBinarySession(config.value, logger);
|
|
@@ -22,6 +22,6 @@ const runSessionStatus = async (logger = silentLogger) => {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
/** List complete provider identities, capabilities, and availability. */
|
|
25
|
-
export const runProviderStatus = (logger = silentLogger) => runSessionStatus(logger);
|
|
25
|
+
export const runProviderStatus = (logger = silentLogger, environment = process.env) => runSessionStatus(logger, environment);
|
|
26
26
|
/** List complete operation descriptors and availability. */
|
|
27
|
-
export const runCapabilityStatus = (logger = silentLogger) => runSessionStatus(logger);
|
|
27
|
+
export const runCapabilityStatus = (logger = silentLogger, environment = process.env) => runSessionStatus(logger, environment);
|
|
@@ -9,7 +9,6 @@ import { linuxHopperBinarySupported, linuxSharedLibrariesAvailable, readLinuxDis
|
|
|
9
9
|
import { CATALOG_IDENTITY } from "../catalogIdentity.js";
|
|
10
10
|
import { PRODUCT_IDENTITY, SDK_IDENTITY } from "../identity.js";
|
|
11
11
|
import { readClientRegistrationStatuses, } from "./ClientRegistrationStatus.js";
|
|
12
|
-
import { inspectRuntimeExecutables, } from "./RuntimeExecutableDiagnostics.js";
|
|
13
12
|
import { collectDoctorDiagnostics, doctorHealthy, } from "./DoctorDiagnostics.js";
|
|
14
13
|
import { normalizeDoctorScope, scopeDoctorChecks, } from "./DoctorScope.js";
|
|
15
14
|
/** Deep provider IDs whose readiness can be selected explicitly by doctor. */
|
|
@@ -20,8 +19,8 @@ export const DOCTOR_PROVIDER_IDS = ["hopper", "ghidra"];
|
|
|
20
19
|
* or an agent consuming the structured result.
|
|
21
20
|
*/
|
|
22
21
|
export const runDoctor = async (target, host = systemDoctorHost(), requestedScope) => {
|
|
23
|
-
const { checks: diagnosticChecks, hopperPath, providerInspections,
|
|
24
|
-
const identity = await collectDoctorIdentity(host
|
|
22
|
+
const { checks: diagnosticChecks, hopperPath, providerInspections, } = await collectDoctorDiagnostics(target, host);
|
|
23
|
+
const identity = await collectDoctorIdentity(host);
|
|
25
24
|
const checks = [...diagnosticChecks, ...identity.checks];
|
|
26
25
|
const providers = {
|
|
27
26
|
hopperAvailable: hopperPath !== undefined &&
|
|
@@ -52,7 +51,7 @@ export const runDoctor = async (target, host = systemDoctorHost(), requestedScop
|
|
|
52
51
|
identity: identity.value,
|
|
53
52
|
};
|
|
54
53
|
};
|
|
55
|
-
const collectDoctorIdentity = async (host
|
|
54
|
+
const collectDoctorIdentity = async (host) => {
|
|
56
55
|
const installationPaths = (await host.installationPaths?.()) ?? [];
|
|
57
56
|
const installedSkillIdentity = await host.installedSkillIdentity?.();
|
|
58
57
|
const skillAligned = skillIdentityAligned(installedSkillIdentity);
|
|
@@ -91,7 +90,6 @@ const collectDoctorIdentity = async (host, runtimeExecutables) => {
|
|
|
91
90
|
: "Run rea setup to update the installed REA skill.",
|
|
92
91
|
},
|
|
93
92
|
registrations,
|
|
94
|
-
runtime_executables: runtimeExecutables ?? null,
|
|
95
93
|
},
|
|
96
94
|
};
|
|
97
95
|
};
|
|
@@ -115,91 +113,102 @@ const registrationCheck = (registration) => ({
|
|
|
115
113
|
remediation: registration.remediation,
|
|
116
114
|
});
|
|
117
115
|
const installationState = (paths) => paths.length === 0 ? "unknown" : paths.length === 1 ? "single" : "multiple";
|
|
116
|
+
const homeFromEnvironment = (environment, platform) => {
|
|
117
|
+
const selected = platform === "win32"
|
|
118
|
+
? (environment.USERPROFILE ??
|
|
119
|
+
(environment.HOMEDRIVE !== undefined &&
|
|
120
|
+
environment.HOMEPATH !== undefined
|
|
121
|
+
? `${environment.HOMEDRIVE}${environment.HOMEPATH}`
|
|
122
|
+
: environment.HOME))
|
|
123
|
+
: (environment.HOME ?? environment.USERPROFILE);
|
|
124
|
+
return selected ?? homedir();
|
|
125
|
+
};
|
|
118
126
|
/** Create diagnostics backed by the current process and host commands. */
|
|
119
|
-
export const systemDoctorHost = (options = {}) =>
|
|
120
|
-
platform
|
|
121
|
-
architecture
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
127
|
+
export const systemDoctorHost = (options = {}) => {
|
|
128
|
+
const platform = options.platform ?? process.platform;
|
|
129
|
+
const architecture = options.architecture ?? process.arch;
|
|
130
|
+
const environment = options.environment ?? process.env;
|
|
131
|
+
const hostExecFileOutput = options.execFileOutput ?? execFileOutput;
|
|
132
|
+
const homeDirectory = homeFromEnvironment(environment, platform);
|
|
133
|
+
const commandEnvironment = { env: environment };
|
|
134
|
+
return {
|
|
135
|
+
platform,
|
|
136
|
+
architecture,
|
|
137
|
+
nodeVersion: process.versions.node,
|
|
138
|
+
homeDirectory,
|
|
139
|
+
...(environment.HOPPER_LAUNCHER_PATH === undefined
|
|
140
|
+
? {}
|
|
141
|
+
: { configuredHopperPath: environment.HOPPER_LAUNCHER_PATH }),
|
|
142
|
+
...(environment.REA_ILSPY_CMD_PATH === undefined
|
|
143
|
+
? {}
|
|
144
|
+
: { configuredIlspyCmdPath: environment.REA_ILSPY_CMD_PATH }),
|
|
145
|
+
macosVersion: () => readMacosVersion(hostExecFileOutput, commandEnvironment),
|
|
146
|
+
linuxDistribution: readLinuxDistribution,
|
|
147
|
+
async validTarget(path) {
|
|
148
|
+
return (await parseBinaryTarget(path, process.cwd(), architecture)).ok;
|
|
149
|
+
},
|
|
150
|
+
executable: (path) => executableAvailable(path, platform, hostExecFileOutput, commandEnvironment),
|
|
151
|
+
linuxDemoRuntimeCheck: options.linuxDemoRuntimeCheck ?? uncomposedLinuxDemoRuntimeCheck,
|
|
152
|
+
supportedLinuxHopper: linuxHopperBinarySupported,
|
|
153
|
+
async brewHopperPath() {
|
|
154
|
+
return probeHomebrew(async (command) => {
|
|
155
|
+
try {
|
|
156
|
+
const prefix = (await hostExecFileOutput(command, ["--prefix", "--cask", "hopper-disassembler"], commandEnvironment)).stdout.trim();
|
|
157
|
+
return `${prefix}/Hopper Disassembler.app/Contents/MacOS/hopper`;
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
manualHopperPaths: () => manualHopperPaths(homeDirectory),
|
|
165
|
+
...(options.providerInspections === undefined
|
|
166
|
+
? {}
|
|
167
|
+
: { providerInspections: options.providerInspections }),
|
|
168
|
+
async ilspyCmdVersion(path) {
|
|
139
169
|
try {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return `${prefix}/Hopper Disassembler.app/Contents/MacOS/hopper`;
|
|
170
|
+
await access(path, constants.X_OK);
|
|
171
|
+
return firstIlspyVersionLine((await hostExecFileOutput(path, ["--version"], {
|
|
172
|
+
timeout: 10_000,
|
|
173
|
+
...commandEnvironment,
|
|
174
|
+
})).stdout);
|
|
146
175
|
}
|
|
147
176
|
catch {
|
|
148
177
|
return undefined;
|
|
149
178
|
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
path: process.env.PATH ?? "",
|
|
171
|
-
launcherNode: process.execPath,
|
|
172
|
-
...(process.env.PATHEXT === undefined
|
|
173
|
-
? {}
|
|
174
|
-
: { pathExtensions: process.env.PATHEXT.split(delimiter) }),
|
|
175
|
-
}),
|
|
176
|
-
async installationPaths() {
|
|
177
|
-
try {
|
|
178
|
-
const command = process.platform === "win32" ? "where" : "which";
|
|
179
|
-
const arguments_ = process.platform === "win32" ? ["rea"] : ["-a", "rea"];
|
|
180
|
-
return uniqueLines((await execFileOutput(command, arguments_)).stdout);
|
|
181
|
-
}
|
|
182
|
-
catch {
|
|
183
|
-
return [];
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
installedSkillIdentity,
|
|
187
|
-
clientRegistrations: () => readClientRegistrationStatuses(homedir()),
|
|
188
|
-
});
|
|
189
|
-
const readMacosVersion = async () => {
|
|
179
|
+
},
|
|
180
|
+
async installationPaths() {
|
|
181
|
+
try {
|
|
182
|
+
const command = platform === "win32" ? "where" : "which";
|
|
183
|
+
const arguments_ = platform === "win32" ? ["rea"] : ["-a", "rea"];
|
|
184
|
+
return uniqueLines((await hostExecFileOutput(command, arguments_, commandEnvironment))
|
|
185
|
+
.stdout);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
installedSkillIdentity: () => installedSkillIdentity(homeDirectory),
|
|
192
|
+
clientRegistrations: () => readClientRegistrationStatuses(homeDirectory, undefined, {
|
|
193
|
+
platform,
|
|
194
|
+
environment,
|
|
195
|
+
}),
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
const readMacosVersion = async (run = execFileOutput, options = { env: process.env }) => {
|
|
190
199
|
try {
|
|
191
|
-
return (await
|
|
200
|
+
return (await run("sw_vers", ["-productVersion"], options)).stdout.trim();
|
|
192
201
|
}
|
|
193
202
|
catch {
|
|
194
203
|
return undefined;
|
|
195
204
|
}
|
|
196
205
|
};
|
|
197
|
-
const executableAvailable = async (path) => {
|
|
206
|
+
const executableAvailable = async (path, platform = process.platform, run = execFileOutput, options = { env: process.env }) => {
|
|
198
207
|
try {
|
|
199
208
|
await access(path, constants.X_OK);
|
|
200
|
-
if (
|
|
209
|
+
if (platform !== "linux")
|
|
201
210
|
return true;
|
|
202
|
-
const linked = await
|
|
211
|
+
const linked = await run("ldd", [path], options);
|
|
203
212
|
return linuxSharedLibrariesAvailable(`${linked.stdout}\n${linked.stderr}`);
|
|
204
213
|
}
|
|
205
214
|
catch {
|
|
@@ -213,9 +222,9 @@ const uncomposedLinuxDemoRuntimeCheck = () => Promise.resolve({
|
|
|
213
222
|
detail: "Linux Hopper private-display diagnostics were not composed",
|
|
214
223
|
remediation: "Run rea doctor through the production CLI adapter.",
|
|
215
224
|
});
|
|
216
|
-
const manualHopperPaths = async () => {
|
|
225
|
+
const manualHopperPaths = async (home = homedir()) => {
|
|
217
226
|
const paths = [];
|
|
218
|
-
for (const root of ["/Applications", join(
|
|
227
|
+
for (const root of ["/Applications", join(home, "Applications")]) {
|
|
219
228
|
try {
|
|
220
229
|
for (const entry of await readdir(root, { withFileTypes: true })) {
|
|
221
230
|
if (entry.isDirectory() && /^Hopper.*\.app$/i.test(entry.name))
|
|
@@ -228,10 +237,10 @@ const manualHopperPaths = async () => {
|
|
|
228
237
|
}
|
|
229
238
|
return paths;
|
|
230
239
|
};
|
|
231
|
-
const readInstalledSkill = () => readFile(join(
|
|
232
|
-
const installedSkillIdentity = async () => {
|
|
240
|
+
const readInstalledSkill = (home) => readFile(join(home, ".agents/skills", PRODUCT_IDENTITY.skillName, "SKILL.md"), "utf8");
|
|
241
|
+
const installedSkillIdentity = async (home) => {
|
|
233
242
|
try {
|
|
234
|
-
const content = await readInstalledSkill();
|
|
243
|
+
const content = await readInstalledSkill(home);
|
|
235
244
|
const countText = /^\s{2}tool_count:\s*(\d+)\s*$/mu.exec(content)?.[1];
|
|
236
245
|
return {
|
|
237
246
|
version: /^\s{2}version:\s*"([^"]+)"\s*$/mu.exec(content)?.[1] ?? null,
|
|
@@ -5,11 +5,7 @@ const DEFAULT_HOPPER = "/Applications/Hopper Disassembler.app/Contents/MacOS/hop
|
|
|
5
5
|
const SYSTEM_LINUX_HOPPER = "/opt/hopper/bin/Hopper";
|
|
6
6
|
/** Collect host, provider, and optional-target diagnostics without mutation. */
|
|
7
7
|
export const collectDoctorDiagnostics = async (target, host) => {
|
|
8
|
-
const
|
|
9
|
-
const checks = [
|
|
10
|
-
nodeCheck(host),
|
|
11
|
-
...runtimeChecks(runtimeExecutables),
|
|
12
|
-
];
|
|
8
|
+
const checks = [nodeCheck(host)];
|
|
13
9
|
checks.push(await hostCheck(host));
|
|
14
10
|
const hopperPath = await findHopper(host);
|
|
15
11
|
checks.push(hopperCheck(host, hopperPath));
|
|
@@ -19,9 +15,6 @@ export const collectDoctorDiagnostics = async (target, host) => {
|
|
|
19
15
|
const providerInspections = await host.providerInspections?.();
|
|
20
16
|
if (providerInspections !== undefined)
|
|
21
17
|
checks.push(...providerInspections.flatMap(providerDoctorChecks));
|
|
22
|
-
const javascriptReplayCheck = await host.javascriptReplayCheck?.();
|
|
23
|
-
if (javascriptReplayCheck !== undefined)
|
|
24
|
-
checks.push(javascriptReplayCheck);
|
|
25
18
|
const ilspyCheck = await optionalIlspyCheck(host);
|
|
26
19
|
if (ilspyCheck !== undefined)
|
|
27
20
|
checks.push(ilspyCheck);
|
|
@@ -35,7 +28,6 @@ export const collectDoctorDiagnostics = async (target, host) => {
|
|
|
35
28
|
checks,
|
|
36
29
|
...(hopperPath === undefined ? {} : { hopperPath }),
|
|
37
30
|
...(providerInspections === undefined ? {} : { providerInspections }),
|
|
38
|
-
...(runtimeExecutables === undefined ? {} : { runtimeExecutables }),
|
|
39
31
|
};
|
|
40
32
|
};
|
|
41
33
|
/** Evaluate core health while treating unconfigured providers as optional. */
|
|
@@ -63,22 +55,6 @@ const nodeCheck = (host) => check("node", supportsNodeVersion(host.nodeVersion),
|
|
|
63
55
|
remediation: "Install Node.js 22.19+ or 24.11+.",
|
|
64
56
|
classification: "missing_dependency",
|
|
65
57
|
});
|
|
66
|
-
const runtimeChecks = (inventory) => {
|
|
67
|
-
if (inventory === undefined)
|
|
68
|
-
return [];
|
|
69
|
-
const broken = inventory.candidates.filter(({ healthy }) => !healthy);
|
|
70
|
-
const detail = broken.length === 0
|
|
71
|
-
? `${String(inventory.candidates.length)} runtime executable candidates passed bounded version probes.`
|
|
72
|
-
: `${String(broken.length)} of ${String(inventory.candidates.length)} runtime executable candidates failed bounded version probes: ${broken
|
|
73
|
-
.map(({ lexical_path: path }) => path)
|
|
74
|
-
.join(", ")}`;
|
|
75
|
-
return [
|
|
76
|
-
check("node-toolchains", broken.length === 0, detail, {
|
|
77
|
-
remediation: "Select a verified healthy Node toolchain or repair the failing installation, then rerun rea doctor. Do not create compatibility-library symlinks.",
|
|
78
|
-
classification: "missing_dependency",
|
|
79
|
-
}),
|
|
80
|
-
];
|
|
81
|
-
};
|
|
82
58
|
const hostCheck = async (host) => {
|
|
83
59
|
const macosVersion = host.platform === "darwin" ? await host.macosVersion() : undefined;
|
|
84
60
|
const linuxDistribution = host.platform === "linux" ? await host.linuxDistribution() : undefined;
|
|
@@ -99,7 +75,7 @@ const findHopper = async (host) => {
|
|
|
99
75
|
? [
|
|
100
76
|
DEFAULT_HOPPER,
|
|
101
77
|
SYSTEM_LINUX_HOPPER,
|
|
102
|
-
linuxHopperLauncherPath(homedir()),
|
|
78
|
+
linuxHopperLauncherPath(host.homeDirectory ?? homedir()),
|
|
103
79
|
...(await host.manualHopperPaths()),
|
|
104
80
|
]
|
|
105
81
|
: [host.configuredHopperPath];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { doctorHealthy } from "./DoctorDiagnostics.js";
|
|
2
1
|
/** Normalize a caller-selected doctor readiness boundary. */
|
|
3
2
|
export const normalizeDoctorScope = (requested, target) => ({
|
|
4
3
|
mode: requested === undefined ? "audit-wide" : "explicit",
|
|
@@ -10,40 +9,35 @@ export const normalizeDoctorScope = (requested, target) => ({
|
|
|
10
9
|
/** Partition diagnostics into required and informational scope checks. */
|
|
11
10
|
export const scopeDoctorChecks = (input) => {
|
|
12
11
|
const providerChecks = input.checks.filter((candidate) => isProviderCheck(candidate.name, input.providers.providerInspections));
|
|
13
|
-
const coreChecks = input.checks.filter(({ name }) =>
|
|
14
|
-
name !== "skill:identity" &&
|
|
15
|
-
!name.startsWith("registration:"));
|
|
12
|
+
const coreChecks = input.checks.filter(({ name }) => name === "node" || (input.scope.target !== null && name === "target"));
|
|
16
13
|
const clientChecks = input.scope.clients.map((client) => selectedRegistrationCheck(client, input.registrations.find((candidate) => candidate.client === client)));
|
|
17
14
|
const skillChecks = input.scope.skill
|
|
18
15
|
? [selectedSkillCheck(input.skillState, input.checks)]
|
|
19
16
|
: [];
|
|
20
|
-
const selectedProviderChecks = input.scope.providers.
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const selectedProviderChecks = input.scope.providers.flatMap((providerId) => selectedProviderChecksFor(providerId, providerChecks, input.providers));
|
|
18
|
+
const hopperHostChecks = input.scope.providers.includes("hopper")
|
|
19
|
+
? input.checks.filter(({ name }) => name === "host")
|
|
20
|
+
: [];
|
|
23
21
|
const scopeChecks = [
|
|
24
22
|
...coreChecks,
|
|
23
|
+
...hopperHostChecks,
|
|
25
24
|
...selectedProviderChecks,
|
|
26
25
|
...clientChecks,
|
|
27
26
|
...skillChecks,
|
|
28
27
|
];
|
|
29
|
-
const providerHealthy = input.scope.providers.length === 0
|
|
30
|
-
? doctorHealthy([...coreChecks, ...providerChecks, ...clientChecks, ...skillChecks], input.providers)
|
|
31
|
-
: selectedProviderChecks.every(({ ok }) => ok);
|
|
32
28
|
const selectedNames = new Set(scopeChecks.map(({ name }) => name));
|
|
33
29
|
return {
|
|
34
30
|
healthy: coreChecks.every(({ ok }) => ok) &&
|
|
31
|
+
hopperHostChecks.every(({ ok }) => ok) &&
|
|
35
32
|
clientChecks.every(({ ok }) => ok) &&
|
|
36
33
|
skillChecks.every(({ ok }) => ok) &&
|
|
37
|
-
|
|
34
|
+
selectedProviderChecks.every(({ ok }) => ok),
|
|
38
35
|
scopeChecks,
|
|
39
36
|
informationalChecks: input.checks.filter(({ name }) => !selectedNames.has(name)),
|
|
40
37
|
};
|
|
41
38
|
};
|
|
42
39
|
const isProviderCheck = (name, inspections) => name.startsWith("hopper") ||
|
|
43
40
|
inspections?.some(({ id }) => doctorProviderCheckName(id, name)) === true;
|
|
44
|
-
const configuredProviderChecks = (checks, providers) => checks.filter(({ name }) => name.startsWith("hopper")
|
|
45
|
-
? providers.hopperConfigured
|
|
46
|
-
: providers.providerInspections?.some(({ id, configured }) => configured && doctorProviderCheckName(id, name)) === true);
|
|
47
41
|
const selectedProviderChecksFor = (providerId, checks, providers) => {
|
|
48
42
|
const selected = checks.filter(({ name }) => providerId === "hopper"
|
|
49
43
|
? name.startsWith("hopper")
|