* feat(agent): add standalone agent runtime * fix(backups): bridge local executor to Effect restic API * fix(agent): add Bun and DOM types to agent tsconfig * refactor: wrap backup error in a tagged effect error * fix: pr feedbacks
12 lines
480 B
TypeScript
12 lines
480 B
TypeScript
import { createAgentMessage, type ControllerMessage } from "@zerobyte/contracts/agent-protocol";
|
|
import type { ControllerCommandContext } from "../context";
|
|
|
|
type HeartbeatPingPayload = Extract<ControllerMessage, { type: "heartbeat.ping" }>["payload"];
|
|
|
|
export const handleHeartbeatPingCommand = (context: ControllerCommandContext, payload: HeartbeatPingPayload) => {
|
|
return context.offerOutbound(
|
|
createAgentMessage("heartbeat.pong", {
|
|
sentAt: payload.sentAt,
|
|
}),
|
|
);
|
|
};
|