dirac-lang 0.1.50 → 0.1.51

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-QVS4OQHX.js";
3
+ } from "./chunk-D2TEBI65.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
@@ -460,12 +460,12 @@ async function executeIf(session, element) {
460
460
  const condition = await evaluatePredicate(session, conditionElement);
461
461
  if (condition) {
462
462
  if (thenElement) {
463
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-B2GRYZ27.js");
463
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-BDXB5X77.js");
464
464
  await integrateChildren2(session, thenElement);
465
465
  }
466
466
  } else {
467
467
  if (elseElement) {
468
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-B2GRYZ27.js");
468
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-BDXB5X77.js");
469
469
  await integrateChildren2(session, elseElement);
470
470
  }
471
471
  }
@@ -478,7 +478,7 @@ async function evaluatePredicate(session, predicateElement) {
478
478
  return await evaluateCondition(session, predicateElement);
479
479
  }
480
480
  const outputLengthBefore = session.output.length;
481
- const { integrate: integrate2 } = await import("./interpreter-B2GRYZ27.js");
481
+ const { integrate: integrate2 } = await import("./interpreter-BDXB5X77.js");
482
482
  await integrate2(session, predicateElement);
483
483
  const newOutputChunks = session.output.slice(outputLengthBefore);
484
484
  const result = newOutputChunks.join("").trim();
@@ -501,11 +501,11 @@ async function evaluateCondition(session, condElement) {
501
501
  }
502
502
  const outputLengthBefore = session.output.length;
503
503
  const args = [];
504
- const { integrate: integrate2 } = await import("./interpreter-B2GRYZ27.js");
504
+ const { integrate: integrate2 } = await import("./interpreter-BDXB5X77.js");
505
505
  for (const child of condElement.children) {
506
506
  if (child.tag.toLowerCase() === "arg") {
507
507
  const argOutputStart = session.output.length;
508
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-B2GRYZ27.js");
508
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-BDXB5X77.js");
509
509
  await integrateChildren2(session, child);
510
510
  const newChunks = session.output.slice(argOutputStart);
511
511
  const argValue = newChunks.join("");
@@ -939,9 +939,9 @@ Please fix these errors and generate valid Dirac XML again. Remember to only use
939
939
  }
940
940
  dialogHistory.push({ role: "assistant", content: result });
941
941
  if (contextVar) {
942
- setVariable(session, contextVar, dialogHistory, true);
942
+ setVariable(session, contextVar, JSON.stringify(dialogHistory), true);
943
943
  } else if (saveDialog) {
944
- setVariable(session, "__llm_dialog__", dialogHistory, true);
944
+ setVariable(session, "__llm_dialog__", JSON.stringify(dialogHistory), true);
945
945
  }
946
946
  if (session.debug) {
947
947
  console.error(`[LLM] Retry ${retryCount} response:
@@ -1025,9 +1025,9 @@ ${feedbackPrompt}
1025
1025
  }
1026
1026
  dialogHistory.push({ role: "assistant", content: result });
1027
1027
  if (contextVar) {
1028
- setVariable(session, contextVar, dialogHistory, true);
1028
+ setVariable(session, contextVar, JSON.stringify(dialogHistory), true);
1029
1029
  } else if (saveDialog) {
1030
- setVariable(session, "__llm_dialog__", dialogHistory, true);
1030
+ setVariable(session, "__llm_dialog__", JSON.stringify(dialogHistory), true);
1031
1031
  }
1032
1032
  if (session.debug) {
1033
1033
  console.error(`[LLM] Feedback response:
@@ -1601,7 +1601,7 @@ async function executeTagCheck(session, element) {
1601
1601
  const executeTag = correctedTag || tagName;
1602
1602
  console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
1603
1603
  const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
1604
- const { integrate: integrate2 } = await import("./interpreter-B2GRYZ27.js");
1604
+ const { integrate: integrate2 } = await import("./interpreter-BDXB5X77.js");
1605
1605
  await integrate2(session, elementToExecute);
1606
1606
  }
1607
1607
  }
@@ -1610,7 +1610,7 @@ async function executeTagCheck(session, element) {
1610
1610
  // src/tags/throw.ts
1611
1611
  async function executeThrow(session, element) {
1612
1612
  const exceptionName = element.attributes?.name || "exception";
1613
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-B2GRYZ27.js");
1613
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-BDXB5X77.js");
1614
1614
  const exceptionDom = {
1615
1615
  tag: "exception-content",
1616
1616
  attributes: { name: exceptionName },
@@ -1623,7 +1623,7 @@ async function executeThrow(session, element) {
1623
1623
  // src/tags/try.ts
1624
1624
  async function executeTry(session, element) {
1625
1625
  setExceptionBoundary(session);
1626
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-B2GRYZ27.js");
1626
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-BDXB5X77.js");
1627
1627
  await integrateChildren2(session, element);
1628
1628
  unsetExceptionBoundary(session);
1629
1629
  }
@@ -1633,7 +1633,7 @@ async function executeCatch(session, element) {
1633
1633
  const exceptionName = element.attributes?.name || "exception";
1634
1634
  const caughtCount = lookupException(session, exceptionName);
1635
1635
  if (caughtCount > 0) {
1636
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-B2GRYZ27.js");
1636
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-BDXB5X77.js");
1637
1637
  await integrateChildren2(session, element);
1638
1638
  }
1639
1639
  flushCurrentException(session);
@@ -1642,7 +1642,7 @@ async function executeCatch(session, element) {
1642
1642
  // src/tags/exception.ts
1643
1643
  async function executeException(session, element) {
1644
1644
  const exceptions = getCurrentExceptions(session);
1645
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-B2GRYZ27.js");
1645
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-BDXB5X77.js");
1646
1646
  for (const exceptionDom of exceptions) {
1647
1647
  await integrateChildren2(session, exceptionDom);
1648
1648
  }
@@ -2109,7 +2109,7 @@ async function executeLoadContext(session, element) {
2109
2109
  query = element.text.trim();
2110
2110
  }
2111
2111
  if (!query && element.children.length > 0) {
2112
- const { integrate: integrate2 } = await import("./interpreter-B2GRYZ27.js");
2112
+ const { integrate: integrate2 } = await import("./interpreter-BDXB5X77.js");
2113
2113
  const beforeOutput = session.output.length;
2114
2114
  for (const child of element.children) {
2115
2115
  await integrate2(session, child);
@@ -2362,7 +2362,7 @@ async function executeForeach(session, element) {
2362
2362
  const parser2 = new DiracParser2();
2363
2363
  try {
2364
2364
  const fromElement = parser2.parse(fromAttr);
2365
- const { integrate: integrate2 } = await import("./interpreter-B2GRYZ27.js");
2365
+ const { integrate: integrate2 } = await import("./interpreter-BDXB5X77.js");
2366
2366
  await integrate2(session, fromElement);
2367
2367
  } catch (e) {
2368
2368
  session.output = savedOutput;
package/dist/cli.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  } from "./chunk-UEFKQRYN.js";
5
5
  import {
6
6
  execute
7
- } from "./chunk-OXJPF74W.js";
8
- import "./chunk-QVS4OQHX.js";
7
+ } from "./chunk-BSEXAELC.js";
8
+ import "./chunk-D2TEBI65.js";
9
9
  import "./chunk-HRHAMPOB.js";
10
10
  import "./chunk-ZY37RS4P.js";
11
11
  import "./chunk-A4SFB5W4.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.50",
19
+ version: "0.1.51",
20
20
  description: "LLM-Augmented Declarative Execution",
21
21
  type: "module",
22
22
  main: "dist/index.js",
@@ -96,7 +96,7 @@ async function main() {
96
96
  process.exit(0);
97
97
  }
98
98
  if (args[0] === "shell") {
99
- const { DiracShell } = await import("./shell-PFR2L6TC.js");
99
+ const { DiracShell } = await import("./shell-QS4PSAF6.js");
100
100
  const shellConfig = { debug: false };
101
101
  for (let i = 1; i < args.length; i++) {
102
102
  const arg = args[i];
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@ import {
2
2
  createLLMAdapter,
3
3
  execute,
4
4
  executeUserCommand
5
- } from "./chunk-OXJPF74W.js";
5
+ } from "./chunk-BSEXAELC.js";
6
6
  import {
7
7
  integrate
8
- } from "./chunk-QVS4OQHX.js";
8
+ } from "./chunk-D2TEBI65.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-QVS4OQHX.js";
4
+ } from "./chunk-D2TEBI65.js";
5
5
  import "./chunk-HRHAMPOB.js";
6
6
  import "./chunk-ZY37RS4P.js";
7
7
  import "./chunk-A4SFB5W4.js";
@@ -3,7 +3,7 @@ import {
3
3
  listScheduledTasks,
4
4
  stopAllScheduledTasks,
5
5
  stopScheduledTask
6
- } from "./chunk-QVS4OQHX.js";
6
+ } from "./chunk-D2TEBI65.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-ZY37RS4P.js";
9
9
  import "./chunk-A4SFB5W4.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-UEFKQRYN.js";
5
5
  import {
6
6
  integrate
7
- } from "./chunk-QVS4OQHX.js";
7
+ } from "./chunk-D2TEBI65.js";
8
8
  import {
9
9
  DiracParser
10
10
  } from "./chunk-HRHAMPOB.js";
@@ -131,7 +131,7 @@ var DiracShell = class {
131
131
  });
132
132
  this.rl.on("close", () => {
133
133
  this.saveHistory();
134
- import("./schedule-3GZLMGAR.js").then(({ stopAllScheduledTasks }) => {
134
+ import("./schedule-WF4BAWHX.js").then(({ stopAllScheduledTasks }) => {
135
135
  stopAllScheduledTasks();
136
136
  console.log("\nGoodbye!");
137
137
  process.exit(0);
@@ -452,7 +452,7 @@ Examples:
452
452
  break;
453
453
  case "tasks":
454
454
  try {
455
- const { listScheduledTasks } = await import("./schedule-3GZLMGAR.js");
455
+ const { listScheduledTasks } = await import("./schedule-WF4BAWHX.js");
456
456
  const tasks = listScheduledTasks();
457
457
  if (tasks.length === 0) {
458
458
  console.log("No scheduled tasks running.");
@@ -471,7 +471,7 @@ Examples:
471
471
  console.log("Usage: :stop <task-name>");
472
472
  } else {
473
473
  try {
474
- const { stopScheduledTask } = await import("./schedule-3GZLMGAR.js");
474
+ const { stopScheduledTask } = await import("./schedule-WF4BAWHX.js");
475
475
  const taskName = args[0];
476
476
  const stopped = stopScheduledTask(taskName);
477
477
  if (stopped) {
@@ -486,7 +486,7 @@ Examples:
486
486
  break;
487
487
  case "stopall":
488
488
  try {
489
- const { stopAllScheduledTasks } = await import("./schedule-3GZLMGAR.js");
489
+ const { stopAllScheduledTasks } = await import("./schedule-WF4BAWHX.js");
490
490
  stopAllScheduledTasks();
491
491
  console.log("All scheduled tasks stopped.");
492
492
  } catch (error) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-QVS4OQHX.js";
3
+ } from "./chunk-D2TEBI65.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.50",
3
+ "version": "0.1.51",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",