@icex-labs/openclaw-memory-engine 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/setup.sh +63 -17
package/package.json
CHANGED
package/setup.sh
CHANGED
|
@@ -384,22 +384,53 @@ except:
|
|
|
384
384
|
|
|
385
385
|
echo " Agents found: $AGENTS"
|
|
386
386
|
|
|
387
|
-
# Register
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
387
|
+
# Register crons from JSON definition file (single source of truth)
|
|
388
|
+
CRON_JSON="$PLUGIN_DIR/extras/auto-consolidation-crons.json"
|
|
389
|
+
if [ -f "$CRON_JSON" ] && command -v python3 &>/dev/null; then
|
|
390
|
+
python3 -c "
|
|
391
|
+
import json, subprocess, sys
|
|
392
|
+
|
|
393
|
+
with open('$CRON_JSON') as f:
|
|
394
|
+
crons = json.load(f).get('crons', [])
|
|
395
|
+
|
|
396
|
+
existing = '''$EXISTING_CRONS'''
|
|
397
|
+
tz = '''$TZ_IANA'''
|
|
398
|
+
|
|
399
|
+
for c in crons:
|
|
400
|
+
name = c['id']
|
|
401
|
+
if name in existing:
|
|
402
|
+
print(f'⏭️ Cron \"{name}\" already exists')
|
|
403
|
+
continue
|
|
404
|
+
agent = c.get('agent', 'main')
|
|
405
|
+
cmd = [
|
|
406
|
+
'openclaw', 'cron', 'add',
|
|
407
|
+
'--name', name,
|
|
408
|
+
'--cron', c['schedule'],
|
|
409
|
+
'--tz', tz,
|
|
410
|
+
'--agent', agent,
|
|
411
|
+
'--session', 'isolated',
|
|
412
|
+
'--model', c.get('model', 'anthropic/claude-sonnet-4-6'),
|
|
413
|
+
'--message', c['message'],
|
|
414
|
+
'--description', c.get('description', ''),
|
|
415
|
+
'--timeout', '60000',
|
|
416
|
+
]
|
|
417
|
+
result = subprocess.run(cmd, capture_output=True, text=True)
|
|
418
|
+
if result.returncode == 0:
|
|
419
|
+
print(f'✅ Cron \"{name}\" ({agent}) registered')
|
|
420
|
+
else:
|
|
421
|
+
print(f'⚠️ Cron \"{name}\" failed (gateway not running?)')
|
|
422
|
+
" 2>/dev/null
|
|
423
|
+
else
|
|
424
|
+
echo "⚠️ Cron JSON not found or python3 missing — registering defaults manually"
|
|
425
|
+
register_cron "memory-reflect-daily" "0 9 * * *" "main" \
|
|
426
|
+
"Run memory_reflect. Do NOT output to main chat." "Daily reflection"
|
|
427
|
+
register_cron "memory-consolidate-6h" "0 */6 * * *" "main" \
|
|
428
|
+
"Run memory_consolidate on today's daily log. Do NOT output to main chat." "Auto-consolidate"
|
|
429
|
+
register_cron "memory-dedup-weekly" "0 4 * * 0" "main" \
|
|
430
|
+
"Run archival_deduplicate with apply=true. Do NOT output to main chat." "Weekly dedup"
|
|
431
|
+
register_cron "memory-dashboard-daily" "30 9 * * *" "main" \
|
|
432
|
+
"Run memory_dashboard. Do NOT output to main chat." "Dashboard refresh" 30000
|
|
433
|
+
fi
|
|
403
434
|
|
|
404
435
|
# Register per-agent crons for agents with separate workspaces
|
|
405
436
|
STAGGER=0
|
|
@@ -441,7 +472,22 @@ else
|
|
|
441
472
|
echo "⚠️ openclaw CLI not found — skipping cron registration"
|
|
442
473
|
fi
|
|
443
474
|
|
|
444
|
-
# --- 9.
|
|
475
|
+
# --- 9. Track installed version ---
|
|
476
|
+
INSTALLED_VERSION=$(python3 -c "
|
|
477
|
+
import json
|
|
478
|
+
with open('$PLUGIN_DIR/package.json') as f: print(json.load(f).get('version','unknown'))
|
|
479
|
+
" 2>/dev/null || echo "unknown")
|
|
480
|
+
PREV_VERSION=""
|
|
481
|
+
VERSION_FILE="$MEMORY_DIR/.memory-engine-version"
|
|
482
|
+
[ -f "$VERSION_FILE" ] && PREV_VERSION=$(cat "$VERSION_FILE")
|
|
483
|
+
echo "$INSTALLED_VERSION" > "$VERSION_FILE"
|
|
484
|
+
|
|
485
|
+
if [ -n "$PREV_VERSION" ] && [ "$PREV_VERSION" != "$INSTALLED_VERSION" ]; then
|
|
486
|
+
echo ""
|
|
487
|
+
echo "📦 Upgraded: $PREV_VERSION → $INSTALLED_VERSION"
|
|
488
|
+
fi
|
|
489
|
+
|
|
490
|
+
# --- 10. Validate config ---
|
|
445
491
|
echo ""
|
|
446
492
|
if command -v openclaw &>/dev/null; then
|
|
447
493
|
openclaw config validate 2>&1 && echo "✅ Config valid" || echo "❌ Config validation failed"
|