@ai-rpg-engine/campaign-memory 2.1.3 → 2.1.5

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/README.es.md ADDED
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.md">English</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
7
+ </p>
8
+
9
+ # @ai-rpg-engine/campaign-memory
10
+
11
+ [![npm](https://img.shields.io/npm/v/@ai-rpg-engine/campaign-memory)](https://www.npmjs.com/package/@ai-rpg-engine/campaign-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE)
13
+
14
+ Memoria persistente de los personajes no jugables (PNJs), relaciones multidimensionales y diario de campaña para [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine).
15
+
16
+ ## Instalación
17
+
18
+ ```bash
19
+ npm install @ai-rpg-engine/campaign-memory
20
+ ```
21
+
22
+ ## ¿Qué hace?
23
+
24
+ Los PNJs recuerdan lo que ha sucedido. No solo "hostil: verdadero", sino que registran la confianza, el miedo, la admiración y la familiaridad en cada interacción. Los recuerdos se desvanecen con el tiempo: vívidos → desvanecidos → tenues → olvidados. El diario de campaña registra eventos importantes a lo largo de las sesiones.
25
+
26
+ ## Uso
27
+
28
+ ### Diario de campaña
29
+
30
+ ```typescript
31
+ import { CampaignJournal } from '@ai-rpg-engine/campaign-memory';
32
+
33
+ const journal = new CampaignJournal();
34
+
35
+ // Record a significant event
36
+ const record = journal.record({
37
+ tick: 42,
38
+ category: 'kill',
39
+ actorId: 'player',
40
+ targetId: 'merchant_1',
41
+ zoneId: 'market',
42
+ description: 'Player killed the merchant during a robbery',
43
+ significance: 0.9,
44
+ witnesses: ['guard_1', 'bystander_2'],
45
+ data: { weapon: 'dagger' },
46
+ });
47
+
48
+ // Query the journal
49
+ const playerActions = journal.query({ actorId: 'player', category: 'kill' });
50
+ const merchantHistory = journal.getInvolving('merchant_1');
51
+ ```
52
+
53
+ ### Banco de memoria de los PNJs
54
+
55
+ ```typescript
56
+ import { NpcMemoryBank, applyRelationshipEffect } from '@ai-rpg-engine/campaign-memory';
57
+
58
+ const guardMemory = new NpcMemoryBank('guard_1');
59
+
60
+ // Guard witnesses the player killing a merchant
61
+ guardMemory.remember(record, 0.9, -0.8); // high salience, very negative
62
+ applyRelationshipEffect(guardMemory, record, 'witness');
63
+
64
+ // Check how the guard feels about the player
65
+ const rel = guardMemory.getRelationship('player');
66
+ // { trust: -0.15, fear: 0.25, admiration: -0.05, familiarity: 0 }
67
+
68
+ // Later, memories fade
69
+ guardMemory.consolidate(currentTick);
70
+ const memories = guardMemory.recall({ aboutEntity: 'player', minSalience: 0.5 });
71
+ ```
72
+
73
+ ### Ejes de relación
74
+
75
+ | Eje | Rango | Significado |
76
+ |------|-------|---------|
77
+ | confianza | -1 a 1 | Desconfianza → Confianza |
78
+ | miedo | 0 a 1 | Sin miedo → Aterrado |
79
+ | admiración | -1 a 1 | Desprecio → Admiración |
80
+ | familiaridad | 0 a 1 | Desconocido → Íntimo |
81
+
82
+ ### Categorías de registro
83
+
84
+ `acción` · `combate` · `muerte` · `traición` · `regalo` · `robo` · `deuda` · `descubrimiento` · `alianza` · `insulto` · `rescate` · `muerte`
85
+
86
+ Cada categoría tiene efectos predeterminados en la relación. Un rescate genera confianza (+0.4) y admiración (+0.3). Una traición destruye la confianza (-0.5).
87
+
88
+ ### Consolidación de la memoria
89
+
90
+ Los recuerdos se desvanecen con el tiempo a través de tres etapas:
91
+
92
+ - **vívido** — alta relevancia, recientemente formado
93
+ - **desvanecido** — la relevancia disminuye por debajo del umbral de desvanecimiento
94
+ - **tenue** — apenas recordado, a punto de ser olvidado
95
+
96
+ Configure las tasas de desvanecimiento para cada PNJ o globalmente.
97
+
98
+ ## Serialización
99
+
100
+ Tanto `CampaignJournal` como `NpcMemoryBank` admiten `serialize()` y `deserialize()` para la persistencia entre sesiones.
101
+
102
+ ## Parte de AI RPG Engine
103
+
104
+ Este paquete es parte del monorepositorio [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine). Funciona de forma independiente o se integra con los sistemas de cognición y rumores del motor.
105
+
106
+ ## Licencia
107
+
108
+ MIT
package/README.fr.md ADDED
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.md">English</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
7
+ </p>
8
+
9
+ # @ai-rpg-engine/campaign-memory
10
+
11
+ [![npm](https://img.shields.io/npm/v/@ai-rpg-engine/campaign-memory)](https://www.npmjs.com/package/@ai-rpg-engine/campaign-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE)
13
+
14
+ Mémoire persistante des PNJ, relations multi-axes et journal de campagne pour [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine).
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @ai-rpg-engine/campaign-memory
20
+ ```
21
+
22
+ ## Fonctionnalités
23
+
24
+ Les PNJ se souviennent de ce qui s'est passé. Il ne s'agit pas seulement de "hostile : vrai" – ils suivent la confiance, la peur, l'admiration et la familiarité à travers chaque interaction. Les souvenirs s'estompent avec le temps : vifs → estompés → faibles → oubliés. Le journal de campagne conserve les événements importants entre les sessions.
25
+
26
+ ## Utilisation
27
+
28
+ ### Journal de campagne
29
+
30
+ ```typescript
31
+ import { CampaignJournal } from '@ai-rpg-engine/campaign-memory';
32
+
33
+ const journal = new CampaignJournal();
34
+
35
+ // Record a significant event
36
+ const record = journal.record({
37
+ tick: 42,
38
+ category: 'kill',
39
+ actorId: 'player',
40
+ targetId: 'merchant_1',
41
+ zoneId: 'market',
42
+ description: 'Player killed the merchant during a robbery',
43
+ significance: 0.9,
44
+ witnesses: ['guard_1', 'bystander_2'],
45
+ data: { weapon: 'dagger' },
46
+ });
47
+
48
+ // Query the journal
49
+ const playerActions = journal.query({ actorId: 'player', category: 'kill' });
50
+ const merchantHistory = journal.getInvolving('merchant_1');
51
+ ```
52
+
53
+ ### Banque de mémoire des PNJ
54
+
55
+ ```typescript
56
+ import { NpcMemoryBank, applyRelationshipEffect } from '@ai-rpg-engine/campaign-memory';
57
+
58
+ const guardMemory = new NpcMemoryBank('guard_1');
59
+
60
+ // Guard witnesses the player killing a merchant
61
+ guardMemory.remember(record, 0.9, -0.8); // high salience, very negative
62
+ applyRelationshipEffect(guardMemory, record, 'witness');
63
+
64
+ // Check how the guard feels about the player
65
+ const rel = guardMemory.getRelationship('player');
66
+ // { trust: -0.15, fear: 0.25, admiration: -0.05, familiarity: 0 }
67
+
68
+ // Later, memories fade
69
+ guardMemory.consolidate(currentTick);
70
+ const memories = guardMemory.recall({ aboutEntity: 'player', minSalience: 0.5 });
71
+ ```
72
+
73
+ ### Axes de relations
74
+
75
+ | Axe | Plage | Signification |
76
+ |------|-------|---------|
77
+ | confiance | -1 à 1 | Méfiance → Confiance |
78
+ | peur | 0 à 1 | Pas de peur → Terreur |
79
+ | admiration | -1 à 1 | Mépris → Admiration |
80
+ | familiarité | 0 à 1 | Étranger → Intime |
81
+
82
+ ### Catégories d'enregistrements
83
+
84
+ `action` · `combat` · `kill` · `betrayal` · `gift` · `theft` · `debt` · `discovery` · `alliance` · `insult` · `rescue` · `death`
85
+
86
+ Chaque catégorie a des effets de relation par défaut. Une action de sauvetage renforce la confiance (+0,4) et l'admiration (+0,3). Une trahison détruit la confiance (-0,5).
87
+
88
+ ### Consolidation de la mémoire
89
+
90
+ Les souvenirs s'estompent avec le temps, en trois étapes :
91
+
92
+ - **vif** — forte importance, récemment créé
93
+ - **estompé** — l'importance a diminué en dessous du seuil d'estompement
94
+ - **faible** — à peine mémorisé, sur le point d'être oublié
95
+
96
+ Configurez les taux d'estompement pour chaque PNJ ou globalement.
97
+
98
+ ## Sérialisation
99
+
100
+ `CampaignJournal` et `NpcMemoryBank` prennent en charge `serialize()` et `deserialize()` pour la persistance entre les sessions.
101
+
102
+ ## Fait partie de AI RPG Engine
103
+
104
+ Ce paquet fait partie du dépôt monorepo [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine). Il peut être utilisé de manière autonome ou intégré aux systèmes de cognition et de rumeurs du moteur.
105
+
106
+ ## Licence
107
+
108
+ MIT
package/README.hi.md ADDED
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.md">English</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
7
+ </p>
8
+
9
+ # @ai-rpg-engine/campaign-memory
10
+
11
+ [![npm](https://img.shields.io/npm/v/@ai-rpg-engine/campaign-memory)](https://www.npmjs.com/package/@ai-rpg-engine/campaign-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE)
13
+
14
+ [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine) के लिए स्थायी एनपीसी (चरित्र) मेमोरी, बहु-आयामी संबंध और अभियान जर्नल।
15
+
16
+ ## इंस्टॉलेशन
17
+
18
+ ```bash
19
+ npm install @ai-rpg-engine/campaign-memory
20
+ ```
21
+
22
+ ## यह क्या करता है
23
+
24
+ एनपीसी (चरित्र) याद रखते हैं कि क्या हुआ। सिर्फ "दुश्मन: सत्य" नहीं, बल्कि वे हर बातचीत में विश्वास, डर, प्रशंसा और परिचितता को ट्रैक करते हैं। समय के साथ यादें फीकी पड़ जाती हैं: स्पष्ट → फीका → धुंधला → भुला दिया गया। अभियान जर्नल सत्रों में महत्वपूर्ण घटनाओं को बरकरार रखता है।
25
+
26
+ ## उपयोग
27
+
28
+ ### अभियान जर्नल
29
+
30
+ ```typescript
31
+ import { CampaignJournal } from '@ai-rpg-engine/campaign-memory';
32
+
33
+ const journal = new CampaignJournal();
34
+
35
+ // Record a significant event
36
+ const record = journal.record({
37
+ tick: 42,
38
+ category: 'kill',
39
+ actorId: 'player',
40
+ targetId: 'merchant_1',
41
+ zoneId: 'market',
42
+ description: 'Player killed the merchant during a robbery',
43
+ significance: 0.9,
44
+ witnesses: ['guard_1', 'bystander_2'],
45
+ data: { weapon: 'dagger' },
46
+ });
47
+
48
+ // Query the journal
49
+ const playerActions = journal.query({ actorId: 'player', category: 'kill' });
50
+ const merchantHistory = journal.getInvolving('merchant_1');
51
+ ```
52
+
53
+ ### एनपीसी मेमोरी बैंक
54
+
55
+ ```typescript
56
+ import { NpcMemoryBank, applyRelationshipEffect } from '@ai-rpg-engine/campaign-memory';
57
+
58
+ const guardMemory = new NpcMemoryBank('guard_1');
59
+
60
+ // Guard witnesses the player killing a merchant
61
+ guardMemory.remember(record, 0.9, -0.8); // high salience, very negative
62
+ applyRelationshipEffect(guardMemory, record, 'witness');
63
+
64
+ // Check how the guard feels about the player
65
+ const rel = guardMemory.getRelationship('player');
66
+ // { trust: -0.15, fear: 0.25, admiration: -0.05, familiarity: 0 }
67
+
68
+ // Later, memories fade
69
+ guardMemory.consolidate(currentTick);
70
+ const memories = guardMemory.recall({ aboutEntity: 'player', minSalience: 0.5 });
71
+ ```
72
+
73
+ ### संबंधों के आयाम
74
+
75
+ | आयाम | रेंज (दायरा) | अर्थ |
76
+ |------|-------|---------|
77
+ | विश्वास | -1 से 1 | अविश्वास → विश्वास |
78
+ | डर | 0 से 1 | बेखबर → भयभीत |
79
+ | प्रशंसा | -1 से 1 | तिरस्कार → प्रशंसा |
80
+ | परिचितता | 0 से 1 | अजनबी → करीबी |
81
+
82
+ ### रिकॉर्ड श्रेणियां
83
+
84
+ `action` (क्रिया) · `combat` (लड़ाई) · `kill` (मारना) · `betrayal` (गद्दार) · `gift` (उपहार) · `theft` (चोरी) · `debt` (कर्ज) · `discovery` (खोज) · `alliance` (गठबंधन) · `insult` (अपमान) · `rescue` (बचाव) · `death` (मृत्यु)
85
+
86
+ प्रत्येक श्रेणी में डिफ़ॉल्ट संबंध प्रभाव होते हैं। एक बचाव विश्वास (+0.4) और प्रशंसा (+0.3) बढ़ाता है। एक गद्दार विश्वास को नष्ट कर देता है (-0.5)।
87
+
88
+ ### मेमोरी कंसोलिडेशन (स्मृति समेकन)
89
+
90
+ यादें समय के साथ तीन चरणों में कमजोर होती जाती हैं:
91
+
92
+ - **vivid** (स्पष्ट) — उच्च महत्व, हाल ही में बनाई गई
93
+ - **faded** (फीका) — महत्व फीका होने की सीमा से नीचे
94
+ - **dim** (धुंधला) — मुश्किल से याद है, भुलाने वाला
95
+
96
+ प्रत्येक एनपीसी के लिए या वैश्विक स्तर पर क्षय दरें कॉन्फ़िगर करें।
97
+
98
+ ## सीरियलाइजेशन (क्रमिकरण)
99
+
100
+ `CampaignJournal` और `NpcMemoryBank` दोनों ही सत्रों में निरंतरता के लिए `serialize()` और `deserialize()` का समर्थन करते हैं।
101
+
102
+ ## AI RPG इंजन का हिस्सा
103
+
104
+ यह पैकेज [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine) मोनोरिपो का हिस्सा है। यह स्टैंडअलोन रूप से काम करता है या इंजन की अनुभूति और अफवाह प्रणालियों के साथ एकीकृत होता है।
105
+
106
+ ## लाइसेंस
107
+
108
+ MIT
package/README.it.md ADDED
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.md">English</a> | <a href="README.pt-BR.md">Português (BR)</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
7
+ </p>
8
+
9
+ # @ai-rpg-engine/campaign-memory
10
+
11
+ [![npm](https://img.shields.io/npm/v/@ai-rpg-engine/campaign-memory)](https://www.npmjs.com/package/@ai-rpg-engine/campaign-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE)
13
+
14
+ Memoria persistente dei personaggi non giocanti (PNG), relazioni multidimensionali e diario di campagna per [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine).
15
+
16
+ ## Installazione
17
+
18
+ ```bash
19
+ npm install @ai-rpg-engine/campaign-memory
20
+ ```
21
+
22
+ ## Funzionalità
23
+
24
+ I PNG ricordano ciò che è successo. Non solo "ostile: true" — tracciano fiducia, paura, ammirazione e familiarità in ogni interazione. I ricordi svaniscono nel tempo: vividi → sbiaditi → deboli → dimenticati. Il diario di campagna registra eventi significativi tra le sessioni.
25
+
26
+ ## Utilizzo
27
+
28
+ ### Diario di campagna
29
+
30
+ ```typescript
31
+ import { CampaignJournal } from '@ai-rpg-engine/campaign-memory';
32
+
33
+ const journal = new CampaignJournal();
34
+
35
+ // Record a significant event
36
+ const record = journal.record({
37
+ tick: 42,
38
+ category: 'kill',
39
+ actorId: 'player',
40
+ targetId: 'merchant_1',
41
+ zoneId: 'market',
42
+ description: 'Player killed the merchant during a robbery',
43
+ significance: 0.9,
44
+ witnesses: ['guard_1', 'bystander_2'],
45
+ data: { weapon: 'dagger' },
46
+ });
47
+
48
+ // Query the journal
49
+ const playerActions = journal.query({ actorId: 'player', category: 'kill' });
50
+ const merchantHistory = journal.getInvolving('merchant_1');
51
+ ```
52
+
53
+ ### Banca di memoria dei PNG
54
+
55
+ ```typescript
56
+ import { NpcMemoryBank, applyRelationshipEffect } from '@ai-rpg-engine/campaign-memory';
57
+
58
+ const guardMemory = new NpcMemoryBank('guard_1');
59
+
60
+ // Guard witnesses the player killing a merchant
61
+ guardMemory.remember(record, 0.9, -0.8); // high salience, very negative
62
+ applyRelationshipEffect(guardMemory, record, 'witness');
63
+
64
+ // Check how the guard feels about the player
65
+ const rel = guardMemory.getRelationship('player');
66
+ // { trust: -0.15, fear: 0.25, admiration: -0.05, familiarity: 0 }
67
+
68
+ // Later, memories fade
69
+ guardMemory.consolidate(currentTick);
70
+ const memories = guardMemory.recall({ aboutEntity: 'player', minSalience: 0.5 });
71
+ ```
72
+
73
+ ### Assi di relazione
74
+
75
+ | Asse | Intervallo | Significato |
76
+ |------|-------|---------|
77
+ | fiducia | -1 a 1 | Sfida → Fiducia |
78
+ | paura | 0 a 1 | Non spaventato → Terrorizzato |
79
+ | ammirazione | -1 a 1 | Disprezzo → Ammirazione |
80
+ | familiarità | 0 a 1 | Sconosciuto → Intimo |
81
+
82
+ ### Categorie di registrazione
83
+
84
+ `azione` · `combattimento` · `uccisione` · `tradimento` · `regalo` · `furto` · `debito` · `scoperta` · `alleanza` · `insulto` · `salvataggio` · `morte`
85
+
86
+ Ogni categoria ha effetti predefiniti sulle relazioni. Un salvataggio aumenta la fiducia (+0.4) e l'ammirazione (+0.3). Un tradimento distrugge la fiducia (-0.5).
87
+
88
+ ### Consolidamento della memoria
89
+
90
+ I ricordi decadono nel tempo attraverso tre fasi:
91
+
92
+ - **vivido** — alta rilevanza, formato di recente
93
+ - **sbiadito** — la rilevanza è scesa al di sotto della soglia di sbiadimento
94
+ - **debole** — a malapena ricordato, sul punto di essere dimenticato
95
+
96
+ Configurare i tassi di decadimento per ogni PNG o a livello globale.
97
+
98
+ ## Serializzazione
99
+
100
+ Sia `CampaignJournal` che `NpcMemoryBank` supportano `serialize()` e `deserialize()` per la persistenza tra le sessioni.
101
+
102
+ ## Parte di AI RPG Engine
103
+
104
+ Questo pacchetto fa parte del monorepo [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine). Può essere utilizzato autonomamente o integrato con i sistemi di cognizione e di voci di corridoio del motore.
105
+
106
+ ## Licenza
107
+
108
+ MIT
package/README.ja.md ADDED
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="README.md">English</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
7
+ </p>
8
+
9
+ # @ai-rpg-engine/campaign-memory
10
+
11
+ [![npm](https://img.shields.io/npm/v/@ai-rpg-engine/campaign-memory)](https://www.npmjs.com/package/@ai-rpg-engine/campaign-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE)
13
+
14
+ [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine) 用の、NPCの記憶、多次元の関係性、およびキャンペーンジャーナル機能を提供します。
15
+
16
+ ## インストール
17
+
18
+ ```bash
19
+ npm install @ai-rpg-engine/campaign-memory
20
+ ```
21
+
22
+ ## 機能概要
23
+
24
+ NPCは、起こったことを記憶します。単に「敵対的:true」というだけでなく、信頼、恐怖、尊敬、親しみといった感情を、あらゆるインタラクションを通じて記録します。記憶は時間とともに薄れていきます。鮮明 → 薄れ → 曖昧 → 忘れ去られる。キャンペーンジャーナルは、重要なイベントをセッション間で保持します。
25
+
26
+ ## 使い方
27
+
28
+ ### キャンペーンジャーナル
29
+
30
+ ```typescript
31
+ import { CampaignJournal } from '@ai-rpg-engine/campaign-memory';
32
+
33
+ const journal = new CampaignJournal();
34
+
35
+ // Record a significant event
36
+ const record = journal.record({
37
+ tick: 42,
38
+ category: 'kill',
39
+ actorId: 'player',
40
+ targetId: 'merchant_1',
41
+ zoneId: 'market',
42
+ description: 'Player killed the merchant during a robbery',
43
+ significance: 0.9,
44
+ witnesses: ['guard_1', 'bystander_2'],
45
+ data: { weapon: 'dagger' },
46
+ });
47
+
48
+ // Query the journal
49
+ const playerActions = journal.query({ actorId: 'player', category: 'kill' });
50
+ const merchantHistory = journal.getInvolving('merchant_1');
51
+ ```
52
+
53
+ ### NPCの記憶バンク
54
+
55
+ ```typescript
56
+ import { NpcMemoryBank, applyRelationshipEffect } from '@ai-rpg-engine/campaign-memory';
57
+
58
+ const guardMemory = new NpcMemoryBank('guard_1');
59
+
60
+ // Guard witnesses the player killing a merchant
61
+ guardMemory.remember(record, 0.9, -0.8); // high salience, very negative
62
+ applyRelationshipEffect(guardMemory, record, 'witness');
63
+
64
+ // Check how the guard feels about the player
65
+ const rel = guardMemory.getRelationship('player');
66
+ // { trust: -0.15, fear: 0.25, admiration: -0.05, familiarity: 0 }
67
+
68
+ // Later, memories fade
69
+ guardMemory.consolidate(currentTick);
70
+ const memories = guardMemory.recall({ aboutEntity: 'player', minSalience: 0.5 });
71
+ ```
72
+
73
+ ### 関係性の軸
74
+
75
+ | 軸 | 範囲 | 意味 |
76
+ |------|-------|---------|
77
+ | 信頼 | -1から1 | 不信 → 信頼 |
78
+ | 恐怖 | 0から1 | 無恐怖 → 極度の恐怖 |
79
+ | 尊敬 | -1から1 | 軽蔑 → 尊敬 |
80
+ | 親しみ | 0から1 | 見知らぬ人 → 親密な関係 |
81
+
82
+ ### 記録カテゴリ
83
+
84
+ `action` (行動) · `combat` (戦闘) · `kill` (殺害) · `betrayal` (裏切り) · `gift` (贈り物) · `theft` (盗み) · `debt` (借金) · `discovery` (発見) · `alliance` (同盟) · `insult` (侮辱) · `rescue` (救出) · `death` (死亡)
85
+
86
+ 各カテゴリには、デフォルトの関係性への影響があります。救出は、信頼 (+0.4) と尊敬 (+0.3) を高めます。裏切りは、信頼を大きく損ないます (-0.5)。
87
+
88
+ ### 記憶の固定化
89
+
90
+ 記憶は、以下の3つの段階で時間とともに薄れていきます。
91
+
92
+ - **鮮明 (vivid)**:重要度が高く、最近形成された記憶
93
+ - **薄れ (faded)**:重要度が、薄れの閾値を下回った記憶
94
+ - **曖昧 (dim)**:ほとんど記憶に残っておらず、忘れ去られようとしている記憶
95
+
96
+ 各NPCまたはグローバルに、記憶の減衰率を設定できます。
97
+
98
+ ## シリアライズ
99
+
100
+ `CampaignJournal` と `NpcMemoryBank` は、セッション間でデータを保持するために、`serialize()` および `deserialize()` をサポートしています。
101
+
102
+ ## AI RPG Engine の一部
103
+
104
+ このパッケージは、[AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine) のモノレポの一部です。スタンドアロンで使用することも、エンジン内の認知システムや噂システムと統合することもできます。
105
+
106
+ ## ライセンス
107
+
108
+ MIT
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
3
+ </p>
4
+
1
5
  <p align="center">
2
6
  <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
3
7
  </p>
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.md">English</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
7
+ </p>
8
+
9
+ # @ai-rpg-engine/campaign-memory
10
+
11
+ [![npm](https://img.shields.io/npm/v/@ai-rpg-engine/campaign-memory)](https://www.npmjs.com/package/@ai-rpg-engine/campaign-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE)
13
+
14
+ Memória persistente de NPCs, relações multi-eixos e diário de campanha para o [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine).
15
+
16
+ ## Instalação
17
+
18
+ ```bash
19
+ npm install @ai-rpg-engine/campaign-memory
20
+ ```
21
+
22
+ ## O que ele faz
23
+
24
+ Os NPCs se lembram do que aconteceu. Não apenas "hostil: verdadeiro" — eles rastreiam confiança, medo, admiração e familiaridade em todas as interações. As memórias diminuem com o tempo: vívidas → desbotadas → tênues → esquecidas. O diário de campanha registra eventos significativos ao longo das sessões.
25
+
26
+ ## Uso
27
+
28
+ ### Diário de Campanha
29
+
30
+ ```typescript
31
+ import { CampaignJournal } from '@ai-rpg-engine/campaign-memory';
32
+
33
+ const journal = new CampaignJournal();
34
+
35
+ // Record a significant event
36
+ const record = journal.record({
37
+ tick: 42,
38
+ category: 'kill',
39
+ actorId: 'player',
40
+ targetId: 'merchant_1',
41
+ zoneId: 'market',
42
+ description: 'Player killed the merchant during a robbery',
43
+ significance: 0.9,
44
+ witnesses: ['guard_1', 'bystander_2'],
45
+ data: { weapon: 'dagger' },
46
+ });
47
+
48
+ // Query the journal
49
+ const playerActions = journal.query({ actorId: 'player', category: 'kill' });
50
+ const merchantHistory = journal.getInvolving('merchant_1');
51
+ ```
52
+
53
+ ### Banco de Memória de NPCs
54
+
55
+ ```typescript
56
+ import { NpcMemoryBank, applyRelationshipEffect } from '@ai-rpg-engine/campaign-memory';
57
+
58
+ const guardMemory = new NpcMemoryBank('guard_1');
59
+
60
+ // Guard witnesses the player killing a merchant
61
+ guardMemory.remember(record, 0.9, -0.8); // high salience, very negative
62
+ applyRelationshipEffect(guardMemory, record, 'witness');
63
+
64
+ // Check how the guard feels about the player
65
+ const rel = guardMemory.getRelationship('player');
66
+ // { trust: -0.15, fear: 0.25, admiration: -0.05, familiarity: 0 }
67
+
68
+ // Later, memories fade
69
+ guardMemory.consolidate(currentTick);
70
+ const memories = guardMemory.recall({ aboutEntity: 'player', minSalience: 0.5 });
71
+ ```
72
+
73
+ ### Eixos de Relação
74
+
75
+ | Eixo | Intervalo | Significado |
76
+ |------|-------|---------|
77
+ | confiança | -1 a 1 | Desconfiança → Confiança |
78
+ | medo | 0 a 1 | Sem medo → Aterrorizado |
79
+ | admiração | -1 a 1 | Desprezo → Admiração |
80
+ | familiaridade | 0 a 1 | Estranho → Íntimo |
81
+
82
+ ### Categorias de Registro
83
+
84
+ `ação` · `combate` · `morte` · `traição` · `presente` · `roubo` · `dívida` · `descoberta` · `aliança` · `insulto` · `resgate` · `morte`
85
+
86
+ Cada categoria tem efeitos de relacionamento padrão. Um resgate aumenta a confiança (+0,4) e a admiração (+0,3). Uma traição destrói a confiança (-0,5).
87
+
88
+ ### Consolidação da Memória
89
+
90
+ As memórias diminuem com o tempo em três estágios:
91
+
92
+ - **vívida** — alta relevância, recém-formada
93
+ - **desbotada** — a relevância caiu abaixo do limite de desvanecimento
94
+ - **tênue** — dificilmente lembrada, prestes a ser esquecida
95
+
96
+ Configure as taxas de decaimento para cada NPC ou globalmente.
97
+
98
+ ## Serialização
99
+
100
+ Tanto `CampaignJournal` quanto `NpcMemoryBank` suportam `serialize()` e `deserialize()` para persistência entre sessões.
101
+
102
+ ## Parte do AI RPG Engine
103
+
104
+ Este pacote faz parte do monorepository [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine). Ele funciona de forma independente ou se integra com os sistemas de cognição e rumores do motor.
105
+
106
+ ## Licença
107
+
108
+ MIT
package/README.zh.md ADDED
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="README.ja.md">日本語</a> | <a href="README.md">English</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/ai-rpg-engine/readme.png" width="400" alt="AI RPG Engine">
7
+ </p>
8
+
9
+ # @ai-rpg-engine/campaign-memory
10
+
11
+ [![npm](https://img.shields.io/npm/v/@ai-rpg-engine/campaign-memory)](https://www.npmjs.com/package/@ai-rpg-engine/campaign-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mcp-tool-shop-org/ai-rpg-engine/blob/main/LICENSE)
13
+
14
+ 为 [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine) 提供的持久 NPC 记忆、多维度关系和战役日志。
15
+
16
+ ## 安装
17
+
18
+ ```bash
19
+ npm install @ai-rpg-engine/campaign-memory
20
+ ```
21
+
22
+ ## 功能
23
+
24
+ NPC 会记住发生的事情。 不仅仅是“敌对:true”,他们会跟踪信任、恐惧、钦佩和熟悉度,这些指标会随着每次互动而变化。 记忆会随着时间的推移而逐渐淡化:鲜明 → 模糊 → 黯淡 → 被遗忘。 战役日志会记录重要的事件,并在不同的游戏会话中保持一致。
25
+
26
+ ## 用法
27
+
28
+ ### 战役日志
29
+
30
+ ```typescript
31
+ import { CampaignJournal } from '@ai-rpg-engine/campaign-memory';
32
+
33
+ const journal = new CampaignJournal();
34
+
35
+ // Record a significant event
36
+ const record = journal.record({
37
+ tick: 42,
38
+ category: 'kill',
39
+ actorId: 'player',
40
+ targetId: 'merchant_1',
41
+ zoneId: 'market',
42
+ description: 'Player killed the merchant during a robbery',
43
+ significance: 0.9,
44
+ witnesses: ['guard_1', 'bystander_2'],
45
+ data: { weapon: 'dagger' },
46
+ });
47
+
48
+ // Query the journal
49
+ const playerActions = journal.query({ actorId: 'player', category: 'kill' });
50
+ const merchantHistory = journal.getInvolving('merchant_1');
51
+ ```
52
+
53
+ ### NPC 记忆库
54
+
55
+ ```typescript
56
+ import { NpcMemoryBank, applyRelationshipEffect } from '@ai-rpg-engine/campaign-memory';
57
+
58
+ const guardMemory = new NpcMemoryBank('guard_1');
59
+
60
+ // Guard witnesses the player killing a merchant
61
+ guardMemory.remember(record, 0.9, -0.8); // high salience, very negative
62
+ applyRelationshipEffect(guardMemory, record, 'witness');
63
+
64
+ // Check how the guard feels about the player
65
+ const rel = guardMemory.getRelationship('player');
66
+ // { trust: -0.15, fear: 0.25, admiration: -0.05, familiarity: 0 }
67
+
68
+ // Later, memories fade
69
+ guardMemory.consolidate(currentTick);
70
+ const memories = guardMemory.recall({ aboutEntity: 'player', minSalience: 0.5 });
71
+ ```
72
+
73
+ ### 关系维度
74
+
75
+ | 维度 | 范围 | 含义 |
76
+ |------|-------|---------|
77
+ | 信任 | -1 到 1 | 不信任 → 信任 |
78
+ | 恐惧 | 0 到 1 | 无惧 → 极度恐惧 |
79
+ | 钦佩 | -1 到 1 | 鄙视 → 钦佩 |
80
+ | 熟悉度 | 0 到 1 | 陌生人 → 亲密 |
81
+
82
+ ### 记录类别
83
+
84
+ `action` (行动) · `combat` (战斗) · `kill` (杀戮) · `betrayal` (背叛) · `gift` (礼物) · `theft` (盗窃) · `debt` (债务) · `discovery` (发现) · `alliance` (联盟) · `insult` (侮辱) · `rescue` (救援) · `death` (死亡)
85
+
86
+ 每个类别都有默认的关系影响。 救援会增加信任 (+0.4) 和钦佩 (+0.3)。 背叛会破坏信任 (-0.5)。
87
+
88
+ ### 记忆巩固
89
+
90
+ 记忆会通过三个阶段随着时间而衰减:
91
+
92
+ - **鲜明 (vivid)** — 显著性高,最近形成的
93
+ - **模糊 (faded)** — 显著性低于衰减阈值
94
+ - **黯淡 (dim)** — 几乎被遗忘,即将被遗忘
95
+
96
+ 可以为每个 NPC 或全局配置衰减率。
97
+
98
+ ## 序列化
99
+
100
+ `CampaignJournal` 和 `NpcMemoryBank` 都支持 `serialize()` 和 `deserialize()` 方法,以便在不同的游戏会话中保持持久性。
101
+
102
+ ## AI RPG Engine 的一部分
103
+
104
+ 此软件包是 [AI RPG Engine](https://github.com/mcp-tool-shop-org/ai-rpg-engine) 单一代码仓库的一部分。 它可以独立使用,也可以与引擎的认知和传闻系统集成。
105
+
106
+ ## 许可证
107
+
108
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-rpg-engine/campaign-memory",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Persistent NPC memory, relationship axes, and campaign journal for AI RPG Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",