mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-17 04:10:04 +02:00
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>
88 lines
2.9 KiB
TypeScript
88 lines
2.9 KiB
TypeScript
import { HotPayload } from '../../types/hmrPayload.js';
|
|
|
|
interface FetchFunctionOptions {
|
|
cached?: boolean;
|
|
startOffset?: number;
|
|
}
|
|
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
|
|
interface CachedFetchResult {
|
|
/**
|
|
* If module cached in the runner, we can just confirm
|
|
* it wasn't invalidated on the server side.
|
|
*/
|
|
cache: true;
|
|
}
|
|
interface ExternalFetchResult {
|
|
/**
|
|
* The path to the externalized module starting with file://,
|
|
* by default this will be imported via a dynamic "import"
|
|
* instead of being transformed by vite and loaded with vite runner
|
|
*/
|
|
externalize: string;
|
|
/**
|
|
* Type of the module. Will be used to determine if import statement is correct.
|
|
* For example, if Vite needs to throw an error if variable is not actually exported
|
|
*/
|
|
type: 'module' | 'commonjs' | 'builtin' | 'network';
|
|
}
|
|
interface ViteFetchResult {
|
|
/**
|
|
* Code that will be evaluated by vite runner
|
|
* by default this will be wrapped in an async function
|
|
*/
|
|
code: string;
|
|
/**
|
|
* File path of the module on disk.
|
|
* This will be resolved as import.meta.url/filename
|
|
* Will be equal to `null` for virtual modules
|
|
*/
|
|
file: string | null;
|
|
/**
|
|
* Module ID in the server module graph.
|
|
*/
|
|
id: string;
|
|
/**
|
|
* Module URL used in the import.
|
|
*/
|
|
url: string;
|
|
/**
|
|
* Invalidate module on the client side.
|
|
*/
|
|
invalidate: boolean;
|
|
}
|
|
type InvokeMethods = {
|
|
fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
|
|
};
|
|
|
|
type ModuleRunnerTransportHandlers = {
|
|
onMessage: (data: HotPayload) => void;
|
|
onDisconnection: () => void;
|
|
};
|
|
/**
|
|
* "send and connect" or "invoke" must be implemented
|
|
*/
|
|
interface ModuleRunnerTransport {
|
|
connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
|
|
disconnect?(): Promise<void> | void;
|
|
send?(data: HotPayload): Promise<void> | void;
|
|
invoke?(data: HotPayload): Promise<{
|
|
result: any;
|
|
} | {
|
|
error: any;
|
|
}>;
|
|
timeout?: number;
|
|
}
|
|
interface NormalizedModuleRunnerTransport {
|
|
connect?(onMessage?: (data: HotPayload) => void): Promise<void> | void;
|
|
disconnect?(): Promise<void> | void;
|
|
send(data: HotPayload): Promise<void>;
|
|
invoke<T extends keyof InvokeMethods>(name: T, data: Parameters<InvokeMethods[T]>): Promise<ReturnType<Awaited<InvokeMethods[T]>>>;
|
|
}
|
|
declare const createWebSocketModuleRunnerTransport: (options: {
|
|
createConnection: () => WebSocket;
|
|
pingInterval?: number;
|
|
}) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
|
|
|
|
export { createWebSocketModuleRunnerTransport as c };
|
|
export type { ExternalFetchResult as E, FetchFunctionOptions as F, ModuleRunnerTransport as M, NormalizedModuleRunnerTransport as N, ViteFetchResult as V, FetchResult as a, ModuleRunnerTransportHandlers as b };
|