foundryvtt-mcp 0.11.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/README.md +142 -0
- package/dist/character/manager.d.ts +92 -0
- package/dist/character/manager.d.ts.map +1 -0
- package/dist/character/manager.js +208 -0
- package/dist/character/manager.js.map +1 -0
- package/dist/combat/manager.d.ts +94 -0
- package/dist/combat/manager.d.ts.map +1 -0
- package/dist/combat/manager.js +373 -0
- package/dist/combat/manager.js.map +1 -0
- package/dist/config/index.d.ts +114 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +177 -0
- package/dist/config/index.js.map +1 -0
- package/dist/diagnostics/client.d.ts +193 -0
- package/dist/diagnostics/client.d.ts.map +1 -0
- package/dist/diagnostics/client.js +314 -0
- package/dist/diagnostics/client.js.map +1 -0
- package/dist/diagnostics/types.d.ts +414 -0
- package/dist/diagnostics/types.d.ts.map +1 -0
- package/dist/diagnostics/types.js +94 -0
- package/dist/diagnostics/types.js.map +1 -0
- package/dist/foundry/auth.d.ts +19 -0
- package/dist/foundry/auth.d.ts.map +1 -0
- package/dist/foundry/auth.js +135 -0
- package/dist/foundry/auth.js.map +1 -0
- package/dist/foundry/client.d.ts +95 -0
- package/dist/foundry/client.d.ts.map +1 -0
- package/dist/foundry/client.js +692 -0
- package/dist/foundry/client.js.map +1 -0
- package/dist/foundry/types.d.ts +805 -0
- package/dist/foundry/types.d.ts.map +1 -0
- package/dist/foundry/types.js +13 -0
- package/dist/foundry/types.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +199 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +93 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/tools/base.d.ts +80 -0
- package/dist/tools/base.d.ts.map +1 -0
- package/dist/tools/base.js +73 -0
- package/dist/tools/base.js.map +1 -0
- package/dist/tools/definitions.d.ts +414 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +429 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/handlers/actors.d.ts +31 -0
- package/dist/tools/handlers/actors.d.ts.map +1 -0
- package/dist/tools/handlers/actors.js +76 -0
- package/dist/tools/handlers/actors.js.map +1 -0
- package/dist/tools/handlers/chat.d.ts +13 -0
- package/dist/tools/handlers/chat.d.ts.map +1 -0
- package/dist/tools/handlers/chat.js +38 -0
- package/dist/tools/handlers/chat.js.map +1 -0
- package/dist/tools/handlers/combat.d.ts +11 -0
- package/dist/tools/handlers/combat.d.ts.map +1 -0
- package/dist/tools/handlers/combat.js +48 -0
- package/dist/tools/handlers/combat.js.map +1 -0
- package/dist/tools/handlers/diagnostics.d.ts +64 -0
- package/dist/tools/handlers/diagnostics.d.ts.map +1 -0
- package/dist/tools/handlers/diagnostics.js +182 -0
- package/dist/tools/handlers/diagnostics.js.map +1 -0
- package/dist/tools/handlers/dice.d.ts +39 -0
- package/dist/tools/handlers/dice.d.ts.map +1 -0
- package/dist/tools/handlers/dice.js +53 -0
- package/dist/tools/handlers/dice.js.map +1 -0
- package/dist/tools/handlers/generation.d.ts +44 -0
- package/dist/tools/handlers/generation.d.ts.map +1 -0
- package/dist/tools/handlers/generation.js +205 -0
- package/dist/tools/handlers/generation.js.map +1 -0
- package/dist/tools/handlers/items.d.ts +21 -0
- package/dist/tools/handlers/items.d.ts.map +1 -0
- package/dist/tools/handlers/items.js +50 -0
- package/dist/tools/handlers/items.js.map +1 -0
- package/dist/tools/handlers/journals.d.ts +22 -0
- package/dist/tools/handlers/journals.d.ts.map +1 -0
- package/dist/tools/handlers/journals.js +62 -0
- package/dist/tools/handlers/journals.js.map +1 -0
- package/dist/tools/handlers/resources.d.ts +13 -0
- package/dist/tools/handlers/resources.d.ts.map +1 -0
- package/dist/tools/handlers/resources.js +188 -0
- package/dist/tools/handlers/resources.js.map +1 -0
- package/dist/tools/handlers/scenes.d.ts +18 -0
- package/dist/tools/handlers/scenes.d.ts.map +1 -0
- package/dist/tools/handlers/scenes.js +34 -0
- package/dist/tools/handlers/scenes.js.map +1 -0
- package/dist/tools/handlers/users.d.ts +11 -0
- package/dist/tools/handlers/users.d.ts.map +1 -0
- package/dist/tools/handlers/users.js +34 -0
- package/dist/tools/handlers/users.js.map +1 -0
- package/dist/tools/handlers/utils.d.ts +11 -0
- package/dist/tools/handlers/utils.d.ts.map +1 -0
- package/dist/tools/handlers/utils.js +24 -0
- package/dist/tools/handlers/utils.js.map +1 -0
- package/dist/tools/handlers/world.d.ts +26 -0
- package/dist/tools/handlers/world.d.ts.map +1 -0
- package/dist/tools/handlers/world.js +92 -0
- package/dist/tools/handlers/world.js.map +1 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +22 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/new-router.d.ts +29 -0
- package/dist/tools/new-router.d.ts.map +1 -0
- package/dist/tools/new-router.js +97 -0
- package/dist/tools/new-router.js.map +1 -0
- package/dist/tools/registry.d.ts +51 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +79 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/resources.d.ts +16 -0
- package/dist/tools/resources.d.ts.map +1 -0
- package/dist/tools/resources.js +63 -0
- package/dist/tools/resources.js.map +1 -0
- package/dist/tools/router.d.ts +22 -0
- package/dist/tools/router.d.ts.map +1 -0
- package/dist/tools/router.js +128 -0
- package/dist/tools/router.js.map +1 -0
- package/dist/utils/cache-instance.d.ts +25 -0
- package/dist/utils/cache-instance.d.ts.map +1 -0
- package/dist/utils/cache-instance.js +30 -0
- package/dist/utils/cache-instance.js.map +1 -0
- package/dist/utils/cache.d.ts +80 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +205 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/diagnostics.d.ts +114 -0
- package/dist/utils/diagnostics.d.ts.map +1 -0
- package/dist/utils/diagnostics.js +330 -0
- package/dist/utils/diagnostics.js.map +1 -0
- package/dist/utils/logger.d.ts +137 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +158 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,805 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview TypeScript type definitions for FoundryVTT data structures
|
|
3
|
+
*
|
|
4
|
+
* This module contains comprehensive type definitions for all FoundryVTT entities
|
|
5
|
+
* including actors, items, scenes, tokens, and other game objects. These types
|
|
6
|
+
* provide type safety and intellisense when working with FoundryVTT data.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.1.0
|
|
9
|
+
* @author FoundryVTT MCP Team
|
|
10
|
+
* @see {@link https://foundryvtt.com/api/} FoundryVTT API Documentation
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Represents an actor (character, NPC, or creature) in FoundryVTT
|
|
14
|
+
*
|
|
15
|
+
* Actors are the primary entities that represent characters, NPCs, monsters,
|
|
16
|
+
* and other creatures in the game world. This interface covers the common
|
|
17
|
+
* properties shared across different game systems.
|
|
18
|
+
*
|
|
19
|
+
* @interface FoundryActor
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const hero: FoundryActor = {
|
|
23
|
+
* _id: 'actor-123',
|
|
24
|
+
* name: 'Aragorn',
|
|
25
|
+
* type: 'character',
|
|
26
|
+
* hp: { value: 45, max: 45 },
|
|
27
|
+
* ac: { value: 16 },
|
|
28
|
+
* level: 5
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export interface FoundryActor {
|
|
33
|
+
_id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
type: string;
|
|
36
|
+
img?: string;
|
|
37
|
+
data?: Record<string, unknown>;
|
|
38
|
+
hp?: {
|
|
39
|
+
value: number;
|
|
40
|
+
max: number;
|
|
41
|
+
temp?: number;
|
|
42
|
+
};
|
|
43
|
+
ac?: {
|
|
44
|
+
value: number;
|
|
45
|
+
};
|
|
46
|
+
attributes?: Record<string, unknown>;
|
|
47
|
+
abilities?: Record<string, {
|
|
48
|
+
value: number;
|
|
49
|
+
mod: number;
|
|
50
|
+
save?: number;
|
|
51
|
+
}>;
|
|
52
|
+
skills?: Record<string, {
|
|
53
|
+
value: number;
|
|
54
|
+
mod: number;
|
|
55
|
+
proficient?: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
level?: number;
|
|
58
|
+
experience?: {
|
|
59
|
+
value: number;
|
|
60
|
+
max: number;
|
|
61
|
+
};
|
|
62
|
+
currency?: Record<string, number>;
|
|
63
|
+
biography?: string;
|
|
64
|
+
notes?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Represents an item (weapon, armor, spell, etc.) in FoundryVTT
|
|
68
|
+
*
|
|
69
|
+
* Items represent equipment, spells, features, and other objects that can be
|
|
70
|
+
* owned by actors or exist independently in the game world.
|
|
71
|
+
*
|
|
72
|
+
* @interface FoundryItem
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const sword: FoundryItem = {
|
|
76
|
+
* _id: 'item-456',
|
|
77
|
+
* name: 'Longsword +1',
|
|
78
|
+
* type: 'weapon',
|
|
79
|
+
* rarity: 'uncommon',
|
|
80
|
+
* damage: { parts: [['1d8+1', 'slashing']] },
|
|
81
|
+
* price: { value: 315, denomination: 'gp' }
|
|
82
|
+
* };
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export interface FoundryItem {
|
|
86
|
+
_id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
type: string;
|
|
89
|
+
img?: string;
|
|
90
|
+
data?: Record<string, unknown>;
|
|
91
|
+
description?: string;
|
|
92
|
+
rarity?: string;
|
|
93
|
+
price?: {
|
|
94
|
+
value: number;
|
|
95
|
+
denomination: string;
|
|
96
|
+
};
|
|
97
|
+
weight?: number;
|
|
98
|
+
quantity?: number;
|
|
99
|
+
equipped?: boolean;
|
|
100
|
+
identified?: boolean;
|
|
101
|
+
damage?: {
|
|
102
|
+
parts: Array<[string, string]>;
|
|
103
|
+
versatile?: string;
|
|
104
|
+
};
|
|
105
|
+
range?: {
|
|
106
|
+
value: number;
|
|
107
|
+
long?: number;
|
|
108
|
+
units: string;
|
|
109
|
+
};
|
|
110
|
+
armor?: {
|
|
111
|
+
value: number;
|
|
112
|
+
type: string;
|
|
113
|
+
dex?: number;
|
|
114
|
+
};
|
|
115
|
+
level?: number;
|
|
116
|
+
school?: string;
|
|
117
|
+
components?: {
|
|
118
|
+
vocal: boolean;
|
|
119
|
+
somatic: boolean;
|
|
120
|
+
material: boolean;
|
|
121
|
+
value?: string;
|
|
122
|
+
};
|
|
123
|
+
duration?: {
|
|
124
|
+
value: number;
|
|
125
|
+
units: string;
|
|
126
|
+
};
|
|
127
|
+
itemRange?: {
|
|
128
|
+
value: number;
|
|
129
|
+
units: string;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Represents a scene (map/battleground) in FoundryVTT
|
|
134
|
+
*
|
|
135
|
+
* Scenes are the visual environments where gameplay takes place, containing
|
|
136
|
+
* background images, tokens, lighting, walls, and other elements.
|
|
137
|
+
*
|
|
138
|
+
* @interface FoundryScene
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const dungeon: FoundryScene = {
|
|
142
|
+
* _id: 'scene-789',
|
|
143
|
+
* name: 'Ancient Tomb',
|
|
144
|
+
* active: true,
|
|
145
|
+
* width: 4000,
|
|
146
|
+
* height: 3000,
|
|
147
|
+
* grid: { size: 100, type: 1 }
|
|
148
|
+
* };
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export interface FoundryScene {
|
|
152
|
+
_id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
active: boolean;
|
|
155
|
+
navigation: boolean;
|
|
156
|
+
img?: string;
|
|
157
|
+
background?: string;
|
|
158
|
+
width: number;
|
|
159
|
+
height: number;
|
|
160
|
+
padding: number;
|
|
161
|
+
initial?: {
|
|
162
|
+
x: number;
|
|
163
|
+
y: number;
|
|
164
|
+
scale: number;
|
|
165
|
+
};
|
|
166
|
+
grid?: {
|
|
167
|
+
type: number;
|
|
168
|
+
size: number;
|
|
169
|
+
color: string;
|
|
170
|
+
alpha: number;
|
|
171
|
+
distance: number;
|
|
172
|
+
units: string;
|
|
173
|
+
};
|
|
174
|
+
shiftX: number;
|
|
175
|
+
shiftY: number;
|
|
176
|
+
description?: string;
|
|
177
|
+
notes?: string;
|
|
178
|
+
weather?: string;
|
|
179
|
+
environment?: string;
|
|
180
|
+
globalLight: boolean;
|
|
181
|
+
globalLightThreshold?: number;
|
|
182
|
+
darkness: number;
|
|
183
|
+
tokens?: FoundryToken[];
|
|
184
|
+
walls?: FoundryWall[];
|
|
185
|
+
lights?: FoundryLight[];
|
|
186
|
+
sounds?: FoundrySound[];
|
|
187
|
+
drawings?: FoundryDrawing[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Represents a token on a scene in FoundryVTT
|
|
191
|
+
*
|
|
192
|
+
* Tokens are the visual representations of actors placed on scenes.
|
|
193
|
+
* They contain position, appearance, and gameplay-related information.
|
|
194
|
+
*
|
|
195
|
+
* @interface FoundryToken
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* const heroToken: FoundryToken = {
|
|
199
|
+
* _id: 'token-123',
|
|
200
|
+
* name: 'Aragorn',
|
|
201
|
+
* x: 1000,
|
|
202
|
+
* y: 1500,
|
|
203
|
+
* actorId: 'actor-123',
|
|
204
|
+
* disposition: 1 // friendly
|
|
205
|
+
* };
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
export interface FoundryToken {
|
|
209
|
+
_id: string;
|
|
210
|
+
name: string;
|
|
211
|
+
img: string;
|
|
212
|
+
x: number;
|
|
213
|
+
y: number;
|
|
214
|
+
width: number;
|
|
215
|
+
height: number;
|
|
216
|
+
scale: number;
|
|
217
|
+
rotation: number;
|
|
218
|
+
actorId?: string;
|
|
219
|
+
actorLink: boolean;
|
|
220
|
+
disposition: number;
|
|
221
|
+
hidden: boolean;
|
|
222
|
+
vision: boolean;
|
|
223
|
+
dimSight: number;
|
|
224
|
+
brightSight: number;
|
|
225
|
+
bar1?: {
|
|
226
|
+
attribute: string;
|
|
227
|
+
};
|
|
228
|
+
bar2?: {
|
|
229
|
+
attribute: string;
|
|
230
|
+
};
|
|
231
|
+
effects?: string[];
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Represents a wall segment in a FoundryVTT scene
|
|
235
|
+
*
|
|
236
|
+
* Walls control movement, vision, and sound propagation in scenes.
|
|
237
|
+
* They define the physical boundaries and obstacles in the environment.
|
|
238
|
+
*
|
|
239
|
+
* @interface FoundryWall
|
|
240
|
+
*/
|
|
241
|
+
export interface FoundryWall {
|
|
242
|
+
_id: string;
|
|
243
|
+
c: [number, number, number, number];
|
|
244
|
+
move: number;
|
|
245
|
+
sense: number;
|
|
246
|
+
sound: number;
|
|
247
|
+
door: number;
|
|
248
|
+
ds: number;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Represents a light source in a FoundryVTT scene
|
|
252
|
+
*
|
|
253
|
+
* Light sources provide illumination and create atmospheric effects
|
|
254
|
+
* in scenes, affecting token vision and creating ambiance.
|
|
255
|
+
*
|
|
256
|
+
* @interface FoundryLight
|
|
257
|
+
*/
|
|
258
|
+
export interface FoundryLight {
|
|
259
|
+
_id: string;
|
|
260
|
+
x: number;
|
|
261
|
+
y: number;
|
|
262
|
+
rotation: number;
|
|
263
|
+
config: {
|
|
264
|
+
bright: number;
|
|
265
|
+
dim: number;
|
|
266
|
+
angle: number;
|
|
267
|
+
color?: string;
|
|
268
|
+
alpha: number;
|
|
269
|
+
animation?: {
|
|
270
|
+
type: string;
|
|
271
|
+
speed: number;
|
|
272
|
+
intensity: number;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
hidden: boolean;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Represents an ambient sound in a FoundryVTT scene
|
|
279
|
+
*
|
|
280
|
+
* Sound objects provide audio atmosphere and effects in scenes,
|
|
281
|
+
* with positional audio and volume controls.
|
|
282
|
+
*
|
|
283
|
+
* @interface FoundrySound
|
|
284
|
+
*/
|
|
285
|
+
export interface FoundrySound {
|
|
286
|
+
_id: string;
|
|
287
|
+
x: number;
|
|
288
|
+
y: number;
|
|
289
|
+
radius: number;
|
|
290
|
+
path: string;
|
|
291
|
+
repeat: boolean;
|
|
292
|
+
volume: number;
|
|
293
|
+
hidden: boolean;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Represents a drawing/annotation in a FoundryVTT scene
|
|
297
|
+
*
|
|
298
|
+
* Drawings allow GMs and players to add visual annotations,
|
|
299
|
+
* shapes, and text directly onto scenes.
|
|
300
|
+
*
|
|
301
|
+
* @interface FoundryDrawing
|
|
302
|
+
*/
|
|
303
|
+
export interface FoundryDrawing {
|
|
304
|
+
_id: string;
|
|
305
|
+
type: string;
|
|
306
|
+
x: number;
|
|
307
|
+
y: number;
|
|
308
|
+
width?: number;
|
|
309
|
+
height?: number;
|
|
310
|
+
points?: number[];
|
|
311
|
+
shape?: {
|
|
312
|
+
type: string;
|
|
313
|
+
points?: number[];
|
|
314
|
+
radius?: number;
|
|
315
|
+
width?: number;
|
|
316
|
+
height?: number;
|
|
317
|
+
};
|
|
318
|
+
fillType: number;
|
|
319
|
+
fillColor?: string;
|
|
320
|
+
strokeWidth: number;
|
|
321
|
+
strokeColor?: string;
|
|
322
|
+
text?: string;
|
|
323
|
+
fontSize?: number;
|
|
324
|
+
fontFamily?: string;
|
|
325
|
+
textColor?: string;
|
|
326
|
+
hidden: boolean;
|
|
327
|
+
locked: boolean;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Represents world information in FoundryVTT
|
|
331
|
+
*
|
|
332
|
+
* Contains metadata about the current game world including
|
|
333
|
+
* system information, modules, and world settings.
|
|
334
|
+
*
|
|
335
|
+
* @interface FoundryWorld
|
|
336
|
+
* @example
|
|
337
|
+
* ```typescript
|
|
338
|
+
* const world: FoundryWorld = {
|
|
339
|
+
* id: 'my-campaign',
|
|
340
|
+
* title: 'Adventures in Middle-earth',
|
|
341
|
+
* system: 'dnd5e',
|
|
342
|
+
* coreVersion: '11.315',
|
|
343
|
+
* playtime: 144000 // in seconds
|
|
344
|
+
* };
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
export interface FoundryWorld {
|
|
348
|
+
id: string;
|
|
349
|
+
title: string;
|
|
350
|
+
description: string;
|
|
351
|
+
system: string;
|
|
352
|
+
coreVersion: string;
|
|
353
|
+
systemVersion: string;
|
|
354
|
+
lastPlayed?: string;
|
|
355
|
+
playtime: number;
|
|
356
|
+
created: string;
|
|
357
|
+
modified: string;
|
|
358
|
+
background?: string;
|
|
359
|
+
nextSession?: string;
|
|
360
|
+
modules?: Array<{
|
|
361
|
+
id: string;
|
|
362
|
+
title: string;
|
|
363
|
+
active: boolean;
|
|
364
|
+
}>;
|
|
365
|
+
}
|
|
366
|
+
export interface FoundryJournal {
|
|
367
|
+
_id: string;
|
|
368
|
+
name: string;
|
|
369
|
+
content: string;
|
|
370
|
+
img?: string;
|
|
371
|
+
folder?: string;
|
|
372
|
+
permission: Record<string, number>;
|
|
373
|
+
pages?: Array<{
|
|
374
|
+
name: string;
|
|
375
|
+
type: string;
|
|
376
|
+
title: string;
|
|
377
|
+
content?: string;
|
|
378
|
+
src?: string;
|
|
379
|
+
}>;
|
|
380
|
+
}
|
|
381
|
+
export interface FoundryMacro {
|
|
382
|
+
_id: string;
|
|
383
|
+
name: string;
|
|
384
|
+
type: string;
|
|
385
|
+
scope: string;
|
|
386
|
+
command: string;
|
|
387
|
+
img?: string;
|
|
388
|
+
folder?: string;
|
|
389
|
+
author: string;
|
|
390
|
+
ownership: Record<string, number>;
|
|
391
|
+
}
|
|
392
|
+
export interface FoundryPlaylist {
|
|
393
|
+
_id: string;
|
|
394
|
+
name: string;
|
|
395
|
+
description?: string;
|
|
396
|
+
mode: number;
|
|
397
|
+
playing: boolean;
|
|
398
|
+
fade: number;
|
|
399
|
+
folder?: string;
|
|
400
|
+
sounds: Array<{
|
|
401
|
+
_id: string;
|
|
402
|
+
name: string;
|
|
403
|
+
path: string;
|
|
404
|
+
playing: boolean;
|
|
405
|
+
repeat: boolean;
|
|
406
|
+
volume: number;
|
|
407
|
+
fade: number;
|
|
408
|
+
}>;
|
|
409
|
+
}
|
|
410
|
+
export interface FoundryCombat {
|
|
411
|
+
_id: string;
|
|
412
|
+
scene?: string;
|
|
413
|
+
active: boolean;
|
|
414
|
+
round: number;
|
|
415
|
+
turn: number;
|
|
416
|
+
started: boolean;
|
|
417
|
+
combatants: Array<{
|
|
418
|
+
_id: string;
|
|
419
|
+
tokenId: string;
|
|
420
|
+
actorId?: string;
|
|
421
|
+
name: string;
|
|
422
|
+
img?: string;
|
|
423
|
+
initiative?: number;
|
|
424
|
+
hidden: boolean;
|
|
425
|
+
defeated: boolean;
|
|
426
|
+
}>;
|
|
427
|
+
settings: {
|
|
428
|
+
resource?: string;
|
|
429
|
+
skipDefeated: boolean;
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Represents the result of a dice roll in FoundryVTT
|
|
434
|
+
*
|
|
435
|
+
* Contains all information about a completed dice roll including
|
|
436
|
+
* the formula used, total result, breakdown, and metadata.
|
|
437
|
+
*
|
|
438
|
+
* @interface DiceRoll
|
|
439
|
+
* @example
|
|
440
|
+
* ```typescript
|
|
441
|
+
* const attackRoll: DiceRoll = {
|
|
442
|
+
* formula: '1d20+5',
|
|
443
|
+
* total: 18,
|
|
444
|
+
* breakdown: '13 + 5',
|
|
445
|
+
* reason: 'Sword attack',
|
|
446
|
+
* timestamp: '2024-01-15T10:30:00Z'
|
|
447
|
+
* };
|
|
448
|
+
* ```
|
|
449
|
+
*/
|
|
450
|
+
export interface DiceRoll {
|
|
451
|
+
formula: string;
|
|
452
|
+
total: number;
|
|
453
|
+
breakdown: string;
|
|
454
|
+
reason?: string;
|
|
455
|
+
timestamp: string;
|
|
456
|
+
}
|
|
457
|
+
export interface FoundryUser {
|
|
458
|
+
_id: string;
|
|
459
|
+
name: string;
|
|
460
|
+
role: number;
|
|
461
|
+
active: boolean;
|
|
462
|
+
color: string;
|
|
463
|
+
avatar?: string;
|
|
464
|
+
character?: string;
|
|
465
|
+
permissions: Record<string, boolean>;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Result structure for actor search operations
|
|
469
|
+
*
|
|
470
|
+
* Contains paginated search results for actor queries
|
|
471
|
+
* along with metadata about the search.
|
|
472
|
+
*
|
|
473
|
+
* @interface ActorSearchResult
|
|
474
|
+
* @example
|
|
475
|
+
* ```typescript
|
|
476
|
+
* const searchResult: ActorSearchResult = {
|
|
477
|
+
* actors: [],
|
|
478
|
+
* total: 25,
|
|
479
|
+
* page: 1,
|
|
480
|
+
* limit: 10
|
|
481
|
+
* };
|
|
482
|
+
* ```
|
|
483
|
+
*/
|
|
484
|
+
export interface ActorSearchResult {
|
|
485
|
+
actors: FoundryActor[];
|
|
486
|
+
total: number;
|
|
487
|
+
page: number;
|
|
488
|
+
limit: number;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Result structure for item search operations
|
|
492
|
+
*
|
|
493
|
+
* Contains paginated search results for item queries
|
|
494
|
+
* along with metadata about the search.
|
|
495
|
+
*
|
|
496
|
+
* @interface ItemSearchResult
|
|
497
|
+
* @example
|
|
498
|
+
* ```typescript
|
|
499
|
+
* const searchResult: ItemSearchResult = {
|
|
500
|
+
* items: [],
|
|
501
|
+
* total: 42,
|
|
502
|
+
* page: 1,
|
|
503
|
+
* limit: 20
|
|
504
|
+
* };
|
|
505
|
+
* ```
|
|
506
|
+
*/
|
|
507
|
+
export interface ItemSearchResult {
|
|
508
|
+
items: FoundryItem[];
|
|
509
|
+
total: number;
|
|
510
|
+
page: number;
|
|
511
|
+
limit: number;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Generic API response structure for FoundryVTT REST API
|
|
515
|
+
*
|
|
516
|
+
* Standardized response format for API calls including
|
|
517
|
+
* success status, data payload, and error information.
|
|
518
|
+
*
|
|
519
|
+
* @interface FoundryAPIResponse
|
|
520
|
+
* @template T - Type of the response data
|
|
521
|
+
* @example
|
|
522
|
+
* ```typescript
|
|
523
|
+
* const response: FoundryAPIResponse<FoundryActor[]> = {
|
|
524
|
+
* success: true,
|
|
525
|
+
* data: [],
|
|
526
|
+
* message: 'Actors retrieved successfully'
|
|
527
|
+
* };
|
|
528
|
+
* ```
|
|
529
|
+
*/
|
|
530
|
+
export interface FoundryAPIResponse<T = unknown> {
|
|
531
|
+
success: boolean;
|
|
532
|
+
data?: T;
|
|
533
|
+
error?: string;
|
|
534
|
+
message?: string;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Structure for WebSocket messages exchanged with FoundryVTT
|
|
538
|
+
*
|
|
539
|
+
* Defines the format for real-time communication messages
|
|
540
|
+
* between the MCP server and FoundryVTT.
|
|
541
|
+
*
|
|
542
|
+
* @interface FoundryWebSocketMessage
|
|
543
|
+
* @example
|
|
544
|
+
* ```typescript
|
|
545
|
+
* const message: FoundryWebSocketMessage = {
|
|
546
|
+
* type: 'combatUpdate',
|
|
547
|
+
* data: { round: 3, turn: 2 },
|
|
548
|
+
* user: 'user-123',
|
|
549
|
+
* timestamp: '2024-01-15T10:30:00Z'
|
|
550
|
+
* };
|
|
551
|
+
* ```
|
|
552
|
+
*/
|
|
553
|
+
export interface FoundryWebSocketMessage {
|
|
554
|
+
type: string;
|
|
555
|
+
data?: unknown;
|
|
556
|
+
user?: string;
|
|
557
|
+
timestamp: string;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Structure for AI-generated NPC data
|
|
561
|
+
*
|
|
562
|
+
* Contains all information needed to create a complete NPC
|
|
563
|
+
* including personality, appearance, and background details.
|
|
564
|
+
*
|
|
565
|
+
* @interface GeneratedNPC
|
|
566
|
+
* @example
|
|
567
|
+
* ```typescript
|
|
568
|
+
* const npc: GeneratedNPC = {
|
|
569
|
+
* name: 'Thorin Ironforge',
|
|
570
|
+
* race: 'Dwarf',
|
|
571
|
+
* class: 'Fighter',
|
|
572
|
+
* personality: ['Gruff but loyal', 'Speaks little but acts decisively'],
|
|
573
|
+
* appearance: 'Short and stocky with a magnificent braided beard',
|
|
574
|
+
* motivations: ['Protect the clan honor', 'Forge the perfect weapon']
|
|
575
|
+
* };
|
|
576
|
+
* ```
|
|
577
|
+
*/
|
|
578
|
+
export interface GeneratedNPC {
|
|
579
|
+
name: string;
|
|
580
|
+
race: string;
|
|
581
|
+
class?: string;
|
|
582
|
+
level?: number;
|
|
583
|
+
background?: string;
|
|
584
|
+
personality: string[];
|
|
585
|
+
appearance: string;
|
|
586
|
+
motivations: string[];
|
|
587
|
+
stats?: Record<string, number>;
|
|
588
|
+
equipment?: string[];
|
|
589
|
+
}
|
|
590
|
+
export interface GeneratedLocation {
|
|
591
|
+
name: string;
|
|
592
|
+
type: string;
|
|
593
|
+
description: string;
|
|
594
|
+
features: string[];
|
|
595
|
+
inhabitants?: string[];
|
|
596
|
+
hooks?: string[];
|
|
597
|
+
connections?: string[];
|
|
598
|
+
}
|
|
599
|
+
export interface GeneratedQuest {
|
|
600
|
+
title: string;
|
|
601
|
+
type: string;
|
|
602
|
+
giver: string;
|
|
603
|
+
description: string;
|
|
604
|
+
objectives: string[];
|
|
605
|
+
rewards: string[];
|
|
606
|
+
complications?: string[];
|
|
607
|
+
timeLimit?: string;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Raw actor document from worldData.
|
|
611
|
+
* The `system` field shape varies by game system (dnd5e, pf2e, etc.).
|
|
612
|
+
*/
|
|
613
|
+
export interface WorldActor {
|
|
614
|
+
_id: string;
|
|
615
|
+
name: string;
|
|
616
|
+
type: string;
|
|
617
|
+
img?: string;
|
|
618
|
+
system: Record<string, unknown>;
|
|
619
|
+
items?: WorldItem[];
|
|
620
|
+
effects?: WorldEffect[];
|
|
621
|
+
folder?: string | null;
|
|
622
|
+
sort?: number;
|
|
623
|
+
ownership?: Record<string, number>;
|
|
624
|
+
flags?: Record<string, unknown>;
|
|
625
|
+
prototypeToken?: Record<string, unknown>;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Raw item document from worldData.
|
|
629
|
+
*/
|
|
630
|
+
export interface WorldItem {
|
|
631
|
+
_id: string;
|
|
632
|
+
name: string;
|
|
633
|
+
type: string;
|
|
634
|
+
img?: string;
|
|
635
|
+
system: Record<string, unknown>;
|
|
636
|
+
effects?: WorldEffect[];
|
|
637
|
+
folder?: string | null;
|
|
638
|
+
sort?: number;
|
|
639
|
+
ownership?: Record<string, number>;
|
|
640
|
+
flags?: Record<string, unknown>;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Raw scene document from worldData.
|
|
644
|
+
*/
|
|
645
|
+
export interface WorldScene {
|
|
646
|
+
_id: string;
|
|
647
|
+
name: string;
|
|
648
|
+
active: boolean;
|
|
649
|
+
navigation: boolean;
|
|
650
|
+
img?: string;
|
|
651
|
+
background?: Record<string, unknown>;
|
|
652
|
+
width: number;
|
|
653
|
+
height: number;
|
|
654
|
+
padding: number;
|
|
655
|
+
grid?: Record<string, unknown>;
|
|
656
|
+
tokens?: Array<Record<string, unknown>>;
|
|
657
|
+
walls?: Array<Record<string, unknown>>;
|
|
658
|
+
lights?: Array<Record<string, unknown>>;
|
|
659
|
+
drawings?: Array<Record<string, unknown>>;
|
|
660
|
+
sounds?: Array<Record<string, unknown>>;
|
|
661
|
+
notes?: Array<Record<string, unknown>>;
|
|
662
|
+
tiles?: Array<Record<string, unknown>>;
|
|
663
|
+
darkness: number;
|
|
664
|
+
globalLight: boolean;
|
|
665
|
+
globalLightThreshold?: number;
|
|
666
|
+
folder?: string | null;
|
|
667
|
+
sort?: number;
|
|
668
|
+
ownership?: Record<string, number>;
|
|
669
|
+
flags?: Record<string, unknown>;
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Raw journal entry from worldData.
|
|
673
|
+
*/
|
|
674
|
+
export interface WorldJournal {
|
|
675
|
+
_id: string;
|
|
676
|
+
name: string;
|
|
677
|
+
pages?: Array<{
|
|
678
|
+
_id: string;
|
|
679
|
+
name: string;
|
|
680
|
+
type: string;
|
|
681
|
+
title?: {
|
|
682
|
+
show: boolean;
|
|
683
|
+
level: number;
|
|
684
|
+
};
|
|
685
|
+
text?: {
|
|
686
|
+
content: string;
|
|
687
|
+
format: number;
|
|
688
|
+
};
|
|
689
|
+
image?: Record<string, unknown>;
|
|
690
|
+
video?: Record<string, unknown>;
|
|
691
|
+
src?: string;
|
|
692
|
+
sort?: number;
|
|
693
|
+
}>;
|
|
694
|
+
folder?: string | null;
|
|
695
|
+
sort?: number;
|
|
696
|
+
ownership?: Record<string, number>;
|
|
697
|
+
flags?: Record<string, unknown>;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Raw chat message from worldData.
|
|
701
|
+
*/
|
|
702
|
+
export interface WorldMessage {
|
|
703
|
+
_id: string;
|
|
704
|
+
type: number;
|
|
705
|
+
user: string;
|
|
706
|
+
timestamp: number;
|
|
707
|
+
flavor?: string;
|
|
708
|
+
content: string;
|
|
709
|
+
speaker?: {
|
|
710
|
+
scene?: string;
|
|
711
|
+
actor?: string;
|
|
712
|
+
token?: string;
|
|
713
|
+
alias?: string;
|
|
714
|
+
};
|
|
715
|
+
rolls?: string[];
|
|
716
|
+
sound?: string;
|
|
717
|
+
whisper?: string[];
|
|
718
|
+
blind?: boolean;
|
|
719
|
+
flags?: Record<string, unknown>;
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Raw combat document from worldData.
|
|
723
|
+
*/
|
|
724
|
+
export interface WorldCombat {
|
|
725
|
+
_id: string;
|
|
726
|
+
scene?: string;
|
|
727
|
+
active: boolean;
|
|
728
|
+
round: number;
|
|
729
|
+
turn: number | null;
|
|
730
|
+
started: boolean;
|
|
731
|
+
combatants: Array<{
|
|
732
|
+
_id: string;
|
|
733
|
+
actorId?: string;
|
|
734
|
+
tokenId?: string;
|
|
735
|
+
sceneId?: string;
|
|
736
|
+
name: string;
|
|
737
|
+
img?: string;
|
|
738
|
+
initiative: number | null;
|
|
739
|
+
hidden: boolean;
|
|
740
|
+
defeated: boolean;
|
|
741
|
+
flags?: Record<string, unknown>;
|
|
742
|
+
}>;
|
|
743
|
+
flags?: Record<string, unknown>;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Raw user document from worldData.
|
|
747
|
+
*/
|
|
748
|
+
export interface WorldUser {
|
|
749
|
+
_id: string;
|
|
750
|
+
name: string;
|
|
751
|
+
role: number;
|
|
752
|
+
color: string;
|
|
753
|
+
avatar?: string;
|
|
754
|
+
character?: string;
|
|
755
|
+
password?: string;
|
|
756
|
+
pronouns?: string;
|
|
757
|
+
flags?: Record<string, unknown>;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Active effect on an actor or item.
|
|
761
|
+
*/
|
|
762
|
+
export interface WorldEffect {
|
|
763
|
+
_id: string;
|
|
764
|
+
name: string;
|
|
765
|
+
img?: string;
|
|
766
|
+
type?: string;
|
|
767
|
+
system?: Record<string, unknown>;
|
|
768
|
+
changes?: Array<{
|
|
769
|
+
key: string;
|
|
770
|
+
mode: number;
|
|
771
|
+
value: string;
|
|
772
|
+
priority?: number;
|
|
773
|
+
}>;
|
|
774
|
+
disabled?: boolean;
|
|
775
|
+
duration?: Record<string, unknown>;
|
|
776
|
+
flags?: Record<string, unknown>;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Complete world data returned by the Socket.IO 'world' event.
|
|
780
|
+
*/
|
|
781
|
+
export interface WorldData {
|
|
782
|
+
userId: string;
|
|
783
|
+
release: Record<string, unknown>;
|
|
784
|
+
world: Record<string, unknown>;
|
|
785
|
+
system: Record<string, unknown>;
|
|
786
|
+
modules: Array<Record<string, unknown>>;
|
|
787
|
+
demoMode: boolean;
|
|
788
|
+
actors: WorldActor[];
|
|
789
|
+
scenes: WorldScene[];
|
|
790
|
+
items: WorldItem[];
|
|
791
|
+
journal: WorldJournal[];
|
|
792
|
+
messages: WorldMessage[];
|
|
793
|
+
combats: WorldCombat[];
|
|
794
|
+
users: WorldUser[];
|
|
795
|
+
activeUsers: string[];
|
|
796
|
+
settings: unknown[];
|
|
797
|
+
folders: Array<Record<string, unknown>>;
|
|
798
|
+
macros: Array<Record<string, unknown>>;
|
|
799
|
+
playlists: Array<Record<string, unknown>>;
|
|
800
|
+
tables: Array<Record<string, unknown>>;
|
|
801
|
+
cards: Array<Record<string, unknown>>;
|
|
802
|
+
packs: Array<Record<string, unknown>>;
|
|
803
|
+
[key: string]: unknown;
|
|
804
|
+
}
|
|
805
|
+
//# sourceMappingURL=types.d.ts.map
|