import { z } from 'zod'; import type { Automation } from '../automations/domain/types.js'; import type { EndpointConnectionSnapshot, EndpointRegistry } from './registry.js'; declare const subjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"channel">; channel: z.ZodString; accountId: z.ZodString; chatId: z.ZodString; senderId: z.ZodString; threadId: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"automation">; automationId: z.ZodString; }, z.core.$strict>], "kind">; export declare const deviceDelegationRequestSchema: z.ZodObject<{ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"channel">; channel: z.ZodString; accountId: z.ZodString; chatId: z.ZodString; senderId: z.ZodString; threadId: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"automation">; automationId: z.ZodString; }, z.core.$strict>], "kind">; endpointId: z.ZodString; toolName: z.ZodString; arguments: z.ZodRecord; expiresAt: z.ZodNumber; }, z.core.$strict>; export type DeviceDelegationSubject = z.infer; type Request = z.infer; type Grant = { id: string; subject: DeviceDelegationSubject; endpointId: string; principalId: string; toolName: string; providerDigest: string; argumentsDigest: string; expiresAt: number; issuedAt: number; automationContract?: string; }; export declare function issueDeviceDelegation(request: Request, registry: EndpointRegistry): Grant; export declare function listDeviceDelegations(): Grant[]; export declare function revokeDeviceDelegation(id: string): void; /** Call only from the verified channel or automation dispatcher, with host-owned run identity. */ export declare function withDeviceDelegation(input: { subject: DeviceDelegationSubject; acceptedAt: number; automation?: Automation; } | undefined, conversationId: string, runId: string, execute: () => T): T; export declare function resolveDeviceDelegation(conversationId: string, runId: string | undefined, registry: EndpointRegistry): { grant?: Grant; endpoint?: EndpointConnectionSnapshot; } | undefined; export declare function deviceDelegationAllowsArguments(grant: Grant, args: Record): boolean; export {};