universal-game-modder 0.1.4
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/ACCEPTABLE_USE.md +49 -0
- package/CHANGELOG.md +119 -0
- package/LICENSE +21 -0
- package/LICENSE-EULA.md +62 -0
- package/README.md +162 -0
- package/VERIFICATION.md +132 -0
- package/dist/backends/child-pool.js +91 -0
- package/dist/backends/mcp-child.js +102 -0
- package/dist/backends/mcp-child.js.map +1 -0
- package/dist/core/config.d.ts +10 -0
- package/dist/core/config.js +48 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/engine-detector.d.ts +13 -0
- package/dist/core/engine-detector.js +247 -0
- package/dist/core/engine-detector.js.map +1 -0
- package/dist/core/event-bus.js +18 -0
- package/dist/core/file-classifier.js +394 -0
- package/dist/core/model-db.js +517 -0
- package/dist/core/model-db.js.map +1 -0
- package/dist/core/router.d.ts +6 -0
- package/dist/core/router.js +143 -0
- package/dist/core/router.js.map +1 -0
- package/dist/core/session.js +114 -0
- package/dist/decoders/audio-export.js +57 -0
- package/dist/decoders/mesh-export.d.ts +20 -0
- package/dist/decoders/mesh-export.js +174 -0
- package/dist/decoders/mesh-export.js.map +1 -0
- package/dist/decoders/native/disassembler.js +85 -0
- package/dist/decoders/native/disassembler.js.map +1 -0
- package/dist/decoders/png-encode.d.ts +17 -0
- package/dist/decoders/png-encode.js +33 -0
- package/dist/decoders/texture-decode.js +278 -0
- package/dist/decoders/texture-decode.js.map +1 -0
- package/dist/decoders/unity/audioclip.d.ts +55 -0
- package/dist/decoders/unity/audioclip.js +87 -0
- package/dist/decoders/unity/audioclip.js.map +1 -0
- package/dist/decoders/unity/binary-reader.d.ts +45 -0
- package/dist/decoders/unity/binary-reader.js +141 -0
- package/dist/decoders/unity/binary-reader.js.map +1 -0
- package/dist/decoders/unity/mesh.js +198 -0
- package/dist/decoders/unity/mesh.js.map +1 -0
- package/dist/decoders/unity/ress-reader.d.ts +33 -0
- package/dist/decoders/unity/ress-reader.js +82 -0
- package/dist/decoders/unity/ress-reader.js.map +1 -0
- package/dist/decoders/unity/serialized-file.d.ts +65 -0
- package/dist/decoders/unity/serialized-file.js +144 -0
- package/dist/decoders/unity/texture2d.js +185 -0
- package/dist/decoders/unity/vertex-data.d.ts +54 -0
- package/dist/decoders/unity/vertex-data.js +174 -0
- package/dist/decoders/unity/vertex-data.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +66 -0
- package/dist/tools/decode-tools.d.ts +29 -0
- package/dist/tools/decode-tools.js +441 -0
- package/dist/tools/delegates/jar-editor.d.ts +2 -0
- package/dist/tools/delegates/jar-editor.js +276 -0
- package/dist/tools/delegates/unity-decompiler.d.ts +2 -0
- package/dist/tools/delegates/unity-decompiler.js +291 -0
- package/dist/tools/delegates/unreal-assets.d.ts +2 -0
- package/dist/tools/delegates/unreal-assets.js +122 -0
- package/dist/tools/detection-tools.d.ts +2 -0
- package/dist/tools/detection-tools.js +164 -0
- package/dist/tools/detection-tools.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +30 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/native/index.d.ts +2 -0
- package/dist/tools/native/index.js +1201 -0
- package/dist/tools/native-comprehension-tools.js +298 -0
- package/dist/tools/native-comprehension-tools.js.map +1 -0
- package/dist/tools/unpack-tools.d.ts +2 -0
- package/dist/tools/unpack-tools.js +382 -0
- package/dist/tools/workflow-tools.d.ts +2 -0
- package/dist/tools/workflow-tools.js +434 -0
- package/dist/utils/logger.d.ts +11 -0
- package/dist/utils/logger.js +49 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/path-utils.d.ts +15 -0
- package/dist/utils/path-utils.js +24 -0
- package/dist/utils/path-utils.js.map +1 -0
- package/dist/utils/steam-finder.d.ts +8 -0
- package/dist/utils/steam-finder.js +32 -0
- package/dist/web/web-server.d.ts +1 -0
- package/dist/web/web-server.js +369 -0
- package/licenses/THIRD-PARTY-NOTICES.md +35 -0
- package/llms-install.md +34 -0
- package/package.json +69 -0
- package/server.json +20 -0
- package/setup.ps1 +34 -0
- package/ugm.config.json +9 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { childPool } from '../../backends/child-pool.js';
|
|
2
|
+
import { logger } from '../../utils/logger.js';
|
|
3
|
+
import { session } from '../../core/session.js';
|
|
4
|
+
function delegateTool(name, description, inputSchema) {
|
|
5
|
+
return {
|
|
6
|
+
name,
|
|
7
|
+
description,
|
|
8
|
+
inputSchema,
|
|
9
|
+
handler: async (args) => {
|
|
10
|
+
const start = Date.now();
|
|
11
|
+
logger.toolStart(name, 'jar-editor');
|
|
12
|
+
try {
|
|
13
|
+
const result = await childPool.call('jar-editor', name, args);
|
|
14
|
+
const text = result.content.map(c => c.text).join('\n');
|
|
15
|
+
const duration = Date.now() - start;
|
|
16
|
+
logger.toolComplete(name, 'jar-editor', duration, !result.isError);
|
|
17
|
+
session.recordToolCall({ tool: name, timestamp: start, duration, success: !result.isError, backend: 'jar-editor' });
|
|
18
|
+
return text;
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
const duration = Date.now() - start;
|
|
22
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
23
|
+
logger.toolComplete(name, 'jar-editor', duration, false);
|
|
24
|
+
session.recordToolCall({ tool: name, timestamp: start, duration, success: false, backend: 'jar-editor' });
|
|
25
|
+
return `ERROR: ${msg}`;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function getJarDelegateTools() {
|
|
31
|
+
return [
|
|
32
|
+
// Session Management
|
|
33
|
+
delegateTool('jar_open', 'Open and extract a JAR file for exploration and editing.', {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
jar_path: { type: 'string', description: 'Path to the JAR file' },
|
|
37
|
+
session_id: { type: 'string', description: 'Optional custom session ID' },
|
|
38
|
+
},
|
|
39
|
+
required: ['jar_path'],
|
|
40
|
+
}),
|
|
41
|
+
delegateTool('jar_close', 'Close a JAR session and clean up temp files.', {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
45
|
+
cleanup: { type: 'boolean', description: 'Delete temp files (default: true)' },
|
|
46
|
+
},
|
|
47
|
+
required: ['session_id'],
|
|
48
|
+
}),
|
|
49
|
+
delegateTool('jar_list_sessions', 'List all active JAR sessions.', {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {},
|
|
52
|
+
}),
|
|
53
|
+
// Browse/Search
|
|
54
|
+
delegateTool('jar_list', 'List contents of an opened JAR file.', {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
58
|
+
filter_pattern: { type: 'string', description: 'Optional filename filter' },
|
|
59
|
+
max_results: { type: 'number', description: 'Max results (default 100)' },
|
|
60
|
+
},
|
|
61
|
+
required: ['session_id'],
|
|
62
|
+
}),
|
|
63
|
+
delegateTool('jar_search', 'Search within JAR for classes, methods, or strings.', {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
67
|
+
search_term: { type: 'string', description: 'Search term' },
|
|
68
|
+
search_type: { type: 'string', description: 'Type: filename, content, classname (default: filename)' },
|
|
69
|
+
},
|
|
70
|
+
required: ['session_id', 'search_term'],
|
|
71
|
+
}),
|
|
72
|
+
delegateTool('jar_search_bytecode', 'Search for numeric values or strings in bytecode.', {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
76
|
+
search_value: { type: 'string', description: 'Value to search for' },
|
|
77
|
+
file_filter: { type: 'string', description: 'Optional file filter pattern' },
|
|
78
|
+
},
|
|
79
|
+
required: ['session_id', 'search_value'],
|
|
80
|
+
}),
|
|
81
|
+
delegateTool('jar_search_opcodes', 'Search for bytecode opcode patterns in .class files.', {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
85
|
+
pattern: { type: 'string', description: 'Opcode pattern to search for' },
|
|
86
|
+
file_filter: { type: 'string', description: 'Optional file filter' },
|
|
87
|
+
},
|
|
88
|
+
required: ['session_id', 'pattern'],
|
|
89
|
+
}),
|
|
90
|
+
// Read/Inspect
|
|
91
|
+
delegateTool('jar_read_class', 'Read and decompile a Java .class file.', {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
95
|
+
class_path: { type: 'string', description: 'Path to .class file within JAR' },
|
|
96
|
+
decompile: { type: 'boolean', description: 'Decompile to Java source (default: true)' },
|
|
97
|
+
extra_classpath: { type: 'array', items: { type: 'string' }, description: 'Additional classpath entries' },
|
|
98
|
+
},
|
|
99
|
+
required: ['session_id', 'class_path'],
|
|
100
|
+
}),
|
|
101
|
+
delegateTool('jar_read_file', 'Read a text file from the JAR.', {
|
|
102
|
+
type: 'object',
|
|
103
|
+
properties: {
|
|
104
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
105
|
+
file_path: { type: 'string', description: 'File path within JAR' },
|
|
106
|
+
},
|
|
107
|
+
required: ['session_id', 'file_path'],
|
|
108
|
+
}),
|
|
109
|
+
delegateTool('jar_inspect_constant_pool', 'Dump the constant pool of a .class file.', {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
113
|
+
class_path: { type: 'string', description: 'Path to .class file' },
|
|
114
|
+
filter_type: { type: 'string', description: 'Filter by constant type' },
|
|
115
|
+
filter_value: { type: 'string', description: 'Filter by value' },
|
|
116
|
+
},
|
|
117
|
+
required: ['session_id', 'class_path'],
|
|
118
|
+
}),
|
|
119
|
+
delegateTool('jar_hex_view', 'Read raw bytes from a .class file as hex dump.', {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {
|
|
122
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
123
|
+
class_path: { type: 'string', description: 'Path to file' },
|
|
124
|
+
offset: { type: 'number', description: 'Start offset (default 0)' },
|
|
125
|
+
length: { type: 'number', description: 'Bytes to read (default 256)' },
|
|
126
|
+
},
|
|
127
|
+
required: ['session_id', 'class_path'],
|
|
128
|
+
}),
|
|
129
|
+
delegateTool('jar_detect_mod_info', 'Auto-detect mod loader, version, and structure from JAR contents.', {
|
|
130
|
+
type: 'object',
|
|
131
|
+
properties: {
|
|
132
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
133
|
+
},
|
|
134
|
+
required: ['session_id'],
|
|
135
|
+
}),
|
|
136
|
+
// Edit
|
|
137
|
+
delegateTool('jar_edit_file', 'Edit a text file within the JAR.', {
|
|
138
|
+
type: 'object',
|
|
139
|
+
properties: {
|
|
140
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
141
|
+
file_path: { type: 'string', description: 'File path within JAR' },
|
|
142
|
+
new_content: { type: 'string', description: 'New file content' },
|
|
143
|
+
},
|
|
144
|
+
required: ['session_id', 'file_path', 'new_content'],
|
|
145
|
+
}),
|
|
146
|
+
delegateTool('jar_edit_class_constants', 'Edit numeric constants in .class file bytecode.', {
|
|
147
|
+
type: 'object',
|
|
148
|
+
properties: {
|
|
149
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
150
|
+
class_path: { type: 'string', description: 'Path to .class file' },
|
|
151
|
+
replacements: { type: 'object', description: 'Map of old_value -> new_value' },
|
|
152
|
+
occurrence: { type: 'number', description: 'Which occurrence to replace (0-indexed)' },
|
|
153
|
+
value_type: { type: 'string', description: 'Value type hint' },
|
|
154
|
+
},
|
|
155
|
+
required: ['session_id', 'class_path', 'replacements'],
|
|
156
|
+
}),
|
|
157
|
+
delegateTool('jar_edit_constant_pool', 'Edit constants by their exact constant pool index.', {
|
|
158
|
+
type: 'object',
|
|
159
|
+
properties: {
|
|
160
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
161
|
+
class_path: { type: 'string', description: 'Path to .class file' },
|
|
162
|
+
edits: { type: 'object', description: 'Map of pool_index -> new_value' },
|
|
163
|
+
},
|
|
164
|
+
required: ['session_id', 'class_path', 'edits'],
|
|
165
|
+
}),
|
|
166
|
+
delegateTool('jar_hex_edit', 'Write raw bytes at a specific offset in a file.', {
|
|
167
|
+
type: 'object',
|
|
168
|
+
properties: {
|
|
169
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
170
|
+
class_path: { type: 'string', description: 'Path to file' },
|
|
171
|
+
offset: { type: 'number', description: 'Byte offset' },
|
|
172
|
+
hex_data: { type: 'string', description: 'Hex string to write' },
|
|
173
|
+
},
|
|
174
|
+
required: ['session_id', 'class_path', 'offset', 'hex_data'],
|
|
175
|
+
}),
|
|
176
|
+
// File Operations
|
|
177
|
+
delegateTool('jar_add_file', 'Add a file from disk into the JAR.', {
|
|
178
|
+
type: 'object',
|
|
179
|
+
properties: {
|
|
180
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
181
|
+
jar_path: { type: 'string', description: 'Destination path within JAR' },
|
|
182
|
+
source_path: { type: 'string', description: 'Source file on disk' },
|
|
183
|
+
overwrite: { type: 'boolean', description: 'Overwrite if exists (default: true)' },
|
|
184
|
+
},
|
|
185
|
+
required: ['session_id', 'jar_path', 'source_path'],
|
|
186
|
+
}),
|
|
187
|
+
delegateTool('jar_add_file_content', 'Write text content as a new file in the JAR.', {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
191
|
+
jar_path: { type: 'string', description: 'Destination path within JAR' },
|
|
192
|
+
content: { type: 'string', description: 'File content' },
|
|
193
|
+
encoding: { type: 'string', description: 'Encoding (default: utf-8)' },
|
|
194
|
+
},
|
|
195
|
+
required: ['session_id', 'jar_path', 'content'],
|
|
196
|
+
}),
|
|
197
|
+
delegateTool('jar_compile_java', 'Compile Java source code and optionally inject into JAR.', {
|
|
198
|
+
type: 'object',
|
|
199
|
+
properties: {
|
|
200
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
201
|
+
source_code: { type: 'string', description: 'Java source code' },
|
|
202
|
+
class_name: { type: 'string', description: 'Fully-qualified class name' },
|
|
203
|
+
classpath: { type: 'array', items: { type: 'string' }, description: 'Additional classpath entries' },
|
|
204
|
+
auto_classpath: { type: 'boolean', description: 'Auto-add JAR to classpath (default: true)' },
|
|
205
|
+
java_release: { type: 'number', description: 'Java release target (default: 21)' },
|
|
206
|
+
inject_into_jar: { type: 'boolean', description: 'Inject compiled class into JAR (default: true)' },
|
|
207
|
+
},
|
|
208
|
+
required: ['session_id', 'source_code', 'class_name'],
|
|
209
|
+
}),
|
|
210
|
+
// Diff/Restore
|
|
211
|
+
delegateTool('jar_diff', 'Show differences between original and modified file.', {
|
|
212
|
+
type: 'object',
|
|
213
|
+
properties: {
|
|
214
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
215
|
+
class_path: { type: 'string', description: 'File path within JAR' },
|
|
216
|
+
},
|
|
217
|
+
required: ['session_id', 'class_path'],
|
|
218
|
+
}),
|
|
219
|
+
delegateTool('jar_restore_file', 'Restore a file from backup to undo modifications.', {
|
|
220
|
+
type: 'object',
|
|
221
|
+
properties: {
|
|
222
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
223
|
+
class_path: { type: 'string', description: 'File path within JAR' },
|
|
224
|
+
},
|
|
225
|
+
required: ['session_id', 'class_path'],
|
|
226
|
+
}),
|
|
227
|
+
// Presets
|
|
228
|
+
delegateTool('jar_preset_save', 'Save a named preset of constant edits for reuse.', {
|
|
229
|
+
type: 'object',
|
|
230
|
+
properties: {
|
|
231
|
+
preset_name: { type: 'string', description: 'Preset name' },
|
|
232
|
+
description: { type: 'string', description: 'Preset description' },
|
|
233
|
+
class_path: { type: 'string', description: 'Target class path' },
|
|
234
|
+
edits: { type: 'object', description: 'Edit map' },
|
|
235
|
+
edit_mode: { type: 'string', description: 'Edit mode: constants or pool (default: constants)' },
|
|
236
|
+
},
|
|
237
|
+
required: ['preset_name', 'description', 'class_path', 'edits'],
|
|
238
|
+
}),
|
|
239
|
+
delegateTool('jar_preset_apply', 'Apply a saved preset of constant edits.', {
|
|
240
|
+
type: 'object',
|
|
241
|
+
properties: {
|
|
242
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
243
|
+
preset_name: { type: 'string', description: 'Preset name to apply' },
|
|
244
|
+
reverse: { type: 'boolean', description: 'Reverse the edits (default: false)' },
|
|
245
|
+
},
|
|
246
|
+
required: ['session_id', 'preset_name'],
|
|
247
|
+
}),
|
|
248
|
+
delegateTool('jar_preset_list', 'List all saved edit presets.', {
|
|
249
|
+
type: 'object',
|
|
250
|
+
properties: {},
|
|
251
|
+
}),
|
|
252
|
+
// Repack/Scaffold
|
|
253
|
+
delegateTool('jar_repack', 'Repack the modified JAR file with all changes.', {
|
|
254
|
+
type: 'object',
|
|
255
|
+
properties: {
|
|
256
|
+
session_id: { type: 'string', description: 'Session ID' },
|
|
257
|
+
output_path: { type: 'string', description: 'Optional output path (defaults to original)' },
|
|
258
|
+
},
|
|
259
|
+
required: ['session_id'],
|
|
260
|
+
}),
|
|
261
|
+
delegateTool('jar_scaffold_mod', 'Generate a minimal Minecraft mod JAR structure.', {
|
|
262
|
+
type: 'object',
|
|
263
|
+
properties: {
|
|
264
|
+
mod_name: { type: 'string', description: 'Mod display name' },
|
|
265
|
+
mod_id: { type: 'string', description: 'Mod ID (lowercase, no spaces)' },
|
|
266
|
+
loader: { type: 'string', description: 'Mod loader: fabric, forge, neoforge (default: fabric)' },
|
|
267
|
+
mc_version: { type: 'string', description: 'Minecraft version (default: 1.21.5)' },
|
|
268
|
+
author: { type: 'string', description: 'Author name' },
|
|
269
|
+
description: { type: 'string', description: 'Mod description' },
|
|
270
|
+
output_dir: { type: 'string', description: 'Output directory' },
|
|
271
|
+
},
|
|
272
|
+
required: ['mod_name', 'mod_id', 'output_dir'],
|
|
273
|
+
}),
|
|
274
|
+
];
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=jar-editor.js.map
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { childPool } from '../../backends/child-pool.js';
|
|
2
|
+
import { logger } from '../../utils/logger.js';
|
|
3
|
+
import { session } from '../../core/session.js';
|
|
4
|
+
function delegateTool(name, description, inputSchema, postProcess) {
|
|
5
|
+
return {
|
|
6
|
+
name,
|
|
7
|
+
description,
|
|
8
|
+
inputSchema,
|
|
9
|
+
handler: async (args) => {
|
|
10
|
+
const start = Date.now();
|
|
11
|
+
logger.toolStart(name, 'unity-decompiler');
|
|
12
|
+
try {
|
|
13
|
+
const result = await childPool.call('unity-decompiler', name, args);
|
|
14
|
+
const text = result.content.map(c => c.text).join('\n');
|
|
15
|
+
const duration = Date.now() - start;
|
|
16
|
+
logger.toolComplete(name, 'unity-decompiler', duration, !result.isError);
|
|
17
|
+
session.recordToolCall({ tool: name, timestamp: start, duration, success: !result.isError, backend: 'unity-decompiler' });
|
|
18
|
+
if (postProcess && !result.isError)
|
|
19
|
+
postProcess(text, args);
|
|
20
|
+
return text;
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
const duration = Date.now() - start;
|
|
24
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
25
|
+
logger.toolComplete(name, 'unity-decompiler', duration, false);
|
|
26
|
+
session.recordToolCall({ tool: name, timestamp: start, duration, success: false, backend: 'unity-decompiler' });
|
|
27
|
+
return `ERROR: ${msg}`;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function getUnityDelegateTools() {
|
|
33
|
+
return [
|
|
34
|
+
// Phase 1: Understanding
|
|
35
|
+
delegateTool('load_assembly', 'Load a .NET assembly (DLL) for analysis. Must be called before other Unity tools.', {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
assembly_path: { type: 'string', description: 'Full path to the .NET DLL file' },
|
|
39
|
+
managed_directory: { type: 'string', description: 'Optional: path to the Managed directory for dependency resolution' },
|
|
40
|
+
},
|
|
41
|
+
required: ['assembly_path'],
|
|
42
|
+
}),
|
|
43
|
+
delegateTool('list_types', 'List all types (classes, structs, enums, interfaces) in a loaded assembly.', {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
assembly: { type: 'string', description: 'Assembly key (from load_assembly)' },
|
|
47
|
+
filter: { type: 'string', description: 'Filter by name (substring match)' },
|
|
48
|
+
kind: { type: 'string', description: 'Filter by kind: class, struct, enum, interface' },
|
|
49
|
+
base_type: { type: 'string', description: 'Filter by base type name' },
|
|
50
|
+
limit: { type: 'number', description: 'Max results (default 200)' },
|
|
51
|
+
},
|
|
52
|
+
required: ['assembly'],
|
|
53
|
+
}),
|
|
54
|
+
delegateTool('decompile_type', 'Decompile a type to full C# source code.', {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
58
|
+
type_name: { type: 'string', description: 'Full type name (Namespace.ClassName)' },
|
|
59
|
+
},
|
|
60
|
+
required: ['assembly', 'type_name'],
|
|
61
|
+
}, (result, args) => {
|
|
62
|
+
session.cacheDecompilation(args.type_name, result);
|
|
63
|
+
}),
|
|
64
|
+
delegateTool('decompile_method', 'Decompile a single method to C# source code.', {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
68
|
+
type_name: { type: 'string', description: 'Full type name' },
|
|
69
|
+
method_name: { type: 'string', description: 'Method name' },
|
|
70
|
+
parameter_count: { type: 'number', description: 'Parameter count to disambiguate overloads' },
|
|
71
|
+
},
|
|
72
|
+
required: ['assembly', 'type_name', 'method_name'],
|
|
73
|
+
}),
|
|
74
|
+
delegateTool('inspect_type', 'Inspect type structure (fields, properties, methods) without decompiling method bodies.', {
|
|
75
|
+
type: 'object',
|
|
76
|
+
properties: {
|
|
77
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
78
|
+
type_name: { type: 'string', description: 'Full type name' },
|
|
79
|
+
},
|
|
80
|
+
required: ['assembly', 'type_name'],
|
|
81
|
+
}),
|
|
82
|
+
delegateTool('search_code', 'Search across assembly for types, methods, fields, or string literals.', {
|
|
83
|
+
type: 'object',
|
|
84
|
+
properties: {
|
|
85
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
86
|
+
pattern: { type: 'string', description: 'Search pattern' },
|
|
87
|
+
scope: { type: 'string', description: 'Search scope: all, types, methods, fields, strings (default: all)' },
|
|
88
|
+
limit: { type: 'number', description: 'Max results (default 100)' },
|
|
89
|
+
},
|
|
90
|
+
required: ['assembly', 'pattern'],
|
|
91
|
+
}),
|
|
92
|
+
delegateTool('find_references', 'Find all references to a method or field.', {
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: {
|
|
95
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
96
|
+
type_name: { type: 'string', description: 'Type containing the member' },
|
|
97
|
+
member_name: { type: 'string', description: 'Member name to find references to' },
|
|
98
|
+
limit: { type: 'number', description: 'Max results (default 100)' },
|
|
99
|
+
},
|
|
100
|
+
required: ['assembly', 'type_name', 'member_name'],
|
|
101
|
+
}),
|
|
102
|
+
delegateTool('get_inheritance_tree', 'Get full inheritance tree for a type (ancestors and descendants).', {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
106
|
+
type_name: { type: 'string', description: 'Full type name' },
|
|
107
|
+
},
|
|
108
|
+
required: ['assembly', 'type_name'],
|
|
109
|
+
}),
|
|
110
|
+
delegateTool('list_monobehaviours', 'List all MonoBehaviour components in assembly.', {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
114
|
+
filter: { type: 'string', description: 'Optional name filter' },
|
|
115
|
+
limit: { type: 'number', description: 'Max results (default 200)' },
|
|
116
|
+
},
|
|
117
|
+
required: ['assembly'],
|
|
118
|
+
}),
|
|
119
|
+
delegateTool('list_scriptableobjects', 'List all ScriptableObject types in assembly.', {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {
|
|
122
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
123
|
+
filter: { type: 'string', description: 'Optional name filter' },
|
|
124
|
+
},
|
|
125
|
+
required: ['assembly'],
|
|
126
|
+
}),
|
|
127
|
+
delegateTool('get_serialized_fields', 'Get all serialized fields for a MonoBehaviour or ScriptableObject.', {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {
|
|
130
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
131
|
+
type_name: { type: 'string', description: 'Full type name' },
|
|
132
|
+
},
|
|
133
|
+
required: ['assembly', 'type_name'],
|
|
134
|
+
}),
|
|
135
|
+
delegateTool('get_method_il', 'Get raw IL bytecode for a method.', {
|
|
136
|
+
type: 'object',
|
|
137
|
+
properties: {
|
|
138
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
139
|
+
type_name: { type: 'string', description: 'Full type name' },
|
|
140
|
+
method_name: { type: 'string', description: 'Method name' },
|
|
141
|
+
},
|
|
142
|
+
required: ['assembly', 'type_name', 'method_name'],
|
|
143
|
+
}),
|
|
144
|
+
// Phase 2: Mod Building
|
|
145
|
+
delegateTool('generate_plugin', 'Generate complete BepInEx 5 plugin template with Harmony patching.', {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
plugin_name: { type: 'string', description: 'Plugin class name' },
|
|
149
|
+
plugin_guid: { type: 'string', description: 'Plugin GUID (e.g. com.author.pluginname)' },
|
|
150
|
+
version: { type: 'string', description: 'Version string (default 1.0.0)' },
|
|
151
|
+
description: { type: 'string', description: 'Plugin description' },
|
|
152
|
+
author: { type: 'string', description: 'Author name' },
|
|
153
|
+
include_harmony: { type: 'boolean', description: 'Include Harmony setup' },
|
|
154
|
+
include_config: { type: 'boolean', description: 'Include config system' },
|
|
155
|
+
managed_directory: { type: 'string', description: 'Path to game Managed directory' },
|
|
156
|
+
},
|
|
157
|
+
required: ['plugin_name', 'plugin_guid'],
|
|
158
|
+
}),
|
|
159
|
+
delegateTool('generate_harmony_patch', 'Generate correct Harmony patch class for a specific method.', {
|
|
160
|
+
type: 'object',
|
|
161
|
+
properties: {
|
|
162
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
163
|
+
type_name: { type: 'string', description: 'Target type name' },
|
|
164
|
+
method_name: { type: 'string', description: 'Target method name' },
|
|
165
|
+
patch_type: { type: 'string', description: 'Patch type: prefix, postfix, both (default: both)' },
|
|
166
|
+
parameter_count: { type: 'number', description: 'Parameter count for overload disambiguation' },
|
|
167
|
+
patch_class_name: { type: 'string', description: 'Custom name for the patch class' },
|
|
168
|
+
},
|
|
169
|
+
required: ['assembly', 'type_name', 'method_name'],
|
|
170
|
+
}),
|
|
171
|
+
delegateTool('validate_patch_target', 'Validate that a Harmony patch target method exists with expected signature.', {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: {
|
|
174
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
175
|
+
type_name: { type: 'string', description: 'Target type name' },
|
|
176
|
+
method_name: { type: 'string', description: 'Target method name' },
|
|
177
|
+
expected_params: { type: 'string', description: 'Expected parameter types (comma-separated)' },
|
|
178
|
+
expected_return: { type: 'string', description: 'Expected return type' },
|
|
179
|
+
},
|
|
180
|
+
required: ['assembly', 'type_name', 'method_name'],
|
|
181
|
+
}),
|
|
182
|
+
delegateTool('list_patchable_methods', 'List all methods in a type that can be Harmony patched.', {
|
|
183
|
+
type: 'object',
|
|
184
|
+
properties: {
|
|
185
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
186
|
+
type_name: { type: 'string', description: 'Full type name' },
|
|
187
|
+
filter: { type: 'string', description: 'Optional method name filter' },
|
|
188
|
+
include_inherited: { type: 'boolean', description: 'Include inherited methods (default: false)' },
|
|
189
|
+
},
|
|
190
|
+
required: ['assembly', 'type_name'],
|
|
191
|
+
}),
|
|
192
|
+
delegateTool('compile_plugin', 'Compile a BepInEx plugin C# source file using Roslyn.', {
|
|
193
|
+
type: 'object',
|
|
194
|
+
properties: {
|
|
195
|
+
source_files: { type: 'string', description: 'C# source file path(s), semicolon-separated' },
|
|
196
|
+
managed_directory: { type: 'string', description: 'Path to game Managed directory' },
|
|
197
|
+
bepinex_core_directory: { type: 'string', description: 'Path to BepInEx/core directory' },
|
|
198
|
+
output_path: { type: 'string', description: 'Output DLL path' },
|
|
199
|
+
assembly_name: { type: 'string', description: 'Assembly name (optional)' },
|
|
200
|
+
},
|
|
201
|
+
required: ['source_files', 'managed_directory', 'bepinex_core_directory', 'output_path'],
|
|
202
|
+
}),
|
|
203
|
+
// Phase 3: Debugging
|
|
204
|
+
delegateTool('analyze_bepinex_log', 'Analyze BepInEx log for errors, warnings, and patch issues.', {
|
|
205
|
+
type: 'object',
|
|
206
|
+
properties: {
|
|
207
|
+
log_path: { type: 'string', description: 'Path to BepInEx LogOutput.log' },
|
|
208
|
+
},
|
|
209
|
+
required: ['log_path'],
|
|
210
|
+
}),
|
|
211
|
+
delegateTool('validate_assembly', 'Validate compiled plugin DLL for missing references and conflicts.', {
|
|
212
|
+
type: 'object',
|
|
213
|
+
properties: {
|
|
214
|
+
plugin_path: { type: 'string', description: 'Path to compiled plugin DLL' },
|
|
215
|
+
managed_directory: { type: 'string', description: 'Path to game Managed directory' },
|
|
216
|
+
},
|
|
217
|
+
required: ['plugin_path', 'managed_directory'],
|
|
218
|
+
}),
|
|
219
|
+
delegateTool('compare_signatures', 'Compare expected Harmony patch signature with actual target method.', {
|
|
220
|
+
type: 'object',
|
|
221
|
+
properties: {
|
|
222
|
+
game_assembly: { type: 'string', description: 'Assembly key' },
|
|
223
|
+
target_type: { type: 'string', description: 'Target type name' },
|
|
224
|
+
target_method: { type: 'string', description: 'Target method name' },
|
|
225
|
+
patch_params: { type: 'string', description: 'Patch parameter types (comma-separated)' },
|
|
226
|
+
patch_kind: { type: 'string', description: 'Patch kind: prefix or postfix (default: prefix)' },
|
|
227
|
+
},
|
|
228
|
+
required: ['game_assembly', 'target_type', 'target_method', 'patch_params'],
|
|
229
|
+
}),
|
|
230
|
+
// Phase 4: Advanced
|
|
231
|
+
delegateTool('read_unity_assets_info', 'List Unity asset files in game data directory.', {
|
|
232
|
+
type: 'object',
|
|
233
|
+
properties: {
|
|
234
|
+
data_directory: { type: 'string', description: 'Path to game _Data directory' },
|
|
235
|
+
},
|
|
236
|
+
required: ['data_directory'],
|
|
237
|
+
}),
|
|
238
|
+
delegateTool('read_playerprefs', 'Read Unity PlayerPrefs from Windows registry.', {
|
|
239
|
+
type: 'object',
|
|
240
|
+
properties: {
|
|
241
|
+
company_name: { type: 'string', description: 'Company name from PlayerSettings' },
|
|
242
|
+
product_name: { type: 'string', description: 'Product name from PlayerSettings' },
|
|
243
|
+
filter: { type: 'string', description: 'Optional key filter' },
|
|
244
|
+
},
|
|
245
|
+
required: ['company_name', 'product_name'],
|
|
246
|
+
}),
|
|
247
|
+
delegateTool('analyze_save_format', 'Analyze game save system by examining SaveManager classes.', {
|
|
248
|
+
type: 'object',
|
|
249
|
+
properties: {
|
|
250
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
251
|
+
},
|
|
252
|
+
required: ['assembly'],
|
|
253
|
+
}),
|
|
254
|
+
delegateTool('detect_networking', 'Detect networking frameworks and flag unsafe-to-patch methods.', {
|
|
255
|
+
type: 'object',
|
|
256
|
+
properties: {
|
|
257
|
+
assembly: { type: 'string', description: 'Assembly key' },
|
|
258
|
+
},
|
|
259
|
+
required: ['assembly'],
|
|
260
|
+
}),
|
|
261
|
+
// Phase 5: Maintenance
|
|
262
|
+
delegateTool('diff_assemblies', 'Compare two assembly versions to show changes.', {
|
|
263
|
+
type: 'object',
|
|
264
|
+
properties: {
|
|
265
|
+
old_assembly_path: { type: 'string', description: 'Path to old version DLL' },
|
|
266
|
+
new_assembly_path: { type: 'string', description: 'Path to new version DLL' },
|
|
267
|
+
show_methods: { type: 'boolean', description: 'Show method-level changes (default: true)' },
|
|
268
|
+
limit: { type: 'number', description: 'Max results (default 200)' },
|
|
269
|
+
},
|
|
270
|
+
required: ['old_assembly_path', 'new_assembly_path'],
|
|
271
|
+
}),
|
|
272
|
+
delegateTool('find_renamed_types', 'Find types likely renamed after a game update.', {
|
|
273
|
+
type: 'object',
|
|
274
|
+
properties: {
|
|
275
|
+
old_assembly_path: { type: 'string', description: 'Path to old version DLL' },
|
|
276
|
+
new_assembly_path: { type: 'string', description: 'Path to new version DLL' },
|
|
277
|
+
min_similarity: { type: 'number', description: 'Min similarity threshold 0-1 (default: 0.6)' },
|
|
278
|
+
},
|
|
279
|
+
required: ['old_assembly_path', 'new_assembly_path'],
|
|
280
|
+
}),
|
|
281
|
+
delegateTool('verify_patches', 'Verify Harmony patch targets in plugin still exist in game assembly.', {
|
|
282
|
+
type: 'object',
|
|
283
|
+
properties: {
|
|
284
|
+
plugin_path: { type: 'string', description: 'Path to compiled plugin DLL' },
|
|
285
|
+
game_assembly: { type: 'string', description: 'Path to game Assembly-CSharp.dll' },
|
|
286
|
+
},
|
|
287
|
+
required: ['plugin_path', 'game_assembly'],
|
|
288
|
+
}),
|
|
289
|
+
];
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=unity-decompiler.js.map
|