aiblueprint-cli 1.4.30 → 1.4.31
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 +35 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33100,6 +33100,7 @@ function getPlaySoundCommand(soundPath) {
|
|
|
33100
33100
|
var KNOWN_CLAUDE_PATHS = [
|
|
33101
33101
|
/\/Users\/[^/]+\/\.claude\//,
|
|
33102
33102
|
/\/home\/[^/]+\/\.claude\//,
|
|
33103
|
+
/\/root\/\.claude\//,
|
|
33103
33104
|
/C:\\Users\\[^\\]+\\\.claude\\/i
|
|
33104
33105
|
];
|
|
33105
33106
|
function transformHookCommand(command, claudeDir) {
|
|
@@ -33108,6 +33109,13 @@ function transformHookCommand(command, claudeDir) {
|
|
|
33108
33109
|
transformed = transformed.replace(pattern, `${claudeDir}/`);
|
|
33109
33110
|
}
|
|
33110
33111
|
transformed = transformed.replace(/\\/g, "/");
|
|
33112
|
+
const isAudioCommand = /^(afplay|paplay|aplay|mpv|ffplay|powershell)\s/.test(transformed);
|
|
33113
|
+
if (isAudioCommand) {
|
|
33114
|
+
const newCommand = transformAudioCommand(transformed, claudeDir);
|
|
33115
|
+
if (newCommand) {
|
|
33116
|
+
return newCommand;
|
|
33117
|
+
}
|
|
33118
|
+
}
|
|
33111
33119
|
return transformed;
|
|
33112
33120
|
}
|
|
33113
33121
|
function transformHook(hook, claudeDir) {
|
|
@@ -33151,12 +33159,39 @@ function isTextFile(filePath) {
|
|
|
33151
33159
|
const ext = filePath.toLowerCase().slice(filePath.lastIndexOf("."));
|
|
33152
33160
|
return TEXT_FILE_EXTENSIONS.has(ext);
|
|
33153
33161
|
}
|
|
33162
|
+
function transformAudioCommand(command, claudeDir) {
|
|
33163
|
+
const soundFileMatch = command.match(/(?:finish\.mp3|need-human\.mp3|[^'"\s]+\.(?:mp3|wav))/);
|
|
33164
|
+
if (!soundFileMatch)
|
|
33165
|
+
return null;
|
|
33166
|
+
const soundFile = soundFileMatch[0];
|
|
33167
|
+
let soundPath;
|
|
33168
|
+
if (soundFile.includes("/")) {
|
|
33169
|
+
soundPath = soundFile;
|
|
33170
|
+
} else {
|
|
33171
|
+
soundPath = `${claudeDir}/song/${soundFile}`;
|
|
33172
|
+
}
|
|
33173
|
+
return getPlaySoundCommand(soundPath);
|
|
33174
|
+
}
|
|
33154
33175
|
function transformFileContent(content, claudeDir) {
|
|
33155
33176
|
let transformed = content;
|
|
33156
33177
|
for (const pattern of KNOWN_CLAUDE_PATHS) {
|
|
33157
33178
|
transformed = transformed.replace(new RegExp(pattern.source, "g"), `${claudeDir}/`);
|
|
33158
33179
|
}
|
|
33159
33180
|
transformed = transformed.replace(/\\/g, "/");
|
|
33181
|
+
const audioPatterns = [
|
|
33182
|
+
/afplay\s+-v\s+[\d.]+\s+'[^']+'/g,
|
|
33183
|
+
/afplay\s+'[^']+'/g,
|
|
33184
|
+
/paplay\s+'[^']+'/g,
|
|
33185
|
+
/aplay\s+'[^']+'/g,
|
|
33186
|
+
/mpv\s+--no-video[^']*'[^']+'/g,
|
|
33187
|
+
/ffplay\s+-nodisp[^']*'[^']+'/g
|
|
33188
|
+
];
|
|
33189
|
+
for (const pattern of audioPatterns) {
|
|
33190
|
+
transformed = transformed.replace(pattern, (match) => {
|
|
33191
|
+
const newCommand = transformAudioCommand(match, claudeDir);
|
|
33192
|
+
return newCommand || match;
|
|
33193
|
+
});
|
|
33194
|
+
}
|
|
33160
33195
|
return transformed;
|
|
33161
33196
|
}
|
|
33162
33197
|
|