dirac-lang 0.1.102 → 0.1.104
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-2KA6H3VE.js → agent-MA26RVA7.js} +2 -2
- package/dist/{chunk-GS33Y77U.js → chunk-4RNEDDMF.js} +1 -1
- package/dist/{chunk-OTP437A4.js → chunk-IWHU4S7Q.js} +1 -1
- package/dist/{chunk-FWTYD7GV.js → chunk-WMNKUJXR.js} +19 -13
- package/dist/cli.js +9 -9
- package/dist/{cron-3C3H6QMC.js → cron-7LOKNMSU.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{interpreter-VO4BMOSU.js → interpreter-PQRJL5V7.js} +1 -1
- package/dist/{run-at-Q437F5V3.js → run-at-OM2MZ64K.js} +1 -1
- package/dist/{schedule-OGJDCWSV.js → schedule-TN3RL2J6.js} +1 -1
- package/dist/{session-server-CMHI5CQ5.js → session-server-J73NWCB4.js} +2 -2
- package/dist/{shell-LEAR2OVM.js → shell-PVJ255M7.js} +32 -15
- 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-4RNEDDMF.js";
|
|
6
|
+
import "./chunk-WMNKUJXR.js";
|
|
7
7
|
import "./chunk-53QJQ2CC.js";
|
|
8
8
|
import "./chunk-HRHAMPOB.js";
|
|
9
9
|
import "./chunk-EAM7IZWA.js";
|
|
@@ -276,7 +276,7 @@ async function executeOutput(session, element) {
|
|
|
276
276
|
async function executeCall(session, element) {
|
|
277
277
|
let name;
|
|
278
278
|
if (element.tag === "call") {
|
|
279
|
-
name = element.attributes.
|
|
279
|
+
name = element.attributes.subroutine || element.attributes.name || "";
|
|
280
280
|
} else {
|
|
281
281
|
name = element.tag;
|
|
282
282
|
}
|
|
@@ -354,6 +354,12 @@ async function executeCallInternal(session, subroutine, callElement, isExtendExe
|
|
|
354
354
|
for (const [attrName, attrValue] of Object.entries(subroutine.attributes)) {
|
|
355
355
|
if (attrName.startsWith("param-")) {
|
|
356
356
|
const paramName = attrName.substring(6);
|
|
357
|
+
if (callElement.tag === "call" && paramName === "name" && !callElement.attributes.subroutine) {
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
if (callElement.tag === "call" && paramName === "subroutine" && callElement.attributes.subroutine) {
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
357
363
|
const alreadySet = session.variables.slice(session.varBoundary).some((v) => v.name === paramName);
|
|
358
364
|
if (!alreadySet) {
|
|
359
365
|
let value = "";
|
|
@@ -487,12 +493,12 @@ async function executeIf(session, element) {
|
|
|
487
493
|
const condition = await evaluatePredicate(session, conditionElement);
|
|
488
494
|
if (condition) {
|
|
489
495
|
if (thenElement) {
|
|
490
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
496
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-PQRJL5V7.js");
|
|
491
497
|
await integrateChildren2(session, thenElement);
|
|
492
498
|
}
|
|
493
499
|
} else {
|
|
494
500
|
if (elseElement) {
|
|
495
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
501
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-PQRJL5V7.js");
|
|
496
502
|
await integrateChildren2(session, elseElement);
|
|
497
503
|
}
|
|
498
504
|
}
|
|
@@ -505,7 +511,7 @@ async function evaluatePredicate(session, predicateElement) {
|
|
|
505
511
|
return await evaluateCondition(session, predicateElement);
|
|
506
512
|
}
|
|
507
513
|
const outputLengthBefore = session.output.length;
|
|
508
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
514
|
+
const { integrate: integrate2 } = await import("./interpreter-PQRJL5V7.js");
|
|
509
515
|
await integrate2(session, predicateElement);
|
|
510
516
|
const newOutputChunks = session.output.slice(outputLengthBefore);
|
|
511
517
|
const result = newOutputChunks.join("").trim();
|
|
@@ -528,11 +534,11 @@ async function evaluateCondition(session, condElement) {
|
|
|
528
534
|
}
|
|
529
535
|
const outputLengthBefore = session.output.length;
|
|
530
536
|
const args = [];
|
|
531
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
537
|
+
const { integrate: integrate2 } = await import("./interpreter-PQRJL5V7.js");
|
|
532
538
|
for (const child of condElement.children) {
|
|
533
539
|
if (child.tag.toLowerCase() === "arg") {
|
|
534
540
|
const argOutputStart = session.output.length;
|
|
535
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
541
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-PQRJL5V7.js");
|
|
536
542
|
await integrateChildren2(session, child);
|
|
537
543
|
const newChunks = session.output.slice(argOutputStart);
|
|
538
544
|
const argValue = newChunks.join("");
|
|
@@ -2103,7 +2109,7 @@ async function executeTagCheck(session, element) {
|
|
|
2103
2109
|
const executeTag = correctedTag || tagName;
|
|
2104
2110
|
console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
|
|
2105
2111
|
const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
|
|
2106
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2112
|
+
const { integrate: integrate2 } = await import("./interpreter-PQRJL5V7.js");
|
|
2107
2113
|
await integrate2(session, elementToExecute);
|
|
2108
2114
|
}
|
|
2109
2115
|
}
|
|
@@ -2112,7 +2118,7 @@ async function executeTagCheck(session, element) {
|
|
|
2112
2118
|
// src/tags/throw.ts
|
|
2113
2119
|
async function executeThrow(session, element) {
|
|
2114
2120
|
const exceptionName = element.attributes?.name || "exception";
|
|
2115
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
2121
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-PQRJL5V7.js");
|
|
2116
2122
|
const exceptionDom = {
|
|
2117
2123
|
tag: "exception-content",
|
|
2118
2124
|
attributes: { name: exceptionName },
|
|
@@ -2125,7 +2131,7 @@ async function executeThrow(session, element) {
|
|
|
2125
2131
|
// src/tags/try.ts
|
|
2126
2132
|
async function executeTry(session, element) {
|
|
2127
2133
|
setExceptionBoundary(session);
|
|
2128
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
2134
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-PQRJL5V7.js");
|
|
2129
2135
|
await integrateChildren2(session, element);
|
|
2130
2136
|
unsetExceptionBoundary(session);
|
|
2131
2137
|
}
|
|
@@ -2135,7 +2141,7 @@ async function executeCatch(session, element) {
|
|
|
2135
2141
|
const exceptionName = element.attributes?.name || "exception";
|
|
2136
2142
|
const caughtCount = lookupException(session, exceptionName);
|
|
2137
2143
|
if (caughtCount > 0) {
|
|
2138
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
2144
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-PQRJL5V7.js");
|
|
2139
2145
|
await integrateChildren2(session, element);
|
|
2140
2146
|
}
|
|
2141
2147
|
flushCurrentException(session);
|
|
@@ -2144,7 +2150,7 @@ async function executeCatch(session, element) {
|
|
|
2144
2150
|
// src/tags/exception.ts
|
|
2145
2151
|
async function executeException(session, element) {
|
|
2146
2152
|
const exceptions = getCurrentExceptions(session);
|
|
2147
|
-
const { integrateChildren: integrateChildren2 } = await import("./interpreter-
|
|
2153
|
+
const { integrateChildren: integrateChildren2 } = await import("./interpreter-PQRJL5V7.js");
|
|
2148
2154
|
for (const exceptionDom of exceptions) {
|
|
2149
2155
|
await integrateChildren2(session, exceptionDom);
|
|
2150
2156
|
}
|
|
@@ -2345,7 +2351,7 @@ async function executeLoadContext(session, element) {
|
|
|
2345
2351
|
query = element.text.trim();
|
|
2346
2352
|
}
|
|
2347
2353
|
if (!query && element.children.length > 0) {
|
|
2348
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
2354
|
+
const { integrate: integrate2 } = await import("./interpreter-PQRJL5V7.js");
|
|
2349
2355
|
const beforeOutput = session.output.length;
|
|
2350
2356
|
for (const child of element.children) {
|
|
2351
2357
|
await integrate2(session, child);
|
|
@@ -3230,7 +3236,7 @@ async function executeForeach(session, element) {
|
|
|
3230
3236
|
const parser2 = new DiracParser2();
|
|
3231
3237
|
try {
|
|
3232
3238
|
const fromElement = parser2.parse(fromAttr);
|
|
3233
|
-
const { integrate: integrate2 } = await import("./interpreter-
|
|
3239
|
+
const { integrate: integrate2 } = await import("./interpreter-PQRJL5V7.js");
|
|
3234
3240
|
await integrate2(session, fromElement);
|
|
3235
3241
|
} catch (e) {
|
|
3236
3242
|
session.output = savedOutput;
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
execute
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IWHU4S7Q.js";
|
|
5
5
|
import {
|
|
6
6
|
BraKetParser
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WMNKUJXR.js";
|
|
8
8
|
import "./chunk-53QJQ2CC.js";
|
|
9
9
|
import "./chunk-HRHAMPOB.js";
|
|
10
10
|
import "./chunk-EAM7IZWA.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.103",
|
|
20
20
|
description: "LLM-Augmented Declarative Execution",
|
|
21
21
|
type: "module",
|
|
22
22
|
main: "dist/index.js",
|
|
@@ -150,7 +150,7 @@ async function main() {
|
|
|
150
150
|
const args = process.argv.slice(2);
|
|
151
151
|
const calledAs = process.argv[1];
|
|
152
152
|
if (calledAs && calledAs.endsWith("/dish")) {
|
|
153
|
-
const { DiracShell } = await import("./shell-
|
|
153
|
+
const { DiracShell } = await import("./shell-PVJ255M7.js");
|
|
154
154
|
const shellConfig = loadShellConfig(args);
|
|
155
155
|
const shell = new DiracShell(shellConfig);
|
|
156
156
|
await shell.start();
|
|
@@ -199,11 +199,11 @@ async function main() {
|
|
|
199
199
|
if (args[0] === "agent") {
|
|
200
200
|
const subcommand = args[1];
|
|
201
201
|
if (subcommand === "daemon") {
|
|
202
|
-
const { runAgentDaemon } = await import("./agent-
|
|
202
|
+
const { runAgentDaemon } = await import("./agent-MA26RVA7.js");
|
|
203
203
|
await runAgentDaemon();
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
const { AgentCLI } = await import("./agent-
|
|
206
|
+
const { AgentCLI } = await import("./agent-MA26RVA7.js");
|
|
207
207
|
const agent = new AgentCLI();
|
|
208
208
|
switch (subcommand) {
|
|
209
209
|
case "start":
|
|
@@ -230,8 +230,8 @@ async function main() {
|
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
if (args[0] === "shell") {
|
|
233
|
-
const { DiracShell } = await import("./shell-
|
|
234
|
-
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-
|
|
233
|
+
const { DiracShell } = await import("./shell-PVJ255M7.js");
|
|
234
|
+
const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-J73NWCB4.js");
|
|
235
235
|
const { SessionClient } = await import("./session-client-3VTC5MLO.js");
|
|
236
236
|
const daemonMode = args.includes("--daemon") || args.includes("-d");
|
|
237
237
|
const agentMode = args.includes("--agent") || args.includes("-a");
|
|
@@ -277,7 +277,7 @@ async function main() {
|
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
279
|
if (args[0] === "daemon") {
|
|
280
|
-
const { SessionServer } = await import("./session-server-
|
|
280
|
+
const { SessionServer } = await import("./session-server-J73NWCB4.js");
|
|
281
281
|
const server = new SessionServer();
|
|
282
282
|
await server.start();
|
|
283
283
|
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-IWHU4S7Q.js";
|
|
6
6
|
import {
|
|
7
7
|
integrate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WMNKUJXR.js";
|
|
9
9
|
import "./chunk-53QJQ2CC.js";
|
|
10
10
|
import {
|
|
11
11
|
DiracParser
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
SessionServer,
|
|
3
3
|
getSocketPath,
|
|
4
4
|
isSessionRunning
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-4RNEDDMF.js";
|
|
6
|
+
import "./chunk-WMNKUJXR.js";
|
|
7
7
|
import "./chunk-53QJQ2CC.js";
|
|
8
8
|
import "./chunk-HRHAMPOB.js";
|
|
9
9
|
import "./chunk-EAM7IZWA.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BraKetParser,
|
|
4
4
|
integrate
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WMNKUJXR.js";
|
|
6
6
|
import "./chunk-53QJQ2CC.js";
|
|
7
7
|
import {
|
|
8
8
|
DiracParser
|
|
@@ -358,7 +358,7 @@ var DiracShell = class {
|
|
|
358
358
|
if (this.client) {
|
|
359
359
|
this.client.disconnect();
|
|
360
360
|
}
|
|
361
|
-
import("./schedule-
|
|
361
|
+
import("./schedule-TN3RL2J6.js").then(({ stopAllScheduledTasks }) => {
|
|
362
362
|
stopAllScheduledTasks();
|
|
363
363
|
console.log("\nGoodbye!");
|
|
364
364
|
process.exit(0);
|
|
@@ -504,14 +504,24 @@ var DiracShell = class {
|
|
|
504
504
|
if (this.session.output.length > 0) {
|
|
505
505
|
console.log(this.session.output.join(""));
|
|
506
506
|
}
|
|
507
|
-
|
|
507
|
+
let silentExecution = void 0;
|
|
508
|
+
for (let i = this.session.variables.length - 1; i >= 0; i--) {
|
|
509
|
+
if (this.session.variables[i].name === "__llm_silent_execution__") {
|
|
510
|
+
silentExecution = this.session.variables[i];
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
508
514
|
if (silentExecution?.value) {
|
|
509
515
|
console.error(`
|
|
510
516
|
[LLM generated]
|
|
511
517
|
${silentExecution.value}
|
|
512
518
|
`);
|
|
513
|
-
|
|
514
|
-
|
|
519
|
+
for (let i = this.session.variables.length - 1; i >= 0; i--) {
|
|
520
|
+
if (this.session.variables[i].name === "__llm_silent_execution__") {
|
|
521
|
+
this.session.variables.splice(i, 1);
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
515
525
|
}
|
|
516
526
|
} catch (error) {
|
|
517
527
|
console.error("Error:", error instanceof Error ? error.message : String(error));
|
|
@@ -818,7 +828,7 @@ Examples:
|
|
|
818
828
|
break;
|
|
819
829
|
case "tasks":
|
|
820
830
|
try {
|
|
821
|
-
const { listScheduledTasks } = await import("./schedule-
|
|
831
|
+
const { listScheduledTasks } = await import("./schedule-TN3RL2J6.js");
|
|
822
832
|
const tasks = listScheduledTasks();
|
|
823
833
|
if (tasks.length === 0) {
|
|
824
834
|
console.log("No scheduled tasks running.");
|
|
@@ -837,7 +847,7 @@ Examples:
|
|
|
837
847
|
console.log("Usage: :stop <task-name>");
|
|
838
848
|
} else {
|
|
839
849
|
try {
|
|
840
|
-
const { stopScheduledTask } = await import("./schedule-
|
|
850
|
+
const { stopScheduledTask } = await import("./schedule-TN3RL2J6.js");
|
|
841
851
|
const taskName = args[0];
|
|
842
852
|
const stopped = stopScheduledTask(taskName);
|
|
843
853
|
if (stopped) {
|
|
@@ -852,7 +862,7 @@ Examples:
|
|
|
852
862
|
break;
|
|
853
863
|
case "stopall":
|
|
854
864
|
try {
|
|
855
|
-
const { stopAllScheduledTasks } = await import("./schedule-
|
|
865
|
+
const { stopAllScheduledTasks } = await import("./schedule-TN3RL2J6.js");
|
|
856
866
|
stopAllScheduledTasks();
|
|
857
867
|
console.log("All scheduled tasks stopped.");
|
|
858
868
|
} catch (error) {
|
|
@@ -861,7 +871,7 @@ Examples:
|
|
|
861
871
|
break;
|
|
862
872
|
case "crons":
|
|
863
873
|
try {
|
|
864
|
-
const { listCronJobs } = await import("./cron-
|
|
874
|
+
const { listCronJobs } = await import("./cron-7LOKNMSU.js");
|
|
865
875
|
const jobs = listCronJobs();
|
|
866
876
|
if (jobs.length === 0) {
|
|
867
877
|
console.log("No cron jobs running.");
|
|
@@ -881,7 +891,7 @@ Examples:
|
|
|
881
891
|
console.log("Usage: :stopcron <job-name>");
|
|
882
892
|
} else {
|
|
883
893
|
try {
|
|
884
|
-
const { stopCronJob } = await import("./cron-
|
|
894
|
+
const { stopCronJob } = await import("./cron-7LOKNMSU.js");
|
|
885
895
|
const jobName = args[0];
|
|
886
896
|
const stopped = stopCronJob(jobName);
|
|
887
897
|
if (stopped) {
|
|
@@ -896,7 +906,7 @@ Examples:
|
|
|
896
906
|
break;
|
|
897
907
|
case "stopallcrons":
|
|
898
908
|
try {
|
|
899
|
-
const { stopAllCronJobs } = await import("./cron-
|
|
909
|
+
const { stopAllCronJobs } = await import("./cron-7LOKNMSU.js");
|
|
900
910
|
stopAllCronJobs();
|
|
901
911
|
console.log("All cron jobs stopped.");
|
|
902
912
|
} catch (error) {
|
|
@@ -905,7 +915,7 @@ Examples:
|
|
|
905
915
|
break;
|
|
906
916
|
case "scheduled":
|
|
907
917
|
try {
|
|
908
|
-
const { listScheduledRuns } = await import("./run-at-
|
|
918
|
+
const { listScheduledRuns } = await import("./run-at-OM2MZ64K.js");
|
|
909
919
|
const runs = listScheduledRuns();
|
|
910
920
|
if (runs.length === 0) {
|
|
911
921
|
console.log("No scheduled runs pending.");
|
|
@@ -925,7 +935,7 @@ Examples:
|
|
|
925
935
|
console.log("Usage: :cancel <run-name>");
|
|
926
936
|
} else {
|
|
927
937
|
try {
|
|
928
|
-
const { cancelScheduledRun } = await import("./run-at-
|
|
938
|
+
const { cancelScheduledRun } = await import("./run-at-OM2MZ64K.js");
|
|
929
939
|
const runName = args[0];
|
|
930
940
|
const cancelled = cancelScheduledRun(runName);
|
|
931
941
|
if (cancelled) {
|
|
@@ -940,7 +950,7 @@ Examples:
|
|
|
940
950
|
break;
|
|
941
951
|
case "cancelall":
|
|
942
952
|
try {
|
|
943
|
-
const { cancelAllScheduledRuns } = await import("./run-at-
|
|
953
|
+
const { cancelAllScheduledRuns } = await import("./run-at-OM2MZ64K.js");
|
|
944
954
|
cancelAllScheduledRuns();
|
|
945
955
|
console.log("All scheduled runs cancelled.");
|
|
946
956
|
} catch (error) {
|
|
@@ -1050,7 +1060,14 @@ Examples:
|
|
|
1050
1060
|
}
|
|
1051
1061
|
}
|
|
1052
1062
|
console.error(`[DEBUG] Final saveMode: ${saveMode}`);
|
|
1053
|
-
const
|
|
1063
|
+
const variables = this.client ? (await this.client.getState()).variables : this.session.variables;
|
|
1064
|
+
let dialogVar = void 0;
|
|
1065
|
+
for (let i = variables.length - 1; i >= 0; i--) {
|
|
1066
|
+
if (variables[i].name === "__llm_dialog__") {
|
|
1067
|
+
dialogVar = variables[i];
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1054
1071
|
if (!dialogVar || !dialogVar.value) {
|
|
1055
1072
|
console.log("No LLM dialog to save");
|
|
1056
1073
|
break;
|
package/dist/test-runner.js
CHANGED