dirac-lang 0.1.86 → 0.1.88

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-VEFJ4NM3.js";
6
- import "./chunk-WVFFIHZL.js";
5
+ } from "./chunk-7RXHPRIW.js";
6
+ import "./chunk-KS5BEPQN.js";
7
7
  import "./chunk-HJSHCEK4.js";
8
8
  import "./chunk-BGG2SULN.js";
9
9
  import "./chunk-HRHAMPOB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-WVFFIHZL.js";
3
+ } from "./chunk-KS5BEPQN.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
@@ -487,12 +487,12 @@ async function executeIf(session, element) {
487
487
  const condition = await evaluatePredicate(session, conditionElement);
488
488
  if (condition) {
489
489
  if (thenElement) {
490
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
490
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-PTTFEDJF.js");
491
491
  await integrateChildren2(session, thenElement);
492
492
  }
493
493
  } else {
494
494
  if (elseElement) {
495
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
495
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-PTTFEDJF.js");
496
496
  await integrateChildren2(session, elseElement);
497
497
  }
498
498
  }
@@ -505,7 +505,7 @@ async function evaluatePredicate(session, predicateElement) {
505
505
  return await evaluateCondition(session, predicateElement);
506
506
  }
507
507
  const outputLengthBefore = session.output.length;
508
- const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
508
+ const { integrate: integrate2 } = await import("./interpreter-PTTFEDJF.js");
509
509
  await integrate2(session, predicateElement);
510
510
  const newOutputChunks = session.output.slice(outputLengthBefore);
511
511
  const result = newOutputChunks.join("").trim();
@@ -528,11 +528,11 @@ async function evaluateCondition(session, condElement) {
528
528
  }
529
529
  const outputLengthBefore = session.output.length;
530
530
  const args = [];
531
- const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
531
+ const { integrate: integrate2 } = await import("./interpreter-PTTFEDJF.js");
532
532
  for (const child of condElement.children) {
533
533
  if (child.tag.toLowerCase() === "arg") {
534
534
  const argOutputStart = session.output.length;
535
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
535
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-PTTFEDJF.js");
536
536
  await integrateChildren2(session, child);
537
537
  const newChunks = session.output.slice(argOutputStart);
538
538
  const argValue = newChunks.join("");
@@ -859,20 +859,31 @@ async function executeLLM(session, element) {
859
859
  }
860
860
  }
861
861
  if (hasExistingDialog && (contextVar || saveDialog)) {
862
- systemPrompt = "Updated available Dirac XML tags:";
863
- for (const sub of subroutines) {
864
- systemPrompt += `
862
+ if (isCustom) {
863
+ systemPrompt = "Available tags:";
864
+ for (const sub of subroutines) {
865
+ systemPrompt += `
866
+ - ${sub.name}`;
867
+ if (sub.description) {
868
+ systemPrompt += `: ${sub.description}`;
869
+ }
870
+ }
871
+ } else {
872
+ systemPrompt = "Updated available Dirac XML tags:";
873
+ for (const sub of subroutines) {
874
+ systemPrompt += `
865
875
  - ${sub.name} : ${sub.description || ""}`;
866
- systemPrompt += `
876
+ systemPrompt += `
867
877
  Ex: <${sub.name}`;
868
- if (sub.parameters && sub.parameters.length > 0) {
869
- for (const p of sub.parameters) {
870
- systemPrompt += ` ${p.name}="${p.example || "string"}"`;
878
+ if (sub.parameters && sub.parameters.length > 0) {
879
+ for (const p of sub.parameters) {
880
+ systemPrompt += ` ${p.name}="${p.example || "string"}"`;
881
+ }
871
882
  }
883
+ let example = sub.meta?.body?.example || "";
884
+ example = example.replace(/&quot;/g, '"').replace(/&#58;/g, ":");
885
+ systemPrompt += ">" + example + "</" + sub.name + ">";
872
886
  }
873
- let example = sub.meta?.body?.example || "";
874
- example = example.replace(/&quot;/g, '"').replace(/&#58;/g, ":");
875
- systemPrompt += ">" + example + "</" + sub.name + ">";
876
887
  }
877
888
  dialogHistory.push({ role: "system", content: systemPrompt });
878
889
  currentUserPrompt = userPrompt;
@@ -880,7 +891,27 @@ async function executeLLM(session, element) {
880
891
  console.error("[LLM] Continuing dialog with updated subroutines (as system message)\n");
881
892
  }
882
893
  } else {
883
- systemPrompt = `Dirac is a XML-based language. To define a subroutine with parameters:
894
+ if (isCustom) {
895
+ systemPrompt = `Dirac is an XML-based language for defining and calling subroutines.
896
+
897
+ Example:
898
+ \`\`\`xml
899
+ <subroutine name="greet" param-name="string">
900
+ <output>Hello, <variable name="name"/>!</output>
901
+ </subroutine>
902
+ <greet name="Alice" />
903
+ \`\`\`
904
+
905
+ Available tags:`;
906
+ for (const sub of subroutines) {
907
+ systemPrompt += `
908
+ - ${sub.name}`;
909
+ if (sub.description) {
910
+ systemPrompt += `: ${sub.description}`;
911
+ }
912
+ }
913
+ } else {
914
+ systemPrompt = `Dirac is a XML-based language. To define a subroutine with parameters:
884
915
 
885
916
  \`\`\`xml
886
917
  <subroutine name="greet" param-name="string">
@@ -902,28 +933,29 @@ CRITICAL: When defining parameters:
902
933
  - Inside the subroutine, access with: <variable name="username"/>
903
934
  - When calling: <mytag username="John" /> (use parameter name directly)
904
935
  `;
905
- systemPrompt += "Now, You are an expert Dirac XML code generator.\nAllowed Dirac XML tags (use ONLY these tags):";
906
- for (const sub of subroutines) {
907
- systemPrompt += `
936
+ systemPrompt += "Now, You are an expert Dirac XML code generator.\nAllowed Dirac XML tags (use ONLY these tags):";
937
+ for (const sub of subroutines) {
938
+ systemPrompt += `
908
939
  - ${sub.name} : ${sub.description || ""}`;
909
- systemPrompt += `
940
+ systemPrompt += `
910
941
  Ex: <${sub.name}`;
911
- if (sub.parameters && sub.parameters.length > 0) {
912
- for (const p of sub.parameters) {
913
- systemPrompt += ` ${p.name}="${p.example || "string"}"`;
942
+ if (sub.parameters && sub.parameters.length > 0) {
943
+ for (const p of sub.parameters) {
944
+ systemPrompt += ` ${p.name}="${p.example || "string"}"`;
945
+ }
914
946
  }
947
+ let example = sub.meta?.body?.example || "";
948
+ example = example.replace(/&quot;/g, '"').replace(/&#58;/g, ":");
949
+ systemPrompt += ">" + example + "</" + sub.name + ">";
915
950
  }
916
- let example = sub.meta?.body?.example || "";
917
- example = example.replace(/&quot;/g, '"').replace(/&#58;/g, ":");
918
- systemPrompt += ">" + example + "</" + sub.name + ">";
919
- }
920
- systemPrompt += "\n\nIMPORTANT INSTRUCTIONS:";
921
- systemPrompt += "\n1. Output ONLY valid XML tags from the list above";
922
- systemPrompt += "\n2. Do NOT include any explanations, descriptions, or extra text";
923
- systemPrompt += "\n3. Do NOT use bullet points or formatting - just pure XML";
924
- systemPrompt += "\n4. Do NOT invent tags - only use tags from the list above";
925
- systemPrompt += "\n5. Start your response directly with the XML tag (e.g., <add ...>)";
926
- systemPrompt += "\n\nDouble-check: Does your response contain ONLY XML tags? If not, remove all non-XML text.";
951
+ systemPrompt += "\n\nIMPORTANT INSTRUCTIONS:";
952
+ systemPrompt += "\n1. Output ONLY valid XML tags from the list above";
953
+ systemPrompt += "\n2. Do NOT include any explanations, descriptions, or extra text";
954
+ systemPrompt += "\n3. Do NOT use bullet points or formatting - just pure XML";
955
+ systemPrompt += "\n4. Do NOT invent tags - only use tags from the list above";
956
+ systemPrompt += "\n5. Start your response directly with the XML tag (e.g., <add ...>)";
957
+ systemPrompt += "\n\nDouble-check: Does your response contain ONLY XML tags? If not, remove all non-XML text.";
958
+ }
927
959
  if (dialogHistory.length === 0) {
928
960
  dialogHistory.push({ role: "system", content: systemPrompt });
929
961
  }
@@ -1756,7 +1788,7 @@ async function executeTagCheck(session, element) {
1756
1788
  const executeTag = correctedTag || tagName;
1757
1789
  console.error(`[tag-check] Executing <${executeTag}/> as all checks passed and execute=true.`);
1758
1790
  const elementToExecute = correctedTag ? { ...child, tag: correctedTag } : child;
1759
- const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
1791
+ const { integrate: integrate2 } = await import("./interpreter-PTTFEDJF.js");
1760
1792
  await integrate2(session, elementToExecute);
1761
1793
  }
1762
1794
  }
@@ -1765,7 +1797,7 @@ async function executeTagCheck(session, element) {
1765
1797
  // src/tags/throw.ts
1766
1798
  async function executeThrow(session, element) {
1767
1799
  const exceptionName = element.attributes?.name || "exception";
1768
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
1800
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-PTTFEDJF.js");
1769
1801
  const exceptionDom = {
1770
1802
  tag: "exception-content",
1771
1803
  attributes: { name: exceptionName },
@@ -1778,7 +1810,7 @@ async function executeThrow(session, element) {
1778
1810
  // src/tags/try.ts
1779
1811
  async function executeTry(session, element) {
1780
1812
  setExceptionBoundary(session);
1781
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
1813
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-PTTFEDJF.js");
1782
1814
  await integrateChildren2(session, element);
1783
1815
  unsetExceptionBoundary(session);
1784
1816
  }
@@ -1788,7 +1820,7 @@ async function executeCatch(session, element) {
1788
1820
  const exceptionName = element.attributes?.name || "exception";
1789
1821
  const caughtCount = lookupException(session, exceptionName);
1790
1822
  if (caughtCount > 0) {
1791
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
1823
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-PTTFEDJF.js");
1792
1824
  await integrateChildren2(session, element);
1793
1825
  }
1794
1826
  flushCurrentException(session);
@@ -1797,7 +1829,7 @@ async function executeCatch(session, element) {
1797
1829
  // src/tags/exception.ts
1798
1830
  async function executeException(session, element) {
1799
1831
  const exceptions = getCurrentExceptions(session);
1800
- const { integrateChildren: integrateChildren2 } = await import("./interpreter-LTE43E4A.js");
1832
+ const { integrateChildren: integrateChildren2 } = await import("./interpreter-PTTFEDJF.js");
1801
1833
  for (const exceptionDom of exceptions) {
1802
1834
  await integrateChildren2(session, exceptionDom);
1803
1835
  }
@@ -1998,7 +2030,7 @@ async function executeLoadContext(session, element) {
1998
2030
  query = element.text.trim();
1999
2031
  }
2000
2032
  if (!query && element.children.length > 0) {
2001
- const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
2033
+ const { integrate: integrate2 } = await import("./interpreter-PTTFEDJF.js");
2002
2034
  const beforeOutput = session.output.length;
2003
2035
  for (const child of element.children) {
2004
2036
  await integrate2(session, child);
@@ -2429,7 +2461,7 @@ async function executeForeach(session, element) {
2429
2461
  const parser2 = new DiracParser2();
2430
2462
  try {
2431
2463
  const fromElement = parser2.parse(fromAttr);
2432
- const { integrate: integrate2 } = await import("./interpreter-LTE43E4A.js");
2464
+ const { integrate: integrate2 } = await import("./interpreter-PTTFEDJF.js");
2433
2465
  await integrate2(session, fromElement);
2434
2466
  } catch (e) {
2435
2467
  session.output = savedOutput;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-WVFFIHZL.js";
3
+ } from "./chunk-KS5BEPQN.js";
4
4
  import {
5
5
  DiracParser
6
6
  } from "./chunk-HRHAMPOB.js";
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-AEYISK7W.js";
8
- import "./chunk-WVFFIHZL.js";
7
+ } from "./chunk-O6T7UF2Y.js";
8
+ import "./chunk-KS5BEPQN.js";
9
9
  import "./chunk-HJSHCEK4.js";
10
10
  import "./chunk-BGG2SULN.js";
11
11
  import "./chunk-HRHAMPOB.js";
@@ -17,7 +17,7 @@ import "dotenv/config";
17
17
  // package.json
18
18
  var package_default = {
19
19
  name: "dirac-lang",
20
- version: "0.1.86",
20
+ version: "0.1.87",
21
21
  description: "LLM-Augmented Declarative Execution",
22
22
  type: "module",
23
23
  main: "dist/index.js",
@@ -151,7 +151,7 @@ async function main() {
151
151
  const args = process.argv.slice(2);
152
152
  const calledAs = process.argv[1];
153
153
  if (calledAs && calledAs.endsWith("/dish")) {
154
- const { DiracShell } = await import("./shell-HINR647H.js");
154
+ const { DiracShell } = await import("./shell-JQ3UQCDD.js");
155
155
  const shellConfig = loadShellConfig(args);
156
156
  const shell = new DiracShell(shellConfig);
157
157
  await shell.start();
@@ -200,11 +200,11 @@ async function main() {
200
200
  if (args[0] === "agent") {
201
201
  const subcommand = args[1];
202
202
  if (subcommand === "daemon") {
203
- const { runAgentDaemon } = await import("./agent-UMP5VWLO.js");
203
+ const { runAgentDaemon } = await import("./agent-UJOKQHAX.js");
204
204
  await runAgentDaemon();
205
205
  return;
206
206
  }
207
- const { AgentCLI } = await import("./agent-UMP5VWLO.js");
207
+ const { AgentCLI } = await import("./agent-UJOKQHAX.js");
208
208
  const agent = new AgentCLI();
209
209
  switch (subcommand) {
210
210
  case "start":
@@ -231,8 +231,8 @@ async function main() {
231
231
  return;
232
232
  }
233
233
  if (args[0] === "shell") {
234
- const { DiracShell } = await import("./shell-HINR647H.js");
235
- const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-I3XM7YYC.js");
234
+ const { DiracShell } = await import("./shell-JQ3UQCDD.js");
235
+ const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-F374HUP7.js");
236
236
  const { SessionClient } = await import("./session-client-3VTC5MLO.js");
237
237
  const daemonMode = args.includes("--daemon") || args.includes("-d");
238
238
  const agentMode = args.includes("--agent") || args.includes("-a");
@@ -278,7 +278,7 @@ async function main() {
278
278
  return;
279
279
  }
280
280
  if (args[0] === "daemon") {
281
- const { SessionServer } = await import("./session-server-I3XM7YYC.js");
281
+ const { SessionServer } = await import("./session-server-F374HUP7.js");
282
282
  const server = new SessionServer();
283
283
  await server.start();
284
284
  console.log("Session daemon started");
@@ -3,7 +3,7 @@ import {
3
3
  listCronJobs,
4
4
  stopAllCronJobs,
5
5
  stopCronJob
6
- } from "./chunk-WVFFIHZL.js";
6
+ } from "./chunk-KS5BEPQN.js";
7
7
  import "./chunk-HJSHCEK4.js";
8
8
  import "./chunk-BGG2SULN.js";
9
9
  import "./chunk-HRHAMPOB.js";
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@ import {
2
2
  createLLMAdapter,
3
3
  execute,
4
4
  executeUserCommand
5
- } from "./chunk-AEYISK7W.js";
5
+ } from "./chunk-O6T7UF2Y.js";
6
6
  import {
7
7
  integrate
8
- } from "./chunk-WVFFIHZL.js";
8
+ } from "./chunk-KS5BEPQN.js";
9
9
  import "./chunk-HJSHCEK4.js";
10
10
  import "./chunk-BGG2SULN.js";
11
11
  import {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  integrate,
3
3
  integrateChildren
4
- } from "./chunk-WVFFIHZL.js";
4
+ } from "./chunk-KS5BEPQN.js";
5
5
  import "./chunk-HJSHCEK4.js";
6
6
  import "./chunk-BGG2SULN.js";
7
7
  import "./chunk-HRHAMPOB.js";
@@ -3,7 +3,7 @@ import {
3
3
  cancelScheduledRun,
4
4
  executeRunAt,
5
5
  listScheduledRuns
6
- } from "./chunk-WVFFIHZL.js";
6
+ } from "./chunk-KS5BEPQN.js";
7
7
  import "./chunk-HJSHCEK4.js";
8
8
  import "./chunk-BGG2SULN.js";
9
9
  import "./chunk-HRHAMPOB.js";
@@ -3,7 +3,7 @@ import {
3
3
  listScheduledTasks,
4
4
  stopAllScheduledTasks,
5
5
  stopScheduledTask
6
- } from "./chunk-WVFFIHZL.js";
6
+ } from "./chunk-KS5BEPQN.js";
7
7
  import "./chunk-HJSHCEK4.js";
8
8
  import "./chunk-BGG2SULN.js";
9
9
  import "./chunk-HRHAMPOB.js";
@@ -2,8 +2,8 @@ import {
2
2
  SessionServer,
3
3
  getSocketPath,
4
4
  isSessionRunning
5
- } from "./chunk-VEFJ4NM3.js";
6
- import "./chunk-WVFFIHZL.js";
5
+ } from "./chunk-7RXHPRIW.js";
6
+ import "./chunk-KS5BEPQN.js";
7
7
  import "./chunk-HJSHCEK4.js";
8
8
  import "./chunk-BGG2SULN.js";
9
9
  import "./chunk-HRHAMPOB.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-AJSYOXXZ.js";
5
5
  import {
6
6
  integrate
7
- } from "./chunk-WVFFIHZL.js";
7
+ } from "./chunk-KS5BEPQN.js";
8
8
  import "./chunk-HJSHCEK4.js";
9
9
  import "./chunk-BGG2SULN.js";
10
10
  import {
@@ -360,7 +360,7 @@ var DiracShell = class {
360
360
  if (this.client) {
361
361
  this.client.disconnect();
362
362
  }
363
- import("./schedule-JTX4TJ5U.js").then(({ stopAllScheduledTasks }) => {
363
+ import("./schedule-K7V77KGN.js").then(({ stopAllScheduledTasks }) => {
364
364
  stopAllScheduledTasks();
365
365
  console.log("\nGoodbye!");
366
366
  process.exit(0);
@@ -764,7 +764,7 @@ Examples:
764
764
  break;
765
765
  case "tasks":
766
766
  try {
767
- const { listScheduledTasks } = await import("./schedule-JTX4TJ5U.js");
767
+ const { listScheduledTasks } = await import("./schedule-K7V77KGN.js");
768
768
  const tasks = listScheduledTasks();
769
769
  if (tasks.length === 0) {
770
770
  console.log("No scheduled tasks running.");
@@ -783,7 +783,7 @@ Examples:
783
783
  console.log("Usage: :stop <task-name>");
784
784
  } else {
785
785
  try {
786
- const { stopScheduledTask } = await import("./schedule-JTX4TJ5U.js");
786
+ const { stopScheduledTask } = await import("./schedule-K7V77KGN.js");
787
787
  const taskName = args[0];
788
788
  const stopped = stopScheduledTask(taskName);
789
789
  if (stopped) {
@@ -798,7 +798,7 @@ Examples:
798
798
  break;
799
799
  case "stopall":
800
800
  try {
801
- const { stopAllScheduledTasks } = await import("./schedule-JTX4TJ5U.js");
801
+ const { stopAllScheduledTasks } = await import("./schedule-K7V77KGN.js");
802
802
  stopAllScheduledTasks();
803
803
  console.log("All scheduled tasks stopped.");
804
804
  } catch (error) {
@@ -807,7 +807,7 @@ Examples:
807
807
  break;
808
808
  case "crons":
809
809
  try {
810
- const { listCronJobs } = await import("./cron-UH6AQRDK.js");
810
+ const { listCronJobs } = await import("./cron-YZK5DMGO.js");
811
811
  const jobs = listCronJobs();
812
812
  if (jobs.length === 0) {
813
813
  console.log("No cron jobs running.");
@@ -827,7 +827,7 @@ Examples:
827
827
  console.log("Usage: :stopcron <job-name>");
828
828
  } else {
829
829
  try {
830
- const { stopCronJob } = await import("./cron-UH6AQRDK.js");
830
+ const { stopCronJob } = await import("./cron-YZK5DMGO.js");
831
831
  const jobName = args[0];
832
832
  const stopped = stopCronJob(jobName);
833
833
  if (stopped) {
@@ -842,7 +842,7 @@ Examples:
842
842
  break;
843
843
  case "stopallcrons":
844
844
  try {
845
- const { stopAllCronJobs } = await import("./cron-UH6AQRDK.js");
845
+ const { stopAllCronJobs } = await import("./cron-YZK5DMGO.js");
846
846
  stopAllCronJobs();
847
847
  console.log("All cron jobs stopped.");
848
848
  } catch (error) {
@@ -851,7 +851,7 @@ Examples:
851
851
  break;
852
852
  case "scheduled":
853
853
  try {
854
- const { listScheduledRuns } = await import("./run-at-L2N6DS6Y.js");
854
+ const { listScheduledRuns } = await import("./run-at-3JETXLOI.js");
855
855
  const runs = listScheduledRuns();
856
856
  if (runs.length === 0) {
857
857
  console.log("No scheduled runs pending.");
@@ -871,7 +871,7 @@ Examples:
871
871
  console.log("Usage: :cancel <run-name>");
872
872
  } else {
873
873
  try {
874
- const { cancelScheduledRun } = await import("./run-at-L2N6DS6Y.js");
874
+ const { cancelScheduledRun } = await import("./run-at-3JETXLOI.js");
875
875
  const runName = args[0];
876
876
  const cancelled = cancelScheduledRun(runName);
877
877
  if (cancelled) {
@@ -886,7 +886,7 @@ Examples:
886
886
  break;
887
887
  case "cancelall":
888
888
  try {
889
- const { cancelAllScheduledRuns } = await import("./run-at-L2N6DS6Y.js");
889
+ const { cancelAllScheduledRuns } = await import("./run-at-3JETXLOI.js");
890
890
  cancelAllScheduledRuns();
891
891
  console.log("All scheduled runs cancelled.");
892
892
  } catch (error) {
@@ -921,9 +921,19 @@ Examples:
921
921
  }
922
922
  return false;
923
923
  }
924
+ /**
925
+ * Check if command likely represents natural language based on first word
926
+ */
927
+ isLikelyNaturalLanguage(command) {
928
+ const trimmed = command.trim().toLowerCase();
929
+ if (trimmed.endsWith("?")) return true;
930
+ const nlStarters = /^(what|why|how|where|when|which|who|can|could|would|should|please|may|might|do|does|did|is|are|was|were|will|shall)\s/i;
931
+ return nlStarters.test(trimmed);
932
+ }
924
933
  /**
925
934
  * Execute a Unix shell command
926
935
  * If command is not found, fallback to treating it as an AI query
936
+ * Also fallback if command fails and looks like natural language
927
937
  */
928
938
  async executeShellCommand(command) {
929
939
  const trimmed = command.trim();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  integrate
3
- } from "./chunk-WVFFIHZL.js";
3
+ } from "./chunk-KS5BEPQN.js";
4
4
  import "./chunk-HJSHCEK4.js";
5
5
  import "./chunk-BGG2SULN.js";
6
6
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirac-lang",
3
- "version": "0.1.86",
3
+ "version": "0.1.88",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",