mirror of
https://github.com/morluto/rea.git
synced 2026-12-05 19:51:20 -05:00
b51ed4c3ec
* refactor(kernel): migrate the remaining one-shot SHA-256 hex digests to sha256Hex * refactor(kernel): move isRecord into src/kernel and replace its inline copies (#11574) * fix(scripts): import isRecord from src/kernel in the managed manifest parser
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { z } from "zod";
|
|
import { isRecord } from "../../kernel/isRecord.js";
|
|
|
|
/**
|
|
* Whether a provider inventory discovered every procedure, string or name in
|
|
* the file. No provider establishes that today, so it is always unknown.
|
|
*/
|
|
export const inventoryDiscoveryCoverageSchema = z.literal("unknown");
|
|
|
|
/**
|
|
* What overview counts measure: every row the bound provider's procedure and
|
|
* string inventories returned, not discovery of the file. The tool
|
|
* description carries the agent-facing explanation once.
|
|
*/
|
|
export const overviewInventoryCoverageSchema = z.strictObject({
|
|
scope: z.literal("provider_inventory"),
|
|
discovery_coverage: inventoryDiscoveryCoverageSchema,
|
|
});
|
|
|
|
/**
|
|
* Label an overview from any producer, including a replayed snapshot saved
|
|
* before this record existed: the counts' meaning does not depend on who
|
|
* produced them.
|
|
*/
|
|
export const withOverviewInventoryCoverage = <Value>(overview: Value): Value =>
|
|
isRecord(overview)
|
|
? {
|
|
...overview,
|
|
inventory_coverage: {
|
|
scope: "provider_inventory",
|
|
discovery_coverage: "unknown",
|
|
} satisfies z.output<typeof overviewInventoryCoverageSchema>,
|
|
}
|
|
: overview;
|