Fix/doctor engine level and test deps #2
@@ -572,9 +572,10 @@ async function checkTypst(fast: boolean): Promise<CheckBody> {
|
||||
}
|
||||
|
||||
/**
|
||||
* The daemon. NOTE: nothing here is an `error`. `draw-things-cli` works perfectly well
|
||||
* cold — it just reloads 6GB of weights on every single call, which turns a draft loop
|
||||
* into a coffee break. So: warn, never block.
|
||||
* The daemon. NOTE: nothing here is an `error` AND nothing here is a `warn`. The
|
||||
* resident server is an optimisation, not a requirement: `draw-things-cli` works fine
|
||||
* cold, and `index.ts`'s `waitForServer()` warms it on the first generation anyway.
|
||||
* So: `info` at worst, so the doctor never lists the engine among "Qualcosa non va".
|
||||
*/
|
||||
async function checkServer(cfg: ImgenConfig, piConfigDir: string): Promise<CheckBody> {
|
||||
const paths = serverPaths(cfg, piConfigDir);
|
||||
@@ -583,7 +584,7 @@ async function checkServer(cfg: ImgenConfig, piConfigDir: string): Promise<Check
|
||||
|
||||
if (!cfg.server.enabled) {
|
||||
return {
|
||||
level: listening ? "info" : "warn",
|
||||
level: "info",
|
||||
message: T.server.disabled,
|
||||
fix: fill(T.server.disabledFix, { file: configFile }),
|
||||
detail: paths.binary,
|
||||
@@ -596,7 +597,7 @@ async function checkServer(cfg: ImgenConfig, piConfigDir: string): Promise<Check
|
||||
|
||||
if (!bin) {
|
||||
return {
|
||||
level: listening ? "info" : "warn",
|
||||
level: "info",
|
||||
message: listening
|
||||
? fill(T.server.foreign, { porta: cfg.server.port })
|
||||
: fill(T.server.binaryMissing, { nome: GRPC_SERVER_BINARY }),
|
||||
@@ -609,7 +610,7 @@ async function checkServer(cfg: ImgenConfig, piConfigDir: string): Promise<Check
|
||||
|
||||
if (!(await canAccess(bin, FS.X_OK))) {
|
||||
return {
|
||||
level: "warn",
|
||||
level: "info",
|
||||
message: fill(T.server.notExecutable, { dove: bin }),
|
||||
fix: fill(T.server.notExecutableFix, { dove: bin }),
|
||||
detail: bin,
|
||||
@@ -624,7 +625,7 @@ async function checkServer(cfg: ImgenConfig, piConfigDir: string): Promise<Check
|
||||
`"${bin}" "${cfg.modelsPath}" --no-tls --port ${cfg.server.port}` +
|
||||
(cfg.server.cpuOffload ? " --cpu-offload" : "");
|
||||
return {
|
||||
level: "warn",
|
||||
level: "info",
|
||||
message: T.server.stopped,
|
||||
fix: fill(T.server.stoppedFix, { comando: command }),
|
||||
detail: bin,
|
||||
|
||||
Generated
+11
@@ -13,6 +13,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.0",
|
||||
"jiti": "^2.4.0",
|
||||
"typescript": "^5.6.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -3515,6 +3516,16 @@
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/jiti": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
|
||||
"integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"jiti": "lib/jiti-cli.mjs"
|
||||
}
|
||||
},
|
||||
"node_modules/json-bigint": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
|
||||
|
||||
+2
-1
@@ -41,6 +41,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.6.0",
|
||||
"@types/node": "^20.14.0"
|
||||
"@types/node": "^20.14.0",
|
||||
"jiti": "^2.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { createJiti } from "jiti";
|
||||
import { join } from "node:path";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
const jiti = createJiti(import.meta.url, { interopDefault: true });
|
||||
const R = "/home/moze/Sorgenti/pi-imgen";
|
||||
const R = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
||||
const c = await jiti.import(join(R, "extensions/imgen/render/contrast.ts"));
|
||||
|
||||
const region = c.TEXT_REGIONS["hero-bottom"];
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
* `print.dpi` has no upper clamp, so a user on 600dpi puts every A3 region over the cap.
|
||||
*/
|
||||
import { createJiti } from "jiti";
|
||||
import { join } from "node:path";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const jiti = createJiti(import.meta.url, { interopDefault: true });
|
||||
const R = "/home/moze/Sorgenti/pi-imgen";
|
||||
const R = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
||||
const c = await jiti.import(join(R, "extensions/imgen/render/contrast.ts"));
|
||||
|
||||
const a = await c.analyseRegion(join(R, "tests/art-fine-busy.png"), { left: 0, top: 0, width: 1, height: 1 });
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { createJiti } from "jiti";
|
||||
import { mkdtempSync, copyFileSync, existsSync, readFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const jiti = createJiti(import.meta.url, { interopDefault: true });
|
||||
const R = "/home/moze/Sorgenti/pi-imgen";
|
||||
const R = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
||||
const typst = await jiti.import(join(R, "extensions/imgen/render/typst.ts"));
|
||||
const cfgMod = await jiti.import(join(R, "extensions/imgen/config.ts"));
|
||||
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
* time — a cycle or a hoisting mistake would surface as `undefined`, not a type error.
|
||||
*/
|
||||
import { createJiti } from "jiti";
|
||||
import { join } from "node:path";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const jiti = createJiti(import.meta.url, { interopDefault: true });
|
||||
const R = "/home/moze/Sorgenti/pi-imgen";
|
||||
const R = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
||||
const s = await jiti.import(join(R, "extensions/imgen/ui/strings.ts"));
|
||||
|
||||
let bad = 0;
|
||||
|
||||
Reference in New Issue
Block a user