refactor(core): alias BackgroundTaskStatus to TaskStatus

The local `BackgroundTaskStatus` union was byte-identical to the new
shared `TaskStatus` defined in `tasks/types.ts`. Replace it with a
`@deprecated` type alias so external consumers (notably
`nonInteractiveCli.ts`) keep compiling unchanged while the canonical
name lives in one place.
This commit is contained in:
tanzhenxin 2026-05-12 16:10:29 +08:00
parent d98565ad23
commit 91b59a8fb9

View file

@ -25,7 +25,7 @@ import { createDebugLogger } from '../utils/debugLogger.js';
import { escapeXml } from '../utils/xml.js';
import { patchAgentMeta } from './agent-transcript.js';
import type { AgentExternalInput } from './runtime/agent-types.js';
import type { TaskBase, TaskRegistration } from './tasks/types.js';
import type { TaskBase, TaskRegistration, TaskStatus } from './tasks/types.js';
const debugLogger = createDebugLogger('BACKGROUND_TASKS');
@ -77,12 +77,12 @@ export function buildBackgroundEntryLabel(
// envelope early and forge sibling tags (e.g. a faked <status>) that the
// parent model would treat as trusted metadata. Use the shared helper.
export type BackgroundTaskStatus =
| 'running'
| 'paused'
| 'completed'
| 'failed'
| 'cancelled';
/**
* @deprecated Use `TaskStatus` from `./tasks/types.js`. Kept as a one-release
* alias so existing consumers (notably `nonInteractiveCli.ts`) compile
* unchanged; the underlying union is identical.
*/
export type BackgroundTaskStatus = TaskStatus;
export interface AgentCompletionStats {
totalTokens: number;