@sharpee/core 0.9.56-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +48 -0
- package/dist/constants/attributes.d.ts +32 -0
- package/dist/constants/attributes.d.ts.map +1 -0
- package/dist/constants/attributes.js +53 -0
- package/dist/constants/attributes.js.map +1 -0
- package/dist/constants/core-events.d.ts +37 -0
- package/dist/constants/core-events.d.ts.map +1 -0
- package/dist/constants/core-events.js +50 -0
- package/dist/constants/core-events.js.map +1 -0
- package/dist/constants/entity-types.d.ts +15 -0
- package/dist/constants/entity-types.d.ts.map +1 -0
- package/dist/constants/entity-types.js +27 -0
- package/dist/constants/entity-types.js.map +1 -0
- package/dist/constants/index.d.ts +22 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +41 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/relationships.d.ts +25 -0
- package/dist/constants/relationships.d.ts.map +1 -0
- package/dist/constants/relationships.js +55 -0
- package/dist/constants/relationships.js.map +1 -0
- package/dist/debug/index.d.ts +5 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +21 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/types.d.ts +65 -0
- package/dist/debug/types.d.ts.map +1 -0
- package/dist/debug/types.js +39 -0
- package/dist/debug/types.js.map +1 -0
- package/dist/events/event-factory.d.ts +81 -0
- package/dist/events/event-factory.d.ts.map +1 -0
- package/dist/events/event-factory.js +74 -0
- package/dist/events/event-factory.js.map +1 -0
- package/dist/events/event-helpers.d.ts +118 -0
- package/dist/events/event-helpers.d.ts.map +1 -0
- package/dist/events/event-helpers.js +151 -0
- package/dist/events/event-helpers.js.map +1 -0
- package/dist/events/event-registry.d.ts +154 -0
- package/dist/events/event-registry.d.ts.map +1 -0
- package/dist/events/event-registry.js +24 -0
- package/dist/events/event-registry.js.map +1 -0
- package/dist/events/event-source.d.ts +39 -0
- package/dist/events/event-source.d.ts.map +1 -0
- package/dist/events/event-source.js +57 -0
- package/dist/events/event-source.js.map +1 -0
- package/dist/events/event-system.d.ts +27 -0
- package/dist/events/event-system.d.ts.map +1 -0
- package/dist/events/event-system.js +64 -0
- package/dist/events/event-system.js.map +1 -0
- package/dist/events/game-events.d.ts +245 -0
- package/dist/events/game-events.d.ts.map +1 -0
- package/dist/events/game-events.js +250 -0
- package/dist/events/game-events.js.map +1 -0
- package/dist/events/index.d.ts +19 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +51 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/platform-events.d.ts +161 -0
- package/dist/events/platform-events.d.ts.map +1 -0
- package/dist/events/platform-events.js +135 -0
- package/dist/events/platform-events.js.map +1 -0
- package/dist/events/semantic-event-source.d.ts +85 -0
- package/dist/events/semantic-event-source.d.ts.map +1 -0
- package/dist/events/semantic-event-source.js +147 -0
- package/dist/events/semantic-event-source.js.map +1 -0
- package/dist/events/standard-events.d.ts +26 -0
- package/dist/events/standard-events.d.ts.map +1 -0
- package/dist/events/standard-events.js +27 -0
- package/dist/events/standard-events.js.map +1 -0
- package/dist/events/system-event.d.ts +62 -0
- package/dist/events/system-event.d.ts.map +1 -0
- package/dist/events/system-event.js +55 -0
- package/dist/events/system-event.js.map +1 -0
- package/dist/events/typed-event.d.ts +69 -0
- package/dist/events/typed-event.d.ts.map +1 -0
- package/dist/events/typed-event.js +20 -0
- package/dist/events/typed-event.js.map +1 -0
- package/dist/events/types.d.ts +105 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/events/types.js +4 -0
- package/dist/events/types.js.map +1 -0
- package/dist/execution/index.d.ts +2 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +23 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/types.d.ts +117 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/execution/types.js +4 -0
- package/dist/execution/types.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +20 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/registry.d.ts +61 -0
- package/dist/extensions/registry.d.ts.map +1 -0
- package/dist/extensions/registry.js +153 -0
- package/dist/extensions/registry.js.map +1 -0
- package/dist/extensions/types.d.ts +84 -0
- package/dist/extensions/types.d.ts.map +1 -0
- package/dist/extensions/types.js +15 -0
- package/dist/extensions/types.js.map +1 -0
- package/dist/ifid/ifid.d.ts +30 -0
- package/dist/ifid/ifid.d.ts.map +1 -0
- package/dist/ifid/ifid.js +52 -0
- package/dist/ifid/ifid.js.map +1 -0
- package/dist/ifid/index.d.ts +2 -0
- package/dist/ifid/index.d.ts.map +1 -0
- package/dist/ifid/index.js +9 -0
- package/dist/ifid/index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/metadata/index.d.ts +2 -0
- package/dist/metadata/index.d.ts.map +1 -0
- package/dist/metadata/index.js +3 -0
- package/dist/metadata/index.js.map +1 -0
- package/dist/metadata/story-metadata.d.ts +64 -0
- package/dist/metadata/story-metadata.d.ts.map +1 -0
- package/dist/metadata/story-metadata.js +5 -0
- package/dist/metadata/story-metadata.js.map +1 -0
- package/dist/query/index.d.ts +9 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +25 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/query-manager.d.ts +86 -0
- package/dist/query/query-manager.d.ts.map +1 -0
- package/dist/query/query-manager.js +391 -0
- package/dist/query/query-manager.js.map +1 -0
- package/dist/query/types.d.ts +188 -0
- package/dist/query/types.d.ts.map +1 -0
- package/dist/query/types.js +106 -0
- package/dist/query/types.js.map +1 -0
- package/dist/random/index.d.ts +5 -0
- package/dist/random/index.d.ts.map +1 -0
- package/dist/random/index.js +9 -0
- package/dist/random/index.js.map +1 -0
- package/dist/random/seeded-random.d.ts +32 -0
- package/dist/random/seeded-random.d.ts.map +1 -0
- package/dist/random/seeded-random.js +62 -0
- package/dist/random/seeded-random.js.map +1 -0
- package/dist/rules/compatibility.d.ts +46 -0
- package/dist/rules/compatibility.d.ts.map +1 -0
- package/dist/rules/compatibility.js +62 -0
- package/dist/rules/compatibility.js.map +1 -0
- package/dist/rules/condition-builder.d.ts +23 -0
- package/dist/rules/condition-builder.d.ts.map +1 -0
- package/dist/rules/condition-builder.js +16 -0
- package/dist/rules/condition-builder.js.map +1 -0
- package/dist/rules/helpers.d.ts +51 -0
- package/dist/rules/helpers.d.ts.map +1 -0
- package/dist/rules/helpers.js +111 -0
- package/dist/rules/helpers.js.map +1 -0
- package/dist/rules/index.d.ts +12 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +34 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/rule-system.d.ts +6 -0
- package/dist/rules/rule-system.d.ts.map +1 -0
- package/dist/rules/rule-system.js +10 -0
- package/dist/rules/rule-system.js.map +1 -0
- package/dist/rules/rule-world-adapter.d.ts +43 -0
- package/dist/rules/rule-world-adapter.d.ts.map +1 -0
- package/dist/rules/rule-world-adapter.js +74 -0
- package/dist/rules/rule-world-adapter.js.map +1 -0
- package/dist/rules/simple-rule-system.d.ts +36 -0
- package/dist/rules/simple-rule-system.d.ts.map +1 -0
- package/dist/rules/simple-rule-system.js +135 -0
- package/dist/rules/simple-rule-system.js.map +1 -0
- package/dist/rules/types.d.ts +64 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +6 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/types/attribute.d.ts +40 -0
- package/dist/types/attribute.d.ts.map +1 -0
- package/dist/types/attribute.js +4 -0
- package/dist/types/attribute.js.map +1 -0
- package/dist/types/entity.d.ts +47 -0
- package/dist/types/entity.d.ts.map +1 -0
- package/dist/types/entity.js +4 -0
- package/dist/types/entity.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +27 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/relationship.d.ts +44 -0
- package/dist/types/relationship.d.ts.map +1 -0
- package/dist/types/relationship.js +4 -0
- package/dist/types/relationship.js.map +1 -0
- package/dist/types/result.d.ts +81 -0
- package/dist/types/result.d.ts.map +1 -0
- package/dist/types/result.js +79 -0
- package/dist/types/result.js.map +1 -0
- package/dist/types/save-data.d.ts +264 -0
- package/dist/types/save-data.d.ts.map +1 -0
- package/dist/types/save-data.js +6 -0
- package/dist/types/save-data.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { AnyExtension, ExtensionType } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Registry for extensions
|
|
4
|
+
*/
|
|
5
|
+
export declare class ExtensionRegistry {
|
|
6
|
+
private extensions;
|
|
7
|
+
private processingOrder;
|
|
8
|
+
/**
|
|
9
|
+
* Register an extension
|
|
10
|
+
* @param type Type of extension
|
|
11
|
+
* @param extension The extension to register
|
|
12
|
+
*/
|
|
13
|
+
register<T extends AnyExtension>(type: ExtensionType, extension: T): void;
|
|
14
|
+
/**
|
|
15
|
+
* Get an extension by type and id
|
|
16
|
+
* @param type Type of extension
|
|
17
|
+
* @param id Extension ID
|
|
18
|
+
*/
|
|
19
|
+
get<T extends AnyExtension>(type: ExtensionType, id: string): T | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Get all extensions of a specific type
|
|
22
|
+
* @param type Type of extension
|
|
23
|
+
*/
|
|
24
|
+
getAll<T extends AnyExtension>(type: ExtensionType): T[];
|
|
25
|
+
/**
|
|
26
|
+
* Set the processing order for a specific extension type
|
|
27
|
+
* @param type Type of extension
|
|
28
|
+
* @param orderedIds Ordered list of extension IDs
|
|
29
|
+
*/
|
|
30
|
+
setProcessingOrder(type: ExtensionType, orderedIds: string[]): void;
|
|
31
|
+
/**
|
|
32
|
+
* Check if an extension is registered
|
|
33
|
+
* @param type Type of extension
|
|
34
|
+
* @param id Extension ID
|
|
35
|
+
*/
|
|
36
|
+
has(type: ExtensionType, id: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Remove an extension
|
|
39
|
+
* @param type Type of extension
|
|
40
|
+
* @param id Extension ID
|
|
41
|
+
*/
|
|
42
|
+
remove(type: ExtensionType, id: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Get the number of registered extensions of a specific type
|
|
45
|
+
* @param type Type of extension
|
|
46
|
+
*/
|
|
47
|
+
count(type: ExtensionType): number;
|
|
48
|
+
/**
|
|
49
|
+
* Initialize an extension if needed
|
|
50
|
+
*/
|
|
51
|
+
private initializeExtension;
|
|
52
|
+
/**
|
|
53
|
+
* Clean up an extension if needed
|
|
54
|
+
*/
|
|
55
|
+
private cleanupExtension;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a new extension registry
|
|
59
|
+
*/
|
|
60
|
+
export declare function createExtensionRegistry(): ExtensionRegistry;
|
|
61
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAA4D;IAC9E,OAAO,CAAC,eAAe,CAA2C;IAElE;;;;OAIG;IACI,QAAQ,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,IAAI;IAuBhF;;;;OAIG;IACI,GAAG,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAOlF;;;OAGG;IACI,MAAM,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,EAAE;IAY/D;;;;OAIG;IACI,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IA0B1E;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;IAOpD;;;;OAIG;IACI,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;IAuBvD;;;OAGG;IACI,KAAK,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM;IAOzC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAK3B;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAIzB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,iBAAiB,CAE3D"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/core/src/extensions/registry.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ExtensionRegistry = void 0;
|
|
5
|
+
exports.createExtensionRegistry = createExtensionRegistry;
|
|
6
|
+
/**
|
|
7
|
+
* Registry for extensions
|
|
8
|
+
*/
|
|
9
|
+
class ExtensionRegistry {
|
|
10
|
+
extensions = new Map();
|
|
11
|
+
processingOrder = new Map();
|
|
12
|
+
/**
|
|
13
|
+
* Register an extension
|
|
14
|
+
* @param type Type of extension
|
|
15
|
+
* @param extension The extension to register
|
|
16
|
+
*/
|
|
17
|
+
register(type, extension) {
|
|
18
|
+
// Initialize maps if they don't exist
|
|
19
|
+
if (!this.extensions.has(type)) {
|
|
20
|
+
this.extensions.set(type, new Map());
|
|
21
|
+
this.processingOrder.set(type, []);
|
|
22
|
+
}
|
|
23
|
+
const typeRegistry = this.extensions.get(type);
|
|
24
|
+
const orderList = this.processingOrder.get(type);
|
|
25
|
+
// Check for duplicate extensions
|
|
26
|
+
if (typeRegistry.has(extension.id)) {
|
|
27
|
+
throw new Error(`Extension with ID "${extension.id}" already registered for type "${type}"`);
|
|
28
|
+
}
|
|
29
|
+
// Register the extension
|
|
30
|
+
typeRegistry.set(extension.id, extension);
|
|
31
|
+
orderList.push(extension.id);
|
|
32
|
+
// Handle initialization for certain extension types
|
|
33
|
+
this.initializeExtension(type, extension);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get an extension by type and id
|
|
37
|
+
* @param type Type of extension
|
|
38
|
+
* @param id Extension ID
|
|
39
|
+
*/
|
|
40
|
+
get(type, id) {
|
|
41
|
+
const typeRegistry = this.extensions.get(type);
|
|
42
|
+
if (!typeRegistry)
|
|
43
|
+
return undefined;
|
|
44
|
+
return typeRegistry.get(id);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get all extensions of a specific type
|
|
48
|
+
* @param type Type of extension
|
|
49
|
+
*/
|
|
50
|
+
getAll(type) {
|
|
51
|
+
const typeRegistry = this.extensions.get(type);
|
|
52
|
+
if (!typeRegistry)
|
|
53
|
+
return [];
|
|
54
|
+
const orderList = this.processingOrder.get(type) || [];
|
|
55
|
+
// Return extensions in the order they were registered
|
|
56
|
+
return orderList
|
|
57
|
+
.map(id => typeRegistry.get(id))
|
|
58
|
+
.filter((e) => e !== undefined);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Set the processing order for a specific extension type
|
|
62
|
+
* @param type Type of extension
|
|
63
|
+
* @param orderedIds Ordered list of extension IDs
|
|
64
|
+
*/
|
|
65
|
+
setProcessingOrder(type, orderedIds) {
|
|
66
|
+
const typeRegistry = this.extensions.get(type);
|
|
67
|
+
if (!typeRegistry) {
|
|
68
|
+
throw new Error(`No extensions registered for type "${type}"`);
|
|
69
|
+
}
|
|
70
|
+
// Validate that all IDs exist
|
|
71
|
+
for (const id of orderedIds) {
|
|
72
|
+
if (!typeRegistry.has(id)) {
|
|
73
|
+
throw new Error(`Extension with ID "${id}" not found for type "${type}"`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Validate that all extensions are included
|
|
77
|
+
const registeredIds = Array.from(typeRegistry.keys());
|
|
78
|
+
if (registeredIds.length !== orderedIds.length) {
|
|
79
|
+
throw new Error(`Processing order must include all registered extensions. ` +
|
|
80
|
+
`Missing: ${registeredIds.filter(id => !orderedIds.includes(id)).join(', ')}`);
|
|
81
|
+
}
|
|
82
|
+
// Set the processing order
|
|
83
|
+
this.processingOrder.set(type, [...orderedIds]);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Check if an extension is registered
|
|
87
|
+
* @param type Type of extension
|
|
88
|
+
* @param id Extension ID
|
|
89
|
+
*/
|
|
90
|
+
has(type, id) {
|
|
91
|
+
const typeRegistry = this.extensions.get(type);
|
|
92
|
+
if (!typeRegistry)
|
|
93
|
+
return false;
|
|
94
|
+
return typeRegistry.has(id);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Remove an extension
|
|
98
|
+
* @param type Type of extension
|
|
99
|
+
* @param id Extension ID
|
|
100
|
+
*/
|
|
101
|
+
remove(type, id) {
|
|
102
|
+
const typeRegistry = this.extensions.get(type);
|
|
103
|
+
if (!typeRegistry)
|
|
104
|
+
return false;
|
|
105
|
+
// Check if extension exists
|
|
106
|
+
if (!typeRegistry.has(id))
|
|
107
|
+
return false;
|
|
108
|
+
// Remove from processing order
|
|
109
|
+
const orderList = this.processingOrder.get(type);
|
|
110
|
+
if (orderList) {
|
|
111
|
+
const index = orderList.indexOf(id);
|
|
112
|
+
if (index !== -1) {
|
|
113
|
+
orderList.splice(index, 1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Clean up extension if needed
|
|
117
|
+
this.cleanupExtension(type, typeRegistry.get(id));
|
|
118
|
+
// Remove from registry
|
|
119
|
+
return typeRegistry.delete(id);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get the number of registered extensions of a specific type
|
|
123
|
+
* @param type Type of extension
|
|
124
|
+
*/
|
|
125
|
+
count(type) {
|
|
126
|
+
const typeRegistry = this.extensions.get(type);
|
|
127
|
+
if (!typeRegistry)
|
|
128
|
+
return 0;
|
|
129
|
+
return typeRegistry.size;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Initialize an extension if needed
|
|
133
|
+
*/
|
|
134
|
+
initializeExtension(type, extension) {
|
|
135
|
+
// Add any initialization logic here if needed
|
|
136
|
+
// For example, calling initialize() on WorldModelExtensions
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Clean up an extension if needed
|
|
140
|
+
*/
|
|
141
|
+
cleanupExtension(type, extension) {
|
|
142
|
+
// Add any cleanup logic here if needed
|
|
143
|
+
// For example, calling cleanup() on WorldModelExtensions
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.ExtensionRegistry = ExtensionRegistry;
|
|
147
|
+
/**
|
|
148
|
+
* Create a new extension registry
|
|
149
|
+
*/
|
|
150
|
+
function createExtensionRegistry() {
|
|
151
|
+
return new ExtensionRegistry();
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;AA4K3C,0DAEC;AAvKD;;GAEG;AACH,MAAa,iBAAiB;IACpB,UAAU,GAAkD,IAAI,GAAG,EAAE,CAAC;IACtE,eAAe,GAAiC,IAAI,GAAG,EAAE,CAAC;IAElE;;;;OAIG;IACI,QAAQ,CAAyB,IAAmB,EAAE,SAAY;QACvE,sCAAsC;QACtC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,EAAwB,CAAC,CAAC;YAC3D,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACrC,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yD;IAC3D,CAAC;CACF;AA7JD,8CA6JC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,OAAO,IAAI,iBAAiB,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ISemanticEvent } from '../events/types';
|
|
2
|
+
/**
|
|
3
|
+
* Base interface for all extensions
|
|
4
|
+
*/
|
|
5
|
+
export interface IExtension {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for this extension
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Human-readable name of the extension
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Version of the extension
|
|
16
|
+
*/
|
|
17
|
+
version?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Extension dependencies
|
|
20
|
+
*/
|
|
21
|
+
dependencies?: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Extension for command handling (generic)
|
|
25
|
+
* The IF-specific version with ParsedCommand and GameContext is in stdlib
|
|
26
|
+
*/
|
|
27
|
+
export interface ICommandExtension extends IExtension {
|
|
28
|
+
/**
|
|
29
|
+
* Verbs that this extension can handle
|
|
30
|
+
*/
|
|
31
|
+
verbs: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Extension for abilities (generic)
|
|
35
|
+
* The IF-specific version with GameContext is in stdlib
|
|
36
|
+
*/
|
|
37
|
+
export interface IAbilityExtension extends IExtension {
|
|
38
|
+
/**
|
|
39
|
+
* Name of the ability
|
|
40
|
+
*/
|
|
41
|
+
abilityName: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Extension for event processing (generic)
|
|
45
|
+
* The IF-specific version with GameContext is in stdlib
|
|
46
|
+
*/
|
|
47
|
+
export interface IEventExtension extends IExtension {
|
|
48
|
+
/**
|
|
49
|
+
* Event types that this extension handles
|
|
50
|
+
*/
|
|
51
|
+
eventTypes: string[];
|
|
52
|
+
/**
|
|
53
|
+
* Process an event
|
|
54
|
+
*/
|
|
55
|
+
processEvent: (event: ISemanticEvent) => ISemanticEvent[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Extension for parser enhancements (generic)
|
|
59
|
+
* The IF-specific version with ParsedCommand is in stdlib
|
|
60
|
+
*/
|
|
61
|
+
export interface IParserExtension extends IExtension {
|
|
62
|
+
/**
|
|
63
|
+
* Grammar rules, dictionaries, etc.
|
|
64
|
+
*/
|
|
65
|
+
vocabulary?: Record<string, string[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Pre-processing hook for input text
|
|
68
|
+
*/
|
|
69
|
+
preProcessInput?: (input: string) => string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Extension types enum
|
|
73
|
+
*/
|
|
74
|
+
export declare enum ExtensionType {
|
|
75
|
+
COMMAND = "command",
|
|
76
|
+
ABILITY = "ability",
|
|
77
|
+
EVENT = "event",
|
|
78
|
+
PARSER = "parser"
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Union type for all extension types
|
|
82
|
+
*/
|
|
83
|
+
export type AnyExtension = ICommandExtension | IAbilityExtension | IEventExtension | IParserExtension;
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/extensions/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,cAAc,EAAE,CAAC;CAC3D;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtC;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/core/src/extensions/types.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ExtensionType = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Extension types enum
|
|
7
|
+
*/
|
|
8
|
+
var ExtensionType;
|
|
9
|
+
(function (ExtensionType) {
|
|
10
|
+
ExtensionType["COMMAND"] = "command";
|
|
11
|
+
ExtensionType["ABILITY"] = "ability";
|
|
12
|
+
ExtensionType["EVENT"] = "event";
|
|
13
|
+
ExtensionType["PARSER"] = "parser";
|
|
14
|
+
})(ExtensionType || (exports.ExtensionType = ExtensionType = {}));
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/extensions/types.ts"],"names":[],"mappings":";AAAA,wCAAwC;;;AAmFxC;;GAEG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,kCAAiB,CAAA;AACnB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a new IFID using UUID v4 format.
|
|
3
|
+
* Returns an uppercase UUID suitable for Treaty of Babel compliance.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const ifid = generateIfid();
|
|
7
|
+
* // => "A1B2C3D4-E5F6-7890-ABCD-EF1234567890"
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateIfid(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Validate an IFID string against Treaty of Babel requirements.
|
|
12
|
+
*
|
|
13
|
+
* @param ifid - The IFID to validate
|
|
14
|
+
* @returns true if valid, false otherwise
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* validateIfid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890"); // true
|
|
18
|
+
* validateIfid("lowercase-invalid"); // false
|
|
19
|
+
* validateIfid("SHORT"); // false (less than 8 chars)
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateIfid(ifid: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Normalize an IFID to uppercase.
|
|
24
|
+
* Returns the normalized IFID or null if invalid after normalization.
|
|
25
|
+
*
|
|
26
|
+
* @param ifid - The IFID to normalize
|
|
27
|
+
* @returns Normalized uppercase IFID, or null if invalid
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeIfid(ifid: string): string | null;
|
|
30
|
+
//# sourceMappingURL=ifid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ifid.d.ts","sourceRoot":"","sources":["../../src/ifid/ifid.ts"],"names":[],"mappings":"AAaA;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/core/src/ifid/ifid.ts
|
|
3
|
+
// IFID (Interactive Fiction Identifier) utilities per Treaty of Babel
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.generateIfid = generateIfid;
|
|
6
|
+
exports.validateIfid = validateIfid;
|
|
7
|
+
exports.normalizeIfid = normalizeIfid;
|
|
8
|
+
// Use globalThis.crypto for cross-platform compatibility (Node 19+ and browsers)
|
|
9
|
+
/**
|
|
10
|
+
* IFID format requirements (Treaty of Babel):
|
|
11
|
+
* - Length: 8 to 63 characters
|
|
12
|
+
* - Characters: Uppercase letters (A-Z), digits (0-9), and hyphens (-)
|
|
13
|
+
* - Recommended: UUID format (ISO/IEC 11578:1996), uppercase
|
|
14
|
+
*/
|
|
15
|
+
const IFID_PATTERN = /^[A-Z0-9-]{8,63}$/;
|
|
16
|
+
/**
|
|
17
|
+
* Generate a new IFID using UUID v4 format.
|
|
18
|
+
* Returns an uppercase UUID suitable for Treaty of Babel compliance.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const ifid = generateIfid();
|
|
22
|
+
* // => "A1B2C3D4-E5F6-7890-ABCD-EF1234567890"
|
|
23
|
+
*/
|
|
24
|
+
function generateIfid() {
|
|
25
|
+
return globalThis.crypto.randomUUID().toUpperCase();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Validate an IFID string against Treaty of Babel requirements.
|
|
29
|
+
*
|
|
30
|
+
* @param ifid - The IFID to validate
|
|
31
|
+
* @returns true if valid, false otherwise
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* validateIfid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890"); // true
|
|
35
|
+
* validateIfid("lowercase-invalid"); // false
|
|
36
|
+
* validateIfid("SHORT"); // false (less than 8 chars)
|
|
37
|
+
*/
|
|
38
|
+
function validateIfid(ifid) {
|
|
39
|
+
return IFID_PATTERN.test(ifid);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Normalize an IFID to uppercase.
|
|
43
|
+
* Returns the normalized IFID or null if invalid after normalization.
|
|
44
|
+
*
|
|
45
|
+
* @param ifid - The IFID to normalize
|
|
46
|
+
* @returns Normalized uppercase IFID, or null if invalid
|
|
47
|
+
*/
|
|
48
|
+
function normalizeIfid(ifid) {
|
|
49
|
+
const normalized = ifid.toUpperCase();
|
|
50
|
+
return validateIfid(normalized) ? normalized : null;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=ifid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ifid.js","sourceRoot":"","sources":["../../src/ifid/ifid.ts"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,sEAAsE;;AAoBtE,oCAEC;AAaD,oCAEC;AASD,sCAGC;AA/CD,iFAAiF;AAEjF;;;;;GAKG;AACH,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC;;;;;;;GAOG;AACH,SAAgB,YAAY;IAC1B,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE,CAAC;AACtD,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACtC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ifid/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeIfid = exports.validateIfid = exports.generateIfid = void 0;
|
|
4
|
+
// packages/core/src/ifid/index.ts
|
|
5
|
+
var ifid_1 = require("./ifid");
|
|
6
|
+
Object.defineProperty(exports, "generateIfid", { enumerable: true, get: function () { return ifid_1.generateIfid; } });
|
|
7
|
+
Object.defineProperty(exports, "validateIfid", { enumerable: true, get: function () { return ifid_1.validateIfid; } });
|
|
8
|
+
Object.defineProperty(exports, "normalizeIfid", { enumerable: true, get: function () { return ifid_1.normalizeIfid; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ifid/index.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,+BAAmE;AAA1D,oGAAA,YAAY,OAAA;AAAE,oGAAA,YAAY,OAAA;AAAE,qGAAA,aAAa,OAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './ifid';
|
|
3
|
+
export * from './metadata';
|
|
4
|
+
export * from './events';
|
|
5
|
+
export * from './extensions/types';
|
|
6
|
+
export { ICommandHandler, IAction, IExecutionContext, ICommandRouter, ICommandHandlerFactory, ICommandExecutionOptions } from './execution/types';
|
|
7
|
+
export * from './rules';
|
|
8
|
+
export * from './debug';
|
|
9
|
+
export * from './query';
|
|
10
|
+
export * from './random';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AAGxB,cAAc,QAAQ,CAAC;AAGvB,cAAc,YAAY,CAAC;AAG3B,cAAc,UAAU,CAAC;AAGzB,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EACL,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/core/src/index.ts
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
// Core data structures
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
20
|
+
// IFID (Interactive Fiction Identifier) utilities
|
|
21
|
+
__exportStar(require("./ifid"), exports);
|
|
22
|
+
// Story metadata
|
|
23
|
+
__exportStar(require("./metadata"), exports);
|
|
24
|
+
// Event system - export from the events index which has everything organized
|
|
25
|
+
__exportStar(require("./events"), exports);
|
|
26
|
+
// Extension system
|
|
27
|
+
__exportStar(require("./extensions/types"), exports);
|
|
28
|
+
// Rules system
|
|
29
|
+
__exportStar(require("./rules"), exports);
|
|
30
|
+
// Debug infrastructure
|
|
31
|
+
__exportStar(require("./debug"), exports);
|
|
32
|
+
// Query system
|
|
33
|
+
__exportStar(require("./query"), exports);
|
|
34
|
+
// Random utilities
|
|
35
|
+
__exportStar(require("./random"), exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;;;;;;;;;;;;;;AAE7B,uBAAuB;AACvB,0CAAwB;AAExB,kDAAkD;AAClD,yCAAuB;AAEvB,iBAAiB;AACjB,6CAA2B;AAE3B,6EAA6E;AAC7E,2CAAyB;AAEzB,mBAAmB;AACnB,qDAAmC;AAYnC,eAAe;AACf,0CAAwB;AAExB,uBAAuB;AACvB,0CAAwB;AAExB,eAAe;AACf,0CAAwB;AAExB,mBAAmB;AACnB,2CAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,aAAa,EACb,aAAa,EACb,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Story metadata for Treaty of Babel compliance.
|
|
3
|
+
* Contains bibliographic information embedded in compiled stories.
|
|
4
|
+
*/
|
|
5
|
+
export interface StoryMetadata {
|
|
6
|
+
/** Unique IFID (Interactive Fiction Identifier) */
|
|
7
|
+
ifid: string;
|
|
8
|
+
/** Story title */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Author name(s) */
|
|
11
|
+
author: string;
|
|
12
|
+
/** Year of first publication (e.g., "2025") */
|
|
13
|
+
firstPublished?: string;
|
|
14
|
+
/** Brief tagline (e.g., "An Interactive Fiction") */
|
|
15
|
+
headline?: string;
|
|
16
|
+
/** Genre classification */
|
|
17
|
+
genre?: string;
|
|
18
|
+
/** Story blurb/description */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** Primary language code (e.g., "en") */
|
|
21
|
+
language?: string;
|
|
22
|
+
/** Series name if part of a series */
|
|
23
|
+
series?: string;
|
|
24
|
+
/** Number in series */
|
|
25
|
+
seriesNumber?: number;
|
|
26
|
+
/** Zarfian forgiveness scale */
|
|
27
|
+
forgiveness?: 'Merciful' | 'Polite' | 'Tough' | 'Nasty' | 'Cruel';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sharpee config section in package.json
|
|
31
|
+
*/
|
|
32
|
+
export interface SharpeeConfig {
|
|
33
|
+
/** Story IFID */
|
|
34
|
+
ifid: string;
|
|
35
|
+
/** Story title */
|
|
36
|
+
title: string;
|
|
37
|
+
/** Author name(s) */
|
|
38
|
+
author: string;
|
|
39
|
+
/** Year of first publication */
|
|
40
|
+
firstPublished?: string;
|
|
41
|
+
/** Brief tagline */
|
|
42
|
+
headline?: string;
|
|
43
|
+
/** Genre classification */
|
|
44
|
+
genre?: string;
|
|
45
|
+
/** Story description */
|
|
46
|
+
description?: string;
|
|
47
|
+
/** Primary language code */
|
|
48
|
+
language?: string;
|
|
49
|
+
/** Series name */
|
|
50
|
+
series?: string;
|
|
51
|
+
/** Number in series */
|
|
52
|
+
seriesNumber?: number;
|
|
53
|
+
/** Zarfian forgiveness scale */
|
|
54
|
+
forgiveness?: 'Merciful' | 'Polite' | 'Tough' | 'Nasty' | 'Cruel';
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Validation result for story configuration
|
|
58
|
+
*/
|
|
59
|
+
export interface StoryConfigValidationResult {
|
|
60
|
+
valid: boolean;
|
|
61
|
+
error?: string;
|
|
62
|
+
warnings?: string[];
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=story-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story-metadata.d.ts","sourceRoot":"","sources":["../../src/metadata/story-metadata.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IAEf,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IAEf,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story-metadata.js","sourceRoot":"","sources":["../../src/metadata/story-metadata.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,uCAAuC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Query system exports
|
|
4
|
+
*
|
|
5
|
+
* The query system implements the PC communication system (ADR-018)
|
|
6
|
+
* for handling player queries and responses.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./types"), exports);
|
|
24
|
+
__exportStar(require("./query-manager"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,kDAAgC"}
|