shine-code-submit 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -114,3 +114,53 @@ export interface CommitsResponse {
114
114
  commits: CommitLog[];
115
115
  error?: string;
116
116
  }
117
+
118
+ // ---- GET /api/report:数据上报页用的跨项目聚合 ----
119
+
120
+ /** 报告里单个会话的 token 明细。tokenTotal 读不到 transcript 为 null。 */
121
+ export interface ReportSession {
122
+ sessionId: string;
123
+ lastActive: number;
124
+ tokenTotal: TokenUsage | null;
125
+ }
126
+
127
+ /** 报告里单项目的提交汇总(窗口内)。 */
128
+ export interface ReportProjectCommits {
129
+ count: number;
130
+ added: number;
131
+ deleted: number;
132
+ lastTime: number | null; // 最近提交时间(ms),无提交 null
133
+ }
134
+
135
+ /** 报告里单个项目(=cwd)的聚合行。 */
136
+ export interface ReportProject {
137
+ cwd: string;
138
+ name: string; // shortDir(cwd),展示用
139
+ gitUser: string | null; // git config user.name
140
+ sessionCount: number;
141
+ sessions: ReportSession[]; // 每会话 token 明细
142
+ totalTokens: TokenUsage; // 该项目 token 合计
143
+ commits: ReportProjectCommits;
144
+ recentCommits: CommitLog[]; // 最近若干条(展示用,限 5)
145
+ gitError?: string;
146
+ }
147
+
148
+ /** 报告全局合计。 */
149
+ export interface ReportTotals {
150
+ projects: number;
151
+ sessions: number;
152
+ tokens: TokenUsage;
153
+ commitCount: number;
154
+ added: number;
155
+ deleted: number;
156
+ }
157
+
158
+ /** GET /api/report 响应。 */
159
+ export interface ReportResponse {
160
+ version: string;
161
+ generatedAt: number;
162
+ since: number; // 统计窗口起点(ms),0=全部
163
+ gitUser: string | null; // 全局代表(首个有 user.name 的项目)
164
+ projects: ReportProject[];
165
+ totals: ReportTotals;
166
+ }