File size: 3,010 Bytes
458cb9a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Agent Deployment & Operational Guide

This document informs further developers and agents about operational configurations, deployment best practices, and tricks for maintaining the **Nova-Act Platform** on Hugging Face Spaces.

## 1. Deployment Configuration

### Target Space
- **Profile:** `Leon4gr45`
- **Space:** `nova-right-nav`
- **Full Identifier:** `Leon4gr45/nova-right-nav`
- **Frontend Port:** `7860` (Mandatory port exposed by the Node.js/Express server)

### Deployment Method
- **Docker SDK:** The application runs on a React (Vite) frontend with a Node/Express backend served out of `UserSync/`. This requires a customized multi-stage Dockerfile that builds the static frontend assets and runs the Express server at port `7860`.

### HF Token
- Loaded securely from environment variables at execution/build time (`HF_TOKEN_SECRET`).

---

## 2. API Exposure and Documentation

### Mandatory Endpoints

- **`/health`**
  - **Method:** GET
  - **Purpose:** Space health telemetry verification.
  - **Response Example:**
    ```
    OK
    ```

- **`/api-docs`**
  - **Method:** GET
  - **Purpose:** Detailed rest-swagger API spec catalog.
  - **Response Example:**
    ```json
    {
      "appName": "Nova-Act Branding Content Testing & Space Suite",
      "version": "2.1",
      "endpoints": [...]
    }
    ```

### Functional Endpoints

#### `/api/craft`
- **Method:** POST
- **Purpose:** Generates 3 engaging variations of marketing copy using advanced Blablador LLM.
- **Request Body:**
  ```json
  {
    "content": "Our security tool detects IAM vulnerability loops in AWS accounts instantly.",
    "variation": "social media post"
  }
  ```
- **Response Body:**
  ```json
  {
    "result": "1. 🚀 Detect IAM loops instantly...\n2. Protect your cloud infrastructure...\n3. Secure your AWS pipelines today..."
  }
  ```

#### `/api/save-data`
- **Method:** POST
- **Purpose:** Persist custom personas, simulation traces, and test suite definitions.
- **Request Body:**
  ```json
  {
    "type": "focus_group",
    "data": { "personas": [...] },
    "user": "developer"
  }
  ```
- **Response Body:**
  ```json
  {
    "success": true,
    "message": "Data saved as developer_focus_group_2024-07-14T20-33-00.json"
  }
  ```

#### `/api/list-data`
- **Method:** GET
- **Purpose:** Retrieve lists of previously persisted local configurations.
- **Query Params:** `type` (optional), `user` (optional)
- **Response Body:**
  ```json
  [
    {
      "user": "developer",
      "type": "focus_group",
      "timestamp": "2024-07-14T20-33-00",
      "data": { "personas": [...] }
    }
  ]
  ```

---

## 3. Ongoing Space Deployment Best Practices
1. Ensure the static React frontend is compiled and optimized before launching the Express server (`npm run build`).
2. Keep the space clean of auxiliary caches, `.log` files, and local artifacts by configuring `.hfignore` correctly.
3. Expose Port `7860` in the Dockerfile so that Hugging Face Proxy binds to the application traffic seamlessly.