dirac-lang 0.1.70 → 0.1.73

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-2SJHHQ5D.js";
6
- import "./chunk-WW2OXQZN.js";
5
+ } from "./chunk-KIIETJFM.js";
6
+ import "./chunk-YCUHRNXQ.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-VC23AJJJ.js";
9
9
  import "./chunk-M57VI7KL.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-WW2OXQZN.js";
3
+ } from "./chunk-YCUHRNXQ.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-WW2OXQZN.js";
3
+ } from "./chunk-YCUHRNXQ.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
@@ -181,6 +181,7 @@ async function executeAssign(session, element) {
181
181
  const name = element.attributes.name;
182
182
  const valueAttr = element.attributes.value;
183
183
  const trimAttr = element.attributes.trim;
184
+ const typeAttr = element.attributes.type;
184
185
  if (!name) {
185
186
  throw new Error("<assign> requires name attribute");
186
187
  }
@@ -203,6 +204,12 @@ async function executeAssign(session, element) {
203
204
  if (trimAttr === "true" && typeof value === "string") {
204
205
  value = value.trim();
205
206
  }
207
+ if (typeAttr === "cat") {
208
+ const existingValue = getVariable(session, name);
209
+ if (existingValue !== void 0) {
210
+ value = String(existingValue) + String(value);
211
+ }
212
+ }
206
213
  for (let i = session.variables.length - 1; i >= 0; i--) {
207
214
  if (session.variables[i].name === name) {
208
215
  session.variables[i].value = value;
@@ -474,12 +481,12 @@ async function executeIf(session, element) {
474
481
  const condition = await evaluatePredicate(session, conditionElement);
475
482
  if (condition) {
476
483
  if (thenElement) {
477
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-TKNNX6UX.js");
484
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-QVHRO4LN.js");
478
485
  await integrateChildren2(session, thenElement);
479
486
  }
480
487
  } else {
481
488
  if (elseElement) {
482
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-TKNNX6UX.js");
489
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-QVHRO4LN.js");
483
490
  await integrateChildren2(session, elseElement);
484
491
  }
485
492
  }
@@ -492,7 +499,7 @@ async function evaluatePredicate(session, predicateElement) {
492
499
  return await evaluateCondition(session, predicateElement);
493
500
  }
494
501
  const outputLengthBefore = session.output.length;
495
- const { integrate: integrate2 } = await import("./interpreter-TKNNX6UX.js");
502
+ const { integrate: integrate2 } = await import("./interpreter-QVHRO4LN.js");
496
503
  await integrate2(session, predicateElement);
497
504
  const newOutputChunks = session.output.slice(outputLengthBefore);
498
505
  const result = newOutputChunks.join("").trim();
@@ -515,11 +522,11 @@ async function evaluateCondition(session, condElement) {
515
522
  }
516
523
  const outputLengthBefore = session.output.length;
517
524
  const args = [];
518
- const { integrate: integrate2 } = await import("./interpreter-TKNNX6UX.js");
525
+ const { integrate: integrate2 } = await import("./interpreter-QVHRO4LN.js");
519
526
  for (const child of condElement.children) {
520
527
  if (child.tag.toLowerCase() === "arg") {
521
528
  const argOutputStart = session.output.length;
522
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-TKNNX6UX.js");
529
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-QVHRO4LN.js");
523
530
  await integrateChildren2(session, child);
524
531
  const newChunks = session.output.slice(argOutputStart);
525
532
  const argValue = newChunks.join("");
@@ -1117,6 +1124,9 @@ ${validation.errorMessages.join("\n")}`);
1117
1124
  if (feedbackMode) {
1118
1125
  const outputAfter = session.output.slice();
1119
1126
  const executionOutput = outputAfter.slice(outputBefore.length).join("");
1127
+ if (executionOutput) {
1128
+ process.stdout.write(executionOutput);
1129
+ }
1120
1130
  if (session.debug) {
1121
1131
  console.error(`[LLM] Execution output (${executionOutput.length} chars):
1122
1132
  ${executionOutput}
@@ -1740,7 +1750,7 @@ async function executeTagCheck(session, element) {
1740
1750
  const executeTag = correctedTag || tagName;
1741
1751
  console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
1742
1752
  const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
1743
- const { integrate: integrate2 } = await import("./interpreter-TKNNX6UX.js");
1753
+ const { integrate: integrate2 } = await import("./interpreter-QVHRO4LN.js");
1744
1754
  await integrate2(session, elementToExecute);
1745
1755
  }
1746
1756
  }
@@ -1749,7 +1759,7 @@ async function executeTagCheck(session, element) {
1749
1759
  // src/tags/throw.ts
1750
1760
  async function executeThrow(session, element) {
1751
1761
  const exceptionName = element.attributes?.name || "exception";
1752
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-TKNNX6UX.js");
1762
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-QVHRO4LN.js");
1753
1763
  const exceptionDom = {
1754
1764
  tag: "exception-content",
1755
1765
  attributes: { name: exceptionName },
@@ -1762,7 +1772,7 @@ async function executeThrow(session, element) {
1762
1772
  // src/tags/try.ts
1763
1773
  async function executeTry(session, element) {
1764
1774
  setExceptionBoundary(session);
1765
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-TKNNX6UX.js");
1775
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-QVHRO4LN.js");
1766
1776
  await integrateChildren2(session, element);
1767
1777
  unsetExceptionBoundary(session);
1768
1778
  }
@@ -1772,7 +1782,7 @@ async function executeCatch(session, element) {
1772
1782
  const exceptionName = element.attributes?.name || "exception";
1773
1783
  const caughtCount = lookupException(session, exceptionName);
1774
1784
  if (caughtCount > 0) {
1775
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-TKNNX6UX.js");
1785
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-QVHRO4LN.js");
1776
1786
  await integrateChildren2(session, element);
1777
1787
  }
1778
1788
  flushCurrentException(session);
@@ -1781,7 +1791,7 @@ async function executeCatch(session, element) {
1781
1791
  // src/tags/exception.ts
1782
1792
  async function executeException(session, element) {
1783
1793
  const exceptions = getCurrentExceptions(session);
1784
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-TKNNX6UX.js");
1794
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-QVHRO4LN.js");
1785
1795
  for (const exceptionDom of exceptions) {
1786
1796
  await integrateChildren2(session, exceptionDom);
1787
1797
  }
@@ -2249,7 +2259,7 @@ async function executeLoadContext(session, element) {
2249
2259
  query = element.text.trim();
2250
2260
  }
2251
2261
  if (!query && element.children.length > 0) {
2252
- const { integrate: integrate2 } = await import("./interpreter-TKNNX6UX.js");
2262
+ const { integrate: integrate2 } = await import("./interpreter-QVHRO4LN.js");
2253
2263
  const beforeOutput = session.output.length;
2254
2264
  for (const child of element.children) {
2255
2265
  await integrate2(session, child);
@@ -2354,6 +2364,8 @@ async function executeSaveSubroutine(session, element) {
2354
2364
  let filePath;
2355
2365
  if (file) {
2356
2366
  filePath = resolve3(process.cwd(), file);
2367
+ } else if (subroutine.sourcePath && existsSync5(dirname4(subroutine.sourcePath))) {
2368
+ filePath = subroutine.sourcePath;
2357
2369
  } else if (pathAttr) {
2358
2370
  const targetDir = join4(homedir4(), ".dirac", "lib", pathAttr);
2359
2371
  filePath = join4(targetDir, `${name}.di`);
@@ -2368,6 +2380,11 @@ async function executeSaveSubroutine(session, element) {
2368
2380
  writeFileSync4(filePath, content, "utf-8");
2369
2381
  emit(session, `Subroutine '${name}' saved to: ${filePath}
2370
2382
  `);
2383
+ const savedSub = session.subroutines.find((s) => s.name === name);
2384
+ if (savedSub) {
2385
+ savedSub.sourcePath = filePath;
2386
+ savedSub.modified = false;
2387
+ }
2371
2388
  if (session.debug) {
2372
2389
  console.error(`[save-subroutine] Saved '${name}' to: ${filePath}`);
2373
2390
  }
@@ -2492,7 +2509,7 @@ function escapeXml3(text) {
2492
2509
  }
2493
2510
 
2494
2511
  // src/tags/edit-subroutine.ts
2495
- import { writeFileSync as writeFileSync5, readFileSync as readFileSync3, unlinkSync } from "fs";
2512
+ import { writeFileSync as writeFileSync5, readFileSync as readFileSync3, unlinkSync, existsSync as existsSync6 } from "fs";
2496
2513
  import { tmpdir } from "os";
2497
2514
  import { join as join5 } from "path";
2498
2515
  import { spawnSync } from "child_process";
@@ -2512,7 +2529,36 @@ async function executeEditSubroutine(session, element) {
2512
2529
  if (!subroutine) {
2513
2530
  throw new Error(`Subroutine '${name}' not found in session`);
2514
2531
  }
2515
- const xml = serializeSubroutineToXML(subroutine);
2532
+ let xml;
2533
+ if (subroutine.sourcePath && existsSync6(subroutine.sourcePath)) {
2534
+ try {
2535
+ const sourceContent = readFileSync3(subroutine.sourcePath, "utf-8");
2536
+ const match = sourceContent.match(
2537
+ new RegExp(`<subroutine\\s+name="${name}"[\\s\\S]*?<\\/subroutine>`, "i")
2538
+ );
2539
+ if (match) {
2540
+ xml = match[0];
2541
+ if (session.debug) {
2542
+ console.error(`[edit-subroutine] Loaded from source: ${subroutine.sourcePath}`);
2543
+ }
2544
+ } else {
2545
+ xml = serializeSubroutineToXML(subroutine);
2546
+ if (session.debug) {
2547
+ console.error(`[edit-subroutine] Could not extract from source, using serialization`);
2548
+ }
2549
+ }
2550
+ } catch (err) {
2551
+ xml = serializeSubroutineToXML(subroutine);
2552
+ if (session.debug) {
2553
+ console.error(`[edit-subroutine] Error reading source file, using serialization`);
2554
+ }
2555
+ }
2556
+ } else {
2557
+ xml = serializeSubroutineToXML(subroutine);
2558
+ if (session.debug) {
2559
+ console.error(`[edit-subroutine] No source file, serializing from AST`);
2560
+ }
2561
+ }
2516
2562
  const tempFile = join5(tmpdir(), `dirac-edit-${name}-${Date.now()}.di`);
2517
2563
  writeFileSync5(tempFile, xml, "utf-8");
2518
2564
  if (session.debug) {
@@ -2537,9 +2583,19 @@ async function executeEditSubroutine(session, element) {
2537
2583
  if (session.debug) {
2538
2584
  console.error(`[edit-subroutine] Editor closed, re-importing subroutine`);
2539
2585
  }
2586
+ const originalSourcePath = subroutine.sourcePath;
2587
+ const oldIndex = session.subroutines.findIndex((s) => s.name === name);
2588
+ if (oldIndex !== -1) {
2589
+ session.subroutines.splice(oldIndex, 1);
2590
+ }
2540
2591
  const parser = new DiracParser();
2541
2592
  const ast = parser.parse(editedContent);
2542
2593
  await integrate(session, ast);
2594
+ const editedSub = session.subroutines.find((s) => s.name === name);
2595
+ if (editedSub) {
2596
+ editedSub.modified = true;
2597
+ editedSub.sourcePath = originalSourcePath;
2598
+ }
2543
2599
  emit(session, `Subroutine '${name}' updated in session (use save-subroutine to persist)
2544
2600
  `);
2545
2601
  }
@@ -2551,9 +2607,14 @@ function serializeSubroutineToXML(sub) {
2551
2607
  return lines.join("\n");
2552
2608
  }
2553
2609
  function serializeElement2(el, lines, indent) {
2554
- if (!el || !el.tag) {
2555
- if (el && typeof el === "string") {
2556
- lines.push(indent + el);
2610
+ if (!el.tag || el.tag === "") {
2611
+ if (el.text) {
2612
+ let lastIdx = lines.length - 1;
2613
+ if (lastIdx >= 0 && !lines[lastIdx].endsWith(">")) {
2614
+ lines[lastIdx] += el.text;
2615
+ } else {
2616
+ lines.push(indent + el.text);
2617
+ }
2557
2618
  }
2558
2619
  return;
2559
2620
  }
@@ -2566,22 +2627,46 @@ function serializeElement2(el, lines, indent) {
2566
2627
  }
2567
2628
  }
2568
2629
  const hasChildren = el.children && el.children.length > 0;
2569
- const hasText = el.text && el.text.trim();
2570
- if (!hasChildren && !hasText) {
2571
- lines.push(tag + " />");
2572
- } else if (hasText && !hasChildren) {
2573
- lines.push(tag + ">" + el.text + `</${el.tag}>`);
2630
+ if (!hasChildren) {
2631
+ let lastIdx = lines.length - 1;
2632
+ if (lastIdx >= 0 && !lines[lastIdx].endsWith(">") && !lines[lastIdx].trim().startsWith("<")) {
2633
+ lines[lastIdx] += tag.slice(indent.length) + " />";
2634
+ } else {
2635
+ lines.push(tag + " />");
2636
+ }
2574
2637
  } else {
2575
- lines.push(tag + ">");
2576
- if (hasText) {
2577
- lines.push(indent + " " + el.text);
2638
+ let lastIdx = lines.length - 1;
2639
+ const shouldInline = lastIdx >= 0 && !lines[lastIdx].endsWith(">");
2640
+ if (shouldInline) {
2641
+ lines[lastIdx] += tag.slice(indent.length) + ">";
2642
+ } else {
2643
+ lines.push(tag + ">");
2578
2644
  }
2579
- if (hasChildren) {
2580
- for (const child of el.children) {
2581
- serializeElement2(child, lines, indent + " ");
2645
+ let allInline = true;
2646
+ for (let i = 0; i < el.children.length; i++) {
2647
+ const child = el.children[i];
2648
+ if (!child.tag || child.tag === "") {
2649
+ lastIdx = lines.length - 1;
2650
+ if (child.text) {
2651
+ lines[lastIdx] += child.text;
2652
+ }
2653
+ } else {
2654
+ const isSimpleVar = child.tag === "variable" && child.attributes && child.attributes.name;
2655
+ if (isSimpleVar) {
2656
+ lastIdx = lines.length - 1;
2657
+ lines[lastIdx] += `<variable name="${child.attributes.name}" />`;
2658
+ } else {
2659
+ allInline = false;
2660
+ serializeElement2(child, lines, indent + " ");
2661
+ }
2582
2662
  }
2583
2663
  }
2584
- lines.push(`${indent}</${el.tag}>`);
2664
+ lastIdx = lines.length - 1;
2665
+ if (allInline || lines[lastIdx].indexOf(`<${el.tag}`) !== -1) {
2666
+ lines[lastIdx] += `</${el.tag}>`;
2667
+ } else {
2668
+ lines.push(`${indent}</${el.tag}>`);
2669
+ }
2585
2670
  }
2586
2671
  }
2587
2672
 
@@ -2605,7 +2690,7 @@ async function executeForeach(session, element) {
2605
2690
  const parser2 = new DiracParser2();
2606
2691
  try {
2607
2692
  const fromElement = parser2.parse(fromAttr);
2608
- const { integrate: integrate2 } = await import("./interpreter-TKNNX6UX.js");
2693
+ const { integrate: integrate2 } = await import("./interpreter-QVHRO4LN.js");
2609
2694
  await integrate2(session, fromElement);
2610
2695
  } catch (e) {
2611
2696
  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-3YGHR3R7.js";
8
- import "./chunk-WW2OXQZN.js";
7
+ } from "./chunk-2EUVDYHX.js";
8
+ import "./chunk-YCUHRNXQ.js";
9
9
  import "./chunk-HRHAMPOB.js";
10
10
  import "./chunk-VC23AJJJ.js";
11
11
  import "./chunk-M57VI7KL.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.69",
19
+ version: "0.1.72",
20
20
  description: "LLM-Augmented Declarative Execution",
21
21
  type: "module",
22
22
  main: "dist/index.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-GYZYKP7V.js");
112
+ const { DiracShell } = await import("./shell-EB5Z2U45.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-YEC64Z37.js");
161
+ const { runAgentDaemon } = await import("./agent-TC34E2DB.js");
162
162
  await runAgentDaemon();
163
163
  return;
164
164
  }
165
- const { AgentCLI } = await import("./agent-YEC64Z37.js");
165
+ const { AgentCLI } = await import("./agent-TC34E2DB.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-GYZYKP7V.js");
193
- const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-QQGWVEOL.js");
192
+ const { DiracShell } = await import("./shell-EB5Z2U45.js");
193
+ const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-K6OZRYTZ.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-QQGWVEOL.js");
239
+ const { SessionServer } = await import("./session-server-K6OZRYTZ.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-WW2OXQZN.js";
6
+ } from "./chunk-YCUHRNXQ.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-VC23AJJJ.js";
9
9
  import "./chunk-M57VI7KL.js";
package/dist/index.d.ts CHANGED
@@ -58,6 +58,7 @@ interface Subroutine {
58
58
  parameters?: ParameterMetadata[];
59
59
  meta?: Record<string, string>;
60
60
  sourcePath?: string;
61
+ modified?: boolean;
61
62
  }
62
63
  /**
63
64
  * Execution context - maps to MaskSession in MASK
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@ import {
2
2
  createLLMAdapter,
3
3
  execute,
4
4
  executeUserCommand
5
- } from "./chunk-3YGHR3R7.js";
5
+ } from "./chunk-2EUVDYHX.js";
6
6
  import {
7
7
  integrate
8
- } from "./chunk-WW2OXQZN.js";
8
+ } from "./chunk-YCUHRNXQ.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-WW2OXQZN.js";
4
+ } from "./chunk-YCUHRNXQ.js";
5
5
  import "./chunk-HRHAMPOB.js";
6
6
  import "./chunk-VC23AJJJ.js";
7
7
  import "./chunk-M57VI7KL.js";
@@ -3,7 +3,7 @@ import {
3
3
  cancelScheduledRun,
4
4
  executeRunAt,
5
5
  listScheduledRuns
6
- } from "./chunk-WW2OXQZN.js";
6
+ } from "./chunk-YCUHRNXQ.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-VC23AJJJ.js";
9
9
  import "./chunk-M57VI7KL.js";
@@ -3,7 +3,7 @@ import {
3
3
  listScheduledTasks,
4
4
  stopAllScheduledTasks,
5
5
  stopScheduledTask
6
- } from "./chunk-WW2OXQZN.js";
6
+ } from "./chunk-YCUHRNXQ.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-VC23AJJJ.js";
9
9
  import "./chunk-M57VI7KL.js";
@@ -2,8 +2,8 @@ import {
2
2
  SessionServer,
3
3
  getSocketPath,
4
4
  isSessionRunning
5
- } from "./chunk-2SJHHQ5D.js";
6
- import "./chunk-WW2OXQZN.js";
5
+ } from "./chunk-KIIETJFM.js";
6
+ import "./chunk-YCUHRNXQ.js";
7
7
  import "./chunk-HRHAMPOB.js";
8
8
  import "./chunk-VC23AJJJ.js";
9
9
  import "./chunk-M57VI7KL.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-AJSYOXXZ.js";
5
5
  import {
6
6
  integrate
7
- } from "./chunk-WW2OXQZN.js";
7
+ } from "./chunk-YCUHRNXQ.js";
8
8
  import {
9
9
  DiracParser
10
10
  } from "./chunk-HRHAMPOB.js";
@@ -283,6 +283,10 @@ var DiracShell = class {
283
283
  if (sub.meta && sub.meta["hide-from-llm"] === "true") {
284
284
  continue;
285
285
  }
286
+ if (sub.modified) {
287
+ unsaved.push(sub.name);
288
+ continue;
289
+ }
286
290
  if (!sub.sourcePath) {
287
291
  unsaved.push(sub.name);
288
292
  } else {
@@ -355,7 +359,7 @@ var DiracShell = class {
355
359
  if (this.client) {
356
360
  this.client.disconnect();
357
361
  }
358
- import("./schedule-G6ZSSQ5W.js").then(({ stopAllScheduledTasks }) => {
362
+ import("./schedule-FWAU6HDT.js").then(({ stopAllScheduledTasks }) => {
359
363
  stopAllScheduledTasks();
360
364
  console.log("\nGoodbye!");
361
365
  process.exit(0);
@@ -577,7 +581,9 @@ Examples:
577
581
  console.log("Variables:");
578
582
  for (const v of variables) {
579
583
  if (v.visible) {
580
- console.log(` ${v.name} = ${JSON.stringify(v.value)}`);
584
+ const formattedValue = typeof v.value === "string" && (v.value.startsWith("[") || v.value.startsWith("{")) ? JSON.stringify(JSON.parse(v.value), null, 2) : JSON.stringify(v.value);
585
+ console.log(` ${v.name} =`);
586
+ console.log(formattedValue.split("\n").map((line) => ` ${line}`).join("\n"));
581
587
  }
582
588
  }
583
589
  }
@@ -746,7 +752,7 @@ Examples:
746
752
  break;
747
753
  case "tasks":
748
754
  try {
749
- const { listScheduledTasks } = await import("./schedule-G6ZSSQ5W.js");
755
+ const { listScheduledTasks } = await import("./schedule-FWAU6HDT.js");
750
756
  const tasks = listScheduledTasks();
751
757
  if (tasks.length === 0) {
752
758
  console.log("No scheduled tasks running.");
@@ -765,7 +771,7 @@ Examples:
765
771
  console.log("Usage: :stop <task-name>");
766
772
  } else {
767
773
  try {
768
- const { stopScheduledTask } = await import("./schedule-G6ZSSQ5W.js");
774
+ const { stopScheduledTask } = await import("./schedule-FWAU6HDT.js");
769
775
  const taskName = args[0];
770
776
  const stopped = stopScheduledTask(taskName);
771
777
  if (stopped) {
@@ -780,7 +786,7 @@ Examples:
780
786
  break;
781
787
  case "stopall":
782
788
  try {
783
- const { stopAllScheduledTasks } = await import("./schedule-G6ZSSQ5W.js");
789
+ const { stopAllScheduledTasks } = await import("./schedule-FWAU6HDT.js");
784
790
  stopAllScheduledTasks();
785
791
  console.log("All scheduled tasks stopped.");
786
792
  } catch (error) {
@@ -789,7 +795,7 @@ Examples:
789
795
  break;
790
796
  case "crons":
791
797
  try {
792
- const { listCronJobs } = await import("./cron-GZ5XXDBY.js");
798
+ const { listCronJobs } = await import("./cron-M5HO2H5T.js");
793
799
  const jobs = listCronJobs();
794
800
  if (jobs.length === 0) {
795
801
  console.log("No cron jobs running.");
@@ -809,7 +815,7 @@ Examples:
809
815
  console.log("Usage: :stopcron <job-name>");
810
816
  } else {
811
817
  try {
812
- const { stopCronJob } = await import("./cron-GZ5XXDBY.js");
818
+ const { stopCronJob } = await import("./cron-M5HO2H5T.js");
813
819
  const jobName = args[0];
814
820
  const stopped = stopCronJob(jobName);
815
821
  if (stopped) {
@@ -824,7 +830,7 @@ Examples:
824
830
  break;
825
831
  case "stopallcrons":
826
832
  try {
827
- const { stopAllCronJobs } = await import("./cron-GZ5XXDBY.js");
833
+ const { stopAllCronJobs } = await import("./cron-M5HO2H5T.js");
828
834
  stopAllCronJobs();
829
835
  console.log("All cron jobs stopped.");
830
836
  } catch (error) {
@@ -833,7 +839,7 @@ Examples:
833
839
  break;
834
840
  case "scheduled":
835
841
  try {
836
- const { listScheduledRuns } = await import("./run-at-ZYUWD64S.js");
842
+ const { listScheduledRuns } = await import("./run-at-GP5XZP5W.js");
837
843
  const runs = listScheduledRuns();
838
844
  if (runs.length === 0) {
839
845
  console.log("No scheduled runs pending.");
@@ -853,7 +859,7 @@ Examples:
853
859
  console.log("Usage: :cancel <run-name>");
854
860
  } else {
855
861
  try {
856
- const { cancelScheduledRun } = await import("./run-at-ZYUWD64S.js");
862
+ const { cancelScheduledRun } = await import("./run-at-GP5XZP5W.js");
857
863
  const runName = args[0];
858
864
  const cancelled = cancelScheduledRun(runName);
859
865
  if (cancelled) {
@@ -868,7 +874,7 @@ Examples:
868
874
  break;
869
875
  case "cancelall":
870
876
  try {
871
- const { cancelAllScheduledRuns } = await import("./run-at-ZYUWD64S.js");
877
+ const { cancelAllScheduledRuns } = await import("./run-at-GP5XZP5W.js");
872
878
  cancelAllScheduledRuns();
873
879
  console.log("All scheduled runs cancelled.");
874
880
  } catch (error) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-WW2OXQZN.js";
3
+ } from "./chunk-YCUHRNXQ.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.70",
3
+ "version": "0.1.73",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",