dirac-lang 0.1.66 → 0.1.67

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.
@@ -2,8 +2,8 @@ import {
2
2
  SessionServer,
3
3
  getSocketPath,
4
4
  isSessionRunning
5
- } from "./chunk-FYOJQTDE.js";
6
- import "./chunk-YM4HLLAJ.js";
5
+ } from "./chunk-6OIMDS6G.js";
6
+ import "./chunk-XNH4TU3Q.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-NKA6ZJDV.js";
9
9
  import "./chunk-3UW6GWYQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-YM4HLLAJ.js";
3
+ } from "./chunk-XNH4TU3Q.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-YM4HLLAJ.js";
3
+ } from "./chunk-XNH4TU3Q.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.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-WTIAZW6A.js");
477
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-TDPDELJC.js");
478
478
  await integrateChildren2(session, thenElement);
479
479
  }
480
480
  } else {
481
481
  if (elseElement) {
482
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-WTIAZW6A.js");
482
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-TDPDELJC.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-WTIAZW6A.js");
495
+ const { integrate: integrate2 } = await import("./interpreter-TDPDELJC.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-WTIAZW6A.js");
518
+ const { integrate: integrate2 } = await import("./interpreter-TDPDELJC.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-WTIAZW6A.js");
522
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-TDPDELJC.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 maxIterations = parseInt(element.attributes["max-iterations"] || "3", 10);
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:
@@ -1717,7 +1718,7 @@ async function executeTagCheck(session, element) {
1717
1718
  const executeTag = correctedTag || tagName;
1718
1719
  console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
1719
1720
  const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
1720
- const { integrate: integrate2 } = await import("./interpreter-WTIAZW6A.js");
1721
+ const { integrate: integrate2 } = await import("./interpreter-TDPDELJC.js");
1721
1722
  await integrate2(session, elementToExecute);
1722
1723
  }
1723
1724
  }
@@ -1726,7 +1727,7 @@ async function executeTagCheck(session, element) {
1726
1727
  // src/tags/throw.ts
1727
1728
  async function executeThrow(session, element) {
1728
1729
  const exceptionName = element.attributes?.name || "exception";
1729
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-WTIAZW6A.js");
1730
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-TDPDELJC.js");
1730
1731
  const exceptionDom = {
1731
1732
  tag: "exception-content",
1732
1733
  attributes: { name: exceptionName },
@@ -1739,7 +1740,7 @@ async function executeThrow(session, element) {
1739
1740
  // src/tags/try.ts
1740
1741
  async function executeTry(session, element) {
1741
1742
  setExceptionBoundary(session);
1742
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-WTIAZW6A.js");
1743
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-TDPDELJC.js");
1743
1744
  await integrateChildren2(session, element);
1744
1745
  unsetExceptionBoundary(session);
1745
1746
  }
@@ -1749,7 +1750,7 @@ async function executeCatch(session, element) {
1749
1750
  const exceptionName = element.attributes?.name || "exception";
1750
1751
  const caughtCount = lookupException(session, exceptionName);
1751
1752
  if (caughtCount > 0) {
1752
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-WTIAZW6A.js");
1753
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-TDPDELJC.js");
1753
1754
  await integrateChildren2(session, element);
1754
1755
  }
1755
1756
  flushCurrentException(session);
@@ -1758,7 +1759,7 @@ async function executeCatch(session, element) {
1758
1759
  // src/tags/exception.ts
1759
1760
  async function executeException(session, element) {
1760
1761
  const exceptions = getCurrentExceptions(session);
1761
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-WTIAZW6A.js");
1762
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-TDPDELJC.js");
1762
1763
  for (const exceptionDom of exceptions) {
1763
1764
  await integrateChildren2(session, exceptionDom);
1764
1765
  }
@@ -2226,7 +2227,7 @@ async function executeLoadContext(session, element) {
2226
2227
  query = element.text.trim();
2227
2228
  }
2228
2229
  if (!query && element.children.length > 0) {
2229
- const { integrate: integrate2 } = await import("./interpreter-WTIAZW6A.js");
2230
+ const { integrate: integrate2 } = await import("./interpreter-TDPDELJC.js");
2230
2231
  const beforeOutput = session.output.length;
2231
2232
  for (const child of element.children) {
2232
2233
  await integrate2(session, child);
@@ -2479,7 +2480,7 @@ async function executeForeach(session, element) {
2479
2480
  const parser2 = new DiracParser2();
2480
2481
  try {
2481
2482
  const fromElement = parser2.parse(fromAttr);
2482
- const { integrate: integrate2 } = await import("./interpreter-WTIAZW6A.js");
2483
+ const { integrate: integrate2 } = await import("./interpreter-TDPDELJC.js");
2483
2484
  await integrate2(session, fromElement);
2484
2485
  } catch (e) {
2485
2486
  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-4IFJOZTM.js";
8
- import "./chunk-YM4HLLAJ.js";
7
+ } from "./chunk-3IC2OMWT.js";
8
+ import "./chunk-XNH4TU3Q.js";
9
9
  import "./chunk-HRHAMPOB.js";
10
10
  import "./chunk-NKA6ZJDV.js";
11
11
  import "./chunk-3UW6GWYQ.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-UYCIYNMN.js");
112
+ const { DiracShell } = await import("./shell-YYSQKOZV.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-MRVK3EEX.js");
161
+ const { runAgentDaemon } = await import("./agent-Y5D5SMAS.js");
162
162
  await runAgentDaemon();
163
163
  return;
164
164
  }
165
- const { AgentCLI } = await import("./agent-MRVK3EEX.js");
165
+ const { AgentCLI } = await import("./agent-Y5D5SMAS.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-UYCIYNMN.js");
193
- const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-FWNQKCMU.js");
192
+ const { DiracShell } = await import("./shell-YYSQKOZV.js");
193
+ const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-RZYUXJFQ.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-FWNQKCMU.js");
239
+ const { SessionServer } = await import("./session-server-RZYUXJFQ.js");
240
240
  const server = new SessionServer();
241
241
  await server.start();
242
242
  console.log("Session daemon started");
@@ -3,7 +3,7 @@ import {
3
3
  listCronJobs,
4
4
  stopAllCronJobs,
5
5
  stopCronJob
6
- } from "./chunk-YM4HLLAJ.js";
6
+ } from "./chunk-XNH4TU3Q.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-NKA6ZJDV.js";
9
9
  import "./chunk-3UW6GWYQ.js";
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@ import {
2
2
  createLLMAdapter,
3
3
  execute,
4
4
  executeUserCommand
5
- } from "./chunk-4IFJOZTM.js";
5
+ } from "./chunk-3IC2OMWT.js";
6
6
  import {
7
7
  integrate
8
- } from "./chunk-YM4HLLAJ.js";
8
+ } from "./chunk-XNH4TU3Q.js";
9
9
  import {
10
10
  DiracParser
11
11
  } from "./chunk-HRHAMPOB.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  integrate,
3
3
  integrateChildren
4
- } from "./chunk-YM4HLLAJ.js";
4
+ } from "./chunk-XNH4TU3Q.js";
5
5
  import "./chunk-HRHAMPOB.js";
6
6
  import "./chunk-NKA6ZJDV.js";
7
7
  import "./chunk-3UW6GWYQ.js";
@@ -3,7 +3,7 @@ import {
3
3
  cancelScheduledRun,
4
4
  executeRunAt,
5
5
  listScheduledRuns
6
- } from "./chunk-YM4HLLAJ.js";
6
+ } from "./chunk-XNH4TU3Q.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-NKA6ZJDV.js";
9
9
  import "./chunk-3UW6GWYQ.js";
@@ -3,7 +3,7 @@ import {
3
3
  listScheduledTasks,
4
4
  stopAllScheduledTasks,
5
5
  stopScheduledTask
6
- } from "./chunk-YM4HLLAJ.js";
6
+ } from "./chunk-XNH4TU3Q.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-NKA6ZJDV.js";
9
9
  import "./chunk-3UW6GWYQ.js";
@@ -2,8 +2,8 @@ import {
2
2
  SessionServer,
3
3
  getSocketPath,
4
4
  isSessionRunning
5
- } from "./chunk-FYOJQTDE.js";
6
- import "./chunk-YM4HLLAJ.js";
5
+ } from "./chunk-6OIMDS6G.js";
6
+ import "./chunk-XNH4TU3Q.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-YM4HLLAJ.js";
7
+ } from "./chunk-XNH4TU3Q.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-UZKFXZQD.js").then(({ stopAllScheduledTasks }) => {
283
+ import("./schedule-U4S53I4N.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-UZKFXZQD.js");
649
+ const { listScheduledTasks } = await import("./schedule-U4S53I4N.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-UZKFXZQD.js");
668
+ const { stopScheduledTask } = await import("./schedule-U4S53I4N.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-UZKFXZQD.js");
683
+ const { stopAllScheduledTasks } = await import("./schedule-U4S53I4N.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-UXGC3YC4.js");
692
+ const { listCronJobs } = await import("./cron-J54RKLKD.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-UXGC3YC4.js");
712
+ const { stopCronJob } = await import("./cron-J54RKLKD.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-UXGC3YC4.js");
727
+ const { stopAllCronJobs } = await import("./cron-J54RKLKD.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-PGD5BY5C.js");
736
+ const { listScheduledRuns } = await import("./run-at-GX2JTTG4.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-PGD5BY5C.js");
756
+ const { cancelScheduledRun } = await import("./run-at-GX2JTTG4.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-PGD5BY5C.js");
771
+ const { cancelAllScheduledRuns } = await import("./run-at-GX2JTTG4.js");
772
772
  cancelAllScheduledRuns();
773
773
  console.log("All scheduled runs cancelled.");
774
774
  } catch (error) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-YM4HLLAJ.js";
3
+ } from "./chunk-XNH4TU3Q.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirac-lang",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",