Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

815 B
Raw Blame
import type { KernelMethodParams, KernelMethodResults, KernelMethods } from "@pibot/protocol-base";
export interface RpcRequestContext {
  signal: AbortSignal;
  source?: "acp";
}
export type KernelRegisterRpc = <K extends keyof typeof KernelMethods>(
  method: K,
  action: (
    params: KernelMethodParams[K],
    context: RpcRequestContext,
  ) => Promise<KernelMethodResults[K]>,
) => void;

/**
 * Capability-facing registration seam. Runtime schemas come from the product composition root;
 * each capability keeps its concrete handler typing in its own contract package.
 */
export type RegisterRpc = (
  method: string,
  // biome-ignore lint/suspicious/noExplicitAny: product-composed schemas validate this erased seam.
  action: (params: any, context: RpcRequestContext) => Promise<any> | any,
) => void;