@ai-rpg-engine/modules 1.0.0
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/belief-provenance.d.ts +41 -0
- package/dist/belief-provenance.d.ts.map +1 -0
- package/dist/belief-provenance.js +254 -0
- package/dist/belief-provenance.js.map +1 -0
- package/dist/belief-provenance.test.d.ts +2 -0
- package/dist/belief-provenance.test.d.ts.map +1 -0
- package/dist/belief-provenance.test.js +139 -0
- package/dist/belief-provenance.test.js.map +1 -0
- package/dist/cognition-core.d.ts +89 -0
- package/dist/cognition-core.d.ts.map +1 -0
- package/dist/cognition-core.js +370 -0
- package/dist/cognition-core.js.map +1 -0
- package/dist/cognition-core.test.d.ts +2 -0
- package/dist/cognition-core.test.d.ts.map +1 -0
- package/dist/cognition-core.test.js +215 -0
- package/dist/cognition-core.test.js.map +1 -0
- package/dist/combat-core.d.ts +11 -0
- package/dist/combat-core.d.ts.map +1 -0
- package/dist/combat-core.js +152 -0
- package/dist/combat-core.js.map +1 -0
- package/dist/dialogue-core.d.ts +10 -0
- package/dist/dialogue-core.d.ts.map +1 -0
- package/dist/dialogue-core.js +172 -0
- package/dist/dialogue-core.js.map +1 -0
- package/dist/district-core.d.ts +59 -0
- package/dist/district-core.d.ts.map +1 -0
- package/dist/district-core.js +224 -0
- package/dist/district-core.js.map +1 -0
- package/dist/district-core.test.d.ts +2 -0
- package/dist/district-core.test.d.ts.map +1 -0
- package/dist/district-core.test.js +157 -0
- package/dist/district-core.test.js.map +1 -0
- package/dist/environment-core.d.ts +78 -0
- package/dist/environment-core.d.ts.map +1 -0
- package/dist/environment-core.js +229 -0
- package/dist/environment-core.js.map +1 -0
- package/dist/environment-core.test.d.ts +2 -0
- package/dist/environment-core.test.d.ts.map +1 -0
- package/dist/environment-core.test.js +252 -0
- package/dist/environment-core.test.js.map +1 -0
- package/dist/faction-cognition.d.ts +39 -0
- package/dist/faction-cognition.d.ts.map +1 -0
- package/dist/faction-cognition.js +139 -0
- package/dist/faction-cognition.js.map +1 -0
- package/dist/faction-cognition.test.d.ts +2 -0
- package/dist/faction-cognition.test.d.ts.map +1 -0
- package/dist/faction-cognition.test.js +166 -0
- package/dist/faction-cognition.test.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory-core.d.ts +10 -0
- package/dist/inventory-core.d.ts.map +1 -0
- package/dist/inventory-core.js +69 -0
- package/dist/inventory-core.js.map +1 -0
- package/dist/knowledge-decay.test.d.ts +2 -0
- package/dist/knowledge-decay.test.d.ts.map +1 -0
- package/dist/knowledge-decay.test.js +143 -0
- package/dist/knowledge-decay.test.js.map +1 -0
- package/dist/narrative-authority.d.ts +40 -0
- package/dist/narrative-authority.d.ts.map +1 -0
- package/dist/narrative-authority.js +89 -0
- package/dist/narrative-authority.js.map +1 -0
- package/dist/narrative-authority.test.d.ts +2 -0
- package/dist/narrative-authority.test.d.ts.map +1 -0
- package/dist/narrative-authority.test.js +237 -0
- package/dist/narrative-authority.test.js.map +1 -0
- package/dist/observer-presentation.d.ts +74 -0
- package/dist/observer-presentation.d.ts.map +1 -0
- package/dist/observer-presentation.js +277 -0
- package/dist/observer-presentation.js.map +1 -0
- package/dist/observer-presentation.test.d.ts +2 -0
- package/dist/observer-presentation.test.d.ts.map +1 -0
- package/dist/observer-presentation.test.js +156 -0
- package/dist/observer-presentation.test.js.map +1 -0
- package/dist/perception-filter.d.ts +46 -0
- package/dist/perception-filter.d.ts.map +1 -0
- package/dist/perception-filter.js +281 -0
- package/dist/perception-filter.js.map +1 -0
- package/dist/perception-filter.test.d.ts +2 -0
- package/dist/perception-filter.test.d.ts.map +1 -0
- package/dist/perception-filter.test.js +308 -0
- package/dist/perception-filter.test.js.map +1 -0
- package/dist/progression-core.d.ts +63 -0
- package/dist/progression-core.d.ts.map +1 -0
- package/dist/progression-core.js +232 -0
- package/dist/progression-core.js.map +1 -0
- package/dist/progression-core.test.d.ts +2 -0
- package/dist/progression-core.test.d.ts.map +1 -0
- package/dist/progression-core.test.js +328 -0
- package/dist/progression-core.test.js.map +1 -0
- package/dist/rumor-propagation.d.ts +31 -0
- package/dist/rumor-propagation.d.ts.map +1 -0
- package/dist/rumor-propagation.js +180 -0
- package/dist/rumor-propagation.js.map +1 -0
- package/dist/rumor-propagation.test.d.ts +2 -0
- package/dist/rumor-propagation.test.d.ts.map +1 -0
- package/dist/rumor-propagation.test.js +176 -0
- package/dist/rumor-propagation.test.js.map +1 -0
- package/dist/simulation-inspector.d.ts +78 -0
- package/dist/simulation-inspector.d.ts.map +1 -0
- package/dist/simulation-inspector.js +263 -0
- package/dist/simulation-inspector.js.map +1 -0
- package/dist/simulation-inspector.test.d.ts +2 -0
- package/dist/simulation-inspector.test.d.ts.map +1 -0
- package/dist/simulation-inspector.test.js +152 -0
- package/dist/simulation-inspector.test.js.map +1 -0
- package/dist/status-core.d.ts +17 -0
- package/dist/status-core.d.ts.map +1 -0
- package/dist/status-core.js +106 -0
- package/dist/status-core.js.map +1 -0
- package/dist/traversal-core.d.ts +3 -0
- package/dist/traversal-core.d.ts.map +1 -0
- package/dist/traversal-core.js +93 -0
- package/dist/traversal-core.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
2
|
+
import { createTestEngine } from '@ai-rpg-engine/core';
|
|
3
|
+
import { createCognitionCore, getCognition, setBelief } from './cognition-core.js';
|
|
4
|
+
import { createPerceptionFilter } from './perception-filter.js';
|
|
5
|
+
import { createEnvironmentCore } from './environment-core.js';
|
|
6
|
+
import { createFactionCognition, getFactionCognition, factionBelieves, getFactionBelief, } from './faction-cognition.js';
|
|
7
|
+
import { createRumorPropagation, getRumorLog, getRumorsFrom, getRumorsToFaction, } from './rumor-propagation.js';
|
|
8
|
+
function makeGuard(id, zone) {
|
|
9
|
+
return {
|
|
10
|
+
id,
|
|
11
|
+
blueprintId: id,
|
|
12
|
+
type: 'npc',
|
|
13
|
+
name: `Guard ${id}`,
|
|
14
|
+
tags: ['enemy'],
|
|
15
|
+
stats: { vigor: 5, instinct: 8, will: 4 },
|
|
16
|
+
resources: { hp: 20, stamina: 10 },
|
|
17
|
+
statuses: [],
|
|
18
|
+
zoneId: zone,
|
|
19
|
+
ai: { profileId: 'aggressive', goals: ['guard'], fears: [], alertLevel: 0, knowledge: {} },
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const player = {
|
|
23
|
+
id: 'player',
|
|
24
|
+
blueprintId: 'player',
|
|
25
|
+
type: 'player',
|
|
26
|
+
name: 'Hero',
|
|
27
|
+
tags: ['player'],
|
|
28
|
+
stats: { vigor: 7, instinct: 5, will: 5 },
|
|
29
|
+
resources: { hp: 30, stamina: 15 },
|
|
30
|
+
statuses: [],
|
|
31
|
+
zoneId: 'courtyard',
|
|
32
|
+
};
|
|
33
|
+
const zones = [
|
|
34
|
+
{ id: 'courtyard', roomId: 'castle', name: 'Courtyard', tags: [], neighbors: ['gatehouse'] },
|
|
35
|
+
{ id: 'gatehouse', roomId: 'castle', name: 'Gatehouse', tags: [], neighbors: ['courtyard'] },
|
|
36
|
+
];
|
|
37
|
+
describe('rumor-propagation', () => {
|
|
38
|
+
function createEngine(rumorConfig) {
|
|
39
|
+
return createTestEngine({
|
|
40
|
+
modules: [
|
|
41
|
+
createCognitionCore(),
|
|
42
|
+
createPerceptionFilter(),
|
|
43
|
+
createEnvironmentCore(),
|
|
44
|
+
createFactionCognition({
|
|
45
|
+
factions: [
|
|
46
|
+
{ factionId: 'castle-guard', entityIds: ['guard_1', 'guard_2'], cohesion: 0.9 },
|
|
47
|
+
],
|
|
48
|
+
}),
|
|
49
|
+
createRumorPropagation(rumorConfig),
|
|
50
|
+
],
|
|
51
|
+
entities: [player, makeGuard('guard_1', 'courtyard'), makeGuard('guard_2', 'gatehouse')],
|
|
52
|
+
zones,
|
|
53
|
+
playerId: 'player',
|
|
54
|
+
startZone: 'courtyard',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
test('combat event schedules rumor propagation', () => {
|
|
58
|
+
const engine = createEngine({ propagationDelay: 2 });
|
|
59
|
+
engine.drainEvents();
|
|
60
|
+
// Simulate combat — guard_1 is in the courtyard with the player
|
|
61
|
+
engine.store.emitEvent('combat.contact.hit', {
|
|
62
|
+
attackerId: 'player',
|
|
63
|
+
targetId: 'guard_1',
|
|
64
|
+
damage: 5,
|
|
65
|
+
}, { actorId: 'player', targetIds: ['guard_1'] });
|
|
66
|
+
// Guard_1 now believes player is hostile (direct experience via cognition-core)
|
|
67
|
+
const guard1Cog = getCognition(engine.world, 'guard_1');
|
|
68
|
+
expect(guard1Cog.beliefs.some(b => b.subject === 'player' && b.key === 'hostile')).toBe(true);
|
|
69
|
+
// Rumor should be logged
|
|
70
|
+
const rumors = getRumorLog(engine.world);
|
|
71
|
+
expect(rumors.length).toBeGreaterThan(0);
|
|
72
|
+
expect(rumors[0].sourceEntityId).toBe('guard_1');
|
|
73
|
+
expect(rumors[0].targetFactionId).toBe('castle-guard');
|
|
74
|
+
});
|
|
75
|
+
test('rumor arrives at faction after propagation delay', () => {
|
|
76
|
+
const engine = createEngine({ propagationDelay: 1 });
|
|
77
|
+
engine.drainEvents();
|
|
78
|
+
// Combat event at tick 0
|
|
79
|
+
engine.store.emitEvent('combat.contact.hit', {
|
|
80
|
+
attackerId: 'player',
|
|
81
|
+
targetId: 'guard_1',
|
|
82
|
+
damage: 5,
|
|
83
|
+
}, { actorId: 'player', targetIds: ['guard_1'] });
|
|
84
|
+
// Faction should NOT have the belief yet (pending, not delivered)
|
|
85
|
+
const factionCogBefore = getFactionCognition(engine.world, 'castle-guard');
|
|
86
|
+
expect(factionBelieves(factionCogBefore, 'player', 'hostile')).toBe(false);
|
|
87
|
+
// First action at tick 0: processPending finds nothing due (needs ≤0), advances to tick 1
|
|
88
|
+
engine.submitAction('faction-tick');
|
|
89
|
+
// Second action at tick 1: processPending finds pending at tick 1 → fires rumor
|
|
90
|
+
engine.submitAction('faction-tick');
|
|
91
|
+
// Now the faction should have received the rumor
|
|
92
|
+
const factionCogAfter = getFactionCognition(engine.world, 'castle-guard');
|
|
93
|
+
expect(factionBelieves(factionCogAfter, 'player', 'hostile', true)).toBe(true);
|
|
94
|
+
});
|
|
95
|
+
test('rumor confidence is reduced by distortion', () => {
|
|
96
|
+
const engine = createEngine({ propagationDelay: 1, distortionPerHop: 0.1 });
|
|
97
|
+
engine.drainEvents();
|
|
98
|
+
// Set a high-confidence belief on guard_1
|
|
99
|
+
const guard1Cog = getCognition(engine.world, 'guard_1');
|
|
100
|
+
setBelief(guard1Cog, 'player', 'hostile', true, 1.0, 'observed', 0);
|
|
101
|
+
engine.store.emitEvent('combat.contact.hit', {
|
|
102
|
+
attackerId: 'player',
|
|
103
|
+
targetId: 'guard_1',
|
|
104
|
+
damage: 5,
|
|
105
|
+
}, { actorId: 'player', targetIds: ['guard_1'] });
|
|
106
|
+
// Advance past delay to deliver the rumor
|
|
107
|
+
engine.submitAction('faction-tick');
|
|
108
|
+
engine.submitAction('faction-tick');
|
|
109
|
+
const factionCog = getFactionCognition(engine.world, 'castle-guard');
|
|
110
|
+
const belief = getFactionBelief(factionCog, 'player', 'hostile');
|
|
111
|
+
// Confidence should be less than original (distortion + cohesion scaling)
|
|
112
|
+
expect(belief).toBeDefined();
|
|
113
|
+
expect(belief.confidence).toBeLessThan(1.0);
|
|
114
|
+
});
|
|
115
|
+
test('getRumorsFrom filters by source entity', () => {
|
|
116
|
+
const engine = createEngine({ propagationDelay: 1 });
|
|
117
|
+
engine.drainEvents();
|
|
118
|
+
engine.store.emitEvent('combat.contact.hit', {
|
|
119
|
+
attackerId: 'player',
|
|
120
|
+
targetId: 'guard_1',
|
|
121
|
+
damage: 5,
|
|
122
|
+
}, { actorId: 'player', targetIds: ['guard_1'] });
|
|
123
|
+
const fromGuard1 = getRumorsFrom(engine.world, 'guard_1');
|
|
124
|
+
const fromGuard2 = getRumorsFrom(engine.world, 'guard_2');
|
|
125
|
+
expect(fromGuard1.length).toBeGreaterThan(0);
|
|
126
|
+
expect(fromGuard2.length).toBe(0);
|
|
127
|
+
});
|
|
128
|
+
test('getRumorsToFaction filters by faction', () => {
|
|
129
|
+
const engine = createEngine({ propagationDelay: 1 });
|
|
130
|
+
engine.drainEvents();
|
|
131
|
+
engine.store.emitEvent('combat.contact.hit', {
|
|
132
|
+
attackerId: 'player',
|
|
133
|
+
targetId: 'guard_1',
|
|
134
|
+
damage: 5,
|
|
135
|
+
}, { actorId: 'player', targetIds: ['guard_1'] });
|
|
136
|
+
const toCastleGuard = getRumorsToFaction(engine.world, 'castle-guard');
|
|
137
|
+
const toBandits = getRumorsToFaction(engine.world, 'bandits');
|
|
138
|
+
expect(toCastleGuard.length).toBeGreaterThan(0);
|
|
139
|
+
expect(toBandits.length).toBe(0);
|
|
140
|
+
});
|
|
141
|
+
test('low confidence beliefs are not propagated', () => {
|
|
142
|
+
const engine = createEngine({ propagationDelay: 1, confidenceThreshold: 0.5 });
|
|
143
|
+
engine.drainEvents();
|
|
144
|
+
// Give guard_1 a low-confidence belief
|
|
145
|
+
const guard1Cog = getCognition(engine.world, 'guard_1');
|
|
146
|
+
setBelief(guard1Cog, 'intruder', 'present', true, 0.2, 'assumed', 0);
|
|
147
|
+
// Fire an event that triggers rumor check — but the belief confidence is below threshold
|
|
148
|
+
engine.store.emitEvent('world.zone.entered', {
|
|
149
|
+
zoneId: 'courtyard',
|
|
150
|
+
}, { actorId: 'player' });
|
|
151
|
+
// The low-confidence belief about 'intruder' shouldn't propagate
|
|
152
|
+
const rumors = getRumorLog(engine.world);
|
|
153
|
+
const intruderRumors = rumors.filter(r => r.subject === 'intruder');
|
|
154
|
+
expect(intruderRumors.length).toBe(0);
|
|
155
|
+
});
|
|
156
|
+
test('dedup prevents redundant rumor propagation', () => {
|
|
157
|
+
const engine = createEngine({ propagationDelay: 2 });
|
|
158
|
+
engine.drainEvents();
|
|
159
|
+
// Two combat events in quick succession
|
|
160
|
+
engine.store.emitEvent('combat.contact.hit', {
|
|
161
|
+
attackerId: 'player',
|
|
162
|
+
targetId: 'guard_1',
|
|
163
|
+
damage: 5,
|
|
164
|
+
}, { actorId: 'player', targetIds: ['guard_1'] });
|
|
165
|
+
engine.store.emitEvent('combat.contact.hit', {
|
|
166
|
+
attackerId: 'player',
|
|
167
|
+
targetId: 'guard_1',
|
|
168
|
+
damage: 3,
|
|
169
|
+
}, { actorId: 'player', targetIds: ['guard_1'] });
|
|
170
|
+
// Should only have one rumor per entity per belief (dedup)
|
|
171
|
+
const rumors = getRumorsFrom(engine.world, 'guard_1');
|
|
172
|
+
const hostileRumors = rumors.filter(r => r.key === 'hostile');
|
|
173
|
+
expect(hostileRumors.length).toBe(1);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
//# sourceMappingURL=rumor-propagation.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rumor-propagation.test.js","sourceRoot":"","sources":["../src/rumor-propagation.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,SAAS,SAAS,CAAC,EAAU,EAAE,IAAY;IACzC,OAAO;QACL,EAAE;QACF,W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;QAErB,wCAAwC;QACxC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,oBAAoB,EAAE;YAC3C,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,CAAC;SACV,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAElD,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,oBAAoB,EAAE;YAC3C,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,CAAC;SACV,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAElD,2DAA2D;QAC3D,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACtD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;QAC9D,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { EngineModule, WorldState } from '@ai-rpg-engine/core';
|
|
2
|
+
import type { Belief, Memory } from './cognition-core.js';
|
|
3
|
+
import type { PerceivedEvent } from './perception-filter.js';
|
|
4
|
+
import type { FactionBelief } from './faction-cognition.js';
|
|
5
|
+
import type { RumorRecord } from './rumor-propagation.js';
|
|
6
|
+
import type { DistrictMetrics } from './district-core.js';
|
|
7
|
+
export type EntityInspection = {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
zone: string | undefined;
|
|
11
|
+
faction: string | undefined;
|
|
12
|
+
cognition: {
|
|
13
|
+
beliefs: Belief[];
|
|
14
|
+
recentMemories: Memory[];
|
|
15
|
+
morale: number;
|
|
16
|
+
suspicion: number;
|
|
17
|
+
currentIntent: string | null;
|
|
18
|
+
};
|
|
19
|
+
perceptions: PerceivedEvent[];
|
|
20
|
+
};
|
|
21
|
+
export type FactionInspection = {
|
|
22
|
+
id: string;
|
|
23
|
+
members: string[];
|
|
24
|
+
beliefs: FactionBelief[];
|
|
25
|
+
alertLevel: number;
|
|
26
|
+
cohesion: number;
|
|
27
|
+
recentRumors: RumorRecord[];
|
|
28
|
+
};
|
|
29
|
+
export type ZoneInspection = {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
dynamicProperties: Record<string, number>;
|
|
33
|
+
entities: string[];
|
|
34
|
+
};
|
|
35
|
+
export type DistrictInspection = {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
zoneIds: string[];
|
|
39
|
+
controllingFaction: string | undefined;
|
|
40
|
+
metrics: DistrictMetrics;
|
|
41
|
+
threatLevel: number;
|
|
42
|
+
eventCount: number;
|
|
43
|
+
};
|
|
44
|
+
export type SimulationSnapshot = {
|
|
45
|
+
tick: number;
|
|
46
|
+
entities: Record<string, EntityInspection>;
|
|
47
|
+
factions: Record<string, FactionInspection>;
|
|
48
|
+
zones: Record<string, ZoneInspection>;
|
|
49
|
+
districts: Record<string, DistrictInspection>;
|
|
50
|
+
rumorCount: number;
|
|
51
|
+
eventLogSize: number;
|
|
52
|
+
};
|
|
53
|
+
export declare function createSimulationInspector(): EngineModule;
|
|
54
|
+
/** Inspect a single entity's cognitive state */
|
|
55
|
+
export declare function inspectEntity(world: WorldState, entityId: string): EntityInspection | null;
|
|
56
|
+
/** Inspect all AI entities */
|
|
57
|
+
export declare function inspectAllEntities(world: WorldState): Record<string, EntityInspection>;
|
|
58
|
+
/** Inspect a single faction */
|
|
59
|
+
export declare function inspectFaction(world: WorldState, factionId: string): FactionInspection | null;
|
|
60
|
+
/** Inspect all factions */
|
|
61
|
+
export declare function inspectAllFactions(world: WorldState): Record<string, FactionInspection>;
|
|
62
|
+
/** Inspect a single zone's dynamic state */
|
|
63
|
+
export declare function inspectZone(world: WorldState, zoneId: string): ZoneInspection | null;
|
|
64
|
+
/** Inspect all zones */
|
|
65
|
+
export declare function inspectAllZones(world: WorldState): Record<string, ZoneInspection>;
|
|
66
|
+
/** Inspect a single district */
|
|
67
|
+
export declare function inspectDistrict(world: WorldState, districtId: string): DistrictInspection | null;
|
|
68
|
+
/** Inspect all districts */
|
|
69
|
+
export declare function inspectAllDistricts(world: WorldState): Record<string, DistrictInspection>;
|
|
70
|
+
/** Create a complete simulation snapshot */
|
|
71
|
+
export declare function createSnapshot(world: WorldState): SimulationSnapshot;
|
|
72
|
+
/** Format entity inspection as readable text */
|
|
73
|
+
export declare function formatEntityInspection(inspection: EntityInspection): string;
|
|
74
|
+
/** Format faction inspection as readable text */
|
|
75
|
+
export declare function formatFactionInspection(inspection: FactionInspection): string;
|
|
76
|
+
/** Format district inspection as readable text */
|
|
77
|
+
export declare function formatDistrictInspection(inspection: DistrictInspection): string;
|
|
78
|
+
//# sourceMappingURL=simulation-inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation-inspector.d.ts","sourceRoot":"","sources":["../src/simulation-inspector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAGX,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAkB,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAyB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,EAAqC,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI7F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EA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,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,kBAAkB,CAUpE;AAID,gDAAgD;AAChD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAuB3E;AAED,iDAAiD;AACjD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAqB7E;AAED,kDAAkD;AAClD,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAc/E"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
// simulation-inspector — observability layer for the simulation
|
|
2
|
+
// Registers debug inspectors that expose entity cognition, faction beliefs,
|
|
3
|
+
// perception events, rumor traces, environmental state, and district memory.
|
|
4
|
+
import { getCognition } from './cognition-core.js';
|
|
5
|
+
import { getPerceptionLog } from './perception-filter.js';
|
|
6
|
+
import { getFactionCognition, getEntityFaction, getFactionMembers } from './faction-cognition.js';
|
|
7
|
+
import { getRumorLog, getRumorsToFaction } from './rumor-propagation.js';
|
|
8
|
+
import { getZoneProperty } from './environment-core.js';
|
|
9
|
+
import { getDistrictState, getDistrictDefinition, getAllDistrictIds, getDistrictThreatLevel } from './district-core.js';
|
|
10
|
+
// --- Module ---
|
|
11
|
+
export function createSimulationInspector() {
|
|
12
|
+
return {
|
|
13
|
+
id: 'simulation-inspector',
|
|
14
|
+
version: '0.1.0',
|
|
15
|
+
register(ctx) {
|
|
16
|
+
ctx.debug.registerInspector({
|
|
17
|
+
id: 'entity-cognition',
|
|
18
|
+
label: 'Entity Cognition',
|
|
19
|
+
inspect: (world) => inspectAllEntities(world),
|
|
20
|
+
});
|
|
21
|
+
ctx.debug.registerInspector({
|
|
22
|
+
id: 'faction-state',
|
|
23
|
+
label: 'Faction State',
|
|
24
|
+
inspect: (world) => inspectAllFactions(world),
|
|
25
|
+
});
|
|
26
|
+
ctx.debug.registerInspector({
|
|
27
|
+
id: 'environment-state',
|
|
28
|
+
label: 'Environment State',
|
|
29
|
+
inspect: (world) => inspectAllZones(world),
|
|
30
|
+
});
|
|
31
|
+
ctx.debug.registerInspector({
|
|
32
|
+
id: 'rumor-trace',
|
|
33
|
+
label: 'Rumor Trace',
|
|
34
|
+
inspect: (world) => getRumorLog(world),
|
|
35
|
+
});
|
|
36
|
+
ctx.debug.registerInspector({
|
|
37
|
+
id: 'district-state',
|
|
38
|
+
label: 'District State',
|
|
39
|
+
inspect: (world) => inspectAllDistricts(world),
|
|
40
|
+
});
|
|
41
|
+
ctx.debug.registerInspector({
|
|
42
|
+
id: 'simulation-snapshot',
|
|
43
|
+
label: 'Full Simulation Snapshot',
|
|
44
|
+
inspect: (world) => createSnapshot(world),
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// --- Entity Inspection ---
|
|
50
|
+
/** Inspect a single entity's cognitive state */
|
|
51
|
+
export function inspectEntity(world, entityId) {
|
|
52
|
+
const entity = world.entities[entityId];
|
|
53
|
+
if (!entity)
|
|
54
|
+
return null;
|
|
55
|
+
const cog = getCognition(world, entityId);
|
|
56
|
+
const perceptions = world.modules['perception-filter']
|
|
57
|
+
? getPerceptionLog(world, entityId)
|
|
58
|
+
: [];
|
|
59
|
+
return {
|
|
60
|
+
id: entity.id,
|
|
61
|
+
name: entity.name,
|
|
62
|
+
zone: entity.zoneId,
|
|
63
|
+
faction: getEntityFaction(world, entityId),
|
|
64
|
+
cognition: {
|
|
65
|
+
beliefs: cog.beliefs,
|
|
66
|
+
recentMemories: cog.memories.slice(-10),
|
|
67
|
+
morale: cog.morale,
|
|
68
|
+
suspicion: cog.suspicion,
|
|
69
|
+
currentIntent: cog.currentIntent,
|
|
70
|
+
},
|
|
71
|
+
perceptions: perceptions.slice(-20),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Inspect all AI entities */
|
|
75
|
+
export function inspectAllEntities(world) {
|
|
76
|
+
const result = {};
|
|
77
|
+
for (const entity of Object.values(world.entities)) {
|
|
78
|
+
if (!entity.ai)
|
|
79
|
+
continue;
|
|
80
|
+
const inspection = inspectEntity(world, entity.id);
|
|
81
|
+
if (inspection)
|
|
82
|
+
result[entity.id] = inspection;
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
// --- Faction Inspection ---
|
|
87
|
+
/** Inspect a single faction */
|
|
88
|
+
export function inspectFaction(world, factionId) {
|
|
89
|
+
if (!world.modules['faction-cognition'])
|
|
90
|
+
return null;
|
|
91
|
+
const factionCog = getFactionCognition(world, factionId);
|
|
92
|
+
const members = getFactionMembers(world, factionId);
|
|
93
|
+
const rumors = getRumorsToFaction(world, factionId);
|
|
94
|
+
return {
|
|
95
|
+
id: factionId,
|
|
96
|
+
members,
|
|
97
|
+
beliefs: factionCog.beliefs,
|
|
98
|
+
alertLevel: factionCog.alertLevel,
|
|
99
|
+
cohesion: factionCog.cohesion,
|
|
100
|
+
recentRumors: rumors.slice(-10),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** Inspect all factions */
|
|
104
|
+
export function inspectAllFactions(world) {
|
|
105
|
+
if (!world.modules['faction-cognition'])
|
|
106
|
+
return {};
|
|
107
|
+
const modState = world.modules['faction-cognition'];
|
|
108
|
+
const result = {};
|
|
109
|
+
for (const factionId of Object.keys(modState.factionCognition)) {
|
|
110
|
+
const inspection = inspectFaction(world, factionId);
|
|
111
|
+
if (inspection)
|
|
112
|
+
result[factionId] = inspection;
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
// --- Zone Inspection ---
|
|
117
|
+
/** Inspect a single zone's dynamic state */
|
|
118
|
+
export function inspectZone(world, zoneId) {
|
|
119
|
+
const zone = world.zones[zoneId];
|
|
120
|
+
if (!zone)
|
|
121
|
+
return null;
|
|
122
|
+
const dynamicProperties = {};
|
|
123
|
+
const envState = world.modules['environment-core'];
|
|
124
|
+
if (envState?.dynamics?.[zoneId]) {
|
|
125
|
+
Object.assign(dynamicProperties, envState.dynamics[zoneId]);
|
|
126
|
+
}
|
|
127
|
+
// Add base properties
|
|
128
|
+
if (zone.noise !== undefined)
|
|
129
|
+
dynamicProperties.noise = getZoneProperty(world, zoneId, 'noise');
|
|
130
|
+
if (zone.light !== undefined)
|
|
131
|
+
dynamicProperties.light = getZoneProperty(world, zoneId, 'light');
|
|
132
|
+
if (zone.stability !== undefined)
|
|
133
|
+
dynamicProperties.stability = getZoneProperty(world, zoneId, 'stability');
|
|
134
|
+
const entities = Object.values(world.entities)
|
|
135
|
+
.filter((e) => e.zoneId === zoneId)
|
|
136
|
+
.map((e) => e.id);
|
|
137
|
+
return {
|
|
138
|
+
id: zoneId,
|
|
139
|
+
name: zone.name,
|
|
140
|
+
dynamicProperties,
|
|
141
|
+
entities,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/** Inspect all zones */
|
|
145
|
+
export function inspectAllZones(world) {
|
|
146
|
+
const result = {};
|
|
147
|
+
for (const zoneId of Object.keys(world.zones)) {
|
|
148
|
+
const inspection = inspectZone(world, zoneId);
|
|
149
|
+
if (inspection)
|
|
150
|
+
result[zoneId] = inspection;
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
// --- District Inspection ---
|
|
155
|
+
/** Inspect a single district */
|
|
156
|
+
export function inspectDistrict(world, districtId) {
|
|
157
|
+
if (!world.modules['district-core'])
|
|
158
|
+
return null;
|
|
159
|
+
const state = getDistrictState(world, districtId);
|
|
160
|
+
const def = getDistrictDefinition(world, districtId);
|
|
161
|
+
if (!state || !def)
|
|
162
|
+
return null;
|
|
163
|
+
return {
|
|
164
|
+
id: districtId,
|
|
165
|
+
name: def.name,
|
|
166
|
+
zoneIds: def.zoneIds,
|
|
167
|
+
controllingFaction: def.controllingFaction,
|
|
168
|
+
metrics: {
|
|
169
|
+
alertPressure: state.alertPressure,
|
|
170
|
+
rumorDensity: state.rumorDensity,
|
|
171
|
+
intruderLikelihood: state.intruderLikelihood,
|
|
172
|
+
surveillance: state.surveillance,
|
|
173
|
+
stability: state.stability,
|
|
174
|
+
},
|
|
175
|
+
threatLevel: getDistrictThreatLevel(world, districtId),
|
|
176
|
+
eventCount: state.eventCount,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/** Inspect all districts */
|
|
180
|
+
export function inspectAllDistricts(world) {
|
|
181
|
+
if (!world.modules['district-core'])
|
|
182
|
+
return {};
|
|
183
|
+
const result = {};
|
|
184
|
+
for (const districtId of getAllDistrictIds(world)) {
|
|
185
|
+
const inspection = inspectDistrict(world, districtId);
|
|
186
|
+
if (inspection)
|
|
187
|
+
result[districtId] = inspection;
|
|
188
|
+
}
|
|
189
|
+
return result;
|
|
190
|
+
}
|
|
191
|
+
// --- Full Snapshot ---
|
|
192
|
+
/** Create a complete simulation snapshot */
|
|
193
|
+
export function createSnapshot(world) {
|
|
194
|
+
return {
|
|
195
|
+
tick: world.meta.tick,
|
|
196
|
+
entities: inspectAllEntities(world),
|
|
197
|
+
factions: inspectAllFactions(world),
|
|
198
|
+
zones: inspectAllZones(world),
|
|
199
|
+
districts: inspectAllDistricts(world),
|
|
200
|
+
rumorCount: getRumorLog(world).length,
|
|
201
|
+
eventLogSize: world.eventLog.length,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
// --- Text Formatters (for CLI output) ---
|
|
205
|
+
/** Format entity inspection as readable text */
|
|
206
|
+
export function formatEntityInspection(inspection) {
|
|
207
|
+
const lines = [];
|
|
208
|
+
lines.push(`Entity: ${inspection.name} (${inspection.id})`);
|
|
209
|
+
lines.push(` Zone: ${inspection.zone ?? 'none'}`);
|
|
210
|
+
lines.push(` Faction: ${inspection.faction ?? 'none'}`);
|
|
211
|
+
lines.push(` Morale: ${inspection.cognition.morale} Suspicion: ${inspection.cognition.suspicion}`);
|
|
212
|
+
lines.push(` Intent: ${inspection.cognition.currentIntent ?? 'none'}`);
|
|
213
|
+
if (inspection.cognition.beliefs.length > 0) {
|
|
214
|
+
lines.push(` Beliefs (${inspection.cognition.beliefs.length}):`);
|
|
215
|
+
for (const b of inspection.cognition.beliefs) {
|
|
216
|
+
lines.push(` ${b.subject}.${b.key} = ${b.value} (confidence: ${b.confidence.toFixed(2)}, source: ${b.source})`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (inspection.perceptions.length > 0) {
|
|
220
|
+
lines.push(` Recent Perceptions (${inspection.perceptions.length}):`);
|
|
221
|
+
for (const p of inspection.perceptions.slice(-5)) {
|
|
222
|
+
lines.push(` [tick ${p.tick}] ${p.detected ? 'detected' : 'missed'} via ${p.sense} (clarity: ${p.clarity.toFixed(2)})`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return lines.join('\n');
|
|
226
|
+
}
|
|
227
|
+
/** Format faction inspection as readable text */
|
|
228
|
+
export function formatFactionInspection(inspection) {
|
|
229
|
+
const lines = [];
|
|
230
|
+
lines.push(`Faction: ${inspection.id}`);
|
|
231
|
+
lines.push(` Members: ${inspection.members.join(', ')}`);
|
|
232
|
+
lines.push(` Alert Level: ${inspection.alertLevel} Cohesion: ${inspection.cohesion.toFixed(2)}`);
|
|
233
|
+
if (inspection.beliefs.length > 0) {
|
|
234
|
+
lines.push(` Beliefs (${inspection.beliefs.length}):`);
|
|
235
|
+
for (const b of inspection.beliefs) {
|
|
236
|
+
lines.push(` ${b.subject}.${b.key} = ${b.value} (confidence: ${b.confidence.toFixed(2)}, sources: ${b.sourceEntities.join(', ')})`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (inspection.recentRumors.length > 0) {
|
|
240
|
+
lines.push(` Recent Rumors (${inspection.recentRumors.length}):`);
|
|
241
|
+
for (const r of inspection.recentRumors.slice(-5)) {
|
|
242
|
+
lines.push(` [tick ${r.originTick}] ${r.sourceEntityId} → ${r.subject}.${r.key} (distortion: ${r.distortion.toFixed(3)})`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return lines.join('\n');
|
|
246
|
+
}
|
|
247
|
+
/** Format district inspection as readable text */
|
|
248
|
+
export function formatDistrictInspection(inspection) {
|
|
249
|
+
const lines = [];
|
|
250
|
+
lines.push(`District: ${inspection.name} (${inspection.id})`);
|
|
251
|
+
lines.push(` Zones: ${inspection.zoneIds.join(', ')}`);
|
|
252
|
+
lines.push(` Controlling Faction: ${inspection.controllingFaction ?? 'none'}`);
|
|
253
|
+
lines.push(` Threat Level: ${inspection.threatLevel}`);
|
|
254
|
+
lines.push(` Metrics:`);
|
|
255
|
+
lines.push(` Alert Pressure: ${inspection.metrics.alertPressure.toFixed(1)}`);
|
|
256
|
+
lines.push(` Rumor Density: ${inspection.metrics.rumorDensity.toFixed(1)}`);
|
|
257
|
+
lines.push(` Intruder Likelihood: ${inspection.metrics.intruderLikelihood.toFixed(1)}`);
|
|
258
|
+
lines.push(` Surveillance: ${inspection.metrics.surveillance.toFixed(1)}`);
|
|
259
|
+
lines.push(` Stability: ${inspection.metrics.stability.toFixed(1)}`);
|
|
260
|
+
lines.push(` Events Recorded: ${inspection.eventCount}`);
|
|
261
|
+
return lines.join('\n');
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=simulation-inspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation-inspector.js","sourceRoot":"","sources":["../src/simulation-inspector.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,4EAA4E;AAC5E,6EAA6E;AAQ7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAElG,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB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