holonovel 2026.8.22
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.md +21 -0
- package/bin/holonovel.js +5 -0
- package/dist/core/character-creation.d.ts +116 -0
- package/dist/core/character-creation.js +346 -0
- package/dist/core/character-creation.js.map +1 -0
- package/dist/core/enrichment.d.ts +45 -0
- package/dist/core/enrichment.js +269 -0
- package/dist/core/enrichment.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/macros.d.ts +21 -0
- package/dist/core/macros.js +50 -0
- package/dist/core/macros.js.map +1 -0
- package/dist/core/rng.d.ts +17 -0
- package/dist/core/rng.js +72 -0
- package/dist/core/rng.js.map +1 -0
- package/dist/core/server.d.ts +18 -0
- package/dist/core/server.js +40 -0
- package/dist/core/server.js.map +1 -0
- package/dist/core/state.d.ts +396 -0
- package/dist/core/state.js +1080 -0
- package/dist/core/state.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4051 -0
- package/dist/index.js.map +1 -0
- package/dist/rulesets.d.ts +65 -0
- package/dist/rulesets.js +212 -0
- package/dist/rulesets.js.map +1 -0
- package/dist/world/index.d.ts +4 -0
- package/dist/world/index.js +3 -0
- package/dist/world/index.js.map +1 -0
- package/dist/world/model.d.ts +125 -0
- package/dist/world/model.js +492 -0
- package/dist/world/model.js.map +1 -0
- package/dist/world/parser.d.ts +18 -0
- package/dist/world/parser.js +462 -0
- package/dist/world/parser.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
// Parser command dispatch — REQ-196
|
|
2
|
+
// Resolves natural-language commands against world-model current state.
|
|
3
|
+
import { ROOM_DIRECTIONS, resolveThingName, resolveThingInInventory } from "./model.js";
|
|
4
|
+
const DIRECTION_ALIASES = {
|
|
5
|
+
n: "north", s: "south", e: "east", w: "west",
|
|
6
|
+
ne: "northeast", nw: "northwest", se: "southeast", sw: "southwest",
|
|
7
|
+
u: "up", d: "down",
|
|
8
|
+
};
|
|
9
|
+
export function dispatchCommand(raw, ctx) {
|
|
10
|
+
const trimmed = raw.trim();
|
|
11
|
+
const tokens = tokenize(trimmed);
|
|
12
|
+
if (tokens.length === 0)
|
|
13
|
+
return { prefix: "ERROR", code: "INVALID_INPUT", text: "No command provided.", correctiveAction: "Try: look, go <direction>, examine <thing>, take <thing>, inventory, or wait." };
|
|
14
|
+
const verb = tokens[0].toLowerCase();
|
|
15
|
+
const args = tokens.slice(1);
|
|
16
|
+
// Direction aliases as standalone commands
|
|
17
|
+
if (verb in DIRECTION_ALIASES || ROOM_DIRECTIONS.includes(verb)) {
|
|
18
|
+
const dir = DIRECTION_ALIASES[verb] || verb;
|
|
19
|
+
return handleGo(dir, ctx);
|
|
20
|
+
}
|
|
21
|
+
switch (verb) {
|
|
22
|
+
case "look": return handleLook(ctx);
|
|
23
|
+
case "go": return handleGo(args[0] || "", ctx);
|
|
24
|
+
case "walk":
|
|
25
|
+
case "move": return handleGo(args[0] || "", ctx);
|
|
26
|
+
case "north":
|
|
27
|
+
case "south":
|
|
28
|
+
case "east":
|
|
29
|
+
case "west":
|
|
30
|
+
case "northeast":
|
|
31
|
+
case "northwest":
|
|
32
|
+
case "southeast":
|
|
33
|
+
case "southwest":
|
|
34
|
+
case "up":
|
|
35
|
+
case "down":
|
|
36
|
+
case "in":
|
|
37
|
+
case "out": return handleGo(verb, ctx);
|
|
38
|
+
case "take":
|
|
39
|
+
case "get":
|
|
40
|
+
case "pick": {
|
|
41
|
+
if (args[0] === "up" || args[0] === "")
|
|
42
|
+
return handleGo(args[1] || "", ctx);
|
|
43
|
+
return handleTake(args.join(" "), ctx);
|
|
44
|
+
}
|
|
45
|
+
case "drop":
|
|
46
|
+
case "put": {
|
|
47
|
+
// "put X in/on Y" vs "drop X"
|
|
48
|
+
const inIdx = args.findIndex(a => a === "in" || a === "on");
|
|
49
|
+
if (verb === "put" && inIdx > 0) {
|
|
50
|
+
const thingName = args.slice(0, inIdx).join(" ");
|
|
51
|
+
const targetName = args.slice(inIdx + 1).join(" ");
|
|
52
|
+
return handlePut(thingName, targetName, ctx);
|
|
53
|
+
}
|
|
54
|
+
return handleDrop(args.join(" "), ctx);
|
|
55
|
+
}
|
|
56
|
+
case "open": return handleOpen(args.join(" "), ctx);
|
|
57
|
+
case "close": return handleClose(args.join(" "), ctx);
|
|
58
|
+
case "unlock": return handleUnlock(args.join(" "), ctx);
|
|
59
|
+
case "lock": return handleLock(args.join(" "), ctx);
|
|
60
|
+
case "inventory":
|
|
61
|
+
case "i": return handleInventory(ctx);
|
|
62
|
+
case "examine":
|
|
63
|
+
case "x":
|
|
64
|
+
case "look at":
|
|
65
|
+
case "search": {
|
|
66
|
+
return handleExamine(args.join(" "), ctx);
|
|
67
|
+
}
|
|
68
|
+
case "wait": return { prefix: "OK", text: "Time passes." };
|
|
69
|
+
default:
|
|
70
|
+
return {
|
|
71
|
+
prefix: "ERROR",
|
|
72
|
+
code: "NOT_FOUND",
|
|
73
|
+
text: `"${verb}" is not a recognized command.`,
|
|
74
|
+
correctiveAction: `Try: look, go <direction>, take <thing>, drop <thing>, open <door>, close <door>, inventory, examine <thing>, or wait.`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function tokenize(input) {
|
|
79
|
+
const tokens = [];
|
|
80
|
+
let i = 0;
|
|
81
|
+
let current = "";
|
|
82
|
+
while (i < input.length) {
|
|
83
|
+
if (input[i] === '"') {
|
|
84
|
+
const end = input.indexOf('"', i + 1);
|
|
85
|
+
if (end === -1) {
|
|
86
|
+
current += input.slice(i);
|
|
87
|
+
i = input.length;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
tokens.push(input.slice(i + 1, end));
|
|
91
|
+
i = end + 1;
|
|
92
|
+
}
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (input[i] === " ") {
|
|
96
|
+
if (current)
|
|
97
|
+
tokens.push(current);
|
|
98
|
+
current = "";
|
|
99
|
+
i++;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
current += input[i];
|
|
103
|
+
i++;
|
|
104
|
+
}
|
|
105
|
+
if (current)
|
|
106
|
+
tokens.push(current);
|
|
107
|
+
return tokens;
|
|
108
|
+
}
|
|
109
|
+
function getRoom(name, ctx) {
|
|
110
|
+
return ctx.world.rooms.get(name.toLowerCase());
|
|
111
|
+
}
|
|
112
|
+
function getRoomThings(roomName, ctx) {
|
|
113
|
+
const things = [];
|
|
114
|
+
const rl = roomName.toLowerCase();
|
|
115
|
+
for (const [, thing] of ctx.world.things) {
|
|
116
|
+
if (!thing.location)
|
|
117
|
+
continue;
|
|
118
|
+
const loc = thing.location.toLowerCase();
|
|
119
|
+
if (loc === rl && thing.locationType === "room") {
|
|
120
|
+
things.push(thing);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return things;
|
|
124
|
+
}
|
|
125
|
+
function getThingsInContainer(containerName, ctx) {
|
|
126
|
+
const things = [];
|
|
127
|
+
const cl = containerName.toLowerCase();
|
|
128
|
+
for (const [, thing] of ctx.world.things) {
|
|
129
|
+
if (thing.location?.toLowerCase() === cl && thing.locationType === "container") {
|
|
130
|
+
things.push(thing);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return things;
|
|
134
|
+
}
|
|
135
|
+
function getThingsOnSupporter(supporterName, ctx) {
|
|
136
|
+
const things = [];
|
|
137
|
+
const sl = supporterName.toLowerCase();
|
|
138
|
+
for (const [, thing] of ctx.world.things) {
|
|
139
|
+
if (thing.location?.toLowerCase() === sl && thing.locationType === "supporter") {
|
|
140
|
+
things.push(thing);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return things;
|
|
144
|
+
}
|
|
145
|
+
function getThing(name, ctx) {
|
|
146
|
+
return ctx.world.things.get(name.toLowerCase());
|
|
147
|
+
}
|
|
148
|
+
function getHeldThing(name, ctx) {
|
|
149
|
+
if (!ctx.inventory.includes(name.toLowerCase()))
|
|
150
|
+
return undefined;
|
|
151
|
+
return ctx.world.things.get(name.toLowerCase());
|
|
152
|
+
}
|
|
153
|
+
function handleLook(ctx) {
|
|
154
|
+
if (!ctx.currentRoom) {
|
|
155
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "You are nowhere. The world model has not been populated.", correctiveAction: "Use an adventure module or CRUD tools to populate the world model." };
|
|
156
|
+
}
|
|
157
|
+
const room = getRoom(ctx.currentRoom, ctx);
|
|
158
|
+
if (!room) {
|
|
159
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `Room '${ctx.currentRoom}' not found.` };
|
|
160
|
+
}
|
|
161
|
+
let text = `${room.name}\n${room.description || "There is nothing special about this place."}`;
|
|
162
|
+
// Visible things
|
|
163
|
+
const roomThings = getRoomThings(ctx.currentRoom, ctx).filter(t => t.locationType === "room");
|
|
164
|
+
const containerThings = getThingsInContainer(ctx.currentRoom, ctx);
|
|
165
|
+
const supporterThings = ctx.world.things.get(ctx.currentRoom.toLowerCase())?.kind === "supporter"
|
|
166
|
+
? getThingsOnSupporter(ctx.currentRoom, ctx) : [];
|
|
167
|
+
const visibleThings = [...roomThings, ...containerThings, ...supporterThings];
|
|
168
|
+
if (visibleThings.length > 0) {
|
|
169
|
+
const names = visibleThings.map(t => `${t.name}${t.portable ? "" : " (fixed)"}`);
|
|
170
|
+
text += `\n\nYou can see: ${names.join(", ")}.`;
|
|
171
|
+
}
|
|
172
|
+
// Exits
|
|
173
|
+
const exitList = [];
|
|
174
|
+
for (const [dir, target] of room.exits) {
|
|
175
|
+
const door = room.doorRefs.get(dir);
|
|
176
|
+
if (door) {
|
|
177
|
+
const doorThing = getThing(door, ctx);
|
|
178
|
+
if (doorThing) {
|
|
179
|
+
const state = doorThing.open ? "open" : (doorThing.locked ? "closed, locked" : "closed");
|
|
180
|
+
exitList.push(`${dir} (${door} — ${state})`);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
exitList.push(`${dir}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
exitList.push(`${dir}`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (exitList.length > 0) {
|
|
191
|
+
text += `\n\nExits: ${exitList.join(", ")}.`;
|
|
192
|
+
}
|
|
193
|
+
return { prefix: "OK", text };
|
|
194
|
+
}
|
|
195
|
+
function handleGo(dir, ctx) {
|
|
196
|
+
if (!ctx.currentRoom) {
|
|
197
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "You are nowhere. The world model has not been populated.", correctiveAction: "Use an adventure module or CRUD tools to populate the world model." };
|
|
198
|
+
}
|
|
199
|
+
if (!dir) {
|
|
200
|
+
return { prefix: "ERROR", code: "INVALID_INPUT", text: "Go where?", correctiveAction: "Try: go north, go south, etc." };
|
|
201
|
+
}
|
|
202
|
+
const direction = dir.toLowerCase();
|
|
203
|
+
if (!ROOM_DIRECTIONS.includes(direction)) {
|
|
204
|
+
return { prefix: "ERROR", code: "INVALID_INPUT", text: `'${dir}' is not a valid direction.`, correctiveAction: `Valid directions: ${ROOM_DIRECTIONS.join(", ")}.` };
|
|
205
|
+
}
|
|
206
|
+
const room = getRoom(ctx.currentRoom, ctx);
|
|
207
|
+
if (!room) {
|
|
208
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `Room '${ctx.currentRoom}' not found.` };
|
|
209
|
+
}
|
|
210
|
+
// Check for door blocking
|
|
211
|
+
const doorName = room.doorRefs.get(direction);
|
|
212
|
+
if (doorName) {
|
|
213
|
+
const door = getThing(doorName, ctx);
|
|
214
|
+
if (door) {
|
|
215
|
+
if (!door.open) {
|
|
216
|
+
if (door.locked) {
|
|
217
|
+
return { prefix: "WARNING", text: `The ${door.name} is closed and locked.`, correctiveAction: `Try: unlock ${door.name} with <key>, then open ${door.name}.` };
|
|
218
|
+
}
|
|
219
|
+
return { prefix: "WARNING", text: `The ${door.name} is closed.`, correctiveAction: `Try: open ${door.name}.` };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
// Check for exit
|
|
224
|
+
const target = room.exits.get(direction);
|
|
225
|
+
if (!target) {
|
|
226
|
+
return { prefix: "WARNING", text: `You can't go ${direction} from here.` };
|
|
227
|
+
}
|
|
228
|
+
const targetRoom = getRoom(target, ctx);
|
|
229
|
+
if (!targetRoom) {
|
|
230
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `Room '${target}' not found.` };
|
|
231
|
+
}
|
|
232
|
+
// Actually move happens in the caller — the parser just resolves
|
|
233
|
+
return { prefix: "OK", text: `${targetRoom.name}\n${targetRoom.description || "There is nothing special about this place."}` };
|
|
234
|
+
}
|
|
235
|
+
function handleTake(target, ctx) {
|
|
236
|
+
if (!ctx.currentRoom) {
|
|
237
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated.", correctiveAction: "Use an adventure module or CRUD tools to populate the world model." };
|
|
238
|
+
}
|
|
239
|
+
// REQ-200: things are reachable from the room directly, from an open
|
|
240
|
+
// container in the room, or from a supporter in the room.
|
|
241
|
+
const roomThings = getRoomThings(ctx.currentRoom, ctx);
|
|
242
|
+
const reachable = [...roomThings];
|
|
243
|
+
for (const [, thing] of ctx.world.things) {
|
|
244
|
+
if (!thing.location)
|
|
245
|
+
continue;
|
|
246
|
+
const parentName = thing.location;
|
|
247
|
+
const parent = ctx.world.things.get(parentName.toLowerCase());
|
|
248
|
+
if (!parent)
|
|
249
|
+
continue;
|
|
250
|
+
if (parent.location?.toLowerCase() !== ctx.currentRoom.toLowerCase())
|
|
251
|
+
continue;
|
|
252
|
+
if (thing.locationType === "supporter")
|
|
253
|
+
reachable.push(thing);
|
|
254
|
+
else if (thing.locationType === "container" && parent.openable && parent.open)
|
|
255
|
+
reachable.push(thing);
|
|
256
|
+
}
|
|
257
|
+
const matches = resolveThingName(target, reachable, ctx.inventory);
|
|
258
|
+
if (matches.length === 0) {
|
|
259
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You see no '${target}' here.` };
|
|
260
|
+
}
|
|
261
|
+
if (matches.length > 1) {
|
|
262
|
+
const names = matches.map(t => `'${t.name}' (${t.description || t.kind})`);
|
|
263
|
+
return { prefix: "ERROR", code: "AMBIGUOUS", text: `Which do you mean: ${names.join(", ")}?` };
|
|
264
|
+
}
|
|
265
|
+
const thing = matches[0];
|
|
266
|
+
if (!thing.portable) {
|
|
267
|
+
return { prefix: "ERROR", code: "RULE_VIOLATION", text: `The ${thing.name} is fixed.`, correctiveAction: "Fixed objects cannot be taken." };
|
|
268
|
+
}
|
|
269
|
+
// Check if it's inside a closed container
|
|
270
|
+
if (thing.locationType === "container") {
|
|
271
|
+
const container = getThing(thing.location || "", ctx);
|
|
272
|
+
if (container && !container.open && container.openable) {
|
|
273
|
+
return { prefix: "ERROR", code: "RULE_VIOLATION", text: `The ${thing.name} is inside the ${container.name}, which is closed.`, correctiveAction: `Try: open ${container.name} first.` };
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// Move to inventory (caller updates)
|
|
277
|
+
return { prefix: "OK", text: `You take the ${thing.name}.` };
|
|
278
|
+
}
|
|
279
|
+
function handleDrop(target, ctx) {
|
|
280
|
+
if (!ctx.currentRoom) {
|
|
281
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated." };
|
|
282
|
+
}
|
|
283
|
+
if (!target) {
|
|
284
|
+
return { prefix: "ERROR", code: "INVALID_INPUT", text: "Drop what?" };
|
|
285
|
+
}
|
|
286
|
+
const heldThings = [];
|
|
287
|
+
for (const name of ctx.inventory) {
|
|
288
|
+
const t = ctx.world.things.get(name);
|
|
289
|
+
if (t)
|
|
290
|
+
heldThings.push(t);
|
|
291
|
+
}
|
|
292
|
+
const matches = resolveThingInInventory(target, heldThings);
|
|
293
|
+
if (matches.length === 0) {
|
|
294
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You're not carrying '${target}'.` };
|
|
295
|
+
}
|
|
296
|
+
if (matches.length > 1) {
|
|
297
|
+
const names = matches.map(t => `'${t.name}'`);
|
|
298
|
+
return { prefix: "ERROR", code: "AMBIGUOUS", text: `Which do you mean: ${names.join(", ")}?` };
|
|
299
|
+
}
|
|
300
|
+
return { prefix: "OK", text: `You drop the ${matches[0].name}.` };
|
|
301
|
+
}
|
|
302
|
+
function handlePut(thingName, targetName, ctx) {
|
|
303
|
+
if (!ctx.currentRoom)
|
|
304
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated." };
|
|
305
|
+
if (!thingName)
|
|
306
|
+
return { prefix: "ERROR", code: "INVALID_INPUT", text: "Put what where?" };
|
|
307
|
+
const heldThing = getHeldThing(thingName, ctx);
|
|
308
|
+
if (!heldThing && ctx.inventory.includes(thingName.toLowerCase())) {
|
|
309
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You're not carrying '${thingName}'.` };
|
|
310
|
+
}
|
|
311
|
+
const targetThing = getThing(targetName, ctx);
|
|
312
|
+
if (!targetThing) {
|
|
313
|
+
// Try room name
|
|
314
|
+
const room = getRoom(targetName, ctx);
|
|
315
|
+
if (room) {
|
|
316
|
+
return { prefix: "OK", text: `You put the ${thingName} in ${targetName}.` };
|
|
317
|
+
}
|
|
318
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You see no '${targetName}' here.` };
|
|
319
|
+
}
|
|
320
|
+
if (targetThing.kind === "container") {
|
|
321
|
+
if (targetThing.openable && !targetThing.open) {
|
|
322
|
+
return { prefix: "ERROR", code: "RULE_VIOLATION", text: `The ${targetThing.name} is closed.`, correctiveAction: `Try: open ${targetThing.name} first.` };
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return { prefix: "OK", text: `You put the ${thingName} ${targetThing.kind === "supporter" ? "on" : "in"} the ${targetName}.` };
|
|
326
|
+
}
|
|
327
|
+
function handleOpen(target, ctx) {
|
|
328
|
+
if (!ctx.currentRoom)
|
|
329
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated." };
|
|
330
|
+
const thing = getThing(target, ctx);
|
|
331
|
+
if (!thing)
|
|
332
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You see no '${target}' here.` };
|
|
333
|
+
if (!thing.openable)
|
|
334
|
+
return { prefix: "ERROR", code: "RULE_VIOLATION", text: `The ${thing.name} cannot be opened.` };
|
|
335
|
+
if (thing.open)
|
|
336
|
+
return { prefix: "WARNING", text: `The ${thing.name} is already open.` };
|
|
337
|
+
if (thing.locked)
|
|
338
|
+
return { prefix: "WARNING", text: `The ${thing.name} is locked.`, correctiveAction: `Try: unlock ${thing.name} with <key>.` };
|
|
339
|
+
return { prefix: "OK", text: `You open the ${thing.name}.` };
|
|
340
|
+
}
|
|
341
|
+
function handleClose(target, ctx) {
|
|
342
|
+
if (!ctx.currentRoom)
|
|
343
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated." };
|
|
344
|
+
const thing = getThing(target, ctx);
|
|
345
|
+
if (!thing)
|
|
346
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You see no '${target}' here.` };
|
|
347
|
+
if (!thing.openable)
|
|
348
|
+
return { prefix: "ERROR", code: "RULE_VIOLATION", text: `The ${thing.name} cannot be closed.` };
|
|
349
|
+
if (!thing.open)
|
|
350
|
+
return { prefix: "WARNING", text: `The ${thing.name} is already closed.` };
|
|
351
|
+
return { prefix: "OK", text: `You close the ${thing.name}.` };
|
|
352
|
+
}
|
|
353
|
+
function handleUnlock(target, ctx) {
|
|
354
|
+
if (!ctx.currentRoom)
|
|
355
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated." };
|
|
356
|
+
const thing = getThing(target, ctx);
|
|
357
|
+
if (!thing)
|
|
358
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You see no '${target}' here.` };
|
|
359
|
+
if (!thing.lockable)
|
|
360
|
+
return { prefix: "ERROR", code: "RULE_VIOLATION", text: `The ${thing.name} is not lockable.` };
|
|
361
|
+
if (!thing.locked)
|
|
362
|
+
return { prefix: "WARNING", text: `The ${thing.name} is already unlocked.` };
|
|
363
|
+
const args = target.split(" with ");
|
|
364
|
+
const keyName = args[1];
|
|
365
|
+
if (keyName && !ctx.inventory.includes(keyName.toLowerCase())) {
|
|
366
|
+
return { prefix: "WARNING", text: `You need ${keyName} to unlock the ${thing.name}. You're not carrying it.` };
|
|
367
|
+
}
|
|
368
|
+
return { prefix: "OK", text: `You unlock the ${thing.name}.` };
|
|
369
|
+
}
|
|
370
|
+
function handleLock(target, ctx) {
|
|
371
|
+
if (!ctx.currentRoom)
|
|
372
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated." };
|
|
373
|
+
const thing = getThing(target, ctx);
|
|
374
|
+
if (!thing)
|
|
375
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You see no '${target}' here.` };
|
|
376
|
+
if (!thing.lockable)
|
|
377
|
+
return { prefix: "ERROR", code: "RULE_VIOLATION", text: `The ${thing.name} is not lockable.` };
|
|
378
|
+
if (thing.locked)
|
|
379
|
+
return { prefix: "WARNING", text: `The ${thing.name} is already locked.` };
|
|
380
|
+
if (thing.open)
|
|
381
|
+
return { prefix: "WARNING", text: `You must close the ${thing.name} before locking it.` };
|
|
382
|
+
const args = target.split(" with ");
|
|
383
|
+
const keyName = args[1];
|
|
384
|
+
if (keyName && !ctx.inventory.includes(keyName.toLowerCase())) {
|
|
385
|
+
return { prefix: "WARNING", text: `You need ${keyName} to lock the ${thing.name}. You're not carrying it.` };
|
|
386
|
+
}
|
|
387
|
+
return { prefix: "OK", text: `You lock the ${thing.name}.` };
|
|
388
|
+
}
|
|
389
|
+
function handleInventory(ctx) {
|
|
390
|
+
if (ctx.inventory.length === 0) {
|
|
391
|
+
return { prefix: "OK", text: "You are carrying nothing." };
|
|
392
|
+
}
|
|
393
|
+
const items = ctx.inventory.map(i => {
|
|
394
|
+
const thing = ctx.world.things.get(i);
|
|
395
|
+
return thing ? thing.name : i;
|
|
396
|
+
});
|
|
397
|
+
return { prefix: "OK", text: `You are carrying: ${items.join(", ")}.` };
|
|
398
|
+
}
|
|
399
|
+
function handleExamine(target, ctx) {
|
|
400
|
+
if (!ctx.currentRoom)
|
|
401
|
+
return { prefix: "ERROR", code: "STATE_CONFLICT", text: "The world model has not been populated." };
|
|
402
|
+
if (!target)
|
|
403
|
+
return { prefix: "ERROR", code: "INVALID_INPUT", text: "Examine what?" };
|
|
404
|
+
const thing = getThing(target, ctx);
|
|
405
|
+
if (thing) {
|
|
406
|
+
let text = thing.description || `You see nothing special about the ${thing.name}.`;
|
|
407
|
+
// Show container contents if open
|
|
408
|
+
if (thing.kind === "container" && thing.openable && thing.open) {
|
|
409
|
+
const contents = getThingsInContainer(thing.name, ctx);
|
|
410
|
+
if (contents.length > 0) {
|
|
411
|
+
text += `\n\nInside the ${thing.name}: ${contents.map(t => t.name).join(", ")}.`;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (thing.kind === "supporter") {
|
|
415
|
+
const contents = getThingsOnSupporter(thing.name, ctx);
|
|
416
|
+
if (contents.length > 0) {
|
|
417
|
+
text += `\n\nOn the ${thing.name}: ${contents.map(t => t.name).join(", ")}.`;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return { prefix: "OK", text };
|
|
421
|
+
}
|
|
422
|
+
return { prefix: "ERROR", code: "NOT_FOUND", text: `You see no '${target}' here.` };
|
|
423
|
+
}
|
|
424
|
+
export function resolveGoMovement(command, ctx) {
|
|
425
|
+
const result = dispatchCommand(command, ctx);
|
|
426
|
+
if (result.prefix !== "OK" && result.prefix !== "WARNING") {
|
|
427
|
+
return { newRoom: null, result };
|
|
428
|
+
}
|
|
429
|
+
// For go commands, determine the new room
|
|
430
|
+
const trimmed = command.trim();
|
|
431
|
+
const tokens = tokenize(trimmed);
|
|
432
|
+
if (tokens.length === 0)
|
|
433
|
+
return { newRoom: null, result };
|
|
434
|
+
const verb = tokens[0].toLowerCase();
|
|
435
|
+
let dir = "";
|
|
436
|
+
if (verb in DIRECTION_ALIASES)
|
|
437
|
+
dir = DIRECTION_ALIASES[verb];
|
|
438
|
+
else if (ROOM_DIRECTIONS.includes(verb))
|
|
439
|
+
dir = verb;
|
|
440
|
+
else if (verb === "go" || verb === "walk" || verb === "move")
|
|
441
|
+
dir = tokens[1] || "";
|
|
442
|
+
if (!dir)
|
|
443
|
+
return { newRoom: null, result };
|
|
444
|
+
const direction = dir.toLowerCase();
|
|
445
|
+
if (!ROOM_DIRECTIONS.includes(direction))
|
|
446
|
+
return { newRoom: null, result };
|
|
447
|
+
if (!ctx.currentRoom)
|
|
448
|
+
return { newRoom: null, result };
|
|
449
|
+
const room = ctx.world.rooms.get(ctx.currentRoom.toLowerCase());
|
|
450
|
+
if (!room)
|
|
451
|
+
return { newRoom: null, result };
|
|
452
|
+
// Check for door blocking
|
|
453
|
+
const doorName = room.doorRefs.get(direction);
|
|
454
|
+
if (doorName) {
|
|
455
|
+
const door = ctx.world.things.get(doorName.toLowerCase());
|
|
456
|
+
if (door && (!door.open || door.locked))
|
|
457
|
+
return { newRoom: null, result };
|
|
458
|
+
}
|
|
459
|
+
const target = room.exits.get(direction);
|
|
460
|
+
return { newRoom: target || null, result };
|
|
461
|
+
}
|
|
462
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/world/parser.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,wEAAwE;AAExE,OAAO,EAAgD,eAAe,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAgBtI,MAAM,iBAAiB,GAA2B;IAChD,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAC5C,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE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AAM,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1D,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC5E,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAsB,CAAC,CAAC;IACtD,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "holonovel",
|
|
3
|
+
"version": "2026.08.22",
|
|
4
|
+
"description": "Holonovel MCP server — world-model base for tabletop RPG play. Provides core scaffold (state management, badge gating, macros, enrichment) and world-model layer (rooms, things, exits, parser commands, kind hierarchy). Consumed by TTRPG servers as a build-time dependency.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"holonovel": "bin/holonovel.js"
|
|
9
|
+
},
|
|
10
|
+
"mcpName": "io.github.flukeatzerocool/holonovel",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/flukeatzerocool/holonovel.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"bin"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./dist/index.js",
|
|
21
|
+
"./core": "./dist/core/index.js",
|
|
22
|
+
"./world": "./dist/world/index.js"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.build.json",
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
27
|
+
"start": "tsx src/index.ts",
|
|
28
|
+
"dev": "tsx src/index.ts",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"inform",
|
|
33
|
+
"world-model",
|
|
34
|
+
"interactive-fiction",
|
|
35
|
+
"mcp",
|
|
36
|
+
"holonovel"
|
|
37
|
+
],
|
|
38
|
+
"author": "Holonovel",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
42
|
+
"zod": "^4.4.3"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^26.1.2",
|
|
46
|
+
"tsx": "^4.23.5",
|
|
47
|
+
"typescript": "^7.0.2"
|
|
48
|
+
}
|
|
49
|
+
}
|