@sharpee/if-services 1.1.1 → 1.5.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/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/perception-service.d.ts +23 -0
- package/perception-service.d.ts.map +1 -1
- package/perception-service.js +6 -0
- package/perception-service.js.map +1 -1
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee_v1/packages/if-services/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,sBAAsB,CAAC"}
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/sharpee_v1/packages/if-services/src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,gCAAgC;AAChC,uDAAqC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharpee/if-services",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Runtime service interfaces for Sharpee Interactive Fiction Platform",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@sharpee/core": "^1.
|
|
9
|
-
"@sharpee/if-domain": "^1.
|
|
10
|
-
"@sharpee/world-model": "^1.
|
|
8
|
+
"@sharpee/core": "^1.5.0",
|
|
9
|
+
"@sharpee/if-domain": "^1.5.0",
|
|
10
|
+
"@sharpee/world-model": "^1.5.0"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"sharpee",
|
package/perception-service.d.ts
CHANGED
|
@@ -14,6 +14,29 @@ import type { IFEntity, IWorldModel } from '@sharpee/world-model';
|
|
|
14
14
|
* Sense types for perception checks
|
|
15
15
|
*/
|
|
16
16
|
export type Sense = 'sight' | 'hearing' | 'smell' | 'touch';
|
|
17
|
+
/**
|
|
18
|
+
* A single per-sense rendering of a witnessable fact: the message ID to render
|
|
19
|
+
* and the parameters that fill its template.
|
|
20
|
+
*
|
|
21
|
+
* @see ADR-069 amendment — Per-sense rendering selection
|
|
22
|
+
*/
|
|
23
|
+
export interface Rendering {
|
|
24
|
+
messageId: string;
|
|
25
|
+
params: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The per-sense renderings carried by a witnessable event's `data.renderings`.
|
|
29
|
+
*
|
|
30
|
+
* The emitter (e.g. NpcService) populates the senses it produces; PerceptionService
|
|
31
|
+
* selects one by the perceiver's available sense. Absent ⇒ not a witnessable fact
|
|
32
|
+
* (pass through). Present-but-empty `{}` ⇒ perceptible by nothing (blocked).
|
|
33
|
+
*/
|
|
34
|
+
export type PerSenseRenderings = Partial<Record<Sense, Rendering>>;
|
|
35
|
+
/**
|
|
36
|
+
* Fixed selection precedence for renderings — independent of map key order.
|
|
37
|
+
* A new `Sense` must declare its rank here.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SENSE_PRECEDENCE: readonly Sense[];
|
|
17
40
|
/**
|
|
18
41
|
* Reasons why perception might be blocked
|
|
19
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perception-service.d.ts","sourceRoot":"","sources":["../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"perception-service.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee_v1/packages/if-services/src/perception-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAA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
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SENSE_PRECEDENCE = void 0;
|
|
14
|
+
/**
|
|
15
|
+
* Fixed selection precedence for renderings — independent of map key order.
|
|
16
|
+
* A new `Sense` must declare its rank here.
|
|
17
|
+
*/
|
|
18
|
+
exports.SENSE_PRECEDENCE = ['sight', 'hearing', 'smell', 'touch'];
|
|
13
19
|
//# sourceMappingURL=perception-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perception-service.js","sourceRoot":"","sources":["../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"perception-service.js","sourceRoot":"","sources":["../../../../../../repos/sharpee_v1/packages/if-services/src/perception-service.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA8BH;;;GAGG;AACU,QAAA,gBAAgB,GAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC"}
|