dirac-lang 0.1.53 → 0.1.55

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.
@@ -73,15 +73,19 @@ var BraKetParser = class {
73
73
  if (!content.trim()) {
74
74
  return { indent, type: "empty", raw };
75
75
  }
76
- const braMatch = content.match(/^<([a-zA-Z_][a-zA-Z0-9_-]*)\s*([^|]*)\|$/);
77
- if (braMatch) {
78
- return {
79
- indent,
80
- type: "bra",
81
- tag: braMatch[1],
82
- attrs: braMatch[2].trim() || void 0,
83
- raw
84
- };
76
+ if (content.startsWith("<") && content.endsWith("|")) {
77
+ const tagMatch = content.match(/^<([a-zA-Z_][a-zA-Z0-9_-]*)\s*/);
78
+ if (tagMatch) {
79
+ const tagName = tagMatch[1];
80
+ const afterTag = content.substring(tagMatch[0].length, content.length - 1);
81
+ return {
82
+ indent,
83
+ type: "bra",
84
+ tag: tagName,
85
+ attrs: afterTag.trim() || void 0,
86
+ raw
87
+ };
88
+ }
85
89
  }
86
90
  const ketMatch = content.match(/^\|([a-zA-Z_][a-zA-Z0-9_-]*)\s*([^>]*?)>\s*(.*)/);
87
91
  if (ketMatch) {
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BraKetParser
4
- } from "./chunk-UEFKQRYN.js";
4
+ } from "./chunk-C6DBZRQZ.js";
5
5
  import {
6
6
  execute
7
7
  } from "./chunk-EXP3R5ZJ.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.53",
19
+ version: "0.1.55",
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-TYEEQWCC.js");
99
+ const { DiracShell } = await import("./shell-WXBGAGAP.js");
100
100
  const shellConfig = { debug: false };
101
101
  for (let i = 1; i < args.length; i++) {
102
102
  const arg = args[i];
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BraKetParser
4
- } from "./chunk-UEFKQRYN.js";
4
+ } from "./chunk-C6DBZRQZ.js";
5
5
  import {
6
6
  integrate
7
7
  } from "./chunk-QZGTAT3E.js";
@@ -52,11 +52,23 @@ var DiracShell = class {
52
52
  const attrPartial = attrMatch[2];
53
53
  const subroutine = this.session.subroutines.find((sub) => sub.name === tagName);
54
54
  if (subroutine && subroutine.parameters && subroutine.parameters.length > 0) {
55
- const paramNames = subroutine.parameters.map((p) => p.name);
56
- const matches = paramNames.filter(
57
- (name) => name.toLowerCase().startsWith(attrPartial.toLowerCase())
55
+ const matches = subroutine.parameters.filter(
56
+ (p) => p.name.toLowerCase().startsWith(attrPartial.toLowerCase())
58
57
  );
59
- const completions = matches.map((name) => `${name}=`);
58
+ if (matches.length > 1) {
59
+ console.log("\n");
60
+ matches.forEach((p) => {
61
+ const parts = [];
62
+ if (p.type) parts.push(p.type);
63
+ if (p.required) parts.push("required");
64
+ if (p.description) parts.push(p.description);
65
+ if (p.options && p.options.length > 0) parts.push(`[${p.options.join(",")}]`);
66
+ if (p.examples && p.examples.length > 0) parts.push(`eg:${p.examples[0]}`);
67
+ const info = parts.length > 0 ? ` (${parts.join(" | ")})` : "";
68
+ console.log(` ${p.name}=${info}`);
69
+ });
70
+ }
71
+ const completions = matches.map((p) => `${p.name}=`);
60
72
  return [completions, attrPartial];
61
73
  }
62
74
  }
@@ -65,11 +77,18 @@ var DiracShell = class {
65
77
  const tagName = tagCompleteMatch[1];
66
78
  const subroutine = this.session.subroutines.find((sub) => sub.name === tagName);
67
79
  if (subroutine && subroutine.parameters && subroutine.parameters.length > 0) {
68
- const paramSuggestions = subroutine.parameters.map((p) => {
69
- const required = p.required ? "*" : "";
70
- const typeInfo = p.type || "string";
71
- return `${p.name}=${required}${typeInfo}`;
80
+ console.log("\n");
81
+ subroutine.parameters.forEach((p) => {
82
+ const parts = [];
83
+ if (p.type) parts.push(p.type);
84
+ if (p.required) parts.push("required");
85
+ if (p.description) parts.push(p.description);
86
+ if (p.options && p.options.length > 0) parts.push(`[${p.options.join(",")}]`);
87
+ if (p.examples && p.examples.length > 0) parts.push(`eg:${p.examples[0]}`);
88
+ const info = parts.length > 0 ? ` (${parts.join(" | ")})` : "";
89
+ console.log(` ${p.name}=${info}`);
72
90
  });
91
+ const paramSuggestions = subroutine.parameters.map((p) => `${p.name}=`);
73
92
  return [paramSuggestions, ""];
74
93
  }
75
94
  const subroutineNames = this.session.subroutines.map((sub) => sub.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirac-lang",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "LLM-Augmented Declarative Execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",