@felan-ai/ext-insights 0.0.0
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.
- package/LICENSE +21 -0
- package/NOTICE +9 -0
- package/README.md +31 -0
- package/dist/analytics.d.ts +3 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +555 -0
- package/dist/analytics.js.map +1 -0
- package/dist/cli.d.ts +21 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +70 -0
- package/dist/cli.js.map +1 -0
- package/dist/contracts.d.ts +20 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -0
- package/dist/facets.d.ts +19 -0
- package/dist/facets.d.ts.map +1 -0
- package/dist/facets.js +60 -0
- package/dist/facets.js.map +1 -0
- package/dist/generated/report-app.d.ts +4 -0
- package/dist/generated/report-app.d.ts.map +1 -0
- package/dist/generated/report-app.js +5 -0
- package/dist/generated/report-app.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown.d.ts +3 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +169 -0
- package/dist/markdown.js.map +1 -0
- package/dist/parser.d.ts +3 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +309 -0
- package/dist/parser.js.map +1 -0
- package/dist/rage.d.ts +12 -0
- package/dist/rage.d.ts.map +1 -0
- package/dist/rage.js +35 -0
- package/dist/rage.js.map +1 -0
- package/dist/report-app/logo.d.ts +2 -0
- package/dist/report-app/logo.d.ts.map +1 -0
- package/dist/report-app/logo.js +2 -0
- package/dist/report-app/logo.js.map +1 -0
- package/dist/report-app/utils.d.ts +7 -0
- package/dist/report-app/utils.d.ts.map +1 -0
- package/dist/report-app/utils.js +60 -0
- package/dist/report-app/utils.js.map +1 -0
- package/dist/report.d.ts +3 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +7 -0
- package/dist/report.js.map +1 -0
- package/dist/types.d.ts +354 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +55 -0
package/dist/parser.js
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { detectRage } from "./rage.js";
|
|
3
|
+
const LANGUAGE_BY_EXTENSION = {
|
|
4
|
+
".ts": "TypeScript",
|
|
5
|
+
".tsx": "TypeScript",
|
|
6
|
+
".js": "JavaScript",
|
|
7
|
+
".jsx": "JavaScript",
|
|
8
|
+
".json": "JSON",
|
|
9
|
+
".md": "Markdown",
|
|
10
|
+
".py": "Python",
|
|
11
|
+
".go": "Go",
|
|
12
|
+
".rs": "Rust",
|
|
13
|
+
".css": "CSS",
|
|
14
|
+
".html": "HTML",
|
|
15
|
+
".sql": "SQL",
|
|
16
|
+
};
|
|
17
|
+
export function parseSessionTranscript(content, sourceId) {
|
|
18
|
+
try {
|
|
19
|
+
let sessionId = "";
|
|
20
|
+
let cwd = "";
|
|
21
|
+
let startTime = null;
|
|
22
|
+
let endTime = null;
|
|
23
|
+
let userMessages = 0;
|
|
24
|
+
let assistantMessages = 0;
|
|
25
|
+
let toolCallCount = 0;
|
|
26
|
+
let toolCallErrors = 0;
|
|
27
|
+
let totalInput = 0;
|
|
28
|
+
let totalOutput = 0;
|
|
29
|
+
let totalCacheRead = 0;
|
|
30
|
+
let totalCacheWrite = 0;
|
|
31
|
+
let totalTokens = 0;
|
|
32
|
+
let totalCost = 0;
|
|
33
|
+
let costInput = 0;
|
|
34
|
+
let costOutput = 0;
|
|
35
|
+
let costCacheRead = 0;
|
|
36
|
+
let costCacheWrite = 0;
|
|
37
|
+
const models = {};
|
|
38
|
+
const providers = {};
|
|
39
|
+
const thinkingLevels = {};
|
|
40
|
+
const toolUsage = {};
|
|
41
|
+
const stopReasons = {};
|
|
42
|
+
let currentModel = "unknown";
|
|
43
|
+
const rageHits = [];
|
|
44
|
+
const responseTimesMs = [];
|
|
45
|
+
const activityByHour = {};
|
|
46
|
+
const filesMentioned = new Set();
|
|
47
|
+
const languageCounts = {};
|
|
48
|
+
const toolErrorsByName = {};
|
|
49
|
+
const gitActivity = { commits: 0, pushes: 0, statusChecks: 0, diffs: 0 };
|
|
50
|
+
let lastUserMessageAt = null;
|
|
51
|
+
let userInterruptions = 0;
|
|
52
|
+
for (const line of content.split(/\r?\n/u)) {
|
|
53
|
+
if (!line.trim())
|
|
54
|
+
continue;
|
|
55
|
+
try {
|
|
56
|
+
const event = JSON.parse(line);
|
|
57
|
+
if (!startTime && event.timestamp)
|
|
58
|
+
startTime = new Date(event.timestamp);
|
|
59
|
+
if (event.timestamp)
|
|
60
|
+
endTime = new Date(event.timestamp);
|
|
61
|
+
const eventTime = event.timestamp ? new Date(event.timestamp) : null;
|
|
62
|
+
if (eventTime && event.type === "message") {
|
|
63
|
+
const hour = String(eventTime.getHours());
|
|
64
|
+
activityByHour[hour] = (activityByHour[hour] ?? 0) + 1;
|
|
65
|
+
}
|
|
66
|
+
if (event.type === "interrupt" || event.type === "user_interrupt" || event.type === "abort") {
|
|
67
|
+
userInterruptions++;
|
|
68
|
+
}
|
|
69
|
+
if (event.type === "session" || event.type === "session_info") {
|
|
70
|
+
const data = event;
|
|
71
|
+
if (data.id)
|
|
72
|
+
sessionId = data.id;
|
|
73
|
+
if (data.cwd)
|
|
74
|
+
cwd = data.cwd;
|
|
75
|
+
}
|
|
76
|
+
if (event.type === "model_change") {
|
|
77
|
+
const data = event;
|
|
78
|
+
if (data.modelId) {
|
|
79
|
+
models[data.modelId] = models[data.modelId] ?? { count: 0, tokens: 0, cost: 0 };
|
|
80
|
+
models[data.modelId].count++;
|
|
81
|
+
currentModel = data.modelId;
|
|
82
|
+
}
|
|
83
|
+
if (data.provider) {
|
|
84
|
+
providers[data.provider] = (providers[data.provider] ?? 0) + 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (event.type === "thinking_level_change") {
|
|
88
|
+
const data = event;
|
|
89
|
+
if (data.thinkingLevel) {
|
|
90
|
+
thinkingLevels[data.thinkingLevel] = (thinkingLevels[data.thinkingLevel] ?? 0) + 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (event.type === "message") {
|
|
94
|
+
const msg = event.message;
|
|
95
|
+
if (msg.role === "user") {
|
|
96
|
+
userMessages++;
|
|
97
|
+
lastUserMessageAt = eventTime;
|
|
98
|
+
// Collect rage hits with the message index for accurate per-message dedup
|
|
99
|
+
const textParts = [];
|
|
100
|
+
if (msg.content) {
|
|
101
|
+
for (const item of msg.content) {
|
|
102
|
+
if (item.type === "text" && item.text)
|
|
103
|
+
textParts.push(item.text);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const text = textParts.join(" ");
|
|
107
|
+
if (text) {
|
|
108
|
+
const hour = event.timestamp ? new Date(event.timestamp).getHours() : -1;
|
|
109
|
+
for (const hit of detectRage(text)) {
|
|
110
|
+
rageHits.push({ ...hit, hour, model: currentModel, msgIndex: userMessages });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else if (msg.role === "assistant") {
|
|
115
|
+
assistantMessages++;
|
|
116
|
+
if (eventTime && lastUserMessageAt) {
|
|
117
|
+
responseTimesMs.push(Math.max(0, eventTime.getTime() - lastUserMessageAt.getTime()));
|
|
118
|
+
lastUserMessageAt = null;
|
|
119
|
+
}
|
|
120
|
+
if (msg.usage) {
|
|
121
|
+
const input = msg.usage.input ?? 0;
|
|
122
|
+
const output = msg.usage.output ?? 0;
|
|
123
|
+
const cacheRead = msg.usage.cacheRead ?? 0;
|
|
124
|
+
const cacheWrite = msg.usage.cacheWrite ?? 0;
|
|
125
|
+
const tokens = msg.usage.totalTokens ?? (input + output + cacheRead);
|
|
126
|
+
const cost = msg.usage.cost?.total ?? 0;
|
|
127
|
+
totalInput += input;
|
|
128
|
+
totalOutput += output;
|
|
129
|
+
totalCacheRead += cacheRead;
|
|
130
|
+
totalCacheWrite += cacheWrite;
|
|
131
|
+
totalTokens += tokens;
|
|
132
|
+
totalCost += cost;
|
|
133
|
+
costInput += msg.usage.cost?.input ?? 0;
|
|
134
|
+
costOutput += msg.usage.cost?.output ?? 0;
|
|
135
|
+
costCacheRead += msg.usage.cost?.cacheRead ?? 0;
|
|
136
|
+
costCacheWrite += msg.usage.cost?.cacheWrite ?? 0;
|
|
137
|
+
if (msg.model) {
|
|
138
|
+
models[msg.model] = models[msg.model] ?? { count: 0, tokens: 0, cost: 0 };
|
|
139
|
+
models[msg.model].tokens += tokens;
|
|
140
|
+
models[msg.model].cost += cost;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (msg.stopReason) {
|
|
144
|
+
stopReasons[msg.stopReason] = (stopReasons[msg.stopReason] ?? 0) + 1;
|
|
145
|
+
if (msg.stopReason.toLowerCase().includes("interrupt"))
|
|
146
|
+
userInterruptions++;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (msg.content) {
|
|
150
|
+
for (const item of msg.content) {
|
|
151
|
+
if (item.type === "toolCall" && item.name) {
|
|
152
|
+
toolCallCount++;
|
|
153
|
+
toolUsage[item.name] = (toolUsage[item.name] ?? 0) + 1;
|
|
154
|
+
collectToolSignals(item.name, [item.input, item.args, item.arguments], filesMentioned, languageCounts, gitActivity);
|
|
155
|
+
}
|
|
156
|
+
if (item.type === "toolResult" && item.isError) {
|
|
157
|
+
toolCallErrors++;
|
|
158
|
+
recordToolError(toolErrorsByName, item.name);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (msg.toolCalls) {
|
|
163
|
+
toolCallCount += msg.toolCalls.length;
|
|
164
|
+
for (const tc of msg.toolCalls) {
|
|
165
|
+
if (tc.name) {
|
|
166
|
+
toolUsage[tc.name] = (toolUsage[tc.name] ?? 0) + 1;
|
|
167
|
+
collectToolSignals(tc.name, [tc.input, tc.args, tc.arguments], filesMentioned, languageCounts, gitActivity);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (msg.toolResults) {
|
|
172
|
+
for (const tr of msg.toolResults) {
|
|
173
|
+
if (tr.isError) {
|
|
174
|
+
toolCallErrors++;
|
|
175
|
+
recordToolError(toolErrorsByName, tr.name);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
// Skip malformed lines
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (!startTime)
|
|
186
|
+
return null;
|
|
187
|
+
if (!endTime)
|
|
188
|
+
endTime = startTime;
|
|
189
|
+
const duration = Math.max(1, Math.round((endTime.getTime() - startTime.getTime()) / 60000));
|
|
190
|
+
const projectName = cwd ? portableBasename(cwd) : "unknown";
|
|
191
|
+
const primaryModel = getPrimaryModel(models, currentModel);
|
|
192
|
+
const avgResponseTimeMs = responseTimesMs.length > 0
|
|
193
|
+
? Math.round(responseTimesMs.reduce((sum, value) => sum + value, 0) / responseTimesMs.length)
|
|
194
|
+
: 0;
|
|
195
|
+
return {
|
|
196
|
+
id: sessionId || portableBasename(sourceId).replace(/\.jsonl$/iu, ""),
|
|
197
|
+
cwd,
|
|
198
|
+
projectName,
|
|
199
|
+
startTime,
|
|
200
|
+
endTime,
|
|
201
|
+
duration,
|
|
202
|
+
messageCount: userMessages + assistantMessages,
|
|
203
|
+
userMessageCount: userMessages,
|
|
204
|
+
assistantMessageCount: assistantMessages,
|
|
205
|
+
toolCallCount,
|
|
206
|
+
tokenUsage: { input: totalInput, output: totalOutput, cacheRead: totalCacheRead, cacheWrite: totalCacheWrite, total: totalTokens },
|
|
207
|
+
cost: { input: costInput, output: costOutput, cacheRead: costCacheRead, cacheWrite: costCacheWrite, total: totalCost },
|
|
208
|
+
models,
|
|
209
|
+
providers,
|
|
210
|
+
thinkingLevels,
|
|
211
|
+
toolUsage,
|
|
212
|
+
stopReasons,
|
|
213
|
+
toolCallErrors,
|
|
214
|
+
hasError: toolCallErrors > 0,
|
|
215
|
+
rageHits,
|
|
216
|
+
metadata: {
|
|
217
|
+
primaryModel,
|
|
218
|
+
responseTimesMs,
|
|
219
|
+
avgResponseTimeMs,
|
|
220
|
+
...(responseTimesMs[0] === undefined ? {} : { firstResponseTimeMs: responseTimesMs[0] }),
|
|
221
|
+
activityByHour,
|
|
222
|
+
filesMentioned: Array.from(filesMentioned).sort(),
|
|
223
|
+
languageCounts,
|
|
224
|
+
gitActivity,
|
|
225
|
+
toolErrorsByName,
|
|
226
|
+
userInterruptions,
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function portableBasename(value) {
|
|
235
|
+
return value.replace(/[\\/]+$/u, "").split(/[\\/]/u).pop() || value;
|
|
236
|
+
}
|
|
237
|
+
function collectToolSignals(toolName, inputs, filesMentioned, languageCounts, gitActivity) {
|
|
238
|
+
for (const input of inputs) {
|
|
239
|
+
for (const filePath of extractFilePaths(input)) {
|
|
240
|
+
filesMentioned.add(filePath);
|
|
241
|
+
const language = languageForPath(filePath);
|
|
242
|
+
if (language)
|
|
243
|
+
languageCounts[language] = (languageCounts[language] ?? 0) + 1;
|
|
244
|
+
}
|
|
245
|
+
if (toolName.toLowerCase() === "bash") {
|
|
246
|
+
const command = extractCommand(input);
|
|
247
|
+
if (command)
|
|
248
|
+
recordGitActivity(command, gitActivity);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function extractFilePaths(value, key = "") {
|
|
253
|
+
if (typeof value === "string") {
|
|
254
|
+
return isPathKey(key) ? normalizeFilePath(value) : [];
|
|
255
|
+
}
|
|
256
|
+
if (Array.isArray(value)) {
|
|
257
|
+
return value.flatMap(item => extractFilePaths(item, key));
|
|
258
|
+
}
|
|
259
|
+
if (!value || typeof value !== "object")
|
|
260
|
+
return [];
|
|
261
|
+
return Object.entries(value).flatMap(([childKey, childValue]) => {
|
|
262
|
+
if (childKey === "command")
|
|
263
|
+
return [];
|
|
264
|
+
return extractFilePaths(childValue, childKey);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function extractCommand(value) {
|
|
268
|
+
if (!value || typeof value !== "object")
|
|
269
|
+
return undefined;
|
|
270
|
+
const command = value.command;
|
|
271
|
+
return typeof command === "string" ? command : undefined;
|
|
272
|
+
}
|
|
273
|
+
function normalizeFilePath(value) {
|
|
274
|
+
if (value.includes("\n") || value.length > 500)
|
|
275
|
+
return [];
|
|
276
|
+
const trimmed = value.trim();
|
|
277
|
+
if (!trimmed || !path.extname(trimmed))
|
|
278
|
+
return [];
|
|
279
|
+
return [trimmed];
|
|
280
|
+
}
|
|
281
|
+
function isPathKey(key) {
|
|
282
|
+
return /^(path|file|files|filePath|file_path|notebook_path|outputPath|output_path)$/i.test(key);
|
|
283
|
+
}
|
|
284
|
+
function languageForPath(filePath) {
|
|
285
|
+
return LANGUAGE_BY_EXTENSION[path.extname(filePath).toLowerCase()];
|
|
286
|
+
}
|
|
287
|
+
function recordGitActivity(command, gitActivity) {
|
|
288
|
+
if (/\bgit\s+commit\b/.test(command))
|
|
289
|
+
gitActivity.commits++;
|
|
290
|
+
if (/\bgit\s+push\b/.test(command))
|
|
291
|
+
gitActivity.pushes++;
|
|
292
|
+
if (/\bgit\s+status\b/.test(command))
|
|
293
|
+
gitActivity.statusChecks++;
|
|
294
|
+
if (/\bgit\s+diff\b/.test(command))
|
|
295
|
+
gitActivity.diffs++;
|
|
296
|
+
}
|
|
297
|
+
function recordToolError(toolErrorsByName, toolName) {
|
|
298
|
+
const key = toolName || "unknown";
|
|
299
|
+
toolErrorsByName[key] = (toolErrorsByName[key] ?? 0) + 1;
|
|
300
|
+
}
|
|
301
|
+
function getPrimaryModel(models, fallback) {
|
|
302
|
+
const [primary] = Object.entries(models).sort(([, a], [, b]) => {
|
|
303
|
+
if (b.tokens !== a.tokens)
|
|
304
|
+
return b.tokens - a.tokens;
|
|
305
|
+
return b.count - a.count;
|
|
306
|
+
});
|
|
307
|
+
return primary?.[0] ?? fallback;
|
|
308
|
+
}
|
|
309
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,qBAAqB,GAA2B;IACpD,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,OAAe,EAAE,QAAgB;IACtE,IAAI,CAAC;QACH,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,SAAS,GAAgB,IAAI,CAAC;QAClC,IAAI,OAAO,GAAgB,IAAI,CAAC;QAChC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,IAAI,iBAAiB,GAAG,CAAC,CAAC;QAC1B,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,IAAI,cAAc,GAAG,CAAC,CAAC;QACvB,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,IAAI,cAAc,GAAG,CAAC,CAAC;QACvB,IAAI,eAAe,GAAG,CAAC,CAAC;QACxB,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,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AI,CAAC,OAAO,CAAC;QAAE,WAAW,CAAC,YAAY,EAAE,CAAC;IACjE,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,WAAW,CAAC,KAAK,EAAE,CAAC;AAC1D,CAAC;AAED,SAAS,eAAe,CAAC,gBAAwC,EAAE,QAAiB;IAClF,MAAM,GAAG,GAAG,QAAQ,IAAI,SAAS,CAAC;IAClC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,eAAe,CAAC,MAA+B,EAAE,QAAgB;IACxE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QAC7D,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtD,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;AAClC,CAAC"}
|
package/dist/rage.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RageWordEntry {
|
|
2
|
+
word: string;
|
|
3
|
+
group: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RageMatch {
|
|
6
|
+
word: string;
|
|
7
|
+
group: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const RAGE_WORDLIST: RageWordEntry[];
|
|
10
|
+
export declare function detectRage(text: string): RageMatch[];
|
|
11
|
+
export declare function wordCount(): number;
|
|
12
|
+
//# sourceMappingURL=rage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rage.d.ts","sourceRoot":"","sources":["../src/rage.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,aAAa,EAmBxC,CAAC;AAWF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAOpD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
|
package/dist/rage.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const RAGE_WORDLIST = [
|
|
2
|
+
{ word: "fuck", group: "fuck" }, { word: "fucking", group: "fuck" },
|
|
3
|
+
{ word: "fucked", group: "fuck" }, { word: "fucker", group: "fuck" },
|
|
4
|
+
{ word: "motherfucker", group: "fuck" }, { word: "clusterfuck", group: "fuck" },
|
|
5
|
+
{ word: "fuckup", group: "fuck" }, { word: "bullshit", group: "shit" },
|
|
6
|
+
{ word: "shit", group: "shit" }, { word: "shitty", group: "shit" },
|
|
7
|
+
{ word: "shithead", group: "shit" }, { word: "shithole", group: "shit" },
|
|
8
|
+
{ word: "asshole", group: "ass" }, { word: "jackass", group: "ass" },
|
|
9
|
+
{ word: "dumbass", group: "ass" }, { word: "ass", group: "ass" },
|
|
10
|
+
{ word: "goddamn", group: "damn" }, { word: "goddammit", group: "damn" },
|
|
11
|
+
{ word: "dammit", group: "damn" }, { word: "damn", group: "damn" },
|
|
12
|
+
{ word: "bitches", group: "bitch" }, { word: "bitch", group: "bitch" },
|
|
13
|
+
{ word: "bastard", group: "bastard" },
|
|
14
|
+
{ word: "pissed", group: "piss" }, { word: "piss", group: "piss" },
|
|
15
|
+
{ word: "dickhead", group: "dick" }, { word: "dick", group: "dick" },
|
|
16
|
+
{ word: "crappy", group: "crap" }, { word: "crap", group: "crap" },
|
|
17
|
+
{ word: "hell", group: "hell" },
|
|
18
|
+
{ word: "wtf", group: "wtf" }, { word: "stfu", group: "stfu" },
|
|
19
|
+
{ word: "cunt", group: "cunt" },
|
|
20
|
+
];
|
|
21
|
+
const PATTERN = new RegExp(`\\b(${RAGE_WORDLIST.map(w => w.word).join("|")})\\b`, "gi");
|
|
22
|
+
const WORD_MAP = new Map(RAGE_WORDLIST.map(w => [w.word.toLowerCase(), w.group]));
|
|
23
|
+
export function detectRage(text) {
|
|
24
|
+
const hits = [];
|
|
25
|
+
for (const m of text.toLowerCase().matchAll(PATTERN)) {
|
|
26
|
+
const group = WORD_MAP.get(m[0]);
|
|
27
|
+
if (group)
|
|
28
|
+
hits.push({ word: m[0], group });
|
|
29
|
+
}
|
|
30
|
+
return hits;
|
|
31
|
+
}
|
|
32
|
+
export function wordCount() {
|
|
33
|
+
return RAGE_WORDLIST.length;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=rage.js.map
|
package/dist/rage.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rage.js","sourceRoot":"","sources":["../src/rage.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,aAAa,GAAoB;IAC5C,EAAE,IAAI,EAAE,MAAM,EAAU,KAAK,EAAE,MAAM,EAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAO,KAAK,EAAE,MAAM,EAAK;IACtF,EAAE,IAAI,EAAE,QAAQ,EAAQ,KAAK,EAAE,MAAM,EAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAQ,KAAK,EAAE,MAAM,EAAK;IACtF,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAG,KAAK,EAAE,MAAM,EAAK;IACtF,EAAE,IAAI,EAAE,QAAQ,EAAQ,KAAK,EAAE,MAAM,EAAK,EAAE,EAAE,IAAI,EAAE,UAA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const FELAN_LOGO = "<?xml version=\"1.0\"?>\n<svg version=\"1.0\" xmlns=\"http://www.w3.org/2000/svg\" width=\"250.000000pt\" height=\"258.000000pt\" viewBox=\"0 0 250.000000 258.000000\" preserveAspectRatio=\"xMidYMid meet\">\n<g transform=\"translate(0.000000,258.000000) scale(0.100000,-0.100000)\" fill=\"#255F44\" stroke=\"none\">\n<path d=\"M1116 2399 c-77 -11 -191 -43 -268 -74 -60 -24 -214 -110 -222 -124
-3 -4 13 -29 35 -56 56 -70 84 -166 75 -256 l-6 -69 62 51 c131 106 282 160
453 162 119 1 196 -17 310 -72 378 -183 516 -645 303 -1013 -75 -130 -209
-247 -347 -303 -411 -167 -883 92 -967 531 -26 137 -12 298 36 410 11 25 20
47 20 49 0 1 -28 -9 -62 -23 -78 -33 -197 -36 -268 -8 -25 9 -51 18 -59 19
-36 5 -68 -252 -52 -410 84 -820 1016 -1271 1695 -819 329 219 518 623 476
1017 -48 450 -323 809 -723 944 -145 48 -340 66 -491 44z\"></path>\n<path d=\"M285 2156 c-89 -41 -135 -115 -135 -213 1 -181 197 -290 350 -195
119 74 144 244 52 354 -35 41 -116 78 -172 78 -26 0 -66 -10 -95 -24z\"></path>\n<path d=\"M1160 1601 c-83 -25 -156 -98 -190 -187 -72 -192 71 -396 279 -396
312 0 403 435 118 568 -54 25 -151 32 -207 15z\"></path>\n</g>\n</svg>";
|
|
2
|
+
//# sourceMappingURL=logo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../src/report-app/logo.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,woCAA8mC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const FELAN_LOGO = '<?xml version="1.0"?>\n<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="250.000000pt" height="258.000000pt" viewBox="0 0 250.000000 258.000000" preserveAspectRatio="xMidYMid meet">\n<g transform="translate(0.000000,258.000000) scale(0.100000,-0.100000)" fill="#255F44" stroke="none">\n<path d="M1116 2399 c-77 -11 -191 -43 -268 -74 -60 -24 -214 -110 -222 -124
-3 -4 13 -29 35 -56 56 -70 84 -166 75 -256 l-6 -69 62 51 c131 106 282 160
453 162 119 1 196 -17 310 -72 378 -183 516 -645 303 -1013 -75 -130 -209
-247 -347 -303 -411 -167 -883 92 -967 531 -26 137 -12 298 36 410 11 25 20
47 20 49 0 1 -28 -9 -62 -23 -78 -33 -197 -36 -268 -8 -25 9 -51 18 -59 19
-36 5 -68 -252 -52 -410 84 -820 1016 -1271 1695 -819 329 219 518 623 476
1017 -48 450 -323 809 -723 944 -145 48 -340 66 -491 44z"></path>\n<path d="M285 2156 c-89 -41 -135 -115 -135 -213 1 -181 197 -290 350 -195
119 74 144 244 52 354 -35 41 -116 78 -172 78 -26 0 -66 -10 -95 -24z"></path>\n<path d="M1160 1601 c-83 -25 -156 -98 -190 -187 -72 -192 71 -396 279 -396
312 0 403 435 118 568 -54 25 -151 32 -207 15z"></path>\n</g>\n</svg>';
|
|
2
|
+
//# sourceMappingURL=logo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.js","sourceRoot":"","sources":["../../src/report-app/logo.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,2mCAA2mC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const formatNumber: (n: number) => string;
|
|
2
|
+
export declare const formatInteger: (n: number) => string;
|
|
3
|
+
export declare const formatDuration: (m: number) => string;
|
|
4
|
+
export declare const formatCost: (c: number) => string;
|
|
5
|
+
export declare const formatPercent: (ratio: number, maximumFractionDigits?: number) => string;
|
|
6
|
+
export declare const COLORS: string[];
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/report-app/utils.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MAIxC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,KAAG,MAGzC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,KAAG,MAI1C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,KAAG,MAWtC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,8BAAyB,KAAG,MAMxE,CAAC;AAEF,eAAO,MAAM,MAAM,UAMlB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const compactNumber = new Intl.NumberFormat('en-US', {
|
|
2
|
+
notation: 'compact',
|
|
3
|
+
maximumFractionDigits: 1,
|
|
4
|
+
});
|
|
5
|
+
const regularNumber = new Intl.NumberFormat('en-US', {
|
|
6
|
+
maximumFractionDigits: 2,
|
|
7
|
+
});
|
|
8
|
+
const integerNumber = new Intl.NumberFormat('en-US', {
|
|
9
|
+
maximumFractionDigits: 0,
|
|
10
|
+
});
|
|
11
|
+
export const formatNumber = (n) => {
|
|
12
|
+
if (!Number.isFinite(n))
|
|
13
|
+
return '—';
|
|
14
|
+
if (Math.abs(n) >= 1000)
|
|
15
|
+
return compactNumber.format(n);
|
|
16
|
+
return regularNumber.format(n);
|
|
17
|
+
};
|
|
18
|
+
export const formatInteger = (n) => {
|
|
19
|
+
if (!Number.isFinite(n))
|
|
20
|
+
return '—';
|
|
21
|
+
return integerNumber.format(n);
|
|
22
|
+
};
|
|
23
|
+
export const formatDuration = (m) => {
|
|
24
|
+
if (!Number.isFinite(m))
|
|
25
|
+
return '—';
|
|
26
|
+
if (m >= 60)
|
|
27
|
+
return formatInteger(m / 60) + 'h';
|
|
28
|
+
return formatNumber(m) + 'm';
|
|
29
|
+
};
|
|
30
|
+
export const formatCost = (c) => {
|
|
31
|
+
if (!Number.isFinite(c))
|
|
32
|
+
return '—';
|
|
33
|
+
if (c === 0)
|
|
34
|
+
return '$0.00';
|
|
35
|
+
const absolute = Math.abs(c);
|
|
36
|
+
const sign = c < 0 ? '−' : '';
|
|
37
|
+
if (absolute < 0.000001)
|
|
38
|
+
return `${sign}< $0.000001`;
|
|
39
|
+
const digits = absolute >= 1 ? 2 : absolute >= 0.01 ? 3 : 6;
|
|
40
|
+
return sign + '$' + new Intl.NumberFormat('en-US', {
|
|
41
|
+
minimumFractionDigits: digits,
|
|
42
|
+
maximumFractionDigits: digits,
|
|
43
|
+
}).format(absolute);
|
|
44
|
+
};
|
|
45
|
+
export const formatPercent = (ratio, maximumFractionDigits = 1) => {
|
|
46
|
+
if (!Number.isFinite(ratio))
|
|
47
|
+
return '—';
|
|
48
|
+
return new Intl.NumberFormat('en-US', {
|
|
49
|
+
style: 'percent',
|
|
50
|
+
maximumFractionDigits,
|
|
51
|
+
}).format(ratio);
|
|
52
|
+
};
|
|
53
|
+
export const COLORS = [
|
|
54
|
+
'hsl(var(--chart-1))',
|
|
55
|
+
'hsl(var(--chart-2))',
|
|
56
|
+
'hsl(var(--chart-3))',
|
|
57
|
+
'hsl(var(--chart-4))',
|
|
58
|
+
'hsl(var(--chart-5))',
|
|
59
|
+
];
|
|
60
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/report-app/utils.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IACnD,QAAQ,EAAE,SAAS;IACnB,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IACnD,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IACnD,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAA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AAG,QAAQ;QAAE,OAAO,GAAG,IAAI,aAAa,CAAC;IACrD,MAAM,MAAM,GAAG,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,IAAI,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QACjD,qBAAqB,EAAE,MAAM;QAC7B,qBAAqB,EAAE,MAAM;KAC9B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,qBAAqB,GAAG,CAAC,EAAU,EAAE;IAChF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IACxC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QACpC,KAAK,EAAE,SAAS;QAChB,qBAAqB;KACtB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;CACtB,CAAC"}
|
package/dist/report.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAGzD"}
|
package/dist/report.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { REPORT_APP_SCRIPT, REPORT_APP_STYLE, REPORT_FAVICON } from './generated/report-app.js';
|
|
2
|
+
const themeBootstrap = `(()=>{const key='felan-insights-theme';let theme;try{theme=localStorage.getItem(key)}catch{}if(theme!=='light'&&theme!=='dark')theme=matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';document.documentElement.dataset.theme=theme})()`;
|
|
3
|
+
export function renderReport(analytics) {
|
|
4
|
+
const data = JSON.stringify(analytics).replace(/</gu, '\\u003c').replace(/>/gu, '\\u003e').replace(/&/gu, '\\u0026');
|
|
5
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="light dark"><meta name="theme-color" content="#255f44"><link rel="icon" type="image/svg+xml" href="${REPORT_FAVICON}"><title>Felan Insights</title><style>${REPORT_APP_STYLE}</style><script>${themeBootstrap}</script></head><body><div id="root"></div><script>window.__FELAN_INSIGHTS_DATA__=${data};</script><script>${REPORT_APP_SCRIPT.replace(/<\//gu, '<\\/')}</script></body></html>`;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhG,MAAM,cAAc,GAAG,yPAAyP,CAAC;AAEjR,MAAM,UAAU,YAAY,CAAC,SAAoB;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACrH,OAAO,uQAAuQ,cAAc,yCAAyC,gBAAgB,mBAAmB,cAAc,qFAAqF,IAAI,qBAAqB,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,yBAAyB,CAAC;AAC1iB,CAAC"}
|