@lumeo_hq/openbooks-doctor 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # @lumeo_hq/openbooks-doctor
2
-
3
- `runDoctor()` checks Node, finds a Python with the Open Books engine, and runs the engine's own diagnostics (providers, model
4
- integrity, a built-in proven-or-refused self-test). A missing Python or engine comes back as a failed check in the report,
5
- not as an exception.
1
+ # @lumeo_hq/openbooks-doctor
2
+
3
+ `runDoctor()` checks Node, finds a Python with the Open Books engine, and runs the engine's own diagnostics (providers, model
4
+ integrity, a built-in proven-or-refused self-test). A missing Python or engine comes back as a failed check in the report,
5
+ not as an exception.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { EngineError, findEngine, runProcess } from "@lumeo_hq/openbooks-core";
1
+ import { EngineError, engineCommand, findEngine, runProcess } from "@lumeo_hq/openbooks-core";
2
2
  const MIN_NODE = 20;
3
3
  function report(checks, strict) {
4
4
  const summary = { pass: 0, warn: 0, fail: 0, skip: 0 };
@@ -18,9 +18,9 @@ function nodeCheck() {
18
18
  */
19
19
  export async function runDoctor(opts = {}) {
20
20
  const checks = [nodeCheck()];
21
- let python;
21
+ let command;
22
22
  try {
23
- python = (await findEngine(opts)).python;
23
+ command = engineCommand(await findEngine(opts));
24
24
  }
25
25
  catch (e) {
26
26
  if (e instanceof EngineError && ["python_not_found", "engine_not_installed", "engine_version"].includes(e.kind)) {
@@ -29,10 +29,10 @@ export async function runDoctor(opts = {}) {
29
29
  }
30
30
  throw e;
31
31
  }
32
- const argv = [...python, "-m", "openbooks_core", "doctor", "--json", ...(opts.deep ? ["--deep"] : [])];
32
+ const argv = [...command, "doctor", "--json", ...(opts.deep ? ["--deep"] : [])];
33
33
  const r = await runProcess(argv, { timeoutMs: opts.timeoutMs ?? 180_000 });
34
34
  if (r.code === 2 && /invalid choice/.test(r.stderr)) {
35
- checks.push({ id: "doctor.installed", status: "fail", detail: "the Python engine is installed but openbooks-doctor is not", fix: "pip install openbooks-doctor" });
35
+ checks.push({ id: "doctor.installed", status: "fail", detail: "the Python engine is installed but its doctor command is not", fix: "pip install --force-reinstall openbooks" });
36
36
  return report(checks, opts.strict ?? false);
37
37
  }
38
38
  if (r.code !== 0 && r.code !== 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumeo_hq/openbooks-doctor",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Open Books doctor wrapper: typed access to the Python engine, restricted to the doctor layouts",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -20,6 +20,6 @@
20
20
  "node": ">=20"
21
21
  },
22
22
  "dependencies": {
23
- "@lumeo_hq/openbooks-core": "0.1.0"
23
+ "@lumeo_hq/openbooks-core": "0.2.0"
24
24
  }
25
25
  }