Commit 127ab878 authored by AI-甘富林's avatar AI-甘富林

feat: 启动完成后改为首页绑定员工密钥

parent dd42a21c
......@@ -521,6 +521,7 @@ export function registerDesktopIpc(services: MainServices): RegisteredDesktopIpc
} = await loadActiveProjectWorkspaceState(projectStore);
const bundleSyncStatus = projectBundleService.getSyncStatus();
const bundleSyncFailed = bundleSyncStatus.state === "error";
const shellReady = !bundleSyncFailed;
const chatSummary = projects.length > 0
? baseChatSummary
: bundleSyncFailed
......@@ -544,6 +545,7 @@ export function registerDesktopIpc(services: MainServices): RegisteredDesktopIpc
};
return {
shellReady,
apiKeyConfigured: config.apiKeyConfigured,
bindingRequired: !config.apiKeyConfigured,
setupRequired: !config.apiKeyConfigured,
......
......@@ -18,6 +18,7 @@ type SecretName = "apiKey" | "gatewayToken" | "deviceToken" | "authToken";
type KeytarModule = typeof import("keytar");
const KEYTAR_SERVICE = "QianjiangClaw";
const FORCED_SECRET_BACKEND = (process.env.QJCLAW_SECRET_BACKEND ?? "").trim().toLowerCase();
const KEYTAR_ACCOUNT_MAP: Record<SecretName, string> = {
apiKey: "provider-api-key",
gatewayToken: "gateway-token",
......@@ -108,6 +109,12 @@ export class SecretManager {
async load(): Promise<void> {
await this.fallbackStore.load();
if (FORCED_SECRET_BACKEND === "file-fallback") {
this.backend = "file-fallback(forced)";
this.store = this.fallbackStore;
return;
}
const keytar = await this.tryLoadKeytar();
if (!keytar) {
this.backend = "file-fallback";
......
This diff is collapsed.
......@@ -259,6 +259,7 @@ export interface PluginSummary {
}
export interface WorkspaceSummary {
shellReady: boolean;
apiKeyConfigured: boolean;
bindingRequired: boolean;
setupRequired: boolean;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment