dirac-lang 0.1.102 → 0.1.103

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.
package/dist/cli.js CHANGED
@@ -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.101",
19
+ version: "0.1.102",
20
20
  description: "LLM-Augmented Declarative Execution",
21
21
  type: "module",
22
22
  main: "dist/index.js",
@@ -150,7 +150,7 @@ async function main() {
150
150
  const args = process.argv.slice(2);
151
151
  const calledAs = process.argv[1];
152
152
  if (calledAs && calledAs.endsWith("/dish")) {
153
- const { DiracShell } = await import("./shell-LEAR2OVM.js");
153
+ const { DiracShell } = await import("./shell-UIXTU4G6.js");
154
154
  const shellConfig = loadShellConfig(args);
155
155
  const shell = new DiracShell(shellConfig);
156
156
  await shell.start();
@@ -230,7 +230,7 @@ async function main() {
230
230
  return;
231
231
  }
232
232
  if (args[0] === "shell") {
233
- const { DiracShell } = await import("./shell-LEAR2OVM.js");
233
+ const { DiracShell } = await import("./shell-UIXTU4G6.js");
234
234
  const { SessionServer, isSessionRunning, getSocketPath } = await import("./session-server-CMHI5CQ5.js");
235
235
  const { SessionClient } = await import("./session-client-3VTC5MLO.js");
236
236
  const daemonMode = args.includes("--daemon") || args.includes("-d");
@@ -504,14 +504,24 @@ var DiracShell = class {
504
504
  if (this.session.output.length > 0) {
505
505
  console.log(this.session.output.join(""));
506
506
  }
507
- const silentExecution = this.session.variables.find((v) => v.name === "__llm_silent_execution__");
507
+ let silentExecution = void 0;
508
+ for (let i = this.session.variables.length - 1; i >= 0; i--) {
509
+ if (this.session.variables[i].name === "__llm_silent_execution__") {
510
+ silentExecution = this.session.variables[i];
511
+ break;
512
+ }
513
+ }
508
514
  if (silentExecution?.value) {
509
515
  console.error(`
510
516
  [LLM generated]
511
517
  ${silentExecution.value}
512
518
  `);
513
- const idx = this.session.variables.findIndex((v) => v.name === "__llm_silent_execution__");
514
- if (idx !== -1) this.session.variables.splice(idx, 1);
519
+ for (let i = this.session.variables.length - 1; i >= 0; i--) {
520
+ if (this.session.variables[i].name === "__llm_silent_execution__") {
521
+ this.session.variables.splice(i, 1);
522
+ break;
523
+ }
524
+ }
515
525
  }
516
526
  } catch (error) {
517
527
  console.error("Error:", error instanceof Error ? error.message : String(error));
@@ -1050,7 +1060,14 @@ Examples:
1050
1060
  }
1051
1061
  }
1052
1062
  console.error(`[DEBUG] Final saveMode: ${saveMode}`);
1053
- const dialogVar = this.client ? (await this.client.getState()).variables.find((v) => v.name === "__llm_dialog__") : this.session.variables.find((v) => v.name === "__llm_dialog__");
1063
+ const variables = this.client ? (await this.client.getState()).variables : this.session.variables;
1064
+ let dialogVar = void 0;
1065
+ for (let i = variables.length - 1; i >= 0; i--) {
1066
+ if (variables[i].name === "__llm_dialog__") {
1067
+ dialogVar = variables[i];
1068
+ break;
1069
+ }
1070
+ }
1054
1071
  if (!dialogVar || !dialogVar.value) {
1055
1072
  console.log("No LLM dialog to save");
1056
1073
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirac-lang",
3
- "version": "0.1.102",
3
+ "version": "0.1.103",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",