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.5 KiB
JavaScript
104 lines
3.5 KiB
JavaScript
import { __extends } from "tslib";
|
|
import { AsyncAction } from './AsyncAction';
|
|
import { Subscription } from '../Subscription';
|
|
import { AsyncScheduler } from './AsyncScheduler';
|
|
var VirtualTimeScheduler = (function (_super) {
|
|
__extends(VirtualTimeScheduler, _super);
|
|
function VirtualTimeScheduler(schedulerActionCtor, maxFrames) {
|
|
if (schedulerActionCtor === void 0) { schedulerActionCtor = VirtualAction; }
|
|
if (maxFrames === void 0) { maxFrames = Infinity; }
|
|
var _this = _super.call(this, schedulerActionCtor, function () { return _this.frame; }) || this;
|
|
_this.maxFrames = maxFrames;
|
|
_this.frame = 0;
|
|
_this.index = -1;
|
|
return _this;
|
|
}
|
|
VirtualTimeScheduler.prototype.flush = function () {
|
|
var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
|
|
var error;
|
|
var action;
|
|
while ((action = actions[0]) && action.delay <= maxFrames) {
|
|
actions.shift();
|
|
this.frame = action.delay;
|
|
if ((error = action.execute(action.state, action.delay))) {
|
|
break;
|
|
}
|
|
}
|
|
if (error) {
|
|
while ((action = actions.shift())) {
|
|
action.unsubscribe();
|
|
}
|
|
throw error;
|
|
}
|
|
};
|
|
VirtualTimeScheduler.frameTimeFactor = 10;
|
|
return VirtualTimeScheduler;
|
|
}(AsyncScheduler));
|
|
export { VirtualTimeScheduler };
|
|
var VirtualAction = (function (_super) {
|
|
__extends(VirtualAction, _super);
|
|
function VirtualAction(scheduler, work, index) {
|
|
if (index === void 0) { index = (scheduler.index += 1); }
|
|
var _this = _super.call(this, scheduler, work) || this;
|
|
_this.scheduler = scheduler;
|
|
_this.work = work;
|
|
_this.index = index;
|
|
_this.active = true;
|
|
_this.index = scheduler.index = index;
|
|
return _this;
|
|
}
|
|
VirtualAction.prototype.schedule = function (state, delay) {
|
|
if (delay === void 0) { delay = 0; }
|
|
if (Number.isFinite(delay)) {
|
|
if (!this.id) {
|
|
return _super.prototype.schedule.call(this, state, delay);
|
|
}
|
|
this.active = false;
|
|
var action = new VirtualAction(this.scheduler, this.work);
|
|
this.add(action);
|
|
return action.schedule(state, delay);
|
|
}
|
|
else {
|
|
return Subscription.EMPTY;
|
|
}
|
|
};
|
|
VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
|
if (delay === void 0) { delay = 0; }
|
|
this.delay = scheduler.frame + delay;
|
|
var actions = scheduler.actions;
|
|
actions.push(this);
|
|
actions.sort(VirtualAction.sortActions);
|
|
return 1;
|
|
};
|
|
VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
|
if (delay === void 0) { delay = 0; }
|
|
return undefined;
|
|
};
|
|
VirtualAction.prototype._execute = function (state, delay) {
|
|
if (this.active === true) {
|
|
return _super.prototype._execute.call(this, state, delay);
|
|
}
|
|
};
|
|
VirtualAction.sortActions = function (a, b) {
|
|
if (a.delay === b.delay) {
|
|
if (a.index === b.index) {
|
|
return 0;
|
|
}
|
|
else if (a.index > b.index) {
|
|
return 1;
|
|
}
|
|
else {
|
|
return -1;
|
|
}
|
|
}
|
|
else if (a.delay > b.delay) {
|
|
return 1;
|
|
}
|
|
else {
|
|
return -1;
|
|
}
|
|
};
|
|
return VirtualAction;
|
|
}(AsyncAction));
|
|
export { VirtualAction };
|
|
//# sourceMappingURL=VirtualTimeScheduler.js.map
|