Compare commits

...

18 Commits

Author SHA1 Message Date
chaim f5c60f4272 release: v1.0.6 2026-03-31 22:56:28 +00:00
chaim 21c3e33635 fix: add getColor to dashlet for EspoCRM v9 compatibility 2026-03-31 22:56:08 +00:00
chaim ffbb648dd5 release: v1.0.5 2026-03-31 22:53:23 +00:00
chaim f915faafdc fix: add getActionItemDataList to dashlet for EspoCRM v9 compatibility 2026-03-31 22:53:10 +00:00
chaim b9abe5f921 release: v1.0.4 — add AssistantConversation entity 2026-03-31 20:33:21 +00:00
chaim a3801deb55 feat: add AssistantConversation i18n (fa_IR/Hebrew) 2026-03-31 20:33:05 +00:00
chaim 300cc58a97 feat: add AssistantConversation i18n (en_US) 2026-03-31 20:33:01 +00:00
chaim c1ea2b7868 feat: add AssistantConversation scope definition 2026-03-31 20:32:53 +00:00
chaim 184cd19285 feat: add AssistantConversation entity definition for chat persistence 2026-03-31 20:32:49 +00:00
chaim 2c34d56c64 release: v1.0.3 2026-03-29 21:34:38 +00:00
chaim d5c8a60193 fix: add clientModule to module.json for client-side template resolution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:34:18 +00:00
chaim 96e7c8e9e0 release: v1.0.2 2026-03-29 20:58:35 +00:00
chaim f3805424d3 fix: correct CSS and script paths in app/client.json metadata
Move CSS to module root (not inside src/), fix script paths to include
src/ prefix for handler/view JS files loaded via scriptList.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:58:22 +00:00
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
22 changed files with 181 additions and 18 deletions
+122
View File
@@ -0,0 +1,122 @@
# SmartAssistant - עוזר חכם
**גרסה:** 1.0.3 | **מחבר:** 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.
Binary file not shown.
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({
@@ -72,5 +72,18 @@ define('custom:modules/smart-assistant/views/dashlets/smart-assistant', ['view']
actionRefresh: function () {
this.loadSummary();
},
getActionItemDataList: function () {
return [
{
name: 'refresh',
iconHtml: '<span class="fas fa-sync-alt"></span>',
},
];
},
getColor: function () {
return '#5c6bc0';
},
});
});
@@ -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({
@@ -0,0 +1 @@
{"labels":{"Create AssistantConversation":"New Conversation"},"fields":{"name":"Title","conversationKey":"Conversation Key","conversationType":"Type","status":"Status","assignedUser":"User","case":"Case","caseName":"Case Name","messageCount":"Messages","messagesData":"Messages Data","lastMessageAt":"Last Message","lastMessagePreview":"Preview","createdAt":"Created At","modifiedAt":"Modified At","createdBy":"Created By","modifiedBy":"Modified By"},"links":{"assignedUser":"User","case":"Case"},"options":{"conversationType":{"office":"Office","case":"Case"}}}
@@ -0,0 +1 @@
{"labels":{"Create AssistantConversation":"שיחה חדשה"},"fields":{"name":"כותרת","conversationKey":"מזהה שיחה","conversationType":"סוג","status":"סטטוס","assignedUser":"משתמש","case":"תיק","caseName":"שם התיק","messageCount":"הודעות","messagesData":"נתוני הודעות","lastMessageAt":"הודעה אחרונה","lastMessagePreview":"תצוגה מקדימה","createdAt":"נוצר ב","modifiedAt":"עודכן ב","createdBy":"נוצר על ידי","modifiedBy":"עודכן על ידי"},"links":{"assignedUser":"משתמש","case":"תיק"},"options":{"conversationType":{"office":"משרד","case":"תיק"}}}
@@ -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"
}
@@ -0,0 +1 @@
{"fields":{"name":{"type":"varchar","maxLength":255,"required":true},"conversationKey":{"type":"varchar","maxLength":255,"required":true},"conversationType":{"type":"enum","options":["office","case"],"default":"office","required":true},"status":{"type":"varchar","maxLength":50,"default":"Active"},"assignedUser":{"type":"link"},"case":{"type":"link"},"caseName":{"type":"varchar","maxLength":255},"messageCount":{"type":"int","default":0},"messagesData":{"type":"jsonArray"},"lastMessageAt":{"type":"datetime"},"lastMessagePreview":{"type":"text","maxLength":200},"createdAt":{"type":"datetime","readOnly":true},"modifiedAt":{"type":"datetime","readOnly":true},"createdBy":{"type":"link","readOnly":true},"modifiedBy":{"type":"link","readOnly":true}},"links":{"assignedUser":{"type":"belongsTo","entity":"User"},"case":{"type":"belongsTo","entity":"Case"},"createdBy":{"type":"belongsTo","entity":"User"},"modifiedBy":{"type":"belongsTo","entity":"User"}},"collection":{"orderBy":"lastMessageAt","order":"desc","textFilterFields":["name","lastMessagePreview"]},"indexes":{"conversationKey":{"columns":["conversationKey","deleted"],"type":"unique"},"assignedUser":{"columns":["assignedUserId","deleted"]},"caseId":{"columns":["caseId","deleted"]},"conversationType":{"columns":["conversationType","deleted"]}}}
@@ -0,0 +1 @@
{"entity":true,"object":true,"module":"SmartAssistant","acl":true,"aclActionList":["create","read","edit","delete"],"aclLevelList":["all","team","own","no"],"tab":false,"stream":false,"disabled":false,"importable":false,"customizable":false}
@@ -5,5 +5,6 @@
"espocrm": ">=8.0.0"
},
"author": "klear",
"description": "Unified AI Assistant for Legal CRM"
"description": "Unified AI Assistant for Legal CRM",
"clientModule": "smart-assistant"
}
+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.6",
"acceptableVersions": [
">=8.0.0"
],
"releaseDate": "2026-03-31",
"php": [
">=8.1"
]
}