visual-ai-staging 0.0.1 → 0.0.2
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 +89 -75
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,86 +1,100 @@
|
|
|
1
|
-
# Visual AI Staging
|
|
2
|
-
## Guía de Pruebas Rápidas y Manual de Usuario
|
|
1
|
+
# Visual AI Staging (vais) 🚀
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
**Visual AI Staging** is a lightweight, secure, and production-ready development companion designed to bridge the gap between visual UI design staging and AI coding assistants (such as Cursor, Claude Code, ChatGPT, or custom LLM developers).
|
|
4
|
+
|
|
5
|
+
It provides frontend developers with an interactive visual sandbox to tweak styles, draw components, and record voice feedback, compiling all sessions into **high-context structured Markdown prompt recipes** optimized for AI generation.
|
|
5
6
|
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Ambas pruebas simularán el entorno completo del navegador e informarán un estado de éxito del `100% [PASS]` en la consola.
|
|
9
|
+
## Key Capabilities
|
|
10
|
+
|
|
11
|
+
* **🔍 Interactive Visual Sandbox:** Inspect active DOM elements, alter dimensions (padding, margins, width, height, border radius, font-size), edit text contents, and experiment with HSL background and text colors in hot memory.
|
|
12
|
+
* **📐 Vector Bounding Boxes (Free-Zone Drawing):** Draw spatial annotation rectangles directly on top of your page. The engine automatically resolves the nearest structural parent container and logs your component templates.
|
|
13
|
+
* **🎙️ Multimodal Localized Audio:** Record voice notes attached to specific components. The engine automatically anchors floating interactive microphone badges (`🎤`) above selected elements with relative position layout compensation.
|
|
14
|
+
* **⚡ Smart Design Token Mapping:** Sliders automatically approximate manual pixel values to standard design tokens (e.g., `--spacing-md`, `--border-radius-lg`) to prevent the generation of static inline styling.
|
|
15
|
+
* **💾 Secure Hot-Persistence CLI Server:** A lightweight, pure Node.js local development server that intercepts AJAX requests to silently persist recording `.wav` assets and Markdown recipe `.md` files directly into your workspace disk.
|
|
16
|
+
* **📦 Safe Distribution Filters:** Strict packaging excludes configured via `.npmignore` to prevent uploading development, testing, and system metadata files.
|
|
17
|
+
* **🤖 Production AI-Pipeline Guardrails:** Exported prompts include pre-prompts that instruct receiving LLMs to halt execution if referred local voice recording files are not attached to the chat session, ensuring absolute context alignment.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Install **Visual AI Staging** globally in your system using NPM:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g visual-ai-staging
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
*(Note: The global `-g` flag is required to register the CLI command globally in your terminal variables).*
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
### 1. Initialize the Staging Environment
|
|
36
|
+
Navigate to your project root folder and start the native dev server:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Start the Visual AI Staging local developer server
|
|
40
|
+
vais dev
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
*Console Output:*
|
|
44
|
+
```bash
|
|
45
|
+
Visual AI Staging Dev Server running at http://localhost:3000/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Run Visual Staging
|
|
49
|
+
1. Open your web browser and navigate to `http://localhost:3000/`.
|
|
50
|
+
2. Activate **Inspection Mode** or **Free-Zone Drawing** on the toolbar.
|
|
51
|
+
3. Select elements, alter visual parameters, record voice notes, and staging your layout options.
|
|
52
|
+
4. Open the floating action button menu (`⚡`) and click **"Copy AI Recipe Prompt"** to copy the compiled Markdown recipe to your clipboard.
|
|
53
|
+
5. Paste the recipe directly into your AI coding assistant to apply perfect-fidelity visual and structural modifications to your codebase.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## CLI Command Guide
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
Usage: vais [options] [command]
|
|
61
|
+
|
|
62
|
+
Options:
|
|
63
|
+
-v, --version Output the version number
|
|
64
|
+
-h, --help Output usage information
|
|
65
|
+
|
|
66
|
+
Commands:
|
|
67
|
+
dev Start the Visual AI Staging native development server
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Folder Architecture
|
|
73
|
+
|
|
74
|
+
When running `vais dev` in your workspace, the local daemon writes data locally under the `.ai-staging/` directory:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
your-project-root/
|
|
78
|
+
├── .ai-staging/ # Local feedback data directory (Git-ignored)
|
|
79
|
+
│ ├── audio/ # Staged .wav voice annotation files
|
|
80
|
+
│ └── feedback/ # Exported markdown prompt recipes (.md)
|
|
81
|
+
├── index.html # Entry page of your sandbox
|
|
82
|
+
├── app.js # Staging controller, drawing layers, and audio recorder
|
|
83
|
+
├── cli.js # Native Node.js CLI server binary
|
|
84
|
+
└── package.json # Distribution manifest
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Safety & Security Guardrails
|
|
90
|
+
|
|
91
|
+
* **Zero Production Dependencies:** The CLI dev server is built entirely using Node.js native standard libraries (`http`, `fs`, `path`, `url`), eliminating third-party package security risks.
|
|
92
|
+
* **Path Traversal Prevention:** The HTTP dev server implements strict `path.resolve` checks to ensure no requests can access, read, or write files outside the workspace root directory (returns `403 Forbidden` on traversal attempts).
|
|
93
|
+
* **Filename Sanitization:** The REST backend sanitizes names using `path.basename` extraction and regex assertions (`^[a-zA-Z0-9_\-\.]+\.(wav|md)$`) to block command injection.
|
|
94
|
+
* **CSP & XSS Compliance:** The web engine uses event listeners (`addEventListener`) and programmatic node creations (`document.createElement` / `.textContent`) to strictly prevent DOM-based XSS vulnerabilities.
|
|
76
95
|
|
|
77
96
|
---
|
|
78
97
|
|
|
79
|
-
##
|
|
98
|
+
## License
|
|
80
99
|
|
|
81
|
-
|
|
82
|
-
* **Estructura e Interfaces Visuales:** `visual_ai_staging/index.html`
|
|
83
|
-
* **Estilos del Tema Oscuro Premium y Sandbox CSS:** `visual_ai_staging/styles.css`
|
|
84
|
-
* **Controlador Principal y Estados en Hot Memory:** `visual_ai_staging/app.js`
|
|
85
|
-
* **Reportes de Auditoría Firmados:** `visual_ai_staging/.ai-staging/audit_reports/`
|
|
86
|
-
* **Suites de Pruebas Node.js:** `visual_ai_staging/verify_r3.js` y `verify_r4.js`
|
|
100
|
+
This project is licensed under the permissive **MIT License** — feel free to use, modify, and distribute it for both commercial and personal use.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual-ai-staging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Visual AI Staging Companion — Bridge the gap between UI design staging and AI coding assistants.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "app.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"vais": "./cli.js"
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|