/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { ITask, Usage } from "@workglow/task-graph"; export interface TaskUsageState { readonly usage: Usage | undefined; readonly modelId: string | undefined; } /** * Subscribes to a task's `usage` event and returns its running token total plus * the model id that produced it (when the provider named one). * * Deliberately does NOT clear on `stream_end` or completion, unlike the stream * text hook: streaming text is transient, but the final token count is the * result and stays on the row. */ export declare function useTaskUsage(task: ITask): TaskUsageState;