dirac-lang 0.1.52 → 0.1.53

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-RTIIVKY5.js";
3
+ } from "./chunk-QZGTAT3E.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
@@ -472,12 +472,12 @@ async function executeIf(session, element) {
472
472
  const condition = await evaluatePredicate(session, conditionElement);
473
473
  if (condition) {
474
474
  if (thenElement) {
475
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-3UK7U2HN.js");
475
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-I4SRKXYK.js");
476
476
  await integrateChildren2(session, thenElement);
477
477
  }
478
478
  } else {
479
479
  if (elseElement) {
480
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-3UK7U2HN.js");
480
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-I4SRKXYK.js");
481
481
  await integrateChildren2(session, elseElement);
482
482
  }
483
483
  }
@@ -490,7 +490,7 @@ async function evaluatePredicate(session, predicateElement) {
490
490
  return await evaluateCondition(session, predicateElement);
491
491
  }
492
492
  const outputLengthBefore = session.output.length;
493
- const { integrate: integrate2 } = await import("./interpreter-3UK7U2HN.js");
493
+ const { integrate: integrate2 } = await import("./interpreter-I4SRKXYK.js");
494
494
  await integrate2(session, predicateElement);
495
495
  const newOutputChunks = session.output.slice(outputLengthBefore);
496
496
  const result = newOutputChunks.join("").trim();
@@ -513,11 +513,11 @@ async function evaluateCondition(session, condElement) {
513
513
  }
514
514
  const outputLengthBefore = session.output.length;
515
515
  const args = [];
516
- const { integrate: integrate2 } = await import("./interpreter-3UK7U2HN.js");
516
+ const { integrate: integrate2 } = await import("./interpreter-I4SRKXYK.js");
517
517
  for (const child of condElement.children) {
518
518
  if (child.tag.toLowerCase() === "arg") {
519
519
  const argOutputStart = session.output.length;
520
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-3UK7U2HN.js");
520
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-I4SRKXYK.js");
521
521
  await integrateChildren2(session, child);
522
522
  const newChunks = session.output.slice(argOutputStart);
523
523
  const argValue = newChunks.join("");
@@ -1613,7 +1613,7 @@ async function executeTagCheck(session, element) {
1613
1613
  const executeTag = correctedTag || tagName;
1614
1614
  console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
1615
1615
  const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
1616
- const { integrate: integrate2 } = await import("./interpreter-3UK7U2HN.js");
1616
+ const { integrate: integrate2 } = await import("./interpreter-I4SRKXYK.js");
1617
1617
  await integrate2(session, elementToExecute);
1618
1618
  }
1619
1619
  }
@@ -1622,7 +1622,7 @@ async function executeTagCheck(session, element) {
1622
1622
  // src/tags/throw.ts
1623
1623
  async function executeThrow(session, element) {
1624
1624
  const exceptionName = element.attributes?.name || "exception";
1625
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-3UK7U2HN.js");
1625
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-I4SRKXYK.js");
1626
1626
  const exceptionDom = {
1627
1627
  tag: "exception-content",
1628
1628
  attributes: { name: exceptionName },
@@ -1635,7 +1635,7 @@ async function executeThrow(session, element) {
1635
1635
  // src/tags/try.ts
1636
1636
  async function executeTry(session, element) {
1637
1637
  setExceptionBoundary(session);
1638
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-3UK7U2HN.js");
1638
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-I4SRKXYK.js");
1639
1639
  await integrateChildren2(session, element);
1640
1640
  unsetExceptionBoundary(session);
1641
1641
  }
@@ -1645,7 +1645,7 @@ async function executeCatch(session, element) {
1645
1645
  const exceptionName = element.attributes?.name || "exception";
1646
1646
  const caughtCount = lookupException(session, exceptionName);
1647
1647
  if (caughtCount > 0) {
1648
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-3UK7U2HN.js");
1648
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-I4SRKXYK.js");
1649
1649
  await integrateChildren2(session, element);
1650
1650
  }
1651
1651
  flushCurrentException(session);
@@ -1654,7 +1654,7 @@ async function executeCatch(session, element) {
1654
1654
  // src/tags/exception.ts
1655
1655
  async function executeException(session, element) {
1656
1656
  const exceptions = getCurrentExceptions(session);
1657
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-3UK7U2HN.js");
1657
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-I4SRKXYK.js");
1658
1658
  for (const exceptionDom of exceptions) {
1659
1659
  await integrateChildren2(session, exceptionDom);
1660
1660
  }
@@ -1892,6 +1892,7 @@ var SubroutineRegistry = class {
1892
1892
  */
1893
1893
  async indexDirectory(dirPath) {
1894
1894
  let count = 0;
1895
+ const absoluteDirPath = path3.isAbsolute(dirPath) ? dirPath : path3.resolve(process.cwd(), dirPath);
1895
1896
  const scanDir = (dir) => {
1896
1897
  const entries = fs4.readdirSync(dir, { withFileTypes: true });
1897
1898
  for (const entry of entries) {
@@ -1903,7 +1904,7 @@ var SubroutineRegistry = class {
1903
1904
  }
1904
1905
  }
1905
1906
  };
1906
- scanDir(dirPath);
1907
+ scanDir(absoluteDirPath);
1907
1908
  this.saveIndex();
1908
1909
  return count;
1909
1910
  }
@@ -2121,7 +2122,7 @@ async function executeLoadContext(session, element) {
2121
2122
  query = element.text.trim();
2122
2123
  }
2123
2124
  if (!query && element.children.length > 0) {
2124
- const { integrate: integrate2 } = await import("./interpreter-3UK7U2HN.js");
2125
+ const { integrate: integrate2 } = await import("./interpreter-I4SRKXYK.js");
2125
2126
  const beforeOutput = session.output.length;
2126
2127
  for (const child of element.children) {
2127
2128
  await integrate2(session, child);
@@ -2163,8 +2164,8 @@ async function executeLoadContext(session, element) {
2163
2164
  if (shouldImport) {
2164
2165
  for (const filePath of fileMap.keys()) {
2165
2166
  try {
2166
- const { resolve: resolve3 } = await import("path");
2167
- const absolutePath = filePath.startsWith("/") ? filePath : resolve3(process.cwd(), filePath);
2167
+ const { resolve: resolve4 } = await import("path");
2168
+ const absolutePath = filePath.startsWith("/") ? filePath : resolve4(process.cwd(), filePath);
2168
2169
  const importElement = {
2169
2170
  tag: "import",
2170
2171
  attributes: { src: absolutePath },
@@ -2197,7 +2198,7 @@ async function executeLoadContext(session, element) {
2197
2198
 
2198
2199
  // src/tags/save-subroutine.ts
2199
2200
  import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync5 } from "fs";
2200
- import { resolve as resolve2, dirname as dirname4, join as join4 } from "path";
2201
+ import { resolve as resolve3, dirname as dirname4, join as join4 } from "path";
2201
2202
  import { homedir as homedir4 } from "os";
2202
2203
  async function executeSaveSubroutine(session, element) {
2203
2204
  const name = element.attributes.name;
@@ -2225,7 +2226,7 @@ async function executeSaveSubroutine(session, element) {
2225
2226
  }
2226
2227
  let filePath;
2227
2228
  if (file) {
2228
- filePath = resolve2(process.cwd(), file);
2229
+ filePath = resolve3(process.cwd(), file);
2229
2230
  } else if (pathAttr) {
2230
2231
  const targetDir = join4(homedir4(), ".dirac", "lib", pathAttr);
2231
2232
  filePath = join4(targetDir, `${name}.di`);
@@ -2374,7 +2375,7 @@ async function executeForeach(session, element) {
2374
2375
  const parser2 = new DiracParser2();
2375
2376
  try {
2376
2377
  const fromElement = parser2.parse(fromAttr);
2377
- const { integrate: integrate2 } = await import("./interpreter-3UK7U2HN.js");
2378
+ const { integrate: integrate2 } = await import("./interpreter-I4SRKXYK.js");
2378
2379
  await integrate2(session, fromElement);
2379
2380
  } catch (e) {
2380
2381
  session.output = savedOutput;
@@ -2563,7 +2564,7 @@ async function readAllStdin() {
2563
2564
  process.stdin.removeAllListeners("data");
2564
2565
  process.stdin.removeAllListeners("end");
2565
2566
  process.stdin.removeAllListeners("error");
2566
- return new Promise((resolve3, reject) => {
2567
+ return new Promise((resolve4, reject) => {
2567
2568
  const chunks = [];
2568
2569
  const onData = (chunk) => {
2569
2570
  chunks.push(chunk);
@@ -2573,7 +2574,7 @@ async function readAllStdin() {
2573
2574
  process.stdin.removeListener("data", onData);
2574
2575
  process.stdin.removeListener("end", onEnd);
2575
2576
  process.stdin.removeListener("error", onError);
2576
- resolve3(result);
2577
+ resolve4(result);
2577
2578
  };
2578
2579
  const onError = (err) => {
2579
2580
  process.stdin.removeListener("data", onData);
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-7YGLAG6M.js";
8
- import "./chunk-RTIIVKY5.js";
7
+ } from "./chunk-EXP3R5ZJ.js";
8
+ import "./chunk-QZGTAT3E.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.52",
19
+ version: "0.1.53",
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-MJDYFPAB.js");
99
+ const { DiracShell } = await import("./shell-TYEEQWCC.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-7YGLAG6M.js";
5
+ } from "./chunk-EXP3R5ZJ.js";
6
6
  import {
7
7
  integrate
8
- } from "./chunk-RTIIVKY5.js";
8
+ } from "./chunk-QZGTAT3E.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-RTIIVKY5.js";
4
+ } from "./chunk-QZGTAT3E.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-RTIIVKY5.js";
6
+ } from "./chunk-QZGTAT3E.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-RTIIVKY5.js";
7
+ } from "./chunk-QZGTAT3E.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-5GCBLXBP.js").then(({ stopAllScheduledTasks }) => {
134
+ import("./schedule-7ZFCWNEF.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-5GCBLXBP.js");
455
+ const { listScheduledTasks } = await import("./schedule-7ZFCWNEF.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-5GCBLXBP.js");
474
+ const { stopScheduledTask } = await import("./schedule-7ZFCWNEF.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-5GCBLXBP.js");
489
+ const { stopAllScheduledTasks } = await import("./schedule-7ZFCWNEF.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-RTIIVKY5.js";
3
+ } from "./chunk-QZGTAT3E.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.52",
3
+ "version": "0.1.53",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",