From 37a2a8b9bee7a6122e7653467be0805f310a1306 Mon Sep 17 00:00:00 2001 From: JJ Lee Date: Sat, 15 Aug 2026 12:13:36 +0200 Subject: [PATCH] fix: rebuild copies skills/ to installed extension The dev-tools 'Rebuild Locally' copies dist/*.js files into the installed extension path but did not copy skills/. Since DEFAULT_LIBRARY_ROOTS resolves via __dirname (which points at the installed extension's dist/), new or modified skills in the dev repo were invisible until a fresh vsix install. Now the rebuild syncs the full skills/ directory alongside dist/, so local skill changes (like migrate-to-armonia) are immediately available after a rebuild + reload. --- packages/extension/src/chat_bridge.ts | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/packages/extension/src/chat_bridge.ts b/packages/extension/src/chat_bridge.ts index d30f6edd..7cde437a 100644 --- a/packages/extension/src/chat_bridge.ts +++ b/packages/extension/src/chat_bridge.ts @@ -547,6 +547,44 @@ export function handleAmicodeBridgeMessage(msg: unknown, io: BridgeIo): boolean } catch (copyErr) { console.warn("[amicode/bridge] extension dist copy failed:", copyErr); } + // Sync content directories that resolve via __dirname or + // ctx.extensionPath at runtime. Without this, local changes to + // skills, scores, templates, exemplars, the plugin, julia pins, + // AGENTS.md, and tools are invisible until a fresh vsix install. + const contentDirs = [ + "skills", + "scores", + "templates", + "exemplars", + "opencode-plugin", + "julia", + "tools", + ]; + for (const dir of contentDirs) { + try { + const src = path.join(amicodePath, "packages", "extension", dir); + const dest = path.join(installedExt.extensionPath, dir); + if (fs.existsSync(src)) { + fs.cpSync(src, dest, { recursive: true }); + } + } catch (syncErr) { + console.warn(`[amicode/bridge] ${dir}/ sync failed:`, syncErr); + } + } + // Sync top-level markdown files (AGENTS.md, DISTILLER.md, etc.) + const mdFiles = ["AGENTS.md", "DISTILLER.md", "CONTRACT.md"]; + for (const f of mdFiles) { + try { + const src = path.join(amicodePath, "packages", "extension", f); + const dest = path.join(installedExt.extensionPath, f); + if (fs.existsSync(src)) { + fs.copyFileSync(src, dest); + } + } catch (syncErr) { + console.warn(`[amicode/bridge] ${f} sync failed:`, syncErr); + } + } + console.log("[amicode/bridge] synced content dirs + markdown to installed extension"); } // ── Apply VS Code settings ──