mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-13 02:08:07 +02:00
Jauge de contexte, espace disque sur partage agrégé, panneau Fichiers
Trois défauts sans rapport entre eux, tous visibles à l'écran. Jauge de contexte bloquée à « 0 / N (0 %) » : le comptage exact vient de usage.prompt_tokens (include_usage), qu'un llama-server récent a cessé de renvoyer. On note désormais si l'usage est arrivé ; sinon la fin de tour publie l'estimation qui pilote déjà la compaction — approximative, mais jamais absente. Et la souscription envoie la valeur courante juste après le rattrapage : une page rechargée affichait zéro sur une discussion pourtant pleine, faute d'événement ctx_used dans la fenêtre rejouée. Espace disque : « il ne reste que 11,9 Go » sur un partage Unraid qui en a des centaines. /mnt/user est servi par shfs, un FUSE qui agrège plusieurs disques — statfs y renvoie l'espace d'un seul, et ce chiffre REFUSAIT l'installation du modèle. Les systèmes de fichiers qui approximent (FUSE, overlay, NFS, CIFS, Ceph, Gluster) sont reconnus par leur magie : leur chiffre reste affiché, précédé d'un « ~ », mais ne bloque plus rien. Panneau Fichiers : le panneau entier défilait, emportant vers le haut l'en-tête, le fil d'Ariane et le pied (occupation disque, bouton .zip) dès qu'il y avait quelques fichiers. Seule la liste défile maintenant ; le pied reste en bas et l'état vide se centre. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
895ff92ed8
commit
b405adea6c
5118 files changed
+1264007
-23
No files matched your search
+10
@@ -0,0 +1,10 @@
|
||||
import { corePlugins } from '../src/corePlugins'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
let corePluginList = Object.keys(corePlugins)
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'src', 'corePluginList.js'),
|
||||
`export default ${JSON.stringify(corePluginList)}`
|
||||
)
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
import prettier from 'prettier'
|
||||
import { corePlugins } from '../src/corePlugins'
|
||||
import colors from '../src/public/colors'
|
||||
import defaultTheme from '../src/public/default-theme'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import * as types from './type-utils'
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'types', 'generated', 'corePluginList.d.ts'),
|
||||
`export type CorePluginList = ${Object.keys(corePlugins)
|
||||
.map((p) => `'${p}'`)
|
||||
.join(' | ')}`
|
||||
)
|
||||
|
||||
let colorsWithoutDeprecatedColors = Object.fromEntries(
|
||||
Object.entries(Object.getOwnPropertyDescriptors(colors))
|
||||
.filter(([_, { value }]) => {
|
||||
return typeof value !== 'undefined'
|
||||
})
|
||||
.map(([name, definition]) => [name, definition.value])
|
||||
)
|
||||
|
||||
let deprecatedColors = Object.entries(Object.getOwnPropertyDescriptors(colors))
|
||||
.filter(([_, { value }]) => {
|
||||
return typeof value === 'undefined'
|
||||
})
|
||||
.map(([name, definition]) => {
|
||||
let warn = console.warn
|
||||
let messages = []
|
||||
console.warn = (...args) => messages.push(args.pop())
|
||||
definition.get()
|
||||
console.warn = warn
|
||||
let message = messages.join(' ').trim()
|
||||
let newColor = message.match(/renamed to `(.*)`/)[1]
|
||||
return `/** @deprecated ${message} */${name}: DefaultColors['${newColor}'],`
|
||||
})
|
||||
.join('\n')
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'types', 'generated', 'colors.d.ts'),
|
||||
prettier.format(
|
||||
`export interface DefaultColors { ${JSON.stringify(colorsWithoutDeprecatedColors).slice(
|
||||
1,
|
||||
-1
|
||||
)}\n${deprecatedColors}\n}`,
|
||||
{
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
printWidth: 100,
|
||||
parser: 'typescript',
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
const defaultThemeTypes = Object.entries(defaultTheme)
|
||||
.map(([name, value]) => {
|
||||
// Special cases for slightly more accurate types
|
||||
if (name === 'keyframes') {
|
||||
return [name, `Record<${types.forKeys(value)}, Record<string, CSSDeclarationList>>`]
|
||||
}
|
||||
|
||||
if (name === 'fontSize') {
|
||||
return [name, `Record<${types.forKeys(value)}, [string, { lineHeight: string }]>`]
|
||||
}
|
||||
|
||||
// General cases
|
||||
if (typeof value === 'string') {
|
||||
return [name, `string`]
|
||||
}
|
||||
|
||||
if (typeof value === 'function') {
|
||||
return [name, null]
|
||||
}
|
||||
|
||||
if (typeof value === 'object') {
|
||||
if (Object.keys(value).length === 0) {
|
||||
return [name, null]
|
||||
}
|
||||
|
||||
return [name, types.forValue(value)]
|
||||
}
|
||||
|
||||
return [name, `unknown`]
|
||||
})
|
||||
.filter(([, type]) => type !== null)
|
||||
.map(([name, type]) => `${name}: ${type}`)
|
||||
.join('\n')
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'types', 'generated', 'default-theme.d.ts'),
|
||||
prettier.format(
|
||||
`
|
||||
type CSSDeclarationList = Record<string, string>
|
||||
export type DefaultTheme = { ${defaultThemeTypes} }
|
||||
`,
|
||||
{
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
printWidth: 100,
|
||||
parser: 'typescript',
|
||||
}
|
||||
)
|
||||
)
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// Given a version, figure out what the release channel is so that we can publish to the correct
|
||||
// channel on npm.
|
||||
//
|
||||
// E.g.:
|
||||
//
|
||||
// 1.2.3 -> latest (default)
|
||||
// 0.0.0-insiders.ffaa88 -> insiders
|
||||
// 4.1.0-alpha.4 -> alpha
|
||||
|
||||
let version =
|
||||
process.argv[2] || process.env.npm_package_version || require('../package.json').version
|
||||
|
||||
let match = /\d+\.\d+\.\d+-(.*)\.\d+/g.exec(version)
|
||||
if (match) {
|
||||
console.log(match[1])
|
||||
} else {
|
||||
console.log('latest')
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// Given a version, figure out what the release notes are so that we can use this to pre-fill the
|
||||
// relase notes on a GitHub release for the current version.
|
||||
|
||||
let path = require('path')
|
||||
let fs = require('fs')
|
||||
|
||||
let version =
|
||||
process.argv[2] || process.env.npm_package_version || require('../package.json').version
|
||||
|
||||
let changelog = fs.readFileSync(path.resolve(__dirname, '..', 'CHANGELOG.md'), 'utf8')
|
||||
let match = new RegExp(
|
||||
`## \\[${version}\\] - (.*)\\n\\n([\\s\\S]*?)\\n(?:(?:##\\s)|(?:\\[))`,
|
||||
'g'
|
||||
).exec(changelog)
|
||||
|
||||
if (match) {
|
||||
let [, , notes] = match
|
||||
console.log(notes.trim())
|
||||
} else {
|
||||
console.log(`Placeholder release notes for version: v${version}`)
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
export function union(types) {
|
||||
return [...new Set(types)].join(' | ')
|
||||
}
|
||||
|
||||
export function unionValues(values) {
|
||||
return union(values.map(forValue))
|
||||
}
|
||||
|
||||
export function forKeys(value) {
|
||||
return union(Object.keys(value).map((key) => `'${key}'`))
|
||||
}
|
||||
|
||||
export function forValue(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return `(${unionValues(value)})[]`
|
||||
}
|
||||
|
||||
if (typeof value === 'object') {
|
||||
return `Record<${forKeys(value)}, ${unionValues(Object.values(value))}>`
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
return `string`
|
||||
}
|
||||
|
||||
return `any`
|
||||
}
|
||||
Reference in new issue
Block a user