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>
121 lines
4.1 KiB
JavaScript
121 lines
4.1 KiB
JavaScript
/**
|
|
* ZIP Format Plugin
|
|
*
|
|
* @module plugins/zip
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
*/
|
|
var engine = require('zip-stream');
|
|
var util = require('archiver-utils');
|
|
|
|
/**
|
|
* @constructor
|
|
* @param {ZipOptions} [options]
|
|
* @param {String} [options.comment] Sets the zip archive comment.
|
|
* @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
|
|
* @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
|
|
* @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths.
|
|
* @param {Boolean} [options.store=false] Sets the compression method to STORE.
|
|
* @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
|
*/
|
|
var Zip = function(options) {
|
|
if (!(this instanceof Zip)) {
|
|
return new Zip(options);
|
|
}
|
|
|
|
options = this.options = util.defaults(options, {
|
|
comment: '',
|
|
forceUTC: false,
|
|
namePrependSlash: false,
|
|
store: false
|
|
});
|
|
|
|
this.supports = {
|
|
directory: true,
|
|
symlink: true
|
|
};
|
|
|
|
this.engine = new engine(options);
|
|
};
|
|
|
|
/**
|
|
* @param {(Buffer|Stream)} source
|
|
* @param {ZipEntryData} data
|
|
* @param {String} data.name Sets the entry name including internal path.
|
|
* @param {(String|Date)} [data.date=NOW()] Sets the entry date.
|
|
* @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.
|
|
* @param {String} [data.prefix] Sets a path prefix for the entry name. Useful
|
|
* when working with methods like `directory` or `glob`.
|
|
* @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing
|
|
* for reduction of fs stat calls when stat data is already known.
|
|
* @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE.
|
|
* @param {Function} callback
|
|
* @return void
|
|
*/
|
|
Zip.prototype.append = function(source, data, callback) {
|
|
this.engine.entry(source, data, callback);
|
|
};
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
Zip.prototype.finalize = function() {
|
|
this.engine.finalize();
|
|
};
|
|
|
|
/**
|
|
* @return this.engine
|
|
*/
|
|
Zip.prototype.on = function() {
|
|
return this.engine.on.apply(this.engine, arguments);
|
|
};
|
|
|
|
/**
|
|
* @return this.engine
|
|
*/
|
|
Zip.prototype.pipe = function() {
|
|
return this.engine.pipe.apply(this.engine, arguments);
|
|
};
|
|
|
|
/**
|
|
* @return this.engine
|
|
*/
|
|
Zip.prototype.unpipe = function() {
|
|
return this.engine.unpipe.apply(this.engine, arguments);
|
|
};
|
|
|
|
module.exports = Zip;
|
|
|
|
/**
|
|
* @typedef {Object} ZipOptions
|
|
* @global
|
|
* @property {String} [comment] Sets the zip archive comment.
|
|
* @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
|
|
* @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers.
|
|
* @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths.
|
|
* @property {Boolean} [store=false] Sets the compression method to STORE.
|
|
* @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
|
* to control compression.
|
|
* @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties.
|
|
*/
|
|
|
|
/**
|
|
* @typedef {Object} ZipEntryData
|
|
* @global
|
|
* @property {String} name Sets the entry name including internal path.
|
|
* @property {(String|Date)} [date=NOW()] Sets the entry date.
|
|
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
|
|
* @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths.
|
|
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
|
|
* when working with methods like `directory` or `glob`.
|
|
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
|
|
* for reduction of fs stat calls when stat data is already known.
|
|
* @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE.
|
|
*/
|
|
|
|
/**
|
|
* ZipStream Module
|
|
* @external ZipStream
|
|
* @see {@link https://www.archiverjs.com/zip-stream/ZipStream.html}
|
|
*/
|