dirac-lang 0.1.88 → 0.1.89
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-UJOKQHAX.js → agent-BWFKP5AW.js} +2 -2
- package/dist/{chunk-O6T7UF2Y.js → chunk-B5OYG2NX.js} +1 -1
- package/dist/{chunk-KS5BEPQN.js → chunk-QGEYKDIA.js} +26 -12
- package/dist/{chunk-7RXHPRIW.js → chunk-ZVWMNAEP.js} +1 -1
- package/dist/cli.js +9 -9
- package/dist/{cron-YZK5DMGO.js → cron-M6QJMAUB.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{interpreter-PTTFEDJF.js → interpreter-NYE2UVMD.js} +1 -1
- package/dist/{run-at-3JETXLOI.js → run-at-I5ZV3QBL.js} +1 -1
- package/dist/{schedule-K7V77KGN.js → schedule-QRJ6IYKM.js} +1 -1
- package/dist/{session-server-F374HUP7.js → session-server-IAC5KFJC.js} +2 -2
- package/dist/{shell-JQ3UQCDD.js → shell-5IR72NFQ.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-ZVWMNAEP.js";
|
|
6
|
+
import "./chunk-QGEYKDIA.js";
|
|
7
7
|
import "./chunk-HJSHCEK4.js";
|
|
8
8
|
import "./chunk-BGG2SULN.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
@@ -487,12 +487,12 @@ async function executeIf(session, element) {
|
|
|
487
487
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
488
488
|
if (condition) {
|
|
489
489
|
if (thenElement) {
|
|
490
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
490
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NYE2UVMD.js");
|
|
491
491
|
await integrateChildren2(session, thenElement);
|
|
492
492
|
}
|
|
493
493
|
} else {
|
|
494
494
|
if (elseElement) {
|
|
495
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
495
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NYE2UVMD.js");
|
|
496
496
|
await integrateChildren2(session, elseElement);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
@@ -505,7 +505,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
505
505
|
return await evaluateCondition(session, predicateElement);
|
|
506
506
|
}
|
|
507
507
|
const outputLengthBefore = session.output.length;
|
|
508
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
508
|
+
const { integrate: integrate2 } = await import("./interpreter-NYE2UVMD.js");
|
|
509
509
|
await integrate2(session, predicateElement);
|
|
510
510
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
511
511
|
const result = newOutputChunks.join("").trim();
|
|
@@ -528,11 +528,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
528
528
|
}
|
|
529
529
|
const outputLengthBefore = session.output.length;
|
|
530
530
|
const args = [];
|
|
531
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
531
|
+
const { integrate: integrate2 } = await import("./interpreter-NYE2UVMD.js");
|
|
532
532
|
for (const child of condElement.children) {
|
|
533
533
|
if (child.tag.toLowerCase() === "arg") {
|
|
534
534
|
const argOutputStart = session.output.length;
|
|
535
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
535
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NYE2UVMD.js");
|
|
536
536
|
await integrateChildren2(session, child);
|
|
537
537
|
const newChunks = session.output.slice(argOutputStart);
|
|
538
538
|
const argValue = newChunks.join("");
|
|
@@ -1035,6 +1035,20 @@ ${result}
|
|
|
1035
1035
|
console.error(`[LLM] Feedback mode enabled (max iterations: ${maxIterations})`);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
+
const containsDiracCode = (response) => {
|
|
1039
|
+
const trimmed = response.trim();
|
|
1040
|
+
if (isCustom) {
|
|
1041
|
+
return trimmed.includes("<dirac>") || trimmed.includes("<dirac ");
|
|
1042
|
+
}
|
|
1043
|
+
return /<[a-zA-Z_][\w-]*(\s|>|\/)/m.test(trimmed);
|
|
1044
|
+
};
|
|
1045
|
+
if (!containsDiracCode(result)) {
|
|
1046
|
+
if (session.debug) {
|
|
1047
|
+
console.error("[LLM] Response does not contain Dirac code, skipping execution");
|
|
1048
|
+
}
|
|
1049
|
+
emit(session, result);
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1038
1052
|
let iteration = 0;
|
|
1039
1053
|
while (iteration < maxIterations && (iteration === 0 || feedbackMode)) {
|
|
1040
1054
|
iteration++;
|
|
@@ -1788,7 +1802,7 @@ async function executeTagCheck(session, element) {
|
|
|
1788
1802
|
const executeTag = correctedTag || tagName;
|
|
1789
1803
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
1790
1804
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
1791
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
1805
|
+
const { integrate: integrate2 } = await import("./interpreter-NYE2UVMD.js");
|
|
1792
1806
|
await integrate2(session, elementToExecute);
|
|
1793
1807
|
}
|
|
1794
1808
|
}
|
|
@@ -1797,7 +1811,7 @@ async function executeTagCheck(session, element) {
|
|
|
1797
1811
|
// src/tags/throw.ts
|
|
1798
1812
|
async function executeThrow(session, element) {
|
|
1799
1813
|
const exceptionName = element.attributes?.name || "exception";
|
|
1800
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1814
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NYE2UVMD.js");
|
|
1801
1815
|
const exceptionDom = {
|
|
1802
1816
|
tag: "exception-content",
|
|
1803
1817
|
attributes: { name: exceptionName },
|
|
@@ -1810,7 +1824,7 @@ async function executeThrow(session, element) {
|
|
|
1810
1824
|
// src/tags/try.ts
|
|
1811
1825
|
async function executeTry(session, element) {
|
|
1812
1826
|
setExceptionBoundary(session);
|
|
1813
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1827
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NYE2UVMD.js");
|
|
1814
1828
|
await integrateChildren2(session, element);
|
|
1815
1829
|
unsetExceptionBoundary(session);
|
|
1816
1830
|
}
|
|
@@ -1820,7 +1834,7 @@ async function executeCatch(session, element) {
|
|
|
1820
1834
|
const exceptionName = element.attributes?.name || "exception";
|
|
1821
1835
|
const caughtCount = lookupException(session, exceptionName);
|
|
1822
1836
|
if (caughtCount > 0) {
|
|
1823
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1837
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NYE2UVMD.js");
|
|
1824
1838
|
await integrateChildren2(session, element);
|
|
1825
1839
|
}
|
|
1826
1840
|
flushCurrentException(session);
|
|
@@ -1829,7 +1843,7 @@ async function executeCatch(session, element) {
|
|
|
1829
1843
|
// src/tags/exception.ts
|
|
1830
1844
|
async function executeException(session, element) {
|
|
1831
1845
|
const exceptions = getCurrentExceptions(session);
|
|
1832
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
1846
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-NYE2UVMD.js");
|
|
1833
1847
|
for (const exceptionDom of exceptions) {
|
|
1834
1848
|
await integrateChildren2(session, exceptionDom);
|
|
1835
1849
|
}
|
|
@@ -2030,7 +2044,7 @@ async function executeLoadContext(session, element) {
|
|
|
2030
2044
|
query = element.text.trim();
|
|
2031
2045
|
}
|
|
2032
2046
|
if (!query && element.children.length > 0) {
|
|
2033
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2047
|
+
const { integrate: integrate2 } = await import("./interpreter-NYE2UVMD.js");
|
|
2034
2048
|
const beforeOutput = session.output.length;
|
|
2035
2049
|
for (const child of element.children) {
|
|
2036
2050
|
await integrate2(session, child);
|
|
@@ -2461,7 +2475,7 @@ async function executeForeach(session, element) {
|
|
|
2461
2475
|
const parser2 = new DiracParser2();
|
|
2462
2476
|
try {
|
|
2463
2477
|
const fromElement = parser2.parse(fromAttr);
|
|
2464
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2478
|
+
const { integrate: integrate2 } = await import("./interpreter-NYE2UVMD.js");
|
|
2465
2479
|
await integrate2(session, fromElement);
|
|
2466
2480
|
} catch (e) {
|
|
2467
2481
|
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-B5OYG2NX.js";
|
|
8
|
+
import "./chunk-QGEYKDIA.js";
|
|
9
9
|
import "./chunk-HJSHCEK4.js";
|
|
10
10
|
import "./chunk-BGG2SULN.js";
|
|
11
11
|
import "./chunk-HRHAMPOB.js";
|
|
@@ -17,7 +17,7 @@ import "dotenv/config";
|
|
|
17
17
|
// package.json
|
|
18
18
|
var package_default = {
|
|
19
19
|
name: "dirac-lang",
|
|
20
|
-
version: "0.1.
|
|
20
|
+
version: "0.1.88",
|
|
21
21
|
description: "LLM-Augmented Declarative Execution",
|
|
22
22
|
type: "module",
|
|
23
23
|
main: "dist/index.js",
|
|
@@ -151,7 +151,7 @@ async function main() {
|
|
|
151
151
|
const args = process.argv.slice(2);
|
|
152
152
|
const calledAs = process.argv[1];
|
|
153
153
|
if (calledAs && calledAs.endsWith("/dish")) {
|
|
154
|
-
const { DiracShell } = await import("./shell-
|
|
154
|
+
const { DiracShell } = await import("./shell-5IR72NFQ.js");
|
|
155
155
|
const shellConfig = loadShellConfig(args);
|
|
156
156
|
const shell = new DiracShell(shellConfig);
|
|
157
157
|
await shell.start();
|
|
@@ -200,11 +200,11 @@ async function main() {
|
|
|
200
200
|
if (args[0] === "agent") {
|
|
201
201
|
const subcommand = args[1];
|
|
202
202
|
if (subcommand === "daemon") {
|
|
203
|
-
const { runAgentDaemon } = await import("./agent-
|
|
203
|
+
const { runAgentDaemon } = await import("./agent-BWFKP5AW.js");
|
|
204
204
|
await runAgentDaemon();
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
|
-
const { AgentCLI } = await import("./agent-
|
|
207
|
+
const { AgentCLI } = await import("./agent-BWFKP5AW.js");
|
|
208
208
|
const agent = new AgentCLI();
|
|
209
209
|
switch (subcommand) {
|
|
210
210
|
case "start":
|
|
@@ -231,8 +231,8 @@ async function main() {
|
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
if (args[0] === "shell") {
|
|
234
|
-
const { DiracShell } = await import("./shell-
|
|
235
|
-
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-
|
|
234
|
+
const { DiracShell } = await import("./shell-5IR72NFQ.js");
|
|
235
|
+
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-IAC5KFJC.js");
|
|
236
236
|
const { SessionClient } = await import("./session-client-3VTC5MLO.js");
|
|
237
237
|
const daemonMode = args.includes("--daemon") || args.includes("-d");
|
|
238
238
|
const agentMode = args.includes("--agent") || args.includes("-a");
|
|
@@ -278,7 +278,7 @@ async function main() {
|
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
if (args[0] === "daemon") {
|
|
281
|
-
const { SessionServer } = await import("./session-server-
|
|
281
|
+
const { SessionServer } = await import("./session-server-IAC5KFJC.js");
|
|
282
282
|
const server = new SessionServer();
|
|
283
283
|
await server.start();
|
|
284
284
|
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-B5OYG2NX.js";
|
|
6
6
|
import {
|
|
7
7
|
integrate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QGEYKDIA.js";
|
|
9
9
|
import "./chunk-HJSHCEK4.js";
|
|
10
10
|
import "./chunk-BGG2SULN.js";
|
|
11
11
|
import {
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
SessionServer,
|
|
3
3
|
getSocketPath,
|
|
4
4
|
isSessionRunning
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ZVWMNAEP.js";
|
|
6
|
+
import "./chunk-QGEYKDIA.js";
|
|
7
7
|
import "./chunk-HJSHCEK4.js";
|
|
8
8
|
import "./chunk-BGG2SULN.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-AJSYOXXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
integrate
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QGEYKDIA.js";
|
|
8
8
|
import "./chunk-HJSHCEK4.js";
|
|
9
9
|
import "./chunk-BGG2SULN.js";
|
|
10
10
|
import {
|
|
@@ -360,7 +360,7 @@ var DiracShell = class {
|
|
|
360
360
|
if (this.client) {
|
|
361
361
|
this.client.disconnect();
|
|
362
362
|
}
|
|
363
|
-
import("./schedule-
|
|
363
|
+
import("./schedule-QRJ6IYKM.js").then(({ stopAllScheduledTasks }) => {
|
|
364
364
|
stopAllScheduledTasks();
|
|
365
365
|
console.log("\nGoodbye!");
|
|
366
366
|
process.exit(0);
|
|
@@ -764,7 +764,7 @@ Examples:
|
|
|
764
764
|
break;
|
|
765
765
|
case "tasks":
|
|
766
766
|
try {
|
|
767
|
-
const { listScheduledTasks } = await import("./schedule-
|
|
767
|
+
const { listScheduledTasks } = await import("./schedule-QRJ6IYKM.js");
|
|
768
768
|
const tasks = listScheduledTasks();
|
|
769
769
|
if (tasks.length === 0) {
|
|
770
770
|
console.log("No scheduled tasks running.");
|
|
@@ -783,7 +783,7 @@ Examples:
|
|
|
783
783
|
console.log("Usage: :stop <task-name>");
|
|
784
784
|
} else {
|
|
785
785
|
try {
|
|
786
|
-
const { stopScheduledTask } = await import("./schedule-
|
|
786
|
+
const { stopScheduledTask } = await import("./schedule-QRJ6IYKM.js");
|
|
787
787
|
const taskName = args[0];
|
|
788
788
|
const stopped = stopScheduledTask(taskName);
|
|
789
789
|
if (stopped) {
|
|
@@ -798,7 +798,7 @@ Examples:
|
|
|
798
798
|
break;
|
|
799
799
|
case "stopall":
|
|
800
800
|
try {
|
|
801
|
-
const { stopAllScheduledTasks } = await import("./schedule-
|
|
801
|
+
const { stopAllScheduledTasks } = await import("./schedule-QRJ6IYKM.js");
|
|
802
802
|
stopAllScheduledTasks();
|
|
803
803
|
console.log("All scheduled tasks stopped.");
|
|
804
804
|
} catch (error) {
|
|
@@ -807,7 +807,7 @@ Examples:
|
|
|
807
807
|
break;
|
|
808
808
|
case "crons":
|
|
809
809
|
try {
|
|
810
|
-
const { listCronJobs } = await import("./cron-
|
|
810
|
+
const { listCronJobs } = await import("./cron-M6QJMAUB.js");
|
|
811
811
|
const jobs = listCronJobs();
|
|
812
812
|
if (jobs.length === 0) {
|
|
813
813
|
console.log("No cron jobs running.");
|
|
@@ -827,7 +827,7 @@ Examples:
|
|
|
827
827
|
console.log("Usage: :stopcron <job-name>");
|
|
828
828
|
} else {
|
|
829
829
|
try {
|
|
830
|
-
const { stopCronJob } = await import("./cron-
|
|
830
|
+
const { stopCronJob } = await import("./cron-M6QJMAUB.js");
|
|
831
831
|
const jobName = args[0];
|
|
832
832
|
const stopped = stopCronJob(jobName);
|
|
833
833
|
if (stopped) {
|
|
@@ -842,7 +842,7 @@ Examples:
|
|
|
842
842
|
break;
|
|
843
843
|
case "stopallcrons":
|
|
844
844
|
try {
|
|
845
|
-
const { stopAllCronJobs } = await import("./cron-
|
|
845
|
+
const { stopAllCronJobs } = await import("./cron-M6QJMAUB.js");
|
|
846
846
|
stopAllCronJobs();
|
|
847
847
|
console.log("All cron jobs stopped.");
|
|
848
848
|
} catch (error) {
|
|
@@ -851,7 +851,7 @@ Examples:
|
|
|
851
851
|
break;
|
|
852
852
|
case "scheduled":
|
|
853
853
|
try {
|
|
854
|
-
const { listScheduledRuns } = await import("./run-at-
|
|
854
|
+
const { listScheduledRuns } = await import("./run-at-I5ZV3QBL.js");
|
|
855
855
|
const runs = listScheduledRuns();
|
|
856
856
|
if (runs.length === 0) {
|
|
857
857
|
console.log("No scheduled runs pending.");
|
|
@@ -871,7 +871,7 @@ Examples:
|
|
|
871
871
|
console.log("Usage: :cancel <run-name>");
|
|
872
872
|
} else {
|
|
873
873
|
try {
|
|
874
|
-
const { cancelScheduledRun } = await import("./run-at-
|
|
874
|
+
const { cancelScheduledRun } = await import("./run-at-I5ZV3QBL.js");
|
|
875
875
|
const runName = args[0];
|
|
876
876
|
const cancelled = cancelScheduledRun(runName);
|
|
877
877
|
if (cancelled) {
|
|
@@ -886,7 +886,7 @@ Examples:
|
|
|
886
886
|
break;
|
|
887
887
|
case "cancelall":
|
|
888
888
|
try {
|
|
889
|
-
const { cancelAllScheduledRuns } = await import("./run-at-
|
|
889
|
+
const { cancelAllScheduledRuns } = await import("./run-at-I5ZV3QBL.js");
|
|
890
890
|
cancelAllScheduledRuns();
|
|
891
891
|
console.log("All scheduled runs cancelled.");
|
|
892
892
|
} catch (error) {
|
package/dist/test-runner.js
CHANGED