Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

542 B
Raw Blame
import { createDirectRtcRuntime, createDirectRuntimeHost } from '@cindy/device-link';
import type { DirectLinkHostApi } from '../shared/directLink';

/** No UI, media capture, filesystem or credentials in this data-only process. */
export function startDirectLinkHost(api: DirectLinkHostApi) {
  const host = createDirectRuntimeHost(createDirectRtcRuntime(), api.event);
  const off = api.onCommand((command) => { void host.command(command); });
  void api.register().catch(() => host.dispose());
  return () => { off(); host.dispose(); };
}