/** * @license * Copyright 2025 Qwen * SPDX-License-Identifier: Apache-2.0 */ import type { SubAgentEventEmitter } from '@3-/qwen-code-core'; import type { SessionContext } from './types.js'; import type * as acp from '../acp.js'; /** * Tracks and emits events for sub-agent tool calls within TaskTool execution. * * Uses the unified ToolCallEmitter for consistency with normal flow * and history replay. Also handles permission requests for tools that * require user approval. */ export declare class SubAgentTracker { private readonly ctx; private readonly client; private readonly toolCallEmitter; private readonly toolStates; constructor(ctx: SessionContext, client: acp.Client); /** * Sets up event listeners for a sub-agent's tool events. * * @param eventEmitter - The SubAgentEventEmitter from TaskTool * @param abortSignal - Signal to abort tracking if parent is cancelled * @returns Array of cleanup functions to remove listeners */ setup(eventEmitter: SubAgentEventEmitter, abortSignal: AbortSignal): Array<() => void>; /** * Creates a handler for tool call start events. */ private createToolCallHandler; /** * Creates a handler for tool result events. */ private createToolResultHandler; /** * Creates a handler for tool approval request events. */ private createApprovalHandler; /** * Converts confirmation details to permission options for the client. */ private toPermissionOptions; }