@link-assistant/hive-mind 1.2.5 → 1.2.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 94dfb13: Fix gh-upload-log argument parsing bug causing "File does not exist" error
8
+ - Fixed bug where `gh-upload-log` received all arguments as a single concatenated string
9
+ - The issue was caused by using `${commandArgs.join(' ')}` in command-stream template literal, which treats the entire joined string as one argument
10
+ - Now using separate `${}` interpolations for each argument to ensure proper argument parsing
11
+ - Also fixed: description flag is now properly passed to gh-upload-log (was only displayed, never sent)
12
+ - Added comprehensive regression tests and case study documentation
13
+
3
14
  ## 1.2.5
4
15
 
5
16
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -33,23 +33,30 @@ export const uploadLogWithGhUploadLog = async ({ logFile, isPublic, description,
33
33
  const result = { success: false, url: null, rawUrl: null, type: null, chunks: 1 };
34
34
 
35
35
  try {
36
- // Build command with appropriate flags
36
+ // Build command flags
37
+ // IMPORTANT: When using command-stream's $ template tag, each ${} interpolation is treated
38
+ // as a single argument. DO NOT use commandArgs.join(' ') as it will make all flags part
39
+ // of the first positional argument, causing "File does not exist" errors.
40
+ // See case study: docs/case-studies/issue-1096/README.md
37
41
  const publicFlag = isPublic ? '--public' : '--private';
38
- const descFlag = description ? `--description "${description}"` : '';
39
- const verboseFlag = verbose ? '--verbose' : '';
40
-
41
- const command = `gh-upload-log "${logFile}" ${publicFlag} ${descFlag} ${verboseFlag}`.trim().replace(/\s+/g, ' ');
42
42
 
43
43
  if (verbose) {
44
- await log(` 📤 Running: ${command}`, { verbose: true });
44
+ const descDisplay = description ? ` --description "${description}"` : '';
45
+ await log(` 📤 Running: gh-upload-log "${logFile}" ${publicFlag}${descDisplay} --verbose`, { verbose: true });
45
46
  }
46
47
 
47
- // Build command arguments array, filtering out empty strings to prevent "Unknown argument: ''" error
48
- const commandArgs = [`"${logFile}"`, publicFlag];
49
- if (verbose) {
50
- commandArgs.push('--verbose');
48
+ // Execute command with separate interpolations for each argument
49
+ // Each ${} is properly passed as a separate argument to the shell
50
+ let uploadResult;
51
+ if (description && verbose) {
52
+ uploadResult = await $`gh-upload-log ${logFile} ${publicFlag} --description ${description} --verbose`;
53
+ } else if (description) {
54
+ uploadResult = await $`gh-upload-log ${logFile} ${publicFlag} --description ${description}`;
55
+ } else if (verbose) {
56
+ uploadResult = await $`gh-upload-log ${logFile} ${publicFlag} --verbose`;
57
+ } else {
58
+ uploadResult = await $`gh-upload-log ${logFile} ${publicFlag}`;
51
59
  }
52
- const uploadResult = await $`gh-upload-log ${commandArgs.join(' ')}`;
53
60
  const output = (uploadResult.stdout?.toString() || '') + (uploadResult.stderr?.toString() || '');
54
61
 
55
62
  if (uploadResult.code !== 0) {