tftsr-devops_investigation/node_modules/chardet/lib/encoding/unicode.js

109 lines
3.1 KiB
JavaScript
Raw Normal View History

feat: initial implementation of TFTSR IT Triage & RCA application Implements Phases 1-8 of the TFTSR implementation plan. Rust backend (Tauri 2.x, src-tauri/): - Multi-provider AI: OpenAI-compatible, Anthropic, Gemini, Mistral, Ollama - PII detection engine: 11 regex patterns with overlap resolution - SQLCipher AES-256 encrypted database with 10 versioned migrations - 28 Tauri IPC commands for triage, analysis, document, and system ops - Ollama: hardware probe, model recommendations, pull/delete with events - RCA and blameless post-mortem Markdown document generators - PDF export via printpdf - Audit log: SHA-256 hash of every external data send - Integration stubs for Confluence, ServiceNow, Azure DevOps (v0.2) Frontend (React 18 + TypeScript + Vite, src/): - 9 pages: full triage workflow NewIssue→LogUpload→Triage→Resolution→RCA→Postmortem→History+Settings - 7 components: ChatWindow, TriageProgress, PiiDiffViewer, DocEditor, HardwareReport, ModelSelector, UI primitives - 3 Zustand stores: session, settings (persisted), history - Type-safe tauriCommands.ts matching Rust backend types exactly - 8 IT domain system prompts (Linux, Windows, Network, K8s, DB, Virt, HW, Obs) DevOps: - .woodpecker/test.yml: rustfmt, clippy, cargo test, tsc, vitest on every push - .woodpecker/release.yml: linux/amd64 + linux/arm64 builds, Gogs release upload Verified: - cargo check: zero errors - tsc --noEmit: zero errors - vitest run: 13/13 unit tests passing Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 03:36:25 +00:00
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UTF_32LE = exports.UTF_32BE = exports.UTF_16LE = exports.UTF_16BE = void 0;
const match_1 = __importDefault(require("../match"));
class UTF_16BE {
name() {
return 'UTF-16BE';
}
match(det) {
const input = det.rawInput;
if (input.length >= 2 &&
(input[0] & 0xff) == 0xfe &&
(input[1] & 0xff) == 0xff) {
return (0, match_1.default)(det, this, 100);
}
return null;
}
}
exports.UTF_16BE = UTF_16BE;
class UTF_16LE {
name() {
return 'UTF-16LE';
}
match(det) {
const input = det.rawInput;
if (input.length >= 2 &&
(input[0] & 0xff) == 0xff &&
(input[1] & 0xff) == 0xfe) {
if (input.length >= 4 && input[2] == 0x00 && input[3] == 0x00) {
return null;
}
return (0, match_1.default)(det, this, 100);
}
return null;
}
}
exports.UTF_16LE = UTF_16LE;
class UTF_32 {
name() {
return 'UTF-32';
}
getChar(_input, _index) {
return -1;
}
match(det) {
let numValid = 0, numInvalid = 0, hasBOM = false, confidence = 0;
const limit = (det.rawLen / 4) * 4;
const input = det.rawInput;
if (limit == 0) {
return null;
}
if (this.getChar(input, 0) == 0x0000feff) {
hasBOM = true;
}
for (let i = 0; i < limit; i += 4) {
const ch = this.getChar(input, i);
if (ch < 0 || ch >= 0x10ffff || (ch >= 0xd800 && ch <= 0xdfff)) {
numInvalid += 1;
}
else {
numValid += 1;
}
}
if (hasBOM && numInvalid == 0) {
confidence = 100;
}
else if (hasBOM && numValid > numInvalid * 10) {
confidence = 80;
}
else if (numValid > 3 && numInvalid == 0) {
confidence = 100;
}
else if (numValid > 0 && numInvalid == 0) {
confidence = 80;
}
else if (numValid > numInvalid * 10) {
confidence = 25;
}
return confidence == 0 ? null : (0, match_1.default)(det, this, confidence);
}
}
class UTF_32BE extends UTF_32 {
name() {
return 'UTF-32BE';
}
getChar(input, index) {
return (((input[index + 0] & 0xff) << 24) |
((input[index + 1] & 0xff) << 16) |
((input[index + 2] & 0xff) << 8) |
(input[index + 3] & 0xff));
}
}
exports.UTF_32BE = UTF_32BE;
class UTF_32LE extends UTF_32 {
name() {
return 'UTF-32LE';
}
getChar(input, index) {
return (((input[index + 3] & 0xff) << 24) |
((input[index + 2] & 0xff) << 16) |
((input[index + 1] & 0xff) << 8) |
(input[index + 0] & 0xff));
}
}
exports.UTF_32LE = UTF_32LE;
//# sourceMappingURL=unicode.js.map