cbrowser 14.4.1 → 16.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/personas.d.ts.map +1 -1
- package/dist/personas.js +387 -0
- package/dist/personas.js.map +1 -1
- package/dist/stealth/framework.d.ts +114 -0
- package/dist/stealth/framework.d.ts.map +1 -0
- package/dist/stealth/framework.js +293 -0
- package/dist/stealth/framework.js.map +1 -0
- package/dist/stealth/index.d.ts +21 -0
- package/dist/stealth/index.d.ts.map +1 -0
- package/dist/stealth/index.js +20 -0
- package/dist/stealth/index.js.map +1 -0
- package/dist/types.d.ts +284 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* Non-production use is permitted. Production use requires a commercial license.
|
|
11
|
+
* See LICENSE for full terms.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Constitutional Stealth Framework
|
|
15
|
+
*
|
|
16
|
+
* Public framework for ethical stealth mode.
|
|
17
|
+
* Full implementation available in cbrowser-enterprise.
|
|
18
|
+
*/
|
|
19
|
+
export { DEFAULT_STEALTH_CONFIG, MINIMUM_RATE_LIMITS, STEALTH_TERMS_OF_SERVICE, matchesDomainPattern, isProhibitedDomain, validateAcknowledgment, mergeStealthConfig, BaseConstitutionalEnforcer, NoOpConstitutionalEnforcer, } from "./framework.js";
|
|
20
|
+
export type { StealthConfig, StealthAuthorization, StealthAcknowledgment, StealthRateLimits, StealthAuditEntry, StealthCheckResult, IConstitutionalEnforcer, } from "./framework.js";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stealth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
* Non-production use is permitted. Production use requires a commercial license.
|
|
11
|
+
* See LICENSE for full terms.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Constitutional Stealth Framework
|
|
15
|
+
*
|
|
16
|
+
* Public framework for ethical stealth mode.
|
|
17
|
+
* Full implementation available in cbrowser-enterprise.
|
|
18
|
+
*/
|
|
19
|
+
export { DEFAULT_STEALTH_CONFIG, MINIMUM_RATE_LIMITS, STEALTH_TERMS_OF_SERVICE, matchesDomainPattern, isProhibitedDomain, validateAcknowledgment, mergeStealthConfig, BaseConstitutionalEnforcer, NoOpConstitutionalEnforcer, } from "./framework.js";
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stealth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -222,6 +222,149 @@ export interface CognitiveTraits {
|
|
|
222
222
|
* @see Monk et al. (2008) - "Effect of interruption duration on resuming suspended goals"
|
|
223
223
|
*/
|
|
224
224
|
interruptRecovery?: number;
|
|
225
|
+
/**
|
|
226
|
+
* Strategy for finding information on pages (0 = exhaustive search, 1 = scent-following)
|
|
227
|
+
*
|
|
228
|
+
* Research basis: Pirolli & Card (1999) - "Information Foraging Theory"
|
|
229
|
+
* Users follow "information scent" - cues that suggest relevance.
|
|
230
|
+
* High foragers efficiently abandon low-scent paths; low foragers search exhaustively.
|
|
231
|
+
*
|
|
232
|
+
* @see https://www.nngroup.com/articles/information-scent/
|
|
233
|
+
* @see Chi et al. (2001) - "Using information scent to model user information needs"
|
|
234
|
+
*/
|
|
235
|
+
informationForaging?: number;
|
|
236
|
+
/**
|
|
237
|
+
* Tendency to miss UI changes outside focus area (0 = notices everything, 1 = tunnel vision)
|
|
238
|
+
*
|
|
239
|
+
* Research basis: Simons & Chabris (1999) - "Gorillas in Our Midst"
|
|
240
|
+
* Inattentional blindness affects 46% of observers in focused tasks.
|
|
241
|
+
* Users miss notifications, loading states, and error messages outside focal area.
|
|
242
|
+
*
|
|
243
|
+
* @see Rensink et al. (1997) - "To See or Not to See"
|
|
244
|
+
* @see Varakin et al. (2004) - "Change blindness and visual memory"
|
|
245
|
+
*/
|
|
246
|
+
changeBlindness?: number;
|
|
247
|
+
/**
|
|
248
|
+
* Tendency to over-weight initial information (0 = adjusts freely, 1 = anchored to first data)
|
|
249
|
+
*
|
|
250
|
+
* Research basis: Tversky & Kahneman (1974) - "Judgment under Uncertainty"
|
|
251
|
+
* Initial prices, ratings, or expectations bias subsequent judgments.
|
|
252
|
+
* High anchoring users compare all options to first seen.
|
|
253
|
+
*
|
|
254
|
+
* @see Furnham & Boo (2011) - "A literature review of the anchoring effect"
|
|
255
|
+
* @see Ariely et al. (2003) - "Coherent arbitrariness"
|
|
256
|
+
*/
|
|
257
|
+
anchoringBias?: number;
|
|
258
|
+
/**
|
|
259
|
+
* Focus on immediate vs. future consequences (0 = long-term focused, 1 = immediate gratification)
|
|
260
|
+
*
|
|
261
|
+
* Research basis: Frederick et al. (2002) - "Time Discounting and Time Preference"
|
|
262
|
+
* Short time horizon users skip tutorials, ignore warnings, prefer quick wins.
|
|
263
|
+
* Long time horizon users invest in learning, read docs, plan ahead.
|
|
264
|
+
*
|
|
265
|
+
* @see Mischel et al. (1989) - Delay of gratification studies
|
|
266
|
+
* @see Weber et al. (2007) - "Asymmetric discounting in intertemporal choice"
|
|
267
|
+
*/
|
|
268
|
+
timeHorizon?: number;
|
|
269
|
+
/**
|
|
270
|
+
* Where blame is assigned for errors (0 = blames system, 1 = blames self)
|
|
271
|
+
*
|
|
272
|
+
* Research basis: Weiner (1985) - "An Attributional Theory of Motivation"
|
|
273
|
+
* Self-blamers give up faster on complex UIs ("I'm not smart enough").
|
|
274
|
+
* System-blamers persist and seek workarounds ("this design is broken").
|
|
275
|
+
*
|
|
276
|
+
* @see Peterson et al. (1982) - "The Attributional Style Questionnaire"
|
|
277
|
+
* @see Abramson et al. (1978) - "Learned helplessness in humans"
|
|
278
|
+
*/
|
|
279
|
+
attributionStyle?: number;
|
|
280
|
+
/**
|
|
281
|
+
* Tendency to plan before acting (0 = impulsive trial-and-error, 1 = careful planning)
|
|
282
|
+
*
|
|
283
|
+
* Research basis: Flavell (1979) - "Metacognition and Cognitive Monitoring"
|
|
284
|
+
* High metacognition users preview forms, read requirements, plan sequences.
|
|
285
|
+
* Low metacognition users click immediately, backtrack often.
|
|
286
|
+
*
|
|
287
|
+
* @see Schraw & Dennison (1994) - "Assessing Metacognitive Awareness"
|
|
288
|
+
* @see Brown (1987) - "Metacognition, executive control, self-regulation"
|
|
289
|
+
*/
|
|
290
|
+
metacognitivePlanning?: number;
|
|
291
|
+
/**
|
|
292
|
+
* Ease of following step-by-step instructions (0 = struggles with sequences, 1 = follows precisely)
|
|
293
|
+
*
|
|
294
|
+
* Research basis: Sweller (1988) - "Cognitive Load Theory"
|
|
295
|
+
* Procedural fluency reduces cognitive load for multi-step tasks.
|
|
296
|
+
* Low fluency users skip steps, confuse order, need more scaffolding.
|
|
297
|
+
*
|
|
298
|
+
* @see Kirschner (2002) - "Cognitive load theory: implications for design"
|
|
299
|
+
* @see Mayer & Moreno (2003) - "Nine ways to reduce cognitive load"
|
|
300
|
+
*/
|
|
301
|
+
proceduralFluency?: number;
|
|
302
|
+
/**
|
|
303
|
+
* Ability to apply knowledge from familiar UIs to new ones (0 = struggles with new UIs, 1 = transfers easily)
|
|
304
|
+
*
|
|
305
|
+
* Research basis: Barnett & Ceci (2002) - "When and Where Do We Apply What We Learn?"
|
|
306
|
+
* High transfer users recognize patterns (hamburger menu, search icon, cart).
|
|
307
|
+
* Low transfer users treat each interface as completely novel.
|
|
308
|
+
*
|
|
309
|
+
* @see Singley & Anderson (1989) - "The Transfer of Cognitive Skill"
|
|
310
|
+
* @see Perkins & Salomon (1992) - "Transfer of learning"
|
|
311
|
+
*/
|
|
312
|
+
transferLearning?: number;
|
|
313
|
+
/**
|
|
314
|
+
* Compliance with perceived authority figures/cues (0 = questions authority, 1 = follows authority)
|
|
315
|
+
*
|
|
316
|
+
* Research basis: Milgram (1963) - "Behavioral Study of Obedience"
|
|
317
|
+
* High sensitivity users trust official badges, admin messages, formal language.
|
|
318
|
+
* Low sensitivity users verify claims, question unusual requests.
|
|
319
|
+
*
|
|
320
|
+
* @see Cialdini (2001) - "Influence: Science and Practice" (Authority principle)
|
|
321
|
+
* @see Fogg (2003) - "Prominence-Interpretation Theory"
|
|
322
|
+
*/
|
|
323
|
+
authoritySensitivity?: number;
|
|
324
|
+
/**
|
|
325
|
+
* Susceptibility to mood influence from UI tone/feedback (0 = mood-stable, 1 = highly influenced)
|
|
326
|
+
*
|
|
327
|
+
* Research basis: Hatfield et al. (1993) - "Emotional Contagion"
|
|
328
|
+
* UI emotional tone (friendly vs. stern) affects user emotional state.
|
|
329
|
+
* High contagion users adopt interface mood; low contagion users remain stable.
|
|
330
|
+
*
|
|
331
|
+
* @see Brave & Nass (2003) - "Emotion in human-computer interaction"
|
|
332
|
+
* @see Hancock et al. (2008) - "Expressing emotion in text-based communication"
|
|
333
|
+
*/
|
|
334
|
+
emotionalContagion?: number;
|
|
335
|
+
/**
|
|
336
|
+
* Tendency toward FOMO-driven decisions (0 = unaffected by scarcity, 1 = highly FOMO-driven)
|
|
337
|
+
*
|
|
338
|
+
* Research basis: Przybylski et al. (2013) - "Motivational, emotional, and behavioral correlates of FoMO"
|
|
339
|
+
* FOMO users click urgency cues (limited time, low stock, flash sales).
|
|
340
|
+
* Low FOMO users evaluate offers independently of artificial scarcity.
|
|
341
|
+
*
|
|
342
|
+
* @see Cialdini (2001) - "Influence" (Scarcity principle)
|
|
343
|
+
* @see Worchel et al. (1975) - "Effects of supply and demand on ratings of object value"
|
|
344
|
+
*/
|
|
345
|
+
fearOfMissingOut?: number;
|
|
346
|
+
/**
|
|
347
|
+
* Influence of social proof on decisions (0 = ignores others, 1 = heavily influenced by reviews)
|
|
348
|
+
*
|
|
349
|
+
* Research basis: Cialdini (2001) - "Influence" (Social proof principle)
|
|
350
|
+
* High sensitivity users prioritize star ratings, testimonials, user counts.
|
|
351
|
+
* Low sensitivity users evaluate products on features alone.
|
|
352
|
+
*
|
|
353
|
+
* @see Sperling & Moran (2020) - "The effects of social proof on decision making"
|
|
354
|
+
* @see Chen et al. (2008) - "Online social interactions: A natural experiment"
|
|
355
|
+
*/
|
|
356
|
+
socialProofSensitivity?: number;
|
|
357
|
+
/**
|
|
358
|
+
* Flexibility in adapting mental models to unexpected UI patterns (0 = rigid, 1 = highly adaptive)
|
|
359
|
+
*
|
|
360
|
+
* Research basis: Johnson-Laird (1983) - "Mental Models"
|
|
361
|
+
* Rigid users struggle when conventions are broken (unusual navigation, novel patterns).
|
|
362
|
+
* Adaptive users quickly form new mental models for unfamiliar interfaces.
|
|
363
|
+
*
|
|
364
|
+
* @see Norman (1988) - "The Design of Everyday Things"
|
|
365
|
+
* @see Gentner & Stevens (1983) - "Mental Models"
|
|
366
|
+
*/
|
|
367
|
+
mentalModelRigidity?: number;
|
|
225
368
|
}
|
|
226
369
|
/**
|
|
227
370
|
* Attention patterns that define how a persona visually scans pages.
|
|
@@ -3222,4 +3365,145 @@ export interface AccessibilityPersona extends Omit<Persona, 'cognitiveTraits'> {
|
|
|
3222
3365
|
/** Cognitive traits (optional partial override) */
|
|
3223
3366
|
cognitiveTraits?: Partial<CognitiveTraits>;
|
|
3224
3367
|
}
|
|
3368
|
+
/**
|
|
3369
|
+
* Domain authorization for stealth mode
|
|
3370
|
+
* Users must explicitly declare which domains they're authorized to test
|
|
3371
|
+
*/
|
|
3372
|
+
export interface StealthAuthorization {
|
|
3373
|
+
/** Domains user owns or has explicit permission to test (supports wildcards) */
|
|
3374
|
+
authorizedDomains: string[];
|
|
3375
|
+
/** Domains explicitly blocked even if matched by wildcard */
|
|
3376
|
+
blockedDomains: string[];
|
|
3377
|
+
/** Require explicit authorization for stealth mode */
|
|
3378
|
+
requireExplicitAuth: boolean;
|
|
3379
|
+
/** How authorization was provided */
|
|
3380
|
+
authorizationSource?: "config" | "cli-flag" | "environment" | "api";
|
|
3381
|
+
}
|
|
3382
|
+
/**
|
|
3383
|
+
* Constitutional stealth configuration
|
|
3384
|
+
*/
|
|
3385
|
+
export interface StealthConfig {
|
|
3386
|
+
/** Whether stealth mode is enabled */
|
|
3387
|
+
enabled: boolean;
|
|
3388
|
+
/** Domain authorization settings */
|
|
3389
|
+
authorization: StealthAuthorization;
|
|
3390
|
+
/** User acknowledgment of ethical use terms */
|
|
3391
|
+
acknowledgment?: StealthAcknowledgment;
|
|
3392
|
+
/** Rate limits (cannot be disabled) */
|
|
3393
|
+
rateLimits: StealthRateLimits;
|
|
3394
|
+
/** Stealth features to enable */
|
|
3395
|
+
features?: StealthFeatures;
|
|
3396
|
+
}
|
|
3397
|
+
/**
|
|
3398
|
+
* User acknowledgment of ethical use terms
|
|
3399
|
+
*/
|
|
3400
|
+
export interface StealthAcknowledgment {
|
|
3401
|
+
/** User confirms ownership/authorization for listed domains */
|
|
3402
|
+
ownershipConfirmed: boolean;
|
|
3403
|
+
/** User confirms authorized testing only */
|
|
3404
|
+
authorizedTestingOnly: boolean;
|
|
3405
|
+
/** User accepts legal responsibility */
|
|
3406
|
+
acceptsResponsibility: boolean;
|
|
3407
|
+
/** Email or identifier of person signing */
|
|
3408
|
+
signedBy: string;
|
|
3409
|
+
/** Timestamp of signing */
|
|
3410
|
+
signedAt: string;
|
|
3411
|
+
}
|
|
3412
|
+
/**
|
|
3413
|
+
* Rate limits for stealth mode (cannot be disabled)
|
|
3414
|
+
*/
|
|
3415
|
+
export interface StealthRateLimits {
|
|
3416
|
+
/** Max requests per minute */
|
|
3417
|
+
requestsPerMinute: number;
|
|
3418
|
+
/** Max form submissions per minute */
|
|
3419
|
+
formsPerMinute: number;
|
|
3420
|
+
/** Max auth attempts per minute */
|
|
3421
|
+
authAttemptsPerMinute: number;
|
|
3422
|
+
}
|
|
3423
|
+
/**
|
|
3424
|
+
* Stealth features that can be enabled
|
|
3425
|
+
*/
|
|
3426
|
+
export interface StealthFeatures {
|
|
3427
|
+
/** Remove webdriver flag */
|
|
3428
|
+
hideWebdriver?: boolean;
|
|
3429
|
+
/** Use headed mode (less detectable) */
|
|
3430
|
+
headedMode?: boolean;
|
|
3431
|
+
/** Randomize fingerprints */
|
|
3432
|
+
fingerprintRandomization?: boolean;
|
|
3433
|
+
/** Use stealth plugin */
|
|
3434
|
+
stealthPlugin?: boolean;
|
|
3435
|
+
/** Emulate human-like timing (CBrowser default) */
|
|
3436
|
+
humanTiming?: boolean;
|
|
3437
|
+
}
|
|
3438
|
+
/**
|
|
3439
|
+
* Audit entry for stealth actions (immutable, 90-day retention)
|
|
3440
|
+
*/
|
|
3441
|
+
export interface StealthAuditEntry {
|
|
3442
|
+
/** Timestamp of action */
|
|
3443
|
+
timestamp: string;
|
|
3444
|
+
/** Action performed */
|
|
3445
|
+
action: string;
|
|
3446
|
+
/** Target URL */
|
|
3447
|
+
url: string;
|
|
3448
|
+
/** Whether stealth was enabled */
|
|
3449
|
+
stealthEnabled: boolean;
|
|
3450
|
+
/** How authorization was provided */
|
|
3451
|
+
authorizationSource: string;
|
|
3452
|
+
/** Which authorized domain matched */
|
|
3453
|
+
authorizedDomain: string;
|
|
3454
|
+
/** Constitutional zone classification */
|
|
3455
|
+
zone: ActionZone;
|
|
3456
|
+
/** Whether force override was used */
|
|
3457
|
+
forceOverride?: boolean;
|
|
3458
|
+
/** Reason for force override */
|
|
3459
|
+
forceReason?: string;
|
|
3460
|
+
/** Requests in last minute (rate limit context) */
|
|
3461
|
+
requestsInLastMinute: number;
|
|
3462
|
+
/** Forms submitted in last minute */
|
|
3463
|
+
formsInLastMinute: number;
|
|
3464
|
+
}
|
|
3465
|
+
/**
|
|
3466
|
+
* Result of constitutional check before stealth action
|
|
3467
|
+
*/
|
|
3468
|
+
export interface StealthCheckResult {
|
|
3469
|
+
/** Whether action is allowed */
|
|
3470
|
+
allowed: boolean;
|
|
3471
|
+
/** Constitutional zone */
|
|
3472
|
+
zone: ActionZone;
|
|
3473
|
+
/** Reason if blocked */
|
|
3474
|
+
reason?: string;
|
|
3475
|
+
/** Whether user confirmation is required */
|
|
3476
|
+
requiresConfirmation?: boolean;
|
|
3477
|
+
/** Suggested alternative if blocked */
|
|
3478
|
+
suggestion?: string;
|
|
3479
|
+
}
|
|
3480
|
+
/**
|
|
3481
|
+
* Actions that are NEVER allowed with stealth mode (Black Zone)
|
|
3482
|
+
*/
|
|
3483
|
+
export declare const STEALTH_PROHIBITED_ACTIONS: readonly ["bypass_captcha", "inject_cookies", "spoof_identity", "mass_account_creation", "credential_stuffing", "rate_limit_bypass"];
|
|
3484
|
+
export type StealthProhibitedAction = typeof STEALTH_PROHIBITED_ACTIONS[number];
|
|
3485
|
+
/**
|
|
3486
|
+
* Domain patterns that are NEVER allowed with stealth mode
|
|
3487
|
+
*/
|
|
3488
|
+
export declare const STEALTH_PROHIBITED_DOMAINS: readonly ["*.gov", "*.mil", "*.edu"];
|
|
3489
|
+
export type StealthProhibitedDomain = typeof STEALTH_PROHIBITED_DOMAINS[number];
|
|
3490
|
+
/**
|
|
3491
|
+
* Abstract interface for constitutional enforcer
|
|
3492
|
+
* Implementation provided by cbrowser-enterprise
|
|
3493
|
+
*/
|
|
3494
|
+
export interface IConstitutionalEnforcer {
|
|
3495
|
+
/** Check if stealth action is allowed */
|
|
3496
|
+
canExecuteWithStealth(action: string, url: string): Promise<StealthCheckResult>;
|
|
3497
|
+
/** Log audit entry (immutable) */
|
|
3498
|
+
logAudit(entry: Omit<StealthAuditEntry, "timestamp">): Promise<void>;
|
|
3499
|
+
/** Check if domain is authorized */
|
|
3500
|
+
isDomainAuthorized(url: string): boolean;
|
|
3501
|
+
/** Get current rate limit status */
|
|
3502
|
+
getRateLimitStatus(): {
|
|
3503
|
+
remaining: number;
|
|
3504
|
+
resetsAt: Date;
|
|
3505
|
+
};
|
|
3506
|
+
/** Validate acknowledgment */
|
|
3507
|
+
validateAcknowledgment(ack: StealthAcknowledgment): boolean;
|
|
3508
|
+
}
|
|
3225
3509
|
//# sourceMappingURL=types.d.ts.map
|