mirror of
https://github.com/morluto/rea.git
synced 2026-11-30 02:17:09 +00:00
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import {
|
|
createAnalysisExecution,
|
|
type ProviderIdentity,
|
|
type CapabilityDescriptor,
|
|
type ProviderAvailability,
|
|
type ProviderTargetSupport,
|
|
} from "../../src/ports/AnalysisProvider.js";
|
|
import { ok } from "../../src/domain/result.js";
|
|
|
|
/** A new identity object for the default session test provider. */
|
|
export const createFixtureProviderIdentity = () =>
|
|
({
|
|
id: "fixture",
|
|
name: "Fixture analysis provider",
|
|
version: "1",
|
|
}) as const;
|
|
|
|
const FIXTURE_PROVIDER = createFixtureProviderIdentity();
|
|
|
|
/** Wrap fixture output in the same atomic provider envelope as production. */
|
|
export const observed = (value: unknown) =>
|
|
ok(createAnalysisExecution(value, FIXTURE_PROVIDER));
|
|
|
|
export const availableFixtureProvider = (): ProviderAvailability => ({
|
|
status: "available",
|
|
code: null,
|
|
reason: null,
|
|
diagnostics: {},
|
|
});
|
|
|
|
export const supportedFixtureTarget = (): ProviderTargetSupport => ({
|
|
status: "supported",
|
|
code: null,
|
|
reason: null,
|
|
diagnostics: {},
|
|
});
|
|
|
|
export const fixtureAddressNameCapability = (
|
|
provider: ProviderIdentity,
|
|
): CapabilityDescriptor => ({
|
|
provider,
|
|
operation: "address_name",
|
|
available: true,
|
|
reason: null,
|
|
effects: {
|
|
mutatesArtifact: false,
|
|
launchesProcess: true,
|
|
mayShowUi: false,
|
|
mayAccessNetwork: false,
|
|
mayWriteFilesystem: false,
|
|
changesPermissions: false,
|
|
requiresRoot: false,
|
|
},
|
|
limitations: [],
|
|
});
|