import { t as AppToolClass, c as AppTool } from './types-DSDLWvXe.js'; /** Sections every tool description carries, regardless of its class. */ declare const COMMON_DESCRIPTION_SECTIONS: readonly ["[USE WHEN]", "[DO NOT USE WHEN]", "[RETURNS]"]; /** * Sections whose value depends on what the tool does. Requiring one universal * seven-section template produced boilerplate (`[READINESS]` on a command, * `[SIDE EFFECTS] None` on every read) and repeated the JSON parameter schema. */ declare const DESCRIPTION_SECTIONS_BY_CLASS: { readonly SNAPSHOT_READ: readonly ["[SCOPE]", "[READINESS]", "[LIMITATIONS]"]; readonly UI_COMMAND: readonly ["[CHANGES]", "[CONSTRAINTS]"]; }; declare function requiredDescriptionSections(toolClass: AppToolClass): readonly string[]; /** One contract breach, addressed to whoever wrote the tool. */ type ConformanceViolation = { tool: string; rule: string; detail: string; }; /** * Checks one result against the envelope. Returns the breaches rather than * throwing, so a suite can report every tool's findings in one pass. * * `toolClass` decides what a successful outcome has to look like, because * `READY` covers both a full digest and a command that did what it was asked — * and a command has no scope, coverage or units to report. Pass the class the * tool declares; without it only the shape-evident checks run. */ declare function checkResultConformance(toolName: string, result: unknown, toolClass?: AppToolClass): ConformanceViolation[]; /** * Compares every caller-visible path exercised by a result matrix with the * tool's `[RETURNS]` prose. It reports the complete missing-path set in one * pass, so adding one description key does not reveal the next key only after * another review round. * * Pass representative results for every success, refusal, partial, empty and * not-ready branch. Stable envelope fields are owned by the kit and excluded. * A tool-owned block such as `summary`, `resultingState` or `changed` is named * literally and then covers its own direct members; a member that came back `null` * in any exercised branch is named on its own line regardless. */ declare function checkResultDocumentation(tool: AppTool, exercisedResults: readonly unknown[]): ConformanceViolation[]; /** * Checks the declarations a tool makes about itself, before any call. * * The class label is what makes the two structural mistakes visible — a snapshot * read that fetches, and a command that poses as a read — so an unlabelled tool * cannot be checked at all. */ declare function checkToolConformance(tool: AppTool): ConformanceViolation[]; declare const APP_TOOL_FAULT_CAPABILITIES: readonly ["loaded-data", "ui-command", "host-round-trip", "entity-scope", "async-load", "bounded-result", "label-resolution", "unit-decorated-labels"]; type AppToolFaultCapability = typeof APP_TOOL_FAULT_CAPABILITIES[number]; declare const APP_TOOL_FAULT_CASES: readonly ["loading", "loaded-empty", "loaded-data", "writer-unavailable", "dropped-write", "writer-rejects-after-partial", "write-read-same-turn", "two-writes-same-key", "older-echo-after-newer-write", "external-host-change", "external-host-change-matches-older-intent", "scope-switch", "stale-entity-reference", "scope-change-during-command", "rejected-async-load", "stale-loaded-data", "result-cap-minus-one", "result-cap-at-limit", "result-cap-plus-one", "multi-entity-cap-fairness", "label-exact", "label-unit-decorated", "label-ambiguous", "label-unknown"]; type AppToolFaultCase = typeof APP_TOOL_FAULT_CASES[number]; type FaultMatrixViolation = { rule: 'duplicate-case' | 'missing-case' | 'unknown-capability' | 'unknown-case'; detail: string; }; type AppToolFaultProbe = { case: string; /** Executes the production-backed assertion for this exact defect family. */ run: () => void | Promise; }; declare function requiredFaultCases(capabilities: readonly AppToolFaultCapability[]): AppToolFaultCase[]; /** Checks declared test coverage; each app still supplies source-truth fixtures. */ declare function checkFaultMatrixCoverage({ capabilities, coveredCases, }: { capabilities: readonly string[]; coveredCases: readonly string[]; }): FaultMatrixViolation[]; /** * Validates the matrix and then executes every declared production-backed probe. * A declaration-only list is deliberately insufficient for the app gate. */ declare function runFaultMatrix({ capabilities, probes, }: { capabilities: readonly string[]; probes: readonly AppToolFaultProbe[]; }): Promise; /** * One tool, one ceiling. Set above the largest measured MANDATORY floor rather than at the * fleet average: parameter schemas are one line each already and `[RETURNS]` must cover the * whole caller-visible surface, so a ceiling under that floor would be unsatisfiable, and an * unsatisfiable gate gets waived rather than met. * * There is deliberately no toolset ceiling. An app with more surface legitimately has more * tools, and capping its total penalises functionality while fixing nothing: the cost that * matters is the dashboard's, where descriptors are attached per mounted instance and one * tool name - `get-current-state` exists in all 29 covered apps - repeats across every tile. * That is bounded by the host shipping a compact catalogue, not by any per-app number. The * toolset total is still measured, because the delivery log and that platform case both need * the figure. */ declare const DEFAULT_TOOL_PROMPT_MAX_BYTES = 6000; type PromptBudget = { perTool: Array<{ tool: string; bytes: number; }>; bytes: number; maxToolBytes: number; withinBudget: boolean; }; /** * Every byte the agent is billed for on each request: the schema the host serializes, * not the source that produced it. `getSchema()` wins where a tool builds its own, * because that is what actually ships. */ declare function measurePromptBytes(tool: AppTool): number; declare function measureToolsetPromptBudget(tools: readonly AppTool[], { maxToolBytes }?: { maxToolBytes?: number; }): PromptBudget; /** * A description is a permanent tax on every request in the conversation, so an oversized * one is a contract breach like any other. The breach is per tool: the toolset total is * reported by `measureToolsetPromptBudget` for the record, but it is not a verdict. */ declare function checkPromptBudget(tools: readonly AppTool[], options?: { maxToolBytes?: number; }): ConformanceViolation[]; export { APP_TOOL_FAULT_CAPABILITIES, APP_TOOL_FAULT_CASES, type AppToolFaultCapability, type AppToolFaultCase, type AppToolFaultProbe, COMMON_DESCRIPTION_SECTIONS, type ConformanceViolation, DEFAULT_TOOL_PROMPT_MAX_BYTES, DESCRIPTION_SECTIONS_BY_CLASS, type FaultMatrixViolation, type PromptBudget, checkFaultMatrixCoverage, checkPromptBudget, checkResultConformance, checkResultDocumentation, checkToolConformance, measurePromptBytes, measureToolsetPromptBudget, requiredDescriptionSections, requiredFaultCases, runFaultMatrix };