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>
53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.testLine = testLine;
|
|
exports.parseLine = parseLine;
|
|
exports.transformList = transformList;
|
|
const FileInfo_1 = require("./FileInfo");
|
|
/**
|
|
* This parser is based on the FTP client library source code in Apache Commons Net provided
|
|
* under the Apache 2.0 license. It has been simplified and rewritten to better fit the Javascript language.
|
|
*
|
|
* https://github.com/apache/commons-net/blob/master/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
|
|
*/
|
|
const RE_LINE = new RegExp("(\\S+)\\s+(\\S+)\\s+" // MM-dd-yy whitespace hh:mma|kk:mm swallow trailing spaces
|
|
+ "(?:(<DIR>)|([0-9]+))\\s+" // <DIR> or ddddd swallow trailing spaces
|
|
+ "(\\S.*)" // First non-space followed by rest of line (name)
|
|
);
|
|
/**
|
|
* Returns true if a given line might be a DOS-style listing.
|
|
*
|
|
* - Example: `12-05-96 05:03PM <DIR> myDir`
|
|
*/
|
|
function testLine(line) {
|
|
return /^\d{2}/.test(line) && RE_LINE.test(line);
|
|
}
|
|
/**
|
|
* Parse a single line of a DOS-style directory listing.
|
|
*/
|
|
function parseLine(line) {
|
|
const groups = line.match(RE_LINE);
|
|
if (groups === null) {
|
|
return undefined;
|
|
}
|
|
const name = groups[5];
|
|
if (name === "." || name === "..") { // Ignore parent directory links
|
|
return undefined;
|
|
}
|
|
const file = new FileInfo_1.FileInfo(name);
|
|
const fileType = groups[3];
|
|
if (fileType === "<DIR>") {
|
|
file.type = FileInfo_1.FileType.Directory;
|
|
file.size = 0;
|
|
}
|
|
else {
|
|
file.type = FileInfo_1.FileType.File;
|
|
file.size = parseInt(groups[4], 10);
|
|
}
|
|
file.rawModifiedAt = groups[1] + " " + groups[2];
|
|
return file;
|
|
}
|
|
function transformList(files) {
|
|
return files;
|
|
}
|