dirac-lang 0.1.55 → 0.1.57
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-EXP3R5ZJ.js → chunk-5FKZ3N7C.js} +2 -2
- package/dist/{chunk-C6DBZRQZ.js → chunk-AJSYOXXZ.js} +3 -0
- package/dist/{chunk-A4SFB5W4.js → chunk-IN55WRFB.js} +2 -0
- package/dist/{chunk-QZGTAT3E.js → chunk-WQ2KRQAR.js} +90 -36
- package/dist/{chunk-ZY37RS4P.js → chunk-WX7VHQYL.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/index.js +4 -4
- package/dist/{interpreter-I4SRKXYK.js → interpreter-WVPCPGVL.js} +3 -3
- package/dist/{schedule-7ZFCWNEF.js → schedule-VYFEIUQE.js} +3 -3
- package/dist/{session-5PEIMBGV.js → session-MRU57VMJ.js} +1 -1
- package/dist/{shell-WXBGAGAP.js → shell-QA7NY73L.js} +8 -8
- package/dist/{subroutine-VIACWZPF.js → subroutine-RBTBNR2T.js} +2 -2
- package/dist/{tag-validator-AZXYIKQV.js → tag-validator-BTBNFPJD.js} +1 -1
- package/dist/test-runner.js +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
integrate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WQ2KRQAR.js";
|
|
4
4
|
import {
|
|
5
5
|
DiracParser
|
|
6
6
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
createSession,
|
|
9
9
|
getAvailableSubroutines,
|
|
10
10
|
getOutput
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IN55WRFB.js";
|
|
12
12
|
|
|
13
13
|
// src/utils/llm-adapter.ts
|
|
14
14
|
function createLLMAdapter(session) {
|
|
@@ -73,6 +73,9 @@ var BraKetParser = class {
|
|
|
73
73
|
if (!content.trim()) {
|
|
74
74
|
return { indent, type: "empty", raw };
|
|
75
75
|
}
|
|
76
|
+
if (content.startsWith("#")) {
|
|
77
|
+
return { indent, type: "empty", raw };
|
|
78
|
+
}
|
|
76
79
|
if (content.startsWith("<") && content.endsWith("|")) {
|
|
77
80
|
const tagMatch = content.match(/^<([a-zA-Z_][a-zA-Z0-9_-]*)\s*/);
|
|
78
81
|
if (tagMatch) {
|
|
@@ -3,8 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-HRHAMPOB.js";
|
|
4
4
|
import {
|
|
5
5
|
executeSubroutine
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WX7VHQYL.js";
|
|
7
7
|
import {
|
|
8
|
+
CustomLLMProvider,
|
|
9
|
+
OllamaProvider,
|
|
8
10
|
cleanSubroutinesToBoundary,
|
|
9
11
|
cleanToBoundary,
|
|
10
12
|
emit,
|
|
@@ -26,7 +28,7 @@ import {
|
|
|
26
28
|
substituteVariables,
|
|
27
29
|
throwException,
|
|
28
30
|
unsetExceptionBoundary
|
|
29
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-IN55WRFB.js";
|
|
30
32
|
|
|
31
33
|
// src/tags/parameters.ts
|
|
32
34
|
async function executeParameters(session, element) {
|
|
@@ -282,7 +284,7 @@ async function executeCall(session, element) {
|
|
|
282
284
|
}
|
|
283
285
|
}
|
|
284
286
|
async function registerExtendChain(session, subroutine, currentName) {
|
|
285
|
-
const { executeSubroutine: executeSubroutine2 } = await import("./subroutine-
|
|
287
|
+
const { executeSubroutine: executeSubroutine2 } = await import("./subroutine-RBTBNR2T.js");
|
|
286
288
|
const extendsAttr = subroutine.attributes.extends;
|
|
287
289
|
let parentName;
|
|
288
290
|
if (extendsAttr) {
|
|
@@ -472,12 +474,12 @@ async function executeIf(session, element) {
|
|
|
472
474
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
473
475
|
if (condition) {
|
|
474
476
|
if (thenElement) {
|
|
475
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
477
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-WVPCPGVL.js");
|
|
476
478
|
await integrateChildren2(session, thenElement);
|
|
477
479
|
}
|
|
478
480
|
} else {
|
|
479
481
|
if (elseElement) {
|
|
480
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
482
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-WVPCPGVL.js");
|
|
481
483
|
await integrateChildren2(session, elseElement);
|
|
482
484
|
}
|
|
483
485
|
}
|
|
@@ -490,7 +492,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
490
492
|
return await evaluateCondition(session, predicateElement);
|
|
491
493
|
}
|
|
492
494
|
const outputLengthBefore = session.output.length;
|
|
493
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
495
|
+
const { integrate: integrate2 } = await import("./interpreter-WVPCPGVL.js");
|
|
494
496
|
await integrate2(session, predicateElement);
|
|
495
497
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
496
498
|
const result = newOutputChunks.join("").trim();
|
|
@@ -513,11 +515,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
513
515
|
}
|
|
514
516
|
const outputLengthBefore = session.output.length;
|
|
515
517
|
const args = [];
|
|
516
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
518
|
+
const { integrate: integrate2 } = await import("./interpreter-WVPCPGVL.js");
|
|
517
519
|
for (const child of condElement.children) {
|
|
518
520
|
if (child.tag.toLowerCase() === "arg") {
|
|
519
521
|
const argOutputStart = session.output.length;
|
|
520
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
522
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-WVPCPGVL.js");
|
|
521
523
|
await integrateChildren2(session, child);
|
|
522
524
|
const newChunks = session.output.slice(argOutputStart);
|
|
523
525
|
const argValue = newChunks.join("");
|
|
@@ -576,9 +578,31 @@ function evaluateConditionType(evalType, args) {
|
|
|
576
578
|
}
|
|
577
579
|
|
|
578
580
|
// src/tags/llm.ts
|
|
581
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
582
|
+
import OpenAI from "openai";
|
|
579
583
|
import * as fs2 from "fs";
|
|
580
584
|
import * as path2 from "path";
|
|
581
585
|
import * as os from "os";
|
|
586
|
+
function createLLMClient(provider, model) {
|
|
587
|
+
const anthropicKey = process.env.ANTHROPIC_API_KEY;
|
|
588
|
+
const openaiKey = process.env.OPENAI_API_KEY;
|
|
589
|
+
const ollamaModel = model || process.env.LLM_MODEL || "llama2";
|
|
590
|
+
const customBaseUrl = process.env.CUSTOM_LLM_URL || "http://localhost:5001";
|
|
591
|
+
switch (provider) {
|
|
592
|
+
case "ollama":
|
|
593
|
+
return new OllamaProvider({ model: ollamaModel });
|
|
594
|
+
case "anthropic":
|
|
595
|
+
if (!anthropicKey) throw new Error("ANTHROPIC_API_KEY required for Anthropic provider");
|
|
596
|
+
return new Anthropic({ apiKey: anthropicKey });
|
|
597
|
+
case "openai":
|
|
598
|
+
if (!openaiKey) throw new Error("OPENAI_API_KEY required for OpenAI provider");
|
|
599
|
+
return new OpenAI({ apiKey: openaiKey });
|
|
600
|
+
case "custom":
|
|
601
|
+
return new CustomLLMProvider({ baseUrl: customBaseUrl, model: ollamaModel });
|
|
602
|
+
default:
|
|
603
|
+
throw new Error(`Unknown LLM provider: ${provider}. Use 'ollama', 'anthropic', 'openai', or 'custom'.`);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
582
606
|
function dumpGeneratedSubroutines(session, diracCode, userPrompt) {
|
|
583
607
|
try {
|
|
584
608
|
let findSubroutines2 = function(element) {
|
|
@@ -687,7 +711,19 @@ async function executeLLM(session, element) {
|
|
|
687
711
|
throw new Error("Maximum LLM calls exceeded");
|
|
688
712
|
}
|
|
689
713
|
session.limits.currentLLMCalls++;
|
|
690
|
-
const
|
|
714
|
+
const requestedProvider = element.attributes.provider;
|
|
715
|
+
let llmClient = session.llmClient;
|
|
716
|
+
if (requestedProvider) {
|
|
717
|
+
const requestedModel = element.attributes.model || process.env.DEFAULT_MODEL;
|
|
718
|
+
llmClient = createLLMClient(requestedProvider, requestedModel);
|
|
719
|
+
if (session.debug) {
|
|
720
|
+
console.error(`[LLM] Switching to provider: ${requestedProvider}`);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
if (!llmClient) {
|
|
724
|
+
throw new Error("No LLM provider configured. Set provider attribute or configure session with LLM_PROVIDER.");
|
|
725
|
+
}
|
|
726
|
+
const providerName = llmClient.constructor.name;
|
|
691
727
|
const isOpenAI = providerName === "OpenAI";
|
|
692
728
|
const isOllama = providerName === "OllamaProvider";
|
|
693
729
|
const isCustom = providerName === "CustomLLMProvider";
|
|
@@ -729,21 +765,39 @@ async function executeLLM(session, element) {
|
|
|
729
765
|
dialogHistory = [...existing];
|
|
730
766
|
hasExistingDialog = dialogHistory.length > 0;
|
|
731
767
|
} else if (existing) {
|
|
732
|
-
|
|
733
|
-
|
|
768
|
+
try {
|
|
769
|
+
const parsed = JSON.parse(String(existing));
|
|
770
|
+
if (Array.isArray(parsed)) {
|
|
771
|
+
dialogHistory = parsed;
|
|
772
|
+
hasExistingDialog = dialogHistory.length > 0;
|
|
773
|
+
} else {
|
|
774
|
+
dialogHistory = [{ role: "system", content: String(existing) }];
|
|
775
|
+
hasExistingDialog = true;
|
|
776
|
+
}
|
|
777
|
+
} catch {
|
|
778
|
+
dialogHistory = [{ role: "system", content: String(existing) }];
|
|
779
|
+
hasExistingDialog = true;
|
|
780
|
+
}
|
|
734
781
|
}
|
|
735
782
|
}
|
|
736
783
|
const noExtra = element.attributes.noextra === "true";
|
|
737
784
|
let systemPrompt = "";
|
|
738
785
|
let currentUserPrompt = userPrompt;
|
|
739
786
|
if (!noExtra) {
|
|
740
|
-
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-
|
|
741
|
-
const
|
|
787
|
+
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-MRU57VMJ.js");
|
|
788
|
+
const allSubroutines = getAvailableSubroutines2(session);
|
|
789
|
+
const subroutines = allSubroutines.filter((sub) => {
|
|
790
|
+
const hideMeta = sub.meta?.["hide-from-llm"];
|
|
791
|
+
return hideMeta !== "true" && hideMeta !== true;
|
|
792
|
+
});
|
|
742
793
|
if (session.debug) {
|
|
743
794
|
console.error(
|
|
744
795
|
"[LLM] Subroutines available at prompt composition:",
|
|
745
796
|
subroutines.map((s) => ({ name: s.name, description: s.description, parameters: s.parameters }))
|
|
746
797
|
);
|
|
798
|
+
if (allSubroutines.length !== subroutines.length) {
|
|
799
|
+
console.error(`[LLM] Filtered out ${allSubroutines.length - subroutines.length} subroutine(s) with hide-from-llm metadata`);
|
|
800
|
+
}
|
|
747
801
|
}
|
|
748
802
|
if (hasExistingDialog && (contextVar || saveDialog)) {
|
|
749
803
|
systemPrompt = "Updated available Dirac XML tags:";
|
|
@@ -828,7 +882,7 @@ CRITICAL: When defining parameters:
|
|
|
828
882
|
try {
|
|
829
883
|
let result;
|
|
830
884
|
if (isOpenAI) {
|
|
831
|
-
const response = await
|
|
885
|
+
const response = await llmClient.chat.completions.create({
|
|
832
886
|
model,
|
|
833
887
|
max_tokens: maxTokens,
|
|
834
888
|
temperature,
|
|
@@ -837,21 +891,21 @@ CRITICAL: When defining parameters:
|
|
|
837
891
|
result = response.choices[0]?.message?.content || "";
|
|
838
892
|
} else if (isOllama) {
|
|
839
893
|
const ollamaPrompt = dialogHistory.map((m) => `${m.role.charAt(0).toUpperCase() + m.role.slice(1)}: ${m.content}`).join("\n");
|
|
840
|
-
result = await
|
|
894
|
+
result = await llmClient.complete(ollamaPrompt, {
|
|
841
895
|
model,
|
|
842
896
|
temperature,
|
|
843
897
|
max_tokens: maxTokens
|
|
844
898
|
});
|
|
845
899
|
} else if (isCustom) {
|
|
846
900
|
const customPrompt = dialogHistory.map((m) => `${m.role}: ${m.content}`).join("\n");
|
|
847
|
-
result = await
|
|
901
|
+
result = await llmClient.complete(customPrompt, {
|
|
848
902
|
model,
|
|
849
903
|
temperature,
|
|
850
904
|
max_tokens: maxTokens,
|
|
851
905
|
messages: dialogHistory
|
|
852
906
|
});
|
|
853
907
|
} else {
|
|
854
|
-
result = await callAnthropic(
|
|
908
|
+
result = await callAnthropic(llmClient, model, maxTokens, temperature, dialogHistory);
|
|
855
909
|
}
|
|
856
910
|
if (session.debug) {
|
|
857
911
|
console.error(`[LLM] Response length: ${result.length}`);
|
|
@@ -865,7 +919,7 @@ ${result}
|
|
|
865
919
|
if (session.debug) {
|
|
866
920
|
console.error(`[LLM] Saving dialog history (${dialogHistory.length} messages) to: ${varName}`);
|
|
867
921
|
}
|
|
868
|
-
setVariable(session, varName, dialogHistory, true);
|
|
922
|
+
setVariable(session, varName, JSON.stringify(dialogHistory), true);
|
|
869
923
|
}
|
|
870
924
|
if (outputVar) {
|
|
871
925
|
setVariable(session, outputVar, result, false);
|
|
@@ -909,7 +963,7 @@ ${result}
|
|
|
909
963
|
const parser = new DiracParser();
|
|
910
964
|
let dynamicAST = parser.parse(diracCode);
|
|
911
965
|
if (validateTags) {
|
|
912
|
-
const { validateDiracCode, applyCorrectedTags } = await import("./tag-validator-
|
|
966
|
+
const { validateDiracCode, applyCorrectedTags } = await import("./tag-validator-BTBNFPJD.js");
|
|
913
967
|
let validation = await validateDiracCode(session, dynamicAST, { autocorrect });
|
|
914
968
|
let retryCount = 0;
|
|
915
969
|
while (!validation.valid && retryCount < maxRetries) {
|
|
@@ -924,7 +978,7 @@ ${errorFeedback}
|
|
|
924
978
|
Please fix these errors and generate valid Dirac XML again. Remember to only use the allowed tags.`;
|
|
925
979
|
dialogHistory.push({ role: "user", content: retryPrompt });
|
|
926
980
|
if (isOpenAI) {
|
|
927
|
-
const response = await
|
|
981
|
+
const response = await llmClient.chat.completions.create({
|
|
928
982
|
model,
|
|
929
983
|
max_tokens: maxTokens,
|
|
930
984
|
temperature,
|
|
@@ -933,21 +987,21 @@ Please fix these errors and generate valid Dirac XML again. Remember to only use
|
|
|
933
987
|
result = response.choices[0]?.message?.content || "";
|
|
934
988
|
} else if (isOllama) {
|
|
935
989
|
const ollamaPrompt = dialogHistory.map((m) => `${m.role.charAt(0).toUpperCase() + m.role.slice(1)}: ${m.content}`).join("\n");
|
|
936
|
-
result = await
|
|
990
|
+
result = await llmClient.complete(ollamaPrompt, {
|
|
937
991
|
model,
|
|
938
992
|
temperature,
|
|
939
993
|
max_tokens: maxTokens
|
|
940
994
|
});
|
|
941
995
|
} else if (isCustom) {
|
|
942
996
|
const customPrompt = dialogHistory.map((m) => `${m.role}: ${m.content}`).join("\n");
|
|
943
|
-
result = await
|
|
997
|
+
result = await llmClient.complete(customPrompt, {
|
|
944
998
|
model,
|
|
945
999
|
temperature,
|
|
946
1000
|
max_tokens: maxTokens,
|
|
947
1001
|
messages: dialogHistory
|
|
948
1002
|
});
|
|
949
1003
|
} else {
|
|
950
|
-
result = await callAnthropic(
|
|
1004
|
+
result = await callAnthropic(llmClient, model, maxTokens, temperature, dialogHistory);
|
|
951
1005
|
}
|
|
952
1006
|
dialogHistory.push({ role: "assistant", content: result });
|
|
953
1007
|
if (contextVar) {
|
|
@@ -1010,7 +1064,7 @@ ${feedbackPrompt}
|
|
|
1010
1064
|
}
|
|
1011
1065
|
dialogHistory.push({ role: "user", content: feedbackPrompt });
|
|
1012
1066
|
if (isOpenAI) {
|
|
1013
|
-
const response = await
|
|
1067
|
+
const response = await llmClient.chat.completions.create({
|
|
1014
1068
|
model,
|
|
1015
1069
|
max_tokens: maxTokens,
|
|
1016
1070
|
temperature,
|
|
@@ -1019,21 +1073,21 @@ ${feedbackPrompt}
|
|
|
1019
1073
|
result = response.choices[0]?.message?.content || "";
|
|
1020
1074
|
} else if (isOllama) {
|
|
1021
1075
|
const ollamaPrompt = dialogHistory.map((m) => `${m.role.charAt(0).toUpperCase() + m.role.slice(1)}: ${m.content}`).join("\n");
|
|
1022
|
-
result = await
|
|
1076
|
+
result = await llmClient.complete(ollamaPrompt, {
|
|
1023
1077
|
model,
|
|
1024
1078
|
temperature,
|
|
1025
1079
|
max_tokens: maxTokens
|
|
1026
1080
|
});
|
|
1027
1081
|
} else if (isCustom) {
|
|
1028
1082
|
const customPrompt = dialogHistory.map((m) => `${m.role}: ${m.content}`).join("\n");
|
|
1029
|
-
result = await
|
|
1083
|
+
result = await llmClient.complete(customPrompt, {
|
|
1030
1084
|
model,
|
|
1031
1085
|
temperature,
|
|
1032
1086
|
max_tokens: maxTokens,
|
|
1033
1087
|
messages: dialogHistory
|
|
1034
1088
|
});
|
|
1035
1089
|
} else {
|
|
1036
|
-
result = await callAnthropic(
|
|
1090
|
+
result = await callAnthropic(llmClient, model, maxTokens, temperature, dialogHistory);
|
|
1037
1091
|
}
|
|
1038
1092
|
dialogHistory.push({ role: "assistant", content: result });
|
|
1039
1093
|
if (contextVar) {
|
|
@@ -1520,7 +1574,7 @@ async function getBestTagMatch(candidate, allowed) {
|
|
|
1520
1574
|
return { tag: allowed[bestIdx], score: bestScore };
|
|
1521
1575
|
}
|
|
1522
1576
|
async function executeTagCheck(session, element) {
|
|
1523
|
-
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-
|
|
1577
|
+
const { getAvailableSubroutines: getAvailableSubroutines2 } = await import("./session-MRU57VMJ.js");
|
|
1524
1578
|
const subroutines = getAvailableSubroutines2(session);
|
|
1525
1579
|
const allowed = new Set(subroutines.map((s) => s.name));
|
|
1526
1580
|
console.error("[tag-check] Allowed subroutines:", Array.from(allowed));
|
|
@@ -1613,7 +1667,7 @@ async function executeTagCheck(session, element) {
|
|
|
1613
1667
|
const executeTag = correctedTag || tagName;
|
|
1614
1668
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1615
1669
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1616
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1670
|
+
const { integrate: integrate2 } = await import("./interpreter-WVPCPGVL.js");
|
|
1617
1671
|
await integrate2(session, elementToExecute);
|
|
1618
1672
|
}
|
|
1619
1673
|
}
|
|
@@ -1622,7 +1676,7 @@ async function executeTagCheck(session, element) {
|
|
|
1622
1676
|
// src/tags/throw.ts
|
|
1623
1677
|
async function executeThrow(session, element) {
|
|
1624
1678
|
const exceptionName = element.attributes?.name || "exception";
|
|
1625
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1679
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-WVPCPGVL.js");
|
|
1626
1680
|
const exceptionDom = {
|
|
1627
1681
|
tag: "exception-content",
|
|
1628
1682
|
attributes: { name: exceptionName },
|
|
@@ -1635,7 +1689,7 @@ async function executeThrow(session, element) {
|
|
|
1635
1689
|
// src/tags/try.ts
|
|
1636
1690
|
async function executeTry(session, element) {
|
|
1637
1691
|
setExceptionBoundary(session);
|
|
1638
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1692
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-WVPCPGVL.js");
|
|
1639
1693
|
await integrateChildren2(session, element);
|
|
1640
1694
|
unsetExceptionBoundary(session);
|
|
1641
1695
|
}
|
|
@@ -1645,7 +1699,7 @@ async function executeCatch(session, element) {
|
|
|
1645
1699
|
const exceptionName = element.attributes?.name || "exception";
|
|
1646
1700
|
const caughtCount = lookupException(session, exceptionName);
|
|
1647
1701
|
if (caughtCount > 0) {
|
|
1648
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1702
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-WVPCPGVL.js");
|
|
1649
1703
|
await integrateChildren2(session, element);
|
|
1650
1704
|
}
|
|
1651
1705
|
flushCurrentException(session);
|
|
@@ -1654,7 +1708,7 @@ async function executeCatch(session, element) {
|
|
|
1654
1708
|
// src/tags/exception.ts
|
|
1655
1709
|
async function executeException(session, element) {
|
|
1656
1710
|
const exceptions = getCurrentExceptions(session);
|
|
1657
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1711
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-WVPCPGVL.js");
|
|
1658
1712
|
for (const exceptionDom of exceptions) {
|
|
1659
1713
|
await integrateChildren2(session, exceptionDom);
|
|
1660
1714
|
}
|
|
@@ -2122,7 +2176,7 @@ async function executeLoadContext(session, element) {
|
|
|
2122
2176
|
query = element.text.trim();
|
|
2123
2177
|
}
|
|
2124
2178
|
if (!query && element.children.length > 0) {
|
|
2125
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2179
|
+
const { integrate: integrate2 } = await import("./interpreter-WVPCPGVL.js");
|
|
2126
2180
|
const beforeOutput = session.output.length;
|
|
2127
2181
|
for (const child of element.children) {
|
|
2128
2182
|
await integrate2(session, child);
|
|
@@ -2191,7 +2245,7 @@ async function executeLoadContext(session, element) {
|
|
|
2191
2245
|
parameters: s.parameters.map((p) => p.name),
|
|
2192
2246
|
filePath: s.filePath
|
|
2193
2247
|
}));
|
|
2194
|
-
const { setVariable: setVariable2 } = await import("./session-
|
|
2248
|
+
const { setVariable: setVariable2 } = await import("./session-MRU57VMJ.js");
|
|
2195
2249
|
setVariable2(session, outputVar, JSON.stringify(summary, null, 2), false);
|
|
2196
2250
|
}
|
|
2197
2251
|
}
|
|
@@ -2375,7 +2429,7 @@ async function executeForeach(session, element) {
|
|
|
2375
2429
|
const parser2 = new DiracParser2();
|
|
2376
2430
|
try {
|
|
2377
2431
|
const fromElement = parser2.parse(fromAttr);
|
|
2378
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2432
|
+
const { integrate: integrate2 } = await import("./interpreter-WVPCPGVL.js");
|
|
2379
2433
|
await integrate2(session, fromElement);
|
|
2380
2434
|
} catch (e) {
|
|
2381
2435
|
session.output = savedOutput;
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BraKetParser
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AJSYOXXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
execute
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-5FKZ3N7C.js";
|
|
8
|
+
import "./chunk-WQ2KRQAR.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-WX7VHQYL.js";
|
|
11
|
+
import "./chunk-IN55WRFB.js";
|
|
12
12
|
|
|
13
13
|
// src/cli.ts
|
|
14
14
|
import "dotenv/config";
|
|
@@ -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.57",
|
|
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-QA7NY73L.js");
|
|
100
100
|
const shellConfig = { debug: false };
|
|
101
101
|
for (let i = 1; i < args.length; i++) {
|
|
102
102
|
const arg = args[i];
|
package/dist/index.js
CHANGED
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
createLLMAdapter,
|
|
3
3
|
execute,
|
|
4
4
|
executeUserCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5FKZ3N7C.js";
|
|
6
6
|
import {
|
|
7
7
|
integrate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WQ2KRQAR.js";
|
|
9
9
|
import {
|
|
10
10
|
DiracParser
|
|
11
11
|
} from "./chunk-HRHAMPOB.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-WX7VHQYL.js";
|
|
13
13
|
import {
|
|
14
14
|
createSession,
|
|
15
15
|
getAvailableSubroutines,
|
|
16
16
|
getOutput
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IN55WRFB.js";
|
|
18
18
|
export {
|
|
19
19
|
DiracParser,
|
|
20
20
|
createLLMAdapter,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
integrate,
|
|
3
3
|
integrateChildren
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WQ2KRQAR.js";
|
|
5
5
|
import "./chunk-HRHAMPOB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-WX7VHQYL.js";
|
|
7
|
+
import "./chunk-IN55WRFB.js";
|
|
8
8
|
export {
|
|
9
9
|
integrate,
|
|
10
10
|
integrateChildren
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
listScheduledTasks,
|
|
4
4
|
stopAllScheduledTasks,
|
|
5
5
|
stopScheduledTask
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WQ2KRQAR.js";
|
|
7
7
|
import "./chunk-HRHAMPOB.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-WX7VHQYL.js";
|
|
9
|
+
import "./chunk-IN55WRFB.js";
|
|
10
10
|
export {
|
|
11
11
|
executeSchedule,
|
|
12
12
|
listScheduledTasks,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BraKetParser
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AJSYOXXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
integrate
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WQ2KRQAR.js";
|
|
8
8
|
import {
|
|
9
9
|
DiracParser
|
|
10
10
|
} from "./chunk-HRHAMPOB.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-WX7VHQYL.js";
|
|
12
12
|
import {
|
|
13
13
|
createSession
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IN55WRFB.js";
|
|
15
15
|
|
|
16
16
|
// src/shell.ts
|
|
17
17
|
import * as readline from "readline";
|
|
@@ -150,7 +150,7 @@ var DiracShell = class {
|
|
|
150
150
|
});
|
|
151
151
|
this.rl.on("close", () => {
|
|
152
152
|
this.saveHistory();
|
|
153
|
-
import("./schedule-
|
|
153
|
+
import("./schedule-VYFEIUQE.js").then(({ stopAllScheduledTasks }) => {
|
|
154
154
|
stopAllScheduledTasks();
|
|
155
155
|
console.log("\nGoodbye!");
|
|
156
156
|
process.exit(0);
|
|
@@ -471,7 +471,7 @@ Examples:
|
|
|
471
471
|
break;
|
|
472
472
|
case "tasks":
|
|
473
473
|
try {
|
|
474
|
-
const { listScheduledTasks } = await import("./schedule-
|
|
474
|
+
const { listScheduledTasks } = await import("./schedule-VYFEIUQE.js");
|
|
475
475
|
const tasks = listScheduledTasks();
|
|
476
476
|
if (tasks.length === 0) {
|
|
477
477
|
console.log("No scheduled tasks running.");
|
|
@@ -490,7 +490,7 @@ Examples:
|
|
|
490
490
|
console.log("Usage: :stop <task-name>");
|
|
491
491
|
} else {
|
|
492
492
|
try {
|
|
493
|
-
const { stopScheduledTask } = await import("./schedule-
|
|
493
|
+
const { stopScheduledTask } = await import("./schedule-VYFEIUQE.js");
|
|
494
494
|
const taskName = args[0];
|
|
495
495
|
const stopped = stopScheduledTask(taskName);
|
|
496
496
|
if (stopped) {
|
|
@@ -505,7 +505,7 @@ Examples:
|
|
|
505
505
|
break;
|
|
506
506
|
case "stopall":
|
|
507
507
|
try {
|
|
508
|
-
const { stopAllScheduledTasks } = await import("./schedule-
|
|
508
|
+
const { stopAllScheduledTasks } = await import("./schedule-VYFEIUQE.js");
|
|
509
509
|
stopAllScheduledTasks();
|
|
510
510
|
console.log("All scheduled tasks stopped.");
|
|
511
511
|
} catch (error) {
|
|
@@ -49,7 +49,7 @@ async function getBestTagMatch(candidate, allowed) {
|
|
|
49
49
|
}
|
|
50
50
|
async function validateTag(session, element, options = {}) {
|
|
51
51
|
const { autocorrect = false, similarityCutoff = SIMILARITY_CUTOFF } = options;
|
|
52
|
-
const { getAvailableSubroutines } = await import("./session-
|
|
52
|
+
const { getAvailableSubroutines } = await import("./session-MRU57VMJ.js");
|
|
53
53
|
const subroutines = getAvailableSubroutines(session);
|
|
54
54
|
const allowed = new Set(subroutines.map((s) => s.name));
|
|
55
55
|
const tagName = element.tag;
|
package/dist/test-runner.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
integrate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WQ2KRQAR.js";
|
|
4
4
|
import {
|
|
5
5
|
DiracParser
|
|
6
6
|
} from "./chunk-HRHAMPOB.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-WX7VHQYL.js";
|
|
8
8
|
import {
|
|
9
9
|
createSession,
|
|
10
10
|
getOutput
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IN55WRFB.js";
|
|
12
12
|
|
|
13
13
|
// src/test-runner.ts
|
|
14
14
|
import fs from "fs";
|