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
090c1d47aa
commit
2f75df158c
3 changed files with 13 additions and 2 deletions
|
|
@ -80,6 +80,7 @@
|
||||||
"date-fns": "^3.6.0",
|
"date-fns": "^3.6.0",
|
||||||
"electron-updater": "^6.7.3",
|
"electron-updater": "^6.7.3",
|
||||||
"fastify": "^5.7.4",
|
"fastify": "^5.7.4",
|
||||||
|
"highlight.js": "^11.11.1",
|
||||||
"idb-keyval": "^6.2.2",
|
"idb-keyval": "^6.2.2",
|
||||||
"lucide-react": "^0.562.0",
|
"lucide-react": "^0.562.0",
|
||||||
"mdast-util-to-hast": "^13.2.1",
|
"mdast-util-to-hast": "^13.2.1",
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,9 @@ importers:
|
||||||
fastify:
|
fastify:
|
||||||
specifier: ^5.7.4
|
specifier: ^5.7.4
|
||||||
version: 5.7.4
|
version: 5.7.4
|
||||||
|
highlight.js:
|
||||||
|
specifier: ^11.11.1
|
||||||
|
version: 11.11.1
|
||||||
idb-keyval:
|
idb-keyval:
|
||||||
specifier: ^6.2.2
|
specifier: ^6.2.2
|
||||||
version: 6.2.2
|
version: 6.2.2
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import { resolveLanguageName } from '@shared/utils/agentLanguage';
|
||||||
import { createLogger } from '@shared/utils/logger';
|
import { createLogger } from '@shared/utils/logger';
|
||||||
import { execFile, spawn } from 'child_process';
|
import { execFile, spawn } from 'child_process';
|
||||||
import { randomUUID } from 'crypto';
|
import { randomUUID } from 'crypto';
|
||||||
import { app } from 'electron';
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
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.`;
|
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 {
|
function getAgentLanguageInstruction(): string {
|
||||||
const config = ConfigManager.getInstance().getConfig();
|
const config = ConfigManager.getInstance().getConfig();
|
||||||
const langCode = config.general.agentLanguage || 'system';
|
const langCode = config.general.agentLanguage || 'system';
|
||||||
const systemLocale = app.getLocale();
|
const systemLocale = getSystemLocale();
|
||||||
const languageName = resolveLanguageName(langCode, systemLocale);
|
const languageName = resolveLanguageName(langCode, systemLocale);
|
||||||
return `IMPORTANT: Communicate in ${languageName}. All messages, summaries, and task descriptions MUST be in ${languageName}.`;
|
return `IMPORTANT: Communicate in ${languageName}. All messages, summaries, and task descriptions MUST be in ${languageName}.`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue