@constela/runtime 0.19.4 → 0.19.5
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/index.js +0 -45
- package/package.json +4 -12
package/dist/index.js
CHANGED
|
@@ -1337,9 +1337,6 @@ async function executeStep(step, ctx) {
|
|
|
1337
1337
|
case "focus":
|
|
1338
1338
|
await executeFocusStep(step, ctx);
|
|
1339
1339
|
break;
|
|
1340
|
-
case "generate":
|
|
1341
|
-
await executeGenerateStep(step, ctx);
|
|
1342
|
-
break;
|
|
1343
1340
|
}
|
|
1344
1341
|
}
|
|
1345
1342
|
async function executeSetStep(target, value, ctx) {
|
|
@@ -1837,48 +1834,6 @@ async function executeFocusStep(step, ctx) {
|
|
|
1837
1834
|
}
|
|
1838
1835
|
}
|
|
1839
1836
|
}
|
|
1840
|
-
async function executeGenerateStep(step, ctx) {
|
|
1841
|
-
const { createDslGenerator } = await import("@constela/ai");
|
|
1842
|
-
const evalCtx = createEvalContext(ctx);
|
|
1843
|
-
const promptValue = evaluate(step.prompt, evalCtx);
|
|
1844
|
-
try {
|
|
1845
|
-
const generator = createDslGenerator({
|
|
1846
|
-
provider: step.provider
|
|
1847
|
-
});
|
|
1848
|
-
const result = await generator.generate({
|
|
1849
|
-
prompt: promptValue,
|
|
1850
|
-
output: step.output
|
|
1851
|
-
});
|
|
1852
|
-
ctx.locals[step.result] = result.dsl;
|
|
1853
|
-
if (!result.validated && result.errors && result.errors.length > 0) {
|
|
1854
|
-
ctx.locals["error"] = {
|
|
1855
|
-
message: `AI generated DSL validation failed: ${result.errors.join(", ")}`,
|
|
1856
|
-
name: "ValidationError"
|
|
1857
|
-
};
|
|
1858
|
-
if (step.onError) {
|
|
1859
|
-
for (const errorStep of step.onError) {
|
|
1860
|
-
await executeStep(errorStep, ctx);
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
return;
|
|
1864
|
-
}
|
|
1865
|
-
if (step.onSuccess) {
|
|
1866
|
-
for (const successStep of step.onSuccess) {
|
|
1867
|
-
await executeStep(successStep, ctx);
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
} catch (err) {
|
|
1871
|
-
ctx.locals["error"] = {
|
|
1872
|
-
message: err instanceof Error ? err.message : String(err),
|
|
1873
|
-
name: err instanceof Error ? err.name : "Error"
|
|
1874
|
-
};
|
|
1875
|
-
if (step.onError) {
|
|
1876
|
-
for (const errorStep of step.onError) {
|
|
1877
|
-
await executeStep(errorStep, ctx);
|
|
1878
|
-
}
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
1837
|
|
|
1883
1838
|
// ../../node_modules/.pnpm/marked@17.0.1/node_modules/marked/lib/marked.esm.js
|
|
1884
1839
|
function L() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/runtime",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.5",
|
|
4
4
|
"description": "Runtime DOM renderer for Constela UI framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"dompurify": "^3.3.1",
|
|
19
19
|
"marked": "^17.0.1",
|
|
20
20
|
"shiki": "^3.20.0",
|
|
21
|
-
"@constela/compiler": "0.14.
|
|
22
|
-
"@constela/core": "0.16.
|
|
21
|
+
"@constela/compiler": "0.14.6",
|
|
22
|
+
"@constela/core": "0.16.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/dompurify": "^3.2.0",
|
|
@@ -29,15 +29,7 @@
|
|
|
29
29
|
"tsup": "^8.0.0",
|
|
30
30
|
"typescript": "^5.3.0",
|
|
31
31
|
"vitest": "^2.0.0",
|
|
32
|
-
"@constela/server": "12.0.
|
|
33
|
-
},
|
|
34
|
-
"peerDependencies": {
|
|
35
|
-
"@constela/ai": "1.0.0"
|
|
36
|
-
},
|
|
37
|
-
"peerDependenciesMeta": {
|
|
38
|
-
"@constela/ai": {
|
|
39
|
-
"optional": true
|
|
40
|
-
}
|
|
32
|
+
"@constela/server": "12.0.1"
|
|
41
33
|
},
|
|
42
34
|
"engines": {
|
|
43
35
|
"node": ">=20.0.0"
|