@hapico/cli 0.0.30 → 0.0.32
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 +118 -0
- package/bin/index.js +382 -490
- package/bin/tools/nativewind/index.js +80 -0
- package/bin/tools/vibe/index.js +79 -13
- package/bin/tools/vibe/patch.utils.js +243 -0
- package/bun.lock +874 -0
- package/dist/index.js +382 -490
- package/dist/tools/nativewind/index.js +80 -0
- package/dist/tools/vibe/index.js +79 -13
- package/dist/tools/vibe/patch.utils.js +243 -0
- package/index.ts +475 -787
- package/package.json +5 -1
- package/tools/nativewind/index.ts +87 -0
- package/tools/vibe/index.ts +82 -13
- package/tools/vibe/patch.utils.ts +273 -0
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Hapico CLI Orchestrator
|
|
2
|
+
|
|
3
|
+
**Hapico CLI** is a high-performance development lifecycle tool engineered for the **[com.ai.vn](https://com.ai.vn)** ecosystem. It bridges the gap between local high-fidelity development and cloud-native execution, leveraging binary-compressed synchronization and neural-enhanced code intelligence.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/hapico)
|
|
6
|
+
[](https://com.ai.vn)
|
|
7
|
+
[](https://com.ai.vn)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🛠 Core Architecture
|
|
12
|
+
|
|
13
|
+
- **Stateful Sync Engine**: Utilizes WebSockets with **Pako (Zlib) compression** for ultra-low latency differential state synchronization.
|
|
14
|
+
- **Neural Orchestration (`vibe`)**: Integrated AI agent capable of contextual project analysis and non-destructive refactoring.
|
|
15
|
+
- **Cross-Platform Bridge**: Unified pipeline supporting Web (React), Mobile (Expo/React Native), and Zalo Mini App ecosystems.
|
|
16
|
+
- **Atomic Deployment**: Guarantees consistency across main projects and distributed replicas through transactional push-to-publish cycles.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 📦 Rapid Deployment
|
|
21
|
+
|
|
22
|
+
Bootstrap your environment globally via your preferred package manager:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g hapico
|
|
26
|
+
# - or -
|
|
27
|
+
yarn global add hapico
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🎮 Command Specification
|
|
33
|
+
|
|
34
|
+
### 1. Identity & Security
|
|
35
|
+
|
|
36
|
+
| Command | Capability | Implementation |
|
|
37
|
+
| :--- | :--- | :--- |
|
|
38
|
+
| `hapico login` | **Device Authorization** | Initiates OAuth2 Device Flow (RFC 8628). Stores encrypted tokens in local secure context. |
|
|
39
|
+
| `hapico logout` | **Session Termination** | Revokes local authorization state and flushes cache. |
|
|
40
|
+
|
|
41
|
+
### 2. Workspace Provisioning
|
|
42
|
+
|
|
43
|
+
#### `hapico clone <project_id>`
|
|
44
|
+
Provision a new workspace. This command performs a three-stage initialization:
|
|
45
|
+
1. **Metadata Discovery**: Resolves project architecture and type.
|
|
46
|
+
2. **Template Injection**: Hydrates the local environment with standardized scaffolds.
|
|
47
|
+
3. **State Recovery**: Synchronizes the latest production and draft source files via binary decompression.
|
|
48
|
+
|
|
49
|
+
#### `hapico pull`
|
|
50
|
+
Synchronizes the local `src` directory with the upstream server state. Essential for multi-agent collaboration and IDE parity.
|
|
51
|
+
|
|
52
|
+
### 3. Continuous Integration & Delivery
|
|
53
|
+
|
|
54
|
+
#### `hapico push`
|
|
55
|
+
Triggers a delta-update to the remote server.
|
|
56
|
+
- Orchestrates multi-target sync for all **Replicas** defined in `hapico.config.json`.
|
|
57
|
+
- Transpiles and synchronizes critical root-level assets (`.env`, `package.json`, `tsconfig.json`).
|
|
58
|
+
|
|
59
|
+
#### `hapico publish`
|
|
60
|
+
Executes an atomic **Push + Build + Deploy** sequence. This ensures that the code currently in your local buffer is the exact version promoted to production across all primary and replica endpoints.
|
|
61
|
+
|
|
62
|
+
### 4. Development & Intelligence
|
|
63
|
+
|
|
64
|
+
#### `hapico dev [--zversion <v>]`
|
|
65
|
+
Spawns the local development runtime:
|
|
66
|
+
- **Hot-Reload Watcher**: Monitors filesystem I/O and streams updates via binary WebSocket packets.
|
|
67
|
+
- **Dynamic Previews**:
|
|
68
|
+
- **Web**: Instant browser orchestration.
|
|
69
|
+
- **Mobile**: Real-time QR generation for Expo Go and Zalo testing environments.
|
|
70
|
+
- **NativeWind JIT**: Integrated Just-In-Time compilation for Tailwind-based mobile styling.
|
|
71
|
+
|
|
72
|
+
#### `hapico vibe`
|
|
73
|
+
The **Neural Intelligence** interface. It injects an AI agent into your local context to perform high-order refactoring, logic optimization, and feature synthesis based on the current project's AST.
|
|
74
|
+
|
|
75
|
+
#### `hapico mirror`
|
|
76
|
+
Generates an LLM-optimized context snapshot (`hapico_files.txt`). This aggregates the entire codebase into a single formatted stream for feeding into Large Language Models.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## ⚙️ Infrastructure Configuration
|
|
81
|
+
|
|
82
|
+
Project behavior is governed by `hapico.config.json` at the root level:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"projectId": "12345",
|
|
87
|
+
"replicate": ["67890", "11223"]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- **`projectId`**: The authoritative UUID for the primary cloud container.
|
|
92
|
+
- **`replicate`**: A vector of IDs for automated mirroring during deployment cycles.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 📂 System Topology
|
|
97
|
+
|
|
98
|
+
Hapico mandates a strict, high-efficiency directory structure:
|
|
99
|
+
- **`/src`**: Authoritative source code container (TSX/JSX/CSS).
|
|
100
|
+
- **`.env*`**: Context-aware environment variables (synced securely).
|
|
101
|
+
- **`nativewind.json`**: Styling configuration for mobile runtimes.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 🌐 Preview Matrix
|
|
106
|
+
|
|
107
|
+
| Runtime Environment | Protocol | Access Method |
|
|
108
|
+
| :--- | :--- | :--- |
|
|
109
|
+
| **Enterprise Web** | HTTP/S | Browser Orchestration |
|
|
110
|
+
| **Expo (Native)** | `exp://` | Expo Go QR Code |
|
|
111
|
+
| **Zalo Mini App** | `zalo://` | Zalo Player QR Code |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## ⚖️ Proprietary Notice
|
|
116
|
+
|
|
117
|
+
Copyright © 2024 **COM.AI.VN**.
|
|
118
|
+
Engineered for professionals who demand low-latency, AI-augmented development workflows.
|