Compare commits

..

5 Commits

Author SHA1 Message Date
chaim 1eea85da2b release: v1.0.1 2026-03-29 20:52:18 +00:00
chaim fbe4f82517 refactor: migrate client paths to EspoCRM module format
Move JS from client/custom/src/modules/{mod}/ to client/custom/modules/{mod}/src/
Move TPL to client/custom/modules/{mod}/res/templates/
Update all define(), createView(), and metadata references from
custom:modules/{mod}/... to modules/{mod}/...

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:51:55 +00:00
chaim 95ca8a0af4 docs: add comprehensive Hebrew README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:53:09 +00:00
chaim bd1cd17490 chore: auto-update README version from manifest on build
build.sh now updates the version in README.md from manifest.json
before creating the ZIP package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:49:22 +00:00
chaim ffd966a4f0 chore: add composer.json for automated Composer Registry publishing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:12:23 +00:00
15 changed files with 162 additions and 17 deletions
+122
View File
@@ -0,0 +1,122 @@
# SmartAssistant - עוזר חכם
**גרסה:** 1.0.1 | **מחבר:** klear | **EspoCRM:** >= 8.0.0
## תיאור
עוזר AI מאוחד למשרד עורכי דין. מספק ממשק צ'אט צף עם שני מצבי עבודה: **מצב משרד** (סקירה כללית, התראות, סטטיסטיקות) ו**מצב תיק** (סיוע מעמיק בתיק ספציפי). כולל מערכת זיכרון תיק מובנית, ביצוע פעולות באישור המשתמש, ואינטגרציה עם Stream של EspoCRM.
מחליף את CrmAssistant + OfficeAssistant (deprecated).
## תלויות
- Webhook חיצוני (n8n או דומה) לעיבוד AI
- NetworkStorageIntegration / NextCloudIntegration (אופציונלי — לניתוח מסמכים)
## התקנה
1. התקנה דרך Admin > Extensions
2. הגדרת Webhook: Admin > Integrations > Smart Assistant
## הגדרות אינטגרציה
| שדה | תיאור | דוגמה |
|------|--------|--------|
| webhookUrl | כתובת Webhook לשירות AI | `https://n8n.example.com/webhook/assistant/chat` |
| apiKey | מפתח אימות (אופציונלי) | `sk-...` |
| maxMessagesPerHour | הגבלת קצב הודעות | `30` |
| inactivityWarningDays | סף אזהרה לחוסר פעילות בתיק | `14` |
| inactivityCriticalDays | סף קריטי לחוסר פעילות | `30` |
| upcomingHearingDays | חלון דיונים קרובים (ימים) | `7` |
## אנטיטי: CaseMemory — זיכרון תיק
מאגר ידע מובנה לכל תיק, מחולק לקטגוריות:
| קטגוריה | תיאור |
|----------|--------|
| key_facts | עובדות מפתח |
| strategy | אסטרטגיה |
| decisions | החלטות |
| contacts_notes | הערות על אנשי קשר |
| timeline | ציר זמן |
| documents_notes | הערות על מסמכים |
| billing_notes | הערות חיוב |
**מקורות:** ידני (manual), עוזר AI (assistant), אוטומטי (auto — hooks)
**רמות חשיבות:** low, normal, high, critical
## רכיבים
### Backend (PHP)
| רכיב | קובץ | תיאור |
|-------|------|--------|
| Controller | `Controllers/SmartAssistant.php` | API endpoints |
| שירות ראשי | `Services/SmartAssistantService.php` | תזמור צ'אט, שיחות, פעולות |
| בונה הקשר תיק | `Services/CaseContextBuilder.php` | אוסף נתוני תיק מלאים (אנשי קשר, משימות, מסמכים, זיכרון) |
| בונה הקשר משרד | `Services/OfficeContextBuilder.php` | סטטיסטיקות, התראות, עומס עבודה |
| מחשבון התראות | `Services/AlertCalculator.php` | זיהוי תיקים לא פעילים, משימות באיחור, דיונים קרובים |
| מבצע פעולות | `Services/ActionExecutor.php` | ביצוע פעולות שאושרו (משימה, פתק, דיון, שינוי סטטוס) |
| שירות זיכרון | `Services/CaseMemoryService.php` | CRUD לזיכרון תיק |
| ספק הקשר זיכרון | `Services/CaseMemoryContextProvider.php` | הזרקת זיכרון להקשר AI |
| מאגר שיחות | `Services/ConversationRepository.php` | שמירה ואחזור שיחות |
| מנתח מסמכים | `Services/DocumentAnalyzer.php` | סריקת מסמכים וסיווג |
### Hooks
| Hook | תיאור |
|------|--------|
| `Case/CaseFieldChangeMemory` | יצירת זיכרון אוטומטית בשינוי שדות תיק (סטטוס, שופט, דיון) |
| `Meeting/HearingScheduledMemory` | יצירת זיכרון בקביעת דיון חדש |
### Frontend (JavaScript)
| רכיב | תיאור |
|-------|--------|
| `floating-chat.js` | ממשק צ'אט צף (FAB) עם מגירת היסטוריה וזיכרון |
| `dashlets/smart-assistant.js` | דשלט עם מדדים והתראות |
| `stream/notes/smart-request.js` | תצוגת הודעת משתמש ב-Stream |
| `stream/notes/smart-response.js` | תצוגת תשובת עוזר ב-Stream |
| `stream/notes/smart-action.js` | תצוגת פעולה שבוצעה ב-Stream |
| `case/modals/add-memory.js` | מודל להוספת זיכרון ידנית |
| `site/navbar.js` | אינטגרציית התראות בסרגל ניווט |
## API Routes
| נתיב | Method | תיאור |
|-------|--------|--------|
| `/SmartAssistant/action/chat` | POST | שליחת הודעה לעוזר |
| `/SmartAssistant/action/execute` | POST | ביצוע פעולה שאושרה |
| `/SmartAssistant/action/summary` | GET | סיכום משרדי + התראות |
| `/SmartAssistant/action/alerts` | GET | רשימת התראות |
| `/SmartAssistant/action/history` | GET | היסטוריית שיחות |
| `/SmartAssistant/action/conversations` | GET | רשימת שיחות אחרונות |
| `/SmartAssistant/action/conversationMessages` | GET | הודעות שיחה ספציפית |
| `/SmartAssistant/action/searchHistory` | GET | חיפוש בשיחות |
| `/SmartAssistant/action/caseMemory` | GET | אחזור זיכרון תיק |
| `/SmartAssistant/action/saveMemory` | POST | שמירת זיכרון ידנית |
## פעולות עוזר
### פעולות מיידיות (ללא אישור)
- `list_documents` — רשימת מסמכים בתיק
- `save_memory` — שמירת זיכרון תיק
### פעולות הדורשות אישור
- `create_task` — יצירת משימה
- `add_note` — הוספת הערה
- `change_status` — שינוי סטטוס תיק
- `create_meeting` — יצירת פגישה
- `schedule_hearing` — קביעת דיון
- `analyze_document` — ניתוח מסמך
- `rename_document` — שינוי שם מסמך
## מערכת התראות
| סוג | סף ברירת מחדל | חומרה |
|------|----------------|--------|
| תיק לא פעיל | 14 יום | אזהרה |
| תיק לא פעיל | 30 יום | קריטי |
| משימה באיחור | תאריך יעד עבר | קריטי |
| דיון קרוב | 7 ימים | אזהרה |
| תיק ללא שיוך | חדש ללא assignedUser | אזהרה |
| משימה בעדיפות גבוהה | 5 ימים | אזהרה |
Binary file not shown.
+5
View File
@@ -4,6 +4,11 @@ set -euo pipefail
VERSION=$(python3 -c "import json; print(json.load(open('manifest.json'))['version'])")
MODULE=$(python3 -c "import json; m=json.load(open('manifest.json')); print(m.get('module', m['name']))")
ZIPNAME="${MODULE}-${VERSION}.zip"
# Update version in README.md if it exists
if [[ -f README.md ]]; then
sed -i "s/\*\*גרסה:\*\* [^ |]*/\*\*גרסה:\*\* ${VERSION}/" README.md
fi
echo "Building $ZIPNAME..."
rm -f "$ZIPNAME"
zip -r "$ZIPNAME" manifest.json files/ \
+14
View File
@@ -0,0 +1,14 @@
{
"name": "espocrm-extensions/smart-assistant",
"description": "Unified AI Assistant for Legal CRM — floating chat with case memory, office alerts, and n8n integration",
"type": "espocrm-extension",
"license": "proprietary",
"authors": [{"name": "klear"}],
"require": {
"php": ">=8.1"
},
"extra": {
"espocrm-module": "SmartAssistant",
"espocrm-min-version": ">=8.0.0"
}
}
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/case/modals/add-memory', ['views/modal'], function (ModalView) {
define('modules/smart-assistant/views/case/modals/add-memory', ['views/modal'], function (ModalView) {
return ModalView.extend({
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/dashlets/options/smart-assistant', ['views/dashlets/options/base'], function (BaseView) {
define('modules/smart-assistant/views/dashlets/options/smart-assistant', ['views/dashlets/options/base'], function (BaseView) {
return BaseView.extend({
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/dashlets/smart-assistant', ['view'], function (View) {
define('modules/smart-assistant/views/dashlets/smart-assistant', ['view'], function (View) {
return View.extend({
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/floating-chat', ['view'], function (View) {
define('modules/smart-assistant/views/floating-chat', ['view'], function (View) {
return View.extend({
@@ -562,7 +562,7 @@ define('custom:modules/smart-assistant/views/floating-chat', ['view'], function
if (!this.currentCaseId) return;
var self = this;
this.createView('addMemoryModal', 'custom:modules/smart-assistant/views/case/modals/add-memory', {
this.createView('addMemoryModal', 'modules/smart-assistant/views/case/modals/add-memory', {
caseId: this.currentCaseId,
}, function (view) {
view.render();
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/site/navbar', ['views/site/navbar'], function (NavbarView) {
define('modules/smart-assistant/views/site/navbar', ['views/site/navbar'], function (NavbarView) {
return NavbarView.extend({
@@ -17,7 +17,7 @@ define('custom:modules/smart-assistant/views/site/navbar', ['views/site/navbar']
$('body').append($container);
}
this.createView('floatingChat', 'custom:modules/smart-assistant/views/floating-chat', {
this.createView('floatingChat', 'modules/smart-assistant/views/floating-chat', {
el: '.smart-assistant-fab-container',
}, function (view) {
view.render();
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/stream/notes/smart-action', ['views/stream/note'], function (NoteView) {
define('modules/smart-assistant/views/stream/notes/smart-action', ['views/stream/note'], function (NoteView) {
return NoteView.extend({
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/stream/notes/smart-request', ['views/stream/note'], function (NoteView) {
define('modules/smart-assistant/views/stream/notes/smart-request', ['views/stream/note'], function (NoteView) {
return NoteView.extend({
@@ -1,4 +1,4 @@
define('custom:modules/smart-assistant/views/stream/notes/smart-response', ['views/stream/note'], function (NoteView) {
define('modules/smart-assistant/views/stream/notes/smart-response', ['views/stream/note'], function (NoteView) {
return NoteView.extend({
@@ -1,3 +1,3 @@
{
"navbarView": "custom:modules/smart-assistant/views/site/navbar"
"navbarView": "modules/smart-assistant/views/site/navbar"
}
@@ -1,5 +1,5 @@
{
"view": "custom:modules/smart-assistant/views/dashlets/smart-assistant",
"optionsView": "custom:modules/smart-assistant/views/dashlets/options/smart-assistant",
"view": "modules/smart-assistant/views/dashlets/smart-assistant",
"optionsView": "modules/smart-assistant/views/dashlets/options/smart-assistant",
"aclScope": "Case"
}
+8 -4
View File
@@ -3,8 +3,12 @@
"module": "SmartAssistant",
"description": "Unified AI Assistant for Legal CRM — floating chat with case memory, office alerts, and n8n integration",
"author": "klear",
"version": "1.0.0",
"acceptableVersions": [">=8.0.0"],
"releaseDate": "2026-03-23",
"php": [">=8.1"]
"version": "1.0.1",
"acceptableVersions": [
">=8.0.0"
],
"releaseDate": "2026-03-29",
"php": [
">=8.1"
]
}