- Introduced LlmStrategyPreferenceStore to handle user preferences for LLM strategies. - Updated StorageService to include the new LlmStrategyPreferenceStore. - Modified LlmConfigStore to validate provider kinds using isLlmProviderKind. - Enhanced SQLite migration scripts to create llm_strategy_preference table. - Updated structured output handling to support new strategy preferences in various components. - Refactored tests to accommodate changes in structured output strategy handling.
28 lines
774 B
JavaScript
28 lines
774 B
JavaScript
import { existsSync } from 'node:fs'
|
|
import path from 'node:path'
|
|
import { spawnSync } from 'node:child_process'
|
|
|
|
const root = process.cwd()
|
|
const electronInstall = path.join(root, 'node_modules', 'electron', 'install.js')
|
|
|
|
const run = (command, args) => {
|
|
const result = spawnSync(command, args, {
|
|
cwd: root,
|
|
stdio: 'inherit',
|
|
env: process.env
|
|
})
|
|
if (result.status !== 0) {
|
|
process.exit(result.status || 1)
|
|
}
|
|
}
|
|
|
|
if (existsSync(electronInstall)) {
|
|
run(process.execPath, [electronInstall])
|
|
}
|
|
|
|
if (process.env.NCURATOR_REBUILD_NATIVE === '1') {
|
|
run(process.execPath, [path.join(root, 'scripts', 'prepare-better-sqlite3-native.mjs'), 'prepare'])
|
|
} else {
|
|
console.log('[postinstall] skip native prepare; set NCURATOR_REBUILD_NATIVE=1 to run it')
|
|
}
|