Previously, resolveTool() used createRequire + req.resolve('@mosaic/mosaic/package.json')
to locate the bundled framework directory. The published package.json only exports the
root '.' subpath, so Node throws ERR_PACKAGE_PATH_NOT_EXPORTED for './package.json'. The
catch block silently swallowed this error and fell through to the MOSAIC_HOME fallback
path (~/.config/mosaic/tools/_scripts/mosaic-doctor), which does not exist on a user's
machine, causing every framework-delegated subcommand (doctor, coord, etc.) to fail with
'[mosaic] Script not found'.
Two-layer fix:
1. Replace the createRequire approach with import.meta.url-based resolution. The built
file lives at dist/commands/launch.js, so ../../framework/tools/... always resolves to
the bundled framework directory regardless of how the package exports field is
configured. This is layout-stable for both the published package and local dev.
2. Add './package.json' and './framework/*' subpath exports to package.json as belt-and-
suspenders, keeping subpath access working for any future caller.
Bump version to 0.0.18.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
65 lines
1.6 KiB
JSON
65 lines
1.6 KiB
JSON
{
|
|
"name": "@mosaic/mosaic",
|
|
"version": "0.0.18",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",
|
|
"directory": "packages/mosaic"
|
|
},
|
|
"description": "Mosaic agent framework — installation wizard and meta package",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"types": "dist/index.d.ts",
|
|
"bin": {
|
|
"mosaic": "dist/cli.js",
|
|
"mosaic-wizard": "dist/index.js"
|
|
},
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
},
|
|
"./package.json": "./package.json",
|
|
"./framework/*": "./framework/*"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"lint": "eslint src",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run --passWithNoTests"
|
|
},
|
|
"dependencies": {
|
|
"@mosaic/config": "workspace:*",
|
|
"@mosaic/forge": "workspace:*",
|
|
"@mosaic/macp": "workspace:*",
|
|
"@mosaic/prdy": "workspace:*",
|
|
"@mosaic/quality-rails": "workspace:*",
|
|
"@mosaic/types": "workspace:*",
|
|
"@clack/prompts": "^0.9.1",
|
|
"commander": "^13.0.0",
|
|
"ink": "^5.0.0",
|
|
"ink-spinner": "^5.0.0",
|
|
"ink-text-input": "^6.0.0",
|
|
"picocolors": "^1.1.1",
|
|
"react": "^18.3.0",
|
|
"socket.io-client": "^4.8.0",
|
|
"yaml": "^2.6.1",
|
|
"zod": "^3.23.8"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.0.0",
|
|
"@types/react": "^18.3.0",
|
|
"tsx": "^4.0.0",
|
|
"typescript": "^5.8.0",
|
|
"vitest": "^2.0.0"
|
|
},
|
|
"publishConfig": {
|
|
"registry": "https://git.mosaicstack.dev/api/packages/mosaic/npm/",
|
|
"access": "public"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"framework"
|
|
]
|
|
}
|