dirac-lang 0.1.44 → 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-4ROK7OUQ.js → chunk-DIDPRJUP.js} +129 -78
- package/dist/{chunk-2SNN7MBU.js → chunk-ZKJVGWKK.js} +1 -1
- package/dist/cli.js +7 -4
- package/dist/index.js +2 -2
- package/dist/{interpreter-Y2BOWVF4.js → interpreter-NAUTRIK2.js} +1 -1
- package/dist/{schedule-DZ2SPHSX.js → schedule-WPGXPI26.js} +1 -1
- package/dist/{shell-3ZZUMKP3.js → shell-LMUSTGDX.js} +5 -5
- package/dist/test-runner.js +1 -1
- package/package.json +1 -1
|
@@ -460,12 +460,12 @@ async function executeIf(session, element) {
|
|
|
460
460
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
461
461
|
if (condition) {
|
|
462
462
|
if (thenElement) {
|
|
463
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
463
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
464
464
|
await integrateChildren2(session, thenElement);
|
|
465
465
|
}
|
|
466
466
|
} else {
|
|
467
467
|
if (elseElement) {
|
|
468
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
468
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
469
469
|
await integrateChildren2(session, elseElement);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
@@ -478,7 +478,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
478
478
|
return await evaluateCondition(session, predicateElement);
|
|
479
479
|
}
|
|
480
480
|
const outputLengthBefore = session.output.length;
|
|
481
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
481
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
482
482
|
await integrate2(session, predicateElement);
|
|
483
483
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
484
484
|
const result = newOutputChunks.join("").trim();
|
|
@@ -501,11 +501,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
501
501
|
}
|
|
502
502
|
const outputLengthBefore = session.output.length;
|
|
503
503
|
const args = [];
|
|
504
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
504
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
505
505
|
for (const child of condElement.children) {
|
|
506
506
|
if (child.tag.toLowerCase() === "arg") {
|
|
507
507
|
const argOutputStart = session.output.length;
|
|
508
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
508
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
509
509
|
await integrateChildren2(session, child);
|
|
510
510
|
const newChunks = session.output.slice(argOutputStart);
|
|
511
511
|
const argValue = newChunks.join("");
|
|
@@ -568,6 +568,23 @@ async function executeLLM(session, element) {
|
|
|
568
568
|
if (!session.llmClient) {
|
|
569
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");
|
|
570
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
|
+
};
|
|
571
588
|
if (session.limits.currentLLMCalls >= session.limits.maxLLMCalls) {
|
|
572
589
|
throw new Error("Maximum LLM calls exceeded");
|
|
573
590
|
}
|
|
@@ -580,6 +597,7 @@ async function executeLLM(session, element) {
|
|
|
580
597
|
const model = element.attributes.model || process.env.DEFAULT_MODEL || defaultModel;
|
|
581
598
|
const outputVar = element.attributes.output;
|
|
582
599
|
const contextVar = element.attributes.context;
|
|
600
|
+
const saveDialog = element.attributes["save-dialog"] === "true";
|
|
583
601
|
const executeMode = element.attributes.execute === "true";
|
|
584
602
|
const temperature = parseFloat(element.attributes.temperature || "1.0");
|
|
585
603
|
const maxTokens = parseInt(element.attributes.maxTokens || "4096", 10);
|
|
@@ -598,23 +616,29 @@ async function executeLLM(session, element) {
|
|
|
598
616
|
throw new Error("<LLM> requires prompt content");
|
|
599
617
|
}
|
|
600
618
|
let dialogHistory = [];
|
|
601
|
-
|
|
602
|
-
|
|
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
|
+
}
|
|
603
630
|
if (Array.isArray(existing)) {
|
|
604
631
|
dialogHistory = [...existing];
|
|
632
|
+
hasExistingDialog = dialogHistory.length > 0;
|
|
605
633
|
} else if (existing) {
|
|
606
634
|
dialogHistory = [{ role: "system", content: String(existing) }];
|
|
635
|
+
hasExistingDialog = true;
|
|
607
636
|
}
|
|
608
637
|
}
|
|
609
638
|
const noExtra = element.attributes.noextra === "true";
|
|
610
|
-
let prompt;
|
|
611
639
|
let systemPrompt = "";
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
if (session.debug || process.env.DIRAC_LOG_PROMPT === "1") {
|
|
615
|
-
console.error("[LLM] Full prompt sent to LLM (noextra):\n" + prompt + "\n");
|
|
616
|
-
}
|
|
617
|
-
} else {
|
|
640
|
+
let currentUserPrompt = userPrompt;
|
|
641
|
+
if (!noExtra) {
|
|
618
642
|
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-UBATJEND.js");
|
|
619
643
|
const subroutines = getAvailableSubroutines2(session);
|
|
620
644
|
if (session.debug) {
|
|
@@ -623,48 +647,85 @@ async function executeLLM(session, element) {
|
|
|
623
647
|
subroutines.map((s) => ({ name: s.name, description: s.description, parameters: s.parameters }))
|
|
624
648
|
);
|
|
625
649
|
}
|
|
626
|
-
|
|
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
|
+
|
|
627
673
|
\`\`\`xml
|
|
628
|
-
<subroutine name=
|
|
629
|
-
|
|
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>
|
|
630
678
|
</subroutine>
|
|
631
679
|
\`\`\`
|
|
632
|
-
|
|
680
|
+
|
|
681
|
+
To call it:
|
|
633
682
|
\`\`\`xml
|
|
634
|
-
<
|
|
683
|
+
<greet name="Alice" />
|
|
684
|
+
<!-- Use just the parameter name (name), NOT param-name -->
|
|
635
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)
|
|
636
692
|
`;
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
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 += `
|
|
640
696
|
- ${sub.name} : ${sub.description || ""}`;
|
|
641
|
-
|
|
697
|
+
systemPrompt += `
|
|
642
698
|
Ex: <${sub.name}`;
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
699
|
+
if (sub.parameters && sub.parameters.length > 0) {
|
|
700
|
+
for (const p of sub.parameters) {
|
|
701
|
+
systemPrompt += ` ${p.name}="${p.example || "string"}"`;
|
|
702
|
+
}
|
|
646
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 });
|
|
717
|
+
}
|
|
718
|
+
currentUserPrompt = userPrompt;
|
|
719
|
+
if (session.debug || process.env.DIRAC_LOG_PROMPT === "1") {
|
|
720
|
+
console.error("[LLM] First call - sending full system prompt\n");
|
|
647
721
|
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
systemPrompt += "\n\nIMPORTANT INSTRUCTIONS:";
|
|
653
|
-
systemPrompt += "\n1. Output ONLY valid XML tags from the list above";
|
|
654
|
-
systemPrompt += "\n2. Do NOT include any explanations, descriptions, or extra text";
|
|
655
|
-
systemPrompt += "\n3. Do NOT use bullet points or formatting - just pure XML";
|
|
656
|
-
systemPrompt += "\n4. Do NOT invent tags - only use tags from the list above";
|
|
657
|
-
systemPrompt += "\n5. Start your response directly with the XML tag (e.g., <add ...>)";
|
|
658
|
-
systemPrompt += "\n\nDouble-check: Does your response contain ONLY XML tags? If not, remove all non-XML text.";
|
|
659
|
-
prompt = systemPrompt + "\nUser: " + userPrompt + "\nOutput:";
|
|
660
|
-
if (session.debug || process.env.DIRAC_LOG_PROMPT === "1") {
|
|
661
|
-
console.error("[LLM] Full prompt sent to LLM:\n" + prompt + "\n");
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
dialogHistory.push({ role: "user", content: noExtra ? userPrompt : prompt });
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
dialogHistory.push({ role: "user", content: currentUserPrompt });
|
|
665
725
|
if (session.debug) {
|
|
666
|
-
console.error(`[LLM] Calling ${model}
|
|
726
|
+
console.error(`[LLM] Calling ${model}`);
|
|
667
727
|
console.error(`[LLM] Dialog history length: ${dialogHistory.length} messages`);
|
|
728
|
+
console.error(`[LLM] Has existing dialog: ${hasExistingDialog}`);
|
|
668
729
|
}
|
|
669
730
|
try {
|
|
670
731
|
let result;
|
|
@@ -692,21 +753,21 @@ then you call it like
|
|
|
692
753
|
messages: dialogHistory
|
|
693
754
|
});
|
|
694
755
|
} else {
|
|
695
|
-
|
|
696
|
-
model,
|
|
697
|
-
max_tokens: maxTokens,
|
|
698
|
-
temperature,
|
|
699
|
-
messages: dialogHistory
|
|
700
|
-
});
|
|
701
|
-
const content = response.content[0];
|
|
702
|
-
result = content.type === "text" ? content.text : "";
|
|
756
|
+
result = await callAnthropic(session.llmClient, model, maxTokens, temperature, dialogHistory);
|
|
703
757
|
}
|
|
704
758
|
if (session.debug) {
|
|
705
759
|
console.error(`[LLM] Response length: ${result.length}`);
|
|
760
|
+
console.error(`[LLM] Generated code:
|
|
761
|
+
${result}
|
|
762
|
+
`);
|
|
706
763
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
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);
|
|
710
771
|
}
|
|
711
772
|
if (outputVar) {
|
|
712
773
|
setVariable(session, outputVar, result, false);
|
|
@@ -788,18 +849,13 @@ Please fix these errors and generate valid Dirac XML again. Remember to only use
|
|
|
788
849
|
messages: dialogHistory
|
|
789
850
|
});
|
|
790
851
|
} else {
|
|
791
|
-
|
|
792
|
-
model,
|
|
793
|
-
max_tokens: maxTokens,
|
|
794
|
-
temperature,
|
|
795
|
-
messages: dialogHistory
|
|
796
|
-
});
|
|
797
|
-
const content = response.content[0];
|
|
798
|
-
result = content.type === "text" ? content.text : "";
|
|
852
|
+
result = await callAnthropic(session.llmClient, model, maxTokens, temperature, dialogHistory);
|
|
799
853
|
}
|
|
800
854
|
dialogHistory.push({ role: "assistant", content: result });
|
|
801
855
|
if (contextVar) {
|
|
802
856
|
setVariable(session, contextVar, dialogHistory, true);
|
|
857
|
+
} else if (saveDialog) {
|
|
858
|
+
setVariable(session, "__llm_dialog__", dialogHistory, true);
|
|
803
859
|
}
|
|
804
860
|
if (session.debug) {
|
|
805
861
|
console.error(`[LLM] Retry ${retryCount} response:
|
|
@@ -876,18 +932,13 @@ ${feedbackPrompt}
|
|
|
876
932
|
messages: dialogHistory
|
|
877
933
|
});
|
|
878
934
|
} else {
|
|
879
|
-
|
|
880
|
-
model,
|
|
881
|
-
max_tokens: maxTokens,
|
|
882
|
-
temperature,
|
|
883
|
-
messages: dialogHistory
|
|
884
|
-
});
|
|
885
|
-
const content = response.content[0];
|
|
886
|
-
result = content.type === "text" ? content.text : "";
|
|
935
|
+
result = await callAnthropic(session.llmClient, model, maxTokens, temperature, dialogHistory);
|
|
887
936
|
}
|
|
888
937
|
dialogHistory.push({ role: "assistant", content: result });
|
|
889
938
|
if (contextVar) {
|
|
890
939
|
setVariable(session, contextVar, dialogHistory, true);
|
|
940
|
+
} else if (saveDialog) {
|
|
941
|
+
setVariable(session, "__llm_dialog__", dialogHistory, true);
|
|
891
942
|
}
|
|
892
943
|
if (session.debug) {
|
|
893
944
|
console.error(`[LLM] Feedback response:
|
|
@@ -1394,7 +1445,7 @@ async function executeTagCheck(session, element) {
|
|
|
1394
1445
|
const executeTag = correctedTag || tagName;
|
|
1395
1446
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1396
1447
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1397
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1448
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1398
1449
|
await integrate2(session, elementToExecute);
|
|
1399
1450
|
}
|
|
1400
1451
|
}
|
|
@@ -1403,7 +1454,7 @@ async function executeTagCheck(session, element) {
|
|
|
1403
1454
|
// src/tags/throw.ts
|
|
1404
1455
|
async function executeThrow(session, element) {
|
|
1405
1456
|
const exceptionName = element.attributes?.name || "exception";
|
|
1406
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1457
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1407
1458
|
const exceptionDom = {
|
|
1408
1459
|
tag: "exception-content",
|
|
1409
1460
|
attributes: { name: exceptionName },
|
|
@@ -1416,7 +1467,7 @@ async function executeThrow(session, element) {
|
|
|
1416
1467
|
// src/tags/try.ts
|
|
1417
1468
|
async function executeTry(session, element) {
|
|
1418
1469
|
setExceptionBoundary(session);
|
|
1419
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1470
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1420
1471
|
await integrateChildren2(session, element);
|
|
1421
1472
|
unsetExceptionBoundary(session);
|
|
1422
1473
|
}
|
|
@@ -1426,7 +1477,7 @@ async function executeCatch(session, element) {
|
|
|
1426
1477
|
const exceptionName = element.attributes?.name || "exception";
|
|
1427
1478
|
const caughtCount = lookupException(session, exceptionName);
|
|
1428
1479
|
if (caughtCount > 0) {
|
|
1429
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1480
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1430
1481
|
await integrateChildren2(session, element);
|
|
1431
1482
|
}
|
|
1432
1483
|
flushCurrentException(session);
|
|
@@ -1435,7 +1486,7 @@ async function executeCatch(session, element) {
|
|
|
1435
1486
|
// src/tags/exception.ts
|
|
1436
1487
|
async function executeException(session, element) {
|
|
1437
1488
|
const exceptions = getCurrentExceptions(session);
|
|
1438
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1489
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1439
1490
|
for (const exceptionDom of exceptions) {
|
|
1440
1491
|
await integrateChildren2(session, exceptionDom);
|
|
1441
1492
|
}
|
|
@@ -1898,7 +1949,7 @@ async function executeLoadContext(session, element) {
|
|
|
1898
1949
|
query = element.text.trim();
|
|
1899
1950
|
}
|
|
1900
1951
|
if (!query && element.children.length > 0) {
|
|
1901
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1952
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
1902
1953
|
const beforeOutput = session.output.length;
|
|
1903
1954
|
for (const child of element.children) {
|
|
1904
1955
|
await integrate2(session, child);
|
|
@@ -2137,7 +2188,7 @@ async function executeForeach(session, element) {
|
|
|
2137
2188
|
const parser2 = new DiracParser2();
|
|
2138
2189
|
try {
|
|
2139
2190
|
const fromElement = parser2.parse(fromAttr);
|
|
2140
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2191
|
+
const { integrate: integrate2 } = await import("./interpreter-NAUTRIK2.js");
|
|
2141
2192
|
await integrate2(session, fromElement);
|
|
2142
2193
|
} catch (e) {
|
|
2143
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