@sharpee/helpers 0.9.103

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/augment.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * IWorldModel augmentation — adds helpers() method via declaration merging.
3
+ *
4
+ * Importing this module (or any re-export of it) patches WorldModel.prototype
5
+ * with a helpers() method that returns pre-bound entity builder functions.
6
+ *
7
+ * This follows the same pattern as @sharpee/media extending EventDataRegistry.
8
+ *
9
+ * Owner context: @sharpee/helpers (ADR-140)
10
+ */
11
+ import { EntityHelpers } from './create-helpers';
12
+ declare module '@sharpee/world-model' {
13
+ interface WorldModel {
14
+ /** Get fluent entity builder functions bound to this world. */
15
+ helpers(): EntityHelpers;
16
+ }
17
+ }
18
+ //# sourceMappingURL=augment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augment.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/helpers/src/augment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAiB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKhE,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,UAAU;QAClB,+DAA+D;QAC/D,OAAO,IAAI,aAAa,CAAC;KAC1B;CACF"}
package/augment.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * IWorldModel augmentation — adds helpers() method via declaration merging.
4
+ *
5
+ * Importing this module (or any re-export of it) patches WorldModel.prototype
6
+ * with a helpers() method that returns pre-bound entity builder functions.
7
+ *
8
+ * This follows the same pattern as @sharpee/media extending EventDataRegistry.
9
+ *
10
+ * Owner context: @sharpee/helpers (ADR-140)
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ const world_model_1 = require("../world-model/index.js");
14
+ const create_helpers_1 = require("./create-helpers");
15
+ // Patch WorldModel.prototype at import time
16
+ world_model_1.WorldModel.prototype.helpers = function () {
17
+ return (0, create_helpers_1.createHelpers)(this);
18
+ };
19
+ //# sourceMappingURL=augment.js.map
package/augment.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augment.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/augment.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAEH,sDAAkD;AAClD,qDAAgE;AAYhE,4CAA4C;AAC3C,wBAAU,CAAC,SAAiB,CAAC,OAAO,GAAG;IACtC,OAAO,IAAA,8BAAa,EAAC,IAA6D,CAAC,CAAC;AACtF,CAAC,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * ActorBuilder — fluent builder for actor entities.
3
+ *
4
+ * Public interface: description, aliases, properName, inventory, in,
5
+ * skipValidation, build.
6
+ *
7
+ * Owner context: @sharpee/helpers (ADR-140)
8
+ */
9
+ import { IFEntity } from "../../world-model/index";
10
+ import type { IWorldModel } from "../../world-model/index";
11
+ /**
12
+ * Fluent builder for creating actor entities (players and NPCs).
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const player = actor('yourself')
17
+ * .description('As good-looking as ever.')
18
+ * .aliases('self', 'me', 'myself')
19
+ * .properName()
20
+ * .inventory({ maxItems: 10 })
21
+ * .build();
22
+ * ```
23
+ */
24
+ export declare class ActorBuilder {
25
+ private world;
26
+ private name;
27
+ private _description?;
28
+ private _aliases?;
29
+ private _properName;
30
+ private _inventory?;
31
+ private _location?;
32
+ private _skipValidation;
33
+ constructor(world: IWorldModel, name: string);
34
+ /**
35
+ * Set the actor description.
36
+ *
37
+ * @param desc - Actor description text
38
+ * @returns this (for chaining)
39
+ */
40
+ description(desc: string): this;
41
+ /**
42
+ * Add name aliases.
43
+ *
44
+ * @param names - Alternative names
45
+ * @returns this (for chaining)
46
+ */
47
+ aliases(...names: string[]): this;
48
+ /**
49
+ * Mark as a proper name (no article).
50
+ *
51
+ * @returns this (for chaining)
52
+ */
53
+ properName(): this;
54
+ /**
55
+ * Add inventory capacity (adds ContainerTrait).
56
+ *
57
+ * @param opts - Inventory options
58
+ * @returns this (for chaining)
59
+ */
60
+ inventory(opts?: {
61
+ maxItems?: number;
62
+ }): this;
63
+ /**
64
+ * Place the actor in a location.
65
+ *
66
+ * @param location - The entity to place this actor in
67
+ * @returns this (for chaining)
68
+ */
69
+ in(location: IFEntity): this;
70
+ /**
71
+ * Bypass validation for placement.
72
+ *
73
+ * @returns this (for chaining)
74
+ */
75
+ skipValidation(): this;
76
+ /**
77
+ * Create the actor entity with configured traits.
78
+ *
79
+ * @returns The created IFEntity
80
+ */
81
+ build(): IFEntity;
82
+ }
83
+ //# sourceMappingURL=actor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/builders/actor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,QAAQ,EAKT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAY;IASrB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,IAAI;IATd,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAC,CAAwB;IAC3C,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,OAAO,CAAC,eAAe,CAAS;gBAGtB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM;IAGtB;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAKjC;;;;OAIG;IACH,UAAU,IAAI,IAAI;IAKlB;;;;;OAKG;IACH,SAAS,CAAC,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAKjD;;;;;OAKG;IACH,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAK5B;;;;OAIG;IACH,cAAc,IAAI,IAAI;IAKtB;;;;OAIG;IACH,KAAK,IAAI,QAAQ;CA0BlB"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ /**
3
+ * ActorBuilder — fluent builder for actor entities.
4
+ *
5
+ * Public interface: description, aliases, properName, inventory, in,
6
+ * skipValidation, build.
7
+ *
8
+ * Owner context: @sharpee/helpers (ADR-140)
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.ActorBuilder = void 0;
12
+ const world_model_1 = require("../../world-model/index.js");
13
+ /**
14
+ * Fluent builder for creating actor entities (players and NPCs).
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const player = actor('yourself')
19
+ * .description('As good-looking as ever.')
20
+ * .aliases('self', 'me', 'myself')
21
+ * .properName()
22
+ * .inventory({ maxItems: 10 })
23
+ * .build();
24
+ * ```
25
+ */
26
+ class ActorBuilder {
27
+ world;
28
+ name;
29
+ _description;
30
+ _aliases;
31
+ _properName = false;
32
+ _inventory;
33
+ _location;
34
+ _skipValidation = false;
35
+ constructor(world, name) {
36
+ this.world = world;
37
+ this.name = name;
38
+ }
39
+ /**
40
+ * Set the actor description.
41
+ *
42
+ * @param desc - Actor description text
43
+ * @returns this (for chaining)
44
+ */
45
+ description(desc) {
46
+ this._description = desc;
47
+ return this;
48
+ }
49
+ /**
50
+ * Add name aliases.
51
+ *
52
+ * @param names - Alternative names
53
+ * @returns this (for chaining)
54
+ */
55
+ aliases(...names) {
56
+ this._aliases = names;
57
+ return this;
58
+ }
59
+ /**
60
+ * Mark as a proper name (no article).
61
+ *
62
+ * @returns this (for chaining)
63
+ */
64
+ properName() {
65
+ this._properName = true;
66
+ return this;
67
+ }
68
+ /**
69
+ * Add inventory capacity (adds ContainerTrait).
70
+ *
71
+ * @param opts - Inventory options
72
+ * @returns this (for chaining)
73
+ */
74
+ inventory(opts = {}) {
75
+ this._inventory = opts;
76
+ return this;
77
+ }
78
+ /**
79
+ * Place the actor in a location.
80
+ *
81
+ * @param location - The entity to place this actor in
82
+ * @returns this (for chaining)
83
+ */
84
+ in(location) {
85
+ this._location = location;
86
+ return this;
87
+ }
88
+ /**
89
+ * Bypass validation for placement.
90
+ *
91
+ * @returns this (for chaining)
92
+ */
93
+ skipValidation() {
94
+ this._skipValidation = true;
95
+ return this;
96
+ }
97
+ /**
98
+ * Create the actor entity with configured traits.
99
+ *
100
+ * @returns The created IFEntity
101
+ */
102
+ build() {
103
+ const entity = this.world.createEntity(this.name, 'actor');
104
+ entity.add(new world_model_1.ActorTrait());
105
+ entity.add(new world_model_1.IdentityTrait({
106
+ name: this.name,
107
+ description: this._description,
108
+ aliases: this._aliases,
109
+ properName: this._properName,
110
+ article: this._properName ? '' : undefined,
111
+ }));
112
+ if (this._inventory) {
113
+ entity.add(new world_model_1.ContainerTrait({
114
+ capacity: this._inventory.maxItems ? { maxItems: this._inventory.maxItems } : undefined,
115
+ }));
116
+ }
117
+ if (this._location) {
118
+ const mover = this._skipValidation
119
+ ? new world_model_1.AuthorModel(this.world.getDataStore(), this.world)
120
+ : this.world;
121
+ mover.moveEntity(entity.id, this._location.id);
122
+ }
123
+ return entity;
124
+ }
125
+ }
126
+ exports.ActorBuilder = ActorBuilder;
127
+ //# sourceMappingURL=actor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actor.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/helpers/src/builders/actor.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,sDAM8B;AAG9B;;;;;;;;;;;;GAYG;AACH,MAAa,YAAY;IASb;IACA;IATF,YAAY,CAAU;IACtB,QAAQ,CAAY;IACpB,WAAW,GAAG,KAAK,CAAC;IACpB,UAAU,CAAyB;IACnC,SAAS,CAAY;IACrB,eAAe,GAAG,KAAK,CAAC;IAEhC,YACU,KAAkB,EAClB,IAAY;QADZ,UAAK,GAAL,KAAK,CAAa;QAClB,SAAI,GAAJ,IAAI,CAAQ;IACnB,CAAC;IAEJ;;;;;OAKG;IACH,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAe;QACxB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,UAAU;QACR,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,OAA8B,EAAE;QACxC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,EAAE,CAAC,QAAkB;QACnB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,cAAc;QACZ,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3D,MAAM,CAAC,GAAG,CAAC,IAAI,wBAAU,EAAE,CAAC,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SAC3C,CAAC,CAAC,CAAC;QAEJ,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,CAAC,GAAG,CAAC,IAAI,4BAAc,CAAC;gBAC5B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;aACxF,CAAC,CAAC,CAAC;QACN,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe;gBAChC,CAAC,CAAC,IAAI,yBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC;gBACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5GD,oCA4GC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * ContainerBuilder — fluent builder for container entities.
3
+ *
4
+ * Public interface: description, aliases, in, openable, lockable,
5
+ * skipValidation, build.
6
+ *
7
+ * Owner context: @sharpee/helpers (ADR-140)
8
+ */
9
+ import { IFEntity } from "../../world-model/index";
10
+ import type { IWorldModel } from "../../world-model/index";
11
+ /**
12
+ * Fluent builder for creating container entities.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const chest = container('wooden chest')
17
+ * .description('A sturdy wooden chest.')
18
+ * .openable({ isOpen: false })
19
+ * .lockable({ isLocked: true, keyId: key.id })
20
+ * .in(treasureRoom)
21
+ * .build();
22
+ * ```
23
+ */
24
+ export declare class ContainerBuilder {
25
+ private world;
26
+ private name;
27
+ private _description?;
28
+ private _aliases?;
29
+ private _location?;
30
+ private _openable?;
31
+ private _lockable?;
32
+ private _skipValidation;
33
+ constructor(world: IWorldModel, name: string);
34
+ /**
35
+ * Set the container description.
36
+ *
37
+ * @param desc - Container description text
38
+ * @returns this (for chaining)
39
+ */
40
+ description(desc: string): this;
41
+ /**
42
+ * Add name aliases.
43
+ *
44
+ * @param names - Alternative names
45
+ * @returns this (for chaining)
46
+ */
47
+ aliases(...names: string[]): this;
48
+ /**
49
+ * Place the container in a location.
50
+ *
51
+ * @param location - The entity to place this container in
52
+ * @returns this (for chaining)
53
+ */
54
+ in(location: IFEntity): this;
55
+ /**
56
+ * Make the container openable.
57
+ *
58
+ * @param opts - Openable options
59
+ * @returns this (for chaining)
60
+ */
61
+ openable(opts?: {
62
+ isOpen?: boolean;
63
+ }): this;
64
+ /**
65
+ * Make the container lockable.
66
+ *
67
+ * @param opts - Lockable options
68
+ * @returns this (for chaining)
69
+ */
70
+ lockable(opts?: {
71
+ isLocked?: boolean;
72
+ keyId?: string;
73
+ }): this;
74
+ /**
75
+ * Bypass validation for placement.
76
+ *
77
+ * @returns this (for chaining)
78
+ */
79
+ skipValidation(): this;
80
+ /**
81
+ * Create the container entity with configured traits.
82
+ *
83
+ * @returns The created IFEntity
84
+ */
85
+ build(): IFEntity;
86
+ }
87
+ //# sourceMappingURL=container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/builders/container.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,QAAQ,EAMT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;IASzB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,IAAI;IATd,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,OAAO,CAAC,SAAS,CAAC,CAAuB;IACzC,OAAO,CAAC,SAAS,CAAC,CAAyC;IAC3D,OAAO,CAAC,eAAe,CAAS;gBAGtB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM;IAGtB;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAKjC;;;;;OAKG;IACH,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAK5B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAK/C;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAKjE;;;;OAIG;IACH,cAAc,IAAI,IAAI;IAKtB;;;;OAIG;IACH,KAAK,IAAI,QAAQ;CA6BlB"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ /**
3
+ * ContainerBuilder — fluent builder for container entities.
4
+ *
5
+ * Public interface: description, aliases, in, openable, lockable,
6
+ * skipValidation, build.
7
+ *
8
+ * Owner context: @sharpee/helpers (ADR-140)
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.ContainerBuilder = void 0;
12
+ const world_model_1 = require("../../world-model/index.js");
13
+ /**
14
+ * Fluent builder for creating container entities.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const chest = container('wooden chest')
19
+ * .description('A sturdy wooden chest.')
20
+ * .openable({ isOpen: false })
21
+ * .lockable({ isLocked: true, keyId: key.id })
22
+ * .in(treasureRoom)
23
+ * .build();
24
+ * ```
25
+ */
26
+ class ContainerBuilder {
27
+ world;
28
+ name;
29
+ _description;
30
+ _aliases;
31
+ _location;
32
+ _openable;
33
+ _lockable;
34
+ _skipValidation = false;
35
+ constructor(world, name) {
36
+ this.world = world;
37
+ this.name = name;
38
+ }
39
+ /**
40
+ * Set the container description.
41
+ *
42
+ * @param desc - Container description text
43
+ * @returns this (for chaining)
44
+ */
45
+ description(desc) {
46
+ this._description = desc;
47
+ return this;
48
+ }
49
+ /**
50
+ * Add name aliases.
51
+ *
52
+ * @param names - Alternative names
53
+ * @returns this (for chaining)
54
+ */
55
+ aliases(...names) {
56
+ this._aliases = names;
57
+ return this;
58
+ }
59
+ /**
60
+ * Place the container in a location.
61
+ *
62
+ * @param location - The entity to place this container in
63
+ * @returns this (for chaining)
64
+ */
65
+ in(location) {
66
+ this._location = location;
67
+ return this;
68
+ }
69
+ /**
70
+ * Make the container openable.
71
+ *
72
+ * @param opts - Openable options
73
+ * @returns this (for chaining)
74
+ */
75
+ openable(opts = {}) {
76
+ this._openable = opts;
77
+ return this;
78
+ }
79
+ /**
80
+ * Make the container lockable.
81
+ *
82
+ * @param opts - Lockable options
83
+ * @returns this (for chaining)
84
+ */
85
+ lockable(opts = {}) {
86
+ this._lockable = opts;
87
+ return this;
88
+ }
89
+ /**
90
+ * Bypass validation for placement.
91
+ *
92
+ * @returns this (for chaining)
93
+ */
94
+ skipValidation() {
95
+ this._skipValidation = true;
96
+ return this;
97
+ }
98
+ /**
99
+ * Create the container entity with configured traits.
100
+ *
101
+ * @returns The created IFEntity
102
+ */
103
+ build() {
104
+ const entity = this.world.createEntity(this.name, 'object');
105
+ entity.add(new world_model_1.IdentityTrait({
106
+ name: this.name,
107
+ description: this._description,
108
+ aliases: this._aliases,
109
+ }));
110
+ entity.add(new world_model_1.ContainerTrait());
111
+ if (this._openable) {
112
+ entity.add(new world_model_1.OpenableTrait({ isOpen: this._openable.isOpen ?? true }));
113
+ }
114
+ if (this._lockable) {
115
+ entity.add(new world_model_1.LockableTrait({
116
+ isLocked: this._lockable.isLocked ?? false,
117
+ ...(this._lockable.keyId ? { requiredKey: this._lockable.keyId } : {}),
118
+ }));
119
+ }
120
+ if (this._location) {
121
+ const mover = this._skipValidation
122
+ ? new world_model_1.AuthorModel(this.world.getDataStore(), this.world)
123
+ : this.world;
124
+ mover.moveEntity(entity.id, this._location.id);
125
+ }
126
+ return entity;
127
+ }
128
+ }
129
+ exports.ContainerBuilder = ContainerBuilder;
130
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/helpers/src/builders/container.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,sDAO8B;AAG9B;;;;;;;;;;;;GAYG;AACH,MAAa,gBAAgB;IASjB;IACA;IATF,YAAY,CAAU;IACtB,QAAQ,CAAY;IACpB,SAAS,CAAY;IACrB,SAAS,CAAwB;IACjC,SAAS,CAA0C;IACnD,eAAe,GAAG,KAAK,CAAC;IAEhC,YACU,KAAkB,EAClB,IAAY;QADZ,UAAK,GAAL,KAAK,CAAa;QAClB,SAAI,GAAJ,IAAI,CAAQ;IACnB,CAAC;IAEJ;;;;;OAKG;IACH,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAe;QACxB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,EAAE,CAAC,QAAkB;QACnB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,OAA6B,EAAE;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,OAA+C,EAAE;QACxD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,cAAc;QACZ,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5D,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC,CAAC;QACJ,MAAM,CAAC,GAAG,CAAC,IAAI,4BAAc,EAAE,CAAC,CAAC;QAEjC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC;gBAC3B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,KAAK;gBAC1C,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACvE,CAAC,CAAC,CAAC;QACN,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe;gBAChC,CAAC,CAAC,IAAI,yBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC;gBACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAhHD,4CAgHC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * DoorBuilder — fluent builder for door entities.
3
+ *
4
+ * Public interface: description, aliases, between, openable, lockable, build.
5
+ *
6
+ * Owner context: @sharpee/helpers (ADR-140)
7
+ */
8
+ import { IFEntity } from "../../world-model/index";
9
+ import type { IWorldModel } from "../../world-model/index";
10
+ import type { DirectionType } from "../../world-model/index";
11
+ /**
12
+ * Fluent builder for creating door entities.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const ironDoor = door('iron door')
17
+ * .description('A heavy iron door.')
18
+ * .between(room1, room2, Direction.NORTH)
19
+ * .openable({ isOpen: false })
20
+ * .lockable({ isLocked: true, keyId: ironKey.id })
21
+ * .build();
22
+ * ```
23
+ */
24
+ export declare class DoorBuilder {
25
+ private world;
26
+ private name;
27
+ private _description?;
28
+ private _aliases?;
29
+ private _room1?;
30
+ private _room2?;
31
+ private _direction?;
32
+ private _openable?;
33
+ private _lockable?;
34
+ constructor(world: IWorldModel, name: string);
35
+ /**
36
+ * Set the door description.
37
+ *
38
+ * @param desc - Door description text
39
+ * @returns this (for chaining)
40
+ */
41
+ description(desc: string): this;
42
+ /**
43
+ * Add name aliases.
44
+ *
45
+ * @param names - Alternative names
46
+ * @returns this (for chaining)
47
+ */
48
+ aliases(...names: string[]): this;
49
+ /**
50
+ * Set the two rooms the door connects and the direction from room1 to room2.
51
+ *
52
+ * @param room1 - First room entity
53
+ * @param room2 - Second room entity
54
+ * @param direction - Direction from room1 to room2
55
+ * @returns this (for chaining)
56
+ */
57
+ between(room1: IFEntity, room2: IFEntity, direction: DirectionType): this;
58
+ /**
59
+ * Make the door openable.
60
+ *
61
+ * @param opts - Openable options
62
+ * @returns this (for chaining)
63
+ */
64
+ openable(opts?: {
65
+ isOpen?: boolean;
66
+ }): this;
67
+ /**
68
+ * Make the door lockable.
69
+ *
70
+ * @param opts - Lockable options
71
+ * @returns this (for chaining)
72
+ */
73
+ lockable(opts?: {
74
+ isLocked?: boolean;
75
+ keyId?: string;
76
+ }): this;
77
+ /**
78
+ * Create the door entity with configured traits and wire room exits.
79
+ *
80
+ * @returns The created IFEntity
81
+ * @throws Error if between() was not called
82
+ */
83
+ build(): IFEntity;
84
+ }
85
+ //# sourceMappingURL=door.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"door.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/builders/door.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAOT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,qBAAa,WAAW;IAUpB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,IAAI;IAVd,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,MAAM,CAAC,CAAW;IAC1B,OAAO,CAAC,MAAM,CAAC,CAAW;IAC1B,OAAO,CAAC,UAAU,CAAC,CAAgB;IACnC,OAAO,CAAC,SAAS,CAAC,CAAuB;IACzC,OAAO,CAAC,SAAS,CAAC,CAAyC;gBAGjD,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM;IAGtB;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAKjC;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,GAAG,IAAI;IAOzE;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAK/C;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAKjE;;;;;OAKG;IACH,KAAK,IAAI,QAAQ;CAmClB"}
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ /**
3
+ * DoorBuilder — fluent builder for door entities.
4
+ *
5
+ * Public interface: description, aliases, between, openable, lockable, build.
6
+ *
7
+ * Owner context: @sharpee/helpers (ADR-140)
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.DoorBuilder = void 0;
11
+ const world_model_1 = require("../../world-model/index.js");
12
+ const world_model_2 = require("../../world-model/index.js");
13
+ /**
14
+ * Fluent builder for creating door entities.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const ironDoor = door('iron door')
19
+ * .description('A heavy iron door.')
20
+ * .between(room1, room2, Direction.NORTH)
21
+ * .openable({ isOpen: false })
22
+ * .lockable({ isLocked: true, keyId: ironKey.id })
23
+ * .build();
24
+ * ```
25
+ */
26
+ class DoorBuilder {
27
+ world;
28
+ name;
29
+ _description;
30
+ _aliases;
31
+ _room1;
32
+ _room2;
33
+ _direction;
34
+ _openable;
35
+ _lockable;
36
+ constructor(world, name) {
37
+ this.world = world;
38
+ this.name = name;
39
+ }
40
+ /**
41
+ * Set the door description.
42
+ *
43
+ * @param desc - Door description text
44
+ * @returns this (for chaining)
45
+ */
46
+ description(desc) {
47
+ this._description = desc;
48
+ return this;
49
+ }
50
+ /**
51
+ * Add name aliases.
52
+ *
53
+ * @param names - Alternative names
54
+ * @returns this (for chaining)
55
+ */
56
+ aliases(...names) {
57
+ this._aliases = names;
58
+ return this;
59
+ }
60
+ /**
61
+ * Set the two rooms the door connects and the direction from room1 to room2.
62
+ *
63
+ * @param room1 - First room entity
64
+ * @param room2 - Second room entity
65
+ * @param direction - Direction from room1 to room2
66
+ * @returns this (for chaining)
67
+ */
68
+ between(room1, room2, direction) {
69
+ this._room1 = room1;
70
+ this._room2 = room2;
71
+ this._direction = direction;
72
+ return this;
73
+ }
74
+ /**
75
+ * Make the door openable.
76
+ *
77
+ * @param opts - Openable options
78
+ * @returns this (for chaining)
79
+ */
80
+ openable(opts = {}) {
81
+ this._openable = opts;
82
+ return this;
83
+ }
84
+ /**
85
+ * Make the door lockable.
86
+ *
87
+ * @param opts - Lockable options
88
+ * @returns this (for chaining)
89
+ */
90
+ lockable(opts = {}) {
91
+ this._lockable = opts;
92
+ return this;
93
+ }
94
+ /**
95
+ * Create the door entity with configured traits and wire room exits.
96
+ *
97
+ * @returns The created IFEntity
98
+ * @throws Error if between() was not called
99
+ */
100
+ build() {
101
+ if (!this._room1 || !this._room2 || !this._direction) {
102
+ throw new Error('DoorBuilder: .between(room1, room2, direction) is required before .build()');
103
+ }
104
+ const entity = this.world.createEntity(this.name, 'door');
105
+ entity.add(new world_model_1.IdentityTrait({
106
+ name: this.name,
107
+ description: this._description,
108
+ aliases: this._aliases,
109
+ }));
110
+ entity.add(new world_model_1.DoorTrait({
111
+ room1: this._room1.id,
112
+ room2: this._room2.id,
113
+ }));
114
+ entity.add(new world_model_1.SceneryTrait());
115
+ entity.add(new world_model_1.OpenableTrait({ isOpen: this._openable?.isOpen ?? false }));
116
+ if (this._lockable) {
117
+ entity.add(new world_model_1.LockableTrait({
118
+ isLocked: this._lockable.isLocked ?? true,
119
+ ...(this._lockable.keyId ? { requiredKey: this._lockable.keyId } : {}),
120
+ }));
121
+ }
122
+ // Wire exits through the door
123
+ const opposite = (0, world_model_2.getOppositeDirection)(this._direction);
124
+ world_model_1.RoomBehavior.setExit(this._room1, this._direction, this._room2.id, entity.id);
125
+ world_model_1.RoomBehavior.setExit(this._room2, opposite, this._room1.id, entity.id);
126
+ // Place door in room1 for scope resolution
127
+ this.world.moveEntity(entity.id, this._room1.id);
128
+ return entity;
129
+ }
130
+ }
131
+ exports.DoorBuilder = DoorBuilder;
132
+ //# sourceMappingURL=door.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"door.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/helpers/src/builders/door.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,sDAQ8B;AAE9B,sDAA4D;AAG5D;;;;;;;;;;;;GAYG;AACH,MAAa,WAAW;IAUZ;IACA;IAVF,YAAY,CAAU;IACtB,QAAQ,CAAY;IACpB,MAAM,CAAY;IAClB,MAAM,CAAY;IAClB,UAAU,CAAiB;IAC3B,SAAS,CAAwB;IACjC,SAAS,CAA0C;IAE3D,YACU,KAAkB,EAClB,IAAY;QADZ,UAAK,GAAL,KAAK,CAAa;QAClB,SAAI,GAAJ,IAAI,CAAQ;IACnB,CAAC;IAEJ;;;;;OAKG;IACH,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAe;QACxB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,KAAe,EAAE,KAAe,EAAE,SAAwB;QAChE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,OAA6B,EAAE;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,OAA+C,EAAE;QACxD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAChG,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC,CAAC;QACJ,MAAM,CAAC,GAAG,CAAC,IAAI,uBAAS,CAAC;YACvB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;YACrB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;SACtB,CAAC,CAAC,CAAC;QACJ,MAAM,CAAC,GAAG,CAAC,IAAI,0BAAY,EAAE,CAAC,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC;QAE3E,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC;gBAC3B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,IAAI;gBACzC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACvE,CAAC,CAAC,CAAC;QACN,CAAC;QAED,8BAA8B;QAC9B,MAAM,QAAQ,GAAG,IAAA,kCAAoB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvD,0BAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9E,0BAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QAEvE,2CAA2C;QAC3C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAEjD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAlHD,kCAkHC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * ObjectBuilder — fluent builder for object entities.
3
+ *
4
+ * Public interface: description, aliases, in, scenery, lightSource,
5
+ * skipValidation, build.
6
+ *
7
+ * Owner context: @sharpee/helpers (ADR-140)
8
+ */
9
+ import { IFEntity } from "../../world-model/index";
10
+ import type { IWorldModel } from "../../world-model/index";
11
+ /**
12
+ * Fluent builder for creating object entities.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const knife = object('bread knife')
17
+ * .description('A sharp bread knife.')
18
+ * .aliases('knife', 'blade')
19
+ * .in(kitchen)
20
+ * .build();
21
+ * ```
22
+ */
23
+ export declare class ObjectBuilder {
24
+ private world;
25
+ private name;
26
+ private _description?;
27
+ private _aliases?;
28
+ private _location?;
29
+ private _scenery;
30
+ private _lightSource?;
31
+ private _skipValidation;
32
+ constructor(world: IWorldModel, name: string);
33
+ /**
34
+ * Set the object description.
35
+ *
36
+ * @param desc - Object description text
37
+ * @returns this (for chaining)
38
+ */
39
+ description(desc: string): this;
40
+ /**
41
+ * Add name aliases for the object.
42
+ *
43
+ * @param names - Alternative names
44
+ * @returns this (for chaining)
45
+ */
46
+ aliases(...names: string[]): this;
47
+ /**
48
+ * Place the object in a location.
49
+ *
50
+ * @param location - The entity to place this object in
51
+ * @returns this (for chaining)
52
+ */
53
+ in(location: IFEntity): this;
54
+ /**
55
+ * Mark as scenery (non-portable).
56
+ *
57
+ * @returns this (for chaining)
58
+ */
59
+ scenery(): this;
60
+ /**
61
+ * Add light source trait.
62
+ *
63
+ * @param opts - Light source options
64
+ * @returns this (for chaining)
65
+ */
66
+ lightSource(opts?: {
67
+ isLit?: boolean;
68
+ fuelTurns?: number;
69
+ }): this;
70
+ /**
71
+ * Bypass validation for placement (e.g., placing in closed containers).
72
+ * Internally wraps the world in an AuthorModel.
73
+ *
74
+ * @returns this (for chaining)
75
+ */
76
+ skipValidation(): this;
77
+ /**
78
+ * Create the object entity with configured traits.
79
+ *
80
+ * @returns The created IFEntity
81
+ */
82
+ build(): IFEntity;
83
+ }
84
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/builders/object.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,QAAQ,EAKT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;IAStB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,IAAI;IATd,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAC,CAA0C;IAC/D,OAAO,CAAC,eAAe,CAAS;gBAGtB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM;IAGtB;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAKjC;;;;;OAKG;IACH,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAK5B;;;;OAIG;IACH,OAAO,IAAI,IAAI;IAKf;;;;;OAKG;IACH,WAAW,CAAC,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAKrE;;;;;OAKG;IACH,cAAc,IAAI,IAAI;IAKtB;;;;OAIG;IACH,KAAK,IAAI,QAAQ;CAyBlB"}
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ /**
3
+ * ObjectBuilder — fluent builder for object entities.
4
+ *
5
+ * Public interface: description, aliases, in, scenery, lightSource,
6
+ * skipValidation, build.
7
+ *
8
+ * Owner context: @sharpee/helpers (ADR-140)
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.ObjectBuilder = void 0;
12
+ const world_model_1 = require("../../world-model/index.js");
13
+ /**
14
+ * Fluent builder for creating object entities.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const knife = object('bread knife')
19
+ * .description('A sharp bread knife.')
20
+ * .aliases('knife', 'blade')
21
+ * .in(kitchen)
22
+ * .build();
23
+ * ```
24
+ */
25
+ class ObjectBuilder {
26
+ world;
27
+ name;
28
+ _description;
29
+ _aliases;
30
+ _location;
31
+ _scenery = false;
32
+ _lightSource;
33
+ _skipValidation = false;
34
+ constructor(world, name) {
35
+ this.world = world;
36
+ this.name = name;
37
+ }
38
+ /**
39
+ * Set the object description.
40
+ *
41
+ * @param desc - Object description text
42
+ * @returns this (for chaining)
43
+ */
44
+ description(desc) {
45
+ this._description = desc;
46
+ return this;
47
+ }
48
+ /**
49
+ * Add name aliases for the object.
50
+ *
51
+ * @param names - Alternative names
52
+ * @returns this (for chaining)
53
+ */
54
+ aliases(...names) {
55
+ this._aliases = names;
56
+ return this;
57
+ }
58
+ /**
59
+ * Place the object in a location.
60
+ *
61
+ * @param location - The entity to place this object in
62
+ * @returns this (for chaining)
63
+ */
64
+ in(location) {
65
+ this._location = location;
66
+ return this;
67
+ }
68
+ /**
69
+ * Mark as scenery (non-portable).
70
+ *
71
+ * @returns this (for chaining)
72
+ */
73
+ scenery() {
74
+ this._scenery = true;
75
+ return this;
76
+ }
77
+ /**
78
+ * Add light source trait.
79
+ *
80
+ * @param opts - Light source options
81
+ * @returns this (for chaining)
82
+ */
83
+ lightSource(opts = {}) {
84
+ this._lightSource = opts;
85
+ return this;
86
+ }
87
+ /**
88
+ * Bypass validation for placement (e.g., placing in closed containers).
89
+ * Internally wraps the world in an AuthorModel.
90
+ *
91
+ * @returns this (for chaining)
92
+ */
93
+ skipValidation() {
94
+ this._skipValidation = true;
95
+ return this;
96
+ }
97
+ /**
98
+ * Create the object entity with configured traits.
99
+ *
100
+ * @returns The created IFEntity
101
+ */
102
+ build() {
103
+ const entity = this.world.createEntity(this.name, 'object');
104
+ entity.add(new world_model_1.IdentityTrait({
105
+ name: this.name,
106
+ description: this._description,
107
+ aliases: this._aliases,
108
+ }));
109
+ if (this._scenery) {
110
+ entity.add(new world_model_1.SceneryTrait());
111
+ }
112
+ if (this._lightSource) {
113
+ entity.add(new world_model_1.LightSourceTrait(this._lightSource));
114
+ }
115
+ if (this._location) {
116
+ const mover = this._skipValidation
117
+ ? new world_model_1.AuthorModel(this.world.getDataStore(), this.world)
118
+ : this.world;
119
+ mover.moveEntity(entity.id, this._location.id);
120
+ }
121
+ return entity;
122
+ }
123
+ }
124
+ exports.ObjectBuilder = ObjectBuilder;
125
+ //# sourceMappingURL=object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/helpers/src/builders/object.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,sDAM8B;AAG9B;;;;;;;;;;;GAWG;AACH,MAAa,aAAa;IASd;IACA;IATF,YAAY,CAAU;IACtB,QAAQ,CAAY;IACpB,SAAS,CAAY;IACrB,QAAQ,GAAG,KAAK,CAAC;IACjB,YAAY,CAA2C;IACvD,eAAe,GAAG,KAAK,CAAC;IAEhC,YACU,KAAkB,EAClB,IAAY;QADZ,UAAK,GAAL,KAAK,CAAa;QAClB,SAAI,GAAJ,IAAI,CAAQ;IACnB,CAAC;IAEJ;;;;;OAKG;IACH,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAe;QACxB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,EAAE,CAAC,QAAkB;QACnB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,OAAgD,EAAE;QAC5D,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,cAAc;QACZ,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5D,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC,CAAC;QAEJ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,IAAI,0BAAY,EAAE,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,IAAI,8BAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe;gBAChC,CAAC,CAAC,IAAI,yBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC;gBACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5GD,sCA4GC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * RoomBuilder — fluent builder for room entities.
3
+ *
4
+ * Public interface: description, aliases, dark, build.
5
+ *
6
+ * Owner context: @sharpee/helpers (ADR-140)
7
+ */
8
+ import { IFEntity } from "../../world-model/index";
9
+ import type { IWorldModel } from "../../world-model/index";
10
+ /**
11
+ * Fluent builder for creating room entities.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const kitchen = room('Kitchen')
16
+ * .description('A warm kitchen.')
17
+ * .build();
18
+ * ```
19
+ */
20
+ export declare class RoomBuilder {
21
+ private world;
22
+ private name;
23
+ private _description?;
24
+ private _aliases?;
25
+ private _isDark;
26
+ constructor(world: IWorldModel, name: string);
27
+ /**
28
+ * Set the room description.
29
+ *
30
+ * @param desc - Room description text
31
+ * @returns this (for chaining)
32
+ */
33
+ description(desc: string): this;
34
+ /**
35
+ * Add name aliases for the room.
36
+ *
37
+ * @param names - Alternative names
38
+ * @returns this (for chaining)
39
+ */
40
+ aliases(...names: string[]): this;
41
+ /**
42
+ * Mark the room as dark (requires a light source to see).
43
+ *
44
+ * @returns this (for chaining)
45
+ */
46
+ dark(): this;
47
+ /**
48
+ * Create the room entity with configured traits.
49
+ *
50
+ * @returns The created IFEntity
51
+ */
52
+ build(): IFEntity;
53
+ }
54
+ //# sourceMappingURL=room.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/builders/room.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAGT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;GASG;AACH,qBAAa,WAAW;IAMpB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,IAAI;IANd,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,OAAO,CAAS;gBAGd,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM;IAGtB;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAKjC;;;;OAIG;IACH,IAAI,IAAI,IAAI;IAKZ;;;;OAIG;IACH,KAAK,IAAI,QAAQ;CAUlB"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /**
3
+ * RoomBuilder — fluent builder for room entities.
4
+ *
5
+ * Public interface: description, aliases, dark, build.
6
+ *
7
+ * Owner context: @sharpee/helpers (ADR-140)
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.RoomBuilder = void 0;
11
+ const world_model_1 = require("../../world-model/index.js");
12
+ /**
13
+ * Fluent builder for creating room entities.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const kitchen = room('Kitchen')
18
+ * .description('A warm kitchen.')
19
+ * .build();
20
+ * ```
21
+ */
22
+ class RoomBuilder {
23
+ world;
24
+ name;
25
+ _description;
26
+ _aliases;
27
+ _isDark = false;
28
+ constructor(world, name) {
29
+ this.world = world;
30
+ this.name = name;
31
+ }
32
+ /**
33
+ * Set the room description.
34
+ *
35
+ * @param desc - Room description text
36
+ * @returns this (for chaining)
37
+ */
38
+ description(desc) {
39
+ this._description = desc;
40
+ return this;
41
+ }
42
+ /**
43
+ * Add name aliases for the room.
44
+ *
45
+ * @param names - Alternative names
46
+ * @returns this (for chaining)
47
+ */
48
+ aliases(...names) {
49
+ this._aliases = names;
50
+ return this;
51
+ }
52
+ /**
53
+ * Mark the room as dark (requires a light source to see).
54
+ *
55
+ * @returns this (for chaining)
56
+ */
57
+ dark() {
58
+ this._isDark = true;
59
+ return this;
60
+ }
61
+ /**
62
+ * Create the room entity with configured traits.
63
+ *
64
+ * @returns The created IFEntity
65
+ */
66
+ build() {
67
+ const entity = this.world.createEntity(this.name, 'room');
68
+ entity.add(new world_model_1.RoomTrait({ isDark: this._isDark }));
69
+ entity.add(new world_model_1.IdentityTrait({
70
+ name: this.name,
71
+ description: this._description,
72
+ aliases: this._aliases,
73
+ }));
74
+ return entity;
75
+ }
76
+ }
77
+ exports.RoomBuilder = RoomBuilder;
78
+ //# sourceMappingURL=room.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/helpers/src/builders/room.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,sDAI8B;AAG9B;;;;;;;;;GASG;AACH,MAAa,WAAW;IAMZ;IACA;IANF,YAAY,CAAU;IACtB,QAAQ,CAAY;IACpB,OAAO,GAAG,KAAK,CAAC;IAExB,YACU,KAAkB,EAClB,IAAY;QADZ,UAAK,GAAL,KAAK,CAAa;QAClB,SAAI,GAAJ,IAAI,CAAQ;IACnB,CAAC;IAEJ;;;;;OAKG;IACH,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAe;QACxB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,IAAI;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,CAAC,GAAG,CAAC,IAAI,uBAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,GAAG,CAAC,IAAI,2BAAa,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC,CAAC;QACJ,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAzDD,kCAyDC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * createHelpers — factory that binds a world reference and returns
3
+ * all entity builder functions.
4
+ *
5
+ * Public interface: createHelpers(world) => EntityHelpers
6
+ *
7
+ * Owner context: @sharpee/helpers (ADR-140)
8
+ */
9
+ import type { IWorldModel } from "../world-model/index";
10
+ import { RoomBuilder } from './builders/room';
11
+ import { ObjectBuilder } from './builders/object';
12
+ import { ContainerBuilder } from './builders/container';
13
+ import { ActorBuilder } from './builders/actor';
14
+ import { DoorBuilder } from './builders/door';
15
+ /**
16
+ * The set of builder factories returned by world.helpers().
17
+ */
18
+ export interface EntityHelpers {
19
+ /** Create a room entity */
20
+ room(name: string): RoomBuilder;
21
+ /** Create an object entity */
22
+ object(name: string): ObjectBuilder;
23
+ /** Create a container entity */
24
+ container(name: string): ContainerBuilder;
25
+ /** Create an actor entity (player or NPC) */
26
+ actor(name: string): ActorBuilder;
27
+ /** Create a door entity */
28
+ door(name: string): DoorBuilder;
29
+ }
30
+ /**
31
+ * Create a set of entity builder functions bound to a world reference.
32
+ *
33
+ * @param world - The IWorldModel to create entities in
34
+ * @returns EntityHelpers with all builder factories
35
+ */
36
+ export declare function createHelpers(world: IWorldModel): EntityHelpers;
37
+ //# sourceMappingURL=create-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-helpers.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/helpers/src/create-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAChC,8BAA8B;IAC9B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;IACpC,gCAAgC;IAChC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAC1C,6CAA6C;IAC7C,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAClC,2BAA2B;IAC3B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,CAQ/D"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * createHelpers — factory that binds a world reference and returns
4
+ * all entity builder functions.
5
+ *
6
+ * Public interface: createHelpers(world) => EntityHelpers
7
+ *
8
+ * Owner context: @sharpee/helpers (ADR-140)
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.createHelpers = createHelpers;
12
+ const room_1 = require("./builders/room");
13
+ const object_1 = require("./builders/object");
14
+ const container_1 = require("./builders/container");
15
+ const actor_1 = require("./builders/actor");
16
+ const door_1 = require("./builders/door");
17
+ /**
18
+ * Create a set of entity builder functions bound to a world reference.
19
+ *
20
+ * @param world - The IWorldModel to create entities in
21
+ * @returns EntityHelpers with all builder factories
22
+ */
23
+ function createHelpers(world) {
24
+ return {
25
+ room: (name) => new room_1.RoomBuilder(world, name),
26
+ object: (name) => new object_1.ObjectBuilder(world, name),
27
+ container: (name) => new container_1.ContainerBuilder(world, name),
28
+ actor: (name) => new actor_1.ActorBuilder(world, name),
29
+ door: (name) => new door_1.DoorBuilder(world, name),
30
+ };
31
+ }
32
+ //# sourceMappingURL=create-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-helpers.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/create-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AA+BH,sCAQC;AApCD,0CAA8C;AAC9C,8CAAkD;AAClD,oDAAwD;AACxD,4CAAgD;AAChD,0CAA8C;AAkB9C;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAAkB;IAC9C,OAAO;QACL,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,kBAAW,CAAC,KAAK,EAAE,IAAI,CAAC;QACpD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,sBAAa,CAAC,KAAK,EAAE,IAAI,CAAC;QACxD,SAAS,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,4BAAgB,CAAC,KAAK,EAAE,IAAI,CAAC;QAC9D,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,oBAAY,CAAC,KAAK,EAAE,IAAI,CAAC;QACtD,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,kBAAW,CAAC,KAAK,EAAE,IAAI,CAAC;KACrD,CAAC;AACJ,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @sharpee/helpers — Fluent entity builder helpers for the Sharpee IF platform.
3
+ *
4
+ * Public interface: Importing this module activates world.helpers() via
5
+ * declaration merging on IWorldModel. Also exports createHelpers() and
6
+ * EntityHelpers for direct use.
7
+ *
8
+ * Owner context: @sharpee/helpers (ADR-140)
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import '@sharpee/helpers';
13
+ *
14
+ * initializeWorld(world: WorldModel): void {
15
+ * const { room, object, actor } = world.helpers();
16
+ *
17
+ * const kitchen = room('Kitchen')
18
+ * .description('A warm kitchen.')
19
+ * .build();
20
+ * }
21
+ * ```
22
+ */
23
+ import './augment';
24
+ export { createHelpers, EntityHelpers } from './create-helpers';
25
+ export { RoomBuilder } from './builders/room';
26
+ export { ObjectBuilder } from './builders/object';
27
+ export { ContainerBuilder } from './builders/container';
28
+ export { ActorBuilder } from './builders/actor';
29
+ export { DoorBuilder } from './builders/door';
30
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/helpers/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,WAAW,CAAC;AAGnB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
package/index.js ADDED
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * @sharpee/helpers — Fluent entity builder helpers for the Sharpee IF platform.
4
+ *
5
+ * Public interface: Importing this module activates world.helpers() via
6
+ * declaration merging on IWorldModel. Also exports createHelpers() and
7
+ * EntityHelpers for direct use.
8
+ *
9
+ * Owner context: @sharpee/helpers (ADR-140)
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import "./index.js";
14
+ *
15
+ * initializeWorld(world: WorldModel): void {
16
+ * const { room, object, actor } = world.helpers();
17
+ *
18
+ * const kitchen = room('Kitchen')
19
+ * .description('A warm kitchen.')
20
+ * .build();
21
+ * }
22
+ * ```
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.DoorBuilder = exports.ActorBuilder = exports.ContainerBuilder = exports.ObjectBuilder = exports.RoomBuilder = exports.createHelpers = void 0;
26
+ // Side-effect import: patches WorldModel.prototype.helpers
27
+ require("./augment");
28
+ // Named exports for direct use
29
+ var create_helpers_1 = require("./create-helpers");
30
+ Object.defineProperty(exports, "createHelpers", { enumerable: true, get: function () { return create_helpers_1.createHelpers; } });
31
+ var room_1 = require("./builders/room");
32
+ Object.defineProperty(exports, "RoomBuilder", { enumerable: true, get: function () { return room_1.RoomBuilder; } });
33
+ var object_1 = require("./builders/object");
34
+ Object.defineProperty(exports, "ObjectBuilder", { enumerable: true, get: function () { return object_1.ObjectBuilder; } });
35
+ var container_1 = require("./builders/container");
36
+ Object.defineProperty(exports, "ContainerBuilder", { enumerable: true, get: function () { return container_1.ContainerBuilder; } });
37
+ var actor_1 = require("./builders/actor");
38
+ Object.defineProperty(exports, "ActorBuilder", { enumerable: true, get: function () { return actor_1.ActorBuilder; } });
39
+ var door_1 = require("./builders/door");
40
+ Object.defineProperty(exports, "DoorBuilder", { enumerable: true, get: function () { return door_1.DoorBuilder; } });
41
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/helpers/src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH,2DAA2D;AAC3D,qBAAmB;AAEnB,+BAA+B;AAC/B,mDAAgE;AAAvD,+GAAA,aAAa,OAAA;AACtB,wCAA8C;AAArC,mGAAA,WAAW,OAAA;AACpB,4CAAkD;AAAzC,uGAAA,aAAa,OAAA;AACtB,kDAAwD;AAA/C,6GAAA,gBAAgB,OAAA;AACzB,0CAAgD;AAAvC,qGAAA,YAAY,OAAA;AACrB,wCAA8C;AAArC,mGAAA,WAAW,OAAA"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@sharpee/helpers",
3
+ "version": "0.9.103",
4
+ "description": "Fluent entity builder helpers for Sharpee Interactive Fiction Platform",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./index.d.ts",
10
+ "require": "./index.js",
11
+ "default": "./index.js"
12
+ }
13
+ },
14
+ "dependencies": {
15
+ "@sharpee/world-model": "^0.9.103"
16
+ },
17
+ "keywords": [
18
+ "interactive-fiction",
19
+ "if",
20
+ "text-adventure",
21
+ "sharpee",
22
+ "helpers",
23
+ "builders"
24
+ ],
25
+ "author": "Sharpee Team",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/ChicagoDave/sharpee.git",
30
+ "directory": "packages/helpers"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ }
38
+ }