@hapico/cli 0.0.31 → 0.0.33

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 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
+ [![NPM Version](https://img.shields.io/npm/v/hapico.svg?style=flat-square&color=007acc)](https://www.npmjs.com/package/hapico)
6
+ [![Platform](https://img.shields.io/badge/Platform-COM.AI.VN-orange.svg?style=flat-square)](https://com.ai.vn)
7
+ [![License](https://img.shields.io/badge/License-Proprietary-red.svg?style=flat-square)](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/cli
26
+ # - or -
27
+ yarn global add @hapico/cli
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.
package/bin/index.js CHANGED
@@ -414,7 +414,7 @@ class RoomState {
414
414
  return this.isConnected;
415
415
  }
416
416
  }
417
- commander_1.program.version("0.0.31").description("Hapico CLI for project management");
417
+ commander_1.program.version("0.0.33").description("Hapico CLI for project management");
418
418
  commander_1.program
419
419
  .command("clone <id>")
420
420
  .description("Clone a project by ID")
package/dist/index.js CHANGED
@@ -414,7 +414,7 @@ class RoomState {
414
414
  return this.isConnected;
415
415
  }
416
416
  }
417
- commander_1.program.version("0.0.31").description("Hapico CLI for project management");
417
+ commander_1.program.version("0.0.33").description("Hapico CLI for project management");
418
418
  commander_1.program
419
419
  .command("clone <id>")
420
420
  .description("Clone a project by ID")
package/index.ts CHANGED
@@ -482,7 +482,7 @@ class RoomState {
482
482
  }
483
483
  }
484
484
 
485
- program.version("0.0.31").description("Hapico CLI for project management");
485
+ program.version("0.0.33").description("Hapico CLI for project management");
486
486
 
487
487
  program
488
488
  .command("clone <id>")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hapico/cli",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "description": "A simple CLI tool for project management",
5
5
  "main": "index.js",
6
6
  "bin": {