@myclaw163/clawclaw-cli 0.7.7 → 0.7.8
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/src/pipeline/event-format.test.ts +13 -0
- package/src/pipeline/event-format.ts +11 -1
- package/src/pipeline/game-sync-event-normalization.test.ts +54 -1
- package/src/pipeline/game-sync-event-normalization.ts +39 -6
- package/src/pipeline/player-projection.test.ts +19 -2
- package/src/pipeline/player-projection.ts +17 -2
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-service.test.ts +71 -0
- package/src/runtime/clawclaw/plugins/source/source-plugin.test.ts +65 -0
package/package.json
CHANGED
|
@@ -37,6 +37,19 @@ describe('event-format', () => {
|
|
|
37
37
|
expect(JSON.stringify(formatted)).not.toContain('Your hands are off the board');
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
it('formats a system killer without a fake player seat', () => {
|
|
41
|
+
const message = formatEventMessage({
|
|
42
|
+
type: 'killed',
|
|
43
|
+
tick: 41,
|
|
44
|
+
room: '制氧舱',
|
|
45
|
+
killer_kind: 'system',
|
|
46
|
+
killer_name: 'Shrimp God',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
expect(message).toContain('被Shrimp God击杀');
|
|
50
|
+
expect(message).not.toContain('?号Shrimp God');
|
|
51
|
+
});
|
|
52
|
+
|
|
40
53
|
it('keeps meeting_briefing details aligned with the compact monitor payload', () => {
|
|
41
54
|
const formatted = compactEventFields({
|
|
42
55
|
type: 'meeting_briefing',
|
|
@@ -232,6 +232,16 @@ function playerLabel(name: unknown, seat: unknown, ctx: EventFormatContext): str
|
|
|
232
232
|
return `${seatLabel(name, seat, ctx)}${text(name, '未知玩家')}`;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
function killerLabel(
|
|
236
|
+
name: unknown,
|
|
237
|
+
seat: unknown,
|
|
238
|
+
kind: unknown,
|
|
239
|
+
ctx: EventFormatContext,
|
|
240
|
+
): string {
|
|
241
|
+
if (kind === 'system') return text(name, '未知系统来源');
|
|
242
|
+
return playerLabel(name, seat, ctx);
|
|
243
|
+
}
|
|
244
|
+
|
|
235
245
|
function playerObject(name: unknown, seat: unknown, ctx: EventFormatContext): Record<string, any> | undefined {
|
|
236
246
|
if (typeof name !== 'string' || name.length === 0) return undefined;
|
|
237
247
|
return cleanObject({
|
|
@@ -367,7 +377,7 @@ function shortBody(event: Record<string, any>, ctx: EventFormatContext): string
|
|
|
367
377
|
case 'kill':
|
|
368
378
|
return `你在${firstString(event, ['room'])}击杀了${playerLabel(event.target_name, firstNumber(event, ['target_seat', 'target_player_seat']), ctx)}。`;
|
|
369
379
|
case 'killed':
|
|
370
|
-
return `你在${firstString(event, ['room'])}被${
|
|
380
|
+
return `你在${firstString(event, ['room'])}被${killerLabel(event.killer_name, firstNumber(event, ['killer_seat', 'killer_player_seat']), event.killer_kind, ctx)}击杀了,你已死亡。`;
|
|
371
381
|
case 'murder_witnessed':
|
|
372
382
|
return `你在${firstString(event, ['room'])}目击${playerLabel(event.killer_name, firstNumber(event, ['killer_seat', 'killer_player_seat']), ctx)}击杀${playerLabel(event.target_name, firstNumber(event, ['target_seat', 'target_player_seat']), ctx)}。`;
|
|
373
383
|
case 'warrior_shrimp_self_destruct':
|
|
@@ -112,7 +112,7 @@ describe('GameSync v2 Event normalization', () => {
|
|
|
112
112
|
tick: 22,
|
|
113
113
|
type: 'synthetic_contract_fixture',
|
|
114
114
|
caller: { seat: 1, name: 'caller' },
|
|
115
|
-
killer: { seat: 2, name: 'killer' },
|
|
115
|
+
killer: { kind: 'player', player: { seat: 2, name: 'killer' } },
|
|
116
116
|
resolver: { seat: 3, name: 'resolver' },
|
|
117
117
|
speaker: { seat: 4, name: 'speaker' },
|
|
118
118
|
current_speaker: { seat: 5, name: 'current' },
|
|
@@ -123,6 +123,7 @@ describe('GameSync v2 Event normalization', () => {
|
|
|
123
123
|
expect(normalized).toMatchObject({
|
|
124
124
|
meeting_caller_name: 'caller',
|
|
125
125
|
meeting_caller_seat: 1,
|
|
126
|
+
killer_kind: 'player',
|
|
126
127
|
killer_name: 'killer',
|
|
127
128
|
killer_seat: 2,
|
|
128
129
|
resolver_name: 'resolver',
|
|
@@ -141,6 +142,58 @@ describe('GameSync v2 Event normalization', () => {
|
|
|
141
142
|
}
|
|
142
143
|
});
|
|
143
144
|
|
|
145
|
+
it('projects structured player and system killers for Agent presentation', () => {
|
|
146
|
+
const playerKilled = normalizeGameSyncEvent({
|
|
147
|
+
event_id: 'player-killed',
|
|
148
|
+
tick: 41,
|
|
149
|
+
type: 'killed',
|
|
150
|
+
actor: { seat: 4, name: 'victim' },
|
|
151
|
+
killer: { kind: 'player', player: { seat: 2, name: 'killer' } },
|
|
152
|
+
room: 'engine',
|
|
153
|
+
});
|
|
154
|
+
expect(playerKilled).toMatchObject({
|
|
155
|
+
actor_name: 'victim',
|
|
156
|
+
actor_seat: 4,
|
|
157
|
+
killer_kind: 'player',
|
|
158
|
+
killer_name: 'killer',
|
|
159
|
+
killer_seat: 2,
|
|
160
|
+
});
|
|
161
|
+
expect(playerKilled).not.toHaveProperty('killer');
|
|
162
|
+
expect(presentCanonicalEvent(canonical(playerKilled), null).hint)
|
|
163
|
+
.toBe('YOU ARE DEAD: seat 2 killer removed you from play.');
|
|
164
|
+
|
|
165
|
+
const systemKilled = normalizeGameSyncEvent({
|
|
166
|
+
event_id: 'system-killed',
|
|
167
|
+
tick: 42,
|
|
168
|
+
type: 'killed',
|
|
169
|
+
actor: { seat: 4, name: 'victim' },
|
|
170
|
+
killer: { kind: 'system', name: 'Shrimp God' },
|
|
171
|
+
room: 'engine',
|
|
172
|
+
});
|
|
173
|
+
expect(systemKilled).toMatchObject({
|
|
174
|
+
actor_name: 'victim',
|
|
175
|
+
actor_seat: 4,
|
|
176
|
+
killer_kind: 'system',
|
|
177
|
+
killer_name: 'Shrimp God',
|
|
178
|
+
});
|
|
179
|
+
expect(systemKilled).not.toHaveProperty('killer');
|
|
180
|
+
expect(systemKilled).not.toHaveProperty('killer_seat');
|
|
181
|
+
expect(presentCanonicalEvent(canonical(systemKilled), null).hint)
|
|
182
|
+
.toBe('YOU ARE DEAD: Shrimp God removed you from play.');
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('rejects malformed structured killers', () => {
|
|
186
|
+
expect(() => normalizeGameSyncEvent({
|
|
187
|
+
type: 'killed', killer: { kind: 'player', player: { seat: 2 } },
|
|
188
|
+
})).toThrow('killer.player.name must be a string');
|
|
189
|
+
expect(() => normalizeGameSyncEvent({
|
|
190
|
+
type: 'killed', killer: { kind: 'system', name: 'GM', seat: 0 },
|
|
191
|
+
})).toThrow('killer contains unsupported fields: seat');
|
|
192
|
+
expect(() => normalizeGameSyncEvent({
|
|
193
|
+
type: 'killed', killer: { kind: 'npc', name: 'GM' },
|
|
194
|
+
})).toThrow("killer.kind must be 'player' or 'system'");
|
|
195
|
+
});
|
|
196
|
+
|
|
144
197
|
it('preserves a faction winner scalar and projects a neutral winner PlayerRef', () => {
|
|
145
198
|
expect(normalizeGameSyncEvent({
|
|
146
199
|
event_id: 'faction-event', tick: 1, type: 'game_over', winner: 'lobster',
|
|
@@ -20,12 +20,6 @@ const SINGLE_PLAYER_REF_PROJECTIONS: readonly PlayerRefProjection[] = [
|
|
|
20
20
|
seatField: 'meeting_caller_seat',
|
|
21
21
|
playerRefOnlyWhenObject: true,
|
|
22
22
|
},
|
|
23
|
-
{
|
|
24
|
-
wireField: 'killer',
|
|
25
|
-
nameField: 'killer_name',
|
|
26
|
-
seatField: 'killer_seat',
|
|
27
|
-
playerRefOnlyWhenObject: true,
|
|
28
|
-
},
|
|
29
23
|
{ wireField: 'resolver', nameField: 'resolver_name', seatField: 'resolver_seat' },
|
|
30
24
|
{
|
|
31
25
|
wireField: 'speaker',
|
|
@@ -100,6 +94,39 @@ function playerRef(value: unknown, field: string): CanonicalPlayerRef {
|
|
|
100
94
|
return { name: value.name, seat: Number(value.seat) };
|
|
101
95
|
}
|
|
102
96
|
|
|
97
|
+
function validateExactFields(
|
|
98
|
+
value: Record<string, unknown>,
|
|
99
|
+
allowed: readonly string[],
|
|
100
|
+
field: string,
|
|
101
|
+
): void {
|
|
102
|
+
const extraFields = Object.keys(value).filter((key) => !allowed.includes(key));
|
|
103
|
+
if (extraFields.length > 0) {
|
|
104
|
+
throw new TypeError(`${field} contains unsupported fields: ${extraFields.join(', ')}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function projectKiller(value: unknown): Record<string, unknown> {
|
|
109
|
+
if (!isRecord(value)) {
|
|
110
|
+
throw new TypeError('GameSync Event.killer must be an object');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (value.kind === 'player') {
|
|
114
|
+
validateExactFields(value, ['kind', 'player'], 'GameSync Event.killer');
|
|
115
|
+
const killer = playerRef(value.player, 'GameSync Event.killer.player');
|
|
116
|
+
return { killer_kind: 'player', killer_name: killer.name, killer_seat: killer.seat };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (value.kind === 'system') {
|
|
120
|
+
validateExactFields(value, ['kind', 'name'], 'GameSync Event.killer');
|
|
121
|
+
if (typeof value.name !== 'string') {
|
|
122
|
+
throw new TypeError('GameSync Event.killer.name must be a string');
|
|
123
|
+
}
|
|
124
|
+
return { killer_kind: 'system', killer_name: value.name };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
throw new TypeError("GameSync Event.killer.kind must be 'player' or 'system'");
|
|
128
|
+
}
|
|
129
|
+
|
|
103
130
|
function playerRefArray(value: unknown, field: string): CanonicalPlayerRef[] {
|
|
104
131
|
if (!Array.isArray(value)) {
|
|
105
132
|
throw new TypeError(`${field} must be a PlayerRef array`);
|
|
@@ -146,6 +173,12 @@ export function normalizeGameSyncEvent(value: unknown): Record<string, any> {
|
|
|
146
173
|
normalized[projection.seatField] = projected.seat;
|
|
147
174
|
}
|
|
148
175
|
|
|
176
|
+
if (Object.hasOwn(normalized, 'killer')) {
|
|
177
|
+
const raw = normalized.killer;
|
|
178
|
+
delete normalized.killer;
|
|
179
|
+
if (raw !== null && raw !== undefined) Object.assign(normalized, projectKiller(raw));
|
|
180
|
+
}
|
|
181
|
+
|
|
149
182
|
for (const field of PLAYER_REF_ARRAY_FIELDS) {
|
|
150
183
|
if (!Object.hasOwn(normalized, field)) continue;
|
|
151
184
|
normalized[field] = playerRefArray(normalized[field], `GameSync Event.${field}`);
|
|
@@ -170,8 +170,7 @@ describe('GameSync v2 player projection', () => {
|
|
|
170
170
|
{ ...ref(2, 'Killer'), known_status: { is_alive: true } },
|
|
171
171
|
],
|
|
172
172
|
},
|
|
173
|
-
//
|
|
174
|
-
// legacy killer_name instead of emitting the structured killer field.
|
|
173
|
+
// Both actor and killer remain optional at the wire-model boundary.
|
|
175
174
|
events: [{ type: 'killed' }],
|
|
176
175
|
});
|
|
177
176
|
|
|
@@ -180,6 +179,24 @@ describe('GameSync v2 player projection', () => {
|
|
|
180
179
|
]);
|
|
181
180
|
});
|
|
182
181
|
|
|
182
|
+
it('accepts structured player and system killers on recipient-private killed events', () => {
|
|
183
|
+
for (const killer of [
|
|
184
|
+
{ kind: 'player', player: ref(2, 'Killer') },
|
|
185
|
+
{ kind: 'system', name: 'Shrimp God' },
|
|
186
|
+
]) {
|
|
187
|
+
expect(() => projectPlayers({
|
|
188
|
+
summary: {
|
|
189
|
+
you: { player: ref(1, 'Self') },
|
|
190
|
+
players: [
|
|
191
|
+
{ ...ref(1, 'Self'), known_status: { is_alive: false, death_cause: 'killed' } },
|
|
192
|
+
{ ...ref(2, 'Killer'), known_status: { is_alive: true } },
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
events: [{ type: 'killed', actor: ref(1, 'Self'), killer }],
|
|
196
|
+
})).not.toThrow();
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
183
200
|
it('preserves richer event knowledge when a later state only confirms death', () => {
|
|
184
201
|
const players = advancePlayerProjection({
|
|
185
202
|
previous: [{
|
|
@@ -141,12 +141,13 @@ function rememberRoster(players: Map<string, MutablePlayerProjection>, source: u
|
|
|
141
141
|
for (const key of [
|
|
142
142
|
'actor',
|
|
143
143
|
'target',
|
|
144
|
-
'killer',
|
|
145
144
|
'caller',
|
|
146
145
|
'resolver',
|
|
147
146
|
'current_speaker',
|
|
148
147
|
'result_target',
|
|
149
148
|
]) rememberRef(players, item[key]);
|
|
149
|
+
const killer = record(item.killer);
|
|
150
|
+
rememberRef(players, killer?.kind === 'player' ? killer.player : undefined);
|
|
150
151
|
for (const key of [
|
|
151
152
|
'reported_corpses',
|
|
152
153
|
'dead_players',
|
|
@@ -200,6 +201,20 @@ function refName(value: unknown): string | undefined {
|
|
|
200
201
|
return playerRef(value)?.name;
|
|
201
202
|
}
|
|
202
203
|
|
|
204
|
+
function killerName(value: unknown): string | undefined {
|
|
205
|
+
const killer = record(value);
|
|
206
|
+
if (killer?.kind === 'player') {
|
|
207
|
+
const player = playerRef(killer.player);
|
|
208
|
+
return player?.name;
|
|
209
|
+
}
|
|
210
|
+
if (killer?.kind === 'system') {
|
|
211
|
+
return typeof killer.name === 'string' && killer.name.length > 0
|
|
212
|
+
? killer.name
|
|
213
|
+
: undefined;
|
|
214
|
+
}
|
|
215
|
+
return playerRef(value)?.name;
|
|
216
|
+
}
|
|
217
|
+
|
|
203
218
|
function applyEvent(
|
|
204
219
|
players: Map<string, MutablePlayerProjection>,
|
|
205
220
|
event: Record<string, any>,
|
|
@@ -225,7 +240,7 @@ function applyEvent(
|
|
|
225
240
|
// optional actor ref is absent. Never mistake another ref for the victim.
|
|
226
241
|
enrichKnownDeath(players, youRef ?? event.actor, {
|
|
227
242
|
cause: 'killed',
|
|
228
|
-
killer:
|
|
243
|
+
killer: killerName(event.killer) ?? null,
|
|
229
244
|
revealed: true,
|
|
230
245
|
source: 'event_log',
|
|
231
246
|
});
|
|
@@ -526,6 +526,77 @@ describe('ClawClaw Mailbox Event query', () => {
|
|
|
526
526
|
expect(repository.delivery(completed.eventId, 'local-agent')?.detailState).not.toBe('not_applicable');
|
|
527
527
|
});
|
|
528
528
|
|
|
529
|
+
it('presents player and system killers through both Monitor and ccl events', async () => {
|
|
530
|
+
const { repository, ingress, service, setReady } = fixture();
|
|
531
|
+
const playerKilled = await publish(ingress, {
|
|
532
|
+
eventId: 'player-killed',
|
|
533
|
+
type: 'killed',
|
|
534
|
+
segmentId: 'room-1',
|
|
535
|
+
epochSeq: 1,
|
|
536
|
+
payload: {
|
|
537
|
+
tick: 41,
|
|
538
|
+
room: '制氧舱',
|
|
539
|
+
actor_name: 'victim',
|
|
540
|
+
actor_seat: 4,
|
|
541
|
+
killer_kind: 'player',
|
|
542
|
+
killer_name: '某蟹',
|
|
543
|
+
killer_seat: 1,
|
|
544
|
+
},
|
|
545
|
+
});
|
|
546
|
+
const systemKilled = await publish(ingress, {
|
|
547
|
+
eventId: 'system-killed',
|
|
548
|
+
type: 'killed',
|
|
549
|
+
segmentId: 'room-1',
|
|
550
|
+
epochSeq: 2,
|
|
551
|
+
payload: {
|
|
552
|
+
tick: 42,
|
|
553
|
+
room: '制氧舱',
|
|
554
|
+
actor_name: 'victim',
|
|
555
|
+
actor_seat: 4,
|
|
556
|
+
killer_kind: 'system',
|
|
557
|
+
killer_name: 'Shrimp God',
|
|
558
|
+
},
|
|
559
|
+
});
|
|
560
|
+
setReady(readyView('room-1', 2, systemKilled.commitSeq, { phase: 'wandering', tick: 42 }));
|
|
561
|
+
|
|
562
|
+
expect(service.prepareMonitor(true)).toBe(2);
|
|
563
|
+
const broker = new MailboxRelayBroker(repository, 'short');
|
|
564
|
+
const claim = broker.handle({
|
|
565
|
+
type: 'mailbox_claim',
|
|
566
|
+
relay_id: 'relay-structured-killers',
|
|
567
|
+
mode: 'short',
|
|
568
|
+
});
|
|
569
|
+
const payloads = claim?.claim?.items.map((item: any) => item.payload) ?? [];
|
|
570
|
+
const monitor = service.composeMonitor(payloads);
|
|
571
|
+
expect(monitor).toMatchObject({ events: ['killed', 'killed'] });
|
|
572
|
+
expect(monitor.messages).toEqual(expect.arrayContaining([
|
|
573
|
+
expect.stringContaining('被1号某蟹击杀'),
|
|
574
|
+
expect.stringContaining('被Shrimp God击杀'),
|
|
575
|
+
]));
|
|
576
|
+
expect(JSON.stringify(monitor)).not.toContain('?号Shrimp God');
|
|
577
|
+
|
|
578
|
+
const events = service.prepareEvents().output.events as Array<Record<string, unknown>>;
|
|
579
|
+
expect(events).toEqual(expect.arrayContaining([
|
|
580
|
+
expect.objectContaining({
|
|
581
|
+
type: 'killed',
|
|
582
|
+
tick: 41,
|
|
583
|
+
killer_kind: 'player',
|
|
584
|
+
killer_name: '某蟹',
|
|
585
|
+
killer_seat: 1,
|
|
586
|
+
hint: 'YOU ARE DEAD: seat 1 某蟹 removed you from play.',
|
|
587
|
+
}),
|
|
588
|
+
expect.objectContaining({
|
|
589
|
+
type: 'killed',
|
|
590
|
+
tick: 42,
|
|
591
|
+
killer_kind: 'system',
|
|
592
|
+
killer_name: 'Shrimp God',
|
|
593
|
+
hint: 'YOU ARE DEAD: Shrimp God removed you from play.',
|
|
594
|
+
}),
|
|
595
|
+
]));
|
|
596
|
+
expect(repository.delivery(playerKilled.eventId, 'local-agent')?.detailState)
|
|
597
|
+
.not.toBe('not_applicable');
|
|
598
|
+
});
|
|
599
|
+
|
|
529
600
|
it('adds the latest structured Strategy status only to ccl events State', async () => {
|
|
530
601
|
const { ingress, service, setReady } = fixture();
|
|
531
602
|
const event = await publish(ingress, {
|
|
@@ -1188,6 +1188,71 @@ describe('ClawclawSourcePlugin lifecycle', () => {
|
|
|
1188
1188
|
await expect(source.waitForCompletion()).resolves.toEqual({ reason: 'stopped' });
|
|
1189
1189
|
});
|
|
1190
1190
|
|
|
1191
|
+
it('normalizes structured player and system killers from GameSync frames', async () => {
|
|
1192
|
+
const scenarios = [{
|
|
1193
|
+
eventId: 'player-killed',
|
|
1194
|
+
killer: { kind: 'player', player: { seat: 2, name: 'Killer' } },
|
|
1195
|
+
expected: {
|
|
1196
|
+
killer_kind: 'player', killer_name: 'Killer', killer_seat: 2,
|
|
1197
|
+
},
|
|
1198
|
+
}, {
|
|
1199
|
+
eventId: 'system-killed',
|
|
1200
|
+
killer: { kind: 'system', name: 'Shrimp God' },
|
|
1201
|
+
expected: { killer_kind: 'system', killer_name: 'Shrimp God' },
|
|
1202
|
+
}];
|
|
1203
|
+
|
|
1204
|
+
for (const scenario of scenarios) {
|
|
1205
|
+
const { runtime, events, source, games } = await fixture([{
|
|
1206
|
+
status: 'allocated',
|
|
1207
|
+
mode: 'match',
|
|
1208
|
+
game_id: `G-${scenario.eventId}`,
|
|
1209
|
+
ws_url: 'wss://game.test/ws',
|
|
1210
|
+
}]);
|
|
1211
|
+
await waitUntil(() => games.length === 1, 'Game transport was not started.');
|
|
1212
|
+
|
|
1213
|
+
await games[0].emit(gameStateFrame('game-1', 1, {
|
|
1214
|
+
tick: 41,
|
|
1215
|
+
phase: 'wandering',
|
|
1216
|
+
you: { player: { seat: 1, name: 'me' }, is_alive: false },
|
|
1217
|
+
players: [
|
|
1218
|
+
{ seat: 1, name: 'me', known_status: { is_alive: false, death_cause: 'killed' } },
|
|
1219
|
+
{ seat: 2, name: 'Killer', known_status: { is_alive: true } },
|
|
1220
|
+
],
|
|
1221
|
+
}, [{
|
|
1222
|
+
event_id: scenario.eventId,
|
|
1223
|
+
type: 'killed',
|
|
1224
|
+
actor: { seat: 1, name: 'me' },
|
|
1225
|
+
killer: scenario.killer,
|
|
1226
|
+
room: '制氧舱',
|
|
1227
|
+
}]));
|
|
1228
|
+
await runtime.flush();
|
|
1229
|
+
|
|
1230
|
+
const killed = runtime.repository.listCommittedEvents({
|
|
1231
|
+
sessionId: runtime.scope().sessionId,
|
|
1232
|
+
segmentId: runtime.scope().segmentId,
|
|
1233
|
+
types: ['killed'],
|
|
1234
|
+
});
|
|
1235
|
+
expect(killed).toHaveLength(1);
|
|
1236
|
+
expect(killed[0].payload).toMatchObject({
|
|
1237
|
+
room: '制氧舱',
|
|
1238
|
+
actor_name: 'me',
|
|
1239
|
+
actor_seat: 1,
|
|
1240
|
+
...scenario.expected,
|
|
1241
|
+
});
|
|
1242
|
+
expect(killed[0].payload).not.toHaveProperty('killer');
|
|
1243
|
+
|
|
1244
|
+
const mailbox = new ClawclawMailboxService({
|
|
1245
|
+
repository: events,
|
|
1246
|
+
readyView: () => runtime.readReadyView(),
|
|
1247
|
+
});
|
|
1248
|
+
expect(mailbox.prepareEvents({ eventType: 'killed' }).output.event)
|
|
1249
|
+
.toMatchObject(scenario.expected);
|
|
1250
|
+
|
|
1251
|
+
await source.stop();
|
|
1252
|
+
await runtime.close();
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1191
1256
|
it('keeps exile pending until a later authoritative State confirms death', async () => {
|
|
1192
1257
|
const { runtime, source, games } = await fixture([{
|
|
1193
1258
|
status: 'allocated',
|