@mythxengine/mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/__tests__/assemble.test.d.ts +2 -0
- package/dist/__tests__/assemble.test.d.ts.map +1 -0
- package/dist/__tests__/assemble.test.js +81 -0
- package/dist/__tests__/assemble.test.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/index.d.ts +9 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +202 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/server.d.ts +41 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +91 -0
- package/dist/server.js.map +1 -0
- package/dist/state/manager.d.ts +88 -0
- package/dist/state/manager.d.ts.map +1 -0
- package/dist/state/manager.js +308 -0
- package/dist/state/manager.js.map +1 -0
- package/dist/state/rules.d.ts +30 -0
- package/dist/state/rules.d.ts.map +1 -0
- package/dist/state/rules.js +61 -0
- package/dist/state/rules.js.map +1 -0
- package/dist/state/worldpacks.d.ts +43 -0
- package/dist/state/worldpacks.d.ts.map +1 -0
- package/dist/state/worldpacks.js +125 -0
- package/dist/state/worldpacks.js.map +1 -0
- package/dist/tools/augmentation/augment.d.ts +15 -0
- package/dist/tools/augmentation/augment.d.ts.map +1 -0
- package/dist/tools/augmentation/augment.js +512 -0
- package/dist/tools/augmentation/augment.js.map +1 -0
- package/dist/tools/augmentation/index.d.ts +6 -0
- package/dist/tools/augmentation/index.d.ts.map +1 -0
- package/dist/tools/augmentation/index.js +7 -0
- package/dist/tools/augmentation/index.js.map +1 -0
- package/dist/tools/characters.d.ts +26 -0
- package/dist/tools/characters.d.ts.map +1 -0
- package/dist/tools/characters.js +362 -0
- package/dist/tools/characters.js.map +1 -0
- package/dist/tools/clocks.d.ts +33 -0
- package/dist/tools/clocks.d.ts.map +1 -0
- package/dist/tools/clocks.js +438 -0
- package/dist/tools/clocks.js.map +1 -0
- package/dist/tools/combat.d.ts +38 -0
- package/dist/tools/combat.d.ts.map +1 -0
- package/dist/tools/combat.js +574 -0
- package/dist/tools/combat.js.map +1 -0
- package/dist/tools/dice.d.ts +9 -0
- package/dist/tools/dice.d.ts.map +1 -0
- package/dist/tools/dice.js +287 -0
- package/dist/tools/dice.js.map +1 -0
- package/dist/tools/encounters.d.ts +21 -0
- package/dist/tools/encounters.d.ts.map +1 -0
- package/dist/tools/encounters.js +521 -0
- package/dist/tools/encounters.js.map +1 -0
- package/dist/tools/engagement.d.ts +25 -0
- package/dist/tools/engagement.d.ts.map +1 -0
- package/dist/tools/engagement.js +491 -0
- package/dist/tools/engagement.js.map +1 -0
- package/dist/tools/expansion/archetype.d.ts +12 -0
- package/dist/tools/expansion/archetype.d.ts.map +1 -0
- package/dist/tools/expansion/archetype.js +157 -0
- package/dist/tools/expansion/archetype.js.map +1 -0
- package/dist/tools/expansion/index.d.ts +12 -0
- package/dist/tools/expansion/index.d.ts.map +1 -0
- package/dist/tools/expansion/index.js +21 -0
- package/dist/tools/expansion/index.js.map +1 -0
- package/dist/tools/expansion/location.d.ts +12 -0
- package/dist/tools/expansion/location.d.ts.map +1 -0
- package/dist/tools/expansion/location.js +149 -0
- package/dist/tools/expansion/location.js.map +1 -0
- package/dist/tools/expansion/monster.d.ts +12 -0
- package/dist/tools/expansion/monster.d.ts.map +1 -0
- package/dist/tools/expansion/monster.js +157 -0
- package/dist/tools/expansion/monster.js.map +1 -0
- package/dist/tools/expansion/npc.d.ts +12 -0
- package/dist/tools/expansion/npc.d.ts.map +1 -0
- package/dist/tools/expansion/npc.js +153 -0
- package/dist/tools/expansion/npc.js.map +1 -0
- package/dist/tools/generation/archetypes.d.ts +12 -0
- package/dist/tools/generation/archetypes.d.ts.map +1 -0
- package/dist/tools/generation/archetypes.js +129 -0
- package/dist/tools/generation/archetypes.js.map +1 -0
- package/dist/tools/generation/arcs.d.ts +13 -0
- package/dist/tools/generation/arcs.d.ts.map +1 -0
- package/dist/tools/generation/arcs.js +186 -0
- package/dist/tools/generation/arcs.js.map +1 -0
- package/dist/tools/generation/encounters.d.ts +12 -0
- package/dist/tools/generation/encounters.d.ts.map +1 -0
- package/dist/tools/generation/encounters.js +169 -0
- package/dist/tools/generation/encounters.js.map +1 -0
- package/dist/tools/generation/index.d.ts +19 -0
- package/dist/tools/generation/index.d.ts.map +1 -0
- package/dist/tools/generation/index.js +42 -0
- package/dist/tools/generation/index.js.map +1 -0
- package/dist/tools/generation/items.d.ts +12 -0
- package/dist/tools/generation/items.d.ts.map +1 -0
- package/dist/tools/generation/items.js +149 -0
- package/dist/tools/generation/items.js.map +1 -0
- package/dist/tools/generation/locations.d.ts +12 -0
- package/dist/tools/generation/locations.d.ts.map +1 -0
- package/dist/tools/generation/locations.js +131 -0
- package/dist/tools/generation/locations.js.map +1 -0
- package/dist/tools/generation/monsters.d.ts +12 -0
- package/dist/tools/generation/monsters.d.ts.map +1 -0
- package/dist/tools/generation/monsters.js +154 -0
- package/dist/tools/generation/monsters.js.map +1 -0
- package/dist/tools/generation/narrative.d.ts +12 -0
- package/dist/tools/generation/narrative.d.ts.map +1 -0
- package/dist/tools/generation/narrative.js +129 -0
- package/dist/tools/generation/narrative.js.map +1 -0
- package/dist/tools/generation/npcs.d.ts +12 -0
- package/dist/tools/generation/npcs.d.ts.map +1 -0
- package/dist/tools/generation/npcs.js +136 -0
- package/dist/tools/generation/npcs.js.map +1 -0
- package/dist/tools/generation/resume.d.ts +12 -0
- package/dist/tools/generation/resume.d.ts.map +1 -0
- package/dist/tools/generation/resume.js +288 -0
- package/dist/tools/generation/resume.js.map +1 -0
- package/dist/tools/generation/rules-prompt.d.ts +23 -0
- package/dist/tools/generation/rules-prompt.d.ts.map +1 -0
- package/dist/tools/generation/rules-prompt.js +209 -0
- package/dist/tools/generation/rules-prompt.js.map +1 -0
- package/dist/tools/generation/seed.d.ts +12 -0
- package/dist/tools/generation/seed.d.ts.map +1 -0
- package/dist/tools/generation/seed.js +171 -0
- package/dist/tools/generation/seed.js.map +1 -0
- package/dist/tools/generation/situations.d.ts +13 -0
- package/dist/tools/generation/situations.d.ts.map +1 -0
- package/dist/tools/generation/situations.js +247 -0
- package/dist/tools/generation/situations.js.map +1 -0
- package/dist/tools/gm-guidance.d.ts +13 -0
- package/dist/tools/gm-guidance.d.ts.map +1 -0
- package/dist/tools/gm-guidance.js +395 -0
- package/dist/tools/gm-guidance.js.map +1 -0
- package/dist/tools/index.d.ts +33 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +80 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/investigation.d.ts +41 -0
- package/dist/tools/investigation.d.ts.map +1 -0
- package/dist/tools/investigation.js +586 -0
- package/dist/tools/investigation.js.map +1 -0
- package/dist/tools/leads.d.ts +29 -0
- package/dist/tools/leads.d.ts.map +1 -0
- package/dist/tools/leads.js +460 -0
- package/dist/tools/leads.js.map +1 -0
- package/dist/tools/players.d.ts +30 -0
- package/dist/tools/players.d.ts.map +1 -0
- package/dist/tools/players.js +448 -0
- package/dist/tools/players.js.map +1 -0
- package/dist/tools/portable-clues.d.ts +29 -0
- package/dist/tools/portable-clues.d.ts.map +1 -0
- package/dist/tools/portable-clues.js +490 -0
- package/dist/tools/portable-clues.js.map +1 -0
- package/dist/tools/relationships.d.ts +29 -0
- package/dist/tools/relationships.d.ts.map +1 -0
- package/dist/tools/relationships.js +471 -0
- package/dist/tools/relationships.js.map +1 -0
- package/dist/tools/scene-framing.d.ts +21 -0
- package/dist/tools/scene-framing.d.ts.map +1 -0
- package/dist/tools/scene-framing.js +380 -0
- package/dist/tools/scene-framing.js.map +1 -0
- package/dist/tools/sessions.d.ts +30 -0
- package/dist/tools/sessions.d.ts.map +1 -0
- package/dist/tools/sessions.js +253 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/time.d.ts +26 -0
- package/dist/tools/time.d.ts.map +1 -0
- package/dist/tools/time.js +438 -0
- package/dist/tools/time.js.map +1 -0
- package/dist/tools/turns.d.ts +38 -0
- package/dist/tools/turns.d.ts.map +1 -0
- package/dist/tools/turns.js +560 -0
- package/dist/tools/turns.js.map +1 -0
- package/dist/tools/worldpack/assemble.d.ts +20 -0
- package/dist/tools/worldpack/assemble.d.ts.map +1 -0
- package/dist/tools/worldpack/assemble.js +237 -0
- package/dist/tools/worldpack/assemble.js.map +1 -0
- package/dist/tools/worldpack/docs-generator.d.ts +18 -0
- package/dist/tools/worldpack/docs-generator.d.ts.map +1 -0
- package/dist/tools/worldpack/docs-generator.js +264 -0
- package/dist/tools/worldpack/docs-generator.js.map +1 -0
- package/dist/tools/worldpack/export.d.ts +12 -0
- package/dist/tools/worldpack/export.d.ts.map +1 -0
- package/dist/tools/worldpack/export.js +209 -0
- package/dist/tools/worldpack/export.js.map +1 -0
- package/dist/tools/worldpack/index.d.ts +15 -0
- package/dist/tools/worldpack/index.d.ts.map +1 -0
- package/dist/tools/worldpack/index.js +30 -0
- package/dist/tools/worldpack/index.js.map +1 -0
- package/dist/tools/worldpack/lookup.d.ts +19 -0
- package/dist/tools/worldpack/lookup.d.ts.map +1 -0
- package/dist/tools/worldpack/lookup.js +320 -0
- package/dist/tools/worldpack/lookup.js.map +1 -0
- package/dist/tools/worldpack/manage.d.ts +20 -0
- package/dist/tools/worldpack/manage.d.ts.map +1 -0
- package/dist/tools/worldpack/manage.js +101 -0
- package/dist/tools/worldpack/manage.js.map +1 -0
- package/dist/tools/worldpack/save-result.d.ts +12 -0
- package/dist/tools/worldpack/save-result.d.ts.map +1 -0
- package/dist/tools/worldpack/save-result.js +222 -0
- package/dist/tools/worldpack/save-result.js.map +1 -0
- package/dist/tools/worldpack/summary.d.ts +13 -0
- package/dist/tools/worldpack/summary.d.ts.map +1 -0
- package/dist/tools/worldpack/summary.js +180 -0
- package/dist/tools/worldpack/summary.js.map +1 -0
- package/dist/tools/worldpack/validate.d.ts +12 -0
- package/dist/tools/worldpack/validate.d.ts.map +1 -0
- package/dist/tools/worldpack/validate.js +388 -0
- package/dist/tools/worldpack/validate.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* World Seed Generation Tool
|
|
3
|
+
*
|
|
4
|
+
* Creates the foundation for a new world from a campaign seed prompt.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { randomUUID } from "crypto";
|
|
8
|
+
import { createEmptyGenerationSession } from "@mythxengine/types";
|
|
9
|
+
import { sessionManager, ensureGenerationDir, writeManifest, createManifest, addManifestStep, } from "../../state/manager.js";
|
|
10
|
+
import { buildRulesPromptSection } from "./rules-prompt.js";
|
|
11
|
+
const GenerateWorldSeedInput = z.object({
|
|
12
|
+
sessionId: z.string(),
|
|
13
|
+
campaignSeed: z.string().describe("The creative prompt for world generation (e.g., 'noir detective in a steampunk city')"),
|
|
14
|
+
tier: z.enum(["small", "medium", "large"]).optional().default("medium").describe("World size: small (3 archetypes, 4 locations), medium (4 archetypes, 6 locations), large (6 archetypes, 10 locations)"),
|
|
15
|
+
settings: z.object({
|
|
16
|
+
lethality: z.enum(["low", "medium", "high", "brutal"]).optional(),
|
|
17
|
+
magicLevel: z.enum(["none", "rare", "common", "high"]).optional(),
|
|
18
|
+
technologyLevel: z.enum(["primitive", "medieval", "renaissance", "industrial", "modern", "futuristic"]).optional(),
|
|
19
|
+
supernaturalPresence: z.enum(["subtle", "common", "pervasive"]).optional(),
|
|
20
|
+
}).optional(),
|
|
21
|
+
/** Optional rules configuration for genre-specific mechanics */
|
|
22
|
+
rulesConfig: z.any().optional().describe("Optional rules configuration for custom abilities, mechanics, or tests"),
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* generate_world_seed tool
|
|
26
|
+
*/
|
|
27
|
+
export const generateWorldSeedTool = {
|
|
28
|
+
name: "generate_world_seed",
|
|
29
|
+
description: "Create the foundation for a new world from a campaign seed prompt. Returns a prompt for LLM execution.",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
sessionId: { type: "string", description: "Session ID" },
|
|
34
|
+
campaignSeed: { type: "string", description: "Creative prompt for world generation (e.g., 'noir detective in a steampunk city')" },
|
|
35
|
+
tier: {
|
|
36
|
+
type: "string",
|
|
37
|
+
enum: ["small", "medium", "large"],
|
|
38
|
+
description: "World size: small (3 archetypes, 4 locations), medium (4 archetypes, 6 locations), large (6 archetypes, 10 locations)"
|
|
39
|
+
},
|
|
40
|
+
settings: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
lethality: { type: "string", enum: ["low", "medium", "high", "brutal"] },
|
|
44
|
+
magicLevel: { type: "string", enum: ["none", "rare", "common", "high"] },
|
|
45
|
+
technologyLevel: { type: "string", enum: ["primitive", "medieval", "renaissance", "industrial", "modern", "futuristic"] },
|
|
46
|
+
supernaturalPresence: { type: "string", enum: ["subtle", "common", "pervasive"] },
|
|
47
|
+
},
|
|
48
|
+
description: "Optional world settings overrides"
|
|
49
|
+
},
|
|
50
|
+
rulesConfig: {
|
|
51
|
+
type: "object",
|
|
52
|
+
description: "Optional rules configuration for custom abilities, mechanics, or tests (e.g., Mothership-style panic checks)",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: ["sessionId", "campaignSeed"],
|
|
56
|
+
},
|
|
57
|
+
handler: async (args) => {
|
|
58
|
+
const input = GenerateWorldSeedInput.parse(args);
|
|
59
|
+
const session = await sessionManager.get(input.sessionId);
|
|
60
|
+
if (!session) {
|
|
61
|
+
throw new Error(`Session not found: ${input.sessionId}`);
|
|
62
|
+
}
|
|
63
|
+
// Initialize generation session if not present
|
|
64
|
+
if (!session.generation) {
|
|
65
|
+
session.generation = createEmptyGenerationSession();
|
|
66
|
+
}
|
|
67
|
+
// Check if already seeded
|
|
68
|
+
if (session.generation.worldSeed) {
|
|
69
|
+
throw new Error("World already seeded. Create a new session to generate a different world.");
|
|
70
|
+
}
|
|
71
|
+
const stepId = randomUUID();
|
|
72
|
+
const tier = input.tier || "medium";
|
|
73
|
+
const tierCounts = {
|
|
74
|
+
small: { archetypes: 3, locations: 4, npcs: 3, monsters: 6 },
|
|
75
|
+
medium: { archetypes: 4, locations: 6, npcs: 5, monsters: 10 },
|
|
76
|
+
large: { archetypes: 6, locations: 10, npcs: 8, monsters: 15 },
|
|
77
|
+
};
|
|
78
|
+
const counts = tierCounts[tier];
|
|
79
|
+
// Record the generation step
|
|
80
|
+
session.generation.history.push({
|
|
81
|
+
id: stepId,
|
|
82
|
+
type: "seed",
|
|
83
|
+
startedAt: new Date().toISOString(),
|
|
84
|
+
completedAt: null,
|
|
85
|
+
status: "in_progress",
|
|
86
|
+
generatedIds: [],
|
|
87
|
+
});
|
|
88
|
+
session.generation.status = "seeding";
|
|
89
|
+
await sessionManager.save(session);
|
|
90
|
+
// Create generation directory and initial manifest
|
|
91
|
+
await ensureGenerationDir(input.sessionId);
|
|
92
|
+
const manifest = createManifest(input.sessionId, input.campaignSeed, tier, input.settings, input.rulesConfig);
|
|
93
|
+
addManifestStep(manifest, "seed", "seed.json");
|
|
94
|
+
await writeManifest(input.sessionId, manifest);
|
|
95
|
+
// Build the rules section for the prompt
|
|
96
|
+
const rulesSection = buildRulesPromptSection(input.rulesConfig);
|
|
97
|
+
// Build the system prompt
|
|
98
|
+
const systemPrompt = `You are a world-building expert for tabletop RPGs. You create compelling, internally consistent worlds that are immediately playable.
|
|
99
|
+
|
|
100
|
+
Your output must be valid JSON matching the WorldSeed schema. Focus on:
|
|
101
|
+
- Creating a unique, evocative world concept
|
|
102
|
+
- Establishing clear aesthetic and tonal guidelines
|
|
103
|
+
- Seeding interesting archetypes, locations, NPCs, and monsters
|
|
104
|
+
- Ensuring the core conflict drives gameplay
|
|
105
|
+
|
|
106
|
+
${rulesSection}`;
|
|
107
|
+
// Build the user prompt
|
|
108
|
+
const settingsOverrides = input.settings ? `
|
|
109
|
+
|
|
110
|
+
The user has specified these settings:
|
|
111
|
+
${input.settings.lethality ? `- Lethality: ${input.settings.lethality}` : ""}
|
|
112
|
+
${input.settings.magicLevel ? `- Magic Level: ${input.settings.magicLevel}` : ""}
|
|
113
|
+
${input.settings.technologyLevel ? `- Technology Level: ${input.settings.technologyLevel}` : ""}
|
|
114
|
+
${input.settings.supernaturalPresence ? `- Supernatural Presence: ${input.settings.supernaturalPresence}` : ""}
|
|
115
|
+
` : "";
|
|
116
|
+
// Rules config JSON for inclusion in output (if provided)
|
|
117
|
+
const rulesConfigJson = input.rulesConfig
|
|
118
|
+
? `\n "rules": ${JSON.stringify(input.rulesConfig)},`
|
|
119
|
+
: "";
|
|
120
|
+
const userPrompt = `Create a world seed for this campaign concept:
|
|
121
|
+
|
|
122
|
+
<campaign_seed>
|
|
123
|
+
${input.campaignSeed}
|
|
124
|
+
</campaign_seed>
|
|
125
|
+
|
|
126
|
+
World size tier: ${input.tier || "medium"}
|
|
127
|
+
- ${counts.archetypes} archetype seeds (name + brief concept)
|
|
128
|
+
- ${counts.locations} location seeds (name + brief concept)
|
|
129
|
+
- ${counts.npcs} NPC seeds (name + brief concept)
|
|
130
|
+
- ${counts.monsters} monster seeds (name + concept + threat tier)
|
|
131
|
+
${settingsOverrides}
|
|
132
|
+
Output a JSON object with this structure:
|
|
133
|
+
{
|
|
134
|
+
"id": "world-id-slug",
|
|
135
|
+
"name": "World Name",
|
|
136
|
+
"tagline": "One-line hook",
|
|
137
|
+
"campaignSeed": "${input.campaignSeed}",
|
|
138
|
+
"aesthetic": {
|
|
139
|
+
"visualStyle": "Visual description",
|
|
140
|
+
"tone": "Emotional tone",
|
|
141
|
+
"themes": ["theme1", "theme2"],
|
|
142
|
+
"inspirations": ["inspiration1", "inspiration2"]
|
|
143
|
+
},
|
|
144
|
+
"settings": {
|
|
145
|
+
"lethality": "low|medium|high|brutal",
|
|
146
|
+
"magicLevel": "none|rare|common|high",
|
|
147
|
+
"technologyLevel": "primitive|medieval|renaissance|industrial|modern|futuristic",
|
|
148
|
+
"supernaturalPresence": "subtle|common|pervasive"
|
|
149
|
+
},${rulesConfigJson}
|
|
150
|
+
"coreConflict": "Description of the central conflict",
|
|
151
|
+
"archetypeSeeds": [{"name": "Name", "concept": "Brief concept"}],
|
|
152
|
+
"locationSeeds": [{"name": "Name", "concept": "Brief concept"}],
|
|
153
|
+
"npcSeeds": [{"name": "Name", "concept": "Brief concept"}],
|
|
154
|
+
"monsterSeeds": [{"name": "Name", "concept": "Brief concept", "threat": "minion|standard|elite|boss"}],
|
|
155
|
+
"createdAt": "${new Date().toISOString()}"
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
Return ONLY the JSON object, no markdown formatting or explanation.`;
|
|
159
|
+
return {
|
|
160
|
+
prompt: {
|
|
161
|
+
system: systemPrompt,
|
|
162
|
+
user: userPrompt,
|
|
163
|
+
outputSchemaName: "WorldSeed",
|
|
164
|
+
},
|
|
165
|
+
stepId,
|
|
166
|
+
message: `World seed generation initiated for: "${input.campaignSeed}". Execute the prompt with an LLM and call save_generation_result with the output.`,
|
|
167
|
+
};
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
export const seedTools = [generateWorldSeedTool];
|
|
171
|
+
//# sourceMappingURL=seed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../../src/tools/generation/seed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,sBAAsB,GAAG,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,CAAC,WAAW;YACvC,CAAC,CAAC,gBAAgB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG;YACtD,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,UAAU,GAAG;;;EAGrB,KAAK,CAAC,YAAY;;;mBAGD,KAAK,CAAC,IAAI,IAAI,QAAQ;IACrC,MAAM,CAAC,UAAU;IACjB,MAAM,CAAC,SAAS;IAChB,MAAM,CAAC,IAAI;IACX,MAAM,CAAC,QAAQ;EACjB,iBAAiB;;;;;;qBAME,KAAK,CAAC,YAAY;;;;;;;;;;;;MAYjC,eAAe;;;;;;kBAMH,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;;;oEAG0B,CAAC;QAEjE,OAAO;YACL,MAAM,EAAE;gBACN,MAAM,EAAE,YAAY;gBACpB,IAAI,EAAE,UAAU;gBAChB,gBAAgB,EAAE,WAAW;aAC9B;YACD,MAAM;YACN,OAAO,EAAE,yCAAyC,KAAK,CAAC,YAAY,oFAAoF;SACzJ,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Situation Generation Tool
|
|
3
|
+
*
|
|
4
|
+
* Generates situations (nodes) for Alexandrian-style node-based scenario design.
|
|
5
|
+
* Each situation represents a set of circumstances that will change without PC intervention.
|
|
6
|
+
*/
|
|
7
|
+
import type { MCPToolEntry } from "@mythxengine/types";
|
|
8
|
+
/**
|
|
9
|
+
* generate_situations tool
|
|
10
|
+
*/
|
|
11
|
+
export declare const generateSituationsTool: MCPToolEntry;
|
|
12
|
+
export declare const situationTools: MCPToolEntry[];
|
|
13
|
+
//# sourceMappingURL=situations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"situations.d.ts","sourceRoot":"","sources":["../../../src/tools/generation/situations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAcvD;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,YAuPpC,CAAC;AAEF,eAAO,MAAM,cAAc,gBAA2B,CAAC"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Situation Generation Tool
|
|
3
|
+
*
|
|
4
|
+
* Generates situations (nodes) for Alexandrian-style node-based scenario design.
|
|
5
|
+
* Each situation represents a set of circumstances that will change without PC intervention.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { randomUUID } from "crypto";
|
|
9
|
+
import { sessionManager, readManifest, writeManifest, addManifestStep, } from "../../state/manager.js";
|
|
10
|
+
const GenerateSituationsInput = z.object({
|
|
11
|
+
sessionId: z.string(),
|
|
12
|
+
count: z.number().min(1).max(20).optional().describe("Number of situations to generate (default: from world seed or 5)"),
|
|
13
|
+
focusOn: z.array(z.string()).optional().describe("Specific situation seeds to focus on (by name)"),
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* generate_situations tool
|
|
17
|
+
*/
|
|
18
|
+
export const generateSituationsTool = {
|
|
19
|
+
name: "generate_situations",
|
|
20
|
+
description: "Generate situations (nodes) based on the world seed using Alexandrian node-based design. Returns a prompt for LLM execution.",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
sessionId: { type: "string", description: "Session ID" },
|
|
25
|
+
count: { type: "number", description: "Number of situations to generate" },
|
|
26
|
+
focusOn: { type: "array", items: { type: "string" }, description: "Specific situation seeds to focus on" },
|
|
27
|
+
},
|
|
28
|
+
required: ["sessionId"],
|
|
29
|
+
},
|
|
30
|
+
handler: async (args) => {
|
|
31
|
+
const input = GenerateSituationsInput.parse(args);
|
|
32
|
+
const session = await sessionManager.get(input.sessionId);
|
|
33
|
+
if (!session) {
|
|
34
|
+
throw new Error(`Session not found: ${input.sessionId}`);
|
|
35
|
+
}
|
|
36
|
+
if (!session.generation?.worldSeed) {
|
|
37
|
+
throw new Error("World seed not found. Call generate_world_seed first.");
|
|
38
|
+
}
|
|
39
|
+
const worldSeed = session.generation.worldSeed;
|
|
40
|
+
// Get existing content for references
|
|
41
|
+
const existingNpcs = session.generation.generatedContent.npcs;
|
|
42
|
+
const existingLocations = session.generation.generatedContent.locations;
|
|
43
|
+
const stepId = randomUUID();
|
|
44
|
+
const situationSeeds = input.focusOn && worldSeed.situationSeeds
|
|
45
|
+
? worldSeed.situationSeeds.filter(s => input.focusOn.includes(s.name))
|
|
46
|
+
: worldSeed.situationSeeds || [];
|
|
47
|
+
const count = input.count || situationSeeds.length || 5;
|
|
48
|
+
// Record the generation step
|
|
49
|
+
session.generation.history.push({
|
|
50
|
+
id: stepId,
|
|
51
|
+
type: "situations",
|
|
52
|
+
startedAt: new Date().toISOString(),
|
|
53
|
+
completedAt: null,
|
|
54
|
+
status: "in_progress",
|
|
55
|
+
generatedIds: [],
|
|
56
|
+
});
|
|
57
|
+
session.generation.status = "generating";
|
|
58
|
+
await sessionManager.save(session);
|
|
59
|
+
// Update manifest
|
|
60
|
+
const manifest = await readManifest(input.sessionId);
|
|
61
|
+
if (manifest) {
|
|
62
|
+
addManifestStep(manifest, "situations", "situations.json");
|
|
63
|
+
manifest.status = "generating";
|
|
64
|
+
await writeManifest(input.sessionId, manifest);
|
|
65
|
+
}
|
|
66
|
+
const systemPrompt = `You are a scenario designer for tabletop RPGs, expert in The Alexandrian's node-based scenario design.
|
|
67
|
+
|
|
68
|
+
You create SITUATIONS - dynamic circumstances that will change without PC intervention. Each situation is a node in a navigable network connected by LEADS (clues that point to other situations).
|
|
69
|
+
|
|
70
|
+
Key Principles:
|
|
71
|
+
1. THREE CLUE RULE: Each important situation should have at least 3 ways to discover it
|
|
72
|
+
2. PROACTIVE ELEMENTS: Include clocks showing what happens if PCs don't act
|
|
73
|
+
3. LEADS AS EDGES: Connect situations with discoverable information
|
|
74
|
+
4. SITUATIONS NOT PLOTS: Describe circumstances, not predetermined events
|
|
75
|
+
|
|
76
|
+
Output valid JSON only.`;
|
|
77
|
+
const npcList = existingNpcs.length > 0
|
|
78
|
+
? `\nExisting NPCs (use these IDs):\n${existingNpcs.map(n => `- ${n.id}: ${n.name}`).join("\n")}`
|
|
79
|
+
: `\nNPC seeds (create IDs like "npc:slug-name"):\n${worldSeed.npcSeeds.map(n => `- ${n.name}: ${n.concept}`).join("\n")}`;
|
|
80
|
+
const locationList = existingLocations.length > 0
|
|
81
|
+
? `\nExisting Locations (use these IDs):\n${existingLocations.map(l => `- ${l.id}: ${l.name}`).join("\n")}`
|
|
82
|
+
: `\nLocation seeds (create IDs like "location:slug-name"):\n${worldSeed.locationSeeds.map(l => `- ${l.name}: ${l.concept}`).join("\n")}`;
|
|
83
|
+
const userPrompt = `Generate ${count} interconnected situations for this world:
|
|
84
|
+
|
|
85
|
+
World: ${worldSeed.name}
|
|
86
|
+
Tone: ${worldSeed.aesthetic.tone}
|
|
87
|
+
Themes: ${worldSeed.aesthetic.themes.join(", ")}
|
|
88
|
+
Core Conflict: ${worldSeed.coreConflict}
|
|
89
|
+
|
|
90
|
+
${situationSeeds.length > 0 ? `Situation seeds to develop:\n${situationSeeds.slice(0, count).map((s, i) => `${i + 1}. ${s.name}: ${s.concept}${s.urgency ? ` (urgency: ${s.urgency})` : ""}`).join("\n")}` : "Create situations that explore the core conflict from different angles."}
|
|
91
|
+
${npcList}
|
|
92
|
+
${locationList}
|
|
93
|
+
|
|
94
|
+
Output a JSON object:
|
|
95
|
+
{
|
|
96
|
+
"situations": [
|
|
97
|
+
{
|
|
98
|
+
"id": "situation:slug-name",
|
|
99
|
+
"name": "Situation Name",
|
|
100
|
+
"description": "What's happening and why it matters",
|
|
101
|
+
"status": "brewing",
|
|
102
|
+
|
|
103
|
+
"stakes": {
|
|
104
|
+
"risks": ["What could go wrong"],
|
|
105
|
+
"opportunities": ["What could be gained"],
|
|
106
|
+
"primaryVictim": "Who suffers if ignored (optional)",
|
|
107
|
+
"ifIgnored": "What happens without PC intervention"
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
"actors": [
|
|
111
|
+
{
|
|
112
|
+
"entityId": "npc:entity-id or faction:id",
|
|
113
|
+
"agenda": "What they want",
|
|
114
|
+
"leverage": "Their power/resources",
|
|
115
|
+
"defaultAction": "What they do if unopposed",
|
|
116
|
+
"isPrimaryAntagonist": true
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
|
|
120
|
+
"locations": {
|
|
121
|
+
"primary": ["location:main-location"],
|
|
122
|
+
"related": ["location:secondary"],
|
|
123
|
+
"details": {
|
|
124
|
+
"location:main-location": "Location-specific context"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
"clock": {
|
|
129
|
+
"id": "clock:situation-name",
|
|
130
|
+
"name": "Clock Name",
|
|
131
|
+
"doom": "What the clock counts toward",
|
|
132
|
+
"stages": [
|
|
133
|
+
{
|
|
134
|
+
"id": "stage-1",
|
|
135
|
+
"name": "Stage Name",
|
|
136
|
+
"description": "What happens",
|
|
137
|
+
"trigger": {
|
|
138
|
+
"type": "time",
|
|
139
|
+
"minutesFromStart": 1440
|
|
140
|
+
},
|
|
141
|
+
"consequences": {
|
|
142
|
+
"setFlags": ["flag-name"],
|
|
143
|
+
"narrative": "Description of what changes"
|
|
144
|
+
},
|
|
145
|
+
"reversible": true
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"currentStage": null,
|
|
149
|
+
"startedAt": null,
|
|
150
|
+
"paused": false
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
"outgoingLeads": [
|
|
154
|
+
{
|
|
155
|
+
"id": "lead:source-to-target-method",
|
|
156
|
+
"information": "What the lead reveals",
|
|
157
|
+
"targetSituationId": "situation:target-id",
|
|
158
|
+
"discovery": {
|
|
159
|
+
"method": "npc|location|investigation|observation|document|consequence|rumor|item",
|
|
160
|
+
"sourceId": "npc:or-location:id",
|
|
161
|
+
"description": "How to find this lead"
|
|
162
|
+
},
|
|
163
|
+
"prominence": "obvious|available|hidden|obscured"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
|
|
167
|
+
"entryPoints": {
|
|
168
|
+
"incomingLeadIds": [],
|
|
169
|
+
"directDiscovery": [
|
|
170
|
+
{
|
|
171
|
+
"method": "Observation",
|
|
172
|
+
"description": "How PCs can stumble upon this",
|
|
173
|
+
"locationId": "location:where"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"minimumLeadsTarget": 3
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
"complications": [
|
|
180
|
+
{
|
|
181
|
+
"id": "comp-1",
|
|
182
|
+
"description": "What makes this hard",
|
|
183
|
+
"type": "obstacle|opposition|moral|resource|time|information|relationship",
|
|
184
|
+
"resolutions": ["Possible way to resolve"]
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
|
|
188
|
+
"outcomes": {
|
|
189
|
+
"victory": {
|
|
190
|
+
"description": "Full success",
|
|
191
|
+
"consequences": ["What changes"],
|
|
192
|
+
"flagsSet": ["victory-flag"]
|
|
193
|
+
},
|
|
194
|
+
"failure": {
|
|
195
|
+
"description": "Complete failure",
|
|
196
|
+
"consequences": ["What goes wrong"],
|
|
197
|
+
"flagsSet": ["failure-flag"]
|
|
198
|
+
},
|
|
199
|
+
"partial": [
|
|
200
|
+
{
|
|
201
|
+
"name": "Partial Success",
|
|
202
|
+
"description": "Mixed outcome",
|
|
203
|
+
"consequences": ["Some good, some bad"],
|
|
204
|
+
"flagsSet": ["partial-flag"]
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
"gmGuidance": {
|
|
210
|
+
"themes": ["Thematic elements"],
|
|
211
|
+
"toneNotes": "How to run this",
|
|
212
|
+
"anticipatedApproaches": [
|
|
213
|
+
{
|
|
214
|
+
"approach": "Players might try...",
|
|
215
|
+
"response": "NPCs/world responds by..."
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"foreshadowing": ["Hints to drop earlier"]
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
"tags": ["tag1", "tag2"],
|
|
222
|
+
"layer": 1
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
IMPORTANT:
|
|
228
|
+
- Create leads that connect situations to each other
|
|
229
|
+
- Ensure each situation has at least 3 entry points (leads + direct discovery)
|
|
230
|
+
- Include clocks for time-sensitive situations
|
|
231
|
+
- Vary discovery methods and prominence levels
|
|
232
|
+
- Connect actors to NPCs and locations
|
|
233
|
+
|
|
234
|
+
Return ONLY the JSON object, no markdown formatting.`;
|
|
235
|
+
return {
|
|
236
|
+
prompt: {
|
|
237
|
+
system: systemPrompt,
|
|
238
|
+
user: userPrompt,
|
|
239
|
+
outputSchemaName: "WorldSituation[]",
|
|
240
|
+
},
|
|
241
|
+
stepId,
|
|
242
|
+
message: `Situation generation initiated for ${count} situations. Execute the prompt and call save_generation_result.`,
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
export const situationTools = [generateSituationsTool];
|
|
247
|
+
//# sourceMappingURL=situations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"situations.js","sourceRoot":"","sources":["../../../src/tools/generation/situations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CA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E,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,yEAAyE;EACpR,OAAO;EACP,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDA8IuC,CAAC;QAElD,OAAO;YACL,MAAM,EAAE;gBACN,MAAM,EAAE,YAAY;gBACpB,IAAI,EAAE,UAAU;gBAChB,gBAAgB,EAAE,kBAAkB;aACrC;YACD,MAAM;YACN,OAAO,EAAE,sCAAsC,KAAK,kEAAkE;SACvH,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GM Context & Guidance Tool
|
|
3
|
+
*
|
|
4
|
+
* Provides context-aware GM advice during gameplay.
|
|
5
|
+
* Makes the wisdom from GM prompts operationally accessible.
|
|
6
|
+
*/
|
|
7
|
+
import type { MCPToolEntry } from "@mythxengine/types";
|
|
8
|
+
/**
|
|
9
|
+
* get_gm_guidance tool
|
|
10
|
+
*/
|
|
11
|
+
export declare const getGmGuidanceTool: MCPToolEntry;
|
|
12
|
+
export declare const gmGuidanceTools: MCPToolEntry[];
|
|
13
|
+
//# sourceMappingURL=gm-guidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gm-guidance.d.ts","sourceRoot":"","sources":["../../src/tools/gm-guidance.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAY,MAAM,oBAAoB,CAAC;AAycjE;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAoE/B,CAAC;AAEF,eAAO,MAAM,eAAe,gBAAsB,CAAC"}
|