ccshare
Version:
Share Claude Code prompts and results easily
97 lines • 2.6 kB
TypeScript
import { HtmlData } from './html-generator.js';
import { SessionData, WorkflowItem } from './types.js';
export interface ShareData {
title: string;
createdAt: string;
sessionInfo: ShareSessionInfo;
techStack: ShareTechStack;
prompts: SharePrompt[];
fileDiffs: ShareFileDiff[];
metadata: ShareMetadata;
claudeMd?: string;
models?: string[];
mcpServers?: ShareMCPServer[];
toolStats?: ShareToolStats;
}
export interface ShareSessionInfo {
totalPrompts: number;
timeRange?: string;
sources?: string[];
projectPath?: string;
claudeProjectPath?: string;
}
export interface ShareTechStack {
languages: string[];
frameworks: string[];
tools: string[];
databases: string[];
}
export interface SharePrompt {
id: number;
content: string;
timestamp: string;
sourceFile?: string;
usage?: {
input_tokens?: number;
output_tokens?: number;
cache_creation_input_tokens?: number;
cache_read_input_tokens?: number;
total_tokens?: number;
};
responseTimeMs?: number;
isAutoGenerated?: boolean;
model?: string;
toolCalls?: string[];
workflow?: WorkflowItem[];
}
export interface ShareMCPServer {
name: string;
tools: string[];
callCount: number;
}
export interface ShareToolStats {
totalCalls: number;
byTool: {
[toolName: string]: number;
};
mcpCalls: number;
regularCalls: number;
}
export interface ShareFileDiff {
path: string;
diff: string;
additions?: number;
deletions?: number;
}
export interface ShareMetadata {
generatedBy: string;
version: string;
platform: string;
nodeVersion?: string;
claudeSettings?: {
permissions?: string[];
model?: string;
};
sessionStats?: {
totalTokensUsed?: number;
averageResponseTime?: number;
totalToolCalls?: number;
errorCount?: number;
};
workingDirectory?: string;
claudeProjectPath?: string;
}
export interface ShareResponse {
id?: string;
url?: string;
message?: string;
error?: string;
}
export declare function transformToShareData(htmlData: HtmlData, sessionData: SessionData): ShareData;
export declare function shareToAPIRaw(data: any, apiUrl: string): Promise<{
url?: string;
error?: string;
}>;
export declare function shareToAPI(shareData: ShareData, apiUrl?: string): Promise<ShareResponse>;
export declare function fetchFromSlug(slug: string, apiUrl?: string): Promise<ShareData | null>;
//# sourceMappingURL=share-service.d.ts.map