mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat: subagent runtime & CLI display - wip
This commit is contained in:
33
packages/core/src/subagents/subagent-hooks.ts
Normal file
33
packages/core/src/subagents/subagent-hooks.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
export interface PreToolUsePayload {
|
||||
subagentId: string;
|
||||
name: string; // subagent name
|
||||
toolName: string;
|
||||
args: Record<string, unknown>;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface PostToolUsePayload extends PreToolUsePayload {
|
||||
success: boolean;
|
||||
durationMs: number;
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export interface SubagentStopPayload {
|
||||
subagentId: string;
|
||||
name: string; // subagent name
|
||||
terminateReason: string;
|
||||
summary: Record<string, unknown>;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface SubagentHooks {
|
||||
preToolUse?(payload: PreToolUsePayload): Promise<void> | void;
|
||||
postToolUse?(payload: PostToolUsePayload): Promise<void> | void;
|
||||
onStop?(payload: SubagentStopPayload): Promise<void> | void;
|
||||
}
|
||||
Reference in New Issue
Block a user