GraziePrego commited on
Commit
e902e6e
·
verified ·
1 Parent(s): 03adff1

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Agent.md +6 -6
  2. README.md +1 -1
  3. entrypoint.sh +35 -13
Agent.md CHANGED
@@ -6,7 +6,7 @@ This file serves as a guide for further agents regarding deployment best practic
6
  The app is configured to run as a Docker container on port 7860.
7
 
8
  ### Target Spaces
9
- - **Target:** `AUXteam/Web-Agent-Internal`
10
  - **Frontend Port:** `7860`
11
 
12
  ### Mandatory Endpoints
@@ -40,19 +40,19 @@ The app is configured to run as a Docker container on port 7860.
40
 
41
  To redeploy, use:
42
  ```bash
43
- # Deploy to AUXteam/Web-Agent-Internal
44
- hf upload AUXteam/Web-Agent-Internal . --repo-type=space
45
  ```
46
 
47
  ### OpenCode CLI Authentication
48
- The Space is configured to automatically log in to OpenCode if the `OPENCODE_AUTH_TOKEN` environment variable is set in the Space secrets.
49
 
50
  ### GitHub CLI Authentication
51
  To enable GitHub operations (like PR creation), provide a GitHub Personal Access Token (PAT) via the `GITHUB_API_TOKEN` environment variable in the Space secrets.
52
 
53
  Monitor logs via:
54
- - Build logs: `curl -N -H "Authorization: Bearer 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" "https://huggingface.co/api/spaces/AUXteam/Web-Agent-Internal/logs/build"`
55
- - Run logs: `curl -N -H "Authorization: Bearer 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" "https://huggingface.co/api/spaces/AUXteam/Web-Agent-Internal/logs/run"`
56
 
57
  ## Tips
58
  - Ensure the Dockerfile builds both the UI and Server.
 
6
  The app is configured to run as a Docker container on port 7860.
7
 
8
  ### Target Spaces
9
+ - **Target:** `GraziePrego/automaker`
10
  - **Frontend Port:** `7860`
11
 
12
  ### Mandatory Endpoints
 
40
 
41
  To redeploy, use:
42
  ```bash
43
+ # Deploy to GraziePrego/automaker
44
+ hf upload GraziePrego/automaker . --repo-type=space --token <YOUR_TOKEN>
45
  ```
46
 
47
  ### OpenCode CLI Authentication
48
+ The Space is configured to automatically log in to OpenCode if the `OPENCODE_API_KEY` or `JULES_API_KEY` environment variables are set in the Space secrets.
49
 
50
  ### GitHub CLI Authentication
51
  To enable GitHub operations (like PR creation), provide a GitHub Personal Access Token (PAT) via the `GITHUB_API_TOKEN` environment variable in the Space secrets.
52
 
53
  Monitor logs via:
54
+ - Build logs: `curl -N -H "Authorization: Bearer <YOUR_TOKEN>" "https://huggingface.co/api/spaces/GraziePrego/automaker/logs/build"`
55
+ - Run logs: `curl -N -H "Authorization: Bearer <YOUR_TOKEN>" "https://huggingface.co/api/spaces/GraziePrego/automaker/logs/run"`
56
 
57
  ## Tips
58
  - Ensure the Dockerfile builds both the UI and Server.
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Web-Agent-Internal
3
  emoji: 🤖
4
  colorFrom: blue
5
  colorTo: indigo
 
1
  ---
2
+ title: Automaker
3
  emoji: 🤖
4
  colorFrom: blue
5
  colorTo: indigo
entrypoint.sh CHANGED
@@ -7,22 +7,36 @@ echo "Starting Automaker entrypoint script..."
7
  mkdir -p "$DATA_DIR"
8
 
9
  # Configure OpenCode authentication
10
- if [ -n "$OPENCODE_API_KEY" ]; then
11
- echo "OPENCODE_API_KEY detected, configuring OpenCode..."
12
  mkdir -p "$HOME/.local/share/opencode"
13
- echo "{\"opencode\": {\"type\": \"api\", \"key\": \"$OPENCODE_API_KEY\"}}" > "$HOME/.local/share/opencode/auth.json"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  echo "OpenCode authentication configured."
15
  else
16
- echo "OPENCODE_API_KEY not found."
17
- fi
18
-
19
- # Configure Jules authentication
20
- if [ -n "$JULES_API_KEY" ]; then
21
- echo "JULES_API_KEY detected, configuring Jules CLI..."
22
- export JULES_TOKEN="$JULES_API_KEY"
23
- echo "Jules CLI authentication configured."
24
- else
25
- echo "JULES_API_KEY not found."
26
  fi
27
 
28
  # Configure GitHub CLI authentication
@@ -34,6 +48,14 @@ else
34
  echo "GITHUB_API_KEY not found."
35
  fi
36
 
 
 
 
 
 
 
 
 
37
  # Start the application
38
  echo "Starting application on port $PORT..."
39
  exec node apps/server/dist/index.js
 
7
  mkdir -p "$DATA_DIR"
8
 
9
  # Configure OpenCode authentication
10
+ if [ -n "$OPENCODE_API_KEY" ] || [ -n "$JULES_API_KEY" ]; then
11
+ echo "Configuring OpenCode authentication..."
12
  mkdir -p "$HOME/.local/share/opencode"
13
+
14
+ # Start with a base auth object
15
+ AUTH_JSON="{}"
16
+
17
+ # Add opencode provider if OPENCODE_API_KEY is present
18
+ if [ -n "$OPENCODE_API_KEY" ]; then
19
+ AUTH_JSON=$(echo "$AUTH_JSON" | jq ". + {\"api_key\": \"$OPENCODE_API_KEY\", \"opencode\": {\"type\": \"api_key\", \"key\": \"$OPENCODE_API_KEY\"}}")
20
+ fi
21
+
22
+ # Add helmholtz provider if JULES_API_KEY is present
23
+ if [ -n "$JULES_API_KEY" ]; then
24
+ AUTH_JSON=$(echo "$AUTH_JSON" | jq ". + {\"helmholtz\": {\"type\": \"api_key\", \"key\": \"$JULES_API_KEY\", \"baseURL\": \"https://api.helmholtz-blablador.fz-juelich.de/v1\"}}")
25
+
26
+ # Also set helmholtz/alias-code as default model using update_settings.py
27
+ if [ -f "/usr/local/bin/update_settings.py" ]; then
28
+ python3 /usr/local/bin/update_settings.py "$DATA_DIR" "helmholtz/alias-code"
29
+ fi
30
+
31
+ # Export as JULES_TOKEN for Jules CLI compatibility
32
+ export JULES_TOKEN="$JULES_API_KEY"
33
+ echo "Jules CLI authentication configured."
34
+ fi
35
+
36
+ echo "$AUTH_JSON" > "$HOME/.local/share/opencode/auth.json"
37
  echo "OpenCode authentication configured."
38
  else
39
+ echo "Neither OPENCODE_API_KEY nor JULES_API_KEY found."
 
 
 
 
 
 
 
 
 
40
  fi
41
 
42
  # Configure GitHub CLI authentication
 
48
  echo "GITHUB_API_KEY not found."
49
  fi
50
 
51
+ # Log environment info for debugging
52
+ echo "Environment Info:"
53
+ echo " UID: $(id -u)"
54
+ echo " HOME: $HOME"
55
+ echo " PWD: $(pwd)"
56
+ echo " PORT: $PORT"
57
+ echo " DATA_DIR: $DATA_DIR"
58
+
59
  # Start the application
60
  echo "Starting application on port $PORT..."
61
  exec node apps/server/dist/index.js