mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 06:17:27 +00:00
Merge remote-tracking branch 'origin/dev' into pr-612-review
# Conflicts: # src/utils/claude-config-path.ts # src/web-server/shared-routes.ts
This commit is contained in:
commit
c98e58383c
77 files changed
+5865
-1099
No files matched your search
@@ -8,30 +8,15 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import { info, warn } from '../ui';
|
||||
import { getWebSearchConfig } from '../../config/unified-config-loader';
|
||||
import { getCcsHooksDir } from '../config-manager';
|
||||
import { getClaudeSettingsPath } from '../claude-config-path';
|
||||
import { isCcsWebSearchHook, deduplicateCcsHooks } from './hook-utils';
|
||||
|
||||
// Hook file name
|
||||
const WEBSEARCH_HOOK = 'websearch-transformer.cjs';
|
||||
|
||||
/**
|
||||
* Get Claude settings path (respects CCS_HOME for test isolation)
|
||||
* In tests, returns path under CCS_HOME; in production, uses real ~/.claude/
|
||||
*/
|
||||
function getClaudeSettingsPath(): string {
|
||||
const ccsHome = process.env.CCS_HOME;
|
||||
if (ccsHome) {
|
||||
// Test mode: use CCS_HOME parent for .claude directory
|
||||
// This prevents tests from modifying user's real settings
|
||||
return path.join(path.dirname(ccsHome), '.claude', 'settings.json');
|
||||
}
|
||||
// Production: use real home directory
|
||||
return path.join(os.homedir(), '.claude', 'settings.json');
|
||||
}
|
||||
|
||||
// Buffer time added to max provider timeout for hook timeout (seconds)
|
||||
const HOOK_TIMEOUT_BUFFER = 30;
|
||||
|
||||
|
||||
Reference in new issue
Block a user