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>
104 lines
3.4 KiB
TypeScript
104 lines
3.4 KiB
TypeScript
/**
|
|
* @file Batteries-included version of Cheerio. This module includes several
|
|
* convenience methods for loading documents from various sources.
|
|
*/
|
|
export * from './load-parse.js';
|
|
export { contains, merge } from './static.js';
|
|
export type * from './types.js';
|
|
export type { Cheerio, CheerioAPI, CheerioOptions, HTMLParser2Options, } from './slim.js';
|
|
import { type SnifferOptions } from 'encoding-sniffer';
|
|
import * as undici from 'undici';
|
|
import { Writable } from 'node:stream';
|
|
import type { CheerioAPI } from './load.js';
|
|
import { type CheerioOptions } from './options.js';
|
|
/**
|
|
* Sniffs the encoding of a buffer, then creates a querying function bound to a
|
|
* document created from the buffer.
|
|
*
|
|
* @category Loading
|
|
* @example
|
|
*
|
|
* ```js
|
|
* import * as cheerio from 'cheerio';
|
|
*
|
|
* const buffer = fs.readFileSync('index.html');
|
|
* const $ = cheerio.loadBuffer(buffer);
|
|
* ```
|
|
*
|
|
* @param buffer - The buffer to sniff the encoding of.
|
|
* @param options - The options to pass to Cheerio.
|
|
* @returns The loaded document.
|
|
*/
|
|
export declare function loadBuffer(buffer: Buffer, options?: DecodeStreamOptions): CheerioAPI;
|
|
/**
|
|
* Creates a stream that parses a sequence of strings into a document.
|
|
*
|
|
* The stream is a `Writable` stream that accepts strings. When the stream is
|
|
* finished, the callback is called with the loaded document.
|
|
*
|
|
* @category Loading
|
|
* @example
|
|
*
|
|
* ```js
|
|
* import * as cheerio from 'cheerio';
|
|
* import * as fs from 'fs';
|
|
*
|
|
* const writeStream = cheerio.stringStream({}, (err, $) => {
|
|
* if (err) {
|
|
* // Handle error
|
|
* }
|
|
*
|
|
* console.log($('h1').text());
|
|
* // Output: Hello, world!
|
|
* });
|
|
*
|
|
* fs.createReadStream('my-document.html', { encoding: 'utf8' }).pipe(
|
|
* writeStream,
|
|
* );
|
|
* ```
|
|
*
|
|
* @param options - The options to pass to Cheerio.
|
|
* @param cb - The callback to call when the stream is finished.
|
|
* @returns The writable stream.
|
|
*/
|
|
export declare function stringStream(options: CheerioOptions, cb: (err: Error | null | undefined, $: CheerioAPI) => void): Writable;
|
|
export interface DecodeStreamOptions extends CheerioOptions {
|
|
encoding?: SnifferOptions;
|
|
}
|
|
/**
|
|
* Parses a stream of buffers into a document.
|
|
*
|
|
* The stream is a `Writable` stream that accepts buffers. When the stream is
|
|
* finished, the callback is called with the loaded document.
|
|
*
|
|
* @category Loading
|
|
* @param options - The options to pass to Cheerio.
|
|
* @param cb - The callback to call when the stream is finished.
|
|
* @returns The writable stream.
|
|
*/
|
|
export declare function decodeStream(options: DecodeStreamOptions, cb: (err: Error | null | undefined, $: CheerioAPI) => void): Writable;
|
|
type UndiciStreamOptions = Omit<undici.Dispatcher.RequestOptions<unknown>, 'path'>;
|
|
export interface CheerioRequestOptions extends DecodeStreamOptions {
|
|
/** The options passed to `undici`'s `stream` method. */
|
|
requestOptions?: UndiciStreamOptions;
|
|
}
|
|
/**
|
|
* `fromURL` loads a document from a URL.
|
|
*
|
|
* By default, redirects are allowed and non-2xx responses are rejected.
|
|
*
|
|
* @category Loading
|
|
* @example
|
|
*
|
|
* ```js
|
|
* import * as cheerio from 'cheerio';
|
|
*
|
|
* const $ = await cheerio.fromURL('https://example.com');
|
|
* ```
|
|
*
|
|
* @param url - The URL to load the document from.
|
|
* @param options - The options to pass to Cheerio.
|
|
* @returns The loaded document.
|
|
*/
|
|
export declare function fromURL(url: string | URL, options?: CheerioRequestOptions): Promise<CheerioAPI>;
|
|
//# sourceMappingURL=index.d.ts.map
|