@link-assistant/hive-mind 1.23.12 → 1.23.13

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,14 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.23.13
4
+
5
+ ### Patch Changes
6
+
7
+ - af1f456: fix: suppress dotenvx MISSING_ENV_FILE warnings in hive-telegram-bot --version
8
+ - Add early --version handling before loading dotenvx to avoid warnings
9
+ - Add ignore: ['MISSING_ENV_FILE'] option to make .env file optional
10
+ - Add tests for version output in tests/test-telegram-bot-version.mjs
11
+
3
12
  ## 1.23.12
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -149,11 +149,14 @@ Run the Hive Mind using Docker for safer local installation - no manual setup re
149
149
  # Pull the latest image from Docker Hub
150
150
  docker pull konard/hive-mind:latest
151
151
 
152
- # Run an interactive session
153
- docker run -it konard/hive-mind:latest
152
+ # Start hive-mind container
153
+ docker run -dit --name hive-mind konard/hive-mind:latest
154
154
 
155
- # IMPORTANT: Authenticate AFTER the Docker image is installed
156
- # This avoids build timeouts and allows the installation to complete successfully
155
+ # Verify container started
156
+ docker ps -a
157
+
158
+ # Enter additional terminal process to do installation
159
+ docker exec -it hive-mind /bin/bash
157
160
 
158
161
  # Inside the container, authenticate with GitHub
159
162
  gh-setup-git-identity
@@ -163,6 +166,15 @@ claude
163
166
 
164
167
  # Now you can use hive and solve commands
165
168
  solve https://github.com/owner/repo/issues/123
169
+
170
+ # Or you can run telegram bot:
171
+
172
+ # Run an to main process
173
+ docker attach hive-mind
174
+
175
+ # Run bot here
176
+
177
+ # Press Ctrl + P, Ctrl + Q to detach without destroying the container (no stopping of main bash process)
166
178
  ```
167
179
 
168
180
  **Benefits of Docker:**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.23.12",
3
+ "version": "1.23.13",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -1,4 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ // Early exit for --version (issue #1318: avoid dotenvx MISSING_ENV_FILE warnings)
3
+ if (process.argv.includes('--version')) {
4
+ const v = await import('./version.lib.mjs').then(m => m.getVersion()).catch(() => 'unknown');
5
+ console.log(v);
6
+ process.exit(v === 'unknown' ? 1 : 0);
7
+ }
2
8
 
3
9
  import { spawn } from 'child_process';
4
10
  import { promisify } from 'util';
@@ -21,7 +27,9 @@ const dotenvx = dotenvxModule.default || dotenvxModule;
21
27
  const getenv = await use('getenv');
22
28
 
23
29
  // Load .env configuration as base
24
- dotenvx.config({ quiet: true });
30
+ // quiet: true suppresses info messages, ignore: ['MISSING_ENV_FILE'] suppresses error when .env doesn't exist
31
+ // This makes .env file optional (issue #1318)
32
+ dotenvx.config({ quiet: true, ignore: ['MISSING_ENV_FILE'] });
25
33
 
26
34
  // Load .lenv configuration (if exists)
27
35
  // .lenv overrides .env
@@ -30,20 +38,15 @@ loadLenvConfig({ override: true, quiet: true });
30
38
  const yargsModule = await use('yargs@17.7.2');
31
39
  const yargs = yargsModule.default || yargsModule;
32
40
  const { hideBin } = await use('yargs@17.7.2/helpers');
33
-
34
- // Import solve and hive yargs configurations for validation
41
+ // Import yargs configurations, GitHub utilities, and telegram helpers
35
42
  const { createYargsConfig: createSolveYargsConfig, detectMalformedFlags } = await import('./solve.config.lib.mjs');
36
43
  const { createYargsConfig: createHiveYargsConfig } = await import('./hive.config.lib.mjs');
37
- // Import GitHub URL parser for extracting URLs from messages
38
44
  const { parseGitHubUrl } = await import('./github.lib.mjs');
39
- // Import model validation for early validation with helpful error messages
40
45
  const { validateModelName } = await import('./model-validation.lib.mjs');
41
- // Import libraries for /limits, /version, and markdown escaping
42
46
  const { formatUsageMessage, getAllCachedLimits } = await import('./limits.lib.mjs');
43
47
  const { getVersionInfo, formatVersionMessage } = await import('./version-info.lib.mjs');
44
48
  const { escapeMarkdown, escapeMarkdownV2, cleanNonPrintableChars, makeSpecialCharsVisible } = await import('./telegram-markdown.lib.mjs');
45
49
  const { getSolveQueue, createQueueExecuteCallback } = await import('./telegram-solve-queue.lib.mjs');
46
- // Import extracted message filter functions for testability (issue #1207)
47
50
  const { isOldMessage: _isOldMessage, isGroupChat: _isGroupChat, isChatAuthorized: _isChatAuthorized, isForwardedOrReply: _isForwardedOrReply, extractCommandFromText } = await import('./telegram-message-filters.lib.mjs');
48
51
  // Import bot launcher with exponential backoff retry (issue #1240)
49
52
  const { launchBotWithRetry } = await import('./telegram-bot-launcher.lib.mjs');
@@ -5,6 +5,11 @@ import { dirname, join } from 'path';
5
5
  import { fileURLToPath } from 'url';
6
6
  import { getGitVersion } from './git.lib.mjs';
7
7
 
8
+ // Cache for version (immutable after first read)
9
+ // This ensures the version remains consistent even if package.json changes during runtime
10
+ // See issue #1318: version should be cached in RAM at startup
11
+ let cachedVersion = null;
12
+
8
13
  async function isRunningAsScript() {
9
14
  const __filename = fileURLToPath(import.meta.url);
10
15
  const __dirname = dirname(__filename);
@@ -18,6 +23,11 @@ async function isRunningAsScript() {
18
23
  }
19
24
 
20
25
  export async function getVersion() {
26
+ // Return cached version if already computed (immutable after first read)
27
+ if (cachedVersion !== null) {
28
+ return cachedVersion;
29
+ }
30
+
21
31
  const __filename = fileURLToPath(import.meta.url);
22
32
  const __dirname = dirname(__filename);
23
33
  const packagePath = join(__dirname, '..', 'package.json');
@@ -28,13 +38,15 @@ export async function getVersion() {
28
38
  const currentVersion = packageJson.version;
29
39
 
30
40
  if (await isRunningAsScript()) {
31
- const version = await getGitVersion(undefined, currentVersion);
32
- return version;
41
+ cachedVersion = await getGitVersion(undefined, currentVersion);
42
+ } else {
43
+ cachedVersion = currentVersion;
33
44
  }
34
45
 
35
- return currentVersion;
46
+ return cachedVersion;
36
47
  } catch {
37
- return 'unknown';
48
+ cachedVersion = 'unknown';
49
+ return cachedVersion;
38
50
  }
39
51
  }
40
52