* Background task runtime protocol (C5 §6.5 of the deferred-feature guide).
* Mirrors the legacy upstream LocalShellTask behaviour (T1-T11).
*/
export type PilotDeckBackgroundTaskStatus =
| "pending"
| "running"
| "completed"
| "failed"
| "cancelled";
export type PilotDeckBackgroundTaskKind = "bash" | "monitor";
* State envelope for a single background bash task. The shape is a strict
* superset of legacy `LocalShellTaskState` for the fields PilotDeck actually
* uses; legacy-only "task" classes (`local_agent`, `remote`) are not part of
* this PR (D-tier).
*/
export type PilotDeckBackgroundBashTask = {
taskId: string;
type: "local_bash";
agentId?: string;
kind: PilotDeckBackgroundTaskKind;
command: string;
cwd: string;
pid?: number;
status: PilotDeckBackgroundTaskStatus;
exitCode?: number | null;
completionStatusSentInAttachment: boolean;
lastReportedTotalLines: number;
isBackgrounded: boolean;
interrupted: boolean;
startedAt: Date;
endedAt?: Date;
outputBytes: number;
};
export type PilotDeckTaskOutputSlice = {
content: string;
nextOffset: number;
totalBytes: number;
truncated: boolean;
};
export type PilotDeckBackgroundTaskListFilter = {
agentId?: string;
status?: PilotDeckBackgroundTaskStatus | PilotDeckBackgroundTaskStatus[];
kind?: PilotDeckBackgroundTaskKind;
};