Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(bots): load linked project dependencies statically

Chris4602346da101
diff --git a/apps/desktop/src/main/localDb/ipc/bots.ts b/apps/desktop/src/main/localDb/ipc/bots.ts
index eca4338336..97489d65ca 100644
--- a/apps/desktop/src/main/localDb/ipc/bots.ts
+++ b/apps/desktop/src/main/localDb/ipc/bots.ts
@@ -1,4 +1,5 @@
import { todoAccess } from '../../maker-ipc/botTodoAccess.js';
+import { botLinkedProjectAccess } from '../../maker-ipc/botLinkedProjects.js';
import type { TodoPatch } from '@cindy/maker-shared/teammate-todo';
/** Cindy Bots 的 main-side 权威数据边界。
*
@@ -2567,7 +2568,6 @@ export function registerBotIpc(): void {
ipcMain.handle(`local-db:bots:projects:${operation}`, async (event, rawBotId: unknown, rawId?: unknown, rawLinked?: unknown) => {
assertTrustedAppRendererEvent(event);
const botId = readText(rawBotId, 'botId', 128, true);
- const { botLinkedProjectAccess } = await import('../../maker-ipc/botLinkedProjects.js');
const access = await botLinkedProjectAccess(botId);
if (operation === 'list') return access.read();
const id = readText(rawId, 'projectId', 64, true);
diff --git a/apps/desktop/src/main/maker-ipc/botWorkbenchTools.ts b/apps/desktop/src/main/maker-ipc/botWorkbenchTools.ts
index 4484a37de2..a6833e37d1 100644
--- a/apps/desktop/src/main/maker-ipc/botWorkbenchTools.ts
+++ b/apps/desktop/src/main/maker-ipc/botWorkbenchTools.ts
@@ -20,6 +20,7 @@ import {
} from '../appSessionState.js';
import type { WorkbenchDelegationStatus, WorkbenchTranscriptItem } from '../../shared/botWorkbench.js';
import { broadcastBotWorkbenchChanged } from './botWorkbenchService.js';
+import { botLinkedProjectAccess } from './botLinkedProjects.js';
import { boundTranscript, readSessionTranscript } from './botWorkbenchTranscripts.js';
import { readTaskResponsibilities, responsibleSessionIds, setTaskResponsibility } from './botTaskResponsibility.js';
import { readBotGlance, readSchedulerBotId, readWatchedSession } from './botWorkbenchAutonomyBridge.js';
@@ -70,7 +71,6 @@ export async function runBotProjectsTool(params: {
if (isAppSessionBoundaryPending()) throw new Error('OWNER_SCOPE_CHANGED');
const caller = await resolveWorkbenchCaller(params.callerSessionId);
if (!caller.ok) return caller;
- const { botLinkedProjectAccess } = await import('./botLinkedProjects.js');
if (owner !== activeOwnerScopeKey() || isAppSessionBoundaryPending()) throw new Error('OWNER_SCOPE_CHANGED');
const access = await botLinkedProjectAccess(caller.botId);
let projects;