cbrowser 16.0.0 → 16.2.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.
@@ -0,0 +1,695 @@
1
+ /**
2
+ * CBrowser - Cognitive Browser Automation
3
+ *
4
+ * Copyright (c) 2026 WF Media (Alexandria Eden)
5
+ * Email: alexandria.shai.eden@gmail.com
6
+ *
7
+ * This source code is licensed under the Business Source License 1.1
8
+ * found in the LICENSE file in the root directory of this source tree.
9
+ */
10
+ /**
11
+ * Complete trait definitions for all 25 cognitive traits
12
+ */
13
+ export const TRAIT_DEFINITIONS = {
14
+ // ============================================================================
15
+ // ORIGINAL TRAITS (v1.0 - v14.x)
16
+ // ============================================================================
17
+ patience: {
18
+ name: "patience",
19
+ description: "Tolerance for delays, loading times, and friction before abandoning",
20
+ lowEnd: "Abandons immediately on any friction",
21
+ highEnd: "Waits indefinitely, never abandons",
22
+ research: "Forrester Research - Web Performance & User Experience",
23
+ examples: {
24
+ veryLow: "Leaves if page takes >2 seconds to load",
25
+ low: "Gives up after 1-2 failed attempts",
26
+ medium: "Tries 3-4 approaches before leaving",
27
+ high: "Persists through multiple errors, reads help docs",
28
+ veryHigh: "Never abandons, keeps trying indefinitely",
29
+ },
30
+ typicalScores: {
31
+ high: ["elderly-user", "screen-reader-user", "stoic-user"],
32
+ low: ["impatient-user", "mobile-user", "power-user"],
33
+ },
34
+ correlates: ["persistence", "resilience", "timeHorizon"],
35
+ defaultValue: 0.5,
36
+ },
37
+ riskTolerance: {
38
+ name: "riskTolerance",
39
+ description: "Willingness to click unfamiliar elements or take uncertain actions",
40
+ lowEnd: "Only clicks obvious, labeled buttons",
41
+ highEnd: "Clicks anything that might work",
42
+ research: "Kahneman & Tversky (1979) - Prospect Theory",
43
+ examples: {
44
+ veryLow: "Won't click unless 100% certain of outcome",
45
+ low: "Needs tooltips/labels before clicking",
46
+ medium: "Clicks familiar-looking elements",
47
+ high: "Explores menu items and settings freely",
48
+ veryHigh: "Clicks experimental features without hesitation",
49
+ },
50
+ typicalScores: {
51
+ high: ["power-user", "impatient-user", "confident-user"],
52
+ low: ["elderly-user", "anxious-user", "first-timer"],
53
+ },
54
+ correlates: ["curiosity", "selfEfficacy", "authoritySensitivity"],
55
+ defaultValue: 0.5,
56
+ },
57
+ comprehension: {
58
+ name: "comprehension",
59
+ description: "Ability to understand UI conventions and interface patterns",
60
+ lowEnd: "Unfamiliar with modern UI patterns",
61
+ highEnd: "Instant recognition of all conventions",
62
+ research: "Nielsen Norman Group - UI Pattern Recognition Studies",
63
+ examples: {
64
+ veryLow: "Doesn't recognize hamburger menu, search icons",
65
+ low: "Needs labels on icons, struggles with gestures",
66
+ medium: "Knows common patterns, learns new ones slowly",
67
+ high: "Recognizes most patterns instantly",
68
+ veryHigh: "Predicts UI behavior before seeing it",
69
+ },
70
+ typicalScores: {
71
+ high: ["power-user", "screen-reader-user"],
72
+ low: ["elderly-user", "first-timer", "elderly-low-vision"],
73
+ },
74
+ correlates: ["transferLearning", "proceduralFluency", "workingMemory"],
75
+ defaultValue: 0.5,
76
+ },
77
+ persistence: {
78
+ name: "persistence",
79
+ description: "Tendency to retry same approach vs. trying alternatives",
80
+ lowEnd: "Tries once, gives up or tries different approach",
81
+ highEnd: "Keeps trying same approach repeatedly",
82
+ research: "Dweck (2006) - Mindset Theory",
83
+ examples: {
84
+ veryLow: "One failure → abandons completely",
85
+ low: "One failure → tries something completely different",
86
+ medium: "Tries 2-3 times before switching approaches",
87
+ high: "Keeps trying same approach with small variations",
88
+ veryHigh: "Never switches approaches, keeps retrying",
89
+ },
90
+ typicalScores: {
91
+ high: ["screen-reader-user", "elderly-user", "stoic-user"],
92
+ low: ["impatient-user", "power-user", "cognitive-adhd"],
93
+ },
94
+ correlates: ["patience", "resilience", "attributionStyle"],
95
+ defaultValue: 0.5,
96
+ },
97
+ curiosity: {
98
+ name: "curiosity",
99
+ description: "Tendency to explore vs. stay focused on immediate goal",
100
+ lowEnd: "Tunnel vision, only goal-relevant actions",
101
+ highEnd: "Easily distracted by interesting elements",
102
+ research: "Berlyne (1960) - Curiosity and Exploration",
103
+ examples: {
104
+ veryLow: "Never clicks anything off the goal path",
105
+ low: "Ignores most side content",
106
+ medium: "Occasionally explores interesting features",
107
+ high: "Frequently clicks on tangential content",
108
+ veryHigh: "Explores everything, loses sight of original goal",
109
+ },
110
+ typicalScores: {
111
+ high: ["first-timer", "cognitive-adhd"],
112
+ low: ["power-user", "impatient-user", "elderly-user"],
113
+ },
114
+ correlates: ["fearOfMissingOut", "timeHorizon", "mentalModelRigidity"],
115
+ defaultValue: 0.5,
116
+ },
117
+ workingMemory: {
118
+ name: "workingMemory",
119
+ description: "Capacity to remember previous attempts and current context",
120
+ lowEnd: "Forgets what was tried, repeats mistakes",
121
+ highEnd: "Perfect recall of all attempts and context",
122
+ research: "Baddeley & Hitch (1974) - Working Memory Model",
123
+ researchUrl: "https://pubmed.ncbi.nlm.nih.gov/28212479/",
124
+ examples: {
125
+ veryLow: "Repeats exact same failed action multiple times",
126
+ low: "Sometimes forgets recent actions, slight repetition",
127
+ medium: "Remembers last 2-3 attempts",
128
+ high: "Tracks all attempts, systematically eliminates options",
129
+ veryHigh: "Never repeats a failed approach",
130
+ },
131
+ typicalScores: {
132
+ high: ["power-user", "screen-reader-user"],
133
+ low: ["elderly-low-vision", "cognitive-adhd", "elderly-user"],
134
+ },
135
+ correlates: ["interruptRecovery", "proceduralFluency", "metacognitivePlanning"],
136
+ defaultValue: 0.5,
137
+ },
138
+ readingTendency: {
139
+ name: "readingTendency",
140
+ description: "Reads content thoroughly vs. scans for CTAs",
141
+ lowEnd: "Visual scanner, ignores all text",
142
+ highEnd: "Reads every word before acting",
143
+ research: "Nielsen (2006) - F-Pattern Reading Studies",
144
+ examples: {
145
+ veryLow: "Ignores all text, clicks based on visual hierarchy",
146
+ low: "Reads headlines only",
147
+ medium: "Skims key paragraphs",
148
+ high: "Reads most content before proceeding",
149
+ veryHigh: "Reads everything including fine print, ToS",
150
+ },
151
+ typicalScores: {
152
+ high: ["screen-reader-user", "elderly-user", "anxious-user"],
153
+ low: ["power-user", "impatient-user", "mobile-user"],
154
+ },
155
+ correlates: ["patience", "proceduralFluency", "trustCalibration"],
156
+ defaultValue: 0.5,
157
+ },
158
+ resilience: {
159
+ name: "resilience",
160
+ description: "Speed of emotional recovery from setbacks and errors",
161
+ lowEnd: "Frustration lingers, compounds with each error",
162
+ highEnd: "Instantly shrugs off errors, stays positive",
163
+ research: "Smith et al. (2008) - Brief Resilience Scale (BRS)",
164
+ researchUrl: "https://pubmed.ncbi.nlm.nih.gov/18696313/",
165
+ examples: {
166
+ veryLow: "Single error ruins entire session mood",
167
+ low: "Takes 5+ minutes to recover from frustration",
168
+ medium: "Recovers after brief pause or deep breath",
169
+ high: "Error barely registers emotionally",
170
+ veryHigh: "Views errors as interesting challenges",
171
+ },
172
+ typicalScores: {
173
+ high: ["power-user", "stoic-user", "confident-user"],
174
+ low: ["emotional-user", "anxious-user", "impatient-user"],
175
+ },
176
+ correlates: ["selfEfficacy", "patience", "emotionalContagion"],
177
+ defaultValue: 0.5,
178
+ },
179
+ selfEfficacy: {
180
+ name: "selfEfficacy",
181
+ description: "Belief in ability to solve interface problems",
182
+ lowEnd: "\"I can't figure this out\"",
183
+ highEnd: "\"I can solve anything\"",
184
+ research: "Bandura (1977) - Self-Efficacy Theory",
185
+ researchUrl: "https://psycnet.apa.org/record/1977-25733-001",
186
+ examples: {
187
+ veryLow: "Gives up immediately, \"this is beyond me\"",
188
+ low: "Assumes difficulty means personal failure",
189
+ medium: "Willing to try but unsure of success",
190
+ high: "Confident in ability to find solutions",
191
+ veryHigh: "Never doubts ability to succeed",
192
+ },
193
+ typicalScores: {
194
+ high: ["power-user", "confident-user"],
195
+ low: ["elderly-user", "anxious-user", "elderly-low-vision"],
196
+ },
197
+ correlates: ["resilience", "persistence", "attributionStyle"],
198
+ defaultValue: 0.5,
199
+ },
200
+ satisficing: {
201
+ name: "satisficing",
202
+ description: "Accepts 'good enough' vs. seeks optimal solution",
203
+ lowEnd: "Maximizer - seeks perfect option",
204
+ highEnd: "Satisficer - accepts first adequate option",
205
+ research: "Simon (1956) - Bounded Rationality; Schwartz et al. (2002)",
206
+ examples: {
207
+ veryLow: "Compares all options exhaustively before deciding",
208
+ low: "Evaluates 3-4 options before choosing",
209
+ medium: "Considers 2 options, picks better one",
210
+ high: "Takes first option that meets basic needs",
211
+ veryHigh: "Clicks first available option without comparing",
212
+ },
213
+ typicalScores: {
214
+ high: ["impatient-user", "mobile-user", "cognitive-adhd"],
215
+ low: ["power-user", "stoic-user"],
216
+ },
217
+ correlates: ["patience", "timeHorizon", "fearOfMissingOut"],
218
+ defaultValue: 0.5,
219
+ },
220
+ trustCalibration: {
221
+ name: "trustCalibration",
222
+ description: "Baseline trust toward websites and UI claims",
223
+ lowEnd: "Highly skeptical, verifies everything",
224
+ highEnd: "Highly trusting, accepts claims at face value",
225
+ research: "Fogg (2003) - Persuasive Technology, Stanford Web Credibility",
226
+ examples: {
227
+ veryLow: "Checks URL, looks for HTTPS, questions all claims",
228
+ low: "Skeptical of promotional language",
229
+ medium: "Trusts professional-looking sites",
230
+ high: "Accepts most website claims",
231
+ veryHigh: "Clicks through without reading warnings",
232
+ },
233
+ typicalScores: {
234
+ high: ["impatient-user", "cognitive-adhd"],
235
+ low: ["elderly-user", "anxious-user", "elderly-low-vision"],
236
+ },
237
+ correlates: ["authoritySensitivity", "readingTendency", "fearOfMissingOut"],
238
+ defaultValue: 0.5,
239
+ },
240
+ interruptRecovery: {
241
+ name: "interruptRecovery",
242
+ description: "Ability to resume tasks after interruption",
243
+ lowEnd: "Restarts from beginning after any interruption",
244
+ highEnd: "Seamlessly resumes exactly where left off",
245
+ research: "Mark et al. (2005) - \"No Task Left Behind?\"",
246
+ examples: {
247
+ veryLow: "Phone ring → completely forgets what was doing",
248
+ low: "Takes 5+ minutes to find place again",
249
+ medium: "Uses browser tabs/history to resume",
250
+ high: "Mental bookmark allows quick resumption",
251
+ veryHigh: "Interruption doesn't break concentration at all",
252
+ },
253
+ typicalScores: {
254
+ high: ["power-user", "screen-reader-user", "stoic-user"],
255
+ low: ["cognitive-adhd", "elderly-low-vision", "impatient-user"],
256
+ },
257
+ correlates: ["workingMemory", "metacognitivePlanning", "resilience"],
258
+ defaultValue: 0.5,
259
+ },
260
+ // ============================================================================
261
+ // NEW TRAITS (v15.0.0)
262
+ // ============================================================================
263
+ informationForaging: {
264
+ name: "informationForaging",
265
+ description: "Strategy for finding information - exhaustive search vs. scent-following",
266
+ lowEnd: "Exhaustive search, clicks everything systematically",
267
+ highEnd: "Follows information scent efficiently, abandons low-yield paths",
268
+ research: "Pirolli & Card (1999) - Information Foraging Theory",
269
+ researchUrl: "https://www.nngroup.com/articles/information-scent/",
270
+ examples: {
271
+ veryLow: "Clicks every link on page looking for answer",
272
+ low: "Explores multiple paths before deciding",
273
+ medium: "Follows promising links, occasionally backtracks",
274
+ high: "Quickly identifies and follows strongest scent",
275
+ veryHigh: "Abandons low-scent paths within seconds",
276
+ },
277
+ typicalScores: {
278
+ high: ["power-user", "impatient-user"],
279
+ low: ["first-timer", "elderly-low-vision"],
280
+ },
281
+ correlates: ["satisficing", "timeHorizon", "comprehension"],
282
+ defaultValue: 0.5,
283
+ },
284
+ changeBlindness: {
285
+ name: "changeBlindness",
286
+ description: "Tendency to miss UI changes outside focal area",
287
+ lowEnd: "Notices all changes, highly perceptive",
288
+ highEnd: "Misses most changes outside focus area",
289
+ research: "Simons & Chabris (1999) - Inattentional Blindness",
290
+ researchUrl: "https://www.cell.com/trends/cognitive-sciences/abstract/S1364-6613(99)01310-2",
291
+ examples: {
292
+ veryLow: "Notices toast notifications, badge updates, loading states",
293
+ low: "Catches most UI changes within viewport",
294
+ medium: "Notices obvious changes, misses subtle ones",
295
+ high: "Often misses notifications while focused on form",
296
+ veryHigh: "Completely unaware of changes outside focal element",
297
+ },
298
+ typicalScores: {
299
+ high: ["elderly-low-vision", "cognitive-adhd", "low-vision-magnified"],
300
+ low: ["anxious-user", "deaf-user"],
301
+ },
302
+ correlates: ["workingMemory", "curiosity", "readingTendency"],
303
+ defaultValue: 0.3,
304
+ },
305
+ anchoringBias: {
306
+ name: "anchoringBias",
307
+ description: "Tendency to over-weight initial information",
308
+ lowEnd: "Freely adjusts opinion as new info appears",
309
+ highEnd: "First information heavily influences all judgments",
310
+ research: "Tversky & Kahneman (1974) - Anchoring Effect",
311
+ examples: {
312
+ veryLow: "Evaluates each option independently",
313
+ low: "Slight preference for first-seen options",
314
+ medium: "Compares all options to first one",
315
+ high: "First price/rating sets strong expectation",
316
+ veryHigh: "First information becomes absolute reference point",
317
+ },
318
+ typicalScores: {
319
+ high: ["elderly-user", "first-timer", "elderly-low-vision"],
320
+ low: ["power-user", "confident-user"],
321
+ },
322
+ correlates: ["satisficing", "mentalModelRigidity", "comprehension"],
323
+ defaultValue: 0.5,
324
+ },
325
+ timeHorizon: {
326
+ name: "timeHorizon",
327
+ description: "Focus on immediate vs. future consequences",
328
+ lowEnd: "Long-term focused, invests time in learning",
329
+ highEnd: "Immediate gratification, wants results NOW",
330
+ research: "Frederick et al. (2002) - Time Discounting",
331
+ examples: {
332
+ veryLow: "Reads entire tutorial before starting",
333
+ low: "Willing to spend time on setup for future benefit",
334
+ medium: "Balances immediate needs with future utility",
335
+ high: "Skips tutorials, wants immediate results",
336
+ veryHigh: "Won't invest any time that doesn't have instant payoff",
337
+ },
338
+ typicalScores: {
339
+ high: ["impatient-user", "mobile-user", "cognitive-adhd"],
340
+ low: ["stoic-user", "power-user"],
341
+ },
342
+ correlates: ["patience", "satisficing", "metacognitivePlanning"],
343
+ defaultValue: 0.5,
344
+ },
345
+ attributionStyle: {
346
+ name: "attributionStyle",
347
+ description: "Where blame is assigned for errors",
348
+ lowEnd: "Blames system/design (external attribution)",
349
+ highEnd: "Blames self (internal attribution)",
350
+ research: "Weiner (1985) - Attribution Theory; Abramson et al. (1978)",
351
+ examples: {
352
+ veryLow: "\"This interface is poorly designed\"",
353
+ low: "\"That button is confusing\"",
354
+ medium: "\"Maybe I did something wrong, or maybe the site is buggy\"",
355
+ high: "\"I must have clicked the wrong thing\"",
356
+ veryHigh: "\"I'm just not smart enough for this\"",
357
+ },
358
+ typicalScores: {
359
+ high: ["elderly-user", "anxious-user", "elderly-low-vision"],
360
+ low: ["power-user", "confident-user"],
361
+ },
362
+ correlates: ["selfEfficacy", "persistence", "resilience"],
363
+ defaultValue: 0.5,
364
+ },
365
+ metacognitivePlanning: {
366
+ name: "metacognitivePlanning",
367
+ description: "Tendency to plan before acting",
368
+ lowEnd: "Impulsive trial-and-error, no planning",
369
+ highEnd: "Careful planning before any action",
370
+ research: "Flavell (1979) - Metacognition; Schraw & Dennison (1994)",
371
+ examples: {
372
+ veryLow: "Clicks immediately without reading anything",
373
+ low: "Glances at page before clicking",
374
+ medium: "Scans form requirements before starting",
375
+ high: "Reads all instructions, plans approach",
376
+ veryHigh: "Creates mental checklist before each step",
377
+ },
378
+ typicalScores: {
379
+ high: ["power-user", "screen-reader-user", "stoic-user"],
380
+ low: ["impatient-user", "cognitive-adhd", "first-timer"],
381
+ },
382
+ correlates: ["workingMemory", "proceduralFluency", "readingTendency"],
383
+ defaultValue: 0.5,
384
+ },
385
+ proceduralFluency: {
386
+ name: "proceduralFluency",
387
+ description: "Ease of following step-by-step instructions",
388
+ lowEnd: "Struggles with sequences, skips steps, confuses order",
389
+ highEnd: "Follows procedures precisely and efficiently",
390
+ research: "Sweller (1988) - Cognitive Load Theory",
391
+ examples: {
392
+ veryLow: "Completes steps out of order, misses requirements",
393
+ low: "Often needs to re-read instructions mid-flow",
394
+ medium: "Follows most procedures with occasional errors",
395
+ high: "Completes multi-step forms smoothly",
396
+ veryHigh: "Executes complex procedures flawlessly",
397
+ },
398
+ typicalScores: {
399
+ high: ["power-user", "screen-reader-user"],
400
+ low: ["first-timer", "elderly-low-vision", "cognitive-adhd"],
401
+ },
402
+ correlates: ["workingMemory", "comprehension", "metacognitivePlanning"],
403
+ defaultValue: 0.5,
404
+ },
405
+ transferLearning: {
406
+ name: "transferLearning",
407
+ description: "Ability to apply knowledge from familiar UIs to new ones",
408
+ lowEnd: "Each new UI feels completely unfamiliar",
409
+ highEnd: "Instantly applies patterns across all interfaces",
410
+ research: "Barnett & Ceci (2002) - Transfer of Learning",
411
+ examples: {
412
+ veryLow: "Doesn't recognize hamburger menu on new site",
413
+ low: "Needs time to find familiar elements in new layout",
414
+ medium: "Recognizes common patterns, struggles with variations",
415
+ high: "Quickly maps new UI to known mental models",
416
+ veryHigh: "Instantly productive on any interface",
417
+ },
418
+ typicalScores: {
419
+ high: ["power-user", "mobile-user"],
420
+ low: ["elderly-low-vision", "first-timer", "elderly-user"],
421
+ },
422
+ correlates: ["comprehension", "mentalModelRigidity", "proceduralFluency"],
423
+ defaultValue: 0.5,
424
+ },
425
+ authoritySensitivity: {
426
+ name: "authoritySensitivity",
427
+ description: "Compliance with perceived authority figures and cues",
428
+ lowEnd: "Questions all authority, verifies claims",
429
+ highEnd: "Follows authority cues without question",
430
+ research: "Milgram (1963) - Obedience; Cialdini (2001) - Influence",
431
+ examples: {
432
+ veryLow: "Ignores \"Admin\" badges, verifies all claims",
433
+ low: "Skeptical of official-looking messages",
434
+ medium: "Trusts verified/official badges",
435
+ high: "Follows instructions from authority-looking sources",
436
+ veryHigh: "Immediately complies with any official-looking request",
437
+ },
438
+ typicalScores: {
439
+ high: ["first-timer", "elderly-user", "elderly-low-vision"],
440
+ low: ["power-user", "confident-user"],
441
+ },
442
+ correlates: ["trustCalibration", "riskTolerance", "socialProofSensitivity"],
443
+ defaultValue: 0.5,
444
+ },
445
+ emotionalContagion: {
446
+ name: "emotionalContagion",
447
+ description: "Susceptibility to mood influence from UI tone",
448
+ lowEnd: "Mood-stable, unaffected by UI emotional tone",
449
+ highEnd: "Adopts UI's emotional tone completely",
450
+ research: "Hatfield et al. (1993) - Emotional Contagion",
451
+ examples: {
452
+ veryLow: "Friendly/stern UI makes no difference to mood",
453
+ low: "Slight mood influence from very emotional content",
454
+ medium: "Noticeably affected by strongly-toned messaging",
455
+ high: "UI frustration → user frustration quickly",
456
+ veryHigh: "Error messages cause immediate emotional response",
457
+ },
458
+ typicalScores: {
459
+ high: ["emotional-user", "anxious-user"],
460
+ low: ["stoic-user", "power-user", "confident-user"],
461
+ },
462
+ correlates: ["resilience", "selfEfficacy", "fearOfMissingOut"],
463
+ defaultValue: 0.5,
464
+ },
465
+ fearOfMissingOut: {
466
+ name: "fearOfMissingOut",
467
+ description: "FOMO-driven decision making",
468
+ lowEnd: "Unaffected by scarcity/urgency cues",
469
+ highEnd: "Highly responsive to urgency and scarcity",
470
+ research: "Przybylski et al. (2013) - FoMO Scale; Cialdini (2001)",
471
+ examples: {
472
+ veryLow: "\"Limited time offer\" has zero effect",
473
+ low: "Notices urgency but evaluates rationally",
474
+ medium: "Urgency slightly speeds up decision-making",
475
+ high: "\"Only 2 left!\" triggers immediate action",
476
+ veryHigh: "Any urgency cue causes immediate click",
477
+ },
478
+ typicalScores: {
479
+ high: ["impatient-user", "cognitive-adhd", "emotional-user"],
480
+ low: ["stoic-user", "power-user", "elderly-user"],
481
+ },
482
+ correlates: ["emotionalContagion", "satisficing", "timeHorizon"],
483
+ defaultValue: 0.5,
484
+ },
485
+ socialProofSensitivity: {
486
+ name: "socialProofSensitivity",
487
+ description: "Influence of reviews, ratings, and social validation",
488
+ lowEnd: "Evaluates products on features alone",
489
+ highEnd: "Heavily influenced by what others chose",
490
+ research: "Cialdini (2001) - Social Proof Principle",
491
+ examples: {
492
+ veryLow: "Ignores star ratings, reads product specs only",
493
+ low: "Glances at ratings but makes independent choice",
494
+ medium: "Ratings are one factor among many",
495
+ high: "Prioritizes highly-rated options",
496
+ veryHigh: "Only considers options with many positive reviews",
497
+ },
498
+ typicalScores: {
499
+ high: ["first-timer", "elderly-user"],
500
+ low: ["power-user", "stoic-user"],
501
+ },
502
+ correlates: ["trustCalibration", "authoritySensitivity", "fearOfMissingOut"],
503
+ defaultValue: 0.5,
504
+ },
505
+ mentalModelRigidity: {
506
+ name: "mentalModelRigidity",
507
+ description: "Ability to adapt mental models to unexpected UI patterns",
508
+ /**
509
+ * ⚠️ SEMANTIC INVERSION WARNING:
510
+ * Despite the name "rigidity", this trait measures FLEXIBILITY.
511
+ * - LOW (0.0) = MORE rigid (struggles with change)
512
+ * - HIGH (1.0) = MORE flexible (adapts quickly)
513
+ *
514
+ * This naming was kept for backward compatibility with existing personas.
515
+ * When setting this trait, think: "How flexible is this user?"
516
+ */
517
+ lowEnd: "Rigid - struggles when conventions are broken",
518
+ highEnd: "Highly adaptive - quickly forms new mental models",
519
+ research: "Johnson-Laird (1983) - Mental Models; Norman (1988)",
520
+ examples: {
521
+ veryLow: "Completely stuck if navigation isn't where expected",
522
+ low: "Takes significant time to adapt to novel patterns",
523
+ medium: "Eventually adapts with some frustration",
524
+ high: "Quickly forms new mental model for novel interface",
525
+ veryHigh: "Instantly productive regardless of UI conventions",
526
+ },
527
+ typicalScores: {
528
+ high: ["power-user", "confident-user", "impatient-user"],
529
+ low: ["elderly-user", "elderly-low-vision", "anxious-user"],
530
+ },
531
+ correlates: ["transferLearning", "comprehension", "resilience"],
532
+ defaultValue: 0.5,
533
+ },
534
+ };
535
+ // ============================================================================
536
+ // PERSONA-TRAIT MATRIX
537
+ // ============================================================================
538
+ /**
539
+ * Quick reference for recommended trait values by persona archetype.
540
+ * Use as starting point when creating custom personas.
541
+ */
542
+ export const PERSONA_TRAIT_GUIDELINES = {
543
+ // Tech expertise spectrum
544
+ "expert": {
545
+ patience: 0.3,
546
+ riskTolerance: 0.9,
547
+ comprehension: 0.95,
548
+ selfEfficacy: 0.9,
549
+ transferLearning: 0.95,
550
+ metacognitivePlanning: 0.8,
551
+ informationForaging: 0.9,
552
+ mentalModelRigidity: 0.8,
553
+ },
554
+ "intermediate": {
555
+ patience: 0.5,
556
+ riskTolerance: 0.5,
557
+ comprehension: 0.6,
558
+ selfEfficacy: 0.5,
559
+ transferLearning: 0.5,
560
+ metacognitivePlanning: 0.5,
561
+ informationForaging: 0.5,
562
+ mentalModelRigidity: 0.5,
563
+ },
564
+ "beginner": {
565
+ patience: 0.6,
566
+ riskTolerance: 0.3,
567
+ comprehension: 0.3,
568
+ selfEfficacy: 0.4,
569
+ transferLearning: 0.2,
570
+ metacognitivePlanning: 0.3,
571
+ informationForaging: 0.3,
572
+ mentalModelRigidity: 0.3,
573
+ },
574
+ // Age spectrum
575
+ "young-adult": {
576
+ timeHorizon: 0.6,
577
+ fearOfMissingOut: 0.7,
578
+ emotionalContagion: 0.6,
579
+ socialProofSensitivity: 0.7,
580
+ workingMemory: 0.7,
581
+ },
582
+ "middle-aged": {
583
+ timeHorizon: 0.5,
584
+ fearOfMissingOut: 0.4,
585
+ emotionalContagion: 0.4,
586
+ socialProofSensitivity: 0.5,
587
+ workingMemory: 0.6,
588
+ },
589
+ "elderly": {
590
+ patience: 0.8,
591
+ riskTolerance: 0.15,
592
+ attributionStyle: 0.8,
593
+ authoritySensitivity: 0.8,
594
+ workingMemory: 0.35,
595
+ mentalModelRigidity: 0.2,
596
+ timeHorizon: 0.4,
597
+ },
598
+ // Emotional baseline
599
+ "emotionally-stable": {
600
+ resilience: 0.8,
601
+ emotionalContagion: 0.2,
602
+ fearOfMissingOut: 0.3,
603
+ patience: 0.7,
604
+ },
605
+ "emotionally-reactive": {
606
+ resilience: 0.2,
607
+ emotionalContagion: 0.8,
608
+ fearOfMissingOut: 0.7,
609
+ patience: 0.3,
610
+ },
611
+ // Accessibility
612
+ "motor-impaired": {
613
+ patience: 0.7,
614
+ proceduralFluency: 0.5,
615
+ satisficing: 0.7,
616
+ },
617
+ "vision-impaired": {
618
+ changeBlindness: 0.7,
619
+ readingTendency: 0.9,
620
+ metacognitivePlanning: 0.7,
621
+ },
622
+ "cognitive-impaired": {
623
+ workingMemory: 0.3,
624
+ interruptRecovery: 0.2,
625
+ proceduralFluency: 0.3,
626
+ metacognitivePlanning: 0.2,
627
+ },
628
+ };
629
+ // ============================================================================
630
+ // HELPER FUNCTIONS
631
+ // ============================================================================
632
+ /**
633
+ * Get trait definition by name
634
+ */
635
+ export function getTraitDefinition(traitName) {
636
+ return TRAIT_DEFINITIONS[traitName];
637
+ }
638
+ /**
639
+ * Get all trait names
640
+ */
641
+ export function getTraitNames() {
642
+ return Object.keys(TRAIT_DEFINITIONS);
643
+ }
644
+ /**
645
+ * Validate trait value is in valid range
646
+ */
647
+ export function isValidTraitValue(value) {
648
+ return value >= 0 && value <= 1;
649
+ }
650
+ /**
651
+ * Get human-readable level description for a trait value
652
+ */
653
+ export function getTraitLevel(value) {
654
+ if (value < 0.2)
655
+ return "veryLow";
656
+ if (value < 0.4)
657
+ return "low";
658
+ if (value < 0.6)
659
+ return "medium";
660
+ if (value < 0.8)
661
+ return "high";
662
+ return "veryHigh";
663
+ }
664
+ /**
665
+ * Get example behavior for trait at given value
666
+ */
667
+ export function getTraitExample(traitName, value) {
668
+ const def = TRAIT_DEFINITIONS[traitName];
669
+ if (!def)
670
+ return undefined;
671
+ const level = getTraitLevel(value);
672
+ return def.examples[level];
673
+ }
674
+ /**
675
+ * Suggest trait value based on persona characteristics
676
+ */
677
+ export function suggestTraitValue(traitName, techLevel, ageGroup) {
678
+ // Start with tech level baseline
679
+ const techGuidelines = PERSONA_TRAIT_GUIDELINES[techLevel];
680
+ if (techGuidelines && techGuidelines[traitName] !== undefined) {
681
+ return techGuidelines[traitName];
682
+ }
683
+ // Check age group
684
+ if (ageGroup) {
685
+ const ageKey = ageGroup === "young" ? "young-adult" : ageGroup === "middle" ? "middle-aged" : "elderly";
686
+ const ageGuidelines = PERSONA_TRAIT_GUIDELINES[ageKey];
687
+ if (ageGuidelines && ageGuidelines[traitName] !== undefined) {
688
+ return ageGuidelines[traitName];
689
+ }
690
+ }
691
+ // Fall back to trait default
692
+ const def = TRAIT_DEFINITIONS[traitName];
693
+ return def?.defaultValue ?? 0.5;
694
+ }
695
+ //# sourceMappingURL=trait-reference.js.map