fix: rename all packages from @mosaic/* to @mosaicstack/*
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/push/ci Pipeline failed

- Updated all package.json name fields and dependency references
- Updated all TypeScript/JavaScript imports
- Updated .woodpecker/publish.yml filters and registry paths
- Updated tools/install.sh scope default
- Updated .npmrc registry paths (worktree + host)
- Enhanced update-checker.ts with checkForAllUpdates() multi-package support
- Updated CLI update command to show table of all packages
- Added KNOWN_PACKAGES, formatAllPackagesTable, getInstallAllCommand
- Marked checkForUpdate() with @deprecated JSDoc

Closes #391
This commit is contained in:
Jarvis
2026-04-04 21:43:23 -05:00
parent 80994bdc8e
commit 774b76447d
200 changed files with 828 additions and 641 deletions

View File

@@ -1,5 +1,5 @@
{
"name": "@mosaic/cli",
"name": "@mosaicstack/cli",
"version": "0.0.17",
"repository": {
"type": "git",
@@ -27,11 +27,11 @@
},
"dependencies": {
"@clack/prompts": "^0.9.0",
"@mosaic/config": "workspace:^",
"@mosaic/mosaic": "workspace:^",
"@mosaic/prdy": "workspace:^",
"@mosaic/quality-rails": "workspace:^",
"@mosaic/types": "workspace:^",
"@mosaicstack/config": "workspace:^",
"@mosaicstack/mosaic": "workspace:^",
"@mosaicstack/prdy": "workspace:^",
"@mosaicstack/quality-rails": "workspace:^",
"@mosaicstack/types": "workspace:^",
"commander": "^13.0.0",
"ink": "^5.0.0",
"ink-spinner": "^5.0.0",

View File

@@ -2,7 +2,7 @@
import { createRequire } from 'module';
import { Command } from 'commander';
import { registerQualityRails } from '@mosaic/quality-rails';
import { registerQualityRails } from '@mosaicstack/quality-rails';
import { registerAgentCommand } from './commands/agent.js';
import { registerMissionCommand } from './commands/mission.js';
// prdy is registered via launch.ts
@@ -14,7 +14,7 @@ const CLI_VERSION: string = (_require('../package.json') as { version: string })
// Fire-and-forget update check at startup (non-blocking, cached 1h)
try {
const { backgroundUpdateCheck } = await import('@mosaic/mosaic');
const { backgroundUpdateCheck } = await import('@mosaicstack/mosaic');
backgroundUpdateCheck();
} catch {
// Silently ignore — update check is best-effort
@@ -314,38 +314,36 @@ program
.description('Check for and install Mosaic CLI updates')
.option('--check', 'Check only, do not install')
.action(async (opts: { check?: boolean }) => {
const { checkForUpdate, formatUpdateNotice, getInstallCommand } =
await import('@mosaic/mosaic');
const { checkForAllUpdates, formatAllPackagesTable, getInstallAllCommand } =
await import('@mosaicstack/mosaic');
const { execSync } = await import('node:child_process');
console.log('Checking for updates…');
const result = checkForUpdate({ skipCache: true });
const results = checkForAllUpdates({ skipCache: true });
if (!result.latest) {
console.error('Could not reach the Mosaic registry.');
process.exit(1);
}
console.log('');
console.log(formatAllPackagesTable(results));
console.log(` Installed: ${result.current || '(none)'}`);
console.log(` Latest: ${result.latest}`);
if (!result.updateAvailable) {
console.log('\n✔ Up to date.');
const outdated = results.filter((r: { updateAvailable: boolean }) => r.updateAvailable);
if (outdated.length === 0) {
const anyInstalled = results.some((r: { current: string }) => r.current);
if (!anyInstalled) {
console.error('No @mosaicstack/* packages are installed.');
process.exit(1);
}
console.log('\n✔ All packages up to date.');
return;
}
const notice = formatUpdateNotice(result);
if (notice) console.log(notice);
if (opts.check) {
process.exit(2); // Signal to callers that an update exists
}
console.log('Installing update…');
console.log(`\nInstalling ${outdated.length} update(s)…`);
try {
// Relies on @mosaic:registry in ~/.npmrc — do NOT pass --registry
// globally or non-@mosaic deps will 404 against the Gitea registry.
execSync(getInstallCommand(result), {
// Relies on @mosaicstack:registry in ~/.npmrc
const cmd = getInstallAllCommand(outdated);
execSync(cmd, {
stdio: 'inherit',
timeout: 60_000,
});
@@ -380,7 +378,7 @@ program
createConfigService,
WizardCancelledError,
DEFAULT_MOSAIC_HOME,
} = await import('@mosaic/mosaic');
} = await import('@mosaicstack/mosaic');
try {
const mosaicHome = (opts['mosaicHome'] as string | undefined) ?? DEFAULT_MOSAIC_HOME;

View File

@@ -91,10 +91,10 @@ export function resolveGatewayEntry(): string {
return meta.entryPoint;
}
// Try to resolve from globally installed @mosaic/gateway
// Try to resolve from globally installed @mosaicstack/gateway
try {
const req = createRequire(import.meta.url);
const pkgPath = req.resolve('@mosaic/gateway/package.json');
const pkgPath = req.resolve('@mosaicstack/gateway/package.json');
const mainEntry = join(resolve(pkgPath, '..'), 'dist', 'main.js');
if (existsSync(mainEntry)) return mainEntry;
} catch {
@@ -210,8 +210,8 @@ function sleep(ms: number): Promise<void> {
const GITEA_REGISTRY = 'https://git.mosaicstack.dev/api/packages/mosaic/npm/';
export function installGatewayPackage(): void {
console.log('Installing @mosaic/gateway from Gitea registry...');
execSync(`npm install -g @mosaic/gateway@latest --@mosaic:registry=${GITEA_REGISTRY}`, {
console.log('Installing @mosaicstack/gateway from Gitea registry...');
execSync(`npm install -g @mosaicstack/gateway@latest --@mosaic:registry=${GITEA_REGISTRY}`, {
stdio: 'inherit',
timeout: 120_000,
});
@@ -219,7 +219,7 @@ export function installGatewayPackage(): void {
export function uninstallGatewayPackage(): void {
try {
execSync('npm uninstall -g @mosaic/gateway', {
execSync('npm uninstall -g @mosaicstack/gateway', {
stdio: 'inherit',
timeout: 60_000,
});
@@ -230,15 +230,15 @@ export function uninstallGatewayPackage(): void {
export function getInstalledGatewayVersion(): string | null {
try {
const output = execSync('npm ls -g @mosaic/gateway --json --depth=0', {
const output = execSync('npm ls -g @mosaicstack/gateway --json --depth=0', {
encoding: 'utf-8',
timeout: 15_000,
stdio: ['pipe', 'pipe', 'pipe'],
});
const data = JSON.parse(output) as {
dependencies?: { '@mosaic/gateway'?: { version?: string } };
dependencies?: { '@mosaicstack/gateway'?: { version?: string } };
};
return data.dependencies?.['@mosaic/gateway']?.version ?? null;
return data.dependencies?.['@mosaicstack/gateway']?.version ?? null;
} catch {
return null;
}

View File

@@ -142,7 +142,7 @@ async function doInstall(rl: ReturnType<typeof createInterface>, opts: InstallOp
entryPoint = resolveGatewayEntry();
} catch {
console.error('Error: Gateway package not found after install.');
console.error('Check that @mosaic/gateway installed correctly.');
console.error('Check that @mosaicstack/gateway installed correctly.');
return;
}

View File

@@ -494,13 +494,13 @@ function delegateToScript(scriptPath: string, args: string[], env?: Record<strin
/**
* Resolve a path under the framework tools directory. Prefers the version
* bundled in the @mosaic/mosaic npm package (always matches the installed
* bundled in the @mosaicstack/mosaic npm package (always matches the installed
* CLI version) over the deployed copy in ~/.config/mosaic/ (may be stale).
*/
function resolveTool(...segments: string[]): string {
try {
const req = createRequire(import.meta.url);
const mosaicPkg = dirname(req.resolve('@mosaic/mosaic/package.json'));
const mosaicPkg = dirname(req.resolve('@mosaicstack/mosaic/package.json'));
const bundled = join(mosaicPkg, 'framework', 'tools', ...segments);
if (existsSync(bundled)) return bundled;
} catch {

View File

@@ -255,7 +255,7 @@ async function planMission(
console.log(`Planning mission: ${mission.name}\n`);
try {
const { runPrdWizard } = await import('@mosaic/prdy');
const { runPrdWizard } = await import('@mosaicstack/prdy');
await runPrdWizard({
name: mission.name,
projectPath: process.cwd(),

View File

@@ -32,7 +32,7 @@ export function registerPrdyCommand(program: Command) {
}
try {
const { runPrdWizard } = await import('@mosaic/prdy');
const { runPrdWizard } = await import('@mosaicstack/prdy');
const name =
typeof opts.init === 'string'
? opts.init

View File

@@ -1,6 +1,6 @@
import React, { useState, useCallback, useEffect, useMemo, useRef } from 'react';
import { Box, useApp, useInput } from 'ink';
import type { ParsedCommand } from '@mosaic/types';
import type { ParsedCommand } from '@mosaicstack/types';
import { TopBar } from './components/top-bar.js';
import { BottomBar } from './components/bottom-bar.js';
import { MessageList } from './components/message-list.js';

View File

@@ -11,7 +11,7 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { parseSlashCommand } from './parse.js';
import { CommandRegistry } from './registry.js';
import type { CommandDef } from '@mosaic/types';
import type { CommandDef } from '@mosaicstack/types';
// ─── Parse + Registry Round-trip ─────────────────────────────────────────────

View File

@@ -1,4 +1,4 @@
import type { ParsedCommand } from '@mosaic/types';
import type { ParsedCommand } from '@mosaicstack/types';
import { commandRegistry } from '../registry.js';
export function executeHelp(_parsed: ParsedCommand): string {

View File

@@ -1,4 +1,4 @@
import type { ParsedCommand } from '@mosaic/types';
import type { ParsedCommand } from '@mosaicstack/types';
export interface StatusContext {
connected: boolean;

View File

@@ -1,4 +1,4 @@
import type { ParsedCommand } from '@mosaic/types';
import type { ParsedCommand } from '@mosaicstack/types';
export function parseSlashCommand(input: string): ParsedCommand | null {
const match = input.match(/^\/([a-z][a-z0-9:_-]*)\s*(.*)?$/i);

View File

@@ -1,4 +1,4 @@
import type { CommandDef, CommandManifest } from '@mosaic/types';
import type { CommandDef, CommandManifest } from '@mosaicstack/types';
// Local-only commands (work even when gateway is disconnected)
const LOCAL_COMMANDS: CommandDef[] = [

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { Box, Text } from 'ink';
import type { RoutingDecisionInfo } from '@mosaic/types';
import type { RoutingDecisionInfo } from '@mosaicstack/types';
import type { TokenUsage } from '../hooks/use-socket.js';
import type { GitInfo } from '../hooks/use-git-info.js';

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { Box, Text } from 'ink';
import type { CommandDef, CommandArgDef } from '@mosaic/types';
import type { CommandDef, CommandArgDef } from '@mosaicstack/types';
interface CommandAutocompleteProps {
commands: CommandDef[];

View File

@@ -1,7 +1,7 @@
import React, { useCallback } from 'react';
import { Box, Text, useInput } from 'ink';
import TextInput from 'ink-text-input';
import type { ParsedCommand, CommandDef } from '@mosaic/types';
import type { ParsedCommand, CommandDef } from '@mosaicstack/types';
import { parseSlashCommand, commandRegistry } from '../commands/index.js';
import { CommandAutocomplete } from './command-autocomplete.js';
import { useInputHistory } from '../hooks/use-input-history.js';

View File

@@ -15,7 +15,7 @@ import type {
SlashCommandResultPayload,
SystemReloadPayload,
RoutingDecisionInfo,
} from '@mosaic/types';
} from '@mosaicstack/types';
import { commandRegistry } from '../commands/index.js';
export interface ToolCall {