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>
40 lines
1.5 KiB
JavaScript
40 lines
1.5 KiB
JavaScript
import {isVerbose, VERBOSE_VALUES, isVerboseFunction} from './values.js';
|
|
|
|
// Information computed before spawning, used by the `verbose` option
|
|
export const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {
|
|
validateVerbose(verbose);
|
|
const commandId = getCommandId(verbose);
|
|
return {
|
|
verbose,
|
|
escapedCommand,
|
|
commandId,
|
|
rawOptions,
|
|
};
|
|
};
|
|
|
|
const getCommandId = verbose => isVerbose({verbose}) ? COMMAND_ID++ : undefined;
|
|
|
|
// Prepending the `pid` is useful when multiple commands print their output at the same time.
|
|
// However, we cannot use the real PID since this is not available with `child_process.spawnSync()`.
|
|
// Also, we cannot use the real PID if we want to print it before `child_process.spawn()` is run.
|
|
// As a pro, it is shorter than a normal PID and never re-uses the same id.
|
|
// As a con, it cannot be used to send signals.
|
|
let COMMAND_ID = 0n;
|
|
|
|
const validateVerbose = verbose => {
|
|
for (const fdVerbose of verbose) {
|
|
if (fdVerbose === false) {
|
|
throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');
|
|
}
|
|
|
|
if (fdVerbose === true) {
|
|
throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');
|
|
}
|
|
|
|
if (!VERBOSE_VALUES.includes(fdVerbose) && !isVerboseFunction(fdVerbose)) {
|
|
const allowedValues = VERBOSE_VALUES.map(allowedValue => `'${allowedValue}'`).join(', ');
|
|
throw new TypeError(`The "verbose" option must not be ${fdVerbose}. Allowed values are: ${allowedValues} or a function.`);
|
|
}
|
|
}
|
|
};
|