aiex-cli 0.0.1-beta.13 → 0.0.1-beta.14
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 doctorDiagnosticsTableRows,
|
|
1
|
+
import { C as formatDoctorDiagnosticsJson, S as doctorDiagnosticsTableRows, _ as JsonSchemaDefinitionSchema, a as DEFAULT_PROMPT_CONFIG, b as generateDrizzleSchema, c as AIConfigSchema, d as description, f as name, h as createMigrationConfig, i as writeAIConfig, l as createConfig, m as version, n as getDefaultAIConfig, o as PLACEHOLDER_SCHEMA, p as package_default, r as readAIConfig, s as PLACEHOLDER_TEXT, t as collectDoctorDiagnostics, u as seedConfig, v as parseJsonSchema, y as toSnakeCase } from "./doctor-c1eu5kMM.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
@@ -13772,105 +13772,10 @@ const schemaCommand = defineCommand({
|
|
|
13772
13772
|
"totalScore"
|
|
13773
13773
|
]
|
|
13774
13774
|
};
|
|
13775
|
-
const
|
|
13776
|
-
$schema: $id,
|
|
13777
|
-
title: "Post",
|
|
13778
|
-
type: "object",
|
|
13779
|
-
table: {
|
|
13780
|
-
name: "posts",
|
|
13781
|
-
timestamps: true,
|
|
13782
|
-
softDelete: true
|
|
13783
|
-
},
|
|
13784
|
-
properties: {
|
|
13785
|
-
id: {
|
|
13786
|
-
type: "integer",
|
|
13787
|
-
primary: true,
|
|
13788
|
-
autoIncrement: true
|
|
13789
|
-
},
|
|
13790
|
-
title: {
|
|
13791
|
-
type: "string",
|
|
13792
|
-
minLength: 5,
|
|
13793
|
-
maxLength: 200
|
|
13794
|
-
},
|
|
13795
|
-
slug: {
|
|
13796
|
-
type: "string",
|
|
13797
|
-
maxLength: 250,
|
|
13798
|
-
unique: true
|
|
13799
|
-
},
|
|
13800
|
-
content: { type: "string" },
|
|
13801
|
-
excerpt: {
|
|
13802
|
-
type: "string",
|
|
13803
|
-
maxLength: 300
|
|
13804
|
-
},
|
|
13805
|
-
authorId: { type: "integer" },
|
|
13806
|
-
status: {
|
|
13807
|
-
type: "string",
|
|
13808
|
-
default: "draft"
|
|
13809
|
-
},
|
|
13810
|
-
viewCount: {
|
|
13811
|
-
type: "integer",
|
|
13812
|
-
default: 0,
|
|
13813
|
-
minimum: 0
|
|
13814
|
-
},
|
|
13815
|
-
likeCount: {
|
|
13816
|
-
type: "integer",
|
|
13817
|
-
default: 0,
|
|
13818
|
-
minimum: 0
|
|
13819
|
-
},
|
|
13820
|
-
publishedAt: {
|
|
13821
|
-
type: "string",
|
|
13822
|
-
format: "date-time"
|
|
13823
|
-
},
|
|
13824
|
-
tags: {
|
|
13825
|
-
type: "array",
|
|
13826
|
-
items: { type: "string" }
|
|
13827
|
-
},
|
|
13828
|
-
metadata: {
|
|
13829
|
-
type: "object",
|
|
13830
|
-
drizzle: { mode: "json" },
|
|
13831
|
-
properties: {
|
|
13832
|
-
featuredImage: { type: "string" },
|
|
13833
|
-
readingTime: { type: "integer" },
|
|
13834
|
-
seoTitle: { type: "string" },
|
|
13835
|
-
seoDescription: { type: "string" }
|
|
13836
|
-
}
|
|
13837
|
-
},
|
|
13838
|
-
comments: {
|
|
13839
|
-
type: "array",
|
|
13840
|
-
items: {
|
|
13841
|
-
type: "object",
|
|
13842
|
-
nested: {
|
|
13843
|
-
enabled: true,
|
|
13844
|
-
relation: "has-many"
|
|
13845
|
-
},
|
|
13846
|
-
properties: {
|
|
13847
|
-
content: {
|
|
13848
|
-
type: "string",
|
|
13849
|
-
minLength: 1,
|
|
13850
|
-
maxLength: 1e3
|
|
13851
|
-
},
|
|
13852
|
-
authorId: { type: "integer" },
|
|
13853
|
-
status: {
|
|
13854
|
-
type: "string",
|
|
13855
|
-
default: "pending"
|
|
13856
|
-
},
|
|
13857
|
-
parentId: { type: "integer" }
|
|
13858
|
-
}
|
|
13859
|
-
}
|
|
13860
|
-
}
|
|
13861
|
-
},
|
|
13862
|
-
required: [
|
|
13863
|
-
"title",
|
|
13864
|
-
"slug",
|
|
13865
|
-
"authorId"
|
|
13866
|
-
]
|
|
13867
|
-
};
|
|
13868
|
-
const examStatus = await writeJsonIfAbsent(path.join(config.schemaPath, "exam_score_report.json"), examReportSchema);
|
|
13869
|
-
const postStatus = await writeJsonIfAbsent(path.join(config.schemaPath, "post.json"), postSchema);
|
|
13775
|
+
const examStatus = await writeJsonIfAbsent(path.join(config.schemaPath, "exam_score_reports.json"), examReportSchema);
|
|
13870
13776
|
consola.success(`Initialized ${pc.cyan(".aiex/")} with example schemas`);
|
|
13871
|
-
if (examStatus === "skipped") consola.warn(`${pc.cyan(".aiex/schema/
|
|
13872
|
-
|
|
13873
|
-
consola.info("Example includes: ExamScoreReport (exam results), Post (blog with comments)");
|
|
13777
|
+
if (examStatus === "skipped") consola.warn(`${pc.cyan(".aiex/schema/exam_score_reports.json")} already exists, skipped`);
|
|
13778
|
+
consola.info("Example includes: ExamScoreReport (college entrance exam score report)");
|
|
13874
13779
|
outro("Run: aiex schema");
|
|
13875
13780
|
return;
|
|
13876
13781
|
}
|
|
@@ -13912,13 +13817,6 @@ const schemaCommand = defineCommand({
|
|
|
13912
13817
|
|
|
13913
13818
|
//#endregion
|
|
13914
13819
|
//#region src/server/routes/ai.ts
|
|
13915
|
-
function maskSecretKey(key) {
|
|
13916
|
-
if (!key || key.length <= 4) return "****";
|
|
13917
|
-
return `sk-***${key.slice(-4)}`;
|
|
13918
|
-
}
|
|
13919
|
-
function isMasked(key) {
|
|
13920
|
-
return key.startsWith("sk-***");
|
|
13921
|
-
}
|
|
13922
13820
|
function aiRoutes(config) {
|
|
13923
13821
|
const app = new Hono();
|
|
13924
13822
|
const aiexDir = path.dirname(config.schemaPath);
|
|
@@ -13934,17 +13832,7 @@ function aiRoutes(config) {
|
|
|
13934
13832
|
}
|
|
13935
13833
|
});
|
|
13936
13834
|
}
|
|
13937
|
-
return c.json(
|
|
13938
|
-
...aiConfig,
|
|
13939
|
-
provider: {
|
|
13940
|
-
...aiConfig.provider,
|
|
13941
|
-
apiKey: maskApiKey(aiConfig.provider.apiKey)
|
|
13942
|
-
},
|
|
13943
|
-
langfuse: aiConfig.langfuse ? {
|
|
13944
|
-
...aiConfig.langfuse,
|
|
13945
|
-
secretKey: maskSecretKey(aiConfig.langfuse.secretKey)
|
|
13946
|
-
} : void 0
|
|
13947
|
-
});
|
|
13835
|
+
return c.json(aiConfig);
|
|
13948
13836
|
});
|
|
13949
13837
|
app.post("/ai/registry-lookup", async (c) => {
|
|
13950
13838
|
try {
|
|
@@ -13972,16 +13860,6 @@ function aiRoutes(config) {
|
|
|
13972
13860
|
success: false,
|
|
13973
13861
|
error: "At least one model must be configured"
|
|
13974
13862
|
}, 400);
|
|
13975
|
-
if (body.provider?.apiKey?.startsWith("sk-***")) {
|
|
13976
|
-
const existing = await readAIConfig(aiexDir);
|
|
13977
|
-
if (existing) body.provider.apiKey = existing.provider.apiKey;
|
|
13978
|
-
else body.provider.apiKey = "";
|
|
13979
|
-
}
|
|
13980
|
-
if (body.langfuse?.secretKey && isMasked(body.langfuse.secretKey)) {
|
|
13981
|
-
const existing = await readAIConfig(aiexDir);
|
|
13982
|
-
if (existing?.langfuse) body.langfuse.secretKey = existing.langfuse.secretKey;
|
|
13983
|
-
else body.langfuse.secretKey = "";
|
|
13984
|
-
}
|
|
13985
13863
|
await writeAIConfig(aiexDir, AIConfigSchema.parse(body));
|
|
13986
13864
|
return c.json({ success: true });
|
|
13987
13865
|
} catch (error) {
|
|
@@ -411,7 +411,7 @@ function generateDrizzleConfig() {
|
|
|
411
411
|
//#endregion
|
|
412
412
|
//#region package.json
|
|
413
413
|
var name = "aiex-cli";
|
|
414
|
-
var version = "0.0.1-beta.
|
|
414
|
+
var version = "0.0.1-beta.14";
|
|
415
415
|
var description = "JSON Schema → SQLite with AI-powered data extraction";
|
|
416
416
|
var package_default = {
|
|
417
417
|
name,
|
|
@@ -618,10 +618,6 @@ async function writeAIConfig(aiexDir, config) {
|
|
|
618
618
|
function getDefaultAIConfig() {
|
|
619
619
|
return { ...DEFAULT_AI_CONFIG };
|
|
620
620
|
}
|
|
621
|
-
function maskApiKey(apiKey) {
|
|
622
|
-
if (apiKey.length <= 4) return "****";
|
|
623
|
-
return `sk-***${apiKey.slice(-4)}`;
|
|
624
|
-
}
|
|
625
621
|
async function addToGitignore(aiexDir, fileName) {
|
|
626
622
|
const projectRoot = path.dirname(aiexDir);
|
|
627
623
|
const gitignorePath = path.join(projectRoot, GITIGNORE_FILE);
|
|
@@ -722,4 +718,4 @@ async function collectDoctorDiagnostics(options = {}) {
|
|
|
722
718
|
}
|
|
723
719
|
|
|
724
720
|
//#endregion
|
|
725
|
-
export {
|
|
721
|
+
export { formatDoctorDiagnosticsJson as C, doctorDiagnosticsTableRows as S, JsonSchemaDefinitionSchema as _, DEFAULT_PROMPT_CONFIG as a, generateDrizzleSchema as b, AIConfigSchema as c, description as d, name as f, generateDrizzleConfig as g, createMigrationConfig as h, writeAIConfig as i, createConfig as l, version as m, getDefaultAIConfig as n, PLACEHOLDER_SCHEMA as o, package_default as p, readAIConfig as r, PLACEHOLDER_TEXT as s, collectDoctorDiagnostics as t, seedConfig as u, parseJsonSchema as v, buildDoctorDiagnostics as x, toSnakeCase as y };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as formatDoctorDiagnosticsJson, S as doctorDiagnosticsTableRows, _ as JsonSchemaDefinitionSchema, b as generateDrizzleSchema, g as generateDrizzleConfig, h as createMigrationConfig, t as collectDoctorDiagnostics, v as parseJsonSchema, x as buildDoctorDiagnostics } from "./doctor-c1eu5kMM.mjs";
|
|
2
2
|
|
|
3
3
|
export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
|
package/package.json
CHANGED