litedbmodel-gen 0.7.2 → 0.7.3
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 +3 -4
- package/cli-contract.yaml +4 -4
- package/dist/cli.js +6 -8
- package/dist/cli.js.map +1 -1
- package/dist/litedbmodel-gen.bundle.mjs +7 -9
- package/dist/litedbmodel-gen.bundle.mjs.map +2 -2
- package/docs/cli-reference.md +2 -2
- package/package.json +1 -1
|
@@ -931,7 +931,7 @@ command_sets:
|
|
|
931
931
|
description: LLM adapter to use for the audit.
|
|
932
932
|
schema:
|
|
933
933
|
type: string
|
|
934
|
-
enum: [mock,
|
|
934
|
+
enum: [mock, claude, openai, gemini]
|
|
935
935
|
default: mock
|
|
936
936
|
|
|
937
937
|
- name: model
|
|
@@ -1036,7 +1036,7 @@ command_sets:
|
|
|
1036
1036
|
onConflict/onConflictUpdate for idempotent writes, forUpdate for
|
|
1037
1037
|
concurrent-safe reads, and DBModel.transaction for multi-step
|
|
1038
1038
|
operations. Avoids all eight common litedbmodel anti-patterns.
|
|
1039
|
-
Requires an agentic adapter (claude
|
|
1039
|
+
Requires an agentic adapter (claude) that can read and
|
|
1040
1040
|
write project files.
|
|
1041
1041
|
usage:
|
|
1042
1042
|
- >-
|
|
@@ -1083,7 +1083,7 @@ command_sets:
|
|
|
1083
1083
|
description: LLM adapter to use for code generation.
|
|
1084
1084
|
schema:
|
|
1085
1085
|
type: string
|
|
1086
|
-
enum: [mock,
|
|
1086
|
+
enum: [mock, claude, openai, gemini]
|
|
1087
1087
|
default: mock
|
|
1088
1088
|
|
|
1089
1089
|
- name: model
|
|
@@ -1138,7 +1138,7 @@ command_sets:
|
|
|
1138
1138
|
sideEffectNote: >-
|
|
1139
1139
|
The agent reads project files and writes implementation code
|
|
1140
1140
|
directly to the target source file(s). Uses an agentic adapter
|
|
1141
|
-
(claude
|
|
1141
|
+
(claude) with file read/write tools.
|
|
1142
1142
|
safeDryRunOption: show-prompt
|
|
1143
1143
|
expectedDurationMs: 120000
|
|
1144
1144
|
retryableExitCodes: [1, 12]
|
|
@@ -1506,7 +1506,6 @@ components:
|
|
|
1506
1506
|
"type": "string",
|
|
1507
1507
|
"enum": [
|
|
1508
1508
|
"mock",
|
|
1509
|
-
"cursor",
|
|
1510
1509
|
"claude",
|
|
1511
1510
|
"openai",
|
|
1512
1511
|
"gemini"
|
|
@@ -1645,7 +1644,7 @@ components:
|
|
|
1645
1644
|
},
|
|
1646
1645
|
"implement": {
|
|
1647
1646
|
"summary": "Implement a feature using litedbmodel best practices.",
|
|
1648
|
-
"description": "Reads the project's model definitions, then implements the described feature directly in the target source file(s), applying litedbmodel best-practice patterns: createMany for batch inserts, upsert with onConflict/onConflictUpdate for idempotent writes, forUpdate for concurrent-safe reads, and DBModel.transaction for multi-step operations. Avoids all eight common litedbmodel anti-patterns. Requires an agentic adapter (claude
|
|
1647
|
+
"description": "Reads the project's model definitions, then implements the described feature directly in the target source file(s), applying litedbmodel best-practice patterns: createMany for batch inserts, upsert with onConflict/onConflictUpdate for idempotent writes, forUpdate for concurrent-safe reads, and DBModel.transaction for multi-step operations. Avoids all eight common litedbmodel anti-patterns. Requires an agentic adapter (claude) that can read and write project files.",
|
|
1649
1648
|
"usage": [
|
|
1650
1649
|
"litedbmodel-gen implement \\"Add syncNutrientSummary in src/services/meal.service.ts\\" --target src/services/meal.service.ts --models \\"src/models/**/*.ts\\" --adapter claude",
|
|
1651
1650
|
"litedbmodel-gen implement \\"Add bulk upsert for order items\\" --target src/services/order.service.ts --adapter claude"
|
|
@@ -1687,7 +1686,6 @@ components:
|
|
|
1687
1686
|
"type": "string",
|
|
1688
1687
|
"enum": [
|
|
1689
1688
|
"mock",
|
|
1690
|
-
"cursor",
|
|
1691
1689
|
"claude",
|
|
1692
1690
|
"openai",
|
|
1693
1691
|
"gemini"
|
|
@@ -1772,7 +1770,7 @@ components:
|
|
|
1772
1770
|
"network",
|
|
1773
1771
|
"filesystem_write"
|
|
1774
1772
|
],
|
|
1775
|
-
"sideEffectNote": "The agent reads project files and writes implementation code directly to the target source file(s). Uses an agentic adapter (claude
|
|
1773
|
+
"sideEffectNote": "The agent reads project files and writes implementation code directly to the target source file(s). Uses an agentic adapter (claude) with file read/write tools.",
|
|
1776
1774
|
"safeDryRunOption": "show-prompt",
|
|
1777
1775
|
"expectedDurationMs": 120000,
|
|
1778
1776
|
"retryableExitCodes": [
|
|
@@ -2206,7 +2204,7 @@ Generated at ${i.generatedAt??"\u2014"} by ${i.tool??"litedbmodel-gen"} (adapter
|
|
|
2206
2204
|
`),process.exit(1)}let l=t.reportFormat??"json",u;if(l==="text"?u=ov(s):l==="yaml"?u=uv(s):u=sv(s),t.output){let c=M9e(t.output);L9e(c,u+`
|
|
2207
2205
|
`,"utf-8"),process.stderr.write(`Report written to: ${c}
|
|
2208
2206
|
`)}else process.stdout.write(u+`
|
|
2209
|
-
`);process.exit(av(s,o))}Pm();var Jxe=Ge.object({userRequest:Ge.string()}),Hxe=Ge.object({userRequest:Ge.string()}),Yxe=Ge.object({summary:Ge.string(),riskLevel:Ge.enum(["low","medium","high","critical"]),findings:Ge.array(Ge.object({id:Ge.string().optional(),severity:Ge.enum(["info","warning","error","critical"]),category:Ge.string(),target:Ge.string().optional(),location:Ge.string().optional(),message:Ge.string(),recommendation:Ge.string().optional(),confidence:Ge.number().min(0).max(1).optional(),evidence:Ge.array(Ge.object({type:Ge.string(),content:Ge.string(),source:Ge.string().optional()})).optional(),details:Ge.record(Ge.string(),Ge.unknown()).optional()})),recommendedActions:Ge.array(Ge.object({kind:Ge.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:Ge.string(),command:Ge.string().optional(),target:Ge.string().optional(),rationale:Ge.string().optional()})).optional(),metadata:Ge.object({tool:Ge.string().optional(),command:Ge.string().optional(),version:Ge.string().optional(),generatedAt:Ge.string().optional(),adapter:Ge.string().optional(),model:Ge.string().optional()}).optional()}),Qxe=Ge.object({summary:Ge.string(),riskLevel:Ge.enum(["low","medium","high","critical"]),findings:Ge.array(Ge.object({id:Ge.string().optional(),severity:Ge.enum(["info","warning","error","critical"]),category:Ge.string(),target:Ge.string().optional(),location:Ge.string().optional(),message:Ge.string(),recommendation:Ge.string().optional(),confidence:Ge.number().min(0).max(1).optional(),evidence:Ge.array(Ge.object({type:Ge.string(),content:Ge.string(),source:Ge.string().optional()})).optional(),details:Ge.record(Ge.string(),Ge.unknown()).optional()})),recommendedActions:Ge.array(Ge.object({kind:Ge.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:Ge.string(),command:Ge.string().optional(),target:Ge.string().optional(),rationale:Ge.string().optional()})).optional(),changedFiles:Ge.array(Ge.object({path:Ge.string(),action:Ge.enum(["created","updated"]),rationale:Ge.string().optional()})),dependencies:Ge.array(Ge.string()).optional(),notes:Ge.string().optional(),metadata:Ge.object({tool:Ge.string().optional(),command:Ge.string().optional(),version:Ge.string().optional(),generatedAt:Ge.string().optional(),adapter:Ge.string().optional(),model:Ge.string().optional()}).optional()});var V9e={version:"0.7.
|
|
2207
|
+
`);process.exit(av(s,o))}Pm();var Jxe=Ge.object({userRequest:Ge.string()}),Hxe=Ge.object({userRequest:Ge.string()}),Yxe=Ge.object({summary:Ge.string(),riskLevel:Ge.enum(["low","medium","high","critical"]),findings:Ge.array(Ge.object({id:Ge.string().optional(),severity:Ge.enum(["info","warning","error","critical"]),category:Ge.string(),target:Ge.string().optional(),location:Ge.string().optional(),message:Ge.string(),recommendation:Ge.string().optional(),confidence:Ge.number().min(0).max(1).optional(),evidence:Ge.array(Ge.object({type:Ge.string(),content:Ge.string(),source:Ge.string().optional()})).optional(),details:Ge.record(Ge.string(),Ge.unknown()).optional()})),recommendedActions:Ge.array(Ge.object({kind:Ge.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:Ge.string(),command:Ge.string().optional(),target:Ge.string().optional(),rationale:Ge.string().optional()})).optional(),metadata:Ge.object({tool:Ge.string().optional(),command:Ge.string().optional(),version:Ge.string().optional(),generatedAt:Ge.string().optional(),adapter:Ge.string().optional(),model:Ge.string().optional()}).optional()}),Qxe=Ge.object({summary:Ge.string(),riskLevel:Ge.enum(["low","medium","high","critical"]),findings:Ge.array(Ge.object({id:Ge.string().optional(),severity:Ge.enum(["info","warning","error","critical"]),category:Ge.string(),target:Ge.string().optional(),location:Ge.string().optional(),message:Ge.string(),recommendation:Ge.string().optional(),confidence:Ge.number().min(0).max(1).optional(),evidence:Ge.array(Ge.object({type:Ge.string(),content:Ge.string(),source:Ge.string().optional()})).optional(),details:Ge.record(Ge.string(),Ge.unknown()).optional()})),recommendedActions:Ge.array(Ge.object({kind:Ge.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:Ge.string(),command:Ge.string().optional(),target:Ge.string().optional(),rationale:Ge.string().optional()})).optional(),changedFiles:Ge.array(Ge.object({path:Ge.string(),action:Ge.enum(["created","updated"]),rationale:Ge.string().optional()})),dependencies:Ge.array(Ge.string()).optional(),notes:Ge.string().optional(),metadata:Ge.object({tool:Ge.string().optional(),command:Ge.string().optional(),version:Ge.string().optional(),generatedAt:Ge.string().optional(),adapter:Ge.string().optional(),model:Ge.string().optional()}).optional()});var V9e={version:"0.7.3"},Z9e=q9e(import.meta.url),hG=gG(Z9e);function G9e(e){let t=gG(e),n=lv(e,"utf-8"),i=dc.load(n)??{},r=ql(t,i.renderers_dir??".embedoc/renderers"),a=ql(t,i.datasources_dir??".embedoc/datasources"),o=ql(t,i.templates_dir??".embedoc/templates");return{renderersDir:r,datasourcesDir:a,templatesDir:o}}var K9e={audit:async(e,t)=>{await fG(e,{adapter:t.adapter,model:t.model,showPrompt:t.showPrompt,failOn:t.failOn,output:t.output,reportFormat:t.reportFormat})},implement:async(e,t)=>{await mG(e,{target:t.target,models:t.models,adapter:t.adapter,model:t.model,showPrompt:t.showPrompt,failOn:t.failOn,output:t.output,reportFormat:t.reportFormat})},agents:async e=>{let t=await Promise.resolve().then(()=>_4(Z9(),1)),n=e.format??"yaml";try{console.log(n==="json"?JSON.stringify(xu,null,2):t.stringify(xu,{lineWidth:120}))}catch(i){console.error(`Failed to output DSL: ${i.message}`),process.exit(1)}},init:async e=>{let t=e??"embedoc.config.yaml",n=ql(t);Jp(n)||(process.stderr.write(JSON.stringify({error:"config_not_found",message:`${t} not found. Run "npx embedoc init" first.`},null,2)+`
|
|
2210
2208
|
`),process.exit(3));let i=G9e(n);console.log(`Setting up litedbmodel-gen...
|
|
2211
2209
|
`),W9e(i.templatesDir),H9e(i.renderersDir),Y9e(i.datasourcesDir),Q9e(n),console.log(`
|
|
2212
2210
|
Done! Next steps:`),console.log(" 1. Edit embedoc.config.yaml \u2014 set path/database in the schema datasource"),console.log(" 2. npx embedoc generate --datasource schema (create model files)"),console.log(" 3. npx embedoc build (fill in column definitions)")}};function W9e(e){z9e(e,{recursive:!0});let t=dE(e,"model.hbs");if(Jp(t)){console.log(` skip ${t} (already exists)`);return}let n=J9e();U9e(n,t),console.log(` create ${t}`)}function J9e(){let e=[ql(hG,"..","templates","model.hbs"),ql(hG,"templates","model.hbs")];for(let t of e)if(Jp(t))return t;throw new Error("Could not find model.hbs template in package")}function H9e(e){let t=dE(e,"index.ts");if(!Jp(t)){console.error(` warn ${t} not found, skipping renderers setup`);return}let n=lv(t,"utf-8");if(n.includes("litedbmodel-gen")){console.log(` skip ${t} (already configured)`);return}let i="import { litedbmodelColumns } from 'litedbmodel-gen';",r=` litedbmodel_columns: {
|