aiex-cli 0.0.1-beta.9 → 0.0.2-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/README.md +50 -26
- package/dist/cli.mjs +1776 -626
- package/dist/{completions-ygS1okck.mjs → completions-C3rmTwXZ.mjs} +2 -2
- package/dist/core/schema-sqlite/migrate-helper.mjs +35 -37
- package/dist/{doctor-BiU1lDp-.mjs → doctor-collector-Cbqgwx__.mjs} +309 -223
- package/dist/index.d.mts +15 -15
- package/dist/index.mjs +1 -1
- package/dist/table-schema.json +4 -0
- package/dist/web/assets/AISettings-Cm8fAfaG.js +205 -0
- package/dist/web/assets/DataBrowser-DQwOvooY.js +6 -0
- package/dist/web/assets/ExtractRunner-CzfLlCCf.js +1 -0
- package/dist/web/assets/ExtractionViewer-D7tghmR-.js +1 -0
- package/dist/web/assets/JsonSchemaEditor-DXhYW-Un.js +570 -0
- package/dist/web/assets/api-client-CIC2X8_4.js +1 -0
- package/dist/web/assets/baseinput-B7PU5-38.js +2 -0
- package/dist/web/assets/button-Cdgr9Igy.js +927 -0
- package/dist/web/assets/checkbox-CCQwMfLd.js +142 -0
- package/dist/web/assets/{cssMode-DAbG0CMn.js → cssMode-CCz1uj8b.js} +1 -1
- package/dist/web/assets/dialog-8xaIXBKO.js +108 -0
- package/dist/web/assets/dist-B5Yem2Jn.js +1 -0
- package/dist/web/assets/{editor.main-BqhfoHxy.js → editor.main-DOue-nGf.js} +2 -2
- package/dist/web/assets/{freemarker2-B9_5ct2b.js → freemarker2-C87H7V8i.js} +1 -1
- package/dist/web/assets/{handlebars-TY59WcoQ.js → handlebars-TLnoktZW.js} +1 -1
- package/dist/web/assets/{html-CLULsh27.js → html-Rewbtgcp.js} +1 -1
- package/dist/web/assets/{htmlMode-BvG7RNbU.js → htmlMode-Cr9y3YUi.js} +1 -1
- package/dist/web/assets/index-BEorm4a5.css +2 -0
- package/dist/web/assets/{index-CKUXTDYj.js → index-CWy8KajQ.js} +38 -38
- package/dist/web/assets/{javascript-DHrLp6gu.js → javascript-BO8DPECx.js} +1 -1
- package/dist/web/assets/{jsonMode-DBDhdzl1.js → jsonMode-B78m_Y1l.js} +1 -1
- package/dist/web/assets/{liquid-tGeb-nqF.js → liquid-CDp_8YUE.js} +1 -1
- package/dist/web/assets/{mdx-Cmdz78VU.js → mdx-CeR1GULE.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CroYPUF5.js → monaco.contribution-tCitzj1_.js} +2 -2
- package/dist/web/assets/object-utils-Cm2M3fPO.js +1 -0
- package/dist/web/assets/{python-Dmfz4iDE.js → python-DWmB1hQ6.js} +1 -1
- package/dist/web/assets/{razor-BJicZHJs.js → razor-BVk762Lq.js} +1 -1
- package/dist/web/assets/runtime-dom.esm-bundler-DZwuSnld.js +1 -0
- package/dist/web/assets/select-DKPPF403.js +438 -0
- package/dist/web/assets/{tsMode-DYqTyE66.js → tsMode-Gjs5D1gt.js} +1 -1
- package/dist/web/assets/{typescript-DLnTe9Hf.js → typescript-Cw6YtwrM.js} +1 -1
- package/dist/web/assets/utils-CZhxh2Ya.js +2 -0
- package/dist/web/assets/{xml-BIYqLORk.js → xml-guZq0YZJ.js} +1 -1
- package/dist/web/assets/{yaml-BjmulkMX.js → yaml-B9TbU-LX.js} +1 -1
- package/dist/web/index.html +11 -8
- package/package.json +17 -1
- package/src/core/schema-sqlite/migrate-helper.ts +32 -46
- package/dist/web/assets/AISettings-DOzonIux.js +0 -334
- package/dist/web/assets/DataBrowser-rznfVRaV.js +0 -3
- package/dist/web/assets/JsonSchemaEditor-C9iyQs7N.js +0 -929
- package/dist/web/assets/api-client-Dsg4WOM9.js +0 -1
- package/dist/web/assets/button-kTMweGMc.js +0 -927
- package/dist/web/assets/dialog-CWuu7WjI.js +0 -108
- package/dist/web/assets/index-DDFnprdM.css +0 -2
- package/dist/web/assets/lib-C30cIFrm.js +0 -1
- package/dist/web/assets/overlayeventbus-AtOpmI6n.js +0 -80
- package/dist/web/assets/table-schema-mJrrf9qw.js +0 -2
- /package/dist/web/assets/{abap-DrZwwXZX.js → abap-C3UM4cME.js} +0 -0
- /package/dist/web/assets/{apex-CrCz0btt.js → apex-BQBZvQmN.js} +0 -0
- /package/dist/web/assets/{azcli-BapzKHay.js → azcli-Dn9Awrok.js} +0 -0
- /package/dist/web/assets/{bat-C_NRAiA1.js → bat-JgEezSDo.js} +0 -0
- /package/dist/web/assets/{bicep-C7pp2CNk.js → bicep-vcQeC7wE.js} +0 -0
- /package/dist/web/assets/{cameligo-BhhK9vxZ.js → cameligo-C0cr0T3L.js} +0 -0
- /package/dist/web/assets/{clojure-D0ujmUyE.js → clojure-Brc1-rbW.js} +0 -0
- /package/dist/web/assets/{coffee-DHEl7Jbb.js → coffee-BiZYU83a.js} +0 -0
- /package/dist/web/assets/{cpp-Iil-3nzZ.js → cpp-ikWHCInz.js} +0 -0
- /package/dist/web/assets/{csharp-Dh0Ee7SY.js → csharp-BRWs_LfH.js} +0 -0
- /package/dist/web/assets/{csp-mwzjw0JL.js → csp-CcAumoJw.js} +0 -0
- /package/dist/web/assets/{css-COIa8ZTR.js → css-BZm6paiA.js} +0 -0
- /package/dist/web/assets/{cypher-GVc17FC4.js → cypher-CDQMONdb.js} +0 -0
- /package/dist/web/assets/{dart-phiCaE7_.js → dart-Ci4SZdF1.js} +0 -0
- /package/dist/web/assets/{dockerfile-BMaDhdim.js → dockerfile-BV0tAr-M.js} +0 -0
- /package/dist/web/assets/{ecl-Cj47kvqp.js → ecl-CP7nM2KN.js} +0 -0
- /package/dist/web/assets/{editor.api-DLXGyrN1.js → editor.api-BU_q4v8i.js} +0 -0
- /package/dist/web/assets/{elixir-DBbstcE1.js → elixir-GcA6wFiI.js} +0 -0
- /package/dist/web/assets/{flow9-ChHb1adO.js → flow9-CIb9youF.js} +0 -0
- /package/dist/web/assets/{fsharp-CMk2OIJN.js → fsharp-BVaBE4co.js} +0 -0
- /package/dist/web/assets/{go-BrMkuJg0.js → go-Bbqf306x.js} +0 -0
- /package/dist/web/assets/{graphql-PSR1UKGv.js → graphql-DJPrC4l-.js} +0 -0
- /package/dist/web/assets/{hcl-DAQrbDOW.js → hcl-QyfWVWpM.js} +0 -0
- /package/dist/web/assets/{ini-0TG5BxW0.js → ini-CgstZeS8.js} +0 -0
- /package/dist/web/assets/{java-rgorz17v.js → java-D4AG88ZY.js} +0 -0
- /package/dist/web/assets/{julia-C8VMdHm8.js → julia-CN8U9648.js} +0 -0
- /package/dist/web/assets/{kotlin-CllWo3gX.js → kotlin-gNNgpJhY.js} +0 -0
- /package/dist/web/assets/{less-Cgca25AP.js → less-C3SY2L8t.js} +0 -0
- /package/dist/web/assets/{lexon-D0GHdBaw.js → lexon-CznnqzUX.js} +0 -0
- /package/dist/web/assets/{lua-DmRsNG-P.js → lua-f3xyJgy5.js} +0 -0
- /package/dist/web/assets/{m3-BgL5dNKT.js → m3-Cl7J89p-.js} +0 -0
- /package/dist/web/assets/{markdown-BuJfycGS.js → markdown-Bv2fnzzT.js} +0 -0
- /package/dist/web/assets/{mips-C9m_93PR.js → mips-D6rXUTWa.js} +0 -0
- /package/dist/web/assets/{msdax-CpFHC9OI.js → msdax-Bb1N2x5J.js} +0 -0
- /package/dist/web/assets/{mysql-qFvltsqN.js → mysql-DXSr6oD7.js} +0 -0
- /package/dist/web/assets/{objective-c-Bnmr858J.js → objective-c-CEJiVkDa.js} +0 -0
- /package/dist/web/assets/{pascal-WP0_D5AO.js → pascal-BtkMEIba.js} +0 -0
- /package/dist/web/assets/{pascaligo-Blom4Rij.js → pascaligo-C7FAwqk7.js} +0 -0
- /package/dist/web/assets/{perl-B-vk8g64.js → perl-D9kqkBbN.js} +0 -0
- /package/dist/web/assets/{pgsql-Cgvz6v67.js → pgsql-BjGTBL1W.js} +0 -0
- /package/dist/web/assets/{php-8a3Lrw9m.js → php-BN0c0noA.js} +0 -0
- /package/dist/web/assets/{pla-DuFqEZ8V.js → pla-B94QTqOt.js} +0 -0
- /package/dist/web/assets/{postiats-DkLtSgkp.js → postiats-DH91dqBs.js} +0 -0
- /package/dist/web/assets/{powerquery-BJ1aNepW.js → powerquery-D7P0oUen.js} +0 -0
- /package/dist/web/assets/{powershell-rE98k687.js → powershell-CCVHmJax.js} +0 -0
- /package/dist/web/assets/{preload-helper-DWTEM3RW.js → preload-helper-DgFuoWHe.js} +0 -0
- /package/dist/web/assets/{protobuf-CUheFacr.js → protobuf-BIP7pixC.js} +0 -0
- /package/dist/web/assets/{pug-LDcAMD8w.js → pug-DcbLK7HH.js} +0 -0
- /package/dist/web/assets/{qsharp-IHfqKOfK.js → qsharp-B-VY_WOG.js} +0 -0
- /package/dist/web/assets/{r-D-QApv87.js → r-DwRtsJsj.js} +0 -0
- /package/dist/web/assets/{redis-SXdDyWR9.js → redis-CaW0tkwu.js} +0 -0
- /package/dist/web/assets/{redshift-Y6lsCryn.js → redshift-3tS8G0ME.js} +0 -0
- /package/dist/web/assets/{restructuredtext-edObr9a8.js → restructuredtext-_TNyGyK0.js} +0 -0
- /package/dist/web/assets/{ruby-CNnUfF-8.js → ruby-A-MwVfO4.js} +0 -0
- /package/dist/web/assets/{rust-IHUZWzBr.js → rust-oemlUIvG.js} +0 -0
- /package/dist/web/assets/{sb-DrUvY44N.js → sb-BDZuaI3W.js} +0 -0
- /package/dist/web/assets/{scala-B4hbXGLM.js → scala-Bfo2loK4.js} +0 -0
- /package/dist/web/assets/{scheme-BGrd12j3.js → scheme-N2eo7rjB.js} +0 -0
- /package/dist/web/assets/{scss-x5G1ES4U.js → scss-vjjSCTgN.js} +0 -0
- /package/dist/web/assets/{shell-DOehe2Y8.js → shell-Bfb9Yq6w.js} +0 -0
- /package/dist/web/assets/{solidity-BeRvcwWV.js → solidity-C9RbukzG.js} +0 -0
- /package/dist/web/assets/{sophia-DZbkUNjy.js → sophia-DWV_MWOg.js} +0 -0
- /package/dist/web/assets/{sparql-B7_oi5-h.js → sparql-iMXILWhh.js} +0 -0
- /package/dist/web/assets/{sql-CTlsFWVE.js → sql-CJDj31JM.js} +0 -0
- /package/dist/web/assets/{st-DJVEJdPE.js → st-BG9AQ1OO.js} +0 -0
- /package/dist/web/assets/{swift-CwhT3fYa.js → swift-B579DvHm.js} +0 -0
- /package/dist/web/assets/{systemverilog-BQN63pkN.js → systemverilog-BNgaF3ZX.js} +0 -0
- /package/dist/web/assets/{tcl-DqwfpskA.js → tcl-grdtJiUA.js} +0 -0
- /package/dist/web/assets/{twig-BiyenUgc.js → twig-JAsFXBZw.js} +0 -0
- /package/dist/web/assets/{typespec-CWOJribt.js → typespec-D3hIQXEU.js} +0 -0
- /package/dist/web/assets/{vb-Cq5F87m3.js → vb-H38jRcEz.js} +0 -0
- /package/dist/web/assets/{wgsl-BAvW2lVr.js → wgsl-BC5Grc5r.js} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import process from "node:process";
|
|
3
|
-
import { z } from "zod";
|
|
4
1
|
import fs from "node:fs/promises";
|
|
5
2
|
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import process from "node:process";
|
|
6
5
|
import Conf from "conf";
|
|
6
|
+
import { readFile, writeFile } from "jsonfile";
|
|
7
|
+
import { z } from "zod";
|
|
7
8
|
|
|
8
9
|
//#region src/core/doctor.ts
|
|
9
10
|
function buildDoctorDiagnostics(input) {
|
|
@@ -61,6 +62,308 @@ function doctorDiagnosticsTableRows(d) {
|
|
|
61
62
|
return rows;
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region package.json
|
|
67
|
+
var name = "aiex-cli";
|
|
68
|
+
var version = "0.0.2-beta.1";
|
|
69
|
+
var description = "JSON Schema → SQLite with AI-powered data extraction";
|
|
70
|
+
var package_default = {
|
|
71
|
+
name,
|
|
72
|
+
type: "module",
|
|
73
|
+
version,
|
|
74
|
+
description,
|
|
75
|
+
author: "OSpoon <zxin088@gmail.com>",
|
|
76
|
+
license: "MIT",
|
|
77
|
+
homepage: "https://github.com/OSpoon/aiex-cli#readme",
|
|
78
|
+
repository: {
|
|
79
|
+
"type": "git",
|
|
80
|
+
"url": "git+https://github.com/OSpoon/aiex-cli.git"
|
|
81
|
+
},
|
|
82
|
+
bugs: "https://github.com/OSpoon/aiex-cli/issues",
|
|
83
|
+
keywords: [
|
|
84
|
+
"json-schema",
|
|
85
|
+
"sqlite",
|
|
86
|
+
"drizzle",
|
|
87
|
+
"orm",
|
|
88
|
+
"ai-extraction",
|
|
89
|
+
"cli",
|
|
90
|
+
"database-migration",
|
|
91
|
+
"schema-editor",
|
|
92
|
+
"code-generation",
|
|
93
|
+
"structured-output"
|
|
94
|
+
],
|
|
95
|
+
sideEffects: false,
|
|
96
|
+
exports: {
|
|
97
|
+
".": "./dist/index.mjs",
|
|
98
|
+
"./cli": "./dist/cli.mjs",
|
|
99
|
+
"./core/schema-sqlite/migrate-helper": "./dist/core/schema-sqlite/migrate-helper.mjs",
|
|
100
|
+
"./package.json": "./package.json"
|
|
101
|
+
},
|
|
102
|
+
main: "./dist/index.mjs",
|
|
103
|
+
module: "./dist/index.mjs",
|
|
104
|
+
types: "./dist/index.d.mts",
|
|
105
|
+
bin: { "aiex": "./bin/cli.mjs" },
|
|
106
|
+
files: [
|
|
107
|
+
"bin",
|
|
108
|
+
"dist",
|
|
109
|
+
"src/core/schema-sqlite/migrate-helper.ts",
|
|
110
|
+
"src/core/schema-sqlite/migration-name.ts"
|
|
111
|
+
],
|
|
112
|
+
scripts: {
|
|
113
|
+
"build": "tsdown && pnpm --filter aiex-web build",
|
|
114
|
+
"dev": "tsdown --watch",
|
|
115
|
+
"start": "tsx src/index.ts",
|
|
116
|
+
"test": "vitest",
|
|
117
|
+
"coverage": "vitest --coverage",
|
|
118
|
+
"typecheck": "tsc",
|
|
119
|
+
"lint": "eslint .",
|
|
120
|
+
"prepack": "cp ../../README.md .",
|
|
121
|
+
"postpack": "rm -f README.md",
|
|
122
|
+
"prepublishOnly": "pnpm run build"
|
|
123
|
+
},
|
|
124
|
+
dependencies: {
|
|
125
|
+
"@ai-sdk/openai-compatible": "catalog:",
|
|
126
|
+
"@clack/prompts": "catalog:",
|
|
127
|
+
"@hono/node-server": "catalog:",
|
|
128
|
+
"@hono/zod-validator": "catalog:",
|
|
129
|
+
"@langfuse/otel": "catalog:",
|
|
130
|
+
"@notionhq/client": "catalog:",
|
|
131
|
+
"@opentelemetry/sdk-trace-node": "catalog:",
|
|
132
|
+
"ai": "catalog:",
|
|
133
|
+
"better-sqlite3": "catalog:",
|
|
134
|
+
"citty": "catalog:",
|
|
135
|
+
"cli-table3": "catalog:",
|
|
136
|
+
"conf": "catalog:",
|
|
137
|
+
"consola": "catalog:",
|
|
138
|
+
"date-fns": "catalog:",
|
|
139
|
+
"drizzle-kit": "catalog:cli",
|
|
140
|
+
"drizzle-orm": "catalog:",
|
|
141
|
+
"es-toolkit": "catalog:",
|
|
142
|
+
"esbuild": "catalog:",
|
|
143
|
+
"execa": "catalog:",
|
|
144
|
+
"hono": "catalog:",
|
|
145
|
+
"jsonfile": "catalog:",
|
|
146
|
+
"jsonrepair": "catalog:",
|
|
147
|
+
"kysely": "catalog:",
|
|
148
|
+
"mime": "catalog:",
|
|
149
|
+
"open": "catalog:",
|
|
150
|
+
"p-retry": "catalog:",
|
|
151
|
+
"picocolors": "catalog:",
|
|
152
|
+
"proper-lockfile": "catalog:",
|
|
153
|
+
"tinyglobby": "catalog:",
|
|
154
|
+
"tsx": "catalog:cli",
|
|
155
|
+
"unpdf": "catalog:",
|
|
156
|
+
"update-notifier": "catalog:",
|
|
157
|
+
"zod": "catalog:"
|
|
158
|
+
},
|
|
159
|
+
devDependencies: {
|
|
160
|
+
"@antfu/eslint-config": "catalog:cli",
|
|
161
|
+
"@antfu/ni": "catalog:cli",
|
|
162
|
+
"@types/better-sqlite3": "catalog:types",
|
|
163
|
+
"@types/jsonfile": "catalog:",
|
|
164
|
+
"@types/node": "catalog:types",
|
|
165
|
+
"@types/proper-lockfile": "catalog:",
|
|
166
|
+
"@types/update-notifier": "catalog:",
|
|
167
|
+
"@vitest/coverage-v8": "catalog:testing",
|
|
168
|
+
"eslint": "catalog:cli",
|
|
169
|
+
"publint": "catalog:cli",
|
|
170
|
+
"tsdown": "catalog:cli",
|
|
171
|
+
"tsnapi": "catalog:testing",
|
|
172
|
+
"typescript": "catalog:cli",
|
|
173
|
+
"vitest": "catalog:testing"
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/config.ts
|
|
179
|
+
function createConfig() {
|
|
180
|
+
return new Conf({
|
|
181
|
+
cwd: process.env.CLI_CONFIG_DIR,
|
|
182
|
+
projectName: process.env.CLI_CONFIG_PROJECT_NAME || name
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function seedConfig(config = createConfig()) {
|
|
186
|
+
if (!config.has("name")) config.set("name", name);
|
|
187
|
+
if (!config.has("version")) config.set("version", version);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/core/ai-extraction/schemas.ts
|
|
192
|
+
const ModelCapabilitiesSchema = z.object({
|
|
193
|
+
vision: z.boolean(),
|
|
194
|
+
structuredOutput: z.boolean(),
|
|
195
|
+
maxTokens: z.number().int().positive().optional(),
|
|
196
|
+
maxOutputTokens: z.number().int().positive().optional()
|
|
197
|
+
});
|
|
198
|
+
const AIModelConfigSchema = z.object({
|
|
199
|
+
name: z.string().min(1),
|
|
200
|
+
capabilities: ModelCapabilitiesSchema
|
|
201
|
+
});
|
|
202
|
+
const AIProviderConfigSchema = z.object({
|
|
203
|
+
baseURL: z.string().min(1),
|
|
204
|
+
apiKey: z.string(),
|
|
205
|
+
models: z.array(AIModelConfigSchema).min(1),
|
|
206
|
+
timeout: z.number().int().positive().default(300).optional()
|
|
207
|
+
});
|
|
208
|
+
const PromptConfigSchema = z.object({
|
|
209
|
+
systemTemplate: z.string().min(1),
|
|
210
|
+
userTemplate: z.string().min(1)
|
|
211
|
+
});
|
|
212
|
+
const ExtractionConfigSchema = z.object({ outputDir: z.string().min(1) });
|
|
213
|
+
const ExternalPdfConverterConfigSchema = z.object({
|
|
214
|
+
command: z.string().min(1),
|
|
215
|
+
args: z.array(z.string()),
|
|
216
|
+
outputFile: z.string().min(1).optional(),
|
|
217
|
+
timeout: z.number().int().positive().default(600).optional(),
|
|
218
|
+
fallbackToUnpdf: z.boolean().optional(),
|
|
219
|
+
keepOutput: z.boolean().optional()
|
|
220
|
+
});
|
|
221
|
+
const PdfConfigSchema = z.object({
|
|
222
|
+
converter: z.enum([
|
|
223
|
+
"unpdf",
|
|
224
|
+
"mineru",
|
|
225
|
+
"markitdown",
|
|
226
|
+
"external"
|
|
227
|
+
]),
|
|
228
|
+
mineru: ExternalPdfConverterConfigSchema.optional(),
|
|
229
|
+
markitdown: ExternalPdfConverterConfigSchema.optional(),
|
|
230
|
+
external: ExternalPdfConverterConfigSchema.optional()
|
|
231
|
+
});
|
|
232
|
+
const LangfuseConfigSchema = z.object({
|
|
233
|
+
publicKey: z.string(),
|
|
234
|
+
secretKey: z.string(),
|
|
235
|
+
host: z.string().optional()
|
|
236
|
+
});
|
|
237
|
+
const NotionSchemaConfigSchema = z.object({
|
|
238
|
+
databaseId: z.string(),
|
|
239
|
+
titleProperty: z.string().optional(),
|
|
240
|
+
fieldMap: z.record(z.string()).optional()
|
|
241
|
+
});
|
|
242
|
+
const NotionConfigSchema = z.object({
|
|
243
|
+
enabled: z.boolean(),
|
|
244
|
+
token: z.string(),
|
|
245
|
+
schemas: z.record(NotionSchemaConfigSchema).default({})
|
|
246
|
+
});
|
|
247
|
+
const AIConfigSchema = z.object({
|
|
248
|
+
provider: AIProviderConfigSchema,
|
|
249
|
+
prompt: PromptConfigSchema,
|
|
250
|
+
extraction: ExtractionConfigSchema,
|
|
251
|
+
pdf: PdfConfigSchema.optional(),
|
|
252
|
+
langfuse: LangfuseConfigSchema.optional(),
|
|
253
|
+
notion: NotionConfigSchema.optional()
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/core/ai-extraction/types.ts
|
|
258
|
+
const PLACEHOLDER_SCHEMA = "{schema}";
|
|
259
|
+
const PLACEHOLDER_TEXT = "{text}";
|
|
260
|
+
const DEFAULT_MODELS = [{
|
|
261
|
+
name: "qwen-plus",
|
|
262
|
+
capabilities: {
|
|
263
|
+
vision: false,
|
|
264
|
+
structuredOutput: true
|
|
265
|
+
}
|
|
266
|
+
}, {
|
|
267
|
+
name: "qwen-vl-plus",
|
|
268
|
+
capabilities: {
|
|
269
|
+
vision: true,
|
|
270
|
+
structuredOutput: true
|
|
271
|
+
}
|
|
272
|
+
}];
|
|
273
|
+
const DEFAULT_PROVIDER_CONFIG = {
|
|
274
|
+
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
275
|
+
apiKey: "",
|
|
276
|
+
models: [...DEFAULT_MODELS],
|
|
277
|
+
timeout: 300
|
|
278
|
+
};
|
|
279
|
+
const DEFAULT_PROMPT_CONFIG = {
|
|
280
|
+
systemTemplate: `You are a professional data extraction assistant. Your task is to extract structured data from text and return a JSON object based on the data structure definition provided below.
|
|
281
|
+
|
|
282
|
+
{schema}
|
|
283
|
+
|
|
284
|
+
Extraction requirements:
|
|
285
|
+
1. Extract strictly according to the field names and types defined in the structure
|
|
286
|
+
2. If the text lacks information for a field, set that field to null
|
|
287
|
+
3. Do not add fields that do not exist in the structure definition
|
|
288
|
+
4. Maintain data accuracy and completeness`,
|
|
289
|
+
userTemplate: `Please extract data from the following text:
|
|
290
|
+
{text}`
|
|
291
|
+
};
|
|
292
|
+
const DEFAULT_EXTRACTION_CONFIG = { outputDir: ".aiex/extracted" };
|
|
293
|
+
const DEFAULT_MINERU_CONFIG = {
|
|
294
|
+
command: "mineru",
|
|
295
|
+
args: [
|
|
296
|
+
"-p",
|
|
297
|
+
"{input}",
|
|
298
|
+
"-o",
|
|
299
|
+
"{outputDir}"
|
|
300
|
+
],
|
|
301
|
+
timeout: 600,
|
|
302
|
+
fallbackToUnpdf: true,
|
|
303
|
+
keepOutput: true
|
|
304
|
+
};
|
|
305
|
+
const DEFAULT_MARKITDOWN_CONFIG = {
|
|
306
|
+
command: "markitdown",
|
|
307
|
+
args: [
|
|
308
|
+
"{input}",
|
|
309
|
+
"-o",
|
|
310
|
+
"{outputDir}/{basename}.md"
|
|
311
|
+
],
|
|
312
|
+
outputFile: "{outputDir}/{basename}.md",
|
|
313
|
+
timeout: 600,
|
|
314
|
+
fallbackToUnpdf: true,
|
|
315
|
+
keepOutput: true
|
|
316
|
+
};
|
|
317
|
+
const DEFAULT_PDF_CONFIG = {
|
|
318
|
+
converter: "unpdf",
|
|
319
|
+
mineru: DEFAULT_MINERU_CONFIG,
|
|
320
|
+
markitdown: DEFAULT_MARKITDOWN_CONFIG
|
|
321
|
+
};
|
|
322
|
+
const DEFAULT_AI_CONFIG = {
|
|
323
|
+
provider: DEFAULT_PROVIDER_CONFIG,
|
|
324
|
+
prompt: DEFAULT_PROMPT_CONFIG,
|
|
325
|
+
extraction: DEFAULT_EXTRACTION_CONFIG,
|
|
326
|
+
pdf: DEFAULT_PDF_CONFIG
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/core/ai-extraction/config.ts
|
|
331
|
+
const CONFIG_FILE_NAME = "ai-config.json";
|
|
332
|
+
const GITIGNORE_FILE = ".gitignore";
|
|
333
|
+
async function readAIConfig(aiexDir) {
|
|
334
|
+
const configPath = path.join(aiexDir, CONFIG_FILE_NAME);
|
|
335
|
+
try {
|
|
336
|
+
const parsed = await readFile(configPath);
|
|
337
|
+
return AIConfigSchema.parse(parsed);
|
|
338
|
+
} catch {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
async function writeAIConfig(aiexDir, config) {
|
|
343
|
+
const configPath = path.join(aiexDir, CONFIG_FILE_NAME);
|
|
344
|
+
await fs.mkdir(aiexDir, { recursive: true });
|
|
345
|
+
await writeFile(configPath, config, {
|
|
346
|
+
spaces: 2,
|
|
347
|
+
EOL: "\n"
|
|
348
|
+
});
|
|
349
|
+
await addToGitignore(aiexDir, CONFIG_FILE_NAME);
|
|
350
|
+
}
|
|
351
|
+
function getDefaultAIConfig() {
|
|
352
|
+
return structuredClone(DEFAULT_AI_CONFIG);
|
|
353
|
+
}
|
|
354
|
+
async function addToGitignore(aiexDir, fileName) {
|
|
355
|
+
const projectRoot = path.dirname(aiexDir);
|
|
356
|
+
const gitignorePath = path.join(projectRoot, GITIGNORE_FILE);
|
|
357
|
+
try {
|
|
358
|
+
const content = await fs.readFile(gitignorePath, "utf-8");
|
|
359
|
+
if (content.split("\n").some((line) => line.trim() === fileName || line.includes(".aiex/"))) return;
|
|
360
|
+
const newContent = content.endsWith("\n") ? `${content}${fileName}\n` : `${content}\n${fileName}\n`;
|
|
361
|
+
await fs.writeFile(gitignorePath, newContent);
|
|
362
|
+
} catch {
|
|
363
|
+
await fs.writeFile(gitignorePath, `${fileName}\n`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
64
367
|
//#endregion
|
|
65
368
|
//#region src/core/schema-sqlite/generator.ts
|
|
66
369
|
function generateColumnDefinition(column) {
|
|
@@ -334,6 +637,7 @@ const ForeignKeyRefSchema = z.object({
|
|
|
334
637
|
column: z.string().min(1)
|
|
335
638
|
});
|
|
336
639
|
const JsonSchemaPropertySchema = z.lazy(() => z.object({
|
|
640
|
+
description: z.string().optional(),
|
|
337
641
|
type: z.enum([
|
|
338
642
|
"string",
|
|
339
643
|
"integer",
|
|
@@ -409,225 +713,7 @@ function generateDrizzleConfig() {
|
|
|
409
713
|
}
|
|
410
714
|
|
|
411
715
|
//#endregion
|
|
412
|
-
//#region
|
|
413
|
-
var name = "aiex-cli";
|
|
414
|
-
var version = "0.0.1-beta.9";
|
|
415
|
-
var description = "JSON Schema → SQLite with AI-powered data extraction";
|
|
416
|
-
var package_default = {
|
|
417
|
-
name,
|
|
418
|
-
type: "module",
|
|
419
|
-
version,
|
|
420
|
-
description,
|
|
421
|
-
author: "OSpoon <zxin088@gmail.com>",
|
|
422
|
-
license: "MIT",
|
|
423
|
-
homepage: "https://github.com/OSpoon/aiex-cli#readme",
|
|
424
|
-
repository: {
|
|
425
|
-
"type": "git",
|
|
426
|
-
"url": "git+https://github.com/OSpoon/aiex-cli.git"
|
|
427
|
-
},
|
|
428
|
-
bugs: "https://github.com/OSpoon/aiex-cli/issues",
|
|
429
|
-
keywords: [
|
|
430
|
-
"json-schema",
|
|
431
|
-
"sqlite",
|
|
432
|
-
"drizzle",
|
|
433
|
-
"orm",
|
|
434
|
-
"ai-extraction",
|
|
435
|
-
"cli",
|
|
436
|
-
"database-migration",
|
|
437
|
-
"schema-editor",
|
|
438
|
-
"code-generation",
|
|
439
|
-
"structured-output"
|
|
440
|
-
],
|
|
441
|
-
sideEffects: false,
|
|
442
|
-
exports: {
|
|
443
|
-
".": "./dist/index.mjs",
|
|
444
|
-
"./cli": "./dist/cli.mjs",
|
|
445
|
-
"./core/schema-sqlite/migrate-helper": "./dist/core/schema-sqlite/migrate-helper.mjs",
|
|
446
|
-
"./package.json": "./package.json"
|
|
447
|
-
},
|
|
448
|
-
main: "./dist/index.mjs",
|
|
449
|
-
module: "./dist/index.mjs",
|
|
450
|
-
types: "./dist/index.d.mts",
|
|
451
|
-
bin: { "aiex": "./bin/cli.mjs" },
|
|
452
|
-
files: [
|
|
453
|
-
"bin",
|
|
454
|
-
"dist",
|
|
455
|
-
"src/core/schema-sqlite/migrate-helper.ts",
|
|
456
|
-
"src/core/schema-sqlite/migration-name.ts"
|
|
457
|
-
],
|
|
458
|
-
scripts: {
|
|
459
|
-
"build": "tsdown && pnpm --filter aiex-web build",
|
|
460
|
-
"dev": "tsdown --watch",
|
|
461
|
-
"start": "tsx src/index.ts",
|
|
462
|
-
"test": "vitest",
|
|
463
|
-
"coverage": "vitest --coverage",
|
|
464
|
-
"typecheck": "tsc",
|
|
465
|
-
"lint": "eslint .",
|
|
466
|
-
"prepublishOnly": "cp ../../README.md . && pnpm run build",
|
|
467
|
-
"postpublish": "rm -f README.md"
|
|
468
|
-
},
|
|
469
|
-
dependencies: {
|
|
470
|
-
"@ai-sdk/openai-compatible": "catalog:",
|
|
471
|
-
"@clack/prompts": "catalog:",
|
|
472
|
-
"@hono/node-server": "catalog:",
|
|
473
|
-
"ai": "catalog:",
|
|
474
|
-
"better-sqlite3": "catalog:",
|
|
475
|
-
"citty": "catalog:",
|
|
476
|
-
"cli-table3": "catalog:",
|
|
477
|
-
"conf": "catalog:",
|
|
478
|
-
"consola": "catalog:",
|
|
479
|
-
"date-fns": "catalog:",
|
|
480
|
-
"drizzle-kit": "catalog:cli",
|
|
481
|
-
"drizzle-orm": "catalog:",
|
|
482
|
-
"es-toolkit": "catalog:",
|
|
483
|
-
"esbuild": "catalog:",
|
|
484
|
-
"hono": "catalog:",
|
|
485
|
-
"picocolors": "catalog:",
|
|
486
|
-
"tsx": "catalog:cli",
|
|
487
|
-
"update-notifier": "catalog:",
|
|
488
|
-
"zod": "catalog:"
|
|
489
|
-
},
|
|
490
|
-
devDependencies: {
|
|
491
|
-
"@antfu/eslint-config": "catalog:cli",
|
|
492
|
-
"@antfu/ni": "catalog:cli",
|
|
493
|
-
"@types/better-sqlite3": "catalog:types",
|
|
494
|
-
"@types/node": "catalog:types",
|
|
495
|
-
"@types/update-notifier": "catalog:",
|
|
496
|
-
"@vitest/coverage-v8": "catalog:testing",
|
|
497
|
-
"eslint": "catalog:cli",
|
|
498
|
-
"publint": "catalog:cli",
|
|
499
|
-
"tsdown": "catalog:cli",
|
|
500
|
-
"tsnapi": "catalog:testing",
|
|
501
|
-
"typescript": "catalog:cli",
|
|
502
|
-
"vitest": "catalog:testing"
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
//#endregion
|
|
507
|
-
//#region src/config.ts
|
|
508
|
-
function createConfig() {
|
|
509
|
-
return new Conf({
|
|
510
|
-
cwd: process.env.CLI_CONFIG_DIR,
|
|
511
|
-
projectName: process.env.CLI_CONFIG_PROJECT_NAME || name
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
function seedConfig(config = createConfig()) {
|
|
515
|
-
if (!config.has("name")) config.set("name", name);
|
|
516
|
-
if (!config.has("version")) config.set("version", version);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
//#endregion
|
|
520
|
-
//#region src/core/ai-extraction/schemas.ts
|
|
521
|
-
const ModelCapabilitiesSchema = z.object({
|
|
522
|
-
vision: z.boolean(),
|
|
523
|
-
structuredOutput: z.boolean(),
|
|
524
|
-
maxTokens: z.number().int().positive().optional(),
|
|
525
|
-
maxOutputTokens: z.number().int().positive().optional()
|
|
526
|
-
});
|
|
527
|
-
const AIModelConfigSchema = z.object({
|
|
528
|
-
name: z.string().min(1),
|
|
529
|
-
capabilities: ModelCapabilitiesSchema
|
|
530
|
-
});
|
|
531
|
-
const AIProviderConfigSchema = z.object({
|
|
532
|
-
baseURL: z.string().min(1),
|
|
533
|
-
apiKey: z.string(),
|
|
534
|
-
models: z.array(AIModelConfigSchema).min(1)
|
|
535
|
-
});
|
|
536
|
-
const PromptConfigSchema = z.object({
|
|
537
|
-
systemTemplate: z.string().min(1),
|
|
538
|
-
userTemplate: z.string().min(1)
|
|
539
|
-
});
|
|
540
|
-
const ExtractionConfigSchema = z.object({ outputDir: z.string().min(1) });
|
|
541
|
-
const AIConfigSchema = z.object({
|
|
542
|
-
provider: AIProviderConfigSchema,
|
|
543
|
-
prompt: PromptConfigSchema,
|
|
544
|
-
extraction: ExtractionConfigSchema
|
|
545
|
-
});
|
|
546
|
-
|
|
547
|
-
//#endregion
|
|
548
|
-
//#region src/core/ai-extraction/types.ts
|
|
549
|
-
const PLACEHOLDER_SCHEMA = "{schema}";
|
|
550
|
-
const PLACEHOLDER_TEXT = "{text}";
|
|
551
|
-
const DEFAULT_MODELS = [{
|
|
552
|
-
name: "qwen-plus",
|
|
553
|
-
capabilities: {
|
|
554
|
-
vision: false,
|
|
555
|
-
structuredOutput: true
|
|
556
|
-
}
|
|
557
|
-
}, {
|
|
558
|
-
name: "qwen-vl-plus",
|
|
559
|
-
capabilities: {
|
|
560
|
-
vision: true,
|
|
561
|
-
structuredOutput: true
|
|
562
|
-
}
|
|
563
|
-
}];
|
|
564
|
-
const DEFAULT_PROVIDER_CONFIG = {
|
|
565
|
-
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
566
|
-
apiKey: "",
|
|
567
|
-
models: [...DEFAULT_MODELS]
|
|
568
|
-
};
|
|
569
|
-
const DEFAULT_PROMPT_CONFIG = {
|
|
570
|
-
systemTemplate: `You are a professional data extraction assistant. Your task is to extract structured data from text and return a JSON object based on the data structure definition provided below.
|
|
571
|
-
|
|
572
|
-
{schema}
|
|
573
|
-
|
|
574
|
-
Extraction requirements:
|
|
575
|
-
1. Extract strictly according to the field names and types defined in the structure
|
|
576
|
-
2. If the text lacks information for a field, set that field to null
|
|
577
|
-
3. Do not add fields that do not exist in the structure definition
|
|
578
|
-
4. Maintain data accuracy and completeness`,
|
|
579
|
-
userTemplate: `Please extract data from the following text:
|
|
580
|
-
{text}`
|
|
581
|
-
};
|
|
582
|
-
const DEFAULT_EXTRACTION_CONFIG = { outputDir: ".aiex/extracted" };
|
|
583
|
-
const DEFAULT_AI_CONFIG = {
|
|
584
|
-
provider: DEFAULT_PROVIDER_CONFIG,
|
|
585
|
-
prompt: DEFAULT_PROMPT_CONFIG,
|
|
586
|
-
extraction: DEFAULT_EXTRACTION_CONFIG
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
//#endregion
|
|
590
|
-
//#region src/core/ai-extraction/config.ts
|
|
591
|
-
const CONFIG_FILE_NAME = "ai-config.json";
|
|
592
|
-
const GITIGNORE_FILE = ".gitignore";
|
|
593
|
-
async function readAIConfig(aiexDir) {
|
|
594
|
-
const configPath = path.join(aiexDir, CONFIG_FILE_NAME);
|
|
595
|
-
try {
|
|
596
|
-
const content = await fs.readFile(configPath, "utf-8");
|
|
597
|
-
const parsed = JSON.parse(content);
|
|
598
|
-
return AIConfigSchema.parse(parsed);
|
|
599
|
-
} catch {
|
|
600
|
-
return null;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
async function writeAIConfig(aiexDir, config) {
|
|
604
|
-
const configPath = path.join(aiexDir, CONFIG_FILE_NAME);
|
|
605
|
-
await fs.mkdir(aiexDir, { recursive: true });
|
|
606
|
-
await fs.writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`);
|
|
607
|
-
await addToGitignore(aiexDir, CONFIG_FILE_NAME);
|
|
608
|
-
}
|
|
609
|
-
function getDefaultAIConfig() {
|
|
610
|
-
return { ...DEFAULT_AI_CONFIG };
|
|
611
|
-
}
|
|
612
|
-
function maskApiKey(apiKey) {
|
|
613
|
-
if (apiKey.length <= 4) return "****";
|
|
614
|
-
return `sk-***${apiKey.slice(-4)}`;
|
|
615
|
-
}
|
|
616
|
-
async function addToGitignore(aiexDir, fileName) {
|
|
617
|
-
const projectRoot = path.dirname(aiexDir);
|
|
618
|
-
const gitignorePath = path.join(projectRoot, GITIGNORE_FILE);
|
|
619
|
-
try {
|
|
620
|
-
const content = await fs.readFile(gitignorePath, "utf-8");
|
|
621
|
-
if (content.split("\n").some((line) => line.trim() === fileName || line.includes(".aiex/"))) return;
|
|
622
|
-
const newContent = content.endsWith("\n") ? `${content}${fileName}\n` : `${content}\n${fileName}\n`;
|
|
623
|
-
await fs.writeFile(gitignorePath, newContent);
|
|
624
|
-
} catch {
|
|
625
|
-
await fs.writeFile(gitignorePath, `${fileName}\n`);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
//#endregion
|
|
630
|
-
//#region src/doctor.ts
|
|
716
|
+
//#region src/core/doctor-collector.ts
|
|
631
717
|
const V1_SUFFIX_RE = /\/v1\/?$/;
|
|
632
718
|
async function checkConnection(baseURL) {
|
|
633
719
|
try {
|
|
@@ -713,4 +799,4 @@ async function collectDoctorDiagnostics(options = {}) {
|
|
|
713
799
|
}
|
|
714
800
|
|
|
715
801
|
//#endregion
|
|
716
|
-
export {
|
|
802
|
+
export { buildDoctorDiagnostics as C, version as S, formatDoctorDiagnosticsJson as T, createConfig as _, parseJsonSchema as a, name as b, getDefaultAIConfig as c, DEFAULT_MARKITDOWN_CONFIG as d, DEFAULT_MINERU_CONFIG as f, AIConfigSchema as g, PLACEHOLDER_TEXT as h, JsonSchemaDefinitionSchema as i, readAIConfig as l, PLACEHOLDER_SCHEMA as m, createMigrationConfig as n, toSnakeCase as o, DEFAULT_PROMPT_CONFIG as p, generateDrizzleConfig as r, generateDrizzleSchema as s, collectDoctorDiagnostics as t, writeAIConfig as u, seedConfig as v, doctorDiagnosticsTableRows as w, package_default as x, description as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZodError, z } from "zod";
|
|
2
1
|
import Conf from "conf";
|
|
2
|
+
import { ZodError, z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/core/doctor.d.ts
|
|
5
5
|
interface DoctorDiagnostics {
|
|
@@ -60,6 +60,19 @@ declare function buildDoctorDiagnostics(input: {
|
|
|
60
60
|
declare function formatDoctorDiagnosticsJson(d: DoctorDiagnostics): string;
|
|
61
61
|
declare function doctorDiagnosticsTableRows(d: DoctorDiagnostics): [string, string][];
|
|
62
62
|
//#endregion
|
|
63
|
+
//#region src/config.d.ts
|
|
64
|
+
interface AppConfig {
|
|
65
|
+
name?: string;
|
|
66
|
+
version?: string;
|
|
67
|
+
}
|
|
68
|
+
declare function createConfig(): Conf<AppConfig>;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/core/doctor-collector.d.ts
|
|
71
|
+
interface CollectDoctorDiagnosticsOptions {
|
|
72
|
+
config?: ReturnType<typeof createConfig>;
|
|
73
|
+
}
|
|
74
|
+
declare function collectDoctorDiagnostics(options?: CollectDoctorDiagnosticsOptions): Promise<DoctorDiagnostics>;
|
|
75
|
+
//#endregion
|
|
63
76
|
//#region src/core/schema-sqlite/types.d.ts
|
|
64
77
|
interface ParsedColumn {
|
|
65
78
|
name: string;
|
|
@@ -114,7 +127,6 @@ declare function createMigrationConfig(cwd: string): MigrationConfig;
|
|
|
114
127
|
declare function generateDrizzleConfig(): string;
|
|
115
128
|
//#endregion
|
|
116
129
|
//#region src/core/schema-sqlite/schemas.d.ts
|
|
117
|
-
|
|
118
130
|
declare const JsonSchemaDefinitionSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
119
131
|
$schema: z.ZodOptional<z.ZodString>;
|
|
120
132
|
title: z.ZodString;
|
|
@@ -237,6 +249,7 @@ interface ForeignKeyRef {
|
|
|
237
249
|
column: string;
|
|
238
250
|
}
|
|
239
251
|
interface JsonSchemaProperty {
|
|
252
|
+
description?: string;
|
|
240
253
|
type: 'string' | 'integer' | 'number' | 'boolean' | 'object' | 'array' | 'null';
|
|
241
254
|
format?: string;
|
|
242
255
|
primary?: boolean;
|
|
@@ -265,17 +278,4 @@ type JsonSchemaDefinition = z.infer<typeof JsonSchemaDefinitionSchema>;
|
|
|
265
278
|
//#region src/core/schema-sqlite/parser.d.ts
|
|
266
279
|
declare function parseJsonSchema(schema: JsonSchemaDefinition): ParseResult;
|
|
267
280
|
//#endregion
|
|
268
|
-
//#region src/config.d.ts
|
|
269
|
-
interface AppConfig {
|
|
270
|
-
name?: string;
|
|
271
|
-
version?: string;
|
|
272
|
-
}
|
|
273
|
-
declare function createConfig(): Conf<AppConfig>;
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region src/doctor.d.ts
|
|
276
|
-
interface CollectDoctorDiagnosticsOptions {
|
|
277
|
-
config?: ReturnType<typeof createConfig>;
|
|
278
|
-
}
|
|
279
|
-
declare function collectDoctorDiagnostics(options?: CollectDoctorDiagnosticsOptions): Promise<DoctorDiagnostics>;
|
|
280
|
-
//#endregion
|
|
281
281
|
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as buildDoctorDiagnostics, T as formatDoctorDiagnosticsJson, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics, w as doctorDiagnosticsTableRows } from "./doctor-collector-Cbqgwx__.mjs";
|
|
2
2
|
|
|
3
3
|
export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
|
package/dist/table-schema.json
CHANGED
|
@@ -81,6 +81,10 @@
|
|
|
81
81
|
"required": ["type"],
|
|
82
82
|
"additionalProperties": false,
|
|
83
83
|
"properties": {
|
|
84
|
+
"description": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"description": "Description of the column."
|
|
87
|
+
},
|
|
84
88
|
"type": {
|
|
85
89
|
"$ref": "#/$defs/columnType",
|
|
86
90
|
"description": "Column data type."
|