The `mosaic gateway install` command had three UX problems: 1. Admin API token was silently saved to meta.json and never shown to the user — no way to retrieve it without reading the file. 2. If install crashed mid-way (e.g. daemon health-check failure), the next run prompted "Reinstall? [y/N]" and aborted on N, leaving a half-configured install with no resume path. 3. Health-check failures only pointed at `mosaic gateway logs` — user had to run a separate command to see the actual error. Changes: - **Prominent admin token banner** printed immediately after bootstrap creates the first admin user. Clear "save now, won't be shown again" warning. - **Resumable install state machine.** Detects partial installs from meta.json + .env + mosaic.config.json + daemon state, and picks up where a prior attempt stopped instead of prompting. Fully set up installs now offer "re-run config wizard" with explicit warnings about what it does (regenerates .env, clears admin token, may change backend storage). - **Inline log tail on health failure.** Last 30 non-empty lines of gateway.log printed automatically when the daemon fails to become healthy, so the user sees the underlying error without running a second command. - **Corrupt-state detection.** If exactly one of .env / mosaic.config.json exists (from an interrupted prior install), refuses to guess and directs the user to `mosaic gateway uninstall`. - **BETTER_AUTH_SECRET preservation** across config regeneration so existing Better Auth sessions aren't silently invalidated. - **Admin token dropped on any config regeneration** (the wizard may point at a different backend; the old token is unverifiable). - **Daemon stopped before config rewrite** so the live process never serves stale config. - Bump `@mosaic/mosaic` 0.0.19 → 0.0.20. Known follow-ups (noted in review): - `--port 14242` as an explicit override cannot be distinguished from commander's default value; requires plumbing an `explicit` flag. - No automated test coverage for the new state branches; requires mocking fs/readline/fetch/spawn. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
63 lines
1.5 KiB
JSON
63 lines
1.5 KiB
JSON
{
|
|
"name": "@mosaicstack/mosaic",
|
|
"version": "0.0.20",
|
|
"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"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"lint": "eslint src",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run --passWithNoTests"
|
|
},
|
|
"dependencies": {
|
|
"@mosaicstack/config": "workspace:*",
|
|
"@mosaicstack/forge": "workspace:*",
|
|
"@mosaicstack/macp": "workspace:*",
|
|
"@mosaicstack/prdy": "workspace:*",
|
|
"@mosaicstack/quality-rails": "workspace:*",
|
|
"@mosaicstack/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"
|
|
]
|
|
}
|