/** * routes/devices.ts, handlers for the paired-device verbs over the live * device capability service (see platform/devices for the contract). * * These are what make the paired-phone feature real on every client: listing * paired device nodes and their capabilities, ASKING one of them for a * capability and reading back what it returned, listing the durable "always * allow" grants with their ledger, revoking a grant, and running the * housekeeping sweep with its disclosure. * * `devices.capability.request` and the two artifact verbs are the path for a * surface that does not host the device posture runtime itself. In-process the * `phone` tool calls DeviceCapabilityService.request directly and reads capture * bytes off the daemon's own disk; a client somewhere else could see the grants * and revoke them and could not ask a phone for anything. Every gate stays * where it was: these handlers shape arguments and render the runtime's own * outcome, and re-decide nothing. The confirmation prompt, the durable-grant * lookup, the input check, the retention window and the disclosure all belong * to the runtime, exactly as they do for the tool. * * Absent a bound service the verbs stay cataloged-but-unhandled, the same * graceful degrade the power and memory verb groups use. */ import type { GatewayMethodCatalog } from '../method-catalog.js'; import type { GatewayMethodHandler } from '../method-catalog-shared.js'; import type { DeviceCapabilityService } from '../../devices/device-capability-service.js'; import type { DeviceCaptureArtifactStore } from '../../devices/device-capture-artifacts.js'; import type { DeviceGrantStore } from '../../devices/device-grants.js'; import type { DeviceHousekeeper } from '../../devices/device-housekeeping.js'; /** The device slice the verbs need, bound by whichever runtime owns it. */ export interface DevicesGatewayService { readonly capabilities: Pick; readonly grants: Pick; readonly housekeeper: Pick; readonly artifacts: Pick; } /** * Ask one paired device for one capability. * * A refusal comes back as `ok: false` with the runtime's own reason rather than * an HTTP error, because a person declining to hand over their camera is an * ANSWER, the request ran, was put to them, and they said no. Reporting that * as a server fault would make a working system look broken and would lose the * one thing the caller needs, which is what they said. */ export declare function createDevicesCapabilityRequestHandler(service: DevicesGatewayService): GatewayMethodHandler; export declare function createDevicesArtifactsListHandler(service: DevicesGatewayService): GatewayMethodHandler; export declare function createDevicesArtifactsReadHandler(service: DevicesGatewayService): GatewayMethodHandler; export declare function createDevicesNodesListHandler(service: DevicesGatewayService): GatewayMethodHandler; export declare function createDevicesGrantsListHandler(service: DevicesGatewayService): GatewayMethodHandler; export declare function createDevicesGrantsRevokeHandler(service: DevicesGatewayService): GatewayMethodHandler; export declare function createDevicesHousekeepingRunHandler(service: DevicesGatewayService): GatewayMethodHandler; /** Attach the device handlers to their registered descriptors (missing = no-op). */ export declare function registerDevicesGatewayMethods(catalog: GatewayMethodCatalog, service: DevicesGatewayService): void; //# sourceMappingURL=devices.d.ts.map