cbrowser 10.0.1 → 10.0.3

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/README.md CHANGED
@@ -638,9 +638,9 @@ mobile-user | pass | 28.1s | 1 | Scroll issue
638
638
 
639
639
  This helps identify which user groups struggle with your interface and where the friction points are, so you can prioritize UX improvements based on data rather than assumptions.
640
640
 
641
- ### Cognitive User Simulation (v8.3.1)
641
+ ### Cognitive User Simulation (v10.0.0)
642
642
 
643
- Go beyond timing and click patterns—simulate how users actually **think**. Cognitive journeys model realistic decision-making with abandonment detection, frustration tracking, and genuine cognitive traits.
643
+ Go beyond timing and click patterns—simulate how users actually **think**. Cognitive journeys model realistic decision-making with abandonment detection, frustration tracking, and genuine cognitive traits—now grounded in **peer-reviewed cognitive science research**.
644
644
 
645
645
  **Why it matters:** Traditional persona testing simulates motor behavior (slow clicks, typos). Cognitive simulation models mental behavior: "Would a confused first-timer give up here? Would they even notice that button?"
646
646
 
@@ -711,6 +711,27 @@ The simulation automatically stops when a realistic user would give up:
711
711
  | Too frustrated | `> 0.85` | "This is so frustrating..." |
712
712
  | No progress | 10+ steps, `< 0.1` progress | "I'm not getting anywhere..." |
713
713
  | Stuck in loop | Same pages 3x | "I keep ending up here..." |
714
+ | Decision fatigue (v9.9.0) | Fatigue > threshold | "I'll just pick the first option..." |
715
+
716
+ **Cognitive Science Foundations (v9.9.0-v10.0.0):**
717
+
718
+ CBrowser's simulation is grounded in established cognitive science research:
719
+
720
+ | Feature | Research Basis | What It Models |
721
+ |---------|---------------|----------------|
722
+ | **Decision Fatigue** (v9.9.0) | Baumeister's ego depletion | Fatigue accumulates logarithmically per decision; users start choosing defaults |
723
+ | **Fitts' Law** (v9.9.0) | Motor control research | Mouse timing: `MT = a + b × log₂(D/W + 1)` with age/tremor modifiers |
724
+ | **Dual-Process Theory** (v10.0.0) | Kahneman (Nobel Prize) | System 1 (automatic/fast) vs System 2 (deliberate/slow) switching |
725
+ | **GOMS/KLM Timing** (v10.0.0) | Card, Moran & Newell | Keystroke timing: 120ms (expert) to 500ms (novice) per key |
726
+
727
+ ```bash
728
+ # v9.9.0+ output now includes cognitive science metrics:
729
+ # Decisions made: 12
730
+ # Decision fatigue: 67%
731
+ # ⚠️ Was choosing defaults (high fatigue)
732
+ # Time in System 1: 45.2s (automatic)
733
+ # Time in System 2: 12.8s (deliberate)
734
+ ```
714
735
 
715
736
  **Output includes:**
716
737
  - Goal achievement status
@@ -91,7 +91,78 @@ async function journeyWithCallbacks() {
91
91
  console.log('\nJourney finished');
92
92
  }
93
93
 
94
- // Example 4: Compare cognitive traits across personas
94
+ // Example 4: Decision Fatigue Metrics (v9.9.0)
95
+ async function decisionFatigueExample() {
96
+ console.log('\n=== Decision Fatigue Metrics (v9.9.0) ===\n');
97
+
98
+ const result = await runCognitiveJourney({
99
+ persona: 'first-timer',
100
+ startUrl: 'https://example.com/signup',
101
+ goal: 'complete registration with all options',
102
+ verbose: true,
103
+ });
104
+
105
+ // v9.9.0 decision fatigue metrics
106
+ console.log('Decision Fatigue Analysis:');
107
+ console.log(` Decisions made: ${result.summary.decisionsMade}`);
108
+ console.log(` Final fatigue: ${(result.summary.finalDecisionFatigue * 100).toFixed(0)}%`);
109
+
110
+ if (result.summary.wasChoosingDefaults) {
111
+ console.log(' ⚠️ User started choosing defaults due to fatigue');
112
+ console.log(' Recommendation: Reduce number of choices or use smart defaults');
113
+ }
114
+ }
115
+
116
+ // Example 5: Dual-Process Theory (v10.0.0)
117
+ async function dualProcessExample() {
118
+ console.log('\n=== Dual-Process Theory (v10.0.0) ===\n');
119
+
120
+ // Power users start in System 1 (automatic, fast)
121
+ // They switch to System 2 (deliberate) when confused
122
+ const result = await runCognitiveJourney({
123
+ persona: 'power-user',
124
+ startUrl: 'https://example.com/settings',
125
+ goal: 'configure advanced notification preferences',
126
+ verbose: true,
127
+ });
128
+
129
+ if (result.cognitiveMode) {
130
+ console.log('Cognitive Mode Analysis:');
131
+ console.log(` Started in: System ${result.cognitiveMode.system === 1 ? '1 (Automatic)' : '2 (Deliberate)'}`);
132
+ console.log(` Time in System 1: ${result.cognitiveMode.timeInSystem1}ms`);
133
+ console.log(` Time in System 2: ${result.cognitiveMode.timeInSystem2}ms`);
134
+ console.log(` System 1 errors: ${result.cognitiveMode.system1Errors}`);
135
+
136
+ const pctSystem1 = (result.cognitiveMode.timeInSystem1 /
137
+ (result.cognitiveMode.timeInSystem1 + result.cognitiveMode.timeInSystem2) * 100).toFixed(0);
138
+ console.log(` Efficiency: ${pctSystem1}% automatic thinking`);
139
+ }
140
+ }
141
+
142
+ // Example 6: Fitts' Law Motor Timing (v9.9.0)
143
+ async function fittsLawExample() {
144
+ console.log('\n=== Fitts\' Law Motor Timing (v9.9.0) ===\n');
145
+
146
+ // Elderly users have age modifier affecting mouse movement
147
+ const result = await runCognitiveJourney({
148
+ persona: 'elderly-user',
149
+ startUrl: 'https://example.com',
150
+ goal: 'click the small help icon in the corner',
151
+ verbose: true,
152
+ });
153
+
154
+ // Find steps with click actions to see Fitts' Law in action
155
+ const clickSteps = result.steps.filter(s => s.action?.startsWith('click'));
156
+ for (const step of clickSteps) {
157
+ console.log(`Step ${step.stepNumber}: ${step.action}`);
158
+ if (step.mouseMovementTime) {
159
+ console.log(` Mouse movement time: ${step.mouseMovementTime}ms`);
160
+ console.log(` (Includes age modifier for elderly persona)`);
161
+ }
162
+ }
163
+ }
164
+
165
+ // Example 7: Compare cognitive traits across personas
95
166
  async function comparePersonas() {
96
167
  console.log('\n=== Comparing Personas ===\n');
97
168
 
@@ -136,6 +207,9 @@ async function main() {
136
207
  await basicJourney();
137
208
  // await customTraitsJourney();
138
209
  // await journeyWithCallbacks();
210
+ // await decisionFatigueExample(); // v9.9.0
211
+ // await dualProcessExample(); // v10.0.0
212
+ // await fittsLawExample(); // v9.9.0
139
213
  // await comparePersonas();
140
214
  } catch (error) {
141
215
  console.error('Error:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cbrowser",
3
- "version": "10.0.1",
3
+ "version": "10.0.3",
4
4
  "type": "module",
5
5
  "description": "Cognitive browser automation that thinks like your users. Simulate real user cognition with abandonment detection, constitutional safety, chaos engineering, and UX friction discovery.",
6
6
  "main": "dist/index.js",