magicpath-ai 1.3.0-beta.2 → 1.3.0-beta.4
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 +63 -8
- package/dist/cli.js +28 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts +49 -0
- package/dist/commands/add.js +129 -25
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/auth.js +33 -2
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/clone.js +112 -86
- package/dist/commands/clone.js.map +1 -1
- package/dist/commands/info.d.ts +2 -0
- package/dist/commands/info.js +124 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +280 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/integrate.js +282 -81
- package/dist/commands/integrate.js.map +1 -1
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.js +138 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/schema.d.ts +2 -0
- package/dist/commands/schema.js +213 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/search.d.ts +2 -0
- package/dist/commands/search.js +120 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/skills.d.ts +2 -0
- package/dist/commands/skills.js +55 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/view.d.ts +2 -0
- package/dist/commands/view.js +27 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.js +58 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/util/api.d.ts +4 -0
- package/dist/util/api.js +12 -0
- package/dist/util/api.js.map +1 -1
- package/dist/util/auth.js +5 -0
- package/dist/util/auth.js.map +1 -1
- package/dist/util/component.d.ts +8 -8
- package/dist/util/diff.d.ts +4 -0
- package/dist/util/diff.js +11 -3
- package/dist/util/diff.js.map +1 -1
- package/dist/util/integrate.d.ts +13 -2
- package/dist/util/integrate.js +111 -9
- package/dist/util/integrate.js.map +1 -1
- package/dist/util/output.d.ts +14 -0
- package/dist/util/output.js +27 -0
- package/dist/util/output.js.map +1 -0
- package/package.json +3 -2
- package/skills/magicpath-add-component/SKILL.md +49 -0
- package/skills/magicpath-integrate/SKILL.md +50 -0
- package/skills/magicpath-list/SKILL.md +38 -0
- package/skills/magicpath-shared/SKILL.md +34 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# MagicPath Add Component
|
|
2
|
+
|
|
3
|
+
Add a MagicPath component to the current project.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Must be in a directory with `package.json`
|
|
8
|
+
- Must be authenticated (see `magicpath-shared` skill)
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Preview what will be added
|
|
14
|
+
magicpath-ai add <generatedName> --output json --yes --dry-run
|
|
15
|
+
|
|
16
|
+
# Actually add the component
|
|
17
|
+
magicpath-ai add <generatedName> --output json --yes
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Required | Description |
|
|
23
|
+
|-----------|----------|-------------|
|
|
24
|
+
| `generatedName` | Yes | Component identifier (e.g., `wispy-river-5234`) |
|
|
25
|
+
| `--yes` | Recommended | Skip confirmation prompts |
|
|
26
|
+
| `--overwrite` | No | Overwrite existing files |
|
|
27
|
+
| `--path <path>` | No | Custom component path (default: `src/components/magicpath`) |
|
|
28
|
+
| `--dry-run` | No | Preview without writing files |
|
|
29
|
+
|
|
30
|
+
## Output (JSON)
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"component": "ComponentName",
|
|
35
|
+
"generatedName": "wispy-river-5234",
|
|
36
|
+
"filesWritten": ["src/components/magicpath/component-name/Component.tsx"],
|
|
37
|
+
"dependenciesInstalled": ["lucide-react"],
|
|
38
|
+
"importStatement": "import { Component } from '@/components/magicpath/component-name/Component';",
|
|
39
|
+
"usage": "<Component />",
|
|
40
|
+
"dryRun": false
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
1. Run `magicpath-ai list-projects --output json` to find your project
|
|
47
|
+
2. Run `magicpath-ai list-components <projectId> --output json` to find the component's `generatedName`
|
|
48
|
+
3. Run `magicpath-ai add <generatedName> --output json --yes` to install it
|
|
49
|
+
4. Use the returned `importStatement` in your code
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# MagicPath Integrate
|
|
2
|
+
|
|
3
|
+
Use AI to integrate a MagicPath component into a specific file in your project.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Must be in a directory with `package.json`
|
|
8
|
+
- Must be authenticated (see `magicpath-shared` skill)
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Preview what will change
|
|
14
|
+
magicpath-ai integrate <generatedName> --target <file> --output json --dry-run
|
|
15
|
+
|
|
16
|
+
# Actually integrate
|
|
17
|
+
magicpath-ai integrate <generatedName> --target <file> --no-review --output json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Required | Description |
|
|
23
|
+
|-----------|----------|-------------|
|
|
24
|
+
| `generatedName` | Yes | Component identifier (e.g., `wispy-river-5234`) |
|
|
25
|
+
| `--target <file>` | Yes (in JSON mode) | File to integrate into (e.g., `src/app/page.tsx`) |
|
|
26
|
+
| `--no-review` | Recommended | Skip interactive review |
|
|
27
|
+
| `--dry-run` | No | Preview without writing files |
|
|
28
|
+
|
|
29
|
+
## Output (JSON)
|
|
30
|
+
|
|
31
|
+
The command returns modified file contents **without writing to disk**. The agent is responsible for applying the changes.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"modifiedFiles": [
|
|
36
|
+
{
|
|
37
|
+
"path": "src/app/page.tsx",
|
|
38
|
+
"content": "// full file content after integration..."
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"framework": "nextjs-app"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
To apply, write each `modifiedFiles[].content` to its `path`.
|
|
46
|
+
|
|
47
|
+
## Workflow
|
|
48
|
+
|
|
49
|
+
1. First add the component: `magicpath-ai add <generatedName> --output json --yes`
|
|
50
|
+
2. Then integrate it: `magicpath-ai integrate <generatedName> --target src/app/page.tsx --no-review --output json`
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# MagicPath List
|
|
2
|
+
|
|
3
|
+
Discover projects and components available in your MagicPath account.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Must be authenticated (see `magicpath-shared` skill)
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
### Check authentication
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
magicpath-ai whoami --output json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### List projects
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
magicpath-ai list-projects --output json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Returns an array of projects with `id`, `name`, and `componentCount`.
|
|
24
|
+
|
|
25
|
+
### List components in a project
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
magicpath-ai list-components <projectId> --output json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Returns an array of components with `id`, `name`, and `generatedName`.
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
1. `magicpath-ai whoami --output json` — verify authentication
|
|
36
|
+
2. `magicpath-ai list-projects --output json` — find the project ID
|
|
37
|
+
3. `magicpath-ai list-components <projectId> --output json` — find the `generatedName` for the component you want to use
|
|
38
|
+
4. Use the `generatedName` with `add` or `integrate` commands
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# MagicPath Shared Setup
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g magicpath-ai
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Authentication
|
|
10
|
+
|
|
11
|
+
Set the `MAGICPATH_TOKEN` environment variable with your API token:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
export MAGICPATH_TOKEN="your-jwt-token-here"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or authenticate interactively:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
magicpath-ai login
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Verify
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
magicpath-ai whoami --output json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Notes
|
|
30
|
+
|
|
31
|
+
- All commands support `--output json` for structured output
|
|
32
|
+
- Use `MAGICPATH_TOKEN` env var for non-interactive/CI auth
|
|
33
|
+
- Use `--dry-run` on `add` and `integrate` to preview changes
|
|
34
|
+
- Use `magicpath-ai schema --all` to see input/output schemas for all commands
|