From 0e9a6759bcc943e1bad93e10179b5aadbc5b2329 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Thu, 2 Apr 2026 21:27:03 -0500 Subject: [PATCH] fix: all script resolution uses bundled-first resolveTool() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace remaining hardcoded MOSAIC_HOME/tools paths (mosaic-init, mosaic-ensure-sequential-thinking) and toolScript() with a shared resolveTool() that checks the npm package first. Every script the CLI delegates to now picks up the bundled version immediately after npm upgrade — no mosaic init needed. Bump @mosaic/mosaic and @mosaic/cli to 0.0.8. Co-Authored-By: Claude Opus 4.6 --- packages/cli/package.json | 2 +- packages/cli/src/commands/launch.ts | 26 +++++++++++++++----------- packages/mosaic/package.json | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index ceb5e2a..15bd207 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@mosaic/cli", - "version": "0.0.7", + "version": "0.0.8", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/cli/src/commands/launch.ts b/packages/cli/src/commands/launch.ts index bb48d81..1c8a57c 100644 --- a/packages/cli/src/commands/launch.ts +++ b/packages/cli/src/commands/launch.ts @@ -68,7 +68,7 @@ function checkSoul(): void { } // Fallback: legacy bash mosaic-init - const initBin = join(MOSAIC_HOME, 'tools', '_scripts', 'mosaic-init'); + const initBin = fwScript('mosaic-init'); if (existsSync(initBin)) { spawnSync(initBin, [], { stdio: 'inherit' }); } else { @@ -79,7 +79,7 @@ function checkSoul(): void { } function checkSequentialThinking(runtime: string): void { - const checker = join(MOSAIC_HOME, 'tools', '_scripts', 'mosaic-ensure-sequential-thinking'); + const checker = fwScript('mosaic-ensure-sequential-thinking'); if (!existsSync(checker)) return; // Skip if checker doesn't exist const result = spawnSync(checker, ['--check', '--runtime', runtime], { stdio: 'ignore' }); if (result.status !== 0) { @@ -493,24 +493,28 @@ function delegateToScript(scriptPath: string, args: string[], env?: Record