dirac-lang 0.1.15 → 0.1.17
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/config.test.yml +5 -0
- package/dist/{chunk-UO6QEXZV.js → chunk-3FECP4IA.js} +1 -1
- package/dist/{chunk-74EQEVS6.js → chunk-OB7IXRFP.js} +27 -18
- package/dist/cli.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{interpreter-SE5I5ROB.js → interpreter-Y465JGHU.js} +1 -1
- package/dist/{tag-validator-DYWFTEBE.js → tag-validator-HBCGQV6F.js} +10 -8
- package/dist/test-runner.js +3 -4
- package/examples/llm-command-more.di +6 -0
- package/examples/llm-command.di +1 -1
- package/package.json +1 -1
- package/src/tags/tag-check.ts +19 -6
- package/src/test-runner.ts +4 -4
- package/src/utils/tag-validator.ts +12 -8
- package/tests/llm-validate.test.di +17 -0
- package/tests/tag-check.test.di +27 -0
- package/config.yml +0 -9
- package/config.yml.bak +0 -8
- package/config.yml.ollama +0 -6
- package/config.yml.openai +0 -6
package/config.test.yml
ADDED
|
@@ -396,12 +396,12 @@ async function executeIf(session, element) {
|
|
|
396
396
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
397
397
|
if (condition) {
|
|
398
398
|
if (thenElement) {
|
|
399
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
399
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-Y465JGHU.js");
|
|
400
400
|
await integrateChildren2(session, thenElement);
|
|
401
401
|
}
|
|
402
402
|
} else {
|
|
403
403
|
if (elseElement) {
|
|
404
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
404
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-Y465JGHU.js");
|
|
405
405
|
await integrateChildren2(session, elseElement);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
@@ -414,7 +414,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
414
414
|
return await evaluateCondition(session, predicateElement);
|
|
415
415
|
}
|
|
416
416
|
const outputLengthBefore = session.output.length;
|
|
417
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
417
|
+
const { integrate: integrate2 } = await import("./interpreter-Y465JGHU.js");
|
|
418
418
|
await integrate2(session, predicateElement);
|
|
419
419
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
420
420
|
const result = newOutputChunks.join("").trim();
|
|
@@ -437,11 +437,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
437
437
|
}
|
|
438
438
|
const outputLengthBefore = session.output.length;
|
|
439
439
|
const args = [];
|
|
440
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
440
|
+
const { integrate: integrate2 } = await import("./interpreter-Y465JGHU.js");
|
|
441
441
|
for (const child of condElement.children) {
|
|
442
442
|
if (child.tag.toLowerCase() === "arg") {
|
|
443
443
|
const argOutputStart = session.output.length;
|
|
444
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
444
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-Y465JGHU.js");
|
|
445
445
|
await integrateChildren2(session, child);
|
|
446
446
|
const newChunks = session.output.slice(argOutputStart);
|
|
447
447
|
const argValue = newChunks.join("");
|
|
@@ -677,7 +677,7 @@ ${result}
|
|
|
677
677
|
const parser = new DiracParser();
|
|
678
678
|
let dynamicAST = parser.parse(diracCode);
|
|
679
679
|
if (validateTags) {
|
|
680
|
-
const { validateDiracCode, applyCorrectedTags } = await import("./tag-validator-
|
|
680
|
+
const { validateDiracCode, applyCorrectedTags } = await import("./tag-validator-HBCGQV6F.js");
|
|
681
681
|
let validation = await validateDiracCode(session, dynamicAST, { autocorrect });
|
|
682
682
|
let retryCount = 0;
|
|
683
683
|
while (!validation.valid && retryCount < maxRetries) {
|
|
@@ -1106,18 +1106,24 @@ import fs from "fs";
|
|
|
1106
1106
|
import yaml from "js-yaml";
|
|
1107
1107
|
var SIMILARITY_CUTOFF = 0.75;
|
|
1108
1108
|
function getEmbeddingServerConfig() {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1109
|
+
try {
|
|
1110
|
+
const configPath = process.env.DIRAC_CONFIG || "config.yml";
|
|
1111
|
+
const config = yaml.load(fs.readFileSync(configPath, "utf8"));
|
|
1112
|
+
const host = config.embeddingServer?.host || "localhost";
|
|
1113
|
+
const port = config.embeddingServer?.port || 11434;
|
|
1114
|
+
const model = config.embeddingServer?.model || "embeddinggemma";
|
|
1115
|
+
return { host, port, model };
|
|
1116
|
+
} catch (e) {
|
|
1117
|
+
return { host: "localhost", port: 11434, model: "embeddinggemma" };
|
|
1118
|
+
}
|
|
1113
1119
|
}
|
|
1114
1120
|
async function getEmbeddings(tags) {
|
|
1115
|
-
const { host, port } = getEmbeddingServerConfig();
|
|
1121
|
+
const { host, port, model } = getEmbeddingServerConfig();
|
|
1116
1122
|
return await Promise.all(tags.map(async (tag) => {
|
|
1117
1123
|
const response = await fetch(`http://${host}:${port}/api/embeddings`, {
|
|
1118
1124
|
method: "POST",
|
|
1119
1125
|
headers: { "Content-Type": "application/json" },
|
|
1120
|
-
body: JSON.stringify({ model
|
|
1126
|
+
body: JSON.stringify({ model, prompt: tag })
|
|
1121
1127
|
});
|
|
1122
1128
|
const data = await response.json();
|
|
1123
1129
|
return data.embedding;
|
|
@@ -1153,6 +1159,9 @@ async function executeTagCheck(session, element) {
|
|
|
1153
1159
|
const shouldExecute = element.attributes?.execute === "true";
|
|
1154
1160
|
for (const child of element.children) {
|
|
1155
1161
|
const tagName = child.tag;
|
|
1162
|
+
if (!tagName || tagName.trim() === "") {
|
|
1163
|
+
continue;
|
|
1164
|
+
}
|
|
1156
1165
|
console.error(`[tag-check] Checking tag: <${tagName}>`);
|
|
1157
1166
|
let allValid = false;
|
|
1158
1167
|
let correctedTag = null;
|
|
@@ -1235,7 +1244,7 @@ async function executeTagCheck(session, element) {
|
|
|
1235
1244
|
const executeTag = correctedTag || tagName;
|
|
1236
1245
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1237
1246
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1238
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1247
|
+
const { integrate: integrate2 } = await import("./interpreter-Y465JGHU.js");
|
|
1239
1248
|
await integrate2(session, elementToExecute);
|
|
1240
1249
|
}
|
|
1241
1250
|
}
|
|
@@ -1244,7 +1253,7 @@ async function executeTagCheck(session, element) {
|
|
|
1244
1253
|
// src/tags/throw.ts
|
|
1245
1254
|
async function executeThrow(session, element) {
|
|
1246
1255
|
const exceptionName = element.attributes?.name || "exception";
|
|
1247
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1256
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-Y465JGHU.js");
|
|
1248
1257
|
const exceptionDom = {
|
|
1249
1258
|
tag: "exception-content",
|
|
1250
1259
|
attributes: { name: exceptionName },
|
|
@@ -1257,7 +1266,7 @@ async function executeThrow(session, element) {
|
|
|
1257
1266
|
// src/tags/try.ts
|
|
1258
1267
|
async function executeTry(session, element) {
|
|
1259
1268
|
setExceptionBoundary(session);
|
|
1260
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1269
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-Y465JGHU.js");
|
|
1261
1270
|
await integrateChildren2(session, element);
|
|
1262
1271
|
unsetExceptionBoundary(session);
|
|
1263
1272
|
}
|
|
@@ -1267,7 +1276,7 @@ async function executeCatch(session, element) {
|
|
|
1267
1276
|
const exceptionName = element.attributes?.name || "exception";
|
|
1268
1277
|
const caughtCount = lookupException(session, exceptionName);
|
|
1269
1278
|
if (caughtCount > 0) {
|
|
1270
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1279
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-Y465JGHU.js");
|
|
1271
1280
|
await integrateChildren2(session, element);
|
|
1272
1281
|
}
|
|
1273
1282
|
flushCurrentException(session);
|
|
@@ -1276,7 +1285,7 @@ async function executeCatch(session, element) {
|
|
|
1276
1285
|
// src/tags/exception.ts
|
|
1277
1286
|
async function executeException(session, element) {
|
|
1278
1287
|
const exceptions = getCurrentExceptions(session);
|
|
1279
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1288
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-Y465JGHU.js");
|
|
1280
1289
|
for (const exceptionDom of exceptions) {
|
|
1281
1290
|
await integrateChildren2(session, exceptionDom);
|
|
1282
1291
|
}
|
|
@@ -1416,7 +1425,7 @@ async function executeForeach(session, element) {
|
|
|
1416
1425
|
const parser2 = new DiracParser2();
|
|
1417
1426
|
try {
|
|
1418
1427
|
const fromElement = parser2.parse(fromAttr);
|
|
1419
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1428
|
+
const { integrate: integrate2 } = await import("./interpreter-Y465JGHU.js");
|
|
1420
1429
|
await integrate2(session, fromElement);
|
|
1421
1430
|
} catch (e) {
|
|
1422
1431
|
session.output = savedOutput;
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
execute
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-3FECP4IA.js";
|
|
5
|
+
import "./chunk-OB7IXRFP.js";
|
|
6
6
|
import "./chunk-HRHAMPOB.js";
|
|
7
7
|
import "./chunk-E7PWEMZA.js";
|
|
8
8
|
import "./chunk-52ED23DR.js";
|
|
@@ -13,7 +13,7 @@ import "dotenv/config";
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "dirac-lang",
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.17",
|
|
17
17
|
description: "LLM-Augmented Declarative Execution",
|
|
18
18
|
type: "module",
|
|
19
19
|
main: "dist/index.js",
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
createLLMAdapter,
|
|
3
3
|
execute,
|
|
4
4
|
executeUserCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3FECP4IA.js";
|
|
6
6
|
import {
|
|
7
7
|
integrate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OB7IXRFP.js";
|
|
9
9
|
import {
|
|
10
10
|
DiracParser
|
|
11
11
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -4,21 +4,23 @@ import yaml from "js-yaml";
|
|
|
4
4
|
var SIMILARITY_CUTOFF = 0.75;
|
|
5
5
|
function getEmbeddingServerConfig() {
|
|
6
6
|
try {
|
|
7
|
-
const
|
|
7
|
+
const configPath = process.env.DIRAC_CONFIG || "config.yml";
|
|
8
|
+
const config = yaml.load(fs.readFileSync(configPath, "utf8"));
|
|
8
9
|
const host = config.embeddingServer?.host || "localhost";
|
|
9
|
-
const port = config.embeddingServer?.port ||
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const port = config.embeddingServer?.port || 11434;
|
|
11
|
+
const model = config.embeddingServer?.model || "embeddinggemma";
|
|
12
|
+
return { host, port, model };
|
|
13
|
+
} catch (e) {
|
|
14
|
+
return { host: "localhost", port: 11434, model: "embeddinggemma" };
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
async function getEmbeddings(tags) {
|
|
16
|
-
const { host, port } = getEmbeddingServerConfig();
|
|
18
|
+
const { host, port, model } = getEmbeddingServerConfig();
|
|
17
19
|
return await Promise.all(tags.map(async (tag) => {
|
|
18
20
|
const response = await fetch(`http://${host}:${port}/api/embeddings`, {
|
|
19
21
|
method: "POST",
|
|
20
22
|
headers: { "Content-Type": "application/json" },
|
|
21
|
-
body: JSON.stringify({ model
|
|
23
|
+
body: JSON.stringify({ model, prompt: tag })
|
|
22
24
|
});
|
|
23
25
|
const data = await response.json();
|
|
24
26
|
return data.embedding;
|
|
@@ -111,7 +113,7 @@ async function validateDiracCode(session, ast, options = {}) {
|
|
|
111
113
|
const results = [];
|
|
112
114
|
const errorMessages = [];
|
|
113
115
|
async function validateElement(element) {
|
|
114
|
-
if (element.tag && element.tag !== "dirac" && element.tag !== "") {
|
|
116
|
+
if (element.tag && element.tag !== "dirac" && element.tag !== "DIRAC-ROOT" && element.tag.trim() !== "") {
|
|
115
117
|
const result = await validateTag(session, element, options);
|
|
116
118
|
results.push(result);
|
|
117
119
|
if (!result.valid) {
|
package/dist/test-runner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
integrate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OB7IXRFP.js";
|
|
4
4
|
import {
|
|
5
5
|
DiracParser
|
|
6
6
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -19,9 +19,8 @@ var TestRunner = class {
|
|
|
19
19
|
config;
|
|
20
20
|
constructor(testDir = "tests", configPath) {
|
|
21
21
|
this.testDir = testDir;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.config = yaml.load(fs.readFileSync(defaultConfigPath, "utf8")) || {};
|
|
22
|
+
if (configPath && fs.existsSync(configPath)) {
|
|
23
|
+
this.config = yaml.load(fs.readFileSync(configPath, "utf8")) || {};
|
|
25
24
|
} else {
|
|
26
25
|
this.config = { llmProvider: "ollama", llmModel: "llama2" };
|
|
27
26
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<dirac>
|
|
2
|
+
<subroutine name="background" description="set the background color." param-color="string:required:color name" >
|
|
3
|
+
this is my color: <variable name="color" />
|
|
4
|
+
</subroutine>
|
|
5
|
+
<llm execute="true">what is the color of red mix with yellow and set the background color to that color</llm>
|
|
6
|
+
</dirac>
|
package/examples/llm-command.di
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
<subroutine name="background" description="set the background color." param-color="string:required:color name" >
|
|
3
3
|
this is my color: <variable name="color" />
|
|
4
4
|
</subroutine>
|
|
5
|
-
<llm execute="true">set the background color to red</llm>
|
|
5
|
+
<llm execute="true" validate="true">set the background color to red</llm>
|
|
6
6
|
</dirac>
|
package/package.json
CHANGED
package/src/tags/tag-check.ts
CHANGED
|
@@ -15,20 +15,27 @@ const SIMILARITY_CUTOFF = 0.75;
|
|
|
15
15
|
|
|
16
16
|
// Helper: get embedding server config from config.yml
|
|
17
17
|
function getEmbeddingServerConfig() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
try {
|
|
19
|
+
const configPath = process.env.DIRAC_CONFIG || 'config.yml';
|
|
20
|
+
const config = yaml.load(fs.readFileSync(configPath, 'utf8')) as any;
|
|
21
|
+
const host = config.embeddingServer?.host || 'localhost';
|
|
22
|
+
const port = config.embeddingServer?.port || 11434;
|
|
23
|
+
const model = config.embeddingServer?.model || 'embeddinggemma';
|
|
24
|
+
return { host, port, model };
|
|
25
|
+
} catch (e) {
|
|
26
|
+
// Fallback to defaults if config file not found
|
|
27
|
+
return { host: 'localhost', port: 11434, model: 'embeddinggemma' };
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
// Helper: call Ollama embedding API directly
|
|
25
32
|
async function getEmbeddings(tags: string[]): Promise<number[][]> {
|
|
26
|
-
const { host, port } = getEmbeddingServerConfig();
|
|
33
|
+
const { host, port, model } = getEmbeddingServerConfig();
|
|
27
34
|
return await Promise.all(tags.map(async tag => {
|
|
28
35
|
const response = await fetch(`http://${host}:${port}/api/embeddings`, {
|
|
29
36
|
method: 'POST',
|
|
30
37
|
headers: { 'Content-Type': 'application/json' },
|
|
31
|
-
body: JSON.stringify({ model
|
|
38
|
+
body: JSON.stringify({ model, prompt: tag })
|
|
32
39
|
});
|
|
33
40
|
const data = await response.json();
|
|
34
41
|
return data.embedding;
|
|
@@ -67,6 +74,12 @@ export async function executeTagCheck(session: DiracSession, element: DiracEleme
|
|
|
67
74
|
|
|
68
75
|
for (const child of element.children) {
|
|
69
76
|
const tagName = child.tag;
|
|
77
|
+
|
|
78
|
+
// Skip text nodes (empty tag names) and whitespace
|
|
79
|
+
if (!tagName || tagName.trim() === '') {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
|
|
70
83
|
console.error(`[tag-check] Checking tag: <${tagName}>`);
|
|
71
84
|
let allValid = false;
|
|
72
85
|
let correctedTag: string | null = null;
|
package/src/test-runner.ts
CHANGED
|
@@ -33,10 +33,10 @@ export class TestRunner {
|
|
|
33
33
|
constructor(testDir: string = 'tests', configPath?: string) {
|
|
34
34
|
this.testDir = testDir;
|
|
35
35
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
if (fs.existsSync(
|
|
39
|
-
this.config = yaml.load(fs.readFileSync(
|
|
36
|
+
// For tests, always use ollama as the default provider (no API keys needed)
|
|
37
|
+
// Unless a specific test config is provided
|
|
38
|
+
if (configPath && fs.existsSync(configPath)) {
|
|
39
|
+
this.config = yaml.load(fs.readFileSync(configPath, 'utf8')) || {};
|
|
40
40
|
} else {
|
|
41
41
|
this.config = { llmProvider: 'ollama', llmModel: 'llama2' };
|
|
42
42
|
}
|
|
@@ -23,23 +23,26 @@ export interface ValidationResult {
|
|
|
23
23
|
// Helper: get embedding server config from config.yml
|
|
24
24
|
function getEmbeddingServerConfig() {
|
|
25
25
|
try {
|
|
26
|
-
const
|
|
26
|
+
const configPath = process.env.DIRAC_CONFIG || 'config.yml';
|
|
27
|
+
const config = yaml.load(fs.readFileSync(configPath, 'utf8')) as any;
|
|
27
28
|
const host = config.embeddingServer?.host || 'localhost';
|
|
28
|
-
const port = config.embeddingServer?.port ||
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const port = config.embeddingServer?.port || 11434;
|
|
30
|
+
const model = config.embeddingServer?.model || 'embeddinggemma';
|
|
31
|
+
return { host, port, model };
|
|
32
|
+
} catch (e) {
|
|
33
|
+
// Fallback to defaults if config file not found
|
|
34
|
+
return { host: 'localhost', port: 11434, model: 'embeddinggemma' };
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
// Helper: call Ollama embedding API directly
|
|
36
39
|
async function getEmbeddings(tags: string[]): Promise<number[][]> {
|
|
37
|
-
const { host, port } = getEmbeddingServerConfig();
|
|
40
|
+
const { host, port, model } = getEmbeddingServerConfig();
|
|
38
41
|
return await Promise.all(tags.map(async tag => {
|
|
39
42
|
const response = await fetch(`http://${host}:${port}/api/embeddings`, {
|
|
40
43
|
method: 'POST',
|
|
41
44
|
headers: { 'Content-Type': 'application/json' },
|
|
42
|
-
body: JSON.stringify({ model
|
|
45
|
+
body: JSON.stringify({ model, prompt: tag })
|
|
43
46
|
});
|
|
44
47
|
const data = await response.json();
|
|
45
48
|
return data.embedding;
|
|
@@ -179,7 +182,8 @@ export async function validateDiracCode(
|
|
|
179
182
|
|
|
180
183
|
// Recursively validate all elements
|
|
181
184
|
async function validateElement(element: DiracElement) {
|
|
182
|
-
|
|
185
|
+
// Skip text nodes, whitespace-only tags, and root wrapper tags
|
|
186
|
+
if (element.tag && element.tag !== 'dirac' && element.tag !== 'DIRAC-ROOT' && element.tag.trim() !== '') {
|
|
183
187
|
const result = await validateTag(session, element, options);
|
|
184
188
|
results.push(result);
|
|
185
189
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- TEST: llm_execute_with_validation -->
|
|
2
|
+
<!-- EXPECT: Background color is: blue -->
|
|
3
|
+
|
|
4
|
+
<dirac>
|
|
5
|
+
<subroutine name="set-color"
|
|
6
|
+
description="Set a background color"
|
|
7
|
+
param-color="string:required:Color name">
|
|
8
|
+
<parameters select="@color"/>
|
|
9
|
+
<output>Background color is: <variable name="color" /></output>
|
|
10
|
+
</subroutine>
|
|
11
|
+
|
|
12
|
+
<!-- Test: LLM with execute=true and validate=true should work -->
|
|
13
|
+
<!-- This tests that DIRAC-ROOT wrapper tag is properly skipped during validation -->
|
|
14
|
+
<llm execute="true" validate="true" maxTokens="100">
|
|
15
|
+
Set the background color to blue
|
|
16
|
+
</llm>
|
|
17
|
+
</dirac>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- TEST: tag_check_autocorrect -->
|
|
2
|
+
<!-- EXPECT: The tag <background-set> was auto-corrected to <background> (similarity: 0.84)
|
|
3
|
+
Color changed to: red -->
|
|
4
|
+
|
|
5
|
+
<dirac>
|
|
6
|
+
<subroutine name="background"
|
|
7
|
+
description="Change the background color"
|
|
8
|
+
param-color="string:required:Background color:red|blue|green">
|
|
9
|
+
<parameters select="@color"/>
|
|
10
|
+
<output>Color changed to: <variable name="color" /></output>
|
|
11
|
+
</subroutine>
|
|
12
|
+
|
|
13
|
+
<subroutine name="foreground"
|
|
14
|
+
description="Change the foreground text color"
|
|
15
|
+
param-color="string:required:Text color:black|white|gray">
|
|
16
|
+
<parameters select="@color"/>
|
|
17
|
+
<output>Text color changed to: <variable name="color" /></output>
|
|
18
|
+
</subroutine>
|
|
19
|
+
|
|
20
|
+
<!-- Test: tag-check should auto-correct similar tag names and execute -->
|
|
21
|
+
<defvar name="result" trim="true">
|
|
22
|
+
<tag-check execute="true" autocorrect="true">
|
|
23
|
+
<background-set color="red" />
|
|
24
|
+
</tag-check>
|
|
25
|
+
</defvar>
|
|
26
|
+
<output><variable name="result" /></output>
|
|
27
|
+
</dirac>
|
package/config.yml
DELETED
package/config.yml.bak
DELETED
package/config.yml.ollama
DELETED