@nikelyh/metamorph 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,14 +2,28 @@
2
2
 
3
3
  **The AI Multi-Agent Migration CLI**
4
4
 
5
- Metamorph is a revolutionary CLI tool powered by [Mozaik AI](https://github.com/jigjoy-ai/mozaik) that automates complex architectural shifts and framework migrations in your codebase. Instead of doing it manually, Metamorph spawns a swarm of specialized AI agents that safely refactor your code in an isolated "Shadow Workspace".
5
+ [![npm version](https://img.shields.io/npm/v/@nikelyh/metamorph.svg?style=flat-square&color=blue&logo=npm)](https://www.npmjs.com/package/@nikelyh/metamorph)
6
+ [![Powered by Mozaik](https://img.shields.io/badge/Powered%20by-Mozaik-6366f1.svg?style=flat-square&logo=github)](https://github.com/jigjoy-ai/mozaik)
7
+
8
+ <p>
9
+ <img src="https://img.shields.io/badge/TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" />
10
+ <img src="https://img.shields.io/badge/Node.js-339933?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js" />
11
+ <img src="https://img.shields.io/badge/React-20232A?style=flat-square&logo=react&logoColor=61DAFB" alt="React" />
12
+ <img src="https://img.shields.io/badge/Turborepo-EF4444?style=flat-square&logo=turborepo&logoColor=white" alt="Turborepo" />
13
+ <img src="https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=flat-square&logo=tailwind-css&logoColor=white" alt="Tailwind CSS" />
14
+ <img src="https://img.shields.io/badge/SQLite-003B57?style=flat-square&logo=sqlite&logoColor=white" alt="SQLite" />
15
+ </p>
16
+
17
+ Metamorph is a CLI tool powered by [Mozaik](https://github.com/jigjoy-ai/mozaik) that automates complex architectural shifts and framework migrations in your codebase. Instead of doing it manually, Metamorph spawns a swarm of specialized AI agents that safely refactor your code in an isolated "Shadow Workspace".
18
+
19
+ 📚 **[Read the Full Documentation](https://metamorph.nikelyh.tech/docs)**
6
20
 
7
21
  ## 🚀 Features
8
22
 
9
- - **Multi-Agent Concurrency**: Utilizes Mapper, Worker, Reviewer, and PackageManager agents to migrate code flawlessly.
23
+ - **Multi-Agent Concurrency**: Utilizes Mapper, Worker, Reviewer, and PackageManager agents to migrate code.
10
24
  - **Zero Risk**: All migrations happen in a `.metamorph/shadow` workspace. Your original code is completely untouched until you explicitly approve and integrate the changes.
11
25
  - **Visual Dashboard**: Watch your agents work in real-time through the built-in local dashboard UI.
12
- - **Extensive Framework Support**: Easily migrate between popular frameworks.
26
+ - **Extensive Framework Support**: Easily migrate between popular frameworks automatically.
13
27
 
14
28
  ## 📦 Installation
15
29
 
@@ -19,47 +33,66 @@ Install Metamorph globally via NPM:
19
33
  npm install -g @nikelyh/metamorph
20
34
  ```
21
35
 
22
- ## 🛠️ Usage
36
+ ## 🛠️ Typical Workflow
23
37
 
24
- Navigate to the project you want to migrate and run:
38
+ You can run the entire migration lifecycle using just your terminal.
39
+
40
+ ### 1. Help & Options
41
+ To see all available commands and options at any time, run:
42
+ ```bash
43
+ metamorph --help
44
+ ```
25
45
 
46
+ ### 2. Start a Migration
47
+ Navigate to the root of the project you want to migrate and run:
26
48
  ```bash
27
49
  metamorph run
28
50
  ```
51
+ Metamorph will automatically detect your current stack (e.g. Express, React) and prompt you to select the target framework. Alternatively, you can bypass the interactive prompt by passing the source explicitly:
52
+ ```bash
53
+ metamorph run --from express
54
+ ```
29
55
 
30
- Metamorph will automatically detect your current stack and prompt you to select the target framework.
31
- Once started, the AI swarm will begin working in the background.
56
+ ### 3. Monitor the Agents (Dashboard UI)
57
+ Once a migration is running, the AI swarm begins working in the background. To see their real-time progress, open a **new terminal tab** in the same folder and run:
58
+ ```bash
59
+ metamorph ui
60
+ ```
61
+ This will start the internal dashboard server and open a Neo-Brutalist interface in your default browser. You can specify a port with `--port 8080`.
32
62
 
33
- ### View the Dashboard
63
+ ### 4. Review and Apply
64
+ After the AI finishes the migration in the isolated Shadow Workspace, you will receive a `runId`. You can apply the completed migration to your actual repository (which automatically creates a new git branch for safety):
65
+ ```bash
66
+ metamorph apply <runId> .
67
+ ```
34
68
 
35
- To see the real-time progress of your AI agents, open a new terminal in the same folder and run:
69
+ ### 5. Managing Migrations
70
+ If you want to discard a run without applying it:
71
+ ```bash
72
+ metamorph rollback <runId>
73
+ ```
74
+ To see a history of all migrations:
75
+ ```bash
76
+ metamorph list
77
+ ```
78
+ To clear the local database and reset all events:
79
+ ```bash
80
+ metamorph reset
81
+ ```
36
82
 
83
+ ### Utility Commands
84
+ To test the technology detection on your repository without starting a migration:
37
85
  ```bash
38
- metamorph ui
86
+ metamorph detect .
39
87
  ```
40
- This will start the internal dashboard and open it in your browser.
41
88
 
42
- ### Other Commands
89
+ ## 🔄 Supported Migrations
43
90
 
44
- - `metamorph apply <runId> <targetPath>`: Applies a completed migration to your repository, creating a new git branch.
45
- - `metamorph rollback <runId>`: Discards an unapplied migration and cleans up the shadow workspace.
46
- - `metamorph list`: Lists all migration history.
47
- - `metamorph detect [path]`: Detects frameworks and libraries in the current project.
48
- - `metamorph reset`: Clears all migration history and events from the local database.
91
+ As Metamorph's AI capabilities are constantly expanding, the list of supported architectural shifts is updated frequently.
49
92
 
50
- ## 🔄 Supported Migrations
93
+ To see the complete, up-to-date list of all supported frontend and backend framework migrations, please visit our official documentation:
51
94
 
52
- **Backend Refactoring**
53
- - Express ⇄ Fastify
54
- - Express ➔ NestJS
55
- - Fastify ➔ NestJS
56
-
57
- **Frontend Modernization**
58
- - React ➔ Next.js
59
- - Vue ➔ React
60
- - Vue ➔ Next.js
61
- - Angular ➔ React
62
- - Svelte ➔ Next.js
95
+ 👉 **[View Supported Migrations](https://metamorph.nikelyh.tech/docs/migrations)**
63
96
 
64
97
  ---
65
98
  *Built with ❤️ using Mozaik.*
package/bin/metamorph.js CHANGED
@@ -1,18 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // For development, we use tsx to run the typescript file directly.
4
- import { spawnSync } from 'child_process';
5
- import { resolve, dirname } from 'path';
6
- import { fileURLToPath } from 'url';
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = dirname(__filename);
10
-
11
- const indexPath = resolve(__dirname, '../src/index.ts');
12
-
13
- const result = spawnSync('npx', ['tsx', indexPath, ...process.argv.slice(2)], {
14
- stdio: 'inherit',
15
- shell: true
16
- });
17
-
18
- process.exit(result.status || 0);
3
+ // Production entry point for the CLI
4
+ import '../dist/index.js';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  detectTechnologies
3
3
  } from "./chunk-3QN2Q75J.js";
4
- import "./chunk-VS2QQHAK.js";
4
+ import "./chunk-3RG5ZIWI.js";
5
5
  export {
6
6
  detectTechnologies
7
7
  };
@@ -0,0 +1,10 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ export {
9
+ __require
10
+ };
@@ -1,9 +1,5 @@
1
- import {
2
- RuntimeState,
3
- defineRuntime
4
- } from "./chunk-XHQSMB6V.js";
5
-
6
1
  // ../application/src/runtime.ts
2
+ import { defineRuntime, RuntimeState } from "@mozaik-ai/core";
7
3
  var MetamorphState = class extends RuntimeState {
8
4
  constructor(repository) {
9
5
  super();