aiex-cli 0.0.7-beta.2 → 0.1.0-beta.1

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/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as PLACEHOLDER_TEXT, D as name, E as description, O as package_default, S as PLACEHOLDER_SCHEMA, T as seedConfig, _ as doctorDiagnosticsTableRows, a as recognizeImageText, b as DEFAULT_MINERU_CONFIG, c as t, d as writeAIConfig, f as AIConfigSchema, h as toSnakeCase, k as version, l as getDefaultAIConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, o as shouldUseImageOcrFallback, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, s as initI18n, t as generateDrizzleSchema, u as readAIConfig, v as formatDoctorDiagnosticsJson, w as createConfig, x as DEFAULT_PROMPT_CONFIG, y as DEFAULT_MINERU_API_CONFIG } from "./generate-drizzle-schema-D_oDmf4J.mjs";
1
+ import { A as package_default, C as DEFAULT_PROMPT_CONFIG, D as seedConfig, E as createConfig, O as description, S as DEFAULT_MINERU_CONFIG, T as PLACEHOLDER_TEXT, _ as doctorDiagnosticsSeverityRows, a as recognizeImageText, b as DEFAULT_LITEPARSE_CONFIG, c as t, d as writeAIConfig, f as AIConfigSchema, h as toSnakeCase, j as version, k as name, l as getDefaultAIConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, o as shouldUseImageOcrFallback, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, s as initI18n, t as generateDrizzleSchema, u as readAIConfig, v as doctorDiagnosticsTableRows, w as PLACEHOLDER_SCHEMA, x as DEFAULT_MINERU_API_CONFIG, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-BAMq_Ufp.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import fs from "node:fs/promises";
4
4
  import os from "node:os";
@@ -128,6 +128,16 @@ const doctorCommand = defineCommand({
128
128
  });
129
129
  table.push(...doctorDiagnosticsTableRows(diagnostics));
130
130
  process.stdout.write(`${table.toString()}\n`);
131
+ const severityRows = doctorDiagnosticsSeverityRows(diagnostics);
132
+ if (severityRows.length) {
133
+ const summary = new CliTable3({
134
+ head: ["status", "diagnostic"],
135
+ colAligns: ["right", "left"],
136
+ style: { compact: true }
137
+ });
138
+ summary.push(...severityRows);
139
+ process.stdout.write(`${summary.toString()}\n`);
140
+ }
131
141
  } catch (err) {
132
142
  consola.error(t("command.doctor.diagnosticsFailed", { error: err }));
133
143
  }
@@ -609,6 +619,66 @@ var ExternalCommandPdfConverter = class {
609
619
  }
610
620
  };
611
621
 
622
+ //#endregion
623
+ //#region src/infrastructure/pdf/liteparse-converter.ts
624
+ const TESSERACT_FAILURE_RE = /tesseract|tessdata|traineddata|language/i;
625
+ function textFromPages(pages = []) {
626
+ return pages.map((page) => {
627
+ if (typeof page.text === "string") return page.text;
628
+ return page.textItems?.map((item) => item.text).filter(Boolean).join("\n") ?? "";
629
+ }).filter(Boolean).join("\n\n");
630
+ }
631
+ function hasBoundingBoxes(pages = []) {
632
+ return pages.some((page) => page.textItems?.some((item) => typeof item.x === "number" && typeof item.y === "number" && typeof item.width === "number" && typeof item.height === "number"));
633
+ }
634
+ async function loadLiteParse() {
635
+ try {
636
+ return (await import("@llamaindex/liteparse")).LiteParse;
637
+ } catch (error) {
638
+ const details = error instanceof Error ? error.message : String(error);
639
+ throw new Error(`LiteParse is selected but @llamaindex/liteparse is not available. Install optional dependencies or switch the PDF converter to unpdf, mineru, mineru_api, or external. ${details}`);
640
+ }
641
+ }
642
+ function formatLiteparseError(error, config) {
643
+ const message = error instanceof Error ? error.message : String(error);
644
+ if (!config.ocrEnabled) return new Error(message);
645
+ if (!TESSERACT_FAILURE_RE.test(message)) return new Error(message);
646
+ return /* @__PURE__ */ new Error(`LiteParse OCR is enabled but Tesseract language data could not be loaded. Install the traineddata file for "${config.ocrLanguage ?? DEFAULT_LITEPARSE_CONFIG.ocrLanguage}" and set pdf.liteparse.tessdataPath to the directory that contains it, or disable pdf.liteparse.ocrEnabled. Original error: ${message}`);
647
+ }
648
+ var LiteparsePdfConverter = class {
649
+ name = "liteparse";
650
+ constructor(config = DEFAULT_LITEPARSE_CONFIG) {
651
+ this.config = config;
652
+ }
653
+ async convert(input, filePath) {
654
+ const LiteParse = await loadLiteParse();
655
+ const config = {
656
+ ...DEFAULT_LITEPARSE_CONFIG,
657
+ ...this.config
658
+ };
659
+ const result = await new LiteParse({
660
+ ocrEnabled: config.ocrEnabled,
661
+ ocrLanguage: config.ocrLanguage,
662
+ ocrServerUrl: config.ocrServerUrl,
663
+ tessdataPath: config.tessdataPath,
664
+ quiet: true
665
+ }).parse(filePath ?? input).catch((error) => {
666
+ throw formatLiteparseError(error, config);
667
+ });
668
+ const pages = Array.isArray(result.pages) ? result.pages : [];
669
+ return {
670
+ text: typeof result.text === "string" ? result.text : textFromPages(pages),
671
+ pageCount: pages.length,
672
+ metadata: {
673
+ converter: this.name,
674
+ ocrEnabled: String(config.ocrEnabled ?? false),
675
+ ...config.ocrLanguage ? { ocrLanguage: config.ocrLanguage } : {},
676
+ hasBoundingBoxes: String(hasBoundingBoxes(pages))
677
+ }
678
+ };
679
+ }
680
+ };
681
+
612
682
  //#endregion
613
683
  //#region src/infrastructure/pdf/mineru-api-converter.ts
614
684
  const TRAILING_SLASH_REGEXP = /\/+$/;
@@ -770,6 +840,7 @@ function withFallback(converter, config) {
770
840
  }
771
841
  function createPdfConverter(config) {
772
842
  if (typeof config === "object") {
843
+ if (config.converter === "liteparse") return new LiteparsePdfConverter(config.liteparse ?? DEFAULT_LITEPARSE_CONFIG);
773
844
  if (config.converter === "mineru") {
774
845
  const mineruConfig = config.mineru ?? DEFAULT_MINERU_CONFIG;
775
846
  return withFallback(new ExternalCommandPdfConverter("mineru", mineruConfig), mineruConfig);
@@ -783,8 +854,9 @@ function createPdfConverter(config) {
783
854
  const key = typeof config === "string" ? config : "unpdf";
784
855
  let instance = registry$1.get(key);
785
856
  if (!instance) {
786
- if (key !== "unpdf") throw new Error(t("errors.pdf.converterRequiresConfig", { name: key }));
787
- instance = new UnpdfConverter();
857
+ if (key === "liteparse") instance = new LiteparsePdfConverter();
858
+ else if (key === "unpdf") instance = new UnpdfConverter();
859
+ else throw new Error(t("errors.pdf.converterRequiresConfig", { name: key }));
788
860
  registry$1.set(key, instance);
789
861
  }
790
862
  return instance;
@@ -3061,9 +3133,9 @@ function resolveTsxPath() {
3061
3133
  }
3062
3134
  function resolveHelperPath() {
3063
3135
  try {
3064
- return path.join(resolvePackageRoot(), "src/core/schema-sqlite/migrate-helper.ts");
3136
+ return path.join(resolvePackageRoot(), "src/infrastructure/schema/migrate-helper.ts");
3065
3137
  } catch {
3066
- return path.join(__dirname, "../../core/schema-sqlite/migrate-helper.ts");
3138
+ return path.join(__dirname, "../schema/migrate-helper.ts");
3067
3139
  }
3068
3140
  }
3069
3141
 
@@ -11,7 +11,7 @@ import { z } from "zod";
11
11
 
12
12
  //#region package.json
13
13
  var name = "aiex-cli";
14
- var version = "0.0.7-beta.2";
14
+ var version = "0.1.0-beta.1";
15
15
  var description = "JSON Schema → SQLite with AI-powered data extraction";
16
16
  var package_default = {
17
17
  name,
@@ -42,7 +42,6 @@ var package_default = {
42
42
  exports: {
43
43
  ".": "./dist/index.mjs",
44
44
  "./cli": "./dist/cli.mjs",
45
- "./core/schema-sqlite/migrate-helper": "./dist/core/schema-sqlite/migrate-helper.mjs",
46
45
  "./package.json": "./package.json"
47
46
  },
48
47
  main: "./dist/index.mjs",
@@ -55,8 +54,8 @@ var package_default = {
55
54
  files: [
56
55
  "bin",
57
56
  "dist",
58
- "src/core/schema-sqlite/migrate-helper.ts",
59
- "src/core/schema-sqlite/migration-name.ts"
57
+ "src/infrastructure/schema/migrate-helper.ts",
58
+ "src/infrastructure/schema/migration-name.ts"
60
59
  ],
61
60
  scripts: {
62
61
  "build": "tsdown && pnpm --filter aiex-web build",
@@ -64,6 +63,7 @@ var package_default = {
64
63
  "start": "tsx src/index.ts",
65
64
  "test": "vitest",
66
65
  "coverage": "vitest --coverage",
66
+ "smoke:package": "node scripts/package-smoke.mjs",
67
67
  "typecheck": "tsc",
68
68
  "lint": "eslint .",
69
69
  "prepack": "cp ../../README.md . && node scripts/generate-completions.mjs",
@@ -111,7 +111,10 @@ var package_default = {
111
111
  "xlsx": "catalog:",
112
112
  "zod": "catalog:"
113
113
  },
114
- optionalDependencies: { "@napi-rs/system-ocr": "catalog:" },
114
+ optionalDependencies: {
115
+ "@llamaindex/liteparse": "catalog:",
116
+ "@napi-rs/system-ocr": "catalog:"
117
+ },
115
118
  devDependencies: {
116
119
  "@antfu/eslint-config": "catalog:cli",
117
120
  "@antfu/ni": "catalog:cli",
@@ -146,6 +149,13 @@ function seedConfig(config = createConfig()) {
146
149
 
147
150
  //#endregion
148
151
  //#region src/domain/ai/types.ts
152
+ const PDF_CONVERTER_KINDS = [
153
+ "unpdf",
154
+ "liteparse",
155
+ "mineru",
156
+ "mineru_api",
157
+ "external"
158
+ ];
149
159
  const PLACEHOLDER_SCHEMA = "{schema}";
150
160
  const PLACEHOLDER_TEXT = "{text}";
151
161
  const DEFAULT_MODELS = [{
@@ -192,6 +202,10 @@ const DEFAULT_MINERU_CONFIG = {
192
202
  timeout: 600,
193
203
  fallbackToUnpdf: true
194
204
  };
205
+ const DEFAULT_LITEPARSE_CONFIG = {
206
+ ocrEnabled: false,
207
+ ocrLanguage: "eng"
208
+ };
195
209
  const DEFAULT_MINERU_API_CONFIG = {
196
210
  token: "",
197
211
  baseURL: "https://mineru.net/api/v4",
@@ -202,6 +216,7 @@ const DEFAULT_MINERU_API_CONFIG = {
202
216
  };
203
217
  const DEFAULT_PDF_CONFIG = {
204
218
  converter: "unpdf",
219
+ liteparse: DEFAULT_LITEPARSE_CONFIG,
205
220
  mineru: DEFAULT_MINERU_CONFIG,
206
221
  mineruApi: DEFAULT_MINERU_API_CONFIG
207
222
  };
@@ -290,6 +305,21 @@ function doctorDiagnosticsTableRows(d) {
290
305
  for (const err of p.errors) rows.push(["error", err]);
291
306
  return rows;
292
307
  }
308
+ function doctorDiagnosticsSeverityRows(d) {
309
+ const rows = [];
310
+ const p = d.project;
311
+ rows.push([p.dirExists ? "ok" : "warn", p.dirExists ? "Project directory exists" : "Project directory is not initialized"]);
312
+ rows.push([p.aiConfig ? "ok" : "warn", p.aiConfig ? "AI config exists" : "AI config is missing"]);
313
+ if (p.aiConfig) rows.push([p.aiApiKeySet ? "ok" : "warn", p.aiApiKeySet ? "AI API key is set" : "AI API key is empty"]);
314
+ if (p.aiConnectionOk !== null) rows.push([p.aiConnectionOk ? "ok" : "warn", p.aiConnectionOk ? "AI provider connection succeeded" : "AI provider connection failed"]);
315
+ if (p.pdfConverterOk !== null) rows.push([p.pdfConverterOk ? "ok" : "error", p.pdfConverterOk ? `PDF converter is available: ${p.pdfConverter ?? "none"}` : `PDF converter is unavailable: ${p.pdfConverter ?? "none"}${p.pdfConverterError ? ` (${p.pdfConverterError})` : ""}`]);
316
+ else if (p.pdfConverterError) rows.push(["warn", p.pdfConverterError]);
317
+ if (d.imageOcr.ocrOk !== null) rows.push([d.imageOcr.ocrOk ? "ok" : "warn", d.imageOcr.ocrOk ? "Image OCR self-check passed" : `Image OCR self-check failed${d.imageOcr.error ? `: ${d.imageOcr.error}` : ""}`]);
318
+ if (p.databaseTablesOk !== null) rows.push([p.databaseTablesOk ? "ok" : "error", p.databaseTablesOk ? "Database tables match schemas" : `Database tables are missing: ${p.missingDatabaseTables.join(", ") || "unknown"}`]);
319
+ for (const invalid of p.invalidSchemas) rows.push(["error", `Invalid schema ${invalid.file}: ${invalid.error}`]);
320
+ for (const err of p.errors) rows.push(["error", err]);
321
+ return rows;
322
+ }
293
323
 
294
324
  //#endregion
295
325
  //#region src/domain/schema/parser.ts
@@ -653,6 +683,15 @@ const MineruApiPdfConverterConfigSchema = z.object({
653
683
  enableFormula: z.boolean().optional(),
654
684
  enableTable: z.boolean().optional()
655
685
  });
686
+ const LiteparsePdfConverterConfigSchema = z.object({
687
+ ocrEnabled: z.boolean().default(false),
688
+ ocrLanguage: z.string().min(1).default("eng"),
689
+ tessdataPath: z.string().min(1).optional(),
690
+ ocrServerUrl: z.string().url().refine((value) => {
691
+ const url = new URL(value);
692
+ return url.protocol === "http:" || url.protocol === "https:";
693
+ }, { message: "ocrServerUrl must use http or https" }).optional()
694
+ });
656
695
  const PdfConfigSchema = z.preprocess((value) => {
657
696
  if (!value || typeof value !== "object") return value;
658
697
  const config = { ...value };
@@ -667,12 +706,8 @@ const PdfConfigSchema = z.preprocess((value) => {
667
706
  delete config.marker;
668
707
  return config;
669
708
  }, z.object({
670
- converter: z.enum([
671
- "unpdf",
672
- "mineru",
673
- "mineru_api",
674
- "external"
675
- ]),
709
+ converter: z.enum(PDF_CONVERTER_KINDS),
710
+ liteparse: LiteparsePdfConverterConfigSchema.optional(),
676
711
  mineru: ExternalPdfConverterConfigSchema.optional(),
677
712
  mineruApi: MineruApiPdfConverterConfigSchema.optional(),
678
713
  external: ExternalPdfConverterConfigSchema.optional()
@@ -1184,7 +1219,9 @@ const en = {
1184
1219
  pdf: {
1185
1220
  converterOptions: {
1186
1221
  unpdf: "Built-in text extraction (unpdf)",
1222
+ liteparse: "Built-in layout parsing (liteparse)",
1187
1223
  mineru: "MinerU (mineru)",
1224
+ mineru_api: "MinerU API (mineru_api)",
1188
1225
  external: "Custom External Command"
1189
1226
  },
1190
1227
  ocrFallbackOptions: { localAuto: "Vision model or local OCR" }
@@ -1258,7 +1295,7 @@ async function initI18n(lng) {
1258
1295
  fallbackLng: "en",
1259
1296
  resources: {
1260
1297
  "en": { translation: en },
1261
- "zh-CN": { translation: await import("./zh-CN-wEUNhuHM.mjs").then((m) => m.zhCN) }
1298
+ "zh-CN": { translation: await import("./zh-CN-B2yrInX9.mjs").then((m) => m.zhCN) }
1262
1299
  },
1263
1300
  interpolation: { escapeValue: false },
1264
1301
  returnNull: false
@@ -1419,6 +1456,14 @@ async function commandAvailable(command) {
1419
1456
  return false;
1420
1457
  }
1421
1458
  }
1459
+ async function liteparseAvailable() {
1460
+ try {
1461
+ await import("@llamaindex/liteparse");
1462
+ return true;
1463
+ } catch {
1464
+ return false;
1465
+ }
1466
+ }
1422
1467
  async function findImageOcrSelfCheckLogo() {
1423
1468
  const candidates = [
1424
1469
  path.resolve(MODULE_DIR, "logo.png"),
@@ -1473,7 +1518,11 @@ async function collectDoctorDiagnostics(options = {}) {
1473
1518
  aiConnectionOk = await checkConnection(cfg.provider.baseURL);
1474
1519
  pdfConverter = cfg.pdf?.converter ?? "unpdf";
1475
1520
  if (pdfConverter === "unpdf") pdfConverterOk = true;
1476
- else if (pdfConverter === "mineru") {
1521
+ else if (pdfConverter === "liteparse") {
1522
+ pdfConverterOk = await liteparseAvailable();
1523
+ if (!pdfConverterOk) pdfConverterError = "@llamaindex/liteparse optional dependency is not installed or cannot be loaded";
1524
+ else if (cfg.pdf?.liteparse?.ocrEnabled && !cfg.pdf.liteparse.tessdataPath) pdfConverterError = "LiteParse OCR is enabled. If OCR fails, install Tesseract traineddata and configure pdf.liteparse.tessdataPath.";
1525
+ } else if (pdfConverter === "mineru") {
1477
1526
  const command = cfg.pdf?.mineru?.command ?? DEFAULT_MINERU_CONFIG.command;
1478
1527
  pdfConverterOk = await commandAvailable(command);
1479
1528
  if (!pdfConverterOk) pdfConverterError = `Command not found: ${command}`;
@@ -1671,4 +1720,4 @@ function generateDrizzleSchema(result) {
1671
1720
  }
1672
1721
 
1673
1722
  //#endregion
1674
- export { PLACEHOLDER_TEXT as C, name as D, description as E, package_default as O, PLACEHOLDER_SCHEMA as S, seedConfig as T, doctorDiagnosticsTableRows as _, recognizeImageText as a, DEFAULT_MINERU_CONFIG as b, t as c, writeAIConfig as d, AIConfigSchema as f, buildDoctorDiagnostics as g, toSnakeCase as h, generateDrizzleConfig as i, version as k, getDefaultAIConfig as l, parseJsonSchema as m, collectDoctorDiagnostics as n, shouldUseImageOcrFallback as o, JsonSchemaDefinitionSchema as p, createMigrationConfig as r, initI18n as s, generateDrizzleSchema as t, readAIConfig as u, formatDoctorDiagnosticsJson as v, createConfig as w, DEFAULT_PROMPT_CONFIG as x, DEFAULT_MINERU_API_CONFIG as y };
1723
+ export { package_default as A, DEFAULT_PROMPT_CONFIG as C, seedConfig as D, createConfig as E, description as O, DEFAULT_MINERU_CONFIG as S, PLACEHOLDER_TEXT as T, doctorDiagnosticsSeverityRows as _, recognizeImageText as a, DEFAULT_LITEPARSE_CONFIG as b, t as c, writeAIConfig as d, AIConfigSchema as f, buildDoctorDiagnostics as g, toSnakeCase as h, generateDrizzleConfig as i, version as j, name as k, getDefaultAIConfig as l, parseJsonSchema as m, collectDoctorDiagnostics as n, shouldUseImageOcrFallback as o, JsonSchemaDefinitionSchema as p, createMigrationConfig as r, initI18n as s, generateDrizzleSchema as t, readAIConfig as u, doctorDiagnosticsTableRows as v, PLACEHOLDER_SCHEMA as w, DEFAULT_MINERU_API_CONFIG as x, formatDoctorDiagnosticsJson as y };
package/dist/index.d.mts CHANGED
@@ -81,6 +81,7 @@ declare function buildDoctorDiagnostics(input: {
81
81
  }): DoctorDiagnostics;
82
82
  declare function formatDoctorDiagnosticsJson(d: DoctorDiagnostics): string;
83
83
  declare function doctorDiagnosticsTableRows(d: DoctorDiagnostics): [string, string][];
84
+ declare function doctorDiagnosticsSeverityRows(d: DoctorDiagnostics): [string, string][];
84
85
  //#endregion
85
86
  //#region src/config.d.ts
86
87
  interface AppConfig {
@@ -363,4 +364,4 @@ declare function generateDrizzleSchema(result: ParseResult): string;
363
364
  declare function createMigrationConfig(cwd: string): MigrationConfig;
364
365
  declare function generateDrizzleConfig(): string;
365
366
  //#endregion
366
- export { type DoctorDiagnostics, type JsonSchemaDefinition, JsonSchemaDefinitionSchema, type JsonSchemaProperty, type MigrationConfig, type ParseResult, type ParsedColumn, type ParsedRelation, type ParsedTable, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
367
+ export { type DoctorDiagnostics, type JsonSchemaDefinition, JsonSchemaDefinitionSchema, type JsonSchemaProperty, type MigrationConfig, type ParseResult, type ParsedColumn, type ParsedRelation, type ParsedTable, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsSeverityRows, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as doctorDiagnosticsTableRows, g as buildDoctorDiagnostics, i as generateDrizzleConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, t as generateDrizzleSchema, v as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-D_oDmf4J.mjs";
1
+ import { _ as doctorDiagnosticsSeverityRows, g as buildDoctorDiagnostics, i as generateDrizzleConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, t as generateDrizzleSchema, v as doctorDiagnosticsTableRows, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-BAMq_Ufp.mjs";
2
2
 
3
- export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
3
+ export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsSeverityRows, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
@@ -15,7 +15,7 @@ function sanitizeMigrationName(name) {
15
15
  }
16
16
 
17
17
  //#endregion
18
- //#region src/core/schema-sqlite/migrate-helper.ts
18
+ //#region src/infrastructure/schema/migrate-helper.ts
19
19
  const require = createRequire(import.meta.url);
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
@@ -40,7 +40,7 @@ async function loadSchemaExports(schemaPath) {
40
40
  const pkgPath = require.resolve("aiex-cli/package.json");
41
41
  cliDir = path.dirname(pkgPath);
42
42
  } catch {
43
- cliDir = path.dirname(path.dirname(path.dirname(path.dirname(__dirname))));
43
+ cliDir = path.dirname(path.dirname(path.dirname(__dirname)));
44
44
  }
45
45
  const result = await esbuild.build({
46
46
  entryPoints: [schemaPath],