UNPKG

framework

Version:

The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.

21 lines 946 B
import { contextRemote } from './context.js'; import { relayRpc } from '../dashboard/remote-run.js'; /** * Run a run-scoped RPC locally, or relay it to the device when `agentId` names an agent this daemon is * relaying to a connected one (#1067 slice 2). For an ordinary local agent the remote lookup is empty and * `local()` runs unchanged. For a remote agent there is no local checkout, so the call is forwarded to the * device over the token; if the device is unreachable, `unreachable` is returned - the same empty/error * shape `local()` gives on a failed read - so the caller never special-cases a remote agent. */ export async function relayOr(agentId, fn, args, local, unreachable) { const target = contextRemote()?.target(agentId); if (!target) return local(); try { return (await relayRpc(target, fn, args)); } catch { return unreachable; } } //# sourceMappingURL=relay-agent.js.map