|
1 | | -import { SendOrchestrator, SendOptions } from '../lib/orchestrators/send-orchestrator'; |
| 1 | +import chalk from 'chalk'; |
| 2 | +import { execSync } from 'child_process'; |
| 3 | +import { promises as fs } from 'fs'; |
| 4 | +import os from 'os'; |
| 5 | +import path from 'path'; |
| 6 | +import packageJson from '../../package.json'; |
| 7 | +import { isNetworkError, createNetworkError } from '../lib/errors/network-errors'; |
2 | 8 | import { BackgroundSendOrchestrator } from '../lib/orchestrators/background-send-orchestrator'; |
3 | 9 | import { HookSendOrchestrator } from '../lib/orchestrators/hook-send-orchestrator'; |
4 | | -import { SendProgressUI } from '../lib/ui/send/send-progress'; |
5 | | -import { SendSummaryUI } from '../lib/ui/send/send-summary'; |
6 | | -import { SendConfirmationUI } from '../lib/ui/send/send-confirmation'; |
| 10 | +import { SendOrchestrator, SendOptions } from '../lib/orchestrators/send-orchestrator'; |
7 | 11 | import { showPrivacyPreview } from '../lib/ui/privacy-preview'; |
8 | 12 | import { parseProjectName } from '../lib/ui/project-display'; |
9 | 13 | import { countTotalRedactions } from '../lib/ui/sanitization-display'; |
| 14 | +import { SendConfirmationUI } from '../lib/ui/send/send-confirmation'; |
| 15 | +import { SendProgressUI } from '../lib/ui/send/send-progress'; |
| 16 | +import { SendSummaryUI } from '../lib/ui/send/send-summary'; |
10 | 17 | import { showUploadResults } from '../lib/ui'; |
11 | 18 | import { VibelogError } from '../utils/errors'; |
12 | 19 | import { logger } from '../utils/logger'; |
13 | | -import { isNetworkError, createNetworkError } from '../lib/errors/network-errors'; |
14 | | -import { checkForUpdate, shouldSpawnLatestForHook, VersionCheckResult } from '../utils/version-check'; |
15 | | -import { tryAcquireUpdateLock, UpdateLock } from '../utils/update-lock'; |
16 | 20 | import { clearNpxCache, checkNpxCacheHealth } from '../utils/npx-cache'; |
17 | | -import { execSync } from 'child_process'; |
18 | | -import chalk from 'chalk'; |
| 21 | +import { tryAcquireUpdateLock, UpdateLock } from '../utils/update-lock'; |
| 22 | +import { checkForUpdate, shouldSpawnLatestForHook, VersionCheckResult } from '../utils/version-check'; |
19 | 23 |
|
20 | 24 | /** |
21 | 25 | * Send session data to Vibelog API |
@@ -44,7 +48,7 @@ export async function send(options: SendOptions): Promise<void> { |
44 | 48 | // When triggered by hooks, check for updates but don't block session processing. |
45 | 49 | // Updates happen in background while current version continues processing. |
46 | 50 | if (options.hookTrigger && !process.env.VIBE_LOG_SKIP_UPDATE) { |
47 | | - const currentVersion = process.env.SIMULATE_OLD_VERSION || require('../../package.json').version; |
| 51 | + const currentVersion = process.env.SIMULATE_OLD_VERSION || packageJson.version; |
48 | 52 | logger.debug(`Checking version update: hookTrigger=${options.hookTrigger}, currentVersion=${currentVersion}`); |
49 | 53 |
|
50 | 54 | const versionCheck = await checkForUpdate(currentVersion); |
@@ -378,10 +382,6 @@ async function updateInBackground( |
378 | 382 | * Log update events to update log file |
379 | 383 | */ |
380 | 384 | async function logUpdateEvent(message: string): Promise<void> { |
381 | | - const fs = require('fs').promises; |
382 | | - const path = require('path'); |
383 | | - const os = require('os'); |
384 | | - |
385 | 385 | const updateLogPath = path.join(os.homedir(), '.vibe-log', 'update.log'); |
386 | 386 | const timestamp = new Date().toISOString(); |
387 | 387 | const logLine = `[${timestamp}] ${message}\n`; |
|
0 commit comments