37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
|
|
/**
|
||
|
|
* Browser-safe background-task domain contract. The registry's live records
|
||
|
|
* never cross the wire; a view is the subset a human list needs, minted fresh
|
||
|
|
* per push.
|
||
|
|
*/
|
||
|
|
|
||
|
|
import type { TaskId } from '@deepseek-ai/dsh-tasks/brand'
|
||
|
|
|
||
|
|
/**
|
||
|
|
* One background task as the client sees it.
|
||
|
|
*
|
||
|
|
* Three registry fields are deliberately absent. `ownerSession` is redundant
|
||
|
|
* beside the frame's own `sessionId`; `reported` is an internal notice-delivery
|
||
|
|
* bit with no user meaning; `outputLimitBytes` is producer-owned model
|
||
|
|
* presentation policy that never reaches a human surface.
|
||
|
|
*/
|
||
|
|
export interface TaskView {
|
||
|
|
/** Registry-issued `<kind>-N` identity, stable for the task's whole life. */
|
||
|
|
id: TaskId
|
||
|
|
/**
|
||
|
|
* Producer kind (`bash`, `pwsh`, `pty-send`, `subagent`, …). Kept as a bare
|
||
|
|
* string because producer plugins extend the kind map by declaration merging,
|
||
|
|
* so no client build can enumerate the closed set.
|
||
|
|
*/
|
||
|
|
kind: string
|
||
|
|
/** Producer-supplied one-line label: the command, or the delegation description. */
|
||
|
|
label: string
|
||
|
|
/** Current lifecycle state. */
|
||
|
|
status: 'running' | 'stopping' | 'completed' | 'killed' | 'failed'
|
||
|
|
/** Kind-specific status detail ('exit code: 3'), present once the producer supplied one. */
|
||
|
|
detail?: string
|
||
|
|
/** Epoch ms when the task was registered. */
|
||
|
|
startedAt: number
|
||
|
|
/** Epoch ms when the task settled; absent while live. */
|
||
|
|
finishedAt?: number
|
||
|
|
}
|