mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-18 20:17:45 +00:00
feat(websearch): inject hooks on profile creation
Add hook injection at profile creation time (not just runtime): - profile-writer.ts: inject on API profile create/update - variant-settings.ts: inject on CLIProxy variant create Hooks now present immediately after profile creation.
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
saveUnifiedConfig,
|
||||
isUnifiedMode,
|
||||
} from '../../config/unified-config-loader';
|
||||
import { ensureProfileHooks } from '../../utils/websearch/profile-hook-injector';
|
||||
import type { ModelMapping, CreateApiProfileResult, RemoveApiProfileResult } from './profile-types';
|
||||
|
||||
/** Check if URL is an OpenRouter endpoint */
|
||||
@@ -43,6 +44,10 @@ function createSettingsFile(
|
||||
};
|
||||
|
||||
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf8');
|
||||
|
||||
// Inject WebSearch hooks into profile settings
|
||||
ensureProfileHooks(name);
|
||||
|
||||
return settingsPath;
|
||||
}
|
||||
|
||||
@@ -101,6 +106,9 @@ function createApiProfileUnified(
|
||||
|
||||
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf8');
|
||||
|
||||
// Inject WebSearch hooks into profile settings
|
||||
ensureProfileHooks(name);
|
||||
|
||||
const config = loadOrCreateUnifiedConfig();
|
||||
config.profiles[name] = {
|
||||
type: 'api',
|
||||
|
||||
Reference in New Issue
Block a user