import type { CuaAction } from "./computer-use.js"; export declare const AFFORDANCE_CLASS_SCHEMA = "humanish.affordance-use.v1"; /** * The affordance classes, named after the surrounding literature rather than invented here: * "naturalistic actions" (AndroidWorld) for the human-modality subset, "nav" (BrowserGym) for * direct navigation, "shortcut" (MAS-Bench) for a non-UI route to the same outcome. */ export type AffordanceClass = /** Pointer or drag interaction with what is rendered on screen — the naturalistic core. */ "pointer" /** Keyboard input into the page: typed text that is not a URL and not script. */ | "keyboard" /** Direct navigation by URL (the `nav` subset). A human affordance; see the note above. */ | "url-navigation" /** Script execution via the address bar (a `javascript:` URL). Not a human affordance. */ | "script-execution" /** Developer tooling opened by keyboard shortcut. Not a human affordance. */ | "devtools" /** A browser-internal surface rather than the product: chrome://, about:, view-source:, file:. */ | "browser-internal" /** The actor observing or pausing rather than acting: screenshots, waits, pointer moves. */ | "observation"; /** Classes that a person operating this product through its own surfaces could produce. */ export declare const NATURALISTIC_AFFORDANCE_CLASSES: readonly AffordanceClass[]; /** Classes that reach past the rendered product surface. Recorded, never blocked. */ export declare const SHORTCUT_AFFORDANCE_CLASSES: readonly AffordanceClass[]; export interface AffordanceObservation { affordance: AffordanceClass; /** * A public-safe hint about WHY this class was assigned, when one exists — a URL scheme or the * devtools chord. Never the typed text, never a full URL (which can carry a session token). */ signal?: string; } /** Aggregate per-run record: how many actions fell into each class. */ export interface AffordanceUse { schema: typeof AFFORDANCE_CLASS_SCHEMA; /** Counts by class; a class with zero actions is omitted so the record stays small and honest. */ counts: Partial>; /** Total classified actions (the denominator for any rate an adopter computes). */ total: number; /** Convenience roll-up: actions in the shortcut classes. Zero is a meaningful, common value. */ shortcutTotal: number; } /** * Classify one computer-use action. PURE: same action in, same class out, no I/O, no clock. The * returned signal is public-safe (a scheme or a chord), never the action's text. */ export declare function classifyCuaAction(action: CuaAction): AffordanceObservation; /** Fold a sequence of observations into the per-run aggregate. */ export declare function summarizeAffordanceUse(observations: readonly AffordanceObservation[]): AffordanceUse;