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 current upstream main into codex/issue-3468

lizzjin2d30f10315f5
diff --cc apps/desktop/src/main/maker-host/__tests__/pi-package-store-security.test.ts
index 002098ac23,8e27abb176..d607bfafd5
--- a/apps/desktop/src/main/maker-host/__tests__/pi-package-store-security.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/pi-package-store-security.test.ts
@@@ -618,26 -612,6 +618,32 @@@ describe('Pi package executable-code bo
await expect(store.resolveManagedPiNativePackagePaths()).resolves.toEqual([]);
});
+ it('collects startup metadata without copying native packages into a session snapshot', async () => {
- const { root } = await createSkillOnlyPackage('npm:native-startup-metadata');
++ const { root, source } = await createSkillOnlyPackage('npm:native-startup-metadata');
++ const aliasParent = await fs.mkdtemp(path.join(os.tmpdir(), 'cindy-pi-package-security-alias-'));
++ roots.push(aliasParent);
++ const aliasRoot = path.join(aliasParent, 'package-link');
++ await fs.symlink(root, aliasRoot, process.platform === 'win32' ? 'junction' : 'dir');
++ runtime.listOutput = `User packages:\n ${source}\n ${aliasRoot}\n`;
++ const canonicalRoot = await fs.realpath(aliasRoot);
+ const store = await import('../pi-package-store.js');
+ const copySpy = vi.spyOn(fs, 'copyFile');
+ try {
+ await expect(store.resolveManagedPiPackageResources({
+ startupTraceId: '0123456789abcdef',
+ })).resolves.toMatchObject({
+ skills: [expect.objectContaining({
- path: path.join(root, 'skills', 'managed-skill', 'SKILL.md'),
++ path: path.join(canonicalRoot, 'skills', 'managed-skill', 'SKILL.md'),
+ })],
- packageRoots: [root],
++ packageRoots: [canonicalRoot],
+ });
+ expect(copySpy).not.toHaveBeenCalled();
- await expect(store.resolveManagedPiNativePackagePaths()).resolves.toEqual([root]);
++ await expect(store.resolveManagedPiNativePackagePaths()).resolves.toEqual([aliasRoot]);
+ } finally {
+ copySpy.mockRestore();
+ }
+ });
+
it('fails explicitly instead of widening a filtered package when settings are invalid', async () => {
const { root, source } = await createPackage({ source: 'npm:filtered-invalid' });
runtime.listOutput = `User packages:\n ${source} (filtered)\n ${root}\n`;