import type { DaemonRemoteManagementRouteHandlers } from './context.js'; import { type JsonRecord } from './route-helpers.js'; /** * The auth object the remote route handlers carry through untouched. * * Exported because a host composing these handlers has to name the type in its * own signatures, and a declaration it cannot import is a declaration it copies: * the daemon product mirrored this alias and the 17-method service interface * below by hand, verbatim, purely because neither carried the keyword. */ export type RemotePeerAuth = unknown; /** The service surface the remote management routes call into. See {@link RemotePeerAuth}. */ export interface DistributedRuntimeRouteService { listPairRequests(): unknown; approvePairRequest(requestId: string, input: Record): Promise; rejectPairRequest(requestId: string, input: Record): Promise; listPeers(): unknown; rotatePeerToken(peerId: string, input: Record): Promise; revokePeerToken(peerId: string, input: Record): Promise; disconnectPeer(peerId: string, input: Record): Promise; listWork(): unknown; invokePeer(input: Record): Promise; cancelWork(workId: string, input: Record): Promise; getNodeHostContract(): unknown; requestPairing(input: Record): Promise; verifyPairRequest(requestId: string, challenge: string, input: Record): Promise; heartbeatPeer(auth: RemotePeerAuth, input: Record): Promise; claimWork(auth: RemotePeerAuth, input: Record): Promise; completeWork(auth: RemotePeerAuth, workId: string, input: Record): Promise; } interface SessionUserLike { readonly username: string; } interface DaemonRemoteRouteContext { readonly authToken?: string | null | undefined; readonly parseJsonBody: (req: Request) => Promise; readonly requireAdmin: (req: Request) => Response | null; readonly requireRemotePeer: (req: Request, scope?: string) => Promise; readonly requireAuthenticatedSession: (req: Request) => SessionUserLike | null; readonly distributedRuntime: DistributedRuntimeRouteService; } export declare function createDaemonRemoteRouteHandlers(context: DaemonRemoteRouteContext): DaemonRemoteManagementRouteHandlers; export declare function handleRemotePairRequest(context: Pick, req: Request): Promise; export declare function handleRemotePairVerify(context: Pick, req: Request): Promise; export declare function handleRemotePeerHeartbeat(context: Pick, req: Request): Promise; export declare function handleRemotePeerWorkPull(context: Pick, req: Request): Promise; export declare function handleRemotePeerWorkComplete(context: Pick, workId: string, req: Request): Promise; export declare function estimateJsonByteLengthWithinLimit(value: unknown, maxBytes: number): { readonly kind: 'ok'; readonly byteLength: number; } | { readonly kind: 'invalid'; }; export {}; //# sourceMappingURL=remote-routes.d.ts.map