@cachly-dev/mcp-server 0.5.44 → 0.5.46
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/dist/index.js +209 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +218 -1
package/dist/index.js
CHANGED
|
@@ -695,6 +695,187 @@ const CROSS_LINGUAL_MAP = new Map([
|
|
|
695
695
|
['תמונה', ['image']],
|
|
696
696
|
['סיסמה', ['password']],
|
|
697
697
|
['הרשאה', ['permission']],
|
|
698
|
+
// ── European languages → English ─────────────────────────────────────────
|
|
699
|
+
// German (Deutsch) → English
|
|
700
|
+
['fehler', ['error', 'err']],
|
|
701
|
+
['absturz', ['crash', 'panic']],
|
|
702
|
+
['bug', ['bug', 'issue']], // same word, keep for completeness
|
|
703
|
+
['beheben', ['fix', 'bugfix']],
|
|
704
|
+
['behoben', ['fix', 'fixed']],
|
|
705
|
+
['lösung', ['solution', 'fix']],
|
|
706
|
+
['bauen', ['build']],
|
|
707
|
+
['testen', ['test']],
|
|
708
|
+
['authentifizierung', ['auth', 'authentication']],
|
|
709
|
+
['konfiguration', ['config', 'configuration']],
|
|
710
|
+
['einstellungen', ['config', 'settings']],
|
|
711
|
+
['installieren', ['install']],
|
|
712
|
+
['installiert', ['install', 'installed']],
|
|
713
|
+
['aktualisieren', ['update', 'upgrade']],
|
|
714
|
+
['aktualisierung', ['update', 'upgrade']],
|
|
715
|
+
['protokoll', ['log']],
|
|
716
|
+
['protokolle', ['log', 'logs']],
|
|
717
|
+
['abbild', ['image']],
|
|
718
|
+
['knoten', ['node']],
|
|
719
|
+
['dienst', ['service']],
|
|
720
|
+
['sicherung', ['backup']],
|
|
721
|
+
['überwachung', ['monitor', 'monitoring']],
|
|
722
|
+
['verbindung', ['connection', 'conn']],
|
|
723
|
+
['warteschlange', ['queue']],
|
|
724
|
+
['leistung', ['performance']],
|
|
725
|
+
['speicher', ['memory', 'storage']],
|
|
726
|
+
['debuggen', ['debug', 'debugging']],
|
|
727
|
+
['neustart', ['restart', 'reboot']],
|
|
728
|
+
['berechtigung', ['permission', 'access']],
|
|
729
|
+
['berechtigungen', ['permission', 'access', 'acl']],
|
|
730
|
+
['netzwerk', ['network']],
|
|
731
|
+
['datenbank', ['database', 'db']],
|
|
732
|
+
['bereitstellen', ['deploy', 'deployment']],
|
|
733
|
+
['bereitstellung', ['deploy', 'deployment']],
|
|
734
|
+
// 'container' and 'server' are the same in German/French/Spanish/Italian/Portuguese
|
|
735
|
+
['kaputt', ['broken', 'error', 'crash']],
|
|
736
|
+
['funktioniert', ['works', 'working']],
|
|
737
|
+
['geht nicht', ['not working', 'broken', 'error']],
|
|
738
|
+
['schlüssel', ['key', 'token', 'secret']],
|
|
739
|
+
['zertifikat', ['certificate', 'cert', 'ssl', 'tls']],
|
|
740
|
+
['umgebung', ['environment', 'env']],
|
|
741
|
+
['variablen', ['variables', 'env', 'environment']],
|
|
742
|
+
['aufgabe', ['task', 'job']],
|
|
743
|
+
['wartung', ['maintenance']],
|
|
744
|
+
['speicherleck', ['memory leak', 'memory']],
|
|
745
|
+
['schnittstelle', ['interface', 'api']],
|
|
746
|
+
// French (Français) → English
|
|
747
|
+
['erreur', ['error', 'err']],
|
|
748
|
+
['réparer', ['fix']],
|
|
749
|
+
['correction', ['fix', 'bugfix']],
|
|
750
|
+
['construire', ['build']],
|
|
751
|
+
['tester', ['test']],
|
|
752
|
+
['authentification', ['auth', 'authentication']],
|
|
753
|
+
['configuration', ['config', 'configuration']],
|
|
754
|
+
['installer', ['install']],
|
|
755
|
+
['installation', ['install']],
|
|
756
|
+
['mettre', ['update', 'upgrade']],
|
|
757
|
+
['journal', ['log', 'logs']],
|
|
758
|
+
['nœud', ['node']],
|
|
759
|
+
['sauvegarde', ['backup']],
|
|
760
|
+
['surveiller', ['monitor', 'monitoring']],
|
|
761
|
+
['connexion', ['connection']],
|
|
762
|
+
['mémoire', ['memory']],
|
|
763
|
+
['déboguer', ['debug']],
|
|
764
|
+
['redémarrer', ['restart', 'reboot']],
|
|
765
|
+
['réseau', ['network']],
|
|
766
|
+
['base de données', ['database', 'db']],
|
|
767
|
+
['déployer', ['deploy']],
|
|
768
|
+
['déploiement', ['deploy', 'deployment']],
|
|
769
|
+
['clé', ['key', 'token']],
|
|
770
|
+
['certificat', ['certificate', 'cert', 'ssl']],
|
|
771
|
+
['environnement', ['environment', 'env']],
|
|
772
|
+
['panne', ['crash', 'outage', 'failure']],
|
|
773
|
+
['plantage', ['crash', 'panic']],
|
|
774
|
+
['interface', ['interface', 'api']],
|
|
775
|
+
['performances', ['performance']],
|
|
776
|
+
['stockage', ['storage', 'disk']],
|
|
777
|
+
['file attente', ['queue']],
|
|
778
|
+
// Spanish (Español) → English
|
|
779
|
+
['arreglar', ['fix']],
|
|
780
|
+
['corrección', ['fix', 'bugfix']],
|
|
781
|
+
['construir', ['build']],
|
|
782
|
+
['probar', ['test']],
|
|
783
|
+
['autenticación', ['auth', 'authentication']],
|
|
784
|
+
['configuración', ['config', 'configuration']],
|
|
785
|
+
['instalar', ['install']],
|
|
786
|
+
['actualizar', ['update', 'upgrade']],
|
|
787
|
+
['actualización', ['update', 'upgrade']],
|
|
788
|
+
['registro', ['log', 'registry']],
|
|
789
|
+
['nodo', ['node']],
|
|
790
|
+
['servicio', ['service']],
|
|
791
|
+
['contraseña', ['password']],
|
|
792
|
+
['copia de seguridad', ['backup']],
|
|
793
|
+
['respaldo', ['backup']],
|
|
794
|
+
['monitorear', ['monitor']],
|
|
795
|
+
['monitoreo', ['monitoring']],
|
|
796
|
+
['conexión', ['connection']],
|
|
797
|
+
['rendimiento', ['performance']],
|
|
798
|
+
['memoria', ['memory']],
|
|
799
|
+
['depurar', ['debug']],
|
|
800
|
+
['fallo', ['crash', 'failure', 'error']],
|
|
801
|
+
['caída', ['crash', 'outage']],
|
|
802
|
+
['reiniciar', ['restart', 'reboot']],
|
|
803
|
+
['permiso', ['permission']],
|
|
804
|
+
['permisos', ['permission', 'access']],
|
|
805
|
+
['red', ['network']],
|
|
806
|
+
['base de datos', ['database', 'db']],
|
|
807
|
+
['desplegar', ['deploy']],
|
|
808
|
+
['despliegue', ['deploy', 'deployment']],
|
|
809
|
+
['clave', ['key', 'token', 'secret']],
|
|
810
|
+
['certificado', ['certificate', 'cert', 'ssl']],
|
|
811
|
+
['entorno', ['environment', 'env']],
|
|
812
|
+
['cola', ['queue']],
|
|
813
|
+
['interfaz', ['interface', 'api']],
|
|
814
|
+
['imagen', ['image']],
|
|
815
|
+
// Italian (Italiano) → English
|
|
816
|
+
['errore', ['error', 'err']],
|
|
817
|
+
['correggere', ['fix']],
|
|
818
|
+
['costruire', ['build']],
|
|
819
|
+
['testare', ['test']],
|
|
820
|
+
['autenticazione', ['auth', 'authentication']],
|
|
821
|
+
['configurazione', ['config', 'configuration']],
|
|
822
|
+
['installare', ['install']],
|
|
823
|
+
['aggiornare', ['update', 'upgrade']],
|
|
824
|
+
['aggiornamento', ['update', 'upgrade']],
|
|
825
|
+
['registro', ['log']],
|
|
826
|
+
['nodo', ['node']],
|
|
827
|
+
['servizio', ['service']],
|
|
828
|
+
['password', ['password']],
|
|
829
|
+
['backup', ['backup']],
|
|
830
|
+
['monitorare', ['monitor']],
|
|
831
|
+
['connessione', ['connection']],
|
|
832
|
+
['prestazioni', ['performance']],
|
|
833
|
+
['memoria', ['memory']],
|
|
834
|
+
['debug', ['debug']],
|
|
835
|
+
['arresto anomalo', ['crash']],
|
|
836
|
+
['riavviare', ['restart']],
|
|
837
|
+
['permesso', ['permission']],
|
|
838
|
+
['rete', ['network']],
|
|
839
|
+
['database', ['database', 'db']],
|
|
840
|
+
['distribuire', ['deploy']],
|
|
841
|
+
['distribuzione', ['deploy', 'deployment']],
|
|
842
|
+
['chiave', ['key', 'token', 'secret']],
|
|
843
|
+
['certificato', ['certificate', 'cert']],
|
|
844
|
+
['ambiente', ['environment', 'env']],
|
|
845
|
+
['coda', ['queue']],
|
|
846
|
+
['immagine', ['image']],
|
|
847
|
+
// Portuguese (Português) → English
|
|
848
|
+
['erro', ['error', 'err']],
|
|
849
|
+
['corrigir', ['fix']],
|
|
850
|
+
['construir', ['build']],
|
|
851
|
+
['testar', ['test']],
|
|
852
|
+
['autenticação', ['auth', 'authentication']],
|
|
853
|
+
['configuração', ['config', 'configuration']],
|
|
854
|
+
['instalar', ['install']],
|
|
855
|
+
['atualizar', ['update', 'upgrade']],
|
|
856
|
+
['atualização', ['update', 'upgrade']],
|
|
857
|
+
['registro', ['log']],
|
|
858
|
+
['nó', ['node']],
|
|
859
|
+
['serviço', ['service']],
|
|
860
|
+
['senha', ['password']],
|
|
861
|
+
['cópia de segurança', ['backup']],
|
|
862
|
+
['monitorar', ['monitor']],
|
|
863
|
+
['conexão', ['connection']],
|
|
864
|
+
['desempenho', ['performance']],
|
|
865
|
+
['memória', ['memory']],
|
|
866
|
+
['depurar', ['debug']],
|
|
867
|
+
['falha', ['crash', 'failure', 'error']],
|
|
868
|
+
['reiniciar', ['restart']],
|
|
869
|
+
['permissão', ['permission']],
|
|
870
|
+
['rede', ['network']],
|
|
871
|
+
['banco de dados', ['database', 'db']],
|
|
872
|
+
['implantar', ['deploy']],
|
|
873
|
+
['implantação', ['deploy', 'deployment']],
|
|
874
|
+
['chave', ['key', 'token', 'secret']],
|
|
875
|
+
['certificado', ['certificate', 'cert']],
|
|
876
|
+
['ambiente', ['environment', 'env']],
|
|
877
|
+
['fila', ['queue']],
|
|
878
|
+
['imagem', ['image']],
|
|
698
879
|
]);
|
|
699
880
|
/**
|
|
700
881
|
* Expand a token to its cross-lingual synonyms.
|
|
@@ -1715,6 +1896,10 @@ const TOOLS = [
|
|
|
1715
1896
|
type: 'string',
|
|
1716
1897
|
description: 'Current AI provider (e.g. "claude-code", "copilot", "cursor", "windsurf"). Shown in the briefing header and saved so the next provider can see who was last active.',
|
|
1717
1898
|
},
|
|
1899
|
+
workspace_path: {
|
|
1900
|
+
type: 'string',
|
|
1901
|
+
description: 'Absolute path to the project root. If no session_end was found (e.g. context limit hit), reads git log to reconstruct what happened since last session.',
|
|
1902
|
+
},
|
|
1718
1903
|
},
|
|
1719
1904
|
required: ['instance_id'],
|
|
1720
1905
|
},
|
|
@@ -3450,7 +3635,7 @@ async function handleTool(name, args) {
|
|
|
3450
3635
|
}
|
|
3451
3636
|
// ── session_start ─────────────────────────────────────────────────────────
|
|
3452
3637
|
case 'session_start': {
|
|
3453
|
-
const { instance_id, focus = '', author = '', provider = '' } = args;
|
|
3638
|
+
const { instance_id, focus = '', author = '', provider = '', workspace_path = '' } = args;
|
|
3454
3639
|
const redis = await getConnection(instance_id);
|
|
3455
3640
|
// 1. Scan all best-solution lessons
|
|
3456
3641
|
const lessonKeys = [];
|
|
@@ -3604,6 +3789,29 @@ async function handleTool(name, args) {
|
|
|
3604
3789
|
}
|
|
3605
3790
|
catch { /* ignore */ }
|
|
3606
3791
|
}
|
|
3792
|
+
// ── Git reconstruction — when no session_end + workspace_path given ─────
|
|
3793
|
+
if (workspace_path && !lastSession) {
|
|
3794
|
+
try {
|
|
3795
|
+
const { execSync } = await import('node:child_process');
|
|
3796
|
+
const gitLog = execSync(`git -C "${workspace_path}" log --oneline --format="%h %s" -15 2>/dev/null`, { encoding: 'utf-8', timeout: 5000 }).trim();
|
|
3797
|
+
const gitDiff = execSync(`git -C "${workspace_path}" diff --stat HEAD~3 2>/dev/null || git -C "${workspace_path}" diff --stat 2>/dev/null`, { encoding: 'utf-8', timeout: 5000 }).trim();
|
|
3798
|
+
if (gitLog) {
|
|
3799
|
+
lines.push(`🔍 **Git reconstruction** (no session_end found — reconstructed from git):`);
|
|
3800
|
+
for (const l of gitLog.split('\n').slice(0, 8))
|
|
3801
|
+
lines.push(` ${l}`);
|
|
3802
|
+
if (gitDiff) {
|
|
3803
|
+
const diffLines = gitDiff.split('\n').filter(l => l.includes('|') || l.includes('changed'));
|
|
3804
|
+
if (diffLines.length > 0) {
|
|
3805
|
+
lines.push(` **Recent changes:**`);
|
|
3806
|
+
for (const dl of diffLines.slice(0, 5))
|
|
3807
|
+
lines.push(` ${dl.trim()}`);
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3810
|
+
lines.push('');
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
catch { /* git not available or no repo — silent */ }
|
|
3814
|
+
}
|
|
3607
3815
|
// Last session
|
|
3608
3816
|
if (lastSession) {
|
|
3609
3817
|
const ago = Math.round((Date.now() - new Date(lastSession.ts).getTime()) / 60000);
|