feat: admin redesign, decision assist, prompt caching and shared state (#11)

This change adds the redesigned admin panel and the smart router decision model assist.
It adds opt-in prompt-prefix caching per provider and cached-token pricing and metrics.
With Redis, the metrics route reports fleet-wide values. The redis.sharedState switch shares six coordination states across replicas.
PR CI grants actions read, which the shared go-pr workflow needs.
The pull request description has the full list and the verification.
This commit is contained in:
2026-11-26 15:50:11 +00:00
committed by GitHub
parent 4c61d19a72
commit 979d903c19
797 changed files with 88225 additions and 16085 deletions
+39
View File
@@ -0,0 +1,39 @@
// Gate scope: gzip (level 9) of every .js and .css in dist/assets, lazy chunks included.
import { existsSync, readdirSync, readFileSync } from 'node:fs'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { gzipSync } from 'node:zlib'
export const LIMIT = 324300
export const DIST = fileURLToPath(new URL('../dist/assets', import.meta.url))
export const hasDist = () => existsSync(DIST)
export function readCss(dir = DIST) {
return readdirSync(dir)
.filter((f) => f.endsWith('.css'))
.map((f) => readFileSync(join(dir, f), 'utf8'))
.join('\n')
}
export function totalGzip(dir = DIST) {
return measure(dir).reduce((n, r) => n + r.gzip, 0)
}
export function measure(dir = DIST) {
return readdirSync(dir)
.filter((f) => /\.(js|css)$/.test(f))
.map((f) => ({ file: f, gzip: gzipSync(readFileSync(join(dir, f)), { level: 9 }).length }))
.sort((a, b) => b.gzip - a.gzip)
}
if (process.argv[1] === fileURLToPath(import.meta.url)) {
const rows = measure()
const total = totalGzip()
for (const r of rows.slice(0, 10)) console.log(`${String(r.gzip).padStart(8)} ${r.file}`)
console.log(`total gzip JS+CSS: ${total} B (limit ${LIMIT}); ${rows.length} files`)
if (total > LIMIT) {
console.error('bundle gate FAILED')
process.exit(1)
}
}