* refactor(config): parse capability settings into exact states * refactor(runtime): encode replay and process outcomes exactly * refactor: make analysis states unrepresentable * refactor(mcp): register canonical schemas with SDK * fix: preserve capability and catalog invariants * fix(build): remove stale compiled modules * fix(replay): update real verifier policy dependency * fix(package): verify the complete MCP catalog * fix(test): supply complete replay reload policy * refactor(contracts): centralize output schema lookup * refactor(mcp): delegate protocol boundaries to SDK * fix(browser): approve real source capture * fix(mcp): preserve catalog guidance
48 lines
1.9 KiB
TypeScript
48 lines
1.9 KiB
TypeScript
import type { AvailabilityPolicy } from "../application/CapabilityInventory.js";
|
|
import type { EvidenceFilePolicy } from "../domain/evidenceBundle.js";
|
|
import type { ProcessExecutionPolicy } from "../domain/processCapture.js";
|
|
|
|
export type SessionAvailability = AvailabilityPolicy;
|
|
|
|
export interface SessionAvailabilityDefaults {
|
|
readonly processPolicy: ProcessExecutionPolicy;
|
|
readonly evidenceFilePolicy: EvidenceFilePolicy;
|
|
readonly investigationInputRoots: readonly string[];
|
|
readonly optionalFeatures?: Pick<
|
|
SessionAvailability,
|
|
| "browserObservationEnabled"
|
|
| "browserScenarioEnabled"
|
|
| "electronObservationEnabled"
|
|
| "electronAutomationEnabled"
|
|
| "v8InspectorObservationEnabled"
|
|
| "javascriptReplayEnabled"
|
|
| "managedRuntimeEnabled"
|
|
>;
|
|
}
|
|
|
|
/** Select configured availability reporting or the target-free defaults. */
|
|
export const sessionAvailabilityPolicy = (
|
|
configured: (() => SessionAvailability) | undefined,
|
|
defaults: SessionAvailabilityDefaults,
|
|
): (() => SessionAvailability) =>
|
|
configured ??
|
|
(() => ({
|
|
processCaptureEnabled: defaults.processPolicy.status === "enabled",
|
|
evidenceFileRoots: defaults.evidenceFilePolicy.roots.length,
|
|
investigationInputRoots: defaults.investigationInputRoots.length,
|
|
browserObservationEnabled:
|
|
defaults.optionalFeatures?.browserObservationEnabled ?? false,
|
|
browserScenarioEnabled:
|
|
defaults.optionalFeatures?.browserScenarioEnabled ?? false,
|
|
electronObservationEnabled:
|
|
defaults.optionalFeatures?.electronObservationEnabled ?? false,
|
|
electronAutomationEnabled:
|
|
defaults.optionalFeatures?.electronAutomationEnabled ?? false,
|
|
v8InspectorObservationEnabled:
|
|
defaults.optionalFeatures?.v8InspectorObservationEnabled ?? false,
|
|
javascriptReplayEnabled:
|
|
defaults.optionalFeatures?.javascriptReplayEnabled ?? false,
|
|
managedRuntimeEnabled:
|
|
defaults.optionalFeatures?.managedRuntimeEnabled ?? false,
|
|
}));
|