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>
201 lines
6.9 KiB
JavaScript
201 lines
6.9 KiB
JavaScript
"use strict";
|
|
var __extends = (this && this.__extends) || (function () {
|
|
var extendStatics = function (d, b) {
|
|
extendStatics = Object.setPrototypeOf ||
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
return extendStatics(d, b);
|
|
};
|
|
return function (d, b) {
|
|
if (typeof b !== "function" && b !== null)
|
|
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
extendStatics(d, b);
|
|
function __() { this.constructor = d; }
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
};
|
|
})();
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.EMPTY_OBSERVER = exports.SafeSubscriber = exports.Subscriber = void 0;
|
|
var isFunction_1 = require("./util/isFunction");
|
|
var Subscription_1 = require("./Subscription");
|
|
var config_1 = require("./config");
|
|
var reportUnhandledError_1 = require("./util/reportUnhandledError");
|
|
var noop_1 = require("./util/noop");
|
|
var NotificationFactories_1 = require("./NotificationFactories");
|
|
var timeoutProvider_1 = require("./scheduler/timeoutProvider");
|
|
var errorContext_1 = require("./util/errorContext");
|
|
var Subscriber = (function (_super) {
|
|
__extends(Subscriber, _super);
|
|
function Subscriber(destination) {
|
|
var _this = _super.call(this) || this;
|
|
_this.isStopped = false;
|
|
if (destination) {
|
|
_this.destination = destination;
|
|
if (Subscription_1.isSubscription(destination)) {
|
|
destination.add(_this);
|
|
}
|
|
}
|
|
else {
|
|
_this.destination = exports.EMPTY_OBSERVER;
|
|
}
|
|
return _this;
|
|
}
|
|
Subscriber.create = function (next, error, complete) {
|
|
return new SafeSubscriber(next, error, complete);
|
|
};
|
|
Subscriber.prototype.next = function (value) {
|
|
if (this.isStopped) {
|
|
handleStoppedNotification(NotificationFactories_1.nextNotification(value), this);
|
|
}
|
|
else {
|
|
this._next(value);
|
|
}
|
|
};
|
|
Subscriber.prototype.error = function (err) {
|
|
if (this.isStopped) {
|
|
handleStoppedNotification(NotificationFactories_1.errorNotification(err), this);
|
|
}
|
|
else {
|
|
this.isStopped = true;
|
|
this._error(err);
|
|
}
|
|
};
|
|
Subscriber.prototype.complete = function () {
|
|
if (this.isStopped) {
|
|
handleStoppedNotification(NotificationFactories_1.COMPLETE_NOTIFICATION, this);
|
|
}
|
|
else {
|
|
this.isStopped = true;
|
|
this._complete();
|
|
}
|
|
};
|
|
Subscriber.prototype.unsubscribe = function () {
|
|
if (!this.closed) {
|
|
this.isStopped = true;
|
|
_super.prototype.unsubscribe.call(this);
|
|
this.destination = null;
|
|
}
|
|
};
|
|
Subscriber.prototype._next = function (value) {
|
|
this.destination.next(value);
|
|
};
|
|
Subscriber.prototype._error = function (err) {
|
|
try {
|
|
this.destination.error(err);
|
|
}
|
|
finally {
|
|
this.unsubscribe();
|
|
}
|
|
};
|
|
Subscriber.prototype._complete = function () {
|
|
try {
|
|
this.destination.complete();
|
|
}
|
|
finally {
|
|
this.unsubscribe();
|
|
}
|
|
};
|
|
return Subscriber;
|
|
}(Subscription_1.Subscription));
|
|
exports.Subscriber = Subscriber;
|
|
var _bind = Function.prototype.bind;
|
|
function bind(fn, thisArg) {
|
|
return _bind.call(fn, thisArg);
|
|
}
|
|
var ConsumerObserver = (function () {
|
|
function ConsumerObserver(partialObserver) {
|
|
this.partialObserver = partialObserver;
|
|
}
|
|
ConsumerObserver.prototype.next = function (value) {
|
|
var partialObserver = this.partialObserver;
|
|
if (partialObserver.next) {
|
|
try {
|
|
partialObserver.next(value);
|
|
}
|
|
catch (error) {
|
|
handleUnhandledError(error);
|
|
}
|
|
}
|
|
};
|
|
ConsumerObserver.prototype.error = function (err) {
|
|
var partialObserver = this.partialObserver;
|
|
if (partialObserver.error) {
|
|
try {
|
|
partialObserver.error(err);
|
|
}
|
|
catch (error) {
|
|
handleUnhandledError(error);
|
|
}
|
|
}
|
|
else {
|
|
handleUnhandledError(err);
|
|
}
|
|
};
|
|
ConsumerObserver.prototype.complete = function () {
|
|
var partialObserver = this.partialObserver;
|
|
if (partialObserver.complete) {
|
|
try {
|
|
partialObserver.complete();
|
|
}
|
|
catch (error) {
|
|
handleUnhandledError(error);
|
|
}
|
|
}
|
|
};
|
|
return ConsumerObserver;
|
|
}());
|
|
var SafeSubscriber = (function (_super) {
|
|
__extends(SafeSubscriber, _super);
|
|
function SafeSubscriber(observerOrNext, error, complete) {
|
|
var _this = _super.call(this) || this;
|
|
var partialObserver;
|
|
if (isFunction_1.isFunction(observerOrNext) || !observerOrNext) {
|
|
partialObserver = {
|
|
next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
|
|
error: error !== null && error !== void 0 ? error : undefined,
|
|
complete: complete !== null && complete !== void 0 ? complete : undefined,
|
|
};
|
|
}
|
|
else {
|
|
var context_1;
|
|
if (_this && config_1.config.useDeprecatedNextContext) {
|
|
context_1 = Object.create(observerOrNext);
|
|
context_1.unsubscribe = function () { return _this.unsubscribe(); };
|
|
partialObserver = {
|
|
next: observerOrNext.next && bind(observerOrNext.next, context_1),
|
|
error: observerOrNext.error && bind(observerOrNext.error, context_1),
|
|
complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
|
|
};
|
|
}
|
|
else {
|
|
partialObserver = observerOrNext;
|
|
}
|
|
}
|
|
_this.destination = new ConsumerObserver(partialObserver);
|
|
return _this;
|
|
}
|
|
return SafeSubscriber;
|
|
}(Subscriber));
|
|
exports.SafeSubscriber = SafeSubscriber;
|
|
function handleUnhandledError(error) {
|
|
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
|
|
errorContext_1.captureError(error);
|
|
}
|
|
else {
|
|
reportUnhandledError_1.reportUnhandledError(error);
|
|
}
|
|
}
|
|
function defaultErrorHandler(err) {
|
|
throw err;
|
|
}
|
|
function handleStoppedNotification(notification, subscriber) {
|
|
var onStoppedNotification = config_1.config.onStoppedNotification;
|
|
onStoppedNotification && timeoutProvider_1.timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });
|
|
}
|
|
exports.EMPTY_OBSERVER = {
|
|
closed: true,
|
|
next: noop_1.noop,
|
|
error: defaultErrorHandler,
|
|
complete: noop_1.noop,
|
|
};
|
|
//# sourceMappingURL=Subscriber.js.map
|