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。

merge: 整合最新主干并保留插件统计回归接口

nanac2041018d21a
diff --cc apps/desktop/src/main/cindy-brain/index.ts
index 607b1acb2f,75a66859a1..d263bfd918
--- a/apps/desktop/src/main/cindy-brain/index.ts
+++ b/apps/desktop/src/main/cindy-brain/index.ts
@@@ -6490,8 -6794,9 +6851,10 @@@ export async function installAndDock
trustOverride?: GhostHostTrustOverride;
registrySource?: 'market' | 'manual' | 'agent-forge' | 'legacy' | 'builtin';
pluginId?: string | null;
+ /** The user agreed to reattach the library left under the bare id. */
+ reclaimLegacyBareInstance?: boolean;
beforePackagePlacement?: () => void;
+ deferUsageBinding?: boolean;
},
): Promise<InstalledGhost> {
return withGhostInstallLock(opts.ghostId, () => installAndDockLocked(manager, lizFilePath, opts));
@@@ -6510,8 -6815,9 +6873,10 @@@ async function installAndDockLocked
installOrigin?: 'agent-forge';
registrySource?: 'market' | 'manual' | 'agent-forge' | 'legacy' | 'builtin';
pluginId?: string | null;
+ /** The user agreed to reattach the library left under the bare id. */
+ reclaimLegacyBareInstance?: boolean;
beforePackagePlacement?: () => void;
+ deferUsageBinding?: boolean;
},
): Promise<InstalledGhost> {
// 确认依据的 manifest 必须就是 expectedPackageSha256 钉住的那份包;锁内现读受体
diff --cc apps/desktop/src/main/plugin-market/__tests__/install-manifest-read.test.ts
index 108362b5f8,b469355db7..66bf0a1591
--- a/apps/desktop/src/main/plugin-market/__tests__/install-manifest-read.test.ts
+++ b/apps/desktop/src/main/plugin-market/__tests__/install-manifest-read.test.ts
@@@ -36,7 -36,7 +36,8 @@@ const brain = vi.hoisted(() => (
),
}));
vi.mock('../../cindy-brain/index.js', () => ({
+ refreshPluginUsageBindings: vi.fn(async () => undefined),
+ confirmLegacyLibraryReattach: async () => false,
getGhostManager: () => ({ inspect: brain.inspect }),
installOrUpdateMarketGhostPackage: async (
filePath: string,
diff --cc apps/desktop/src/main/plugin-market/__tests__/service-custom-sources.test.ts
index 217d5c9f3e,6ce3d317cd..54101e63bc
--- a/apps/desktop/src/main/plugin-market/__tests__/service-custom-sources.test.ts
+++ b/apps/desktop/src/main/plugin-market/__tests__/service-custom-sources.test.ts
@@@ -74,7 -74,7 +74,8 @@@ vi.mock('../../logger.js', () => (
createLogger: () => ({ info: vi.fn(), warn: vi.fn(), error: vi.fn() }),
}));
vi.mock('../../cindy-brain/index.js', () => ({
+ refreshPluginUsageBindings: vi.fn(async () => undefined),
+ confirmLegacyLibraryReattach: async () => false,
getGhostManager: () => ({
list: () =>
(runtime.listSequence ? runtime.listSequence() : runtime.ghosts).map((ghost) => ({
diff --cc apps/desktop/src/main/plugin-market/__tests__/service.test.ts
index 8d2b76883b,300a4ce0db..6ce12b3604
--- a/apps/desktop/src/main/plugin-market/__tests__/service.test.ts
+++ b/apps/desktop/src/main/plugin-market/__tests__/service.test.ts
@@@ -103,7 -104,7 +104,8 @@@ vi.mock('../../logger.js', () => (
createLogger: () => ({ info: vi.fn(), warn: vi.fn(), error: vi.fn() }),
}));
vi.mock('../../cindy-brain/index.js', () => ({
+ refreshPluginUsageBindings: vi.fn(async () => undefined),
+ confirmLegacyLibraryReattach: (plugin: unknown) => runtime.confirmLegacyLibraryReattach(plugin),
getGhostManager: () => ({
resumePendingResidentsOffline: runtime.resumeOfflineResidents,
reconcilePendingRootNamespaces: runtime.reconcilePendingRootNamespaces,
diff --cc apps/desktop/src/main/plugin-market/service.ts
index 693e808ea8,16d5fdaa53..5c246c6704
--- a/apps/desktop/src/main/plugin-market/service.ts
+++ b/apps/desktop/src/main/plugin-market/service.ts
@@@ -2352,8 -2338,8 +2367,9 @@@ export class PluginMarketService
plugin,
{
consent,
+ ...(reclaimLegacyBareInstance ? { reclaimLegacyBareInstance: true } : {}),
expectedInstalled: options.expectedInstalled,
+ verifiedServerRoot,
...(options.expectedInstalledApproval !== undefined
? { expectedInstalledApproval: options.expectedInstalledApproval }
: {}),