fix: resolve CI failures — add highlight.js dep, remove electron import from provisioning
- Add highlight.js as direct dependency (was transitive via rehype-highlight, missing type declarations in CI) - Replace `app.getLocale()` with `Intl.DateTimeFormat().resolvedOptions().locale` to avoid importing electron in TeamProvisioningService (broke tests that don't mock electron)
This commit is contained in:
parent
fbcfd7b1a7
commit
a3fa65859f
3 changed files with 13 additions and 2 deletions
|
|
@ -80,6 +80,7 @@
|
|||
"date-fns": "^3.6.0",
|
||||
"electron-updater": "^6.7.3",
|
||||
"fastify": "^5.7.4",
|
||||
"highlight.js": "^11.11.1",
|
||||
"idb-keyval": "^6.2.2",
|
||||
"lucide-react": "^0.562.0",
|
||||
"mdast-util-to-hast": "^13.2.1",
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ importers:
|
|||
fastify:
|
||||
specifier: ^5.7.4
|
||||
version: 5.7.4
|
||||
highlight.js:
|
||||
specifier: ^11.11.1
|
||||
version: 11.11.1
|
||||
idb-keyval:
|
||||
specifier: ^6.2.2
|
||||
version: 6.2.2
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import { resolveLanguageName } from '@shared/utils/agentLanguage';
|
|||
import { createLogger } from '@shared/utils/logger';
|
||||
import { execFile, spawn } from 'child_process';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { app } from 'electron';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
|
@ -288,10 +287,18 @@ function buildTaskStatusProtocol(teamName: string): string {
|
|||
Failure to follow this protocol means the task board will show incorrect status.`;
|
||||
}
|
||||
|
||||
function getSystemLocale(): string {
|
||||
try {
|
||||
return Intl.DateTimeFormat().resolvedOptions().locale;
|
||||
} catch {
|
||||
return process.env.LANG?.split('.')[0]?.replace('_', '-') ?? 'en';
|
||||
}
|
||||
}
|
||||
|
||||
function getAgentLanguageInstruction(): string {
|
||||
const config = ConfigManager.getInstance().getConfig();
|
||||
const langCode = config.general.agentLanguage || 'system';
|
||||
const systemLocale = app.getLocale();
|
||||
const systemLocale = getSystemLocale();
|
||||
const languageName = resolveLanguageName(langCode, systemLocale);
|
||||
return `IMPORTANT: Communicate in ${languageName}. All messages, summaries, and task descriptions MUST be in ${languageName}.`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue