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>
139 lines
3.7 KiB
TypeScript
139 lines
3.7 KiB
TypeScript
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
import {Options as LocatePathOptions} from 'locate-path';
|
|
|
|
declare const stop: unique symbol;
|
|
|
|
declare namespace findUp {
|
|
interface Options extends LocatePathOptions {}
|
|
|
|
type StopSymbol = typeof stop;
|
|
|
|
type Match = string | StopSymbol | undefined;
|
|
}
|
|
|
|
declare const findUp: {
|
|
sync: {
|
|
/**
|
|
Synchronously check if a path exists.
|
|
|
|
@param path - Path to the file or directory.
|
|
@returns Whether the path exists.
|
|
|
|
@example
|
|
```
|
|
import findUp = require('find-up');
|
|
|
|
console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png'));
|
|
//=> true
|
|
```
|
|
*/
|
|
exists: (path: string) => boolean;
|
|
|
|
/**
|
|
Synchronously find a file or directory by walking up parent directories.
|
|
|
|
@param name - Name of the file or directory to find. Can be multiple.
|
|
@returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found.
|
|
*/
|
|
(name: string | readonly string[], options?: findUp.Options): string | undefined;
|
|
|
|
/**
|
|
Synchronously find a file or directory by walking up parent directories.
|
|
|
|
@param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search.
|
|
@returns The first path found or `undefined` if none could be found.
|
|
|
|
@example
|
|
```
|
|
import path = require('path');
|
|
import findUp = require('find-up');
|
|
|
|
console.log(findUp.sync(directory => {
|
|
const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png'));
|
|
return hasUnicorns && directory;
|
|
}, {type: 'directory'}));
|
|
//=> '/Users/sindresorhus'
|
|
```
|
|
*/
|
|
(matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined;
|
|
};
|
|
|
|
/**
|
|
Check if a path exists.
|
|
|
|
@param path - Path to a file or directory.
|
|
@returns Whether the path exists.
|
|
|
|
@example
|
|
```
|
|
import findUp = require('find-up');
|
|
|
|
(async () => {
|
|
console.log(await findUp.exists('/Users/sindresorhus/unicorn.png'));
|
|
//=> true
|
|
})();
|
|
```
|
|
*/
|
|
exists: (path: string) => Promise<boolean>;
|
|
|
|
/**
|
|
Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`.
|
|
*/
|
|
readonly stop: findUp.StopSymbol;
|
|
|
|
/**
|
|
Find a file or directory by walking up parent directories.
|
|
|
|
@param name - Name of the file or directory to find. Can be multiple.
|
|
@returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found.
|
|
|
|
@example
|
|
```
|
|
// /
|
|
// └── Users
|
|
// └── sindresorhus
|
|
// ├── unicorn.png
|
|
// └── foo
|
|
// └── bar
|
|
// ├── baz
|
|
// └── example.js
|
|
|
|
// example.js
|
|
import findUp = require('find-up');
|
|
|
|
(async () => {
|
|
console.log(await findUp('unicorn.png'));
|
|
//=> '/Users/sindresorhus/unicorn.png'
|
|
|
|
console.log(await findUp(['rainbow.png', 'unicorn.png']));
|
|
//=> '/Users/sindresorhus/unicorn.png'
|
|
})();
|
|
```
|
|
*/
|
|
(name: string | readonly string[], options?: findUp.Options): Promise<string | undefined>;
|
|
|
|
/**
|
|
Find a file or directory by walking up parent directories.
|
|
|
|
@param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search.
|
|
@returns The first path found or `undefined` if none could be found.
|
|
|
|
@example
|
|
```
|
|
import path = require('path');
|
|
import findUp = require('find-up');
|
|
|
|
(async () => {
|
|
console.log(await findUp(async directory => {
|
|
const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png'));
|
|
return hasUnicorns && directory;
|
|
}, {type: 'directory'}));
|
|
//=> '/Users/sindresorhus'
|
|
})();
|
|
```
|
|
*/
|
|
(matcher: (directory: string) => (findUp.Match | Promise<findUp.Match>), options?: findUp.Options): Promise<string | undefined>;
|
|
};
|
|
|
|
export = findUp;
|