dirac-lang 0.1.67 → 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-Y5D5SMAS.js → agent-VBGWVB6G.js} +2 -2
- package/dist/{chunk-3IC2OMWT.js → chunk-74SZ3727.js} +1 -1
- package/dist/{chunk-XNH4TU3Q.js → chunk-GAGWNYD4.js} +34 -12
- package/dist/{chunk-6OIMDS6G.js → chunk-XVAUVQZU.js} +1 -1
- package/dist/cli.js +9 -9
- package/dist/{cron-J54RKLKD.js → cron-36B7PK6H.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{interpreter-TDPDELJC.js → interpreter-KV56UTCS.js} +1 -1
- package/dist/{run-at-GX2JTTG4.js → run-at-SRHVN4IW.js} +1 -1
- package/dist/{schedule-U4S53I4N.js → schedule-R7CRCLH6.js} +1 -1
- package/dist/{session-server-RZYUXJFQ.js → session-server-C63QPABR.js} +2 -2
- package/dist/{shell-YYSQKOZV.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("");
|
|
@@ -1092,6 +1092,28 @@ ${validation.errorMessages.join("\n")}`);
|
|
|
1092
1092
|
if (iteration === 1) {
|
|
1093
1093
|
dumpGeneratedSubroutines(session, diracCode, userPrompt);
|
|
1094
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
|
+
}
|
|
1095
1117
|
if (feedbackMode) {
|
|
1096
1118
|
const outputAfter = session.output.slice();
|
|
1097
1119
|
const executionOutput = outputAfter.slice(outputBefore.length).join("");
|
|
@@ -1718,7 +1740,7 @@ async function executeTagCheck(session, element) {
|
|
|
1718
1740
|
const executeTag = correctedTag || tagName;
|
|
1719
1741
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1720
1742
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1721
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1743
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
1722
1744
|
await integrate2(session, elementToExecute);
|
|
1723
1745
|
}
|
|
1724
1746
|
}
|
|
@@ -1727,7 +1749,7 @@ async function executeTagCheck(session, element) {
|
|
|
1727
1749
|
// src/tags/throw.ts
|
|
1728
1750
|
async function executeThrow(session, element) {
|
|
1729
1751
|
const exceptionName = element.attributes?.name || "exception";
|
|
1730
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1752
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1731
1753
|
const exceptionDom = {
|
|
1732
1754
|
tag: "exception-content",
|
|
1733
1755
|
attributes: { name: exceptionName },
|
|
@@ -1740,7 +1762,7 @@ async function executeThrow(session, element) {
|
|
|
1740
1762
|
// src/tags/try.ts
|
|
1741
1763
|
async function executeTry(session, element) {
|
|
1742
1764
|
setExceptionBoundary(session);
|
|
1743
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1765
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1744
1766
|
await integrateChildren2(session, element);
|
|
1745
1767
|
unsetExceptionBoundary(session);
|
|
1746
1768
|
}
|
|
@@ -1750,7 +1772,7 @@ async function executeCatch(session, element) {
|
|
|
1750
1772
|
const exceptionName = element.attributes?.name || "exception";
|
|
1751
1773
|
const caughtCount = lookupException(session, exceptionName);
|
|
1752
1774
|
if (caughtCount > 0) {
|
|
1753
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1775
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1754
1776
|
await integrateChildren2(session, element);
|
|
1755
1777
|
}
|
|
1756
1778
|
flushCurrentException(session);
|
|
@@ -1759,7 +1781,7 @@ async function executeCatch(session, element) {
|
|
|
1759
1781
|
// src/tags/exception.ts
|
|
1760
1782
|
async function executeException(session, element) {
|
|
1761
1783
|
const exceptions = getCurrentExceptions(session);
|
|
1762
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1784
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-KV56UTCS.js");
|
|
1763
1785
|
for (const exceptionDom of exceptions) {
|
|
1764
1786
|
await integrateChildren2(session, exceptionDom);
|
|
1765
1787
|
}
|
|
@@ -2227,7 +2249,7 @@ async function executeLoadContext(session, element) {
|
|
|
2227
2249
|
query = element.text.trim();
|
|
2228
2250
|
}
|
|
2229
2251
|
if (!query && element.children.length > 0) {
|
|
2230
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2252
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
2231
2253
|
const beforeOutput = session.output.length;
|
|
2232
2254
|
for (const child of element.children) {
|
|
2233
2255
|
await integrate2(session, child);
|
|
@@ -2480,7 +2502,7 @@ async function executeForeach(session, element) {
|
|
|
2480
2502
|
const parser2 = new DiracParser2();
|
|
2481
2503
|
try {
|
|
2482
2504
|
const fromElement = parser2.parse(fromAttr);
|
|
2483
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2505
|
+
const { integrate: integrate2 } = await import("./interpreter-KV56UTCS.js");
|
|
2484
2506
|
await integrate2(session, fromElement);
|
|
2485
2507
|
} catch (e) {
|
|
2486
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