@surbee/cipher 0.1.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,341 @@
1
+ /**
2
+ * Cipher SDK Types
3
+ *
4
+ * Core type definitions for the Cipher response validation system.
5
+ * Implementation details are hidden - the SDK communicates with Surbee's
6
+ * secure validation engine.
7
+ */
8
+ type CipherTier = 1 | 2 | 3 | 4 | 5;
9
+ type CheckId = 'rapid_completion' | 'uniform_timing' | 'low_interaction' | 'straight_line_answers' | 'impossibly_fast' | 'minimal_effort' | 'excessive_paste' | 'pointer_spikes' | 'webdriver_detected' | 'automation_detected' | 'no_plugins' | 'suspicious_user_agent' | 'device_fingerprint_mismatch' | 'screen_anomaly' | 'suspicious_pauses' | 'robotic_typing' | 'mouse_teleporting' | 'no_corrections' | 'excessive_tab_switching' | 'window_focus_loss' | 'ai_content_basic' | 'contradiction_basic' | 'hover_behavior' | 'scroll_patterns' | 'mouse_acceleration' | 'vpn_detection' | 'datacenter_ip' | 'plagiarism_basic' | 'quality_assessment' | 'semantic_analysis' | 'ai_content_full' | 'contradiction_full' | 'plagiarism_full' | 'fraud_ring_detection' | 'answer_sharing' | 'coordinated_timing' | 'device_sharing' | 'tor_detection' | 'proxy_detection' | 'timezone_validation' | 'baseline_deviation' | 'perplexity_analysis' | 'burstiness_analysis';
10
+ interface CheckResult {
11
+ /** The check that was run */
12
+ checkId: CheckId;
13
+ /** Whether the check passed */
14
+ passed: boolean;
15
+ /** Suspicion score (0-1, higher = more suspicious) */
16
+ score: number;
17
+ /** Human-readable details */
18
+ details?: string;
19
+ }
20
+ interface ResponseInput {
21
+ /** The question text */
22
+ question: string;
23
+ /** The user's answer */
24
+ answer: string;
25
+ /** Question type for context */
26
+ questionType?: 'text' | 'multiple_choice' | 'rating' | 'scale' | 'boolean';
27
+ /** Time spent on this question in milliseconds */
28
+ responseTimeMs?: number;
29
+ /** Question index in the survey */
30
+ questionIndex?: number;
31
+ }
32
+ interface ValidationInput {
33
+ /** Array of question/answer pairs */
34
+ responses: ResponseInput[];
35
+ /** Behavioral metrics from client-side tracking */
36
+ behavioralMetrics?: BehavioralMetrics;
37
+ /** Device/browser information */
38
+ deviceInfo?: DeviceInfo;
39
+ /** Survey context */
40
+ context?: SurveyContext;
41
+ }
42
+ interface SurveyContext {
43
+ /** Survey ID for cross-respondent analysis */
44
+ surveyId?: string;
45
+ /** Expected completion time in seconds */
46
+ expectedDurationSeconds?: number;
47
+ /** Actual completion time in seconds */
48
+ actualDurationSeconds?: number;
49
+ /** Survey type for context-aware analysis */
50
+ surveyType?: 'nps' | 'csat' | 'research' | 'feedback' | 'quiz';
51
+ /** Total number of questions */
52
+ totalQuestions?: number;
53
+ }
54
+ interface BehavioralMetrics {
55
+ sessionId: string;
56
+ startedAt: number;
57
+ duration: number;
58
+ lastActiveAt: number;
59
+ mouseMovements: MouseMovement[];
60
+ mouseClicks: MouseClick[];
61
+ mouseMovementCount: number;
62
+ avgMouseVelocity: number;
63
+ keystrokeDynamics: KeystrokeEvent[];
64
+ keypressCount: number;
65
+ backspaceCount: number;
66
+ avgKeystrokeDwell: number;
67
+ keystrokeVariance: number;
68
+ scrollEvents: ScrollEvent[];
69
+ scrollEventCount: number;
70
+ focusEvents: FocusEvent[];
71
+ tabSwitchCount: number;
72
+ totalBlurDuration: number;
73
+ pasteEvents: number;
74
+ copyEvents: number;
75
+ hoverEvents: HoverEvent[];
76
+ responseTime: number[];
77
+ questionStartTimes: Record<string, number>;
78
+ }
79
+ interface MouseMovement {
80
+ x: number;
81
+ y: number;
82
+ t: number;
83
+ velocity: number;
84
+ }
85
+ interface MouseClick {
86
+ x: number;
87
+ y: number;
88
+ t: number;
89
+ hadHover: boolean;
90
+ }
91
+ interface KeystrokeEvent {
92
+ key: string;
93
+ downAt: number;
94
+ upAt: number;
95
+ dwell: number;
96
+ flightTime: number;
97
+ }
98
+ interface ScrollEvent {
99
+ y: number;
100
+ t: number;
101
+ velocity: number;
102
+ }
103
+ interface FocusEvent {
104
+ type: 'focus' | 'blur' | 'hidden' | 'visible';
105
+ t: number;
106
+ }
107
+ interface HoverEvent {
108
+ element: string;
109
+ duration: number;
110
+ t: number;
111
+ }
112
+ interface DeviceInfo {
113
+ userAgent: string;
114
+ platform: string;
115
+ language: string;
116
+ languages: string[];
117
+ timezone: string;
118
+ timezoneOffset: number;
119
+ screenWidth: number;
120
+ screenHeight: number;
121
+ screenAvailWidth: number;
122
+ screenAvailHeight: number;
123
+ colorDepth: number;
124
+ pixelRatio: number;
125
+ touchSupport: boolean;
126
+ maxTouchPoints: number;
127
+ hardwareConcurrency: number;
128
+ deviceMemory: number;
129
+ cookiesEnabled: boolean;
130
+ webDriver: boolean;
131
+ automationDetected: boolean;
132
+ canvasFingerprint: string | null;
133
+ webglVendor: string | null;
134
+ webglRenderer: string | null;
135
+ pluginCount: number;
136
+ collectedAt: number;
137
+ }
138
+ interface ValidationResult {
139
+ /** Overall quality score (0-1, higher = better quality) */
140
+ score: number;
141
+ /** Whether the response passed validation */
142
+ passed: boolean;
143
+ /** Recommendation for the response */
144
+ recommendation: 'keep' | 'review' | 'discard';
145
+ /** Confidence in the assessment (0-1) */
146
+ confidence: number;
147
+ /** Flags that were triggered */
148
+ flags: string[];
149
+ /** Human-readable summary analysis */
150
+ summary: ValidationSummary;
151
+ /** Detailed check results */
152
+ checks: CheckResult[];
153
+ /** Processing metadata */
154
+ meta: ValidationMeta;
155
+ }
156
+ interface ValidationSummary {
157
+ /** Short verdict (e.g., "Likely legitimate", "Suspected bot") */
158
+ verdict: string;
159
+ /** List of issues found */
160
+ issues: string[];
161
+ /** List of positive signals */
162
+ positives: string[];
163
+ /** Actionable suggestion for the user */
164
+ suggestion: string;
165
+ }
166
+ interface ValidationMeta {
167
+ /** Tier used for validation */
168
+ tier: CipherTier;
169
+ /** Processing time in milliseconds */
170
+ processingTimeMs: number;
171
+ /** Number of checks run */
172
+ checksRun: number;
173
+ /** Number of checks passed */
174
+ checksPassed: number;
175
+ /** Request ID for support */
176
+ requestId: string;
177
+ /** Timestamp */
178
+ timestamp: number;
179
+ }
180
+ interface CipherConfig {
181
+ /**
182
+ * API key from Surbee dashboard (Settings > API Keys)
183
+ * Format: cipher_sk_...
184
+ */
185
+ apiKey: string;
186
+ /**
187
+ * Validation tier (1-5)
188
+ * - Tier 1-2: Basic checks (~free)
189
+ * - Tier 3: Enhanced analysis
190
+ * - Tier 4: Advanced validation
191
+ * - Tier 5: Maximum accuracy
192
+ */
193
+ tier?: CipherTier;
194
+ /** Custom thresholds */
195
+ thresholds?: {
196
+ /** Score below this = fail (default: 0.4) */
197
+ fail?: number;
198
+ /** Score below this = review (default: 0.7) */
199
+ review?: number;
200
+ };
201
+ /** Enable debug logging */
202
+ debug?: boolean;
203
+ /** Custom API endpoint (for enterprise/self-hosted) */
204
+ endpoint?: string;
205
+ }
206
+ interface BatchValidationInput {
207
+ submissions: ValidationInput[];
208
+ /** Enable cross-submission fraud detection (tier 5) */
209
+ crossAnalysis?: boolean;
210
+ }
211
+ interface BatchValidationResult {
212
+ results: ValidationResult[];
213
+ summary: {
214
+ total: number;
215
+ passed: number;
216
+ review: number;
217
+ failed: number;
218
+ avgScore: number;
219
+ };
220
+ /** Cross-submission fraud indicators (tier 5 only) */
221
+ fraudIndicators?: FraudIndicators;
222
+ }
223
+ interface FraudIndicators {
224
+ /** Response IDs with duplicate answers */
225
+ duplicateAnswers: string[];
226
+ /** Whether coordinated timing was detected */
227
+ coordinatedTiming: boolean;
228
+ /** Whether device sharing was detected */
229
+ deviceSharing: boolean;
230
+ /** Fraud ring score (0-1) */
231
+ fraudRingScore: number;
232
+ }
233
+ interface CipherError {
234
+ code: CipherErrorCode;
235
+ message: string;
236
+ details?: Record<string, unknown>;
237
+ }
238
+ type CipherErrorCode = 'INVALID_API_KEY' | 'RATE_LIMITED' | 'INSUFFICIENT_CREDITS' | 'INVALID_INPUT' | 'TIER_NOT_AVAILABLE' | 'SERVER_ERROR' | 'NETWORK_ERROR';
239
+
240
+ /**
241
+ * Cipher - AI-powered survey response validation
242
+ *
243
+ * Main class for validating survey responses through Surbee's
244
+ * secure validation engine.
245
+ *
246
+ * ```typescript
247
+ * import { Cipher } from '@surbee/cipher';
248
+ *
249
+ * const cipher = new Cipher({ apiKey: 'cipher_sk_...' });
250
+ * const result = await cipher.validate(input);
251
+ * ```
252
+ */
253
+
254
+ /**
255
+ * Cipher SDK
256
+ */
257
+ declare class Cipher {
258
+ private config;
259
+ constructor(config: CipherConfig);
260
+ /**
261
+ * Validate a single response
262
+ */
263
+ validate(input: ValidationInput): Promise<ValidationResult>;
264
+ /**
265
+ * Validate multiple responses in batch
266
+ */
267
+ validateBatch(input: BatchValidationInput): Promise<BatchValidationResult>;
268
+ /**
269
+ * Get tier information
270
+ */
271
+ getTierInfo(tier?: CipherTier): {
272
+ name: string;
273
+ description: string;
274
+ checksCount: number;
275
+ };
276
+ /**
277
+ * Get all available tiers
278
+ */
279
+ getAllTiers(): {
280
+ name: string;
281
+ description: string;
282
+ checksCount: number;
283
+ tier: CipherTier;
284
+ }[];
285
+ /**
286
+ * Check API key validity and credits
287
+ */
288
+ checkStatus(): Promise<{
289
+ valid: boolean;
290
+ credits: number;
291
+ tier: CipherTier;
292
+ rateLimit: {
293
+ remaining: number;
294
+ resetAt: number;
295
+ };
296
+ }>;
297
+ /**
298
+ * Make API request to Surbee
299
+ */
300
+ private request;
301
+ /**
302
+ * Create a typed error
303
+ */
304
+ private createError;
305
+ }
306
+
307
+ /**
308
+ * @surbee/cipher - AI-powered survey response validation SDK
309
+ *
310
+ * Detect fraudulent survey responses with Surbee's secure validation engine.
311
+ * All processing happens server-side - no algorithms or models are exposed.
312
+ *
313
+ * @example
314
+ * ```typescript
315
+ * import { Cipher } from '@surbee/cipher';
316
+ *
317
+ * // Initialize with your API key from Settings > API Keys
318
+ * const cipher = new Cipher({
319
+ * apiKey: 'cipher_sk_...',
320
+ * tier: 4, // 1-5, higher = more checks
321
+ * });
322
+ *
323
+ * // Validate a response
324
+ * const result = await cipher.validate({
325
+ * responses: [
326
+ * { question: 'What do you think?', answer: 'Great product!' }
327
+ * ],
328
+ * behavioralMetrics: tracker.getMetrics(),
329
+ * deviceInfo: tracker.getDeviceInfo(),
330
+ * });
331
+ *
332
+ * console.log(result.score); // 0.92
333
+ * console.log(result.recommendation); // 'keep' | 'review' | 'discard'
334
+ * ```
335
+ *
336
+ * @packageDocumentation
337
+ */
338
+
339
+ declare const VERSION = "0.1.0";
340
+
341
+ export { type BatchValidationInput, type BatchValidationResult, type BehavioralMetrics, type CheckId, type CheckResult, Cipher, type CipherConfig, type CipherError, type CipherErrorCode, type CipherTier, type DeviceInfo, type FocusEvent, type FraudIndicators, type HoverEvent, type KeystrokeEvent, type MouseClick, type MouseMovement, type ResponseInput, type ScrollEvent, type SurveyContext, VERSION, type ValidationInput, type ValidationMeta, type ValidationResult, type ValidationSummary };
@@ -0,0 +1,341 @@
1
+ /**
2
+ * Cipher SDK Types
3
+ *
4
+ * Core type definitions for the Cipher response validation system.
5
+ * Implementation details are hidden - the SDK communicates with Surbee's
6
+ * secure validation engine.
7
+ */
8
+ type CipherTier = 1 | 2 | 3 | 4 | 5;
9
+ type CheckId = 'rapid_completion' | 'uniform_timing' | 'low_interaction' | 'straight_line_answers' | 'impossibly_fast' | 'minimal_effort' | 'excessive_paste' | 'pointer_spikes' | 'webdriver_detected' | 'automation_detected' | 'no_plugins' | 'suspicious_user_agent' | 'device_fingerprint_mismatch' | 'screen_anomaly' | 'suspicious_pauses' | 'robotic_typing' | 'mouse_teleporting' | 'no_corrections' | 'excessive_tab_switching' | 'window_focus_loss' | 'ai_content_basic' | 'contradiction_basic' | 'hover_behavior' | 'scroll_patterns' | 'mouse_acceleration' | 'vpn_detection' | 'datacenter_ip' | 'plagiarism_basic' | 'quality_assessment' | 'semantic_analysis' | 'ai_content_full' | 'contradiction_full' | 'plagiarism_full' | 'fraud_ring_detection' | 'answer_sharing' | 'coordinated_timing' | 'device_sharing' | 'tor_detection' | 'proxy_detection' | 'timezone_validation' | 'baseline_deviation' | 'perplexity_analysis' | 'burstiness_analysis';
10
+ interface CheckResult {
11
+ /** The check that was run */
12
+ checkId: CheckId;
13
+ /** Whether the check passed */
14
+ passed: boolean;
15
+ /** Suspicion score (0-1, higher = more suspicious) */
16
+ score: number;
17
+ /** Human-readable details */
18
+ details?: string;
19
+ }
20
+ interface ResponseInput {
21
+ /** The question text */
22
+ question: string;
23
+ /** The user's answer */
24
+ answer: string;
25
+ /** Question type for context */
26
+ questionType?: 'text' | 'multiple_choice' | 'rating' | 'scale' | 'boolean';
27
+ /** Time spent on this question in milliseconds */
28
+ responseTimeMs?: number;
29
+ /** Question index in the survey */
30
+ questionIndex?: number;
31
+ }
32
+ interface ValidationInput {
33
+ /** Array of question/answer pairs */
34
+ responses: ResponseInput[];
35
+ /** Behavioral metrics from client-side tracking */
36
+ behavioralMetrics?: BehavioralMetrics;
37
+ /** Device/browser information */
38
+ deviceInfo?: DeviceInfo;
39
+ /** Survey context */
40
+ context?: SurveyContext;
41
+ }
42
+ interface SurveyContext {
43
+ /** Survey ID for cross-respondent analysis */
44
+ surveyId?: string;
45
+ /** Expected completion time in seconds */
46
+ expectedDurationSeconds?: number;
47
+ /** Actual completion time in seconds */
48
+ actualDurationSeconds?: number;
49
+ /** Survey type for context-aware analysis */
50
+ surveyType?: 'nps' | 'csat' | 'research' | 'feedback' | 'quiz';
51
+ /** Total number of questions */
52
+ totalQuestions?: number;
53
+ }
54
+ interface BehavioralMetrics {
55
+ sessionId: string;
56
+ startedAt: number;
57
+ duration: number;
58
+ lastActiveAt: number;
59
+ mouseMovements: MouseMovement[];
60
+ mouseClicks: MouseClick[];
61
+ mouseMovementCount: number;
62
+ avgMouseVelocity: number;
63
+ keystrokeDynamics: KeystrokeEvent[];
64
+ keypressCount: number;
65
+ backspaceCount: number;
66
+ avgKeystrokeDwell: number;
67
+ keystrokeVariance: number;
68
+ scrollEvents: ScrollEvent[];
69
+ scrollEventCount: number;
70
+ focusEvents: FocusEvent[];
71
+ tabSwitchCount: number;
72
+ totalBlurDuration: number;
73
+ pasteEvents: number;
74
+ copyEvents: number;
75
+ hoverEvents: HoverEvent[];
76
+ responseTime: number[];
77
+ questionStartTimes: Record<string, number>;
78
+ }
79
+ interface MouseMovement {
80
+ x: number;
81
+ y: number;
82
+ t: number;
83
+ velocity: number;
84
+ }
85
+ interface MouseClick {
86
+ x: number;
87
+ y: number;
88
+ t: number;
89
+ hadHover: boolean;
90
+ }
91
+ interface KeystrokeEvent {
92
+ key: string;
93
+ downAt: number;
94
+ upAt: number;
95
+ dwell: number;
96
+ flightTime: number;
97
+ }
98
+ interface ScrollEvent {
99
+ y: number;
100
+ t: number;
101
+ velocity: number;
102
+ }
103
+ interface FocusEvent {
104
+ type: 'focus' | 'blur' | 'hidden' | 'visible';
105
+ t: number;
106
+ }
107
+ interface HoverEvent {
108
+ element: string;
109
+ duration: number;
110
+ t: number;
111
+ }
112
+ interface DeviceInfo {
113
+ userAgent: string;
114
+ platform: string;
115
+ language: string;
116
+ languages: string[];
117
+ timezone: string;
118
+ timezoneOffset: number;
119
+ screenWidth: number;
120
+ screenHeight: number;
121
+ screenAvailWidth: number;
122
+ screenAvailHeight: number;
123
+ colorDepth: number;
124
+ pixelRatio: number;
125
+ touchSupport: boolean;
126
+ maxTouchPoints: number;
127
+ hardwareConcurrency: number;
128
+ deviceMemory: number;
129
+ cookiesEnabled: boolean;
130
+ webDriver: boolean;
131
+ automationDetected: boolean;
132
+ canvasFingerprint: string | null;
133
+ webglVendor: string | null;
134
+ webglRenderer: string | null;
135
+ pluginCount: number;
136
+ collectedAt: number;
137
+ }
138
+ interface ValidationResult {
139
+ /** Overall quality score (0-1, higher = better quality) */
140
+ score: number;
141
+ /** Whether the response passed validation */
142
+ passed: boolean;
143
+ /** Recommendation for the response */
144
+ recommendation: 'keep' | 'review' | 'discard';
145
+ /** Confidence in the assessment (0-1) */
146
+ confidence: number;
147
+ /** Flags that were triggered */
148
+ flags: string[];
149
+ /** Human-readable summary analysis */
150
+ summary: ValidationSummary;
151
+ /** Detailed check results */
152
+ checks: CheckResult[];
153
+ /** Processing metadata */
154
+ meta: ValidationMeta;
155
+ }
156
+ interface ValidationSummary {
157
+ /** Short verdict (e.g., "Likely legitimate", "Suspected bot") */
158
+ verdict: string;
159
+ /** List of issues found */
160
+ issues: string[];
161
+ /** List of positive signals */
162
+ positives: string[];
163
+ /** Actionable suggestion for the user */
164
+ suggestion: string;
165
+ }
166
+ interface ValidationMeta {
167
+ /** Tier used for validation */
168
+ tier: CipherTier;
169
+ /** Processing time in milliseconds */
170
+ processingTimeMs: number;
171
+ /** Number of checks run */
172
+ checksRun: number;
173
+ /** Number of checks passed */
174
+ checksPassed: number;
175
+ /** Request ID for support */
176
+ requestId: string;
177
+ /** Timestamp */
178
+ timestamp: number;
179
+ }
180
+ interface CipherConfig {
181
+ /**
182
+ * API key from Surbee dashboard (Settings > API Keys)
183
+ * Format: cipher_sk_...
184
+ */
185
+ apiKey: string;
186
+ /**
187
+ * Validation tier (1-5)
188
+ * - Tier 1-2: Basic checks (~free)
189
+ * - Tier 3: Enhanced analysis
190
+ * - Tier 4: Advanced validation
191
+ * - Tier 5: Maximum accuracy
192
+ */
193
+ tier?: CipherTier;
194
+ /** Custom thresholds */
195
+ thresholds?: {
196
+ /** Score below this = fail (default: 0.4) */
197
+ fail?: number;
198
+ /** Score below this = review (default: 0.7) */
199
+ review?: number;
200
+ };
201
+ /** Enable debug logging */
202
+ debug?: boolean;
203
+ /** Custom API endpoint (for enterprise/self-hosted) */
204
+ endpoint?: string;
205
+ }
206
+ interface BatchValidationInput {
207
+ submissions: ValidationInput[];
208
+ /** Enable cross-submission fraud detection (tier 5) */
209
+ crossAnalysis?: boolean;
210
+ }
211
+ interface BatchValidationResult {
212
+ results: ValidationResult[];
213
+ summary: {
214
+ total: number;
215
+ passed: number;
216
+ review: number;
217
+ failed: number;
218
+ avgScore: number;
219
+ };
220
+ /** Cross-submission fraud indicators (tier 5 only) */
221
+ fraudIndicators?: FraudIndicators;
222
+ }
223
+ interface FraudIndicators {
224
+ /** Response IDs with duplicate answers */
225
+ duplicateAnswers: string[];
226
+ /** Whether coordinated timing was detected */
227
+ coordinatedTiming: boolean;
228
+ /** Whether device sharing was detected */
229
+ deviceSharing: boolean;
230
+ /** Fraud ring score (0-1) */
231
+ fraudRingScore: number;
232
+ }
233
+ interface CipherError {
234
+ code: CipherErrorCode;
235
+ message: string;
236
+ details?: Record<string, unknown>;
237
+ }
238
+ type CipherErrorCode = 'INVALID_API_KEY' | 'RATE_LIMITED' | 'INSUFFICIENT_CREDITS' | 'INVALID_INPUT' | 'TIER_NOT_AVAILABLE' | 'SERVER_ERROR' | 'NETWORK_ERROR';
239
+
240
+ /**
241
+ * Cipher - AI-powered survey response validation
242
+ *
243
+ * Main class for validating survey responses through Surbee's
244
+ * secure validation engine.
245
+ *
246
+ * ```typescript
247
+ * import { Cipher } from '@surbee/cipher';
248
+ *
249
+ * const cipher = new Cipher({ apiKey: 'cipher_sk_...' });
250
+ * const result = await cipher.validate(input);
251
+ * ```
252
+ */
253
+
254
+ /**
255
+ * Cipher SDK
256
+ */
257
+ declare class Cipher {
258
+ private config;
259
+ constructor(config: CipherConfig);
260
+ /**
261
+ * Validate a single response
262
+ */
263
+ validate(input: ValidationInput): Promise<ValidationResult>;
264
+ /**
265
+ * Validate multiple responses in batch
266
+ */
267
+ validateBatch(input: BatchValidationInput): Promise<BatchValidationResult>;
268
+ /**
269
+ * Get tier information
270
+ */
271
+ getTierInfo(tier?: CipherTier): {
272
+ name: string;
273
+ description: string;
274
+ checksCount: number;
275
+ };
276
+ /**
277
+ * Get all available tiers
278
+ */
279
+ getAllTiers(): {
280
+ name: string;
281
+ description: string;
282
+ checksCount: number;
283
+ tier: CipherTier;
284
+ }[];
285
+ /**
286
+ * Check API key validity and credits
287
+ */
288
+ checkStatus(): Promise<{
289
+ valid: boolean;
290
+ credits: number;
291
+ tier: CipherTier;
292
+ rateLimit: {
293
+ remaining: number;
294
+ resetAt: number;
295
+ };
296
+ }>;
297
+ /**
298
+ * Make API request to Surbee
299
+ */
300
+ private request;
301
+ /**
302
+ * Create a typed error
303
+ */
304
+ private createError;
305
+ }
306
+
307
+ /**
308
+ * @surbee/cipher - AI-powered survey response validation SDK
309
+ *
310
+ * Detect fraudulent survey responses with Surbee's secure validation engine.
311
+ * All processing happens server-side - no algorithms or models are exposed.
312
+ *
313
+ * @example
314
+ * ```typescript
315
+ * import { Cipher } from '@surbee/cipher';
316
+ *
317
+ * // Initialize with your API key from Settings > API Keys
318
+ * const cipher = new Cipher({
319
+ * apiKey: 'cipher_sk_...',
320
+ * tier: 4, // 1-5, higher = more checks
321
+ * });
322
+ *
323
+ * // Validate a response
324
+ * const result = await cipher.validate({
325
+ * responses: [
326
+ * { question: 'What do you think?', answer: 'Great product!' }
327
+ * ],
328
+ * behavioralMetrics: tracker.getMetrics(),
329
+ * deviceInfo: tracker.getDeviceInfo(),
330
+ * });
331
+ *
332
+ * console.log(result.score); // 0.92
333
+ * console.log(result.recommendation); // 'keep' | 'review' | 'discard'
334
+ * ```
335
+ *
336
+ * @packageDocumentation
337
+ */
338
+
339
+ declare const VERSION = "0.1.0";
340
+
341
+ export { type BatchValidationInput, type BatchValidationResult, type BehavioralMetrics, type CheckId, type CheckResult, Cipher, type CipherConfig, type CipherError, type CipherErrorCode, type CipherTier, type DeviceInfo, type FocusEvent, type FraudIndicators, type HoverEvent, type KeystrokeEvent, type MouseClick, type MouseMovement, type ResponseInput, type ScrollEvent, type SurveyContext, VERSION, type ValidationInput, type ValidationMeta, type ValidationResult, type ValidationSummary };