@sharpee/character 1.0.8 → 1.1.1

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 (2) hide show
  1. package/README.md +54 -0
  2. package/package.json +4 -4
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @sharpee/character
2
+
3
+ Character model builder for the Sharpee Interactive Fiction platform (ADR-141).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @sharpee/character
9
+ ```
10
+
11
+ ## Overview
12
+
13
+ A fluent builder API for defining NPCs with rich internal state. Authors describe a character in words; the builder compiles to `CharacterModelTrait` data consumed by `@sharpee/world-model`:
14
+
15
+ - **`CharacterBuilder`** - Personality, mood, threat level, dispositions, knowledge/beliefs, cognitive profile, and custom predicates.
16
+ - **Triggers** - `.on(event)` chains (`TriggerBuilder`) compile to state mutations like mood shifts and disposition changes.
17
+ - **Cognitive presets** - `COGNITIVE_PRESETS` and `VocabularyExtension` for custom moods and personalities.
18
+ - **`applyCharacter()`** - Attaches the compiled character to an entity and returns the trait plus behavior config.
19
+ - **Behavior systems** - Conversation (ADR-142), information propagation (ADR-144), goal pursuit (ADR-145), and influence (ADR-146), each with its own builder and tick-phase handler.
20
+
21
+ ## Usage
22
+
23
+ ```typescript
24
+ import { CharacterBuilder, applyCharacter } from '@sharpee/character';
25
+ import { ThreatLevel } from '@sharpee/world-model';
26
+
27
+ const guard = new CharacterBuilder('castle-guard')
28
+ .personality('very honest', 'cowardly')
29
+ .mood('wary')
30
+ .threat(ThreatLevel.NONE)
31
+ .loyalTo('king')
32
+ .distrusts('player')
33
+ .knows('the postern gate is unlocked', { witnessed: true })
34
+ .on('player threatens')
35
+ .becomes('panicked')
36
+ .feelsAbout('player', 'afraid of')
37
+ .shift('threat', ThreatLevel.HIGH)
38
+ .done()
39
+ .compile();
40
+
41
+ // Attach to the NPC entity in your world initializer
42
+ const applied = applyCharacter(guardEntity, guard);
43
+ // applied.trait, applied.goalDefs, applied.influenceDefs, …
44
+ ```
45
+
46
+ ## Related Packages
47
+
48
+ - [@sharpee/world-model](https://www.npmjs.com/package/@sharpee/world-model) - Hosts `CharacterModelTrait` and the personality/mood/threat types
49
+ - [@sharpee/stdlib](https://www.npmjs.com/package/@sharpee/stdlib) - Standard actions NPCs interact with
50
+ - [@sharpee/sharpee](https://www.npmjs.com/package/@sharpee/sharpee) - Full platform bundle
51
+
52
+ ## License
53
+
54
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharpee/character",
3
- "version": "1.0.8",
3
+ "version": "1.1.1",
4
4
  "description": "Character model builder for Sharpee Interactive Fiction Platform (ADR-141)",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -12,9 +12,9 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@sharpee/core": "^1.0.8",
16
- "@sharpee/world-model": "^1.0.8",
17
- "@sharpee/stdlib": "^1.0.8"
15
+ "@sharpee/core": "^1.1.1",
16
+ "@sharpee/world-model": "^1.1.1",
17
+ "@sharpee/stdlib": "^1.1.1"
18
18
  },
19
19
  "keywords": [
20
20
  "interactive-fiction",