maiass 5.9.37 → 5.9.39

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.
@@ -55,10 +55,16 @@ export function readConfig(configPath) {
55
55
  if (key && valueParts.length > 0) {
56
56
  let value = valueParts.join('=').trim();
57
57
 
58
- // Remove surrounding quotes if present
59
- if ((value.startsWith('"') && value.endsWith('"')) ||
60
- (value.startsWith("'") && value.endsWith("'"))) {
61
- value = value.slice(1, -1);
58
+ // Strip surrounding quotes, following dotenv conventions:
59
+ // - Double-quoted: unescape \\ → \ and \" " after stripping (standard escape sequences)
60
+ // - Single-quoted: strip only, no unescaping (everything is literal)
61
+ // - Unquoted: use as-is (important for Windows paths like C:\Users\name)
62
+ if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
63
+ value = value.slice(1, -1)
64
+ .replace(/\\"/g, '"') // unescape \" → "
65
+ .replace(/\\\\/g, '\\'); // unescape \\ → \
66
+ } else if (value.length >= 2 && value.startsWith("'") && value.endsWith("'")) {
67
+ value = value.slice(1, -1); // single-quoted: literal, no unescaping
62
68
  }
63
69
 
64
70
  config[key.trim()] = value;
@@ -132,9 +138,9 @@ export function writeConfig(configPath, config, options = {}) {
132
138
  }
133
139
 
134
140
  // Quote values that contain spaces or special characters.
135
- // Written to a file only not passed to a shell. codeql[js/incomplete-sanitization]
141
+ // Escape backslashes first, then double-quotes, for .env file format.
136
142
  const needsQuotes = /[\s#"'\\]/.test(value);
137
- const quotedValue = needsQuotes ? `"${value.replace(/"/g, '\\"')}"` : value;
143
+ const quotedValue = needsQuotes ? `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"` : value;
138
144
 
139
145
  lines.push(`${key}=${quotedValue}`);
140
146
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "maiass",
3
3
  "type": "module",
4
- "version": "5.9.37",
4
+ "version": "5.9.39",
5
5
  "description": "MAIASS - Modular AI-Augmented Semantic Scribe - Intelligent Git workflow automation",
6
6
  "main": "maiass.mjs",
7
7
  "bin": {