fix(team): resolve TypeScript errors in team collaboration module

- Remove unused imports and variables in Team components
- Fix CollaborationEvent type import in useTeamEvents
- Add proper type guards for Hand status in gatewayStore
- Fix Session status type compatibility in gateway-client
- Remove unused getGatewayClient import from teamStore
- Handle unknown payload types in TeamCollaborationView

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-15 09:20:58 +08:00
parent 4802eb7d6a
commit fc30290b1c
9 changed files with 93 additions and 47 deletions

View File

@@ -967,12 +967,42 @@ export class GatewayClient {
// === OpenFang Hands API ===
/** List available Hands */
async listHands(): Promise<{ hands: { id: string; name: string; description: string; status: string; requirements_met?: boolean; category?: string }[] }> {
async listHands(): Promise<{
hands: {
id?: string;
name: string;
description?: string;
status?: string;
requirements_met?: boolean;
category?: string;
icon?: string;
tool_count?: number;
tools?: string[];
metric_count?: number;
metrics?: string[];
}[]
}> {
return this.restGet('/api/hands');
}
/** Get Hand details */
async getHand(name: string): Promise<{ name: string; description: string; config: Record<string, unknown> }> {
async getHand(name: string): Promise<{
id?: string;
name?: string;
description?: string;
status?: string;
requirements_met?: boolean;
category?: string;
icon?: string;
provider?: string;
model?: string;
requirements?: { description?: string; name?: string; met?: boolean; satisfied?: boolean; details?: string; hint?: string }[];
tools?: string[];
metrics?: string[];
config?: Record<string, unknown>;
tool_count?: number;
metric_count?: number;
}> {
return this.restGet(`/api/hands/${name}`);
}
@@ -1097,7 +1127,7 @@ export class GatewayClient {
created_at: string;
updated_at?: string;
message_count?: number;
status?: string;
status?: 'active' | 'archived' | 'expired';
}>;
}> {
const params = new URLSearchParams();
@@ -1113,7 +1143,7 @@ export class GatewayClient {
created_at: string;
updated_at?: string;
message_count?: number;
status?: string;
status?: 'active' | 'archived' | 'expired';
metadata?: Record<string, unknown>;
}> {
return this.restGet(`/api/sessions/${sessionId}`);