/**
 * Custom-action contracts — a mechanism for addons to expose system-level
 * extensibility endpoints (e.g. benchmark addon API) through a single
 * generic `api.addons.custom` tRPC endpoint.
 *
 * The contract shape mirrors `method()` from capability-definition.ts —
 * input/output Zod schemas, kind, auth — plus a `scope` discriminated union
 * (today only 'system' is runtime-supported; 'device' is typed for forward
 * compat).
 */
import type { z } from 'zod';
import type { DeviceType } from '../device/device-type.js';
import type { CapabilityMethodAuth } from './capability-definition.js';
/** Scope of a custom action. Today only `system` is supported by the runtime. */
export type CustomActionScope = {
    readonly kind: 'system';
} | {
    readonly kind: 'device';
    readonly deviceTypes?: readonly DeviceType[];
};
export interface CustomActionSpec<TIn extends z.ZodType = z.ZodType, TOut extends z.ZodType = z.ZodType, TKind extends 'query' | 'mutation' | 'subscription' = 'query' | 'mutation' | 'subscription', TAuth extends CapabilityMethodAuth = CapabilityMethodAuth, TScope extends CustomActionScope = CustomActionScope> {
    readonly input: TIn;
    readonly output: TOut;
    readonly kind: TKind;
    readonly auth: TAuth;
    readonly scope: TScope;
}
export type CustomActionsSpec = Record<string, CustomActionSpec>;
/**
 * Identity — preserves literal types for downstream inference.
 *
 * The constraint is `Record<string, unknown>` (not `CustomActionsSpec`) so
 * TypeScript does not widen each entry's literal `kind`/`auth` fields to
 * the broader unions declared on `CustomActionSpec`'s default generics.
 * Shape validity is enforced separately by the `customAction(...)` helper
 * whose return type is already a `CustomActionSpec<...>`.
 */
export declare function defineCustomActions<T extends Record<string, unknown>>(spec: T): T;
export interface CustomActionOptions<TKind extends 'query' | 'mutation' | 'subscription' = 'query', TAuth extends CapabilityMethodAuth = 'protected'> {
    readonly kind?: TKind;
    readonly auth?: TAuth;
    readonly scope?: CustomActionScope;
}
export declare function customAction<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends 'query' | 'mutation' | 'subscription' = 'query', TAuth extends CapabilityMethodAuth = 'protected'>(input: TIn, output: TOut, options?: CustomActionOptions<TKind, TAuth>): CustomActionSpec<TIn, TOut, TKind, TAuth, {
    readonly kind: 'system';
}>;
//# sourceMappingURL=custom-actions.d.ts.map