Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(skills): ignore hidden scoped package entries (#1042)
Lane0d142ba56ce
diff --git a/apps/desktop/electron/main/pi-skill-discovery.ts b/apps/desktop/electron/main/pi-skill-discovery.tsindex dba90fa48..2ef49a527 100644--- a/apps/desktop/electron/main/pi-skill-discovery.ts+++ b/apps/desktop/electron/main/pi-skill-discovery.ts@@ -42,7 +42,9 @@ export async function discoverPiSkillPackages(modules: string, importedDescripti}try {for (const child of await readdir(path, { withFileTypes: true })) {- if (child.isDirectory() && !child.isSymbolicLink()) paths.push(join(path, child.name));+ if (child.isDirectory() && !child.isSymbolicLink() && !child.name.startsWith(".")) {+ paths.push(join(path, child.name));+ }}} catch (error) {errors.push(`${path}: ${error instanceof Error ? error.message : String(error)}`);diff --git a/apps/desktop/test/pi-skill-discovery.test.mjs b/apps/desktop/test/pi-skill-discovery.test.mjsindex 57cbee7bd..76dc84917 100644--- a/apps/desktop/test/pi-skill-discovery.test.mjs+++ b/apps/desktop/test/pi-skill-discovery.test.mjs@@ -24,6 +24,14 @@ test('discovers installed plain and scoped packages without importing or executiassert.ok(result.candidates.every(c => c.skills.length === 1 && !c.hasExtensions && !c.imported));assert.equal(existsSync(f.imports), false);});+test('hidden directories inside scoped packages do not produce discovery errors', async t => {+ const f = fixture(t);+ mkdirSync(join(f.modules, '@img', '.sharp-win32-x64-temp'), { recursive: true });+ f.pkg('healthy');+ const result = await discoverPiSkillPackages(f.modules);+ assert.deepEqual(result.candidates.map(candidate => candidate.name), ['healthy']);+ assert.deepEqual(result.errors, []);+});test('hoisted npm dependencies do not prevent discovery of installed skills', async t => {const f = fixture(t);for (let index = 0; index < 300; index++) {