UNPKG

@dawans/promptshield

Version:

Secure your LLM stack with enterprise-grade RulePacks for AI safety scanning

42 lines (41 loc) 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScanRequest = void 0; /** * Represents a scan request with input data and configuration */ class ScanRequest { constructor(input, config, timestamp = new Date()) { this.input = input; this.config = config; this.timestamp = timestamp; } /** * Creates a scan request with default configuration */ static create(input, config = {}) { const defaultConfig = { rulepack: 'default', outputFormat: 'markdown', severity: ['low', 'medium', 'high', 'critical'], category: [], fields: ['prompt', 'response'], maxObjects: undefined, maxDepth: 4, scanEntireObject: false, ndjsonMode: false, streamingThreshold: 1000, memoryWarningThreshold: 0.8, parallel: false, batchSize: 10, timeout: 300, quiet: false, verbose: false, debug: false, strict: false, ...config, }; return new ScanRequest(input, defaultConfig); } } exports.ScanRequest = ScanRequest;