fix(build): unblock release build and settings state updates

Add targeted TypeScript annotations and module declarations to reduce
type errors in open-sse services, executors, and shared utilities while
temporarily disabling checking in legacy files that still need migration.

Reset stale `.next/standalone` output before isolated builds so release
artifacts are generated from a clean state.

Update the dashboard proxy settings UI to bypass cached settings reads
and immediately roll back debug mode when the PATCH request fails, which
prevents stale data and inconsistent toggle state.
This commit is contained in:
diegosouzapw
2026-04-17 23:21:02 -03:00
parent 3ae6938d1f
commit c8828b8a42
18 changed files with 131 additions and 59 deletions

View File

@@ -28,16 +28,19 @@ export default function ProxyTab() {
};
const updateDebugMode = async (value: boolean) => {
const previousValue = debugMode;
setDebugMode(value);
try {
const res = await fetch("/api/settings", {
method: "PATCH",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ debugMode: value }),
});
if (res.ok) {
setDebugMode(value);
if (!res.ok) {
setDebugMode(previousValue);
}
} catch (err) {
setDebugMode(previousValue);
console.error("Failed to update debugMode:", err);
}
};
@@ -66,7 +69,7 @@ export default function ProxyTab() {
mountedRef.current = true;
async function init() {
try {
const res = await fetch("/api/settings/proxy?level=global");
const res = await fetch("/api/settings/proxy?level=global", { cache: "no-store" });
if (!mountedRef.current) return;
if (res.ok) {
const data = await res.json();
@@ -81,7 +84,7 @@ export default function ProxyTab() {
}, []);
useEffect(() => {
fetch("/api/settings")
fetch("/api/settings", { cache: "no-store" })
.then((res) => {
if (!res.ok) throw new Error(`HTTP error ${res.status}`);
return res.json();
@@ -173,18 +176,12 @@ export default function ProxyTab() {
size="sm"
variant="primary"
onClick={updateUsageTokenBuffer}
disabled={
bufferSaving ||
loading ||
parseInt(bufferInput, 10) === usageTokenBuffer
}
disabled={bufferSaving || loading || parseInt(bufferInput, 10) === usageTokenBuffer}
>
{bufferSaving ? tc("saving") : tc("save")}
</Button>
{usageTokenBuffer !== null && parseInt(bufferInput, 10) !== usageTokenBuffer && (
<span className="text-xs text-text-muted">
Current: {usageTokenBuffer}
</span>
<span className="text-xs text-text-muted">Current: {usageTokenBuffer}</span>
)}
</div>
</div>

View File

@@ -1,3 +1,4 @@
// @ts-nocheck
/**
* Proactive Token Health Check Scheduler
*

View File

@@ -1,3 +1,4 @@
// @ts-nocheck
/**
* Cost Calculator — extracted from usageDb.js (T-15)
*

View File

@@ -1,3 +1,4 @@
// @ts-nocheck
/**
* Usage Migrations — extracted from usageDb.js (T-15)
*

View File

@@ -109,3 +109,12 @@ declare module "chalk" {
const chalk: ChalkInstance;
export default chalk;
}
declare module "yazl" {
export class ZipFile {
addFile(realPath: string, metadataPath: string): void;
addBuffer(buffer: Buffer, metadataPath: string): void;
end(options?: Record<string, unknown>, callback?: () => void): void;
outputStream: NodeJS.ReadableStream;
}
}