dirac-lang 0.1.43 → 0.1.45
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/{chunk-BN7IKYVP.js → chunk-DIDPRJUP.js} +142 -79
- package/dist/{chunk-G5UIFJ5I.js → chunk-ZKJVGWKK.js} +1 -1
- package/dist/cli.js +7 -4
- package/dist/index.js +2 -2
- package/dist/{interpreter-7N52YTBH.js → interpreter-NAUTRIK2.js} +1 -1
- package/dist/{schedule-CROFBEVH.js → schedule-WPGXPI26.js} +1 -1
- package/dist/{shell-HPRM7WFE.js → shell-LMUSTGDX.js} +5 -5
- package/dist/test-runner.js +1 -1
- package/package.json +1 -1
|
@@ -175,20 +175,32 @@ function executeVariable(session, element) {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
// src/tags/assign.ts
|
|
178
|
-
function executeAssign(session, element) {
|
|
178
|
+
async function executeAssign(session, element) {
|
|
179
179
|
const name = element.attributes.name;
|
|
180
180
|
const valueAttr = element.attributes.value;
|
|
181
|
+
const trimAttr = element.attributes.trim;
|
|
181
182
|
if (!name) {
|
|
182
183
|
throw new Error("<assign> requires name attribute");
|
|
183
184
|
}
|
|
184
185
|
let value;
|
|
185
186
|
if (valueAttr !== void 0) {
|
|
186
187
|
value = substituteVariables(session, valueAttr);
|
|
188
|
+
} else if (element.children && element.children.length > 0) {
|
|
189
|
+
const prevOutput = session.output;
|
|
190
|
+
session.output = [];
|
|
191
|
+
for (const child of element.children) {
|
|
192
|
+
await integrate(session, child);
|
|
193
|
+
}
|
|
194
|
+
value = session.output.join("");
|
|
195
|
+
session.output = prevOutput;
|
|
187
196
|
} else if (element.text) {
|
|
188
197
|
value = substituteVariables(session, element.text);
|
|
189
198
|
} else {
|
|
190
199
|
value = "";
|
|
191
200
|
}
|
|
201
|
+
if (trimAttr === "true" && typeof value === "string") {
|
|
202
|
+
value = value.trim();
|
|
203
|
+
}
|
|
192
204
|
for (let i = session.variables.length - 1; i >= 0; i--) {
|
|
193
205
|
if (session.variables[i].name === name) {
|
|
194
206
|
session.variables[i].value = value;
|
|
@@ -448,12 +460,12 @@ async function executeIf(session, element) {
|
|
|
448
460
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
449
461
|
if (condition) {
|
|
450
462
|
if (thenElement) {
|
|
451
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
463
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
452
464
|
await integrateChildren2(session, thenElement);
|
|
453
465
|
}
|
|
454
466
|
} else {
|
|
455
467
|
if (elseElement) {
|
|
456
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
468
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
457
469
|
await integrateChildren2(session, elseElement);
|
|
458
470
|
}
|
|
459
471
|
}
|
|
@@ -466,7 +478,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
466
478
|
return await evaluateCondition(session, predicateElement);
|
|
467
479
|
}
|
|
468
480
|
const outputLengthBefore = session.output.length;
|
|
469
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
481
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
470
482
|
await integrate2(session, predicateElement);
|
|
471
483
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
472
484
|
const result = newOutputChunks.join("").trim();
|
|
@@ -489,11 +501,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
489
501
|
}
|
|
490
502
|
const outputLengthBefore = session.output.length;
|
|
491
503
|
const args = [];
|
|
492
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
504
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
493
505
|
for (const child of condElement.children) {
|
|
494
506
|
if (child.tag.toLowerCase() === "arg") {
|
|
495
507
|
const argOutputStart = session.output.length;
|
|
496
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
508
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
497
509
|
await integrateChildren2(session, child);
|
|
498
510
|
const newChunks = session.output.slice(argOutputStart);
|
|
499
511
|
const argValue = newChunks.join("");
|
|
@@ -556,6 +568,23 @@ async function executeLLM(session, element) {
|
|
|
556
568
|
if (!session.llmClient) {
|
|
557
569
|
throw new Error("<llm> tag requires LLM configuration. Set LLM_PROVIDER (ollama/anthropic/openai/custom) and appropriate API keys in environment or config.yml");
|
|
558
570
|
}
|
|
571
|
+
const callAnthropic = async (client, model2, maxTokens2, temperature2, messages) => {
|
|
572
|
+
const systemMessages = messages.filter((m) => m.role === "system");
|
|
573
|
+
const userAssistantMessages = messages.filter((m) => m.role !== "system");
|
|
574
|
+
const systemContent = systemMessages.map((m) => m.content).join("\n\n");
|
|
575
|
+
const anthropicParams = {
|
|
576
|
+
model: model2,
|
|
577
|
+
max_tokens: maxTokens2,
|
|
578
|
+
temperature: temperature2,
|
|
579
|
+
messages: userAssistantMessages
|
|
580
|
+
};
|
|
581
|
+
if (systemContent) {
|
|
582
|
+
anthropicParams.system = systemContent;
|
|
583
|
+
}
|
|
584
|
+
const response = await client.messages.create(anthropicParams);
|
|
585
|
+
const content = response.content[0];
|
|
586
|
+
return content.type === "text" ? content.text : "";
|
|
587
|
+
};
|
|
559
588
|
if (session.limits.currentLLMCalls >= session.limits.maxLLMCalls) {
|
|
560
589
|
throw new Error("Maximum LLM calls exceeded");
|
|
561
590
|
}
|
|
@@ -568,6 +597,7 @@ async function executeLLM(session, element) {
|
|
|
568
597
|
const model = element.attributes.model || process.env.DEFAULT_MODEL || defaultModel;
|
|
569
598
|
const outputVar = element.attributes.output;
|
|
570
599
|
const contextVar = element.attributes.context;
|
|
600
|
+
const saveDialog = element.attributes["save-dialog"] === "true";
|
|
571
601
|
const executeMode = element.attributes.execute === "true";
|
|
572
602
|
const temperature = parseFloat(element.attributes.temperature || "1.0");
|
|
573
603
|
const maxTokens = parseInt(element.attributes.maxTokens || "4096", 10);
|
|
@@ -586,23 +616,29 @@ async function executeLLM(session, element) {
|
|
|
586
616
|
throw new Error("<LLM> requires prompt content");
|
|
587
617
|
}
|
|
588
618
|
let dialogHistory = [];
|
|
589
|
-
|
|
590
|
-
|
|
619
|
+
let hasExistingDialog = false;
|
|
620
|
+
if (contextVar || saveDialog) {
|
|
621
|
+
const varName = contextVar || "__llm_dialog__";
|
|
622
|
+
const existing = getVariable(session, varName);
|
|
623
|
+
if (session.debug) {
|
|
624
|
+
console.error(`[LLM] Checking for dialog context in variable: ${varName}`);
|
|
625
|
+
console.error(`[LLM] Existing value type: ${Array.isArray(existing) ? "array" : typeof existing}`);
|
|
626
|
+
if (Array.isArray(existing)) {
|
|
627
|
+
console.error(`[LLM] Existing dialog length: ${existing.length} messages`);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
591
630
|
if (Array.isArray(existing)) {
|
|
592
631
|
dialogHistory = [...existing];
|
|
632
|
+
hasExistingDialog = dialogHistory.length > 0;
|
|
593
633
|
} else if (existing) {
|
|
594
634
|
dialogHistory = [{ role: "system", content: String(existing) }];
|
|
635
|
+
hasExistingDialog = true;
|
|
595
636
|
}
|
|
596
637
|
}
|
|
597
638
|
const noExtra = element.attributes.noextra === "true";
|
|
598
|
-
let prompt;
|
|
599
639
|
let systemPrompt = "";
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
if (session.debug || process.env.DIRAC_LOG_PROMPT === "1") {
|
|
603
|
-
console.error("[LLM] Full prompt sent to LLM (noextra):\n" + prompt + "\n");
|
|
604
|
-
}
|
|
605
|
-
} else {
|
|
640
|
+
let currentUserPrompt = userPrompt;
|
|
641
|
+
if (!noExtra) {
|
|
606
642
|
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-UBATJEND.js");
|
|
607
643
|
const subroutines = getAvailableSubroutines2(session);
|
|
608
644
|
if (session.debug) {
|
|
@@ -611,48 +647,85 @@ async function executeLLM(session, element) {
|
|
|
611
647
|
subroutines.map((s) => ({ name: s.name, description: s.description, parameters: s.parameters }))
|
|
612
648
|
);
|
|
613
649
|
}
|
|
614
|
-
|
|
650
|
+
if (hasExistingDialog && (contextVar || saveDialog)) {
|
|
651
|
+
systemPrompt = "Updated available Dirac XML tags:";
|
|
652
|
+
for (const sub of subroutines) {
|
|
653
|
+
systemPrompt += `
|
|
654
|
+
- ${sub.name} : ${sub.description || ""}`;
|
|
655
|
+
systemPrompt += `
|
|
656
|
+
Ex: <${sub.name}`;
|
|
657
|
+
if (sub.parameters && sub.parameters.length > 0) {
|
|
658
|
+
for (const p of sub.parameters) {
|
|
659
|
+
systemPrompt += ` ${p.name}="${p.example || "string"}"`;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
let example = sub.meta?.body?.example || "";
|
|
663
|
+
example = example.replace(/"/g, '"').replace(/:/g, ":");
|
|
664
|
+
systemPrompt += ">" + example + "</" + sub.name + ">";
|
|
665
|
+
}
|
|
666
|
+
currentUserPrompt = systemPrompt + "\n\nUser request: " + userPrompt;
|
|
667
|
+
if (session.debug || process.env.DIRAC_LOG_PROMPT === "1") {
|
|
668
|
+
console.error("[LLM] Continuing dialog with updated subroutines\n");
|
|
669
|
+
}
|
|
670
|
+
} else {
|
|
671
|
+
systemPrompt = `Dirac is a XML-based language. To define a subroutine with parameters:
|
|
672
|
+
|
|
615
673
|
\`\`\`xml
|
|
616
|
-
<subroutine name=
|
|
617
|
-
|
|
674
|
+
<subroutine name="greet" param-name="string">
|
|
675
|
+
<!-- param-name defines a parameter called "name" -->
|
|
676
|
+
<!-- Access it inside using: <variable name="name"/> -->
|
|
677
|
+
<output>Hello, <variable name="name"/>!</output>
|
|
618
678
|
</subroutine>
|
|
619
679
|
\`\`\`
|
|
620
|
-
|
|
680
|
+
|
|
681
|
+
To call it:
|
|
621
682
|
\`\`\`xml
|
|
622
|
-
<
|
|
683
|
+
<greet name="Alice" />
|
|
684
|
+
<!-- Use just the parameter name (name), NOT param-name -->
|
|
623
685
|
\`\`\`
|
|
686
|
+
|
|
687
|
+
CRITICAL: When defining parameters:
|
|
688
|
+
- Use param-NAME="type" format where NAME is the parameter's name
|
|
689
|
+
- Example: param-username="string" means parameter is called "username"
|
|
690
|
+
- Inside the subroutine, access with: <variable name="username"/>
|
|
691
|
+
- When calling: <mytag username="John" /> (use parameter name directly)
|
|
624
692
|
`;
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
693
|
+
systemPrompt += "Now, You are an expert Dirac XML code generator.\nAllowed Dirac XML tags (use ONLY these tags):";
|
|
694
|
+
for (const sub of subroutines) {
|
|
695
|
+
systemPrompt += `
|
|
628
696
|
- ${sub.name} : ${sub.description || ""}`;
|
|
629
|
-
|
|
697
|
+
systemPrompt += `
|
|
630
698
|
Ex: <${sub.name}`;
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
699
|
+
if (sub.parameters && sub.parameters.length > 0) {
|
|
700
|
+
for (const p of sub.parameters) {
|
|
701
|
+
systemPrompt += ` ${p.name}="${p.example || "string"}"`;
|
|
702
|
+
}
|
|
634
703
|
}
|
|
704
|
+
let example = sub.meta?.body?.example || "";
|
|
705
|
+
example = example.replace(/"/g, '"').replace(/:/g, ":");
|
|
706
|
+
systemPrompt += ">" + example + "</" + sub.name + ">";
|
|
707
|
+
}
|
|
708
|
+
systemPrompt += "\n\nIMPORTANT INSTRUCTIONS:";
|
|
709
|
+
systemPrompt += "\n1. Output ONLY valid XML tags from the list above";
|
|
710
|
+
systemPrompt += "\n2. Do NOT include any explanations, descriptions, or extra text";
|
|
711
|
+
systemPrompt += "\n3. Do NOT use bullet points or formatting - just pure XML";
|
|
712
|
+
systemPrompt += "\n4. Do NOT invent tags - only use tags from the list above";
|
|
713
|
+
systemPrompt += "\n5. Start your response directly with the XML tag (e.g., <add ...>)";
|
|
714
|
+
systemPrompt += "\n\nDouble-check: Does your response contain ONLY XML tags? If not, remove all non-XML text.";
|
|
715
|
+
if (dialogHistory.length === 0) {
|
|
716
|
+
dialogHistory.push({ role: "system", content: systemPrompt });
|
|
635
717
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
systemPrompt += "\n3. Do NOT use bullet points or formatting - just pure XML";
|
|
644
|
-
systemPrompt += "\n4. Do NOT invent tags - only use tags from the list above";
|
|
645
|
-
systemPrompt += "\n5. Start your response directly with the XML tag (e.g., <add ...>)";
|
|
646
|
-
systemPrompt += "\n\nDouble-check: Does your response contain ONLY XML tags? If not, remove all non-XML text.";
|
|
647
|
-
prompt = systemPrompt + "\nUser: " + userPrompt + "\nOutput:";
|
|
648
|
-
if (session.debug || process.env.DIRAC_LOG_PROMPT === "1") {
|
|
649
|
-
console.error("[LLM] Full prompt sent to LLM:\n" + prompt + "\n");
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
dialogHistory.push({ role: "user", content: noExtra ? userPrompt : prompt });
|
|
718
|
+
currentUserPrompt = userPrompt;
|
|
719
|
+
if (session.debug || process.env.DIRAC_LOG_PROMPT === "1") {
|
|
720
|
+
console.error("[LLM] First call - sending full system prompt\n");
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
dialogHistory.push({ role: "user", content: currentUserPrompt });
|
|
653
725
|
if (session.debug) {
|
|
654
|
-
console.error(`[LLM] Calling ${model}
|
|
726
|
+
console.error(`[LLM] Calling ${model}`);
|
|
655
727
|
console.error(`[LLM] Dialog history length: ${dialogHistory.length} messages`);
|
|
728
|
+
console.error(`[LLM] Has existing dialog: ${hasExistingDialog}`);
|
|
656
729
|
}
|
|
657
730
|
try {
|
|
658
731
|
let result;
|
|
@@ -680,21 +753,21 @@ then you call it like
|
|
|
680
753
|
messages: dialogHistory
|
|
681
754
|
});
|
|
682
755
|
} else {
|
|
683
|
-
|
|
684
|
-
model,
|
|
685
|
-
max_tokens: maxTokens,
|
|
686
|
-
temperature,
|
|
687
|
-
messages: dialogHistory
|
|
688
|
-
});
|
|
689
|
-
const content = response.content[0];
|
|
690
|
-
result = content.type === "text" ? content.text : "";
|
|
756
|
+
result = await callAnthropic(session.llmClient, model, maxTokens, temperature, dialogHistory);
|
|
691
757
|
}
|
|
692
758
|
if (session.debug) {
|
|
693
759
|
console.error(`[LLM] Response length: ${result.length}`);
|
|
760
|
+
console.error(`[LLM] Generated code:
|
|
761
|
+
${result}
|
|
762
|
+
`);
|
|
694
763
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
764
|
+
dialogHistory.push({ role: "assistant", content: result });
|
|
765
|
+
const varName = contextVar || (saveDialog ? "__llm_dialog__" : null);
|
|
766
|
+
if (varName) {
|
|
767
|
+
if (session.debug) {
|
|
768
|
+
console.error(`[LLM] Saving dialog history (${dialogHistory.length} messages) to: ${varName}`);
|
|
769
|
+
}
|
|
770
|
+
setVariable(session, varName, dialogHistory, true);
|
|
698
771
|
}
|
|
699
772
|
if (outputVar) {
|
|
700
773
|
setVariable(session, outputVar, result, false);
|
|
@@ -776,18 +849,13 @@ Please fix these errors and generate valid Dirac XML again. Remember to only use
|
|
|
776
849
|
messages: dialogHistory
|
|
777
850
|
});
|
|
778
851
|
} else {
|
|
779
|
-
|
|
780
|
-
model,
|
|
781
|
-
max_tokens: maxTokens,
|
|
782
|
-
temperature,
|
|
783
|
-
messages: dialogHistory
|
|
784
|
-
});
|
|
785
|
-
const content = response.content[0];
|
|
786
|
-
result = content.type === "text" ? content.text : "";
|
|
852
|
+
result = await callAnthropic(session.llmClient, model, maxTokens, temperature, dialogHistory);
|
|
787
853
|
}
|
|
788
854
|
dialogHistory.push({ role: "assistant", content: result });
|
|
789
855
|
if (contextVar) {
|
|
790
856
|
setVariable(session, contextVar, dialogHistory, true);
|
|
857
|
+
} else if (saveDialog) {
|
|
858
|
+
setVariable(session, "__llm_dialog__", dialogHistory, true);
|
|
791
859
|
}
|
|
792
860
|
if (session.debug) {
|
|
793
861
|
console.error(`[LLM] Retry ${retryCount} response:
|
|
@@ -864,18 +932,13 @@ ${feedbackPrompt}
|
|
|
864
932
|
messages: dialogHistory
|
|
865
933
|
});
|
|
866
934
|
} else {
|
|
867
|
-
|
|
868
|
-
model,
|
|
869
|
-
max_tokens: maxTokens,
|
|
870
|
-
temperature,
|
|
871
|
-
messages: dialogHistory
|
|
872
|
-
});
|
|
873
|
-
const content = response.content[0];
|
|
874
|
-
result = content.type === "text" ? content.text : "";
|
|
935
|
+
result = await callAnthropic(session.llmClient, model, maxTokens, temperature, dialogHistory);
|
|
875
936
|
}
|
|
876
937
|
dialogHistory.push({ role: "assistant", content: result });
|
|
877
938
|
if (contextVar) {
|
|
878
939
|
setVariable(session, contextVar, dialogHistory, true);
|
|
940
|
+
} else if (saveDialog) {
|
|
941
|
+
setVariable(session, "__llm_dialog__", dialogHistory, true);
|
|
879
942
|
}
|
|
880
943
|
if (session.debug) {
|
|
881
944
|
console.error(`[LLM] Feedback response:
|
|
@@ -1382,7 +1445,7 @@ async function executeTagCheck(session, element) {
|
|
|
1382
1445
|
const executeTag = correctedTag || tagName;
|
|
1383
1446
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1384
1447
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1385
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1448
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1386
1449
|
await integrate2(session, elementToExecute);
|
|
1387
1450
|
}
|
|
1388
1451
|
}
|
|
@@ -1391,7 +1454,7 @@ async function executeTagCheck(session, element) {
|
|
|
1391
1454
|
// src/tags/throw.ts
|
|
1392
1455
|
async function executeThrow(session, element) {
|
|
1393
1456
|
const exceptionName = element.attributes?.name || "exception";
|
|
1394
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1457
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1395
1458
|
const exceptionDom = {
|
|
1396
1459
|
tag: "exception-content",
|
|
1397
1460
|
attributes: { name: exceptionName },
|
|
@@ -1404,7 +1467,7 @@ async function executeThrow(session, element) {
|
|
|
1404
1467
|
// src/tags/try.ts
|
|
1405
1468
|
async function executeTry(session, element) {
|
|
1406
1469
|
setExceptionBoundary(session);
|
|
1407
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1470
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1408
1471
|
await integrateChildren2(session, element);
|
|
1409
1472
|
unsetExceptionBoundary(session);
|
|
1410
1473
|
}
|
|
@@ -1414,7 +1477,7 @@ async function executeCatch(session, element) {
|
|
|
1414
1477
|
const exceptionName = element.attributes?.name || "exception";
|
|
1415
1478
|
const caughtCount = lookupException(session, exceptionName);
|
|
1416
1479
|
if (caughtCount > 0) {
|
|
1417
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1480
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1418
1481
|
await integrateChildren2(session, element);
|
|
1419
1482
|
}
|
|
1420
1483
|
flushCurrentException(session);
|
|
@@ -1423,7 +1486,7 @@ async function executeCatch(session, element) {
|
|
|
1423
1486
|
// src/tags/exception.ts
|
|
1424
1487
|
async function executeException(session, element) {
|
|
1425
1488
|
const exceptions = getCurrentExceptions(session);
|
|
1426
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1489
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1427
1490
|
for (const exceptionDom of exceptions) {
|
|
1428
1491
|
await integrateChildren2(session, exceptionDom);
|
|
1429
1492
|
}
|
|
@@ -1886,7 +1949,7 @@ async function executeLoadContext(session, element) {
|
|
|
1886
1949
|
query = element.text.trim();
|
|
1887
1950
|
}
|
|
1888
1951
|
if (!query && element.children.length > 0) {
|
|
1889
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1952
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1890
1953
|
const beforeOutput = session.output.length;
|
|
1891
1954
|
for (const child of element.children) {
|
|
1892
1955
|
await integrate2(session, child);
|
|
@@ -2125,7 +2188,7 @@ async function executeForeach(session, element) {
|
|
|
2125
2188
|
const parser2 = new DiracParser2();
|
|
2126
2189
|
try {
|
|
2127
2190
|
const fromElement = parser2.parse(fromAttr);
|
|
2128
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2191
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
2129
2192
|
await integrate2(session, fromElement);
|
|
2130
2193
|
} catch (e) {
|
|
2131
2194
|
session.output = savedOutput;
|
package/dist/cli.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "./chunk-UEFKQRYN.js";
|
|
5
5
|
import {
|
|
6
6
|
execute
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-ZKJVGWKK.js";
|
|
8
|
+
import "./chunk-DIDPRJUP.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
10
|
import "./chunk-4QLTSCDG.js";
|
|
11
11
|
import "./chunk-GLXVY235.js";
|
|
@@ -16,7 +16,7 @@ import "dotenv/config";
|
|
|
16
16
|
// package.json
|
|
17
17
|
var package_default = {
|
|
18
18
|
name: "dirac-lang",
|
|
19
|
-
version: "0.1.
|
|
19
|
+
version: "0.1.45",
|
|
20
20
|
description: "LLM-Augmented Declarative Execution",
|
|
21
21
|
type: "module",
|
|
22
22
|
main: "dist/index.js",
|
|
@@ -96,7 +96,7 @@ async function main() {
|
|
|
96
96
|
process.exit(0);
|
|
97
97
|
}
|
|
98
98
|
if (args[0] === "shell") {
|
|
99
|
-
const { DiracShell } = await import("./shell-
|
|
99
|
+
const { DiracShell } = await import("./shell-LMUSTGDX.js");
|
|
100
100
|
const shellConfig = { debug: false };
|
|
101
101
|
for (let i = 1; i < args.length; i++) {
|
|
102
102
|
const arg = args[i];
|
|
@@ -142,6 +142,9 @@ async function main() {
|
|
|
142
142
|
let filePath;
|
|
143
143
|
let emitXml = false;
|
|
144
144
|
let configFile;
|
|
145
|
+
if (process.env.DEBUG === "1") {
|
|
146
|
+
config.debug = true;
|
|
147
|
+
}
|
|
145
148
|
for (let i = 0; i < args.length; i++) {
|
|
146
149
|
const arg = args[i];
|
|
147
150
|
if (arg === "--debug") {
|
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-ZKJVGWKK.js";
|
|
6
6
|
import {
|
|
7
7
|
integrate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DIDPRJUP.js";
|
|
9
9
|
import {
|
|
10
10
|
DiracParser
|
|
11
11
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-UEFKQRYN.js";
|
|
5
5
|
import {
|
|
6
6
|
integrate
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DIDPRJUP.js";
|
|
8
8
|
import {
|
|
9
9
|
DiracParser
|
|
10
10
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -66,7 +66,7 @@ var DiracShell = class {
|
|
|
66
66
|
});
|
|
67
67
|
this.rl.on("close", () => {
|
|
68
68
|
this.saveHistory();
|
|
69
|
-
import("./schedule-
|
|
69
|
+
import("./schedule-WPGXPI26.js").then(({ stopAllScheduledTasks }) => {
|
|
70
70
|
stopAllScheduledTasks();
|
|
71
71
|
console.log("\nGoodbye!");
|
|
72
72
|
process.exit(0);
|
|
@@ -366,7 +366,7 @@ Examples:
|
|
|
366
366
|
break;
|
|
367
367
|
case "tasks":
|
|
368
368
|
try {
|
|
369
|
-
const { listScheduledTasks } = await import("./schedule-
|
|
369
|
+
const { listScheduledTasks } = await import("./schedule-WPGXPI26.js");
|
|
370
370
|
const tasks = listScheduledTasks();
|
|
371
371
|
if (tasks.length === 0) {
|
|
372
372
|
console.log("No scheduled tasks running.");
|
|
@@ -385,7 +385,7 @@ Examples:
|
|
|
385
385
|
console.log("Usage: :stop <task-name>");
|
|
386
386
|
} else {
|
|
387
387
|
try {
|
|
388
|
-
const { stopScheduledTask } = await import("./schedule-
|
|
388
|
+
const { stopScheduledTask } = await import("./schedule-WPGXPI26.js");
|
|
389
389
|
const taskName = args[0];
|
|
390
390
|
const stopped = stopScheduledTask(taskName);
|
|
391
391
|
if (stopped) {
|
|
@@ -400,7 +400,7 @@ Examples:
|
|
|
400
400
|
break;
|
|
401
401
|
case "stopall":
|
|
402
402
|
try {
|
|
403
|
-
const { stopAllScheduledTasks } = await import("./schedule-
|
|
403
|
+
const { stopAllScheduledTasks } = await import("./schedule-WPGXPI26.js");
|
|
404
404
|
stopAllScheduledTasks();
|
|
405
405
|
console.log("All scheduled tasks stopped.");
|
|
406
406
|
} catch (error) {
|
package/dist/test-runner.js
CHANGED