dirac-lang 0.1.66 → 0.1.68
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/{agent-MRVK3EEX.js → agent-VBGWVB6G.js} +2 -2
- package/dist/{chunk-4IFJOZTM.js → chunk-74SZ3727.js} +1 -1
- package/dist/{chunk-YM4HLLAJ.js → chunk-GAGWNYD4.js} +36 -13
- package/dist/{chunk-FYOJQTDE.js → chunk-XVAUVQZU.js} +1 -1
- package/dist/cli.js +9 -9
- package/dist/{cron-UXGC3YC4.js → cron-36B7PK6H.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{interpreter-WTIAZW6A.js → interpreter-KV56UTCS.js} +1 -1
- package/dist/{run-at-PGD5BY5C.js → run-at-SRHVN4IW.js} +1 -1
- package/dist/{schedule-UZKFXZQD.js → schedule-R7CRCLH6.js} +1 -1
- package/dist/{session-server-FWNQKCMU.js → session-server-C63QPABR.js} +2 -2
- package/dist/{shell-UYCIYNMN.js → shell-6Z45ETUO.js} +11 -11
- package/dist/test-runner.js +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
SessionServer,
|
|
3
3
|
getSocketPath,
|
|
4
4
|
isSessionRunning
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-XVAUVQZU.js";
|
|
6
|
+
import "./chunk-GAGWNYD4.js";
|
|
7
7
|
import "./chunk-HRHAMPOB.js";
|
|
8
8
|
import "./chunk-NKA6ZJDV.js";
|
|
9
9
|
import "./chunk-3UW6GWYQ.js";
|
|
@@ -474,12 +474,12 @@ async function executeIf(session, element) {
|
|
|
474
474
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
475
475
|
if (condition) {
|
|
476
476
|
if (thenElement) {
|
|
477
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
477
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
478
478
|
await integrateChildren2(session, thenElement);
|
|
479
479
|
}
|
|
480
480
|
} else {
|
|
481
481
|
if (elseElement) {
|
|
482
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
482
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
483
483
|
await integrateChildren2(session, elseElement);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
@@ -492,7 +492,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
492
492
|
return await evaluateCondition(session, predicateElement);
|
|
493
493
|
}
|
|
494
494
|
const outputLengthBefore = session.output.length;
|
|
495
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
495
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
496
496
|
await integrate2(session, predicateElement);
|
|
497
497
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
498
498
|
const result = newOutputChunks.join("").trim();
|
|
@@ -515,11 +515,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
515
515
|
}
|
|
516
516
|
const outputLengthBefore = session.output.length;
|
|
517
517
|
const args = [];
|
|
518
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
518
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
519
519
|
for (const child of condElement.children) {
|
|
520
520
|
if (child.tag.toLowerCase() === "arg") {
|
|
521
521
|
const argOutputStart = session.output.length;
|
|
522
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
522
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
523
523
|
await integrateChildren2(session, child);
|
|
524
524
|
const newChunks = session.output.slice(argOutputStart);
|
|
525
525
|
const argValue = newChunks.join("");
|
|
@@ -976,7 +976,8 @@ ${result}
|
|
|
976
976
|
const autocorrect = element.attributes["autocorrect"] === "true";
|
|
977
977
|
const maxRetries = parseInt(element.attributes["max-retries"] || "0", 10);
|
|
978
978
|
const feedbackMode = element.attributes["feedback"] === "true";
|
|
979
|
-
const
|
|
979
|
+
const maxIterationsAttr = substituteAttribute(session, element.attributes["max-iterations"] || "3");
|
|
980
|
+
const maxIterations = parseInt(maxIterationsAttr, 10);
|
|
980
981
|
const replaceTick = element.attributes["replace-tick"] === "true";
|
|
981
982
|
if (session.debug) {
|
|
982
983
|
console.error(`[LLM] Executing response as Dirac code:
|
|
@@ -1091,6 +1092,28 @@ ${validation.errorMessages.join("\n")}`);
|
|
|
1091
1092
|
if (iteration === 1) {
|
|
1092
1093
|
dumpGeneratedSubroutines(session, diracCode, userPrompt);
|
|
1093
1094
|
}
|
|
1095
|
+
const onIterationCallback = element.attributes["on-iteration"];
|
|
1096
|
+
if (onIterationCallback && feedbackMode) {
|
|
1097
|
+
if (session.debug) {
|
|
1098
|
+
console.error(`[LLM] Calling on-iteration plugin: ${onIterationCallback}`);
|
|
1099
|
+
}
|
|
1100
|
+
setVariable(session, "__llm_iteration__", iteration.toString(), true);
|
|
1101
|
+
setVariable(session, "__llm_max_iterations__", maxIterations.toString(), true);
|
|
1102
|
+
const callElement = {
|
|
1103
|
+
tag: onIterationCallback,
|
|
1104
|
+
attributes: {},
|
|
1105
|
+
children: [],
|
|
1106
|
+
text: ""
|
|
1107
|
+
};
|
|
1108
|
+
await integrate(session, callElement);
|
|
1109
|
+
const stopRequested = getVariable(session, "__llm_stop_requested__");
|
|
1110
|
+
if (stopRequested === "true") {
|
|
1111
|
+
if (session.debug) {
|
|
1112
|
+
console.error("[LLM] Plugin requested stop");
|
|
1113
|
+
}
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1094
1117
|
if (feedbackMode) {
|
|
1095
1118
|
const outputAfter = session.output.slice();
|
|
1096
1119
|
const executionOutput = outputAfter.slice(outputBefore.length).join("");
|
|
@@ -1717,7 +1740,7 @@ async function executeTagCheck(session, element) {
|
|
|
1717
1740
|
const executeTag = correctedTag || tagName;
|
|
1718
1741
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1719
1742
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1720
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1743
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
1721
1744
|
await integrate2(session, elementToExecute);
|
|
1722
1745
|
}
|
|
1723
1746
|
}
|
|
@@ -1726,7 +1749,7 @@ async function executeTagCheck(session, element) {
|
|
|
1726
1749
|
// src/tags/throw.ts
|
|
1727
1750
|
async function executeThrow(session, element) {
|
|
1728
1751
|
const exceptionName = element.attributes?.name || "exception";
|
|
1729
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1752
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1730
1753
|
const exceptionDom = {
|
|
1731
1754
|
tag: "exception-content",
|
|
1732
1755
|
attributes: { name: exceptionName },
|
|
@@ -1739,7 +1762,7 @@ async function executeThrow(session, element) {
|
|
|
1739
1762
|
// src/tags/try.ts
|
|
1740
1763
|
async function executeTry(session, element) {
|
|
1741
1764
|
setExceptionBoundary(session);
|
|
1742
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1765
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1743
1766
|
await integrateChildren2(session, element);
|
|
1744
1767
|
unsetExceptionBoundary(session);
|
|
1745
1768
|
}
|
|
@@ -1749,7 +1772,7 @@ async function executeCatch(session, element) {
|
|
|
1749
1772
|
const exceptionName = element.attributes?.name || "exception";
|
|
1750
1773
|
const caughtCount = lookupException(session, exceptionName);
|
|
1751
1774
|
if (caughtCount > 0) {
|
|
1752
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1775
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1753
1776
|
await integrateChildren2(session, element);
|
|
1754
1777
|
}
|
|
1755
1778
|
flushCurrentException(session);
|
|
@@ -1758,7 +1781,7 @@ async function executeCatch(session, element) {
|
|
|
1758
1781
|
// src/tags/exception.ts
|
|
1759
1782
|
async function executeException(session, element) {
|
|
1760
1783
|
const exceptions = getCurrentExceptions(session);
|
|
1761
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1784
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1762
1785
|
for (const exceptionDom of exceptions) {
|
|
1763
1786
|
await integrateChildren2(session, exceptionDom);
|
|
1764
1787
|
}
|
|
@@ -2226,7 +2249,7 @@ async function executeLoadContext(session, element) {
|
|
|
2226
2249
|
query = element.text.trim();
|
|
2227
2250
|
}
|
|
2228
2251
|
if (!query && element.children.length > 0) {
|
|
2229
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2252
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
2230
2253
|
const beforeOutput = session.output.length;
|
|
2231
2254
|
for (const child of element.children) {
|
|
2232
2255
|
await integrate2(session, child);
|
|
@@ -2479,7 +2502,7 @@ async function executeForeach(session, element) {
|
|
|
2479
2502
|
const parser2 = new DiracParser2();
|
|
2480
2503
|
try {
|
|
2481
2504
|
const fromElement = parser2.parse(fromAttr);
|
|
2482
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2505
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
2483
2506
|
await integrate2(session, fromElement);
|
|
2484
2507
|
} catch (e) {
|
|
2485
2508
|
session.output = savedOutput;
|
package/dist/cli.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "./chunk-AJSYOXXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
execute
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-74SZ3727.js";
|
|
8
|
+
import "./chunk-GAGWNYD4.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
10
|
import "./chunk-NKA6ZJDV.js";
|
|
11
11
|
import "./chunk-3UW6GWYQ.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.67",
|
|
20
20
|
description: "LLM-Augmented Declarative Execution",
|
|
21
21
|
type: "module",
|
|
22
22
|
main: "dist/index.js",
|
|
@@ -109,7 +109,7 @@ async function main() {
|
|
|
109
109
|
const args = process.argv.slice(2);
|
|
110
110
|
const calledAs = process.argv[1];
|
|
111
111
|
if (calledAs && calledAs.endsWith("/dish")) {
|
|
112
|
-
const { DiracShell } = await import("./shell-
|
|
112
|
+
const { DiracShell } = await import("./shell-6Z45ETUO.js");
|
|
113
113
|
const shellConfig = loadShellConfig(args);
|
|
114
114
|
const shell = new DiracShell(shellConfig);
|
|
115
115
|
await shell.start();
|
|
@@ -158,11 +158,11 @@ async function main() {
|
|
|
158
158
|
if (args[0] === "agent") {
|
|
159
159
|
const subcommand = args[1];
|
|
160
160
|
if (subcommand === "daemon") {
|
|
161
|
-
const { runAgentDaemon } = await import("./agent-
|
|
161
|
+
const { runAgentDaemon } = await import("./agent-VBGWVB6G.js");
|
|
162
162
|
await runAgentDaemon();
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
|
-
const { AgentCLI } = await import("./agent-
|
|
165
|
+
const { AgentCLI } = await import("./agent-VBGWVB6G.js");
|
|
166
166
|
const agent = new AgentCLI();
|
|
167
167
|
switch (subcommand) {
|
|
168
168
|
case "start":
|
|
@@ -189,8 +189,8 @@ async function main() {
|
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
if (args[0] === "shell") {
|
|
192
|
-
const { DiracShell } = await import("./shell-
|
|
193
|
-
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-
|
|
192
|
+
const { DiracShell } = await import("./shell-6Z45ETUO.js");
|
|
193
|
+
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-C63QPABR.js");
|
|
194
194
|
const { SessionClient } = await import("./session-client-3VTC5MLO.js");
|
|
195
195
|
const daemonMode = args.includes("--daemon") || args.includes("-d");
|
|
196
196
|
const agentMode = args.includes("--agent") || args.includes("-a");
|
|
@@ -236,7 +236,7 @@ async function main() {
|
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
238
|
if (args[0] === "daemon") {
|
|
239
|
-
const { SessionServer } = await import("./session-server-
|
|
239
|
+
const { SessionServer } = await import("./session-server-C63QPABR.js");
|
|
240
240
|
const server = new SessionServer();
|
|
241
241
|
await server.start();
|
|
242
242
|
console.log("Session daemon started");
|
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-74SZ3727.js";
|
|
6
6
|
import {
|
|
7
7
|
integrate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GAGWNYD4.js";
|
|
9
9
|
import {
|
|
10
10
|
DiracParser
|
|
11
11
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
SessionServer,
|
|
3
3
|
getSocketPath,
|
|
4
4
|
isSessionRunning
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-XVAUVQZU.js";
|
|
6
|
+
import "./chunk-GAGWNYD4.js";
|
|
7
7
|
import "./chunk-HRHAMPOB.js";
|
|
8
8
|
import "./chunk-NKA6ZJDV.js";
|
|
9
9
|
import "./chunk-3UW6GWYQ.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-AJSYOXXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
integrate
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GAGWNYD4.js";
|
|
8
8
|
import {
|
|
9
9
|
DiracParser
|
|
10
10
|
} from "./chunk-HRHAMPOB.js";
|
|
@@ -280,7 +280,7 @@ var DiracShell = class {
|
|
|
280
280
|
if (this.client) {
|
|
281
281
|
this.client.disconnect();
|
|
282
282
|
}
|
|
283
|
-
import("./schedule-
|
|
283
|
+
import("./schedule-R7CRCLH6.js").then(({ stopAllScheduledTasks }) => {
|
|
284
284
|
stopAllScheduledTasks();
|
|
285
285
|
console.log("\nGoodbye!");
|
|
286
286
|
process.exit(0);
|
|
@@ -646,7 +646,7 @@ Examples:
|
|
|
646
646
|
break;
|
|
647
647
|
case "tasks":
|
|
648
648
|
try {
|
|
649
|
-
const { listScheduledTasks } = await import("./schedule-
|
|
649
|
+
const { listScheduledTasks } = await import("./schedule-R7CRCLH6.js");
|
|
650
650
|
const tasks = listScheduledTasks();
|
|
651
651
|
if (tasks.length === 0) {
|
|
652
652
|
console.log("No scheduled tasks running.");
|
|
@@ -665,7 +665,7 @@ Examples:
|
|
|
665
665
|
console.log("Usage: :stop <task-name>");
|
|
666
666
|
} else {
|
|
667
667
|
try {
|
|
668
|
-
const { stopScheduledTask } = await import("./schedule-
|
|
668
|
+
const { stopScheduledTask } = await import("./schedule-R7CRCLH6.js");
|
|
669
669
|
const taskName = args[0];
|
|
670
670
|
const stopped = stopScheduledTask(taskName);
|
|
671
671
|
if (stopped) {
|
|
@@ -680,7 +680,7 @@ Examples:
|
|
|
680
680
|
break;
|
|
681
681
|
case "stopall":
|
|
682
682
|
try {
|
|
683
|
-
const { stopAllScheduledTasks } = await import("./schedule-
|
|
683
|
+
const { stopAllScheduledTasks } = await import("./schedule-R7CRCLH6.js");
|
|
684
684
|
stopAllScheduledTasks();
|
|
685
685
|
console.log("All scheduled tasks stopped.");
|
|
686
686
|
} catch (error) {
|
|
@@ -689,7 +689,7 @@ Examples:
|
|
|
689
689
|
break;
|
|
690
690
|
case "crons":
|
|
691
691
|
try {
|
|
692
|
-
const { listCronJobs } = await import("./cron-
|
|
692
|
+
const { listCronJobs } = await import("./cron-36B7PK6H.js");
|
|
693
693
|
const jobs = listCronJobs();
|
|
694
694
|
if (jobs.length === 0) {
|
|
695
695
|
console.log("No cron jobs running.");
|
|
@@ -709,7 +709,7 @@ Examples:
|
|
|
709
709
|
console.log("Usage: :stopcron <job-name>");
|
|
710
710
|
} else {
|
|
711
711
|
try {
|
|
712
|
-
const { stopCronJob } = await import("./cron-
|
|
712
|
+
const { stopCronJob } = await import("./cron-36B7PK6H.js");
|
|
713
713
|
const jobName = args[0];
|
|
714
714
|
const stopped = stopCronJob(jobName);
|
|
715
715
|
if (stopped) {
|
|
@@ -724,7 +724,7 @@ Examples:
|
|
|
724
724
|
break;
|
|
725
725
|
case "stopallcrons":
|
|
726
726
|
try {
|
|
727
|
-
const { stopAllCronJobs } = await import("./cron-
|
|
727
|
+
const { stopAllCronJobs } = await import("./cron-36B7PK6H.js");
|
|
728
728
|
stopAllCronJobs();
|
|
729
729
|
console.log("All cron jobs stopped.");
|
|
730
730
|
} catch (error) {
|
|
@@ -733,7 +733,7 @@ Examples:
|
|
|
733
733
|
break;
|
|
734
734
|
case "scheduled":
|
|
735
735
|
try {
|
|
736
|
-
const { listScheduledRuns } = await import("./run-at-
|
|
736
|
+
const { listScheduledRuns } = await import("./run-at-SRHVN4IW.js");
|
|
737
737
|
const runs = listScheduledRuns();
|
|
738
738
|
if (runs.length === 0) {
|
|
739
739
|
console.log("No scheduled runs pending.");
|
|
@@ -753,7 +753,7 @@ Examples:
|
|
|
753
753
|
console.log("Usage: :cancel <run-name>");
|
|
754
754
|
} else {
|
|
755
755
|
try {
|
|
756
|
-
const { cancelScheduledRun } = await import("./run-at-
|
|
756
|
+
const { cancelScheduledRun } = await import("./run-at-SRHVN4IW.js");
|
|
757
757
|
const runName = args[0];
|
|
758
758
|
const cancelled = cancelScheduledRun(runName);
|
|
759
759
|
if (cancelled) {
|
|
@@ -768,7 +768,7 @@ Examples:
|
|
|
768
768
|
break;
|
|
769
769
|
case "cancelall":
|
|
770
770
|
try {
|
|
771
|
-
const { cancelAllScheduledRuns } = await import("./run-at-
|
|
771
|
+
const { cancelAllScheduledRuns } = await import("./run-at-SRHVN4IW.js");
|
|
772
772
|
cancelAllScheduledRuns();
|
|
773
773
|
console.log("All scheduled runs cancelled.");
|
|
774
774
|
} catch (error) {
|
package/dist/test-runner.js
CHANGED