behavior-wrapped 0.3.0 → 0.4.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/dist/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="theme-color" content="#0d0b1b" />
|
|
7
7
|
<meta name="description" content="Your private, local-first Claude Code behavior report." />
|
|
8
8
|
<title>Behavior Wrapped</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-DiU3lDI3.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BS_1umgY.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "behavior-wrapped",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A private, local-first Wrapped report for Claude Code and Codex behavior.",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "A private, local-first Wrapped report for Claude Code, Cowork, and Codex behavior.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Haoxing Du",
|
package/server/leaderboard.mjs
CHANGED
|
@@ -5,12 +5,21 @@ const demoTokens = [820_000, 2_400_000, 8_900_000, 14_300_000, 31_000_000, 47_50
|
|
|
5
5
|
const demoRatios = [0.8, 1.2, 1.7, 2.1, 2.8, 3.4, 4.2, 5.1, 6.7, 8.4, 11.2, 14.6];
|
|
6
6
|
const demoGoodHumanScores = [12.5, 25, 33.3, 40, 50, 57.1, 66.7, 72.7, 80, 87.5, 94.1, 100];
|
|
7
7
|
const demoWorkarounds = [0, 0, 1, 1, 2, 2, 3, 4, 5, 7, 9, 14];
|
|
8
|
+
const demoSessionTurnCounts = [[2, 4, 8], [3, 12, 21], [5, 17], [7, 35, 66], [9, 14, 93], [11, 45], [16, 28, 120], [22, 73], [31, 180], [48, 310], [82, 620], [140, 1_240]];
|
|
8
9
|
|
|
9
10
|
function finiteNonNegative(value) {
|
|
10
11
|
const number = Number(value);
|
|
11
12
|
return Number.isFinite(number) && number >= 0 ? number : 0;
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
function sessionTurnCounts(value) {
|
|
16
|
+
if (!Array.isArray(value)) return [];
|
|
17
|
+
return value.slice(0, 2_000).flatMap((item) => {
|
|
18
|
+
const turns = Number(item);
|
|
19
|
+
return Number.isInteger(turns) && turns >= 1 && turns <= 1_000_000 ? [turns] : [];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
export function leaderboardAggregateFromReport(report) {
|
|
15
24
|
const stats = report?.stats || {};
|
|
16
25
|
const agentWords = finiteNonNegative(stats.agentWords);
|
|
@@ -31,6 +40,7 @@ export function leaderboardAggregateFromReport(report) {
|
|
|
31
40
|
favorite_phrase: typeof phrase === "string" && /^[a-z]+(?:'[a-z]+)?(?: [a-z]+(?:'[a-z]+)?){3,9}$/.test(phrase) ? phrase : null,
|
|
32
41
|
phrase_occurrences: Math.round(finiteNonNegative(report?.phraseCard?.occurrences)),
|
|
33
42
|
phrase_sessions: Math.round(finiteNonNegative(report?.phraseCard?.distinctSessions)),
|
|
43
|
+
session_turn_counts: sessionTurnCounts(stats.sessionTurnCounts),
|
|
34
44
|
};
|
|
35
45
|
}
|
|
36
46
|
|
|
@@ -60,6 +70,13 @@ export function syntheticLeaderboardSnapshot(aggregate, participation = null) {
|
|
|
60
70
|
percentile: Math.round(demoWorkarounds.filter((value) => value <= aggregate.instrumental_workarounds).length / demoWorkarounds.length * 100),
|
|
61
71
|
samples: demoWorkarounds.map((value, index) => ({ participant_id: index + 1, value })),
|
|
62
72
|
},
|
|
73
|
+
session_lengths: {
|
|
74
|
+
values: aggregate.session_turn_counts,
|
|
75
|
+
samples: demoSessionTurnCounts.flatMap((values, participantIndex) => values.map((value, sessionIndex) => ({ participant_id: participantIndex + 1, session_index: sessionIndex, value }))),
|
|
76
|
+
},
|
|
77
|
+
phrases: {
|
|
78
|
+
entries: aggregate.favorite_phrase ? [{ participant_id: 1, phrase: aggregate.favorite_phrase, occurrences: aggregate.phrase_occurrences, sessions: aggregate.phrase_sessions }] : [],
|
|
79
|
+
},
|
|
63
80
|
participation: participation || { joined: false },
|
|
64
81
|
};
|
|
65
82
|
}
|