feat: add tool status management and localization for skill installation
- Updated chat message types to include tool statuses. - Enhanced localization files for English, Thai, and Chinese to support new tool status messages. - Modified HomePage and SkillsPage components to handle tool statuses in chat messages. - Implemented tool status merging and updating logic in the chat store. - Added handling for tool status events in the gateway event processing. - Created tests for chat message rendering with tool statuses and skill installation shortcuts. - Improved gateway event dispatching for tool lifecycle events.
This commit is contained in:
@@ -5,7 +5,10 @@ export type RuntimeRefreshTopic =
|
||||
| 'models'
|
||||
| 'agents'
|
||||
| 'channels'
|
||||
| 'channel-targets';
|
||||
| 'channel-targets'
|
||||
| 'skills';
|
||||
|
||||
export type GatewayToolStatus = 'running' | 'completed' | 'error';
|
||||
|
||||
/// Gateway 向 Renderer 推送的事件类型
|
||||
export type GatewayEvent =
|
||||
@@ -32,6 +35,19 @@ export type GatewayEvent =
|
||||
sessionKey: string;
|
||||
runId: string;
|
||||
}
|
||||
| {
|
||||
type: 'tool:status';
|
||||
sessionKey: string;
|
||||
runId: string;
|
||||
toolName: string;
|
||||
status: GatewayToolStatus;
|
||||
updatedAt: number;
|
||||
toolCallId?: string;
|
||||
summary?: string;
|
||||
durationMs?: number;
|
||||
input?: unknown;
|
||||
result?: unknown;
|
||||
}
|
||||
| {
|
||||
type: 'gateway:status';
|
||||
status: 'connected' | 'disconnected' | 'reconnecting';
|
||||
@@ -73,6 +89,16 @@ export interface GatewayRpcParams {
|
||||
skillKey: string;
|
||||
enabled?: boolean;
|
||||
};
|
||||
'skills.install': {
|
||||
kind: 'marketplace';
|
||||
slug: string;
|
||||
version?: string;
|
||||
force?: boolean;
|
||||
} | {
|
||||
kind: 'github-url';
|
||||
url: string;
|
||||
force?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/// Gateway RPC 方法返回值映射
|
||||
@@ -103,4 +129,11 @@ export interface GatewayRpcReturns {
|
||||
}>;
|
||||
};
|
||||
'skills.update': { success: boolean };
|
||||
'skills.install': {
|
||||
success: true;
|
||||
slug: string;
|
||||
baseDir: string;
|
||||
source: 'marketplace' | 'github-url';
|
||||
enabled: true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user