@sharpee/ext-testing 0.9.62-beta → 0.9.66-beta

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.
Files changed (147) hide show
  1. package/{dist/annotations → annotations}/context.d.ts +1 -1
  2. package/annotations/context.d.ts.map +1 -0
  3. package/annotations/context.js.map +1 -0
  4. package/annotations/index.d.ts.map +1 -0
  5. package/annotations/index.js.map +1 -0
  6. package/annotations/store.d.ts.map +1 -0
  7. package/annotations/store.js.map +1 -0
  8. package/checkpoints/index.d.ts.map +1 -0
  9. package/checkpoints/index.js.map +1 -0
  10. package/{dist/checkpoints → checkpoints}/serializer.d.ts +1 -1
  11. package/checkpoints/serializer.d.ts.map +1 -0
  12. package/checkpoints/serializer.js.map +1 -0
  13. package/checkpoints/store.d.ts.map +1 -0
  14. package/checkpoints/store.js.map +1 -0
  15. package/commands/index.d.ts.map +1 -0
  16. package/commands/index.js.map +1 -0
  17. package/commands/registry.d.ts.map +1 -0
  18. package/commands/registry.js.map +1 -0
  19. package/{dist-npm/context → context}/debug-context.d.ts +1 -1
  20. package/context/debug-context.d.ts.map +1 -0
  21. package/{dist-npm/context → context}/debug-context.js +1 -1
  22. package/context/debug-context.js.map +1 -0
  23. package/context/index.d.ts.map +1 -0
  24. package/context/index.js.map +1 -0
  25. package/{dist/extension.d.ts → extension.d.ts} +1 -1
  26. package/extension.d.ts.map +1 -0
  27. package/extension.js.map +1 -0
  28. package/{dist-npm/index.d.ts → index.d.ts} +1 -1
  29. package/index.d.ts.map +1 -0
  30. package/{dist-npm/index.js → index.js} +1 -1
  31. package/index.js.map +1 -0
  32. package/package.json +14 -25
  33. package/{dist/types.d.ts → types.d.ts} +1 -1
  34. package/types.d.ts.map +1 -0
  35. package/types.js.map +1 -0
  36. package/LICENSE +0 -21
  37. package/dist/annotations/context.d.ts.map +0 -1
  38. package/dist/annotations/context.js +0 -42
  39. package/dist/annotations/context.js.map +0 -1
  40. package/dist/annotations/index.d.ts +0 -6
  41. package/dist/annotations/index.d.ts.map +0 -1
  42. package/dist/annotations/index.js +0 -12
  43. package/dist/annotations/index.js.map +0 -1
  44. package/dist/annotations/store.d.ts +0 -11
  45. package/dist/annotations/store.d.ts.map +0 -1
  46. package/dist/annotations/store.js +0 -191
  47. package/dist/annotations/store.js.map +0 -1
  48. package/dist/checkpoints/index.d.ts +0 -3
  49. package/dist/checkpoints/index.d.ts.map +0 -1
  50. package/dist/checkpoints/index.js +0 -12
  51. package/dist/checkpoints/index.js.map +0 -1
  52. package/dist/checkpoints/serializer.d.ts.map +0 -1
  53. package/dist/checkpoints/serializer.js +0 -95
  54. package/dist/checkpoints/serializer.js.map +0 -1
  55. package/dist/checkpoints/store.d.ts +0 -20
  56. package/dist/checkpoints/store.d.ts.map +0 -1
  57. package/dist/checkpoints/store.js +0 -193
  58. package/dist/checkpoints/store.js.map +0 -1
  59. package/dist/commands/index.d.ts +0 -2
  60. package/dist/commands/index.d.ts.map +0 -1
  61. package/dist/commands/index.js +0 -8
  62. package/dist/commands/index.js.map +0 -1
  63. package/dist/commands/registry.d.ts +0 -28
  64. package/dist/commands/registry.d.ts.map +0 -1
  65. package/dist/commands/registry.js +0 -70
  66. package/dist/commands/registry.js.map +0 -1
  67. package/dist/context/debug-context.d.ts +0 -21
  68. package/dist/context/debug-context.d.ts.map +0 -1
  69. package/dist/context/debug-context.js +0 -172
  70. package/dist/context/debug-context.js.map +0 -1
  71. package/dist/context/index.d.ts +0 -2
  72. package/dist/context/index.d.ts.map +0 -1
  73. package/dist/context/index.js +0 -8
  74. package/dist/context/index.js.map +0 -1
  75. package/dist/extension.d.ts.map +0 -1
  76. package/dist/extension.js +0 -938
  77. package/dist/extension.js.map +0 -1
  78. package/dist/index.d.ts +0 -40
  79. package/dist/index.d.ts.map +0 -1
  80. package/dist/index.js +0 -63
  81. package/dist/index.js.map +0 -1
  82. package/dist/types.d.ts.map +0 -1
  83. package/dist/types.js +0 -8
  84. package/dist/types.js.map +0 -1
  85. package/dist-npm/annotations/context.d.ts +0 -16
  86. package/dist-npm/annotations/context.d.ts.map +0 -1
  87. package/dist-npm/annotations/context.js.map +0 -1
  88. package/dist-npm/annotations/index.d.ts.map +0 -1
  89. package/dist-npm/annotations/index.js.map +0 -1
  90. package/dist-npm/annotations/store.d.ts.map +0 -1
  91. package/dist-npm/annotations/store.js.map +0 -1
  92. package/dist-npm/checkpoints/index.d.ts.map +0 -1
  93. package/dist-npm/checkpoints/index.js.map +0 -1
  94. package/dist-npm/checkpoints/serializer.d.ts +0 -21
  95. package/dist-npm/checkpoints/serializer.d.ts.map +0 -1
  96. package/dist-npm/checkpoints/serializer.js.map +0 -1
  97. package/dist-npm/checkpoints/store.d.ts.map +0 -1
  98. package/dist-npm/checkpoints/store.js.map +0 -1
  99. package/dist-npm/commands/index.d.ts.map +0 -1
  100. package/dist-npm/commands/index.js.map +0 -1
  101. package/dist-npm/commands/registry.d.ts.map +0 -1
  102. package/dist-npm/commands/registry.js.map +0 -1
  103. package/dist-npm/context/debug-context.d.ts.map +0 -1
  104. package/dist-npm/context/debug-context.js.map +0 -1
  105. package/dist-npm/context/index.d.ts.map +0 -1
  106. package/dist-npm/context/index.js.map +0 -1
  107. package/dist-npm/extension.d.ts +0 -78
  108. package/dist-npm/extension.d.ts.map +0 -1
  109. package/dist-npm/extension.js.map +0 -1
  110. package/dist-npm/index.d.ts.map +0 -1
  111. package/dist-npm/index.js.map +0 -1
  112. package/dist-npm/types.d.ts +0 -375
  113. package/dist-npm/types.d.ts.map +0 -1
  114. package/dist-npm/types.js.map +0 -1
  115. package/src/annotations/context.ts +0 -47
  116. package/src/annotations/index.ts +0 -6
  117. package/src/annotations/store.ts +0 -219
  118. package/src/checkpoints/index.ts +0 -2
  119. package/src/checkpoints/serializer.ts +0 -121
  120. package/src/checkpoints/store.ts +0 -188
  121. package/src/commands/index.ts +0 -1
  122. package/src/commands/registry.ts +0 -81
  123. package/src/context/debug-context.ts +0 -209
  124. package/src/context/index.ts +0 -1
  125. package/src/extension.ts +0 -1089
  126. package/src/index.ts +0 -69
  127. package/src/types.ts +0 -469
  128. package/tsconfig.json +0 -16
  129. package/tsconfig.tsbuildinfo +0 -1
  130. /package/{dist-npm/annotations → annotations}/context.js +0 -0
  131. /package/{dist-npm/annotations → annotations}/index.d.ts +0 -0
  132. /package/{dist-npm/annotations → annotations}/index.js +0 -0
  133. /package/{dist-npm/annotations → annotations}/store.d.ts +0 -0
  134. /package/{dist-npm/annotations → annotations}/store.js +0 -0
  135. /package/{dist-npm/checkpoints → checkpoints}/index.d.ts +0 -0
  136. /package/{dist-npm/checkpoints → checkpoints}/index.js +0 -0
  137. /package/{dist-npm/checkpoints → checkpoints}/serializer.js +0 -0
  138. /package/{dist-npm/checkpoints → checkpoints}/store.d.ts +0 -0
  139. /package/{dist-npm/checkpoints → checkpoints}/store.js +0 -0
  140. /package/{dist-npm/commands → commands}/index.d.ts +0 -0
  141. /package/{dist-npm/commands → commands}/index.js +0 -0
  142. /package/{dist-npm/commands → commands}/registry.d.ts +0 -0
  143. /package/{dist-npm/commands → commands}/registry.js +0 -0
  144. /package/{dist-npm/context → context}/index.d.ts +0 -0
  145. /package/{dist-npm/context → context}/index.js +0 -0
  146. /package/{dist-npm/extension.js → extension.js} +0 -0
  147. /package/{dist-npm/types.js → types.js} +0 -0
@@ -1,375 +0,0 @@
1
- /**
2
- * @sharpee/ext-testing - Type definitions
3
- *
4
- * Core interfaces for the testing extension, generalized from Dungeo's GDT implementation.
5
- */
6
- import type { WorldModel, IFEntity, AuthorModel } from '@sharpee/world-model';
7
- /**
8
- * Configuration for the testing extension
9
- */
10
- export interface TestingExtensionConfig {
11
- /**
12
- * Interactive debug mode (GDT-style) configuration
13
- */
14
- debugMode?: {
15
- /** Enable interactive debug commands */
16
- enabled?: boolean;
17
- /** Command prefix (default: 'gdt') */
18
- prefix?: string;
19
- /** Optional password to enter debug mode */
20
- password?: string | null;
21
- };
22
- /**
23
- * Test mode configuration for transcript testing
24
- */
25
- testMode?: {
26
- /** Enable test commands ($teleport, $assert, etc.) */
27
- enabled?: boolean;
28
- /** Use deterministic random for reproducible tests */
29
- deterministicRandom?: boolean;
30
- /** Enable assertion commands */
31
- assertions?: boolean;
32
- };
33
- /**
34
- * Checkpoint configuration
35
- */
36
- checkpoints?: {
37
- /** Directory for checkpoint files */
38
- directory?: string;
39
- };
40
- /**
41
- * Additional story-specific commands
42
- */
43
- commands?: DebugCommand[];
44
- }
45
- /**
46
- * Context provided to debug commands for inspecting and modifying game state.
47
- * Wraps WorldModel with convenience methods for common debug operations.
48
- */
49
- export interface DebugContext {
50
- /** Direct access to world model (read operations) */
51
- readonly world: WorldModel;
52
- /** Author model for bypassing game rules during setup */
53
- readonly author: AuthorModel;
54
- /** Current player entity */
55
- readonly player: IFEntity;
56
- /** Debug flags (story-specific state) */
57
- readonly flags: Map<string, boolean>;
58
- /**
59
- * Find entity by ID or partial name match
60
- */
61
- findEntity(idOrName: string): IFEntity | undefined;
62
- /**
63
- * Find room by ID or partial name match
64
- */
65
- findRoom(idOrName: string): IFEntity | undefined;
66
- /**
67
- * Get all entities matching a predicate
68
- */
69
- findEntities(predicate: (entity: IFEntity) => boolean): IFEntity[];
70
- /**
71
- * Get current player location
72
- */
73
- getPlayerLocation(): IFEntity | undefined;
74
- /**
75
- * Get player inventory as array of entities
76
- */
77
- getInventory(): IFEntity[];
78
- /**
79
- * Get all entities at a location
80
- */
81
- getContents(locationId: string): IFEntity[];
82
- /**
83
- * Teleport player to a room
84
- */
85
- teleportPlayer(roomId: string): boolean;
86
- /**
87
- * Move an object to a location
88
- */
89
- moveObject(objectId: string, locationId: string): boolean;
90
- /**
91
- * Give an object to player (add to inventory)
92
- */
93
- takeObject(objectId: string): boolean;
94
- /**
95
- * Remove an object from the game (move to limbo)
96
- */
97
- removeObject(objectId: string): boolean;
98
- /**
99
- * Spawn an object at a location
100
- */
101
- spawnObject(objectId: string, locationId: string): boolean;
102
- /**
103
- * Set a debug flag
104
- */
105
- setFlag(name: string, value: boolean): void;
106
- /**
107
- * Get a debug flag value
108
- */
109
- getFlag(name: string): boolean;
110
- }
111
- /**
112
- * Result of executing a debug command
113
- */
114
- export interface CommandResult {
115
- /** Whether the command succeeded */
116
- success: boolean;
117
- /** Output lines to display */
118
- output: string[];
119
- /** Error message if failed */
120
- error?: string;
121
- /** Optional data for programmatic use */
122
- data?: Record<string, unknown>;
123
- }
124
- /**
125
- * Categories for organizing commands
126
- */
127
- export type CommandCategory = 'display' | 'alter' | 'toggle' | 'utility' | 'test' | 'annotation';
128
- /**
129
- * A debug/test command handler
130
- */
131
- export interface DebugCommand {
132
- /**
133
- * Short code for GDT mode (e.g., "AH" for teleport)
134
- */
135
- code: string;
136
- /**
137
- * Test syntax for transcript mode (e.g., "teleport")
138
- */
139
- testSyntax?: string;
140
- /**
141
- * Human-readable name
142
- */
143
- name: string;
144
- /**
145
- * Brief description for help text
146
- */
147
- description: string;
148
- /**
149
- * Command category for organization
150
- */
151
- category: CommandCategory;
152
- /**
153
- * Usage pattern (e.g., "teleport <room>")
154
- */
155
- usage?: string;
156
- /**
157
- * Execute the command
158
- */
159
- execute(context: DebugContext, args: string[]): CommandResult;
160
- }
161
- /**
162
- * Registry for debug commands
163
- */
164
- export interface CommandRegistry {
165
- /**
166
- * Register a command
167
- */
168
- register(command: DebugCommand): void;
169
- /**
170
- * Get command by GDT code
171
- */
172
- getByCode(code: string): DebugCommand | undefined;
173
- /**
174
- * Get command by test syntax
175
- */
176
- getByTestSyntax(syntax: string): DebugCommand | undefined;
177
- /**
178
- * Get all commands
179
- */
180
- getAll(): DebugCommand[];
181
- /**
182
- * Get commands by category
183
- */
184
- getByCategory(category: CommandCategory): DebugCommand[];
185
- }
186
- /**
187
- * Serialized checkpoint data
188
- */
189
- export interface CheckpointData {
190
- /** Format version */
191
- version: '1.0.0';
192
- /** When checkpoint was created */
193
- timestamp: number;
194
- /** Metadata about the checkpoint */
195
- metadata: {
196
- /** Optional name for the checkpoint */
197
- name?: string;
198
- /** Current turn number */
199
- turn: number;
200
- /** Player location at checkpoint */
201
- location?: string;
202
- };
203
- /** Serialized world state */
204
- worldState: string;
205
- /** Scheduler state (daemons, fuses) */
206
- schedulerState?: {
207
- turn: number;
208
- daemons: SerializedDaemon[];
209
- fuses: SerializedFuse[];
210
- };
211
- }
212
- /**
213
- * Serialized daemon data
214
- */
215
- export interface SerializedDaemon {
216
- id: string;
217
- handler: string;
218
- interval: number;
219
- lastRun: number;
220
- data?: Record<string, unknown>;
221
- }
222
- /**
223
- * Serialized fuse data
224
- */
225
- export interface SerializedFuse {
226
- id: string;
227
- handler: string;
228
- turnsRemaining: number;
229
- data?: Record<string, unknown>;
230
- }
231
- /**
232
- * Checkpoint storage interface
233
- */
234
- export interface CheckpointStore {
235
- /**
236
- * Save a checkpoint
237
- */
238
- save(name: string, data: CheckpointData): Promise<void>;
239
- /**
240
- * Load a checkpoint
241
- */
242
- load(name: string): Promise<CheckpointData | undefined>;
243
- /**
244
- * List available checkpoints
245
- */
246
- list(): Promise<string[]>;
247
- /**
248
- * Delete a checkpoint
249
- */
250
- delete(name: string): Promise<boolean>;
251
- /**
252
- * Check if checkpoint exists
253
- */
254
- exists(name: string): Promise<boolean>;
255
- }
256
- /**
257
- * Types of annotations playtesters can create
258
- */
259
- export type AnnotationType = 'comment' | 'bug' | 'note' | 'confusing' | 'expected' | 'bookmark';
260
- /**
261
- * Context captured with each annotation
262
- */
263
- export interface AnnotationContext {
264
- /** Current room ID */
265
- roomId: string;
266
- /** Current room name */
267
- roomName: string;
268
- /** Current turn number */
269
- turn: number;
270
- /** Current score */
271
- score: number;
272
- /** The command that was just executed */
273
- lastCommand: string;
274
- /** The game's response to that command */
275
- lastResponse: string;
276
- /** Items currently in player's inventory */
277
- inventory: string[];
278
- }
279
- /**
280
- * A single annotation from a playtester
281
- */
282
- export interface Annotation {
283
- /** Unique identifier */
284
- id: string;
285
- /** When the annotation was created */
286
- timestamp: number;
287
- /** Type of annotation */
288
- type: AnnotationType;
289
- /** The annotation text */
290
- text: string;
291
- /** Game state context when annotation was made */
292
- context: AnnotationContext;
293
- /** Session this annotation belongs to (if any) */
294
- sessionId?: string;
295
- }
296
- /**
297
- * A playtest session containing multiple annotations
298
- */
299
- export interface AnnotationSession {
300
- /** Unique session identifier */
301
- id: string;
302
- /** Human-readable session name */
303
- name: string;
304
- /** When session started */
305
- startTime: number;
306
- /** When session ended (undefined if still active) */
307
- endTime?: number;
308
- /** All annotations in this session */
309
- annotations: Annotation[];
310
- }
311
- /**
312
- * Storage interface for annotations
313
- */
314
- export interface AnnotationStore {
315
- /** Start a new annotation session */
316
- startSession(name: string): string;
317
- /** End the current session */
318
- endSession(): AnnotationSession | undefined;
319
- /** Get the current active session */
320
- getCurrentSession(): AnnotationSession | undefined;
321
- /** Add an annotation with context */
322
- addAnnotation(type: AnnotationType, text: string, context: AnnotationContext): Annotation;
323
- /** Get all annotations (current session or all if no session) */
324
- getAnnotations(): Annotation[];
325
- /** Get annotations filtered by type */
326
- getAnnotationsByType(type: AnnotationType): Annotation[];
327
- /** Export annotations as markdown report */
328
- exportMarkdown(): string;
329
- /** Export annotations as JSON */
330
- exportJson(): string;
331
- /** Clear all annotations */
332
- clear(): void;
333
- }
334
- /**
335
- * Interface for the testing extension
336
- */
337
- export interface ITestingExtension {
338
- /** Extension configuration */
339
- readonly config: TestingExtensionConfig;
340
- /** Command registry */
341
- readonly commands: CommandRegistry;
342
- /** Checkpoint store */
343
- readonly checkpoints: CheckpointStore;
344
- /** Annotation store */
345
- readonly annotations: AnnotationStore;
346
- /**
347
- * Execute a GDT-style command (e.g., "AH room-id")
348
- */
349
- executeGdtCommand(input: string, world: WorldModel): CommandResult;
350
- /**
351
- * Execute a test command (e.g., "$teleport room-id")
352
- */
353
- executeTestCommand(input: string, world: WorldModel): CommandResult;
354
- /**
355
- * Create a debug context for the current world state
356
- */
357
- createContext(world: WorldModel): DebugContext;
358
- /**
359
- * Save current state as checkpoint
360
- */
361
- saveCheckpoint(name: string, world: WorldModel): Promise<void>;
362
- /**
363
- * Restore state from checkpoint
364
- */
365
- restoreCheckpoint(name: string, world: WorldModel): Promise<boolean>;
366
- /**
367
- * Set context for annotation commands (called by transcript-tester after each command)
368
- */
369
- setCommandContext(command: string, response: string): void;
370
- /**
371
- * Add an annotation directly (for # comments from transcript-tester)
372
- */
373
- addAnnotation(type: AnnotationType, text: string, world: WorldModel): Annotation;
374
- }
375
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAM9E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,wCAAwC;QACxC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,sCAAsC;QACtC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,4CAA4C;QAC5C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,sDAAsD;QACtD,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,sDAAsD;QACtD,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,gCAAgC;QAChC,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;IAEF;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ,qCAAqC;QACrC,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAMD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAE3B,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B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AAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErE;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3D;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC;CAClF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -1,47 +0,0 @@
1
- /**
2
- * Annotation Context Capture
3
- *
4
- * Utility to capture current game state for annotations.
5
- */
6
-
7
- import type { WorldModel } from '@sharpee/world-model';
8
- import type { AnnotationContext } from '../types.js';
9
-
10
- /**
11
- * Capture the current game state for annotation context
12
- */
13
- export function captureContext(
14
- world: WorldModel,
15
- lastCommand: string,
16
- lastResponse: string
17
- ): AnnotationContext {
18
- const player = world.getPlayer();
19
- const locationId = player ? world.getLocation(player.id) : undefined;
20
- const location = locationId ? world.getEntity(locationId) : undefined;
21
- const inventory = player ? world.getContents(player.id) : [];
22
-
23
- return {
24
- roomId: locationId ?? 'unknown',
25
- roomName: location?.name ?? locationId ?? 'unknown',
26
- turn: (world.getStateValue('turnCount') as number) ?? (world.getStateValue('moves') as number) ?? 0,
27
- score: (world.getStateValue('score') as number) ?? 0,
28
- lastCommand,
29
- lastResponse,
30
- inventory: inventory.map((e) => e.name ?? e.id),
31
- };
32
- }
33
-
34
- /**
35
- * Create an empty/default context (for when no command has been executed yet)
36
- */
37
- export function createEmptyContext(): AnnotationContext {
38
- return {
39
- roomId: 'unknown',
40
- roomName: 'unknown',
41
- turn: 0,
42
- score: 0,
43
- lastCommand: '',
44
- lastResponse: '',
45
- inventory: [],
46
- };
47
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Annotations module - Playtester feedback capture (ADR-109)
3
- */
4
-
5
- export { createAnnotationStore } from './store.js';
6
- export { captureContext, createEmptyContext } from './context.js';
@@ -1,219 +0,0 @@
1
- /**
2
- * Annotation Store Implementation
3
- *
4
- * In-memory storage for playtester annotations with session management.
5
- */
6
-
7
- import type { AnnotationType, Annotation, AnnotationContext, AnnotationSession, AnnotationStore } from '../types.js';
8
-
9
- /**
10
- * Generate a unique ID
11
- */
12
- function generateId(): string {
13
- return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
14
- }
15
-
16
- /**
17
- * Create an in-memory annotation store
18
- */
19
- export function createAnnotationStore(): AnnotationStore {
20
- let currentSession: AnnotationSession | undefined;
21
- let allAnnotations: Annotation[] = [];
22
-
23
- return {
24
- // Session management
25
- startSession(name: string): string {
26
- // End any existing session first
27
- if (currentSession) {
28
- currentSession.endTime = Date.now();
29
- }
30
-
31
- const id = generateId();
32
- currentSession = {
33
- id,
34
- name,
35
- startTime: Date.now(),
36
- annotations: [],
37
- };
38
-
39
- return id;
40
- },
41
-
42
- endSession(): AnnotationSession | undefined {
43
- if (!currentSession) {
44
- return undefined;
45
- }
46
-
47
- currentSession.endTime = Date.now();
48
- const ended = currentSession;
49
- currentSession = undefined;
50
- return ended;
51
- },
52
-
53
- getCurrentSession(): AnnotationSession | undefined {
54
- return currentSession;
55
- },
56
-
57
- // Annotation capture
58
- addAnnotation(type: AnnotationType, text: string, context: AnnotationContext): Annotation {
59
- const annotation: Annotation = {
60
- id: generateId(),
61
- timestamp: Date.now(),
62
- type,
63
- text,
64
- context,
65
- sessionId: currentSession?.id,
66
- };
67
-
68
- allAnnotations.push(annotation);
69
-
70
- if (currentSession) {
71
- currentSession.annotations.push(annotation);
72
- }
73
-
74
- return annotation;
75
- },
76
-
77
- getAnnotations(): Annotation[] {
78
- if (currentSession) {
79
- return [...currentSession.annotations];
80
- }
81
- return [...allAnnotations];
82
- },
83
-
84
- getAnnotationsByType(type: AnnotationType): Annotation[] {
85
- const source = currentSession ? currentSession.annotations : allAnnotations;
86
- return source.filter((a) => a.type === type);
87
- },
88
-
89
- // Export
90
- exportMarkdown(): string {
91
- return formatMarkdownReport(currentSession, allAnnotations);
92
- },
93
-
94
- exportJson(): string {
95
- const data = currentSession
96
- ? { session: currentSession }
97
- : { annotations: allAnnotations };
98
- return JSON.stringify(data, null, 2);
99
- },
100
-
101
- // Cleanup
102
- clear(): void {
103
- currentSession = undefined;
104
- allAnnotations = [];
105
- },
106
- };
107
- }
108
-
109
- /**
110
- * Format annotations as a markdown report (per ADR-109)
111
- */
112
- function formatMarkdownReport(
113
- session: AnnotationSession | undefined,
114
- allAnnotations: Annotation[]
115
- ): string {
116
- const annotations = session ? session.annotations : allAnnotations;
117
- const lines: string[] = [];
118
-
119
- // Header
120
- if (session) {
121
- lines.push(`# Play Test Session: ${session.name}`);
122
- lines.push(`Date: ${new Date(session.startTime).toLocaleString()}`);
123
- if (session.endTime) {
124
- const durationMs = session.endTime - session.startTime;
125
- const durationMins = Math.round(durationMs / 60000);
126
- lines.push(`Duration: ${durationMins} minutes`);
127
- }
128
- } else {
129
- lines.push('# Playtest Annotations');
130
- lines.push(`Generated: ${new Date().toLocaleString()}`);
131
- }
132
- lines.push('');
133
-
134
- // Group by type
135
- const bugs = annotations.filter((a) => a.type === 'bug');
136
- const notes = annotations.filter((a) => a.type === 'note');
137
- const confusing = annotations.filter((a) => a.type === 'confusing');
138
- const expected = annotations.filter((a) => a.type === 'expected');
139
- const bookmarks = annotations.filter((a) => a.type === 'bookmark');
140
- const comments = annotations.filter((a) => a.type === 'comment');
141
-
142
- // Bugs section
143
- if (bugs.length > 0) {
144
- lines.push(`## Bugs (${bugs.length})`);
145
- bugs.forEach((bug, i) => {
146
- lines.push(`${i + 1}. [Turn ${bug.context.turn}, ${bug.context.roomName}] "${bug.text}"`);
147
- lines.push(` - Command: ${bug.context.lastCommand}`);
148
- lines.push(` - Response: ${truncate(bug.context.lastResponse, 100)}`);
149
- lines.push('');
150
- });
151
- }
152
-
153
- // Notes section
154
- if (notes.length > 0) {
155
- lines.push(`## Notes (${notes.length})`);
156
- notes.forEach((note, i) => {
157
- lines.push(`${i + 1}. [Turn ${note.context.turn}, ${note.context.roomName}] "${note.text}"`);
158
- });
159
- lines.push('');
160
- }
161
-
162
- // Confusion points
163
- if (confusing.length > 0) {
164
- lines.push(`## Confusion Points (${confusing.length})`);
165
- confusing.forEach((c, i) => {
166
- lines.push(`${i + 1}. [Turn ${c.context.turn}, ${c.context.roomName}]`);
167
- lines.push(` - After: ${c.context.lastCommand}`);
168
- lines.push(` - Response: ${truncate(c.context.lastResponse, 100)}`);
169
- lines.push('');
170
- });
171
- }
172
-
173
- // Expected behavior
174
- if (expected.length > 0) {
175
- lines.push(`## Expected Behavior (${expected.length})`);
176
- expected.forEach((e, i) => {
177
- lines.push(`${i + 1}. [Turn ${e.context.turn}, ${e.context.roomName}]`);
178
- lines.push(` - Expected: ${e.text}`);
179
- lines.push(` - Actual: ${truncate(e.context.lastResponse, 100)}`);
180
- lines.push('');
181
- });
182
- }
183
-
184
- // Bookmarks
185
- if (bookmarks.length > 0) {
186
- lines.push(`## Bookmarks (${bookmarks.length})`);
187
- bookmarks.forEach((b, i) => {
188
- lines.push(`${i + 1}. "${b.text}" at Turn ${b.context.turn}, ${b.context.roomName}`);
189
- });
190
- lines.push('');
191
- }
192
-
193
- // Comments (silent feedback)
194
- if (comments.length > 0) {
195
- lines.push(`## Comments (${comments.length})`);
196
- comments.forEach((c, i) => {
197
- lines.push(`${i + 1}. [Turn ${c.context.turn}, ${c.context.roomName}] "${c.text}"`);
198
- });
199
- lines.push('');
200
- }
201
-
202
- // Summary stats
203
- lines.push('## Summary');
204
- lines.push(`- Total annotations: ${annotations.length}`);
205
- lines.push(`- Bugs: ${bugs.length}`);
206
- lines.push(`- Notes: ${notes.length}`);
207
- lines.push(`- Confusion points: ${confusing.length}`);
208
- lines.push(`- Bookmarks: ${bookmarks.length}`);
209
-
210
- return lines.join('\n');
211
- }
212
-
213
- /**
214
- * Truncate a string to max length
215
- */
216
- function truncate(str: string, maxLen: number): string {
217
- if (str.length <= maxLen) return str;
218
- return str.substring(0, maxLen - 3) + '...';
219
- }
@@ -1,2 +0,0 @@
1
- export { serializeCheckpoint, deserializeCheckpoint, validateCheckpoint } from './serializer.js';
2
- export { createFileStore, createMemoryStore, createLocalStorageStore } from './store.js';