@sharpee/engine 1.0.0 → 1.1.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/README.md +73 -72
- package/action-context-factory.d.ts +3 -3
- package/action-context-factory.d.ts.map +1 -1
- package/action-context-factory.js +3 -3
- package/capability-dispatch-helper.d.ts +3 -3
- package/capability-dispatch-helper.d.ts.map +1 -1
- package/capability-dispatch-helper.js +1 -1
- package/command-executor.d.ts +6 -6
- package/command-executor.d.ts.map +1 -1
- package/command-executor.js +2 -2
- package/events/event-emitter.d.ts +2 -2
- package/events/event-emitter.d.ts.map +1 -1
- package/game-engine.d.ts +7 -7
- package/game-engine.d.ts.map +1 -1
- package/game-engine.js +7 -7
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/language-provider-interface.d.ts +1 -1
- package/language-provider-interface.d.ts.map +1 -1
- package/narrative/index.d.ts.map +1 -1
- package/narrative/narrative-settings.d.ts +1 -1
- package/narrative/narrative-settings.d.ts.map +1 -1
- package/package.json +12 -12
- package/parser-interface.d.ts +2 -2
- package/parser-interface.d.ts.map +1 -1
- package/platform-operations.d.ts +2 -2
- package/platform-operations.d.ts.map +1 -1
- package/platform-operations.js +1 -1
- package/prose-pipeline/assemble.d.ts +1 -1
- package/prose-pipeline/assemble.d.ts.map +1 -1
- package/prose-pipeline/decorations/index.d.ts.map +1 -1
- package/prose-pipeline/decorations/parser.d.ts.map +1 -1
- package/prose-pipeline/decorations/parser.js +26 -8
- package/prose-pipeline/decorations/parser.js.map +1 -1
- package/prose-pipeline/decorations/platform-vocabulary.d.ts +9 -1
- package/prose-pipeline/decorations/platform-vocabulary.d.ts.map +1 -1
- package/prose-pipeline/decorations/platform-vocabulary.js +17 -1
- package/prose-pipeline/decorations/platform-vocabulary.js.map +1 -1
- package/prose-pipeline/decorations/resolver.d.ts.map +1 -1
- package/prose-pipeline/decorations/types.d.ts +1 -1
- package/prose-pipeline/decorations/types.d.ts.map +1 -1
- package/prose-pipeline/handlers/about.d.ts +2 -2
- package/prose-pipeline/handlers/about.d.ts.map +1 -1
- package/prose-pipeline/handlers/audibility.d.ts +2 -2
- package/prose-pipeline/handlers/audibility.d.ts.map +1 -1
- package/prose-pipeline/handlers/audibility.js +1 -1
- package/prose-pipeline/handlers/banner.d.ts +1 -1
- package/prose-pipeline/handlers/banner.d.ts.map +1 -1
- package/prose-pipeline/handlers/client-query.d.ts +2 -2
- package/prose-pipeline/handlers/client-query.d.ts.map +1 -1
- package/prose-pipeline/handlers/client-query.js +1 -1
- package/prose-pipeline/handlers/command-failed.d.ts +2 -2
- package/prose-pipeline/handlers/command-failed.d.ts.map +1 -1
- package/prose-pipeline/handlers/command-failed.js +1 -1
- package/prose-pipeline/handlers/domain-message.d.ts +2 -2
- package/prose-pipeline/handlers/domain-message.d.ts.map +1 -1
- package/prose-pipeline/handlers/domain-message.js +1 -1
- package/prose-pipeline/handlers/game.d.ts +2 -2
- package/prose-pipeline/handlers/game.d.ts.map +1 -1
- package/prose-pipeline/handlers/generic.d.ts +2 -2
- package/prose-pipeline/handlers/generic.d.ts.map +1 -1
- package/prose-pipeline/handlers/generic.js +1 -1
- package/prose-pipeline/handlers/help.d.ts +2 -2
- package/prose-pipeline/handlers/help.d.ts.map +1 -1
- package/prose-pipeline/handlers/implicit-take.d.ts +2 -2
- package/prose-pipeline/handlers/implicit-take.d.ts.map +1 -1
- package/prose-pipeline/handlers/implicit-take.js +1 -1
- package/prose-pipeline/handlers/index.d.ts.map +1 -1
- package/prose-pipeline/handlers/revealed.d.ts +2 -2
- package/prose-pipeline/handlers/revealed.d.ts.map +1 -1
- package/prose-pipeline/handlers/revealed.js +1 -1
- package/prose-pipeline/handlers/room.d.ts +2 -2
- package/prose-pipeline/handlers/room.d.ts.map +1 -1
- package/prose-pipeline/handlers/room.js +1 -1
- package/prose-pipeline/handlers/types.d.ts +3 -3
- package/prose-pipeline/handlers/types.d.ts.map +1 -1
- package/prose-pipeline/index.d.ts.map +1 -1
- package/prose-pipeline/pipeline.d.ts +3 -3
- package/prose-pipeline/pipeline.d.ts.map +1 -1
- package/prose-pipeline/stages/filter.d.ts +1 -1
- package/prose-pipeline/stages/filter.d.ts.map +1 -1
- package/prose-pipeline/stages/index.d.ts.map +1 -1
- package/prose-pipeline/stages/sort.d.ts +1 -1
- package/prose-pipeline/stages/sort.d.ts.map +1 -1
- package/prose-pipeline/types.d.ts +2 -2
- package/prose-pipeline/types.d.ts.map +1 -1
- package/save-restore-service.d.ts +3 -3
- package/save-restore-service.d.ts.map +1 -1
- package/save-restore-service.js +1 -1
- package/scene-evaluation-plugin.d.ts +2 -2
- package/scene-evaluation-plugin.d.ts.map +1 -1
- package/scene-evaluation-plugin.js +1 -1
- package/shared-data-keys.d.ts +3 -3
- package/shared-data-keys.d.ts.map +1 -1
- package/sound/dispatcher.d.ts +3 -3
- package/sound/dispatcher.d.ts.map +1 -1
- package/sound/dispatcher.js +2 -2
- package/sound/index.d.ts.map +1 -1
- package/sound/propagation.d.ts +3 -3
- package/sound/propagation.d.ts.map +1 -1
- package/sound/propagation.js +2 -2
- package/story.d.ts +4 -4
- package/story.d.ts.map +1 -1
- package/test-helpers/mock-prose-pipeline.d.ts +2 -2
- package/test-helpers/mock-prose-pipeline.d.ts.map +1 -1
- package/turn-event-processor.d.ts +3 -3
- package/turn-event-processor.d.ts.map +1 -1
- package/turn-event-processor.js +1 -1
- package/types.d.ts +4 -4
- package/types.d.ts.map +1 -1
- package/vocabulary-manager.d.ts +1 -1
- package/vocabulary-manager.d.ts.map +1 -1
- package/vocabulary-manager.js +1 -1
- package/event-adapter.d.ts +0 -44
- package/event-adapter.d.ts.map +0 -1
- package/event-adapter.js +0 -127
- package/event-adapter.js.map +0 -1
- package/event-sequencer.d.ts +0 -73
- package/event-sequencer.d.ts.map +0 -1
- package/event-sequencer.js +0 -134
- package/event-sequencer.js.map +0 -1
- package/test-helpers/mock-text-service.d.ts +0 -11
- package/test-helpers/mock-text-service.d.ts.map +0 -1
- package/test-helpers/mock-text-service.js +0 -47
- package/test-helpers/mock-text-service.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Runtime engine for the Sharpee IF Platform. This package provides the core game loop, command execution, and turn management.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sharpee/engine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
> **Architecture note**: The CommandExecutor is a thin orchestrator. Actions own their complete event lifecycle through the four-phase pattern (validate/execute/report/blocked, ADR-051).
|
|
6
12
|
|
|
7
13
|
## Overview
|
|
8
14
|
|
|
@@ -32,42 +38,32 @@ User Input
|
|
|
32
38
|
Turn Result
|
|
33
39
|
```
|
|
34
40
|
|
|
35
|
-
### Action
|
|
41
|
+
### Action Four-Phase Pattern
|
|
36
42
|
|
|
37
|
-
Actions follow a strict
|
|
43
|
+
Actions follow a strict four-phase pattern (ADR-051) for clean separation of concerns:
|
|
38
44
|
|
|
39
45
|
1. **Validate Phase**: Check if the action can be performed (no mutations)
|
|
40
46
|
2. **Execute Phase**: Perform state mutations only (no events)
|
|
41
47
|
3. **Report Phase**: Generate events based on final state (no mutations)
|
|
48
|
+
4. **Blocked Phase**: Generate events when validation fails
|
|
42
49
|
|
|
43
50
|
The CommandExecutor simply orchestrates these phases, delegating all responsibility to the appropriate components. Actions own their complete event lifecycle, including error events.
|
|
44
51
|
|
|
45
52
|
## Basic Usage
|
|
46
53
|
|
|
47
54
|
```typescript
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
55
|
+
import { GameEngine } from '@sharpee/engine';
|
|
56
|
+
import { EnglishParser } from '@sharpee/parser-en-us';
|
|
57
|
+
import { EnglishLanguageProvider } from '@sharpee/lang-en-us';
|
|
50
58
|
|
|
51
|
-
//
|
|
52
|
-
const
|
|
59
|
+
// Build the world and player (typically via your story's setup)
|
|
60
|
+
const language = new EnglishLanguageProvider();
|
|
61
|
+
const parser = new EnglishParser(language);
|
|
53
62
|
|
|
54
|
-
|
|
55
|
-
await engine.setLanguage('en-US');
|
|
63
|
+
const engine = new GameEngine({ world, player, parser, language });
|
|
56
64
|
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
config: {
|
|
60
|
-
id: 'my-story',
|
|
61
|
-
title: 'My Adventure',
|
|
62
|
-
author: 'Me',
|
|
63
|
-
version: '1.0.0',
|
|
64
|
-
language: 'en-US' // Language automatically loaded
|
|
65
|
-
},
|
|
66
|
-
initializeWorld: (world) => { /* ... */ },
|
|
67
|
-
createPlayer: (world) => { /* ... */ }
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
await engine.setStory(story); // Automatically sets up language
|
|
65
|
+
// Register a story (configures world, player, grammar, channels)
|
|
66
|
+
engine.setStory(story);
|
|
71
67
|
|
|
72
68
|
// Start the engine
|
|
73
69
|
engine.start();
|
|
@@ -81,30 +77,28 @@ const context = engine.getContext();
|
|
|
81
77
|
console.log(`Current turn: ${context.currentTurn}`);
|
|
82
78
|
|
|
83
79
|
// Access parser and language provider if needed
|
|
84
|
-
const
|
|
80
|
+
const activeParser = engine.getParser();
|
|
85
81
|
const languageProvider = engine.getLanguageProvider();
|
|
86
82
|
```
|
|
87
83
|
|
|
88
|
-
|
|
84
|
+
> In most cases you don't construct the engine by hand — the build toolchain and
|
|
85
|
+
> the browser/CLI clients assemble the parser, language provider, and story for
|
|
86
|
+
> you from the story's config (`language: 'en-US'`).
|
|
87
|
+
|
|
88
|
+
## Engine Configuration
|
|
89
|
+
|
|
90
|
+
The optional `config` field on the constructor options tunes engine behavior:
|
|
89
91
|
|
|
90
92
|
```typescript
|
|
91
93
|
import { GameEngine, EngineConfig } from '@sharpee/engine';
|
|
92
|
-
import { IWorldModel, IFEntity } from '@sharpee/world-model';
|
|
93
94
|
|
|
94
|
-
// Create your world
|
|
95
|
-
const world: IWorldModel = createMyWorld();
|
|
96
|
-
const player: IFEntity = createPlayer();
|
|
97
|
-
|
|
98
|
-
// Configure engine
|
|
99
95
|
const config: EngineConfig = {
|
|
100
96
|
maxHistory: 50,
|
|
101
97
|
collectTiming: true,
|
|
102
|
-
|
|
103
|
-
onError: (error, context) => console.error(`Error at turn ${context.currentTurn}:`, error)
|
|
98
|
+
validateEvents: true
|
|
104
99
|
};
|
|
105
100
|
|
|
106
|
-
|
|
107
|
-
const engine = new GameEngine(world, player, config);
|
|
101
|
+
const engine = new GameEngine({ world, player, parser, language, config });
|
|
108
102
|
|
|
109
103
|
// Listen to engine events
|
|
110
104
|
engine.on('turn:complete', (result) => {
|
|
@@ -140,7 +134,7 @@ Events are self-contained with all necessary data embedded at creation time:
|
|
|
140
134
|
|
|
141
135
|
This enables:
|
|
142
136
|
- **Historical Replay**: Events contain complete state at that moment
|
|
143
|
-
- **No World Queries**:
|
|
137
|
+
- **No World Queries**: The prose pipeline renders from embedded event data, not world lookups
|
|
144
138
|
- **Consistency**: Entity state is captured after all mutations complete
|
|
145
139
|
|
|
146
140
|
## Event Sequencing
|
|
@@ -163,20 +157,15 @@ Events are automatically sequenced within turns:
|
|
|
163
157
|
|
|
164
158
|
## Language Management
|
|
165
159
|
|
|
166
|
-
The
|
|
160
|
+
The parser and language provider are supplied to the engine at construction
|
|
161
|
+
time (see Basic Usage). A story declares which language it expects via its
|
|
162
|
+
config; the build toolchain and clients pick the matching packages by code.
|
|
167
163
|
|
|
168
164
|
```typescript
|
|
169
|
-
// Set language directly
|
|
170
|
-
await engine.setLanguage('en-US'); // Loads @sharpee/lang-en-us and @sharpee/parser-en-us
|
|
171
|
-
|
|
172
|
-
// Change language at runtime
|
|
173
|
-
await engine.setLanguage('es'); // Switches to Spanish
|
|
174
|
-
|
|
175
|
-
// Language from story config
|
|
176
165
|
const story = {
|
|
177
|
-
config: { language: '
|
|
166
|
+
config: { id: 'my-story', title: '…', language: 'en-US', /* ... */ },
|
|
167
|
+
// ...
|
|
178
168
|
};
|
|
179
|
-
await engine.setStory(story); // Automatically uses Japanese
|
|
180
169
|
```
|
|
181
170
|
|
|
182
171
|
### Naming Convention
|
|
@@ -192,33 +181,44 @@ For example:
|
|
|
192
181
|
|
|
193
182
|
## Save/Load
|
|
194
183
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
localStorage.setItem('save', JSON.stringify(saveData));
|
|
184
|
+
Save and restore are driven by platform events and host-supplied hooks rather
|
|
185
|
+
than direct method calls. The host (CLI, browser client, server) registers
|
|
186
|
+
hooks that persist and reload the engine's save data:
|
|
199
187
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
188
|
+
```typescript
|
|
189
|
+
engine.registerSaveRestoreHooks({
|
|
190
|
+
onSaveRequested: async (saveData) => {
|
|
191
|
+
localStorage.setItem('save', JSON.stringify(saveData));
|
|
192
|
+
},
|
|
193
|
+
onRestoreRequested: async () => {
|
|
194
|
+
const raw = localStorage.getItem('save');
|
|
195
|
+
return raw ? JSON.parse(raw) : null;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
203
198
|
```
|
|
204
199
|
|
|
200
|
+
The standard `save` / `restore` meta-actions emit the platform events that
|
|
201
|
+
trigger these hooks.
|
|
202
|
+
|
|
205
203
|
## Integration with Story Files
|
|
206
204
|
|
|
207
|
-
The engine
|
|
205
|
+
The engine works with TypeScript story files implementing the `Story` interface:
|
|
208
206
|
|
|
209
207
|
```typescript
|
|
210
208
|
// my-story.ts
|
|
211
|
-
import { Story } from '@sharpee/
|
|
212
|
-
|
|
213
|
-
export
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
209
|
+
import { Story, StoryConfig } from '@sharpee/engine';
|
|
210
|
+
|
|
211
|
+
export const story: Story = {
|
|
212
|
+
config: {
|
|
213
|
+
id: 'my-story',
|
|
214
|
+
title: 'My Adventure',
|
|
215
|
+
author: 'Me',
|
|
216
|
+
version: '1.0.0',
|
|
217
|
+
language: 'en-US'
|
|
218
|
+
},
|
|
219
|
+
initializeWorld(world) { /* create rooms, objects, NPCs */ },
|
|
220
|
+
createPlayer(world) { /* create and place the player */ }
|
|
221
|
+
};
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
## API Reference
|
|
@@ -226,18 +226,16 @@ export default new Story()
|
|
|
226
226
|
### GameEngine
|
|
227
227
|
|
|
228
228
|
- `start()`: Start the engine
|
|
229
|
-
- `stop()`: Stop the engine
|
|
230
|
-
- `executeTurn(input: string)`: Execute a turn with user input
|
|
229
|
+
- `stop(reason?)`: Stop the engine
|
|
230
|
+
- `executeTurn(input: string)`: Execute a turn with user input (async)
|
|
231
231
|
- `getContext()`: Get current game context
|
|
232
232
|
- `getWorld()`: Get world model
|
|
233
|
-
- `saveState()`: Save game state
|
|
234
|
-
- `loadState(state)`: Load game state
|
|
235
233
|
- `getHistory()`: Get turn history
|
|
236
234
|
- `getRecentEvents(count)`: Get recent events
|
|
237
|
-
- `
|
|
238
|
-
- `setStory(story: Story)`: Set story (automatically configures language from story config)
|
|
235
|
+
- `setStory(story: Story)`: Register a story (configures world, player, grammar, channels)
|
|
239
236
|
- `getParser()`: Get current parser instance
|
|
240
237
|
- `getLanguageProvider()`: Get current language provider instance
|
|
238
|
+
- `registerSaveRestoreHooks(hooks)`: Register save/restore persistence hooks
|
|
241
239
|
|
|
242
240
|
### Events
|
|
243
241
|
|
|
@@ -305,7 +303,6 @@ The engine package includes comprehensive test coverage:
|
|
|
305
303
|
- `command-executor.test.ts` - Command parsing and execution
|
|
306
304
|
- `event-sequencer.test.ts` - Event ordering and utilities
|
|
307
305
|
- `story.test.ts` - Story interface and configuration
|
|
308
|
-
- `text-service.test.ts` - Text output formatting
|
|
309
306
|
- `types.test.ts` - Type definitions and contracts
|
|
310
307
|
|
|
311
308
|
### Integration Tests
|
|
@@ -326,3 +323,7 @@ pnpm test game-engine
|
|
|
326
323
|
# Generate coverage report
|
|
327
324
|
pnpm test:coverage
|
|
328
325
|
```
|
|
326
|
+
|
|
327
|
+
## License
|
|
328
|
+
|
|
329
|
+
MIT
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Action Context Factory - Creates ActionContext for action execution
|
|
3
3
|
*/
|
|
4
|
-
import { ActionContext, Action, ScopeResolver, ValidatedCommand } from
|
|
5
|
-
import { WorldModel } from
|
|
6
|
-
import { ISound } from
|
|
4
|
+
import { ActionContext, Action, ScopeResolver, ValidatedCommand } from '@sharpee/stdlib';
|
|
5
|
+
import { WorldModel } from '@sharpee/world-model';
|
|
6
|
+
import { ISound } from '@sharpee/if-domain';
|
|
7
7
|
import { GameContext } from './types';
|
|
8
8
|
/**
|
|
9
9
|
* Create an ActionContext for action execution.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-context-factory.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"action-context-factory.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/action-context-factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAA+E,MAAM,iBAAiB,CAAC;AACtK,OAAO,EAAE,UAAU,EAAuB,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA+CtC;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,aAAa,CAuQf"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createActionContext = createActionContext;
|
|
7
|
-
const stdlib_1 = require("
|
|
8
|
-
const world_model_1 = require("
|
|
9
|
-
const core_1 = require("
|
|
7
|
+
const stdlib_1 = require("@sharpee/stdlib");
|
|
8
|
+
const world_model_1 = require("@sharpee/world-model");
|
|
9
|
+
const core_1 = require("@sharpee/core");
|
|
10
10
|
const shared_data_keys_1 = require("./shared-data-keys");
|
|
11
11
|
/**
|
|
12
12
|
* Helper to get entity from command slot
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* - all-must-pass: All entities must return valid: true
|
|
17
17
|
* - highest-priority: Only highest priority entity is checked
|
|
18
18
|
*/
|
|
19
|
-
import { ISemanticEvent } from
|
|
20
|
-
import { IFEntity, CapabilityBehavior, CapabilitySharedData, ITrait, CapabilityResolution } from
|
|
21
|
-
import { ActionContext, ValidationResult } from
|
|
19
|
+
import { ISemanticEvent } from '@sharpee/core';
|
|
20
|
+
import { IFEntity, CapabilityBehavior, CapabilitySharedData, ITrait, CapabilityResolution } from '@sharpee/world-model';
|
|
21
|
+
import { ActionContext, ValidationResult } from '@sharpee/stdlib';
|
|
22
22
|
/**
|
|
23
23
|
* A single capability claim from an entity.
|
|
24
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-dispatch-helper.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"capability-dispatch-helper.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/capability-dispatch-helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,QAAQ,EAKR,kBAAkB,EAClB,oBAAoB,EAEpB,MAAM,EAEN,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAU,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,eAAe;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CACtC,OAAO,EAAE,aAAa,GACrB,IAAI,CAUN;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,aAAa,GACrB,cAAc,EAAE,CAgBlB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,GACf,cAAc,EAAE,CAwBlB"}
|
|
@@ -24,7 +24,7 @@ exports.executeCapabilityValidate = executeCapabilityValidate;
|
|
|
24
24
|
exports.executeCapabilityExecute = executeCapabilityExecute;
|
|
25
25
|
exports.executeCapabilityReport = executeCapabilityReport;
|
|
26
26
|
exports.executeCapabilityBlocked = executeCapabilityBlocked;
|
|
27
|
-
const world_model_1 = require("
|
|
27
|
+
const world_model_1 = require("@sharpee/world-model");
|
|
28
28
|
/**
|
|
29
29
|
* Check if capability dispatch should be used for this action and target.
|
|
30
30
|
*
|
package/command-executor.d.ts
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All event creation is owned by the action components themselves.
|
|
11
11
|
*/
|
|
12
|
-
import { ISystemEvent, IGenericEventSource, Result } from
|
|
13
|
-
import { IParser, IValidatedCommand, IParsedCommand, IValidationError } from
|
|
14
|
-
import { ISound } from
|
|
15
|
-
import { WorldModel } from
|
|
16
|
-
import { EventProcessor } from
|
|
17
|
-
import { ActionRegistry } from
|
|
12
|
+
import { ISystemEvent, IGenericEventSource, Result } from '@sharpee/core';
|
|
13
|
+
import { IParser, IValidatedCommand, IParsedCommand, IValidationError } from '@sharpee/world-model';
|
|
14
|
+
import { ISound } from '@sharpee/if-domain';
|
|
15
|
+
import { WorldModel } from '@sharpee/world-model';
|
|
16
|
+
import { EventProcessor } from '@sharpee/event-processor';
|
|
17
|
+
import { ActionRegistry } from '@sharpee/stdlib';
|
|
18
18
|
import { GameContext, TurnResult, EngineConfig } from './types';
|
|
19
19
|
/**
|
|
20
20
|
* Data passed to pre-action hook listeners (ADR-148).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-executor.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"command-executor.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/command-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAkB,YAAY,EAAE,mBAAmB,EAA0B,MAAM,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAEL,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAWhE;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;AAE/F;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,UAAU,KACd,cAAc,CAAC;AAEpB,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,aAAa,CAAC,CAAgB;IACtC,OAAO,CAAC,yBAAyB,CAAkC;IACnE,OAAO,CAAC,qBAAqB,CAAkC;gBAG7D,KAAK,EAAE,UAAU,EACjB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,OAAO,EACf,YAAY,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC;IAgBlD;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;IAIrF;;;;;OAKG;IACH,gCAAgC,CAAC,WAAW,EAAE,wBAAwB,GAAG,IAAI;IAI7E;;;;;OAKG;IACH,kCAAkC,CAAC,WAAW,EAAE,wBAAwB,GAAG,OAAO;IASlF;;;;;;;OAOG;IACH,cAAc,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IAIxD;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMlB,OAAO,CACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,YAAY,EACrB,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,UAAU,CAAC;CAsTvB;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,UAAU,EACjB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,OAAO,EACf,YAAY,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,GAC/C,eAAe,CAEjB"}
|
package/command-executor.js
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.CommandExecutor = void 0;
|
|
15
15
|
exports.createCommandExecutor = createCommandExecutor;
|
|
16
|
-
const core_1 = require("
|
|
16
|
+
const core_1 = require("@sharpee/core");
|
|
17
17
|
const parser_interface_1 = require("./parser-interface");
|
|
18
18
|
const shared_data_keys_1 = require("./shared-data-keys");
|
|
19
|
-
const stdlib_1 = require("
|
|
19
|
+
const stdlib_1 = require("@sharpee/stdlib");
|
|
20
20
|
const action_context_factory_1 = require("./action-context-factory");
|
|
21
21
|
const capability_dispatch_helper_1 = require("./capability-dispatch-helper");
|
|
22
22
|
class CommandExecutor {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Event emitter for managing game events
|
|
3
3
|
*/
|
|
4
|
-
import { ISemanticEvent } from
|
|
5
|
-
import { IGameEvent, SimpleEventHandler } from
|
|
4
|
+
import { ISemanticEvent } from '@sharpee/core';
|
|
5
|
+
import { IGameEvent, SimpleEventHandler } from '@sharpee/world-model';
|
|
6
6
|
/**
|
|
7
7
|
* Simple event emitter for the game event system
|
|
8
8
|
* Used for story-level event handlers (daemons)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/events/event-emitter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEtE;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAgD;IAEhE;;OAEG;IACH,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAMxD;;OAEG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAUzD;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,EAAE;IAczC;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ/B;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;CAGzC"}
|
package/game-engine.d.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Manages game state, turn execution, and coordinates all subsystems
|
|
5
5
|
*/
|
|
6
|
-
import { WorldModel, IFEntity } from
|
|
7
|
-
import { EventProcessor } from
|
|
8
|
-
import { Parser, IPerceptionService } from
|
|
9
|
-
import { LanguageProvider, ClientCapabilities, CmgtPacket, TurnPacket } from
|
|
6
|
+
import { WorldModel, IFEntity } from '@sharpee/world-model';
|
|
7
|
+
import { EventProcessor } from '@sharpee/event-processor';
|
|
8
|
+
import { Parser, IPerceptionService } from '@sharpee/stdlib';
|
|
9
|
+
import { LanguageProvider, ClientCapabilities, CmgtPacket, TurnPacket } from '@sharpee/if-domain';
|
|
10
10
|
import { ITextService } from './prose-pipeline';
|
|
11
|
-
import { ITextBlock } from
|
|
12
|
-
import { ISemanticEvent, ISaveRestoreHooks, ISemanticEventSource } from
|
|
13
|
-
import { PluginRegistry } from
|
|
11
|
+
import { ITextBlock } from '@sharpee/text-blocks';
|
|
12
|
+
import { ISemanticEvent, ISaveRestoreHooks, ISemanticEventSource } from '@sharpee/core';
|
|
13
|
+
import { PluginRegistry } from '@sharpee/plugins';
|
|
14
14
|
import { GameContext, TurnResult, EngineConfig, InputModeHandler, EngineIntrospection } from './types';
|
|
15
15
|
import { Story } from './story';
|
|
16
16
|
import { NarrativeSettings } from './narrative';
|
package/game-engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-engine.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"game-engine.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/game-engine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,UAAU,EACV,QAAQ,EAYT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,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K,EAAE,CAAC,EACR,QAAQ,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACnC,IAAI;CAQR"}
|
package/game-engine.js
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.GameEngine = exports.DEFAULT_TEXT_CAPABILITIES = void 0;
|
|
9
|
-
const world_model_1 = require("
|
|
10
|
-
const event_processor_1 = require("
|
|
11
|
-
const stdlib_1 = require("
|
|
9
|
+
const world_model_1 = require("@sharpee/world-model");
|
|
10
|
+
const event_processor_1 = require("@sharpee/event-processor");
|
|
11
|
+
const stdlib_1 = require("@sharpee/stdlib");
|
|
12
12
|
const prose_pipeline_1 = require("./prose-pipeline");
|
|
13
|
-
const text_blocks_1 = require("
|
|
14
|
-
const channel_service_1 = require("
|
|
15
|
-
const core_1 = require("
|
|
16
|
-
const plugins_1 = require("
|
|
13
|
+
const text_blocks_1 = require("@sharpee/text-blocks");
|
|
14
|
+
const channel_service_1 = require("@sharpee/channel-service");
|
|
15
|
+
const core_1 = require("@sharpee/core");
|
|
16
|
+
const plugins_1 = require("@sharpee/plugins");
|
|
17
17
|
const scene_evaluation_plugin_1 = require("./scene-evaluation-plugin");
|
|
18
18
|
const types_1 = require("./types");
|
|
19
19
|
const narrative_1 = require("./narrative");
|
package/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export * from './capability-dispatch-helper';
|
|
|
14
14
|
export * from './parser-interface';
|
|
15
15
|
export * from './shared-data-keys';
|
|
16
16
|
export * from './game-engine';
|
|
17
|
-
export { PluginRegistry, TurnPlugin, TurnPluginContext } from
|
|
17
|
+
export { PluginRegistry, TurnPlugin, TurnPluginContext } from '@sharpee/plugins';
|
|
18
18
|
export { SceneEvaluationPlugin } from './scene-evaluation-plugin';
|
|
19
19
|
export * from './vocabulary-manager';
|
|
20
20
|
export * from './save-restore-service';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACtB,MAAM,oBAAoB,CAAC"}
|
package/index.js
CHANGED
|
@@ -40,7 +40,7 @@ __exportStar(require("./shared-data-keys"), exports);
|
|
|
40
40
|
// Main engine
|
|
41
41
|
__exportStar(require("./game-engine"), exports);
|
|
42
42
|
// Plugin system (ADR-120)
|
|
43
|
-
var plugins_1 = require("
|
|
43
|
+
var plugins_1 = require("@sharpee/plugins");
|
|
44
44
|
Object.defineProperty(exports, "PluginRegistry", { enumerable: true, get: function () { return plugins_1.PluginRegistry; } });
|
|
45
45
|
// Scene evaluation (ADR-149)
|
|
46
46
|
var scene_evaluation_plugin_1 = require("./scene-evaluation-plugin");
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* retrieval. This interface extends it with optional methods the engine can use
|
|
6
6
|
* when available, following the same type-guard pattern as parser-interface.ts.
|
|
7
7
|
*/
|
|
8
|
-
import type { LanguageProvider } from
|
|
8
|
+
import type { LanguageProvider } from '@sharpee/if-domain';
|
|
9
9
|
import type { NarrativeSettings } from './narrative';
|
|
10
10
|
/**
|
|
11
11
|
* Extended language provider interface for engine integration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-provider-interface.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"language-provider-interface.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/language-provider-interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;IACpE;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,GACzB,QAAQ,IAAI,4BAA4B,GAAG;IAC5C,oBAAoB,EAAE,WAAW,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,CAAC,CAAC;CACzF,CAKA"}
|
package/narrative/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/narrative/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ADR-089 Phase C: Defines how the story narrates player actions.
|
|
5
5
|
* Stories can be written in 1st, 2nd, or 3rd person perspective.
|
|
6
6
|
*/
|
|
7
|
-
import { PronounSet } from
|
|
7
|
+
import { PronounSet } from '@sharpee/world-model';
|
|
8
8
|
/**
|
|
9
9
|
* Narrative perspective for player actions
|
|
10
10
|
* - '1st': "I take the lamp" (rare, Anchorhead-style)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrative-settings.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"narrative-settings.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/narrative/narrative-settings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEhD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,WAAW,EAAE,WAAW,CAAC;IAEzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAGxC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAMlF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharpee/engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Runtime engine for Sharpee IF Platform - game loop, command execution, and turn management",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@sharpee/channel-service": "^1.
|
|
16
|
-
"@sharpee/core": "^1.
|
|
17
|
-
"@sharpee/event-processor": "^1.
|
|
18
|
-
"@sharpee/plugins": "^1.
|
|
19
|
-
"@sharpee/if-domain": "^1.
|
|
20
|
-
"@sharpee/if-services": "^1.
|
|
21
|
-
"@sharpee/lang-en-us": "^1.
|
|
22
|
-
"@sharpee/parser-en-us": "^1.
|
|
23
|
-
"@sharpee/stdlib": "^1.
|
|
24
|
-
"@sharpee/text-blocks": "^1.
|
|
25
|
-
"@sharpee/world-model": "^1.
|
|
15
|
+
"@sharpee/channel-service": "^1.1.0",
|
|
16
|
+
"@sharpee/core": "^1.1.0",
|
|
17
|
+
"@sharpee/event-processor": "^1.1.0",
|
|
18
|
+
"@sharpee/plugins": "^1.1.0",
|
|
19
|
+
"@sharpee/if-domain": "^1.1.0",
|
|
20
|
+
"@sharpee/if-services": "^1.1.0",
|
|
21
|
+
"@sharpee/lang-en-us": "^1.1.0",
|
|
22
|
+
"@sharpee/parser-en-us": "^1.1.0",
|
|
23
|
+
"@sharpee/stdlib": "^1.1.0",
|
|
24
|
+
"@sharpee/text-blocks": "^1.1.0",
|
|
25
|
+
"@sharpee/world-model": "^1.1.0",
|
|
26
26
|
"fflate": "^0.8.2"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
package/parser-interface.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This interface extends it with optional methods that the engine can use when
|
|
6
6
|
* available, replacing duck-typing with proper type guards.
|
|
7
7
|
*/
|
|
8
|
-
import type { IParser, IValidatedCommand, WorldModel } from
|
|
9
|
-
import type { ISemanticEvent } from
|
|
8
|
+
import type { IParser, IValidatedCommand, WorldModel } from '@sharpee/world-model';
|
|
9
|
+
import type { ISemanticEvent } from '@sharpee/core';
|
|
10
10
|
/**
|
|
11
11
|
* Extended parser interface for engine integration.
|
|
12
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser-interface.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"parser-interface.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/parser-interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD;;;;;;;;OAQG;IACH,eAAe,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpF;;;;;OAKG;IACH,uBAAuB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IAEvF;;;;;;;OAOG;IACH,oBAAoB,CAAC,CAAC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5E;;;OAGG;IACH,mBAAmB,CAAC,IAAI,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,CAOjF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,GAAG;IAAE,eAAe,EAAE,WAAW,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAA;CAAE,CAEvJ;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,GAAG;IACjF,oBAAoB,EAAE,WAAW,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAC9E,mBAAmB,EAAE,WAAW,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC,CAAC;CAC7E,CAOA;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,GAAG;IACvF,uBAAuB,EAAE,WAAW,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC,CAAC;CACrF,CAKA"}
|
package/platform-operations.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Extracted from GameEngine as part of Phase 4 remediation.
|
|
5
5
|
* Uses strategy pattern to handle different platform operation types.
|
|
6
6
|
*/
|
|
7
|
-
import { IPlatformEvent, ISemanticEvent, ISemanticEventSource, ISaveRestoreHooks } from
|
|
8
|
-
import type { IParser } from
|
|
7
|
+
import { IPlatformEvent, ISemanticEvent, ISemanticEventSource, ISaveRestoreHooks } from '@sharpee/core';
|
|
8
|
+
import type { IParser } from '@sharpee/world-model';
|
|
9
9
|
import { SaveRestoreService, ISaveRestoreStateProvider } from './save-restore-service';
|
|
10
10
|
import { VocabularyManager } from './vocabulary-manager';
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-operations.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-operations.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/platform-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EAalB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kB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AEG;YACW,aAAa;IAkC3B;;OAEG;YACW,UAAU;IAqBxB;;OAEG;YACW,aAAa;IAmC3B;;OAEG;IACH,OAAO,CAAC,UAAU;IAkBlB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAmBzB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,iBAAiB,GAAG,SAAS,EAC/C,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,yBAAyB,EACxC,iBAAiB,EAAE,iBAAiB,GACnC,wBAAwB,CAO1B"}
|
package/platform-operations.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.PlatformOperationHandler = void 0;
|
|
10
10
|
exports.createPlatformOperationHandler = createPlatformOperationHandler;
|
|
11
|
-
const core_1 = require("
|
|
11
|
+
const core_1 = require("@sharpee/core");
|
|
12
12
|
const parser_interface_1 = require("./parser-interface");
|
|
13
13
|
/**
|
|
14
14
|
* Handler for platform operations
|