Add Alfred IDE config, start script, branding patches, architecture docs

This commit is contained in:
Commander 2026-04-07 16:16:58 -04:00
parent 2fc04c07c4
commit dbd09fcdba
4 changed files with 98 additions and 1 deletions

View File

@ -1,2 +1,43 @@
# alfred-ide
# Alfred IDE
Cloud-native AI development environment built on code-server, with custom Commander extension, multi-provider AI chat, voice assistant, and sovereign infrastructure.
## Architecture
- **Base**: code-server 4.102.2 (VS Code for the web)
- **Extension**: Alfred Commander (3,551-line extension.js) — AI chat, stats, voice, walkthrough
- **Auth**: Cookie-based gating via Apache + PHP, PIN/email login
- **MCP**: 500+ tools via gocodeme-mcp service (port 3006)
- **Branding**: Patched workbench.js + NLS message files
## Components
| Component | Location | Purpose |
|-----------|----------|---------|
| `start.sh` | Server start script | Launches code-server with config |
| `config.yaml` | code-server config | Port 8443, auth:none (Apache handles auth) |
| `branding-patches.sh` | Branding automation | Patches "code-server" → "Alfred IDE" |
| Commander extension | `extensions/gositeme.alfred-commander-1.0.1/` | Full IDE UX |
## Auth Flow
1. User visits `gositeme.com/alfred-ide/`
2. Apache checks for `alfred_ide_token` cookie
3. Missing → redirect to `alfred-ide-auth.php`
4. Login via PIN (Commander) or email/password
5. Session created in DB, cookie set → proxy to code-server
## Running
```bash
# PM2 managed
pm2 start alfred-ide
# Manual
./start.sh
# → http://127.0.0.1:8443
```
## License
AGPL-3.0 — GoSiteMe Inc.

21
branding-patches.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
# Alfred IDE Branding Patches
# Applied to code-server workbench.js and NLS files
# See user memory notes for full details
WORKBENCH="/home/gositeme/.local/share/code-server/lib/vscode/out/vs/workbench/workbench.web.main.js"
# Product name patches
sed -i 's/nameShort:"code-server"/nameShort:"Alfred IDE"/g' "$WORKBENCH"
sed -i 's/nameLong:"code-server"/nameLong:"Alfred IDE"/g' "$WORKBENCH"
# Secure context warning
sed -i 's/d(3228,null,"code-server")/d(3228,null,"Alfred IDE")/g' "$WORKBENCH"
# Logout menu
sed -i 's/d(3230,null,"code-server")/d(3230,null,"Alfred IDE")/g' "$WORKBENCH"
# Update notification
sed -i 's/\[code-server v/[Alfred IDE v/g' "$WORKBENCH"
echo "Branding patches applied to $(basename $WORKBENCH)"

7
config.yaml Normal file
View File

@ -0,0 +1,7 @@
bind-addr: 127.0.0.1:8443
auth: none
cert: false
app-name: Alfred IDE
welcome-text: Welcome, Commander
disable-telemetry: true
disable-update-check: true

28
start.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# Alfred IDE - Start Script
# Launches code-server (rebranded as Alfred IDE)
# CRITICAL: unset VSCODE_IPC_HOOK_CLI or code-server detects VS Code and exits silently
unset VSCODE_IPC_HOOK_CLI
# Prevent file watcher from consuming all CPU when inotify fills up
export VSCODE_FILE_WATCHER_POLLING_INTERVAL=30000
export CHOKIDAR_USEPOLLING=0
PORT=8443
HOST=127.0.0.1
CODE_SERVER_BIN=/home/gositeme/.local/bin/code-server
# If Alfred IDE is already bound on the expected port, do not spawn a duplicate.
EXISTING_PID=$(ss -ltnp 2>/dev/null | awk -v addr="$HOST:$PORT" '$4 == addr { if (match($0, /pid=([0-9]+)/, m)) print m[1] }' | head -n 1)
if [[ -n "$EXISTING_PID" ]] && ps -p "$EXISTING_PID" -o args= 2>/dev/null | grep -q 'code-server'; then
echo "Alfred IDE already running on ${HOST}:${PORT} (pid ${EXISTING_PID})"
exit 0
fi
exec nice -n 15 ionice -c 3 /home/gositeme/.local/bin/code-server \
--bind-addr ${HOST}:${PORT} \
--disable-telemetry \
--disable-update-check \
--user-data-dir /home/gositeme/.local/share/code-server \
/home/gositeme