feat: Implement team artifacts feature with tree navigation and file preview

This commit is contained in:
catlog22
2026-02-15 18:14:07 +08:00
parent 0d56396710
commit 4ddd2e9f17
26 changed files with 1250 additions and 3038 deletions

View File

@@ -4,6 +4,7 @@
// Typed fetch functions for API communication with CSRF token handling
import type { SessionMetadata, TaskData, IndexStatus, IndexRebuildRequest, Rule, RuleCreateInput, RulesResponse, Prompt, PromptInsight, Pattern, Suggestion, McpTemplate, McpTemplateInstallRequest, AllProjectsResponse, OtherProjectsServersResponse, CrossCliCopyRequest, CrossCliCopyResponse } from '../types/store';
import type { TeamArtifactsResponse } from '../types/team';
// Re-export types for backward compatibility
export type { IndexStatus, IndexRebuildRequest, Rule, RuleCreateInput, RulesResponse, Prompt, PromptInsight, Pattern, Suggestion, McpTemplate, McpTemplateInstallRequest, AllProjectsResponse, OtherProjectsServersResponse, CrossCliCopyRequest, CrossCliCopyResponse };
@@ -6139,6 +6140,19 @@ export async function fetchTeamStatus(
return fetchApi(`/api/teams/${encodeURIComponent(teamName)}/status`);
}
export async function fetchTeamArtifacts(
teamName: string
): Promise<TeamArtifactsResponse> {
return fetchApi(`/api/teams/${encodeURIComponent(teamName)}/artifacts`);
}
export async function fetchArtifactContent(
teamName: string,
artifactPath: string
): Promise<{ content: string; contentType: string; path: string }> {
return fetchApi(`/api/teams/${encodeURIComponent(teamName)}/artifacts/${encodeURIComponent(artifactPath)}`);
}
// ========== CLI Sessions (PTY) API ==========
export interface CliSession {