CEO: add email notifications, subtask parentId, and Paperclip UI assets

- CEO agent now sends email via notify.py when awaiting human response
- CEO creates child issues (parentId) instead of flat disconnected issues
- Fix notify.py email address to chaim+paperclip@marcus-law.co.il
- Move Paperclip UI assets (RTL CSS + Hebrew JS) into repo under scripts/
- Add deploy.sh script to push assets to live Paperclip instance
- Fix comment box positioning: newest comment on top, input below it

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-14 15:55:55 +00:00
parent 6228846223
commit 11c73a7c60
6 changed files with 2493 additions and 1 deletions

View File

@@ -60,6 +60,48 @@ tools:
| בודק איכות | 1a5b229e-9220-4b13-940c-f8eb7285fc29 | QA לפני ייצוא | | בודק איכות | 1a5b229e-9220-4b13-940c-f8eb7285fc29 | QA לפני ייצוא |
| מייצא טיוטה | d0dc703b-ca83-4883-bca7-c9449e8713cd | בדיקה סופית + ייצוא DOCX מגורסת | | מייצא טיוטה | d0dc703b-ca83-4883-bca7-c9449e8713cd | בדיקה סופית + ייצוא DOCX מגורסת |
## כלל: כל issue חדש = תת-משימה
כשאתה יוצר issue חדש לסוכן, **תמיד** כלול `parentId` עם ה-issue ID הראשי של התיק.
ה-issue הראשי הוא ה-issue שבו אתה עובד — `$PAPERCLIP_TASK_ID`.
```bash
curl -s -X POST -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
-H "Content-Type: application/json" \
"$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/issues" \
-d '{"title": "...", "description": "...", "parentId": "'$PAPERCLIP_TASK_ID'", "assigneeAgentId": "..."}'
```
**אם** ה-issue שלך הוא בעצמו תת-משימה (יש לו parent), השתמש ב-parent של ה-parent — כלומר ה-issue הראשי של התיק. לקבלת ה-parent:
```bash
curl -s -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
"$PAPERCLIP_API_URL/api/issues/$PAPERCLIP_TASK_ID" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('parentId') or d['id'])"
```
---
## התראת מייל — חובה
**בכל פעם שאתה מפרסם comment שמצפה לתשובה מחיים**, שלח מייל:
```bash
python3 /home/chaim/legal-ai/scripts/notify.py \
"נדרשת תשובתך — [תיאור קצר]" \
"[סיכום: מה בוצע, מה נדרש ממך, קישור ל-issue]"
```
**מתי לשלוח — תמיד:**
- סיום כל שלב (B, C, D, F) — עם סיכום מה בוצע
- כל comment שמבקש בחירה (תוצאה, כיוון, טיפול בטענות)
- שגיאה שדורשת התערבות
- החלטה מוכנה לביקורת דפנה
**מתי לא לשלוח:**
- עדכוני סטטוס ביניים (רק בסיום שלב)
- שגיאות טכניות שאפשר לפתור לבד
---
## תהליך אינטראקטיבי — שלב אחר שלב ## תהליך אינטראקטיבי — שלב אחר שלב
### שלב 0: בדוק למה התעוררת ### שלב 0: בדוק למה התעוררת

View File

@@ -15,7 +15,7 @@ SMTP_HOST = "smtp.gmail.com"
SMTP_PORT = 587 SMTP_PORT = 587
FROM_EMAIL = "notify@marcus-law.co.il" FROM_EMAIL = "notify@marcus-law.co.il"
FROM_PASS = "vuva jwed lbuz xjds" FROM_PASS = "vuva jwed lbuz xjds"
TO_EMAIL = "paperclip+chaim@marcus-law.co.il" TO_EMAIL = "chaim+paperclip@marcus-law.co.il"
def send(subject: str, body: str) -> bool: def send(subject: str, body: str) -> bool:

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Deploy Paperclip UI assets (RTL + Hebrew translation) to the live instance.
# Usage: bash scripts/paperclip-assets/deploy.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
UI_DIR="/home/chaim/.npm/_npx/43414d9b790239bb/node_modules/@paperclipai/server/ui-dist"
if [ ! -d "$UI_DIR/assets" ]; then
echo "ERROR: Paperclip ui-dist not found at $UI_DIR"
echo "Run: find ~/.npm/_npx -name ui-dist -path '*paperclipai*' -type d"
exit 1
fi
cp "$SCRIPT_DIR/rtl-override.css" "$UI_DIR/assets/rtl-override.css"
cp "$SCRIPT_DIR/translate-he.js" "$UI_DIR/assets/translate-he.js"
echo "Assets deployed to $UI_DIR/assets/"
echo "Restarting Paperclip..."
pm2 restart paperclip
echo "Done."

View File

@@ -0,0 +1,33 @@
#!/bin/bash
# patch-html.sh - Inject Hebrew RTL + translation into Paperclip UI
set -e
# Find the ui-dist directory in the global npm install
UI_DIR=$(find /usr/local/lib/node_modules/paperclipai -name "ui-dist" -type d | head -1)
if [ -z "$UI_DIR" ]; then
echo "ERROR: Could not find Paperclip ui-dist directory"
exit 1
fi
echo "Found ui-dist at: $UI_DIR"
# Copy assets
cp /tmp/rtl-override.css "$UI_DIR/assets/rtl-override.css"
cp /tmp/translate-he.js "$UI_DIR/assets/translate-he.js"
# Patch index.html:
# 1. Set dir="rtl" and lang="he"
sed -i 's/<html lang="en"/<html lang="he" dir="rtl"/' "$UI_DIR/index.html"
# 2. Inject RTL CSS and translation script before </head>
sed -i 's|</head>|<link rel="stylesheet" href="/assets/rtl-override.css">\n<script defer src="/assets/translate-he.js"></script>\n</head>|' "$UI_DIR/index.html"
# 3. Update page title
sed -i 's|<title>Paperclip</title>|<title>Paperclip - פייפרקליפ</title>|' "$UI_DIR/index.html"
echo "Hebrew RTL patch applied successfully"
echo "Patched files:"
echo " - $UI_DIR/index.html"
echo " - $UI_DIR/assets/rtl-override.css"
echo " - $UI_DIR/assets/translate-he.js"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff