aiex-cli 0.0.1-beta.29 → 0.0.1-beta.30

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.
Files changed (108) hide show
  1. package/README.md +4 -15
  2. package/dist/cli.mjs +95 -246
  3. package/dist/{completions-ygS1okck.mjs → completions-C3rmTwXZ.mjs} +2 -2
  4. package/dist/core/schema-sqlite/migrate-helper.mjs +12 -7
  5. package/dist/{doctor-collector-j2dG7dG1.mjs → doctor-collector-DhiJrVw5.mjs} +14 -6
  6. package/dist/index.mjs +1 -1
  7. package/dist/web/assets/{AISettings-Dn58ZHhM.js → AISettings-BjXxD5Ts.js} +1 -1
  8. package/dist/web/assets/DataBrowser-CwcTG80-.js +6 -0
  9. package/dist/web/assets/{ExtractionViewer-CTS1RXzc.js → ExtractionViewer-CsdK1kKK.js} +1 -1
  10. package/dist/web/assets/{JsonSchemaEditor-Dpgu6HPz.js → JsonSchemaEditor-BhY9BNOn.js} +15 -15
  11. package/dist/web/assets/{cssMode-BM5FOYIl.js → cssMode-CPThwItX.js} +1 -1
  12. package/dist/web/assets/dist-9yHVMqQ0.js +1 -0
  13. package/dist/web/assets/{editor.main-C2Q97Dkk.js → editor.main-BnOkwRFv.js} +2 -2
  14. package/dist/web/assets/{freemarker2-BqyJTCTn.js → freemarker2-DWDTYVJR.js} +1 -1
  15. package/dist/web/assets/{handlebars-DxRJTefg.js → handlebars-D4DzjGQ7.js} +1 -1
  16. package/dist/web/assets/{html-gyvgrapw.js → html-DnzhKSoD.js} +1 -1
  17. package/dist/web/assets/{htmlMode-CNjCRwdY.js → htmlMode-CR7UKfEH.js} +1 -1
  18. package/dist/web/assets/index-DCAKotsV.js +882 -0
  19. package/dist/web/assets/{javascript-BK6ufvq6.js → javascript-D2srszZ8.js} +1 -1
  20. package/dist/web/assets/{jsonMode-m2trGjkO.js → jsonMode-B4jaPYEr.js} +1 -1
  21. package/dist/web/assets/{liquid-BtyuYqQQ.js → liquid-CIT2Wl_l.js} +1 -1
  22. package/dist/web/assets/{mdx-C8K4EvCQ.js → mdx-CWLaEOFy.js} +1 -1
  23. package/dist/web/assets/{monaco.contribution-BTr-G8hO.js → monaco.contribution-DDv5ldfS.js} +2 -2
  24. package/dist/web/assets/{python-8dyH1nS_.js → python-6CGfpCNq.js} +1 -1
  25. package/dist/web/assets/{razor-DtWMI74k.js → razor-DEMMh3TD.js} +1 -1
  26. package/dist/web/assets/{tsMode-Dv8YG-YK.js → tsMode-Cm1NtjPs.js} +1 -1
  27. package/dist/web/assets/{typescript-DbClKYS3.js → typescript-BM9aPEFg.js} +1 -1
  28. package/dist/web/assets/{xml-Bb59gjP6.js → xml-CoSbvcg5.js} +1 -1
  29. package/dist/web/assets/{yaml-DVMb_IfV.js → yaml-56GOgy8k.js} +1 -1
  30. package/dist/web/index.html +4 -3
  31. package/package.json +8 -3
  32. package/src/core/schema-sqlite/migrate-helper.ts +6 -5
  33. package/dist/web/assets/DataBrowser-B6WECCZM.js +0 -6
  34. package/dist/web/assets/index-g2pWXPQZ.js +0 -882
  35. /package/dist/web/assets/{abap-DiwvWnMr.js → abap-Bgec7Keq.js} +0 -0
  36. /package/dist/web/assets/{apex-CmtZjKlf.js → apex-VBlPwEoQ.js} +0 -0
  37. /package/dist/web/assets/{api-client-CbQEkaKT.js → api-client-D2Y_-4JM.js} +0 -0
  38. /package/dist/web/assets/{azcli-DL2My_i-.js → azcli-DKqrEFBx.js} +0 -0
  39. /package/dist/web/assets/{bat-B-nC98wG.js → bat-DdgQWy_0.js} +0 -0
  40. /package/dist/web/assets/{bicep-Ju5MwOgh.js → bicep-CRMM43EB.js} +0 -0
  41. /package/dist/web/assets/{cameligo-8Eu1TyBr.js → cameligo-UatALtML.js} +0 -0
  42. /package/dist/web/assets/{clojure-u-RpMkH3.js → clojure-D8JU08RA.js} +0 -0
  43. /package/dist/web/assets/{coffee-CdA7bbTe.js → coffee-C56wu358.js} +0 -0
  44. /package/dist/web/assets/{cpp-CzNFP8ks.js → cpp-CyZLvhJG.js} +0 -0
  45. /package/dist/web/assets/{csharp-j1LThmcE.js → csharp-BJl3ixva.js} +0 -0
  46. /package/dist/web/assets/{csp-CLRC61y6.js → csp-CxEKxmO-.js} +0 -0
  47. /package/dist/web/assets/{css-r6rC_7P2.js → css-B0t_muXd.js} +0 -0
  48. /package/dist/web/assets/{cypher-CW08XVUh.js → cypher-D1hqiMFD.js} +0 -0
  49. /package/dist/web/assets/{dart-Cs9aL5T_.js → dart-Bz550Pyv.js} +0 -0
  50. /package/dist/web/assets/{dockerfile-BWM0M184.js → dockerfile-CIXgVAuA.js} +0 -0
  51. /package/dist/web/assets/{ecl-MJJuer5P.js → ecl-D9qbvZoA.js} +0 -0
  52. /package/dist/web/assets/{editor.api-nsOUOZde.js → editor.api-C8BHpRhn.js} +0 -0
  53. /package/dist/web/assets/{elixir-D2AIuXqn.js → elixir-b2M38fAy.js} +0 -0
  54. /package/dist/web/assets/{flow9-B2H24giC.js → flow9-Dq1UYMkt.js} +0 -0
  55. /package/dist/web/assets/{fsharp-CFNadkg7.js → fsharp-BaeLhgfq.js} +0 -0
  56. /package/dist/web/assets/{go-dSur1iB2.js → go-Bd-NFKIC.js} +0 -0
  57. /package/dist/web/assets/{graphql-qyhAo11d.js → graphql-DZVerJfy.js} +0 -0
  58. /package/dist/web/assets/{hcl-DFzjMyzm.js → hcl-CAVzrZfH.js} +0 -0
  59. /package/dist/web/assets/{ini-TdzA8TIl.js → ini-CyXdX58t.js} +0 -0
  60. /package/dist/web/assets/{java-CSGA9pkE.js → java-B5pNgvhy.js} +0 -0
  61. /package/dist/web/assets/{julia-9izz5OsY.js → julia-XRhmV3AN.js} +0 -0
  62. /package/dist/web/assets/{kotlin-DuPK7AtF.js → kotlin-DOd3J5vr.js} +0 -0
  63. /package/dist/web/assets/{less-B8d93iCg.js → less-veZSnyw6.js} +0 -0
  64. /package/dist/web/assets/{lexon-DWtEIyu7.js → lexon-QWGkuK0H.js} +0 -0
  65. /package/dist/web/assets/{lua-Ciq0OGgt.js → lua-CYGpjuO5.js} +0 -0
  66. /package/dist/web/assets/{m3-Cki6JWj_.js → m3-yNnrZkdc.js} +0 -0
  67. /package/dist/web/assets/{markdown-Cu47xwU0.js → markdown-BCSWEPSX.js} +0 -0
  68. /package/dist/web/assets/{mips-BM8ui995.js → mips-OpYmcC30.js} +0 -0
  69. /package/dist/web/assets/{msdax-DqLio0_c.js → msdax-2oxoTO9Z.js} +0 -0
  70. /package/dist/web/assets/{mysql-v1wbjJOq.js → mysql-5KlC-K_9.js} +0 -0
  71. /package/dist/web/assets/{objective-c-CQl3PGSB.js → objective-c-CcDCgtLx.js} +0 -0
  72. /package/dist/web/assets/{pascal-D4iW0ZtD.js → pascal-BZGsbaEV.js} +0 -0
  73. /package/dist/web/assets/{pascaligo-BdC9CZdj.js → pascaligo-DtD5qU3G.js} +0 -0
  74. /package/dist/web/assets/{perl-BL10m4XD.js → perl-C1jNNS3E.js} +0 -0
  75. /package/dist/web/assets/{pgsql-Be_oqVo3.js → pgsql-CT0fhiZa.js} +0 -0
  76. /package/dist/web/assets/{php-BtvXSFRI.js → php-D6DrXoPM.js} +0 -0
  77. /package/dist/web/assets/{pla-B2vUy15C.js → pla-b3-HN2pF.js} +0 -0
  78. /package/dist/web/assets/{postiats-CbmTTfXr.js → postiats-Bin2ApVS.js} +0 -0
  79. /package/dist/web/assets/{powerquery-DszLhJGx.js → powerquery-7ASnn-ZG.js} +0 -0
  80. /package/dist/web/assets/{powershell-B0dYktF6.js → powershell-t4p7sU1H.js} +0 -0
  81. /package/dist/web/assets/{preload-helper-DWTEM3RW.js → preload-helper-Dd-HcVz_.js} +0 -0
  82. /package/dist/web/assets/{protobuf-CZvaj1VX.js → protobuf-BUGeWa_j.js} +0 -0
  83. /package/dist/web/assets/{pug-CPDx1B3S.js → pug-BuKcgC9s.js} +0 -0
  84. /package/dist/web/assets/{qsharp-CAxMZVjw.js → qsharp-DxLLX8mo.js} +0 -0
  85. /package/dist/web/assets/{r-8DbbFX2l.js → r-DMlFgn7A.js} +0 -0
  86. /package/dist/web/assets/{redis-DRWj9MtJ.js → redis-cXItkC5u.js} +0 -0
  87. /package/dist/web/assets/{redshift-C6cElE_5.js → redshift-BZVbW7HE.js} +0 -0
  88. /package/dist/web/assets/{restructuredtext-W9pS9n3m.js → restructuredtext-BzjxwS8h.js} +0 -0
  89. /package/dist/web/assets/{ruby-BKnzWnk-.js → ruby-C5nyLV4l.js} +0 -0
  90. /package/dist/web/assets/{rust-YPCclWwe.js → rust-BcmMsHdf.js} +0 -0
  91. /package/dist/web/assets/{sb-BgM4DTFb.js → sb-Dnb1iy6B.js} +0 -0
  92. /package/dist/web/assets/{scala-fz1OPLMl.js → scala-anMIFYpA.js} +0 -0
  93. /package/dist/web/assets/{scheme-8Uz1RIbu.js → scheme-BItQTe08.js} +0 -0
  94. /package/dist/web/assets/{scss-Djo3IYXr.js → scss-BOv51BJ5.js} +0 -0
  95. /package/dist/web/assets/{select-DyjIzt-v.js → select-BGex2SPs.js} +0 -0
  96. /package/dist/web/assets/{shell-CINF5Tx_.js → shell-BsRYRTNN.js} +0 -0
  97. /package/dist/web/assets/{solidity-GgiNEuUm.js → solidity-BtuLgGDx.js} +0 -0
  98. /package/dist/web/assets/{sophia-Culj97P9.js → sophia-B0Vkc5MF.js} +0 -0
  99. /package/dist/web/assets/{sparql-C2ZlpxOY.js → sparql-B7lvkZQM.js} +0 -0
  100. /package/dist/web/assets/{sql-BEf5Pg7Y.js → sql-DvP5MpA3.js} +0 -0
  101. /package/dist/web/assets/{st-CT6UUoeH.js → st-GVUeyB3U.js} +0 -0
  102. /package/dist/web/assets/{swift-B5g0xTG3.js → swift-DSPIoCjm.js} +0 -0
  103. /package/dist/web/assets/{systemverilog-CEgQz9DR.js → systemverilog-Icj2-k23.js} +0 -0
  104. /package/dist/web/assets/{tcl-D0qL2L0I.js → tcl-Cd8KQcm-.js} +0 -0
  105. /package/dist/web/assets/{twig-BFUAVf1E.js → twig-CBHmt8z3.js} +0 -0
  106. /package/dist/web/assets/{typespec-CjVVcNKm.js → typespec-Ckc037mq.js} +0 -0
  107. /package/dist/web/assets/{vb-CZJr-DQz.js → vb-B97GW9Wb.js} +0 -0
  108. /package/dist/web/assets/{wgsl-ivoXUo2e.js → wgsl-DIKmb3YH.js} +0 -0
@@ -2,6 +2,7 @@ import { createRequire } from "node:module";
2
2
  import fs from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import process from "node:process";
5
+ import { readFile, writeFile } from "jsonfile";
5
6
  import { fileURLToPath } from "node:url";
6
7
  import Database from "better-sqlite3";
7
8
  import * as esbuild from "esbuild";
@@ -63,11 +64,10 @@ async function loadSchemaExports(schemaPath) {
63
64
  async function loadPrevSnapshot(migrationsPath) {
64
65
  const metaPath = path.join(migrationsPath, "meta", "_journal.json");
65
66
  try {
66
- const journal = JSON.parse(await fs.readFile(metaPath, "utf-8"));
67
+ const journal = await readFile(metaPath);
67
68
  if (!journal.entries?.length) return null;
68
69
  const latestEntry = journal.entries[journal.entries.length - 1];
69
- const snapshotPath = path.join(migrationsPath, "meta", `${latestEntry.tag}_snapshot.json`);
70
- return JSON.parse(await fs.readFile(snapshotPath, "utf-8"));
70
+ return await readFile(path.join(migrationsPath, "meta", `${latestEntry.tag}_snapshot.json`));
71
71
  } catch {
72
72
  return null;
73
73
  }
@@ -78,7 +78,7 @@ async function saveSnapshot(migrationsPath, snapshot, migrationName) {
78
78
  const journalPath = path.join(metaPath, "_journal.json");
79
79
  let journal;
80
80
  try {
81
- journal = JSON.parse(await fs.readFile(journalPath, "utf-8"));
81
+ journal = await readFile(journalPath);
82
82
  } catch {
83
83
  journal = {
84
84
  version: "6",
@@ -89,8 +89,10 @@ async function saveSnapshot(migrationsPath, snapshot, migrationName) {
89
89
  const idx = journal.entries.length + 1;
90
90
  const suffix = sanitizeMigrationName(migrationName) || snapshot.id.replace(/-/g, "_").substring(0, 8);
91
91
  const tag = `${String(idx).padStart(4, "0")}_${suffix}`;
92
- const snapshotPath = path.join(metaPath, `${tag}_snapshot.json`);
93
- await fs.writeFile(snapshotPath, JSON.stringify(snapshot, null, 2));
92
+ await writeFile(path.join(metaPath, `${tag}_snapshot.json`), snapshot, {
93
+ spaces: 2,
94
+ EOL: "\n"
95
+ });
94
96
  journal.entries.push({
95
97
  idx,
96
98
  version: snapshot.id,
@@ -98,7 +100,10 @@ async function saveSnapshot(migrationsPath, snapshot, migrationName) {
98
100
  tag,
99
101
  breakpoints: true
100
102
  });
101
- await fs.writeFile(journalPath, JSON.stringify(journal, null, 2));
103
+ await writeFile(journalPath, journal, {
104
+ spaces: 2,
105
+ EOL: "\n"
106
+ });
102
107
  return tag;
103
108
  }
104
109
  async function saveMigrationFile(migrationsPath, tag, sqlStatements) {
@@ -3,6 +3,7 @@ import os from "node:os";
3
3
  import path from "node:path";
4
4
  import process from "node:process";
5
5
  import Conf from "conf";
6
+ import { readFile, writeFile } from "jsonfile";
6
7
  import { z } from "zod";
7
8
 
8
9
  //#region src/core/doctor.ts
@@ -64,7 +65,7 @@ function doctorDiagnosticsTableRows(d) {
64
65
  //#endregion
65
66
  //#region package.json
66
67
  var name = "aiex-cli";
67
- var version = "0.0.1-beta.29";
68
+ var version = "0.0.1-beta.30";
68
69
  var description = "JSON Schema → SQLite with AI-powered data extraction";
69
70
  var package_default = {
70
71
  name,
@@ -124,6 +125,7 @@ var package_default = {
124
125
  "@ai-sdk/openai-compatible": "catalog:",
125
126
  "@clack/prompts": "catalog:",
126
127
  "@hono/node-server": "catalog:",
128
+ "@hono/zod-validator": "catalog:",
127
129
  "@langfuse/otel": "catalog:",
128
130
  "@opentelemetry/sdk-trace-node": "catalog:",
129
131
  "ai": "catalog:",
@@ -139,10 +141,14 @@ var package_default = {
139
141
  "esbuild": "catalog:",
140
142
  "execa": "catalog:",
141
143
  "hono": "catalog:",
144
+ "jsonfile": "catalog:",
145
+ "jsonrepair": "catalog:",
146
+ "mime": "catalog:",
147
+ "open": "catalog:",
142
148
  "p-retry": "catalog:",
143
149
  "picocolors": "catalog:",
144
- "picomatch": "catalog:",
145
150
  "proper-lockfile": "catalog:",
151
+ "tinyglobby": "catalog:",
146
152
  "tsx": "catalog:cli",
147
153
  "unpdf": "catalog:",
148
154
  "update-notifier": "catalog:",
@@ -152,8 +158,8 @@ var package_default = {
152
158
  "@antfu/eslint-config": "catalog:cli",
153
159
  "@antfu/ni": "catalog:cli",
154
160
  "@types/better-sqlite3": "catalog:types",
161
+ "@types/jsonfile": "catalog:",
155
162
  "@types/node": "catalog:types",
156
- "@types/picomatch": "catalog:",
157
163
  "@types/proper-lockfile": "catalog:",
158
164
  "@types/update-notifier": "catalog:",
159
165
  "@vitest/coverage-v8": "catalog:testing",
@@ -297,8 +303,7 @@ const GITIGNORE_FILE = ".gitignore";
297
303
  async function readAIConfig(aiexDir) {
298
304
  const configPath = path.join(aiexDir, CONFIG_FILE_NAME);
299
305
  try {
300
- const content = await fs.readFile(configPath, "utf-8");
301
- const parsed = JSON.parse(content);
306
+ const parsed = await readFile(configPath);
302
307
  return AIConfigSchema.parse(parsed);
303
308
  } catch {
304
309
  return null;
@@ -307,7 +312,10 @@ async function readAIConfig(aiexDir) {
307
312
  async function writeAIConfig(aiexDir, config) {
308
313
  const configPath = path.join(aiexDir, CONFIG_FILE_NAME);
309
314
  await fs.mkdir(aiexDir, { recursive: true });
310
- await fs.writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`);
315
+ await writeFile(configPath, config, {
316
+ spaces: 2,
317
+ EOL: "\n"
318
+ });
311
319
  await addToGitignore(aiexDir, CONFIG_FILE_NAME);
312
320
  }
313
321
  function getDefaultAIConfig() {
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { C as doctorDiagnosticsTableRows, S as buildDoctorDiagnostics, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics, w as formatDoctorDiagnosticsJson } from "./doctor-collector-j2dG7dG1.mjs";
1
+ import { C as doctorDiagnosticsTableRows, S as buildDoctorDiagnostics, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics, w as formatDoctorDiagnosticsJson } from "./doctor-collector-DhiJrVw5.mjs";
2
2
 
3
3
  export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
@@ -1,4 +1,4 @@
1
- import{B as e,H as t,Jt as n,K as r,L as i,Lt as a,M as o,Pn as s,Pt as c,Q as l,R as u,S as d,Sn as f,Tn as p,U as m,W as h,Yt as g,_,c as v,d as ee,g as y,h as b,ht as x,i as S,in as C,jn as w,lt as T,m as E,nt as D,t as O,un as k,v as A,w as j,x as M}from"./button-Cdgr9Igy.js";import{i as N,n as P,r as F,s as I,t as te}from"./dialog-CUkPLPNP.js";import{s as ne,t as L}from"./runtime-dom.esm-bundler-ei_N7Xjw.js";import{d as re,f as ie,h as ae,n as oe}from"./api-client-CbQEkaKT.js";import{i as R,n as z,o as B,r as V,t as se}from"./select-DyjIzt-v.js";var H={name:`MinusIcon`,extends:S};function ce(e){return ue(e)||W(e)||le(e)||U()}function U(){throw TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{B as e,H as t,Jt as n,K as r,L as i,Lt as a,M as o,Pn as s,Pt as c,Q as l,R as u,S as d,Sn as f,Tn as p,U as m,W as h,Yt as g,_,c as v,d as ee,g as y,h as b,ht as x,i as S,in as C,jn as w,lt as T,m as E,nt as D,t as O,un as k,v as A,w as j,x as M}from"./button-Cdgr9Igy.js";import{i as N,n as P,r as F,s as I,t as te}from"./dialog-CUkPLPNP.js";import{s as ne,t as L}from"./runtime-dom.esm-bundler-ei_N7Xjw.js";import{d as re,f as ie,h as ae,n as oe}from"./api-client-D2Y_-4JM.js";import{i as R,n as z,o as B,r as V,t as se}from"./select-BGex2SPs.js";var H={name:`MinusIcon`,extends:S};function ce(e){return ue(e)||W(e)||le(e)||U()}function U(){throw TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(e,t){if(e){if(typeof e==`string`)return G(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}function W(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ue(e){if(Array.isArray(e))return G(e)}function G(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function K(t,n,r,i,a,s){return e(),A(`svg`,o({width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},t.pti()),ce(n[0]||=[b(`path`,{d:`M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z`,fill:`currentColor`},null,-1)]),16)}H.render=K;var q=v.extend({name:`checkbox`,style:`
3
3
  .p-checkbox {
4
4
  position: relative;