rea-agents 1.7.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -59
- package/bridge/ghidra/ReaGhidraBridge.java +96 -11
- package/dist/application/ArtifactExtraction.js +1 -1
- package/dist/application/ArtifactInventory/classify.js +42 -0
- package/dist/application/ArtifactInventory/hash.js +43 -0
- package/dist/application/ArtifactInventory/reader.js +41 -0
- package/dist/application/ArtifactInventory/scanCanonical.js +155 -0
- package/dist/application/ArtifactInventory/scanReader.js +124 -0
- package/dist/application/ArtifactInventory/types.js +10 -0
- package/dist/application/ArtifactInventory.js +9 -351
- package/dist/application/AuthorizedArtifactInventory.js +2 -2
- package/dist/application/BinarySession.js +47 -270
- package/dist/application/BinarySessionExecution.js +28 -0
- package/dist/application/BinarySessionOpen.js +39 -0
- package/dist/application/BinarySessionRecords.js +149 -0
- package/dist/application/BinarySessionStatus.js +75 -0
- package/dist/application/CapabilityInventory.js +42 -2
- package/dist/application/ClientRegistrationStatus.js +1 -1
- package/dist/application/CrossVersionInventory.js +8 -2
- package/dist/application/CrossVersionInvestigation.js +11 -29
- package/dist/application/CrossVersionInvestigationCollections.js +23 -0
- package/dist/application/DirectAnalysis.js +47 -44
- package/dist/application/Doctor.js +165 -197
- package/dist/application/DoctorDiagnostics.js +180 -0
- package/dist/application/ElectronBoundaryAnalysis.js +112 -0
- package/dist/application/ElectronBoundaryGraph.js +9 -0
- package/dist/application/ElectronBoundaryGraphContext.js +62 -0
- package/dist/application/ElectronBoundaryGraphIpc.js +242 -0
- package/dist/application/ElectronBoundaryGraphNative.js +86 -0
- package/dist/application/ElectronBoundaryGraphWindows.js +223 -0
- package/dist/application/EnhancedToolPagination.js +22 -0
- package/dist/application/EnhancedToolTypes.js +4 -0
- package/dist/application/EnhancedTools.js +58 -50
- package/dist/application/InstrumentedJavaScriptReplayHost.js +36 -0
- package/dist/application/InvestigationProviders.js +30 -0
- package/dist/application/InvestigationWorkspaceStore.js +24 -10
- package/dist/application/JavaScriptApplicationEvidence.js +26 -0
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +89 -0
- package/dist/application/JavaScriptApplicationService.js +74 -0
- package/dist/application/JavaScriptApplicationWorkflowEvidence.js +29 -0
- package/dist/application/JavaScriptApplicationWorkflowService.js +90 -0
- package/dist/application/JavaScriptArtifactAnalysis.js +52 -7
- package/dist/application/JavaScriptArtifactFiles.js +6 -2
- package/dist/application/JavaScriptArtifactGraphBuilder.js +82 -17
- package/dist/application/JavaScriptArtifactGraphBundlers.js +225 -0
- package/dist/application/JavaScriptArtifactGraphContext.js +37 -36
- package/dist/application/JavaScriptArtifactGraphDocuments.js +27 -4
- package/dist/application/JavaScriptArtifactGraphEvidence.js +24 -14
- package/dist/application/JavaScriptArtifactGraphFindings.js +54 -8
- package/dist/application/JavaScriptArtifactGraphStructure.js +29 -101
- package/dist/application/JavaScriptArtifactPathResolution.js +269 -0
- package/dist/application/JavaScriptArtifactReconstruction.js +4 -1
- package/dist/application/JavaScriptArtifactReconstructionInput.js +2 -83
- package/dist/application/JavaScriptJsonModules.js +39 -0
- package/dist/application/JavaScriptModuleRelationships.js +262 -0
- package/dist/application/JavaScriptReplayPermission.js +16 -0
- package/dist/application/JavaScriptReplayPlanning.js +201 -0
- package/dist/application/JavaScriptReplayService.js +292 -0
- package/dist/application/JavaScriptRuntimeReconciliationEvidence.js +25 -0
- package/dist/application/JavaScriptRuntimeReconciliationService.js +27 -0
- package/dist/application/LinuxHopper.js +10 -0
- package/dist/application/MacHopper.js +22 -11
- package/dist/application/ManagedApplicationGraphService.js +55 -0
- package/dist/application/ManagedMemberComparisonService.js +122 -0
- package/dist/application/ManagedNativeVerificationService.js +39 -0
- package/dist/application/ManagedReconstructionService.js +58 -0
- package/dist/application/ManagedRuntimeCorrelationService.js +103 -0
- package/dist/application/NodeRuntimeCharacterizationService.js +196 -0
- package/dist/application/PermissionAuthority.js +106 -63
- package/dist/application/ProcessCaptureCapability.js +1 -1
- package/dist/application/ProcessCapturePermission.js +13 -0
- package/dist/application/ProcessCli.js +2 -12
- package/dist/application/ProcessHarness.js +1 -1
- package/dist/application/ProcessSampling.js +15 -11
- package/dist/application/ProjectPermissionStore.js +49 -9
- package/dist/application/RealHopperAssertions.js +76 -0
- package/dist/application/ReconstructionCoverageService.js +69 -0
- package/dist/application/ReconstructionCoverageWorkspaceStore.js +31 -0
- package/dist/application/RuntimeExecutableDiagnostics.js +172 -0
- package/dist/application/Setup.js +147 -259
- package/dist/application/SetupClientConfiguration.js +220 -0
- package/dist/application/SetupClients.js +24 -2
- package/dist/application/SetupPlan.js +123 -12
- package/dist/application/SetupSkill.js +26 -12
- package/dist/application/SupportedClients.js +1 -0
- package/dist/application/Uninstall.js +6 -3
- package/dist/application/WindowsCapabilities.js +86 -0
- package/dist/application/runtime.js +2 -0
- package/dist/artifacts/AsarArtifactReader.js +11 -0
- package/dist/browser/BrowserProcessStartup.js +88 -0
- package/dist/browser/CdpCaptureDocuments.js +12 -8
- package/dist/browser/CdpCaptureEventBodyShapes.js +75 -0
- package/dist/browser/CdpCaptureEventHandlers.js +336 -0
- package/dist/browser/CdpCaptureEventHelpers.js +71 -0
- package/dist/browser/CdpCaptureEventState.js +1 -0
- package/dist/browser/CdpCaptureEventTypes.js +1 -0
- package/dist/browser/CdpCaptureEvents.js +46 -464
- package/dist/browser/CdpElectronInspection.js +106 -162
- package/dist/browser/CdpElectronProvider.js +5 -1
- package/dist/browser/CdpElectronScriptEvents.js +69 -0
- package/dist/browser/CdpElectronScripts.js +94 -0
- package/dist/browser/CdpElectronWorkers.js +56 -0
- package/dist/browser/CdpObservationSession.js +51 -8
- package/dist/browser/CdpPageCapture.js +12 -129
- package/dist/browser/CdpPageCaptureScripts.js +97 -0
- package/dist/browser/CdpPageCaptureWorkers.js +46 -0
- package/dist/browser/CdpWebMcpDiscovery.js +38 -14
- package/dist/browser/PngVisualDiff.js +9 -2
- package/dist/catalogIdentity.js +8 -1
- package/dist/cli/artifactCommands.js +82 -0
- package/dist/cli/coreAnalysisCommands.js +232 -0
- package/dist/cli/managedCommands.js +397 -0
- package/dist/cli/managedProjectGraphCommand.js +24 -0
- package/dist/cli/options.js +9 -0
- package/dist/cli/setupCommands.js +108 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utilityCommands.js +122 -0
- package/dist/cli.js +13 -383
- package/dist/cliApplicationCommands.js +176 -0
- package/dist/cliBrowserAdvancedCommands.js +73 -16
- package/dist/cliBrowserCommands.js +39 -115
- package/dist/cliCommandNames.js +17 -0
- package/dist/cliElectronCommands.js +100 -27
- package/dist/cliEvidenceCommands.js +13 -2
- package/dist/cliInvestigationCommands.js +53 -10
- package/dist/cliJsonInput.js +54 -0
- package/dist/cliObservationOptions.js +137 -0
- package/dist/cliPolicyCommands.js +80 -46
- package/dist/cliSetup.js +289 -0
- package/dist/config/environment.js +107 -0
- package/dist/config/parseConfig.js +228 -0
- package/dist/config/parsers.js +68 -0
- package/dist/config/permissions.js +30 -0
- package/dist/config/types.js +1 -0
- package/dist/config.js +1 -292
- package/dist/contracts/applicationToolContracts.js +225 -0
- package/dist/contracts/artifactToolContracts.js +5 -9
- package/dist/contracts/browserToolContracts.js +14 -62
- package/dist/contracts/electronToolContracts.js +45 -19
- package/dist/contracts/errorSchemas.js +1 -0
- package/dist/contracts/investigationExamples.js +0 -6
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +46 -0
- package/dist/contracts/javascriptRuntimeReconciliationExample.js +208 -0
- package/dist/contracts/managedToolContracts.js +153 -0
- package/dist/contracts/managedWorkflowExamples.js +346 -0
- package/dist/contracts/managedWorkflowToolContracts.js +203 -0
- package/dist/contracts/nativeToolContracts.js +2 -6
- package/dist/contracts/promptContracts.js +18 -2
- package/dist/contracts/providerSelection.js +2 -0
- package/dist/contracts/toolContractExamples.js +10 -25
- package/dist/contracts/toolContracts.js +49 -47
- package/dist/contracts/toolEffects.js +174 -0
- package/dist/contracts/toolOutputSchemaGroups.js +232 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +327 -0
- package/dist/contracts/toolOutputSchemas.js +2 -535
- package/dist/doctorRuntime.js +42 -1
- package/dist/domain/analysisErrorPresentation.js +234 -0
- package/dist/domain/analysisErrorProjection.js +284 -0
- package/dist/domain/artifactComparison.js +37 -19
- package/dist/domain/binaryTarget.js +87 -37
- package/dist/domain/browserObservation.js +1 -282
- package/dist/domain/browserObservationSchemas.js +286 -0
- package/dist/domain/bundleComparison.js +4 -4
- package/dist/domain/electronObservation.js +13 -0
- package/dist/domain/electronStaticAnalysis.js +9 -0
- package/dist/domain/electronStaticAnalysisBrowser.js +206 -0
- package/dist/domain/electronStaticAnalysisIpc.js +171 -0
- package/dist/domain/electronStaticAnalysisNative.js +164 -0
- package/dist/domain/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/electronStaticAnalysisValues.js +103 -0
- package/dist/domain/errors.js +32 -448
- package/dist/domain/functionComparison.js +4 -165
- package/dist/domain/functionComparisonDimensions.js +164 -0
- package/dist/domain/functionComparisonSchemas.js +3 -8
- package/dist/domain/inputIssueProjection.js +52 -0
- package/dist/domain/javascriptApplicationAnalysis.js +155 -0
- package/dist/domain/javascriptApplicationChangeGraph.js +231 -0
- package/dist/domain/javascriptApplicationEvidenceSchemas.js +18 -0
- package/dist/domain/javascriptApplicationGraph.js +2 -1
- package/dist/domain/javascriptApplicationGraphSchemas.js +7 -0
- package/dist/domain/javascriptApplicationVersionComparison.js +116 -0
- package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +139 -0
- package/dist/domain/javascriptApplicationVersionItems.js +233 -0
- package/dist/domain/javascriptApplicationVersionKeys.js +170 -0
- package/dist/domain/javascriptExportInstrumentation.js +97 -0
- package/dist/domain/javascriptFeatureSeed.js +140 -0
- package/dist/domain/javascriptFeatureTrace.js +232 -0
- package/dist/domain/javascriptFeatureTraceSchemas.js +136 -0
- package/dist/domain/javascriptFeatureTraversal.js +100 -0
- package/dist/domain/javascriptNativeHandoff.js +85 -0
- package/dist/domain/javascriptReplay.js +361 -0
- package/dist/domain/javascriptRuntimeLoadState.js +106 -0
- package/dist/domain/javascriptRuntimeReconciliation.js +42 -0
- package/dist/domain/javascriptRuntimeReconciliationGraph.js +169 -0
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +247 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +160 -0
- package/dist/domain/javascriptRuntimeReconciliationResult.js +119 -0
- package/dist/domain/javascriptRuntimeReconciliationRuntime.js +316 -0
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +245 -0
- package/dist/domain/javascriptRuntimeStaticCandidates.js +193 -0
- package/dist/domain/javascriptSemanticAnalysis.js +386 -0
- package/dist/domain/javascriptSemanticIr.js +30 -0
- package/dist/domain/javascriptSemanticProjection.js +366 -0
- package/dist/domain/javascriptSemanticState.js +40 -0
- package/dist/domain/javascriptSemanticTraversal.js +22 -0
- package/dist/domain/javascriptSemanticValues.js +352 -0
- package/dist/domain/javascriptStaticAnalysis.js +26 -254
- package/dist/domain/javascriptStaticAnalysisBundler.js +209 -0
- package/dist/domain/javascriptStaticAnalysisCalls.js +180 -0
- package/dist/domain/javascriptStaticAnalysisFindings.js +39 -0
- package/dist/domain/javascriptStaticAnalysisHelpers.js +81 -2
- package/dist/domain/javascriptStaticAnalysisState.js +6 -0
- package/dist/domain/knownPageCoverage.js +21 -0
- package/dist/domain/managedApplicationGraph.js +206 -0
- package/dist/domain/managedApplicationGraphCoverage.js +170 -0
- package/dist/domain/managedApplicationGraphNodeCoverage.js +6 -0
- package/dist/domain/managedApplicationGraphNodes.js +336 -0
- package/dist/domain/managedArtifact.js +452 -0
- package/dist/domain/managedMemberComparison.js +211 -0
- package/dist/domain/managedMemberComparisonCoverage.js +72 -0
- package/dist/domain/managedMemberComparisonMatch.js +356 -0
- package/dist/domain/managedNativeVerification.js +46 -0
- package/dist/domain/managedNativeVerificationMatch.js +272 -0
- package/dist/domain/managedNativeVerificationSchemas.js +141 -0
- package/dist/domain/managedReconstruction.js +196 -0
- package/dist/domain/managedRuntimeCorrelation.js +184 -0
- package/dist/domain/nodeRuntimeCharacterization.js +66 -0
- package/dist/domain/permissionPolicy.js +2 -0
- package/dist/domain/reconstructionCoverage.js +387 -0
- package/dist/domain/reconstructionCoverageEvaluation.js +212 -0
- package/dist/domain/reconstructionVerificationSchemas.js +9 -3
- package/dist/domain/runtimeCharacterization.js +85 -0
- package/dist/domain/webBundleAnalyzer.js +3 -409
- package/dist/domain/webBundleAnalyzerAst.js +77 -0
- package/dist/domain/webBundleAnalyzerInspection.js +307 -0
- package/dist/domain/webBundleAnalyzerResult.js +120 -0
- package/dist/dotnet/ManagedArtifactInspector.js +339 -0
- package/dist/dotnet/ManagedMemberInspector.js +153 -0
- package/dist/dotnet/ManagedMemberInspectorCore.js +297 -0
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +427 -0
- package/dist/dotnet/ManagedMemberRows.js +120 -0
- package/dist/dotnet/ManagedMetadataHeaps.js +131 -0
- package/dist/dotnet/ManagedMetadataInventory.js +104 -0
- package/dist/dotnet/ManagedMetadataInventoryRows.js +292 -0
- package/dist/dotnet/ManagedMetadataLayout.js +259 -0
- package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +143 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +311 -0
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +143 -0
- package/dist/dotnet/ManagedPeReader.js +188 -0
- package/dist/dotnet/ManagedReaderFailure.js +10 -0
- package/dist/dotnet/ManagedStaticProvider.js +203 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraClient.js +76 -91
- package/dist/ghidra/GhidraClientStartup.js +29 -0
- package/dist/ghidra/GhidraClientWire.js +34 -0
- package/dist/ghidra/GhidraDefaults.js +1 -1
- package/dist/ghidra/GhidraDiagnostics.js +6 -1
- package/dist/ghidra/GhidraInstallation.js +20 -15
- package/dist/ghidra/GhidraLauncher.js +93 -29
- package/dist/ghidra/GhidraProvider.js +67 -161
- package/dist/ghidra/GhidraProviderCapabilities.js +173 -0
- package/dist/ghidra/GhidraSessionValues.js +2 -0
- package/dist/ghidra/GhidraSocketConnection.js +44 -7
- package/dist/ghidra/GhidraTargetSnapshot.js +30 -0
- package/dist/ghidra/GhidraTransport.js +71 -0
- package/dist/identity.js +3 -2
- package/dist/main/messages.js +5 -0
- package/dist/main/reload.js +49 -0
- package/dist/main/shutdown.js +25 -0
- package/dist/main/startup.js +14 -0
- package/dist/main/state.js +26 -0
- package/dist/main/transport.js +61 -0
- package/dist/main/types.js +1 -0
- package/dist/main.js +35 -132
- package/dist/process/PrivateRuntimeRoot.js +3 -2
- package/dist/process/ProcessOwnership.js +35 -0
- package/dist/process/ProviderProcess.js +2 -0
- package/dist/replay/JavaScriptReplayWorker.js +300 -0
- package/dist/replay/LinuxJavaScriptReplayRunner.js +217 -0
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +140 -0
- package/dist/replay/LinuxRuntimeClosure.js +46 -0
- package/dist/replay/LinuxSeccompPolicy.js +40 -0
- package/dist/replay/ReplayOutcome.js +95 -0
- package/dist/replay/ReplayProcessLifecycle.js +71 -0
- package/dist/replay/ReplayWorkerProtocol.js +55 -0
- package/dist/replay/SystemJavaScriptReplayHost.js +182 -0
- package/dist/server/ProcessCaptureElicitation.js +157 -0
- package/dist/server/createServer.js +158 -41
- package/dist/server/registerApplicationTools/characterization.js +57 -0
- package/dist/server/registerApplicationTools/compareVersions.js +34 -0
- package/dist/server/registerApplicationTools/controlledReplay.js +38 -0
- package/dist/server/registerApplicationTools/coverage.js +84 -0
- package/dist/server/registerApplicationTools/helpers.js +42 -0
- package/dist/server/registerApplicationTools/traceFeature.js +26 -0
- package/dist/server/registerApplicationTools/types.js +1 -0
- package/dist/server/registerApplicationTools.js +13 -0
- package/dist/server/registerArtifactComparisonTool.js +16 -9
- package/dist/server/registerBrowserTools.js +61 -60
- package/dist/server/registerBundleComparisonTool.js +17 -20
- package/dist/server/registerElectronTools.js +39 -12
- package/dist/server/registerEnhancedTools.js +52 -15
- package/dist/server/registerEvidenceResources.js +54 -0
- package/dist/server/registerEvidenceTools.js +5 -1
- package/dist/server/registerFunctionComparisonTool.js +14 -7
- package/dist/server/registerInvestigationTools/helpers.js +74 -0
- package/dist/server/registerInvestigationTools/types.js +1 -0
- package/dist/server/registerInvestigationTools.js +103 -132
- package/dist/server/registerManagedTools.js +6 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +65 -0
- package/dist/server/registerManagedWorkflowTools/contract.js +8 -0
- package/dist/server/registerManagedWorkflowTools/evidence.js +43 -0
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +39 -0
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +39 -0
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +52 -0
- package/dist/server/registerManagedWorkflowTools/types.js +1 -0
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +75 -0
- package/dist/server/registerManagedWorkflowTools.js +13 -0
- package/dist/server/registerOfficialTools.js +81 -67
- package/dist/server/registerProcessComparisonTool.js +25 -47
- package/dist/server/registerSessionRecordTools.js +137 -0
- package/dist/server/registerSessionStatusTool.js +9 -8
- package/dist/server/registerSessionTools.js +77 -216
- package/dist/server/sessionAvailabilityPolicy.js +10 -0
- package/dist/server/sessionEvidence.js +14 -19
- package/dist/server/toolInputValidation.js +77 -0
- package/dist/server/toolRegistrationOptions.js +177 -2
- package/dist/server/toolResult.js +30 -17
- package/package.json +21 -14
- package/scripts/rea.mjs +1 -1
- package/skills/{rea-analysis → reverse-engineer-anything}/SKILL.md +75 -6
- package/scripts/prepare-node-pty.mjs +0 -35
- package/scripts/rebuild-native.mjs +0 -22
package/dist/domain/errors.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { hopperStartupFailure, } from "./hopperStartupFailure.js";
|
|
2
2
|
export { hopperStartupFailure };
|
|
3
|
+
export { projectAnalysisError } from "./analysisErrorProjection.js";
|
|
3
4
|
/** Stable tags exposed by safe analysis-error projections. */
|
|
4
5
|
const ANALYSIS_ERROR_TAGS = [
|
|
5
6
|
"AnalysisProtocolError",
|
|
@@ -28,6 +29,7 @@ const ANALYSIS_ERROR_TAGS = [
|
|
|
28
29
|
"NoBinaryOpenError",
|
|
29
30
|
"BinaryTargetError",
|
|
30
31
|
"PermissionRequiredError",
|
|
32
|
+
"ReplayPlanStaleError",
|
|
31
33
|
];
|
|
32
34
|
/** Base class for expected analysis, provider, and session failures. */
|
|
33
35
|
export class AnalysisError extends Error {
|
|
@@ -46,10 +48,12 @@ export class AnalysisProtocolError extends AnalysisError {
|
|
|
46
48
|
/** Caller input failed provider-neutral application parsing. */
|
|
47
49
|
export class AnalysisInputError extends AnalysisError {
|
|
48
50
|
operation;
|
|
51
|
+
issues;
|
|
49
52
|
_tag = "AnalysisInputError";
|
|
50
|
-
constructor(operation, options) {
|
|
53
|
+
constructor(operation, options, issues = []) {
|
|
51
54
|
super(`Invalid analysis input for ${operation}`, options);
|
|
52
55
|
this.operation = operation;
|
|
56
|
+
this.issues = issues;
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
/** Provider output failed provider-neutral application parsing. */
|
|
@@ -196,6 +200,20 @@ export class ArtifactOperationError extends AnalysisError {
|
|
|
196
200
|
export class EvidenceIntegrityError extends AnalysisError {
|
|
197
201
|
_tag = "EvidenceIntegrityError";
|
|
198
202
|
}
|
|
203
|
+
/** A session Evidence reference is missing or has the wrong semantic identity. */
|
|
204
|
+
export class EvidenceReferenceError extends EvidenceIntegrityError {
|
|
205
|
+
evidenceId;
|
|
206
|
+
reason;
|
|
207
|
+
expected;
|
|
208
|
+
actual;
|
|
209
|
+
constructor(evidenceId, reason, expected, actual) {
|
|
210
|
+
super(`Evidence reference ${reason}: ${evidenceId}`);
|
|
211
|
+
this.evidenceId = evidenceId;
|
|
212
|
+
this.reason = reason;
|
|
213
|
+
this.expected = expected;
|
|
214
|
+
this.actual = actual;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
199
217
|
/** A bounded evidence ledger cannot accept more records or serialized bytes. */
|
|
200
218
|
export class EvidenceLimitError extends AnalysisError {
|
|
201
219
|
limit;
|
|
@@ -314,13 +332,14 @@ export class BinaryTargetError extends AnalysisError {
|
|
|
314
332
|
}
|
|
315
333
|
/** Exact denied authority used by both CLI and MCP remediation. */
|
|
316
334
|
export class PermissionRequiredError extends AnalysisError {
|
|
335
|
+
_tag = "PermissionRequiredError";
|
|
317
336
|
requested;
|
|
318
337
|
missing;
|
|
319
338
|
ceiling;
|
|
320
339
|
elicitationSupported;
|
|
321
340
|
restartRequired;
|
|
322
|
-
|
|
323
|
-
|
|
341
|
+
constructor(...args) {
|
|
342
|
+
const [requested, missing, ceiling, elicitationSupported, restartRequired] = args;
|
|
324
343
|
super(`Permission required for ${requested.capability}`);
|
|
325
344
|
this.requested = requested;
|
|
326
345
|
this.missing = missing;
|
|
@@ -329,449 +348,14 @@ export class PermissionRequiredError extends AnalysisError {
|
|
|
329
348
|
this.restartRequired = restartRequired;
|
|
330
349
|
}
|
|
331
350
|
}
|
|
332
|
-
/**
|
|
333
|
-
export
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
retryable: RETRYABLE_CODES.has(code),
|
|
342
|
-
remediation: {
|
|
343
|
-
action: remediationAction(error),
|
|
344
|
-
restart_required: error instanceof PermissionRequiredError && error.restartRequired,
|
|
345
|
-
...(error instanceof PermissionRequiredError
|
|
346
|
-
? { elicitation_supported: error.elicitationSupported }
|
|
347
|
-
: {}),
|
|
348
|
-
},
|
|
349
|
-
...(details === undefined ? {} : { details }),
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
const errorCode = (error) => {
|
|
353
|
-
if (error instanceof PermissionRequiredError)
|
|
354
|
-
return "permission_required";
|
|
355
|
-
if (error instanceof ProviderSelectionError &&
|
|
356
|
-
error.reason === "provider_unavailable")
|
|
357
|
-
return "provider_unavailable";
|
|
358
|
-
if (error instanceof BrowserObservationError) {
|
|
359
|
-
if (error.reason === "payload_limit")
|
|
360
|
-
return "truncated";
|
|
361
|
-
if (error.reason === "target_not_found" ||
|
|
362
|
-
error.reason === "target_not_allowed" ||
|
|
363
|
-
error.reason === "target_changed")
|
|
364
|
-
return "target_unavailable";
|
|
365
|
-
if (error.reason === "endpoint_unreachable" ||
|
|
366
|
-
error.reason === "disconnected")
|
|
367
|
-
return "provider_unavailable";
|
|
368
|
-
return "unreadable_output";
|
|
369
|
-
}
|
|
370
|
-
if (error instanceof ArtifactOperationError)
|
|
371
|
-
return error.reason === "integrity" && error.artifactDetails !== undefined
|
|
372
|
-
? "artifact_integrity_mismatch"
|
|
373
|
-
: error.reason === "limit"
|
|
374
|
-
? "truncated"
|
|
375
|
-
: error.reason === "cancelled"
|
|
376
|
-
? "cancelled"
|
|
377
|
-
: "artifact_operation_failed";
|
|
378
|
-
if (error instanceof EvidenceFileError)
|
|
379
|
-
return error.reason === "outside-root"
|
|
380
|
-
? "outside_approved_root"
|
|
381
|
-
: error.reason === "too-large"
|
|
382
|
-
? "truncated"
|
|
383
|
-
: error.reason === "disabled"
|
|
384
|
-
? "capability_unavailable"
|
|
385
|
-
: "execution_failure";
|
|
386
|
-
if (error instanceof InvestigationWorkspaceError) {
|
|
387
|
-
if (error.reason === "revision-conflict" ||
|
|
388
|
-
error.reason === "name-conflict")
|
|
389
|
-
return "revision_conflict";
|
|
390
|
-
if (error.reason === "too-large")
|
|
391
|
-
return "truncated";
|
|
392
|
-
if (error.reason === "disabled")
|
|
393
|
-
return "capability_unavailable";
|
|
394
|
-
if (error.reason === "outside-root")
|
|
395
|
-
return "outside_approved_root";
|
|
396
|
-
if (error.reason === "integrity" || error.reason === "invalid-json")
|
|
397
|
-
return "evidence_integrity_mismatch";
|
|
398
|
-
return "execution_failure";
|
|
351
|
+
/** Approved replay commitment no longer matches the immediately rebuilt plan. */
|
|
352
|
+
export class ReplayPlanStaleError extends AnalysisError {
|
|
353
|
+
approvedDigest;
|
|
354
|
+
actualDigest;
|
|
355
|
+
_tag = "ReplayPlanStaleError";
|
|
356
|
+
constructor(approvedDigest, actualDigest) {
|
|
357
|
+
super("Controlled replay plan changed before execution");
|
|
358
|
+
this.approvedDigest = approvedDigest;
|
|
359
|
+
this.actualDigest = actualDigest;
|
|
399
360
|
}
|
|
400
|
-
|
|
401
|
-
return error.reason === "revision-conflict" ||
|
|
402
|
-
error.reason === "already-exists"
|
|
403
|
-
? "revision_conflict"
|
|
404
|
-
: error.reason === "limit"
|
|
405
|
-
? "truncated"
|
|
406
|
-
: error.reason === "integrity"
|
|
407
|
-
? "evidence_integrity_mismatch"
|
|
408
|
-
: "execution_failure";
|
|
409
|
-
if (error._tag === "ProcessCaptureError")
|
|
410
|
-
return error.cleanupIncomplete
|
|
411
|
-
? "cleanup_incomplete"
|
|
412
|
-
: error.userCategory === "cancelled"
|
|
413
|
-
? "cancelled"
|
|
414
|
-
: error.userCategory === "permission_required"
|
|
415
|
-
? "permission_required"
|
|
416
|
-
: "process_capture_failed";
|
|
417
|
-
switch (error._tag) {
|
|
418
|
-
case "AnalysisProtocolError":
|
|
419
|
-
case "AnalysisOutputError":
|
|
420
|
-
case "HopperProtocolError":
|
|
421
|
-
return "unreadable_output";
|
|
422
|
-
case "AnalysisInputError":
|
|
423
|
-
return "invalid_request";
|
|
424
|
-
case "AnalysisCapabilityUnavailableError":
|
|
425
|
-
case "ProviderSelectionError":
|
|
426
|
-
return "capability_unavailable";
|
|
427
|
-
case "AnalysisCancelledError":
|
|
428
|
-
case "HopperCancelledError":
|
|
429
|
-
return "cancelled";
|
|
430
|
-
case "AnalysisTimeoutError":
|
|
431
|
-
case "HopperTimeoutError":
|
|
432
|
-
return "provider_timeout";
|
|
433
|
-
case "HopperProcessError":
|
|
434
|
-
case "HopperStartError":
|
|
435
|
-
return "provider_unavailable";
|
|
436
|
-
case "ConfigurationError":
|
|
437
|
-
return "configuration_invalid";
|
|
438
|
-
case "NoBinaryOpenError":
|
|
439
|
-
case "BinaryTargetError":
|
|
440
|
-
return "target_unavailable";
|
|
441
|
-
case "EvidenceIntegrityError":
|
|
442
|
-
return "evidence_integrity_mismatch";
|
|
443
|
-
case "EvidenceLimitError":
|
|
444
|
-
return "truncated";
|
|
445
|
-
case "ProviderAdapterError":
|
|
446
|
-
case "HopperRemoteError":
|
|
447
|
-
return "execution_failure";
|
|
448
|
-
case "BrowserObservationError":
|
|
449
|
-
throw new TypeError("Unhandled specialized browser error");
|
|
450
|
-
case "ArtifactOperationError":
|
|
451
|
-
case "EvidenceFileError":
|
|
452
|
-
case "InvestigationWorkspaceError":
|
|
453
|
-
case "UnknownRegistryError":
|
|
454
|
-
case "PermissionRequiredError":
|
|
455
|
-
throw new TypeError("Unhandled specialized analysis error");
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
const errorDetails = (error) => {
|
|
459
|
-
if (error instanceof PermissionRequiredError)
|
|
460
|
-
return {
|
|
461
|
-
capability: error.requested.capability,
|
|
462
|
-
requested: scopeDetails(error.requested),
|
|
463
|
-
missing: missingScopeDetails(error.missing),
|
|
464
|
-
ceiling: error.ceiling === null ? null : scopeDetails(error.ceiling),
|
|
465
|
-
};
|
|
466
|
-
if (error instanceof ArtifactOperationError && error.artifactDetails)
|
|
467
|
-
return {
|
|
468
|
-
logical_path: error.artifactDetails.logicalPath,
|
|
469
|
-
declared_sha256: error.artifactDetails.declaredSha256,
|
|
470
|
-
calculated_sha256: error.artifactDetails.calculatedSha256,
|
|
471
|
-
unpacked: error.artifactDetails.unpacked,
|
|
472
|
-
};
|
|
473
|
-
if (error instanceof ArtifactOperationError)
|
|
474
|
-
return {
|
|
475
|
-
operation: error.operation,
|
|
476
|
-
reason: error.reason,
|
|
477
|
-
...(error.reason === "limit" ? { truncated: true } : {}),
|
|
478
|
-
};
|
|
479
|
-
if (error instanceof AnalysisCancelledError)
|
|
480
|
-
return { operation: error.operation, cleanup: "complete" };
|
|
481
|
-
if (error instanceof HopperCancelledError)
|
|
482
|
-
return { operation: "hopper", cleanup: "complete" };
|
|
483
|
-
if (error instanceof AnalysisTimeoutError)
|
|
484
|
-
return { operation: error.operation, timeout_ms: error.timeoutMs };
|
|
485
|
-
if (error instanceof HopperTimeoutError)
|
|
486
|
-
return { operation: "hopper", timeout_ms: error.timeoutMs };
|
|
487
|
-
if (error instanceof EvidenceLimitError)
|
|
488
|
-
return { limit: error.limit, maximum: error.maximum, truncated: true };
|
|
489
|
-
if (error instanceof InvestigationWorkspaceError)
|
|
490
|
-
return { operation: error.operation, reason: error.reason };
|
|
491
|
-
if (error instanceof UnknownRegistryError)
|
|
492
|
-
return { reason: error.reason };
|
|
493
|
-
if (error instanceof EvidenceFileError)
|
|
494
|
-
return { operation: error.operation, reason: error.reason };
|
|
495
|
-
if (error instanceof AnalysisCapabilityUnavailableError)
|
|
496
|
-
return { provider_id: error.providerId, operation: error.operation };
|
|
497
|
-
if (error instanceof ProviderSelectionError)
|
|
498
|
-
return {
|
|
499
|
-
operation: error.operation,
|
|
500
|
-
selection_reason: error.reason,
|
|
501
|
-
requested_provider_id: error.requestedProviderId,
|
|
502
|
-
candidate_ids: [...error.candidateIds],
|
|
503
|
-
rejections: error.rejections.map((rejection) => ({
|
|
504
|
-
provider_id: rejection.providerId,
|
|
505
|
-
code: rejection.code,
|
|
506
|
-
reason: rejection.reason,
|
|
507
|
-
diagnostics: rejection.diagnostics,
|
|
508
|
-
})),
|
|
509
|
-
};
|
|
510
|
-
if (error instanceof ProviderAdapterError)
|
|
511
|
-
return {
|
|
512
|
-
provider_id: error.providerId,
|
|
513
|
-
operation: error.operation,
|
|
514
|
-
...(error.diagnostics === undefined
|
|
515
|
-
? {}
|
|
516
|
-
: { diagnostics: error.diagnostics }),
|
|
517
|
-
};
|
|
518
|
-
if (error instanceof BrowserObservationError)
|
|
519
|
-
return { operation: error.operation, reason: error.reason };
|
|
520
|
-
if (error instanceof HopperRemoteError)
|
|
521
|
-
return { provider_code: error.code, diagnostic_type: error.diagnosticType };
|
|
522
|
-
if (error instanceof HopperProcessError && error.failureCode !== undefined)
|
|
523
|
-
return { failure_code: error.failureCode, exit_code: error.exitCode };
|
|
524
|
-
if (error._tag === "ProcessCaptureError" && error.cleanupIncomplete)
|
|
525
|
-
return {
|
|
526
|
-
cleanup: "incomplete",
|
|
527
|
-
resources: [...error.cleanupResources],
|
|
528
|
-
};
|
|
529
|
-
if (error._tag === "ProcessCaptureError" &&
|
|
530
|
-
error.userCategory === "cancelled")
|
|
531
|
-
return { operation: "process_capture", cleanup: "complete" };
|
|
532
|
-
if (error instanceof BinaryTargetError)
|
|
533
|
-
return { path: error.path };
|
|
534
|
-
return undefined;
|
|
535
|
-
};
|
|
536
|
-
const scopeDetails = (scope) => ({
|
|
537
|
-
capability: scope.capability,
|
|
538
|
-
roots: [...scope.roots],
|
|
539
|
-
executables: [...scope.executables],
|
|
540
|
-
environment_names: [...scope.environment_names],
|
|
541
|
-
...(scope.origins === undefined ? {} : { origins: [...scope.origins] }),
|
|
542
|
-
network: scope.network,
|
|
543
|
-
mount: scope.mount,
|
|
544
|
-
});
|
|
545
|
-
const missingScopeDetails = (scope) => ({
|
|
546
|
-
...(scope.roots === undefined ? {} : { roots: [...scope.roots] }),
|
|
547
|
-
...(scope.executables === undefined
|
|
548
|
-
? {}
|
|
549
|
-
: { executables: [...scope.executables] }),
|
|
550
|
-
...(scope.environment_names === undefined
|
|
551
|
-
? {}
|
|
552
|
-
: { environment_names: [...scope.environment_names] }),
|
|
553
|
-
...(scope.origins === undefined ? {} : { origins: [...scope.origins] }),
|
|
554
|
-
...(scope.network === undefined ? {} : { network: scope.network }),
|
|
555
|
-
...(scope.mount === undefined ? {} : { mount: scope.mount }),
|
|
556
|
-
});
|
|
557
|
-
const RETRYABLE_CODES = new Set([
|
|
558
|
-
"provider_timeout",
|
|
559
|
-
"cancelled",
|
|
560
|
-
"revision_conflict",
|
|
561
|
-
"provider_unavailable",
|
|
562
|
-
]);
|
|
563
|
-
const remediationAction = (error) => {
|
|
564
|
-
if (error instanceof PermissionRequiredError)
|
|
565
|
-
return error.elicitationSupported
|
|
566
|
-
? "Approve the exact missing scope, then retry the operation."
|
|
567
|
-
: "Add the exact missing scope beneath the administrator ceiling, then retry.";
|
|
568
|
-
return userMessage(error);
|
|
569
|
-
};
|
|
570
|
-
const errorCategory = (error) => {
|
|
571
|
-
if (error instanceof PermissionRequiredError)
|
|
572
|
-
return "permission_required";
|
|
573
|
-
if (error instanceof ProviderSelectionError &&
|
|
574
|
-
error.reason === "provider_unavailable")
|
|
575
|
-
return "unavailable";
|
|
576
|
-
if (error._tag === "ProcessCaptureError")
|
|
577
|
-
return error.userCategory ?? "execution_failure";
|
|
578
|
-
if (error instanceof BrowserObservationError) {
|
|
579
|
-
if (error.reason === "payload_limit")
|
|
580
|
-
return "truncated";
|
|
581
|
-
if (error.reason === "target_not_found" ||
|
|
582
|
-
error.reason === "target_not_allowed" ||
|
|
583
|
-
error.reason === "target_changed" ||
|
|
584
|
-
error.reason === "endpoint_unreachable" ||
|
|
585
|
-
error.reason === "disconnected")
|
|
586
|
-
return "unavailable";
|
|
587
|
-
}
|
|
588
|
-
if (error instanceof HopperRemoteError &&
|
|
589
|
-
error.diagnosticType === "authorization")
|
|
590
|
-
return "permission_required";
|
|
591
|
-
if (error instanceof ArtifactOperationError)
|
|
592
|
-
return artifactErrorCategory(error.reason);
|
|
593
|
-
if (error instanceof EvidenceFileError && error.reason === "disabled")
|
|
594
|
-
return "unavailable";
|
|
595
|
-
if (error instanceof InvestigationWorkspaceError)
|
|
596
|
-
return investigationWorkspaceCategory(error.reason);
|
|
597
|
-
return STATIC_ERROR_CATEGORIES[error._tag] ?? "execution_failure";
|
|
598
|
-
};
|
|
599
|
-
const investigationWorkspaceCategory = (reason) => {
|
|
600
|
-
if (reason === "disabled" ||
|
|
601
|
-
reason === "outside-root" ||
|
|
602
|
-
reason === "not-file")
|
|
603
|
-
return "unavailable";
|
|
604
|
-
if (reason === "too-large")
|
|
605
|
-
return "truncated";
|
|
606
|
-
if (reason === "invalid-json" || reason === "integrity")
|
|
607
|
-
return "integrity_mismatch";
|
|
608
|
-
return "execution_failure";
|
|
609
|
-
};
|
|
610
|
-
const artifactErrorCategory = (reason) => {
|
|
611
|
-
if (reason === "integrity")
|
|
612
|
-
return "integrity_mismatch";
|
|
613
|
-
if (reason === "limit")
|
|
614
|
-
return "truncated";
|
|
615
|
-
if (reason === "cancelled")
|
|
616
|
-
return "cancelled";
|
|
617
|
-
if (reason === "unavailable")
|
|
618
|
-
return "unavailable";
|
|
619
|
-
return "execution_failure";
|
|
620
|
-
};
|
|
621
|
-
const STATIC_ERROR_CATEGORIES = {
|
|
622
|
-
AnalysisInputError: "invalid_input",
|
|
623
|
-
AnalysisCapabilityUnavailableError: "unsupported_provider",
|
|
624
|
-
ProviderSelectionError: "unsupported_provider",
|
|
625
|
-
EvidenceIntegrityError: "integrity_mismatch",
|
|
626
|
-
EvidenceLimitError: "truncated",
|
|
627
|
-
AnalysisCancelledError: "cancelled",
|
|
628
|
-
HopperCancelledError: "cancelled",
|
|
629
|
-
AnalysisTimeoutError: "timeout",
|
|
630
|
-
HopperTimeoutError: "timeout",
|
|
631
|
-
NoBinaryOpenError: "unavailable",
|
|
632
|
-
BinaryTargetError: "unavailable",
|
|
633
|
-
};
|
|
634
|
-
const userMessage = (error) => {
|
|
635
|
-
if (error instanceof PermissionRequiredError)
|
|
636
|
-
return "This operation needs additional local permission. Review the requested scope and remediation.";
|
|
637
|
-
if (error instanceof AnalysisInputError)
|
|
638
|
-
return "Analysis input is invalid. Check the arguments and try again.";
|
|
639
|
-
if (error.userMessage !== undefined)
|
|
640
|
-
return error.userMessage;
|
|
641
|
-
if (UNREADABLE_OUTPUT_TAGS.has(error._tag))
|
|
642
|
-
return "Analysis returned an unreadable result. Retry once; if it continues, run `rea doctor`.";
|
|
643
|
-
if (UNSUPPORTED_PROVIDER_TAGS.has(error._tag))
|
|
644
|
-
return "This analysis is unavailable for the current target. Choose another analysis or target.";
|
|
645
|
-
if (CANCELLED_TAGS.has(error._tag))
|
|
646
|
-
return "Analysis was cancelled. Start it again when ready.";
|
|
647
|
-
if (TIMEOUT_TAGS.has(error._tag))
|
|
648
|
-
return "Analysis took too long. Try a smaller request, then run `rea doctor` if it continues.";
|
|
649
|
-
if (ADAPTER_FAILURE_TAGS.has(error._tag))
|
|
650
|
-
return "Analysis could not complete. Retry once; if it continues, run `rea doctor`.";
|
|
651
|
-
if (START_FAILURE_TAGS.has(error._tag))
|
|
652
|
-
return "Analysis could not start or stopped unexpectedly. Run `rea doctor`, then try again.";
|
|
653
|
-
if (error instanceof ArtifactOperationError)
|
|
654
|
-
return artifactMessage(error.reason);
|
|
655
|
-
if (error instanceof EvidenceIntegrityError)
|
|
656
|
-
return "Evidence is invalid or has changed. Recreate or re-import it, then try again.";
|
|
657
|
-
if (error instanceof EvidenceLimitError)
|
|
658
|
-
return "Evidence is too large for this session. Reduce the evidence set and try again.";
|
|
659
|
-
if (error instanceof EvidenceFileError)
|
|
660
|
-
return evidenceFileMessage(error.reason);
|
|
661
|
-
if (error instanceof InvestigationWorkspaceError)
|
|
662
|
-
return investigationWorkspaceMessage(error.reason);
|
|
663
|
-
if (error instanceof UnknownRegistryError)
|
|
664
|
-
return "Evidence state changed before the update completed. Refresh the current state and try again.";
|
|
665
|
-
if (error instanceof ConfigurationError)
|
|
666
|
-
return "REA configuration is invalid. Run `rea doctor` and fix the reported setting.";
|
|
667
|
-
if (error instanceof NoBinaryOpenError)
|
|
668
|
-
return error.message;
|
|
669
|
-
if (error instanceof BinaryTargetError)
|
|
670
|
-
return "REA could not open that app or binary. Check that the path exists, is readable, and points to a supported file.";
|
|
671
|
-
if (error._tag === "ProcessCaptureError")
|
|
672
|
-
return (error.userMessage ??
|
|
673
|
-
"Process capture could not complete. Run `rea doctor`, then review capture policy and try again.");
|
|
674
|
-
return "Analysis could not complete. Run `rea doctor`, then try again.";
|
|
675
|
-
};
|
|
676
|
-
const UNREADABLE_OUTPUT_TAGS = new Set([
|
|
677
|
-
"AnalysisProtocolError",
|
|
678
|
-
"AnalysisOutputError",
|
|
679
|
-
"HopperProtocolError",
|
|
680
|
-
]);
|
|
681
|
-
const UNSUPPORTED_PROVIDER_TAGS = new Set([
|
|
682
|
-
"AnalysisCapabilityUnavailableError",
|
|
683
|
-
"ProviderSelectionError",
|
|
684
|
-
]);
|
|
685
|
-
const CANCELLED_TAGS = new Set([
|
|
686
|
-
"AnalysisCancelledError",
|
|
687
|
-
"HopperCancelledError",
|
|
688
|
-
]);
|
|
689
|
-
const TIMEOUT_TAGS = new Set([
|
|
690
|
-
"AnalysisTimeoutError",
|
|
691
|
-
"HopperTimeoutError",
|
|
692
|
-
]);
|
|
693
|
-
const ADAPTER_FAILURE_TAGS = new Set([
|
|
694
|
-
"ProviderAdapterError",
|
|
695
|
-
"HopperRemoteError",
|
|
696
|
-
]);
|
|
697
|
-
const START_FAILURE_TAGS = new Set([
|
|
698
|
-
"HopperProcessError",
|
|
699
|
-
"HopperStartError",
|
|
700
|
-
]);
|
|
701
|
-
const artifactMessage = (reason) => {
|
|
702
|
-
if (reason === "cancelled")
|
|
703
|
-
return "Artifact operation was cancelled. Start it again when ready.";
|
|
704
|
-
if (reason === "limit")
|
|
705
|
-
return "Artifact is too large to process safely. Narrow the requested path or use a smaller artifact.";
|
|
706
|
-
if (reason === "path")
|
|
707
|
-
return "Artifact path is not allowed. Choose a path inside the artifact and try again.";
|
|
708
|
-
if (reason === "unavailable")
|
|
709
|
-
return "Artifact format is not available on this system. Choose another artifact or supported environment.";
|
|
710
|
-
if (reason === "format" || reason === "integrity")
|
|
711
|
-
return "Artifact is invalid or has changed. Get a fresh copy and try again.";
|
|
712
|
-
return "Artifact could not be read or written. Check file access and try again.";
|
|
713
|
-
};
|
|
714
|
-
const evidenceFileMessage = (reason) => {
|
|
715
|
-
if (reason === "disabled")
|
|
716
|
-
return "Evidence file access is disabled. Enable an evidence directory or use inline evidence.";
|
|
717
|
-
if (reason === "outside-root")
|
|
718
|
-
return "Evidence path is outside the allowed directory. Choose a path inside the configured evidence directory.";
|
|
719
|
-
if (reason === "not-file")
|
|
720
|
-
return "Evidence path does not point to a file. Choose an evidence file and try again.";
|
|
721
|
-
if (reason === "too-large")
|
|
722
|
-
return "Evidence file is too large. Reduce its size and try again.";
|
|
723
|
-
if (reason === "exists")
|
|
724
|
-
return "Evidence file already exists. Choose another path or allow overwrite.";
|
|
725
|
-
if (reason === "invalid-json")
|
|
726
|
-
return "Evidence file is not valid JSON. Repair or recreate the file and try again.";
|
|
727
|
-
return "Evidence file could not be accessed. Check file permissions and try again.";
|
|
728
|
-
};
|
|
729
|
-
const investigationWorkspaceMessage = (reason) => {
|
|
730
|
-
if (reason === "disabled")
|
|
731
|
-
return "Investigation workspace access is disabled. Configure a workspace directory and try again.";
|
|
732
|
-
if (reason === "outside-root")
|
|
733
|
-
return "Investigation workspace is outside the allowed directory. Choose a configured workspace directory and try again.";
|
|
734
|
-
if (reason === "not-file")
|
|
735
|
-
return "Investigation workspace path is not a file. Choose a workspace file and try again.";
|
|
736
|
-
if (reason === "too-large")
|
|
737
|
-
return "Investigation workspace is too large. Reduce its size and try again.";
|
|
738
|
-
if (reason === "invalid-json" || reason === "integrity")
|
|
739
|
-
return "Investigation workspace is invalid or has changed. Recreate or repair it, then try again.";
|
|
740
|
-
if (reason === "locked")
|
|
741
|
-
return "Another investigation update is in progress. Try again when it finishes.";
|
|
742
|
-
if (reason === "revision-conflict" || reason === "name-conflict")
|
|
743
|
-
return "Investigation workspace state changed. Refresh the current state and try again.";
|
|
744
|
-
return "Investigation workspace could not be accessed. Check file permissions and try again.";
|
|
745
|
-
};
|
|
746
|
-
const KNOWN_ERROR_TAGS = {
|
|
747
|
-
AnalysisProtocolError: true,
|
|
748
|
-
AnalysisInputError: true,
|
|
749
|
-
AnalysisOutputError: true,
|
|
750
|
-
AnalysisCapabilityUnavailableError: true,
|
|
751
|
-
AnalysisCancelledError: true,
|
|
752
|
-
AnalysisTimeoutError: true,
|
|
753
|
-
ProviderSelectionError: true,
|
|
754
|
-
ProviderAdapterError: true,
|
|
755
|
-
BrowserObservationError: true,
|
|
756
|
-
ArtifactOperationError: true,
|
|
757
|
-
ProcessCaptureError: true,
|
|
758
|
-
EvidenceIntegrityError: true,
|
|
759
|
-
EvidenceLimitError: true,
|
|
760
|
-
EvidenceFileError: true,
|
|
761
|
-
InvestigationWorkspaceError: true,
|
|
762
|
-
UnknownRegistryError: true,
|
|
763
|
-
HopperTimeoutError: true,
|
|
764
|
-
HopperCancelledError: true,
|
|
765
|
-
HopperProtocolError: true,
|
|
766
|
-
HopperRemoteError: true,
|
|
767
|
-
HopperProcessError: true,
|
|
768
|
-
HopperStartError: true,
|
|
769
|
-
ConfigurationError: true,
|
|
770
|
-
NoBinaryOpenError: true,
|
|
771
|
-
BinaryTargetError: true,
|
|
772
|
-
PermissionRequiredError: true,
|
|
773
|
-
};
|
|
774
|
-
const assertKnownTag = (tag) => {
|
|
775
|
-
if (KNOWN_ERROR_TAGS[tag] !== true)
|
|
776
|
-
throw new TypeError("Unknown analysis error tag");
|
|
777
|
-
};
|
|
361
|
+
}
|