This repository has been archived on 2026-05-15. You can view files and clone it, but cannot push or open issues or pull requests.
pi-fanout/types.ts

70 lines
1.3 KiB
TypeScript

export interface JobUsage {
input: number;
output: number;
cacheRead: number;
cacheWrite: number;
cost: number;
turns: number;
}
export interface FanoutJob {
id: string;
createdAt: number;
agent: string;
agentSource: "user" | "project" | "unknown";
task: string;
cwd: string;
model?: string;
tools?: string[];
status: "queued" | "running" | "done" | "failed" | "aborted";
pid?: number;
exitCode?: number;
outputFile: string;
metaFile: string;
notified: boolean;
errorMessage?: string;
usage: JobUsage;
modelUsed?: string;
stopReason?: string;
/** Last assistant text output seen while running (for live previews) */
lastPreview?: string;
}
export interface DispatchResult {
jobId: string;
status: "queued" | "running";
message: string;
}
export interface StatusResult {
jobs: Array<{
id: string;
status: FanoutJob["status"];
agent: string;
task: string;
exitCode?: number;
pid?: number;
turns?: number;
cost?: number;
preview?: string;
}>;
}
export interface CollectResult {
results: Array<{
id: string;
status: FanoutJob["status"];
output: string;
exitCode?: number;
usage: JobUsage;
modelUsed?: string;
errorMessage?: string;
}>;
}
export interface AbortResult {
aborted: string[];
notFound: string[];
alreadyDone: string[];
}