run-dmcp 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 +22 -0
- package/README.md +79 -0
- package/dist/__tests__/engineVocabulary.test.d.ts +1 -0
- package/dist/__tests__/engineVocabulary.test.js +147 -0
- package/dist/db/__tests__/connection.test.d.ts +1 -0
- package/dist/db/__tests__/connection.test.js +72 -0
- package/dist/db/__tests__/testDb.d.ts +33 -0
- package/dist/db/__tests__/testDb.js +41 -0
- package/dist/db/connection.d.ts +22 -0
- package/dist/db/connection.js +107 -0
- package/dist/db/schema.d.ts +1 -0
- package/dist/db/schema.js +725 -0
- package/dist/events/emitter.d.ts +22 -0
- package/dist/events/emitter.js +71 -0
- package/dist/http/server.d.ts +3 -0
- package/dist/http/server.js +649 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +92 -0
- package/dist/register/abilities.d.ts +2 -0
- package/dist/register/abilities.js +165 -0
- package/dist/register/audio.d.ts +2 -0
- package/dist/register/audio.js +326 -0
- package/dist/register/batch.d.ts +2 -0
- package/dist/register/batch.js +343 -0
- package/dist/register/character.d.ts +2 -0
- package/dist/register/character.js +324 -0
- package/dist/register/combat.d.ts +2 -0
- package/dist/register/combat.js +207 -0
- package/dist/register/core.d.ts +2 -0
- package/dist/register/core.js +1040 -0
- package/dist/register/display.d.ts +2 -0
- package/dist/register/display.js +263 -0
- package/dist/register/factions.d.ts +2 -0
- package/dist/register/factions.js +186 -0
- package/dist/register/images.d.ts +2 -0
- package/dist/register/images.js +400 -0
- package/dist/register/inventory.d.ts +2 -0
- package/dist/register/inventory.js +115 -0
- package/dist/register/mcp-prompts.d.ts +2 -0
- package/dist/register/mcp-prompts.js +684 -0
- package/dist/register/mcp-resources.d.ts +2 -0
- package/dist/register/mcp-resources.js +335 -0
- package/dist/register/narrative.d.ts +2 -0
- package/dist/register/narrative.js +242 -0
- package/dist/register/notes.d.ts +2 -0
- package/dist/register/notes.js +170 -0
- package/dist/register/pause.d.ts +2 -0
- package/dist/register/pause.js +580 -0
- package/dist/register/quests.d.ts +2 -0
- package/dist/register/quests.js +118 -0
- package/dist/register/relationships.d.ts +2 -0
- package/dist/register/relationships.js +147 -0
- package/dist/register/resources.d.ts +2 -0
- package/dist/register/resources.js +277 -0
- package/dist/register/secrets.d.ts +2 -0
- package/dist/register/secrets.js +192 -0
- package/dist/register/status.d.ts +2 -0
- package/dist/register/status.js +130 -0
- package/dist/register/tables.d.ts +2 -0
- package/dist/register/tables.js +146 -0
- package/dist/register/tags.d.ts +2 -0
- package/dist/register/tags.js +114 -0
- package/dist/register/time.d.ts +2 -0
- package/dist/register/time.js +281 -0
- package/dist/register/world.d.ts +2 -0
- package/dist/register/world.js +127 -0
- package/dist/schemas/index.d.ts +921 -0
- package/dist/schemas/index.js +121 -0
- package/dist/test-setup.d.ts +1 -0
- package/dist/test-setup.js +13 -0
- package/dist/tools/__tests__/audio.test.d.ts +1 -0
- package/dist/tools/__tests__/audio.test.js +59 -0
- package/dist/tools/__tests__/conserved.test.d.ts +1 -0
- package/dist/tools/__tests__/conserved.test.js +488 -0
- package/dist/tools/__tests__/constraint.test.d.ts +1 -0
- package/dist/tools/__tests__/constraint.test.js +212 -0
- package/dist/tools/__tests__/expiry-consequences.test.d.ts +1 -0
- package/dist/tools/__tests__/expiry-consequences.test.js +110 -0
- package/dist/tools/__tests__/images.test.d.ts +1 -0
- package/dist/tools/__tests__/images.test.js +59 -0
- package/dist/tools/__tests__/relationship.test.d.ts +1 -0
- package/dist/tools/__tests__/relationship.test.js +132 -0
- package/dist/tools/__tests__/resource-constraints.test.d.ts +1 -0
- package/dist/tools/__tests__/resource-constraints.test.js +131 -0
- package/dist/tools/__tests__/resource.test.d.ts +1 -0
- package/dist/tools/__tests__/resource.test.js +190 -0
- package/dist/tools/__tests__/time.test.d.ts +1 -0
- package/dist/tools/__tests__/time.test.js +404 -0
- package/dist/tools/__tests__/timers.test.d.ts +1 -0
- package/dist/tools/__tests__/timers.test.js +426 -0
- package/dist/tools/__tests__/world.test.d.ts +1 -0
- package/dist/tools/__tests__/world.test.js +70 -0
- package/dist/tools/ability.d.ts +48 -0
- package/dist/tools/ability.js +238 -0
- package/dist/tools/audio.d.ts +24 -0
- package/dist/tools/audio.js +365 -0
- package/dist/tools/character.d.ts +70 -0
- package/dist/tools/character.js +309 -0
- package/dist/tools/combat.d.ts +13 -0
- package/dist/tools/combat.js +195 -0
- package/dist/tools/constraint.d.ts +132 -0
- package/dist/tools/constraint.js +269 -0
- package/dist/tools/dice.d.ts +23 -0
- package/dist/tools/dice.js +111 -0
- package/dist/tools/display.d.ts +120 -0
- package/dist/tools/display.js +528 -0
- package/dist/tools/faction.d.ts +61 -0
- package/dist/tools/faction.js +269 -0
- package/dist/tools/game.d.ts +96 -0
- package/dist/tools/game.js +526 -0
- package/dist/tools/image-prompt.d.ts +49 -0
- package/dist/tools/image-prompt.js +479 -0
- package/dist/tools/images.d.ts +47 -0
- package/dist/tools/images.js +449 -0
- package/dist/tools/inventory.d.ts +20 -0
- package/dist/tools/inventory.js +145 -0
- package/dist/tools/narrative.d.ts +58 -0
- package/dist/tools/narrative.js +237 -0
- package/dist/tools/notes.d.ts +41 -0
- package/dist/tools/notes.js +220 -0
- package/dist/tools/pause.d.ts +110 -0
- package/dist/tools/pause.js +1254 -0
- package/dist/tools/quest.d.ts +34 -0
- package/dist/tools/quest.js +164 -0
- package/dist/tools/relationship.d.ts +74 -0
- package/dist/tools/relationship.js +324 -0
- package/dist/tools/resource.d.ts +93 -0
- package/dist/tools/resource.js +374 -0
- package/dist/tools/rules.d.ts +4 -0
- package/dist/tools/rules.js +30 -0
- package/dist/tools/secrets.d.ts +49 -0
- package/dist/tools/secrets.js +195 -0
- package/dist/tools/status.d.ts +36 -0
- package/dist/tools/status.js +218 -0
- package/dist/tools/tables.d.ts +33 -0
- package/dist/tools/tables.js +209 -0
- package/dist/tools/tags.d.ts +52 -0
- package/dist/tools/tags.js +176 -0
- package/dist/tools/time.d.ts +33 -0
- package/dist/tools/time.js +276 -0
- package/dist/tools/timers.d.ts +41 -0
- package/dist/tools/timers.js +215 -0
- package/dist/tools/world.d.ts +78 -0
- package/dist/tools/world.js +331 -0
- package/dist/types/index.d.ts +969 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/__tests__/json.test.d.ts +1 -0
- package/dist/utils/__tests__/json.test.js +55 -0
- package/dist/utils/__tests__/validation.test.d.ts +1 -0
- package/dist/utils/__tests__/validation.test.js +90 -0
- package/dist/utils/errors.d.ts +44 -0
- package/dist/utils/errors.js +121 -0
- package/dist/utils/json.d.ts +9 -0
- package/dist/utils/json.js +23 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.js +50 -0
- package/dist/utils/output-schemas.d.ts +594 -0
- package/dist/utils/output-schemas.js +331 -0
- package/dist/utils/tool-annotations.d.ts +147 -0
- package/dist/utils/tool-annotations.js +98 -0
- package/dist/utils/validation.d.ts +34 -0
- package/dist/utils/validation.js +52 -0
- package/dist/utils/verbosity.d.ts +57 -0
- package/dist/utils/verbosity.js +67 -0
- package/dist/utils/webui.d.ts +20 -0
- package/dist/utils/webui.js +35 -0
- package/package.json +75 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from "uuid";
|
|
2
|
+
import { getDatabase } from "../db/connection.js";
|
|
3
|
+
import { safeJsonParse } from "../utils/json.js";
|
|
4
|
+
import { validateGameExists } from "./game.js";
|
|
5
|
+
export function createFaction(params) {
|
|
6
|
+
// Validate game exists to prevent orphaned records
|
|
7
|
+
validateGameExists(params.gameId);
|
|
8
|
+
const db = getDatabase();
|
|
9
|
+
const id = uuidv4();
|
|
10
|
+
const now = new Date().toISOString();
|
|
11
|
+
db.prepare(`
|
|
12
|
+
INSERT INTO factions (id, game_id, name, description, leader_id, headquarters_id, resources, goals, traits, status, created_at)
|
|
13
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
14
|
+
`).run(id, params.gameId, params.name, params.description || "", params.leaderId || null, params.headquartersId || null, JSON.stringify(params.resources || {}), JSON.stringify(params.goals || []), JSON.stringify(params.traits || []), params.status || "active", now);
|
|
15
|
+
return {
|
|
16
|
+
id,
|
|
17
|
+
gameId: params.gameId,
|
|
18
|
+
name: params.name,
|
|
19
|
+
description: params.description || "",
|
|
20
|
+
leaderId: params.leaderId || null,
|
|
21
|
+
headquartersId: params.headquartersId || null,
|
|
22
|
+
resources: params.resources || {},
|
|
23
|
+
goals: params.goals || [],
|
|
24
|
+
traits: params.traits || [],
|
|
25
|
+
status: params.status || "active",
|
|
26
|
+
createdAt: now,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function getFaction(id) {
|
|
30
|
+
const db = getDatabase();
|
|
31
|
+
const row = db.prepare(`SELECT * FROM factions WHERE id = ?`).get(id);
|
|
32
|
+
if (!row)
|
|
33
|
+
return null;
|
|
34
|
+
return {
|
|
35
|
+
id: row.id,
|
|
36
|
+
gameId: row.game_id,
|
|
37
|
+
name: row.name,
|
|
38
|
+
description: row.description,
|
|
39
|
+
leaderId: row.leader_id,
|
|
40
|
+
headquartersId: row.headquarters_id,
|
|
41
|
+
resources: safeJsonParse(row.resources || "{}", {}),
|
|
42
|
+
goals: safeJsonParse(row.goals || "[]", []),
|
|
43
|
+
traits: safeJsonParse(row.traits || "[]", []),
|
|
44
|
+
status: row.status,
|
|
45
|
+
createdAt: row.created_at,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function updateFaction(id, updates) {
|
|
49
|
+
const db = getDatabase();
|
|
50
|
+
const current = getFaction(id);
|
|
51
|
+
if (!current)
|
|
52
|
+
return null;
|
|
53
|
+
const newName = updates.name ?? current.name;
|
|
54
|
+
const newDescription = updates.description ?? current.description;
|
|
55
|
+
const newLeaderId = updates.leaderId !== undefined ? updates.leaderId : current.leaderId;
|
|
56
|
+
const newHeadquartersId = updates.headquartersId !== undefined ? updates.headquartersId : current.headquartersId;
|
|
57
|
+
const newTraits = updates.traits ?? current.traits;
|
|
58
|
+
const newStatus = updates.status ?? current.status;
|
|
59
|
+
db.prepare(`
|
|
60
|
+
UPDATE factions
|
|
61
|
+
SET name = ?, description = ?, leader_id = ?, headquarters_id = ?, traits = ?, status = ?
|
|
62
|
+
WHERE id = ?
|
|
63
|
+
`).run(newName, newDescription, newLeaderId, newHeadquartersId, JSON.stringify(newTraits), newStatus, id);
|
|
64
|
+
return {
|
|
65
|
+
...current,
|
|
66
|
+
name: newName,
|
|
67
|
+
description: newDescription,
|
|
68
|
+
leaderId: newLeaderId,
|
|
69
|
+
headquartersId: newHeadquartersId,
|
|
70
|
+
traits: newTraits,
|
|
71
|
+
status: newStatus,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function deleteFaction(id) {
|
|
75
|
+
const db = getDatabase();
|
|
76
|
+
const result = db.prepare(`DELETE FROM factions WHERE id = ?`).run(id);
|
|
77
|
+
return result.changes > 0;
|
|
78
|
+
}
|
|
79
|
+
export function listFactions(gameId, filter) {
|
|
80
|
+
const db = getDatabase();
|
|
81
|
+
let query = `SELECT * FROM factions WHERE game_id = ?`;
|
|
82
|
+
const params = [gameId];
|
|
83
|
+
if (filter?.status) {
|
|
84
|
+
query += ` AND status = ?`;
|
|
85
|
+
params.push(filter.status);
|
|
86
|
+
}
|
|
87
|
+
query += ` ORDER BY name`;
|
|
88
|
+
const rows = db.prepare(query).all(...params);
|
|
89
|
+
return rows.map(row => ({
|
|
90
|
+
id: row.id,
|
|
91
|
+
gameId: row.game_id,
|
|
92
|
+
name: row.name,
|
|
93
|
+
description: row.description,
|
|
94
|
+
leaderId: row.leader_id,
|
|
95
|
+
headquartersId: row.headquarters_id,
|
|
96
|
+
resources: safeJsonParse(row.resources || "{}", {}),
|
|
97
|
+
goals: safeJsonParse(row.goals || "[]", []),
|
|
98
|
+
traits: safeJsonParse(row.traits || "[]", []),
|
|
99
|
+
status: row.status,
|
|
100
|
+
createdAt: row.created_at,
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
export function modifyFactionResource(params) {
|
|
104
|
+
const db = getDatabase();
|
|
105
|
+
const faction = getFaction(params.factionId);
|
|
106
|
+
if (!faction)
|
|
107
|
+
return null;
|
|
108
|
+
const newResources = { ...faction.resources };
|
|
109
|
+
newResources[params.resource] = (newResources[params.resource] || 0) + params.delta;
|
|
110
|
+
// Remove resource if zero or negative
|
|
111
|
+
if (newResources[params.resource] <= 0) {
|
|
112
|
+
delete newResources[params.resource];
|
|
113
|
+
}
|
|
114
|
+
db.prepare(`UPDATE factions SET resources = ? WHERE id = ?`)
|
|
115
|
+
.run(JSON.stringify(newResources), params.factionId);
|
|
116
|
+
return { ...faction, resources: newResources };
|
|
117
|
+
}
|
|
118
|
+
export function setFactionResource(params) {
|
|
119
|
+
const db = getDatabase();
|
|
120
|
+
const faction = getFaction(params.factionId);
|
|
121
|
+
if (!faction)
|
|
122
|
+
return null;
|
|
123
|
+
const newResources = { ...faction.resources };
|
|
124
|
+
if (params.value <= 0) {
|
|
125
|
+
delete newResources[params.resource];
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
newResources[params.resource] = params.value;
|
|
129
|
+
}
|
|
130
|
+
db.prepare(`UPDATE factions SET resources = ? WHERE id = ?`)
|
|
131
|
+
.run(JSON.stringify(newResources), params.factionId);
|
|
132
|
+
return { ...faction, resources: newResources };
|
|
133
|
+
}
|
|
134
|
+
export function addFactionGoal(factionId, goal) {
|
|
135
|
+
const db = getDatabase();
|
|
136
|
+
const faction = getFaction(factionId);
|
|
137
|
+
if (!faction)
|
|
138
|
+
return null;
|
|
139
|
+
const newGoals = [...faction.goals, goal];
|
|
140
|
+
db.prepare(`UPDATE factions SET goals = ? WHERE id = ?`)
|
|
141
|
+
.run(JSON.stringify(newGoals), factionId);
|
|
142
|
+
return { ...faction, goals: newGoals };
|
|
143
|
+
}
|
|
144
|
+
export function completeFactionGoal(factionId, goalIndex) {
|
|
145
|
+
const db = getDatabase();
|
|
146
|
+
const faction = getFaction(factionId);
|
|
147
|
+
if (!faction)
|
|
148
|
+
return null;
|
|
149
|
+
if (goalIndex < 0 || goalIndex >= faction.goals.length) {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
const newGoals = faction.goals.filter((_, i) => i !== goalIndex);
|
|
153
|
+
db.prepare(`UPDATE factions SET goals = ? WHERE id = ?`)
|
|
154
|
+
.run(JSON.stringify(newGoals), factionId);
|
|
155
|
+
return { ...faction, goals: newGoals };
|
|
156
|
+
}
|
|
157
|
+
export function addFactionTrait(factionId, trait) {
|
|
158
|
+
const db = getDatabase();
|
|
159
|
+
const faction = getFaction(factionId);
|
|
160
|
+
if (!faction)
|
|
161
|
+
return null;
|
|
162
|
+
if (faction.traits.includes(trait)) {
|
|
163
|
+
return faction;
|
|
164
|
+
}
|
|
165
|
+
const newTraits = [...faction.traits, trait];
|
|
166
|
+
db.prepare(`UPDATE factions SET traits = ? WHERE id = ?`)
|
|
167
|
+
.run(JSON.stringify(newTraits), factionId);
|
|
168
|
+
return { ...faction, traits: newTraits };
|
|
169
|
+
}
|
|
170
|
+
export function removeFactionTrait(factionId, trait) {
|
|
171
|
+
const db = getDatabase();
|
|
172
|
+
const faction = getFaction(factionId);
|
|
173
|
+
if (!faction)
|
|
174
|
+
return null;
|
|
175
|
+
const newTraits = faction.traits.filter(t => t !== trait);
|
|
176
|
+
db.prepare(`UPDATE factions SET traits = ? WHERE id = ?`)
|
|
177
|
+
.run(JSON.stringify(newTraits), factionId);
|
|
178
|
+
return { ...faction, traits: newTraits };
|
|
179
|
+
}
|
|
180
|
+
// ============================================================================
|
|
181
|
+
// CONSOLIDATED OPERATIONS
|
|
182
|
+
// ============================================================================
|
|
183
|
+
export function modifyFactionTraits(factionId, params) {
|
|
184
|
+
const db = getDatabase();
|
|
185
|
+
const faction = getFaction(factionId);
|
|
186
|
+
if (!faction)
|
|
187
|
+
return null;
|
|
188
|
+
let newTraits = [...faction.traits];
|
|
189
|
+
const added = [];
|
|
190
|
+
const removed = [];
|
|
191
|
+
// Remove traits first
|
|
192
|
+
if (params.remove?.length) {
|
|
193
|
+
for (const trait of params.remove) {
|
|
194
|
+
if (newTraits.includes(trait)) {
|
|
195
|
+
newTraits = newTraits.filter(t => t !== trait);
|
|
196
|
+
removed.push(trait);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Then add new traits
|
|
201
|
+
if (params.add?.length) {
|
|
202
|
+
for (const trait of params.add) {
|
|
203
|
+
if (!newTraits.includes(trait)) {
|
|
204
|
+
newTraits.push(trait);
|
|
205
|
+
added.push(trait);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
db.prepare(`UPDATE factions SET traits = ? WHERE id = ?`)
|
|
210
|
+
.run(JSON.stringify(newTraits), factionId);
|
|
211
|
+
return {
|
|
212
|
+
faction: { ...faction, traits: newTraits },
|
|
213
|
+
added,
|
|
214
|
+
removed,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export function modifyFactionGoals(factionId, params) {
|
|
218
|
+
const db = getDatabase();
|
|
219
|
+
const faction = getFaction(factionId);
|
|
220
|
+
if (!faction)
|
|
221
|
+
return null;
|
|
222
|
+
const newGoals = [...faction.goals];
|
|
223
|
+
const added = [];
|
|
224
|
+
const completed = [];
|
|
225
|
+
// Complete goals first (by index, descending to preserve indices)
|
|
226
|
+
if (params.complete?.length) {
|
|
227
|
+
const sortedIndices = [...params.complete].sort((a, b) => b - a);
|
|
228
|
+
for (const index of sortedIndices) {
|
|
229
|
+
if (index >= 0 && index < newGoals.length) {
|
|
230
|
+
completed.push(newGoals[index]);
|
|
231
|
+
newGoals.splice(index, 1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// Then add new goals
|
|
236
|
+
if (params.add?.length) {
|
|
237
|
+
for (const goal of params.add) {
|
|
238
|
+
newGoals.push(goal);
|
|
239
|
+
added.push(goal);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
db.prepare(`UPDATE factions SET goals = ? WHERE id = ?`)
|
|
243
|
+
.run(JSON.stringify(newGoals), factionId);
|
|
244
|
+
return {
|
|
245
|
+
faction: { ...faction, goals: newGoals },
|
|
246
|
+
added,
|
|
247
|
+
completed,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export function updateFactionResource(params) {
|
|
251
|
+
const db = getDatabase();
|
|
252
|
+
const faction = getFaction(params.factionId);
|
|
253
|
+
if (!faction)
|
|
254
|
+
return null;
|
|
255
|
+
const newResources = { ...faction.resources };
|
|
256
|
+
if (params.mode === "delta") {
|
|
257
|
+
newResources[params.resource] = (newResources[params.resource] || 0) + params.value;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
newResources[params.resource] = params.value;
|
|
261
|
+
}
|
|
262
|
+
// Remove resource if zero or negative
|
|
263
|
+
if (newResources[params.resource] <= 0) {
|
|
264
|
+
delete newResources[params.resource];
|
|
265
|
+
}
|
|
266
|
+
db.prepare(`UPDATE factions SET resources = ? WHERE id = ?`)
|
|
267
|
+
.run(JSON.stringify(newResources), params.factionId);
|
|
268
|
+
return { ...faction, resources: newResources };
|
|
269
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Game, GamePreferences, ImageGenerationPreferences, ImageGenerationPreset, ImagePromptTemplate } from "../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Validates that a game exists and returns it, or throws an error if not found.
|
|
4
|
+
* Use this in create operations to prevent orphaned records.
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateGameExists(gameId: string): Game;
|
|
7
|
+
export declare function createGame(params: {
|
|
8
|
+
name: string;
|
|
9
|
+
setting: string;
|
|
10
|
+
style: string;
|
|
11
|
+
preferences?: GamePreferences;
|
|
12
|
+
}): Game;
|
|
13
|
+
export declare function loadGame(id: string): Game | null;
|
|
14
|
+
export declare function listGames(): Game[];
|
|
15
|
+
export declare function listGameSummaries(): import("../types/index.js").GameSummary[];
|
|
16
|
+
export declare function updateGamePreferences(gameId: string, preferences: GamePreferences): boolean;
|
|
17
|
+
export declare function getGamePreferences(gameId: string): GamePreferences | null;
|
|
18
|
+
export declare function deleteGame(id: string): boolean;
|
|
19
|
+
export declare function updateGameLocation(gameId: string, locationId: string | null): boolean;
|
|
20
|
+
export declare function updateGame(gameId: string, updates: {
|
|
21
|
+
name?: string;
|
|
22
|
+
setting?: string;
|
|
23
|
+
style?: string;
|
|
24
|
+
}): Game | null;
|
|
25
|
+
export declare function setGameTitleImage(gameId: string, imageId: string | null): Game | null;
|
|
26
|
+
export declare function setGameFavicon(gameId: string, imageId: string | null): Game | null;
|
|
27
|
+
export interface GameMenuResult {
|
|
28
|
+
hasExistingGames: boolean;
|
|
29
|
+
games: Array<{
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
setting: string;
|
|
33
|
+
style: string;
|
|
34
|
+
lastPlayed: string;
|
|
35
|
+
characterCount: number;
|
|
36
|
+
locationCount: number;
|
|
37
|
+
}>;
|
|
38
|
+
instruction: string;
|
|
39
|
+
visualizationTip: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function getGameMenu(): GameMenuResult;
|
|
42
|
+
export declare function getGameState(gameId: string): {
|
|
43
|
+
game: Game;
|
|
44
|
+
characterCount: number;
|
|
45
|
+
locationCount: number;
|
|
46
|
+
activeQuests: number;
|
|
47
|
+
activeCombat: boolean;
|
|
48
|
+
} | null;
|
|
49
|
+
export declare function listImageGenerationPresets(gameId: string): ImageGenerationPreset[];
|
|
50
|
+
export declare function getImageGenerationPreset(gameId: string, presetId: string): ImageGenerationPreset | null;
|
|
51
|
+
export declare function getDefaultImagePreset(gameId: string): ImageGenerationPreset | null;
|
|
52
|
+
export declare function createImageGenerationPreset(gameId: string, params: {
|
|
53
|
+
name: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
entityTypes?: string[];
|
|
56
|
+
isDefault?: boolean;
|
|
57
|
+
config: ImageGenerationPreferences;
|
|
58
|
+
}): ImageGenerationPreset;
|
|
59
|
+
export declare function updateImageGenerationPreset(gameId: string, presetId: string, updates: {
|
|
60
|
+
name?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
entityTypes?: string[];
|
|
63
|
+
isDefault?: boolean;
|
|
64
|
+
config?: Partial<ImageGenerationPreferences>;
|
|
65
|
+
}): ImageGenerationPreset | null;
|
|
66
|
+
export declare function deleteImageGenerationPreset(gameId: string, presetId: string): boolean;
|
|
67
|
+
export declare function setDefaultImagePreset(gameId: string, presetId: string): boolean;
|
|
68
|
+
export declare function listImagePromptTemplates(gameId: string): ImagePromptTemplate[];
|
|
69
|
+
export declare function getImagePromptTemplate(gameId: string, templateId: string): ImagePromptTemplate | null;
|
|
70
|
+
export declare function getDefaultImagePromptTemplate(gameId: string, entityType: string): ImagePromptTemplate | null;
|
|
71
|
+
export declare function createImagePromptTemplate(gameId: string, params: {
|
|
72
|
+
name: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
entityType: string;
|
|
75
|
+
promptTemplate: string;
|
|
76
|
+
negativePromptTemplate?: string;
|
|
77
|
+
promptPrefix?: string;
|
|
78
|
+
promptSuffix?: string;
|
|
79
|
+
fieldAliases?: Record<string, string>;
|
|
80
|
+
defaults?: Record<string, string>;
|
|
81
|
+
priority?: number;
|
|
82
|
+
isDefault?: boolean;
|
|
83
|
+
}): ImagePromptTemplate;
|
|
84
|
+
export declare function updateImagePromptTemplate(gameId: string, templateId: string, updates: {
|
|
85
|
+
name?: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
promptTemplate?: string;
|
|
88
|
+
negativePromptTemplate?: string;
|
|
89
|
+
promptPrefix?: string;
|
|
90
|
+
promptSuffix?: string;
|
|
91
|
+
fieldAliases?: Record<string, string>;
|
|
92
|
+
defaults?: Record<string, string>;
|
|
93
|
+
priority?: number;
|
|
94
|
+
isDefault?: boolean;
|
|
95
|
+
}): ImagePromptTemplate | null;
|
|
96
|
+
export declare function deleteImagePromptTemplate(gameId: string, templateId: string): boolean;
|