gadget/packages/api/src/messages/drone.ts
2026-04-30 09:40:27 -04:00

54 lines
1.3 KiB
TypeScript

// src/messages/drone.ts
// Copyright (C) 2026 Rob Colbert <rob.colbert@openplatform.us>
// Licensed under the Apache License, Version 2.0
import { IChatSession } from "../interfaces/chat-session.ts";
import { IChatTurn } from "../interfaces/chat-turn.ts";
import { IDroneRegistration } from "../interfaces/drone-registration.ts";
import { IProject } from "../interfaces/project.ts";
export type ProcessWorkOrderCallback = (
success: boolean,
message?: string,
) => void;
export type ProcessWorkOrderMessage = (
registration: IDroneRegistration,
project: IProject,
chatSession: IChatSession,
turn: IChatTurn,
cb: ProcessWorkOrderCallback,
) => void;
export type ThinkingMessage = (content: string) => void;
export type ResponseMessage = (content: string) => void;
export type ToolCallMessage = (
callId: string,
name: string,
params: string,
response: string,
) => void;
export type WorkOrderCompleteMessage = (
workOrderId: string,
success: boolean,
message?: string,
) => void;
export type RequestCrashRecoveryMessage = (data: {
workspaceId: string;
turnId: string;
chatSessionId: string;
}) => void;
export type CrashRecoveryResponseMessage = (data: {
turnId: string;
action: "discard" | "retry";
retryDelay?: number;
}) => void;
export type RequestTerminationMessage = (
cb: (success: boolean) => void,
) => void;