claude-warden 1.1.6 → 1.1.7
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/index.cjs +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -18139,6 +18139,10 @@ var require_dist2 = __commonJS({
|
|
|
18139
18139
|
var import_bash_parser = __toESM(require_src(), 1);
|
|
18140
18140
|
var import_path = require("path");
|
|
18141
18141
|
var HEREDOC_REGEX = /<<-?\s*['"]?\w+['"]?/;
|
|
18142
|
+
function preprocessCatHeredocs(input) {
|
|
18143
|
+
const regex = /\$\(cat\s+<<-?\s*['"]?(\w+)['"]?\n([\s\S]*?)\n\1\s*\)/g;
|
|
18144
|
+
return input.replace(regex, "__HEREDOC_TEXT__");
|
|
18145
|
+
}
|
|
18142
18146
|
function convertCommand(node) {
|
|
18143
18147
|
if (!node.name) return null;
|
|
18144
18148
|
const command = node.name.text.includes("/") ? (0, import_path.basename)(node.name.text) : node.name.text;
|
|
@@ -18258,6 +18262,7 @@ function parseCommand(input) {
|
|
|
18258
18262
|
if (!input || !input.trim()) {
|
|
18259
18263
|
return { commands: [], hasSubshell: false, subshellCommands: [], parseError: false };
|
|
18260
18264
|
}
|
|
18265
|
+
input = preprocessCatHeredocs(input);
|
|
18261
18266
|
const hasHeredoc = HEREDOC_REGEX.test(input);
|
|
18262
18267
|
if (hasHeredoc) {
|
|
18263
18268
|
const firstLine = input.split("\n")[0];
|