dsh-reverse-engine 0.0.0-stage → 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/lib/tools.js ADDED
@@ -0,0 +1,245 @@
1
+ /**
2
+ * Model-facing tools.
3
+ *
4
+ * Two dispatcher tools keep the 274-tool catalog out of every request:
5
+ * `rea_tools` searches it and `rea_call` executes any entry. The default `core`
6
+ * exposure additionally registers the first tools of the investigation workflow
7
+ * under their canonical REA names, so the shipped
8
+ * `reverse-engineer-anything` skill keeps working unchanged.
9
+ */
10
+ import { familyOf, familiesOf, searchTools } from './catalog.js'
11
+ import { ReaError, text } from './util.js'
12
+
13
+ const MAX_RENDER_CHARS = 400_000
14
+
15
+ function schemaOf(tool) {
16
+ const schema = tool.inputSchema
17
+ if (!schema || typeof schema !== 'object' || Array.isArray(schema)) return { type: 'object', properties: {}, additionalProperties: false }
18
+ if (schema.type === 'object' && schema.properties && typeof schema.properties === 'object') return schema
19
+ return { type: 'object', properties: {}, additionalProperties: false }
20
+ }
21
+
22
+ function renderValue(value) {
23
+ if (value === null || value === undefined) return [{ type: 'text', text: '(no result)' }]
24
+ let body
25
+ if (typeof value === 'string') body = value
26
+ else if (value.ok === false && value.error) body = JSON.stringify({ ok: false, error: value.error }, null, 2)
27
+ else if (value.structuredContent !== undefined && value.structuredContent !== null) body = JSON.stringify(value.structuredContent, null, 2)
28
+ else if (value.text !== undefined) body = String(value.text)
29
+ else body = JSON.stringify(value, null, 2)
30
+ if (body.length > MAX_RENDER_CHARS) {
31
+ body = `${body.slice(0, MAX_RENDER_CHARS)}\n\n[truncated ${body.length - MAX_RENDER_CHARS} characters; request a narrower tool result, or page retained Evidence with inspect_analysis_view]`
32
+ }
33
+ return [{ type: 'text', text: body }]
34
+ }
35
+
36
+ function errorValue(error) {
37
+ return {
38
+ ok: false,
39
+ error: {
40
+ code: typeof error?.code === 'string' ? error.code : 'rea-failed',
41
+ message: error instanceof Error ? error.message : String(error),
42
+ ...(error?.details ? { details: error.details } : {}),
43
+ },
44
+ }
45
+ }
46
+
47
+ function wrapperFor(tool, engine, settings) {
48
+ const description = tool.description?.trim() || tool.title || `${tool.name} (REA)`
49
+ return {
50
+ name: tool.name,
51
+ description: `[REA] ${description}`,
52
+ parameters: schemaOf(tool),
53
+ timeoutMs: settings.toolCallTimeoutMs + 5_000,
54
+ output: {
55
+ schema: { type: 'object', additionalProperties: true },
56
+ render: (_args, value) => renderValue(value),
57
+ },
58
+ async execute(args, exec) {
59
+ try {
60
+ const result = await engine.callTool(tool.name, args && typeof args === 'object' ? args : {}, { signal: exec?.signal })
61
+ return {
62
+ ok: true,
63
+ tool: tool.name,
64
+ durationMs: result.durationMs,
65
+ structuredContent: result.structuredContent,
66
+ text: result.text,
67
+ content: result.content,
68
+ }
69
+ } catch (error) {
70
+ return errorValue(error)
71
+ }
72
+ },
73
+ }
74
+ }
75
+
76
+ function statusTool(engine, settings, extra) {
77
+ return {
78
+ name: 'rea_status',
79
+ description:
80
+ '[REA] Report the local REA engine used by this plugin: readiness, engine version, Node.js runtime, tool and prompt counts, exposure mode, data directory, and the MCP command other agent clients can use. '
81
+ + 'Use it when a REA tool fails or when the user asks whether reverse engineering is available.',
82
+ parameters: { type: 'object', properties: {}, additionalProperties: false },
83
+ output: {
84
+ schema: { type: 'object', additionalProperties: true },
85
+ render: (_args, value) => renderValue(value),
86
+ },
87
+ async execute() {
88
+ const snapshot = engine.snapshot()
89
+ return {
90
+ ok: snapshot.status === 'ready',
91
+ engine: snapshot,
92
+ exposure: {
93
+ mode: settings.toolExposure,
94
+ families: settings.toolFamilies,
95
+ nativeToolCount: extra.nativeToolNames?.length ?? 0,
96
+ nativeTools: extra.nativeToolNames ?? [],
97
+ },
98
+ catalog: {
99
+ tools: engine.tools.length,
100
+ prompts: engine.prompts.length,
101
+ families: familiesOf(engine.tools),
102
+ },
103
+ mcp: extra.mcpCommand ?? null,
104
+ dataDirectory: settings.dataDirectory,
105
+ usage:
106
+ 'Use rea_tools to search the complete REA catalog, then rea_call with { tool, arguments } to run any entry. '
107
+ + 'The reverse-engineer-anything skill documents the investigation workflow. Native providers (Ghidra, IDA, Hopper, Kuna) must be installed and configured by the user.',
108
+ }
109
+ },
110
+ }
111
+ }
112
+
113
+ function catalogTool(engine) {
114
+ return {
115
+ name: 'rea_tools',
116
+ description:
117
+ '[REA] Search the complete REA reverse-engineering tool catalog without starting analysis: 274 operations across native binaries, JavaScript/Electron, .NET, Android, firmware, captures, and Evidence workflows. '
118
+ + 'Returns canonical tool names, one-line descriptions, families, and risk hints. Follow with rea_call({ tool, arguments }). Use an empty query to page the whole catalog, or filter with family.',
119
+ parameters: {
120
+ type: 'object',
121
+ properties: {
122
+ query: { type: 'string', description: 'Words matched against tool names and descriptions, for example "ghidra function", "javascript asar", or "evidence".' },
123
+ family: { type: 'string', description: 'Optional family id such as native, artifact, javascript-runtime, application, android, firmware, browser, or session.' },
124
+ limit: { type: 'integer', minimum: 1, maximum: 50, description: 'Maximum results (default 20).' },
125
+ offset: { type: 'integer', minimum: 0, description: 'Result offset for paging.' },
126
+ },
127
+ additionalProperties: false,
128
+ },
129
+ output: {
130
+ schema: { type: 'object', additionalProperties: true },
131
+ render: (_args, value) => renderValue(value),
132
+ },
133
+ async execute(args) {
134
+ if (engine.status !== 'ready') {
135
+ return { ok: false, error: { code: 'engine-not-ready', message: engine.snapshot().lastError ?? 'The REA engine is starting or stopped.' } }
136
+ }
137
+ const page = searchTools(engine.tools, args?.query ?? '', {
138
+ family: args?.family,
139
+ limit: args?.limit ?? 20,
140
+ offset: args?.offset ?? 0,
141
+ })
142
+ return {
143
+ ok: true,
144
+ ...page,
145
+ families: familiesOf(engine.tools),
146
+ hint: page.total === 0
147
+ ? 'No tool matched. Try fewer or different words, or omit family.'
148
+ : 'Run one with rea_call({ tool, arguments }). Ask for the input schema with rea_tools again only when needed.',
149
+ }
150
+ },
151
+ }
152
+ }
153
+
154
+ function callTool(engine, settings) {
155
+ return {
156
+ name: 'rea_call',
157
+ description:
158
+ '[REA] Execute any REA reverse-engineering operation by canonical tool name. Pass the exact name returned by rea_tools and a JSON arguments object matching that tool schema. '
159
+ + 'Operations run locally against user-supplied paths; long native operations (a cold Ghidra import) can take minutes. '
160
+ + 'Results are canonical Evidence JSON. Common first calls: binary_session, open_binary, inspect_artifact, analyze_javascript_application.',
161
+ parameters: {
162
+ type: 'object',
163
+ properties: {
164
+ tool: { type: 'string', description: 'Canonical REA tool name, as returned by rea_tools.' },
165
+ arguments: { type: 'object', additionalProperties: true, description: 'Arguments for that tool. Omit or pass {} for a target-free report such as binary_session.' },
166
+ timeout_ms: { type: 'integer', minimum: 5000, maximum: 3600000, description: 'Optional per-call deadline; defaults to the plugin setting.' },
167
+ },
168
+ required: ['tool'],
169
+ additionalProperties: false,
170
+ },
171
+ timeoutMs: settings.toolCallTimeoutMs + 5_000,
172
+ output: {
173
+ schema: { type: 'object', additionalProperties: true },
174
+ render: (_args, value) => renderValue(value),
175
+ },
176
+ async execute(args, exec) {
177
+ try {
178
+ const result = await engine.callTool(String(args?.tool ?? '').trim(), args?.arguments && typeof args.arguments === 'object' ? args.arguments : {}, {
179
+ signal: exec?.signal,
180
+ timeoutMs: args?.timeout_ms,
181
+ })
182
+ return {
183
+ ok: true,
184
+ tool: args.tool,
185
+ family: familyOf(String(args.tool)),
186
+ durationMs: result.durationMs,
187
+ structuredContent: result.structuredContent,
188
+ text: result.text,
189
+ content: result.content,
190
+ }
191
+ } catch (error) {
192
+ return errorValue(error)
193
+ }
194
+ },
195
+ }
196
+ }
197
+
198
+ /** Build the complete tool set for one catalog generation. */
199
+ export function buildToolDefinitions({ engine, settings, extra = {} }) {
200
+ const tools = [statusTool(engine, settings, extra), catalogTool(engine), callTool(engine, settings)]
201
+ return tools
202
+ }
203
+
204
+ export function buildNativeTool({ engine, settings, tool }) {
205
+ return wrapperFor(tool, engine, settings)
206
+ }
207
+
208
+ export function buildPromptTool(engine) {
209
+ return {
210
+ name: 'rea_workflow',
211
+ description:
212
+ '[REA] Read one of REA\'s guided investigation workflows by name, for example investigate_feature, compare_application_versions, verify_reconstruction, trace_crash. Returns the workflow Markdown. Use rea_status for the current prompt list.',
213
+ parameters: {
214
+ type: 'object',
215
+ properties: {
216
+ name: { type: 'string', description: 'Guided workflow name.' },
217
+ arguments: { type: 'object', additionalProperties: true, description: 'Workflow arguments, when it declares any.' },
218
+ },
219
+ required: ['name'],
220
+ additionalProperties: false,
221
+ },
222
+ output: {
223
+ schema: { type: 'object', additionalProperties: true },
224
+ render: (_args, value) => renderValue(value),
225
+ },
226
+ async execute(args) {
227
+ try {
228
+ const prompt = await engine.getPrompt(String(args?.name ?? ''), args?.arguments && typeof args.arguments === 'object' ? args.arguments : {})
229
+ const body = prompt.messages
230
+ .map(message => {
231
+ const content = message?.content
232
+ if (content?.type === 'text') return String(content.text ?? '')
233
+ return JSON.stringify(content)
234
+ })
235
+ .join('\n\n')
236
+ return { ok: true, name: args.name, description: prompt.description, text: body }
237
+ } catch (error) {
238
+ return errorValue(error)
239
+ }
240
+ },
241
+ }
242
+ }
243
+
244
+ export { renderValue, errorValue, schemaOf }
245
+ export { ReaError, text }
package/lib/util.js ADDED
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Small shared helpers for the dsh-reverse-engine Host half.
3
+ *
4
+ * The plugin keeps its own state as plain JSON under the DSH home directory and
5
+ * spawns only the external `rea` engine; nothing here imports DSH internals.
6
+ */
7
+ import { spawn } from 'node:child_process'
8
+ import fs from 'node:fs'
9
+ import fsp from 'node:fs/promises'
10
+ import os from 'node:os'
11
+ import path from 'node:path'
12
+
13
+ /** A plugin-owned failure with a stable code the page and the tools can branch on. */
14
+ export class ReaError extends Error {
15
+ constructor(code, message, details) {
16
+ super(message)
17
+ this.name = 'ReaError'
18
+ this.code = code
19
+ this.details = details
20
+ }
21
+ }
22
+
23
+ /** JSON response with no caching. */
24
+ export function json(payload, status = 200) {
25
+ return new Response(JSON.stringify(payload), {
26
+ status,
27
+ headers: {
28
+ 'content-type': 'application/json; charset=utf-8',
29
+ 'cache-control': 'no-store',
30
+ },
31
+ })
32
+ }
33
+
34
+ /** One error envelope for every route: `{ ok: false, error: { code, message } }`. */
35
+ export function errorResponse(error) {
36
+ const code = typeof error?.code === 'string' ? error.code : 'failed'
37
+ const message = error instanceof Error ? error.message : String(error)
38
+ let status = 400
39
+ if (code === 'body-too-large') status = 413
40
+ else if (code === 'not-found') status = 404
41
+ else if (code === 'method-not-allowed') status = 405
42
+ else if (code === 'engine-not-ready' || code === 'runtime-missing') status = 409
43
+ else if (code === 'engine-timeout' || code === 'engine-stopped') status = 503
44
+ return json({ ok: false, error: { code, message, details: safeDetails(error?.details) } }, status)
45
+ }
46
+
47
+ function safeDetails(details) {
48
+ if (details === undefined || details === null) return undefined
49
+ try {
50
+ JSON.stringify(details)
51
+ return details
52
+ } catch {
53
+ return String(details)
54
+ }
55
+ }
56
+
57
+ /** Read a JSON request body with an explicit size bound. */
58
+ export async function readJsonBody(request, limit = 256 * 1024) {
59
+ const text = await request.text()
60
+ if (text.length > limit) throw new ReaError('body-too-large', 'Request body is too large.')
61
+ if (!text.trim()) return {}
62
+ let value
63
+ try {
64
+ value = JSON.parse(text)
65
+ } catch {
66
+ throw new ReaError('invalid-json', 'Request body must be valid JSON.')
67
+ }
68
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
69
+ throw new ReaError('invalid-json', 'Request body must be a JSON object.')
70
+ }
71
+ return value
72
+ }
73
+
74
+ /** Read and parse a JSON file, returning `fallback` for a missing or invalid file. */
75
+ export async function readJsonFile(file, fallback = undefined) {
76
+ try {
77
+ return JSON.parse(await fsp.readFile(file, 'utf8'))
78
+ } catch {
79
+ return fallback
80
+ }
81
+ }
82
+
83
+ /** Read a JSON file synchronously, returning `fallback` on any failure. */
84
+ export function readJsonFileSync(file, fallback = undefined) {
85
+ try {
86
+ return JSON.parse(fs.readFileSync(file, 'utf8'))
87
+ } catch {
88
+ return fallback
89
+ }
90
+ }
91
+
92
+ /** Write JSON atomically (temp file in the same directory, then rename). */
93
+ export async function writeJsonAtomic(file, value) {
94
+ await fsp.mkdir(path.dirname(file), { recursive: true })
95
+ const temporary = `${file}.${process.pid}.${Date.now()}.tmp`
96
+ await fsp.writeFile(temporary, `${JSON.stringify(value, null, 2)}\n`, 'utf8')
97
+ try {
98
+ await fsp.rename(temporary, file)
99
+ } catch (error) {
100
+ // Some Windows workspace volumes report EXDEV for a same-directory rename.
101
+ // Fall back to a replacement copy so settings still persist.
102
+ if (error?.code !== 'EXDEV' && error?.code !== 'EPERM') throw error
103
+ await fsp.copyFile(temporary, file)
104
+ await fsp.unlink(temporary).catch(() => {})
105
+ }
106
+ }
107
+
108
+ /** Coerce to a bounded string. */
109
+ export function text(value, max = 4096) {
110
+ const string = typeof value === 'string' ? value : value === undefined || value === null ? '' : String(value)
111
+ return string.length > max ? `${string.slice(0, max)}…` : string
112
+ }
113
+
114
+ /** Clamp an integer option. */
115
+ export function clampInteger(value, min, max, fallback) {
116
+ const number = Number(value)
117
+ if (!Number.isFinite(number)) return fallback
118
+ return Math.min(max, Math.max(min, Math.trunc(number)))
119
+ }
120
+
121
+ /** First line of an error, for status cells. */
122
+ export function shortError(error) {
123
+ return text(error instanceof Error ? error.message : String(error), 400).split('\n')[0]
124
+ }
125
+
126
+ /** Expand a leading `~` and resolve relative paths against `base`. */
127
+ export function resolveUserPath(value, base = process.cwd()) {
128
+ if (typeof value !== 'string' || !value.trim()) return null
129
+ let candidate = value.trim()
130
+ if (candidate === '~') candidate = os.homedir()
131
+ else if (candidate.startsWith('~/') || candidate.startsWith('~\\')) candidate = path.join(os.homedir(), candidate.slice(2))
132
+ return path.resolve(base, candidate)
133
+ }
134
+
135
+ export function existsSync(file) {
136
+ try {
137
+ fs.accessSync(file)
138
+ return true
139
+ } catch {
140
+ return false
141
+ }
142
+ }
143
+
144
+ export function isDirectorySync(file) {
145
+ try {
146
+ return fs.statSync(file).isDirectory()
147
+ } catch {
148
+ return false
149
+ }
150
+ }
151
+
152
+ /** Parse a `vX.Y.Z` or `X.Y.Z` version into numeric parts. */
153
+ export function parseVersion(value) {
154
+ const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(String(value ?? '').trim())
155
+ if (!match) return null
156
+ return { major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]), prerelease: match[4] ?? null }
157
+ }
158
+
159
+ export function compareVersions(left, right) {
160
+ const a = typeof left === 'string' ? parseVersion(left) : left
161
+ const b = typeof right === 'string' ? parseVersion(right) : right
162
+ if (!a || !b) return 0
163
+ for (const key of ['major', 'minor', 'patch']) {
164
+ if (a[key] !== b[key]) return a[key] < b[key] ? -1 : 1
165
+ }
166
+ return 0
167
+ }
168
+
169
+ /**
170
+ * REA 7.x accepts Node 22.23.4+, 24.22.1+, or 26.12.1+. Keep this in one place:
171
+ * both runtime discovery and the page warning use it.
172
+ */
173
+ export function nodeSupport(version) {
174
+ const parsed = parseVersion(version)
175
+ if (!parsed) return { supported: false, reason: `Unknown Node.js version: ${version ?? 'none'}` }
176
+ const { major, minor, patch } = parsed
177
+ const atLeast = (maj, min, pat) => major === maj && (minor > min || (minor === min && patch >= pat))
178
+ if (major === 22) return atLeast(22, 23, 4) ? { supported: true } : { supported: false, reason: 'REA needs Node.js 22.23.4 or newer on the 22.x line.' }
179
+ if (major === 24) return atLeast(24, 22, 1) ? { supported: true } : { supported: false, reason: 'REA needs Node.js 24.22.1 or newer on the 24.x line.' }
180
+ if (major >= 26) return major === 26 && (minor > 12 || (minor === 12 && patch >= 1)) ? { supported: true } : major > 26 ? { supported: true } : { supported: false, reason: 'REA needs Node.js 26.12.1 or newer on the 26.x line.' }
181
+ return { supported: false, reason: `REA does not support Node.js ${version}; use 22.23.4+, 24.22.1+, or 26.12.1+.` }
182
+ }
183
+
184
+ /** Windows .cmd/.bat launchers need cmd.exe; other platforms execute directly. */
185
+ export function isWindowsBatch(file) {
186
+ return process.platform === 'win32' && /\.(cmd|bat)$/i.test(file)
187
+ }
188
+
189
+ function quoteWindowsArgument(value) {
190
+ const string = String(value)
191
+ if (string === '') return '""'
192
+ if (!/[\s"&|<>^()]/.test(string)) return string
193
+ return `"${string.replace(/"/g, '\\"')}"`
194
+ }
195
+
196
+ /**
197
+ * Run one child process and capture bounded output. Direct executables are
198
+ * spawned without a shell; `.cmd`/`.bat` launchers go through cmd.exe because
199
+ * Windows cannot execute them directly.
200
+ */
201
+ export function runCommand(file, args = [], options = {}) {
202
+ const {
203
+ cwd,
204
+ env,
205
+ timeoutMs = 120_000,
206
+ signal,
207
+ onStdout,
208
+ onStderr,
209
+ maxOutputBytes = 4 * 1024 * 1024,
210
+ input,
211
+ } = options
212
+
213
+ const useShell = isWindowsBatch(file)
214
+ const command = useShell ? process.env.ComSpec || 'cmd.exe' : file
215
+ const commandArgs = useShell
216
+ ? ['/d', '/s', '/c', [file, ...args].map(quoteWindowsArgument).join(' ')]
217
+ : args
218
+
219
+ return new Promise((resolve, reject) => {
220
+ let child
221
+ try {
222
+ child = spawn(command, commandArgs, {
223
+ cwd,
224
+ env,
225
+ stdio: [input === undefined ? 'ignore' : 'pipe', 'pipe', 'pipe'],
226
+ windowsHide: true,
227
+ })
228
+ } catch (error) {
229
+ reject(new ReaError('spawn-failed', `Cannot start ${path.basename(file)}: ${error.message}`))
230
+ return
231
+ }
232
+
233
+ let stdout = ''
234
+ let stderr = ''
235
+ let stdoutBytes = 0
236
+ let stderrBytes = 0
237
+ let settled = false
238
+ const finish = (error, value) => {
239
+ if (settled) return
240
+ settled = true
241
+ clearTimeout(timer)
242
+ if (signal) signal.removeEventListener?.('abort', abort)
243
+ if (error) reject(error)
244
+ else resolve(value)
245
+ }
246
+ const kill = () => {
247
+ try {
248
+ child.kill('SIGTERM')
249
+ } catch {
250
+ /* ignore */
251
+ }
252
+ }
253
+ const abort = () => {
254
+ kill()
255
+ finish(new ReaError('aborted', 'The command was cancelled.'))
256
+ }
257
+ const timer = setTimeout(() => {
258
+ kill()
259
+ finish(new ReaError('timeout', `The command timed out after ${Math.round(timeoutMs / 1000)} seconds.`))
260
+ }, Math.max(1, timeoutMs))
261
+ timer.unref?.()
262
+
263
+ if (signal) {
264
+ if (signal.aborted) {
265
+ abort()
266
+ return
267
+ }
268
+ signal.addEventListener('abort', abort, { once: true })
269
+ }
270
+
271
+ const take = (buffer, chunk) => {
272
+ const remaining = maxOutputBytes - Buffer.byteLength(buffer, 'utf8')
273
+ if (remaining <= 0) return buffer
274
+ const decoded = chunk.toString('utf8')
275
+ return buffer + (Buffer.byteLength(decoded, 'utf8') > remaining ? decoded.slice(0, remaining) : decoded)
276
+ }
277
+ child.stdout?.on('data', chunk => {
278
+ stdout = take(stdout, chunk)
279
+ stdoutBytes += chunk.length
280
+ onStdout?.(chunk.toString('utf8'))
281
+ })
282
+ child.stderr?.on('data', chunk => {
283
+ stderr = take(stderr, chunk)
284
+ stderrBytes += chunk.length
285
+ onStderr?.(chunk.toString('utf8'))
286
+ })
287
+ child.once('error', error => finish(new ReaError('spawn-failed', `Cannot start ${path.basename(file)}: ${error.message}`)))
288
+ child.once('close', (code, signalName) => finish(null, { code: code ?? -1, signal: signalName, stdout, stderr }))
289
+ if (input !== undefined) {
290
+ child.stdin.on('error', () => {})
291
+ child.stdin.end(input)
292
+ }
293
+ })
294
+ }
295
+
296
+ /** Locate an executable without a shell (`where` / `which`). */
297
+ export async function which(name) {
298
+ const file = process.platform === 'win32' ? 'where.exe' : 'which'
299
+ try {
300
+ const result = await runCommand(file, [name], { timeoutMs: 10_000, maxOutputBytes: 64 * 1024 })
301
+ if (result.code !== 0) return null
302
+ const first = result.stdout.split(/\r?\n/).map(line => line.trim()).find(Boolean)
303
+ return first || null
304
+ } catch {
305
+ return null
306
+ }
307
+ }
308
+
309
+ /** Quote a path for an npm command line shown to the user. */
310
+ export function quoteCommandPath(file) {
311
+ return /\s/.test(file) ? `"${file}"` : file
312
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Reverse engineering",
4
+ "description": "Run REA locally from DeepSeek Harness. The sidebar console shows the engine and Node runtime status, searches and runs all 274 REA analysis tools (native binaries, JavaScript/Electron, .NET, APK, firmware, captures, and evidence workflows), installs the reverse-engineer-anything skill, reports analysis-provider readiness, and registers the same local MCP engine with 43 agent clients such as Claude Code, Codex, Cursor, Gemini CLI, Qwen Code, and OpenCode. Targets and results stay on this machine. Native providers (Ghidra, IDA, Hopper, Kuna) use the installation the user configures; the plugin does not install them."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "逆向工程",
4
+ "description": "在 DeepSeek Harness 中本地运行 REA。侧边栏控制台显示引擎与 Node 运行时状态,可搜索并执行全部 274 个 REA 分析工具(原生二进制、JavaScript/Electron、.NET、APK、固件、抓包与证据工作流),安装 reverse-engineer-anything 技能,查看分析引擎(Ghidra / IDA / Hopper / Kuna)就绪情况,并把同一个本地 MCP 引擎一键注册到 Claude Code、Codex、Cursor、Gemini CLI、Qwen Code、OpenCode 等 43 个 Agent 客户端。目标文件与分析结果只保留在本机;原生分析引擎使用用户自行配置的安装,插件不代为安装。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,79 @@
1
1
  {
2
2
  "name": "dsh-reverse-engine",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "REA reverse-engineering workspace for DeepSeek Harness: an agent-side tool bridge for 274 local analysis operations plus a sidebar console with engine status, a runnable tool catalog, and one-click MCP registration for 43 agent clients.",
5
+ "license": "Apache-2.0",
6
+ "author": "Zmang-Tech",
7
+ "type": "module",
8
+ "main": "index.js",
9
+ "icon": "./icon.svg",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "homepage": "https://github.com/Zmang-Tech/dsh-reverse-engine#readme",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/Zmang-Tech/dsh-reverse-engine.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/Zmang-Tech/dsh-reverse-engine/issues"
20
+ },
21
+ "keywords": [
22
+ "deepseek-harness",
23
+ "dsh-plugin",
24
+ "reverse-engineering",
25
+ "rea",
26
+ "mcp",
27
+ "binary-analysis",
28
+ "decompiler",
29
+ "electron",
30
+ "ghidra",
31
+ "ida"
32
+ ],
33
+ "engines": {
34
+ "node": ">=22.19.0"
35
+ },
36
+ "scripts": {
37
+ "test": "node --test tests/",
38
+ "check": "node scripts/validate.mjs && node --test tests/",
39
+ "prepublishOnly": "npm run check"
40
+ },
41
+ "exports": {
42
+ ".": "./index.js",
43
+ "./client": "./client.js",
44
+ "./locale/*.json": "./locale/*.json",
45
+ "./icon": "./icon.svg",
46
+ "./package.json": "./package.json"
47
+ },
48
+ "files": [
49
+ "index.js",
50
+ "client.js",
51
+ "lib",
52
+ "locale/*.json",
53
+ "docs",
54
+ "icon.svg",
55
+ "cordis.patch.yml",
56
+ "README.md",
57
+ "README.zh-CN.md",
58
+ "CHANGELOG.md",
59
+ "LICENSE",
60
+ "NOTICE"
61
+ ],
62
+ "dependencies": {
63
+ "rea-agents": "7.0.0"
64
+ },
65
+ "dsh": {
66
+ "bundle": {
67
+ "patch": "./cordis.patch.yml"
68
+ },
69
+ "client": {
70
+ "platform": "web",
71
+ "immediately": true,
72
+ "inject": [
73
+ "@deepseek-ai/dsh-client-ui-layout",
74
+ "@deepseek-ai/dsh-client-ui-sidebar",
75
+ "@deepseek-ai/dsh-client-locale"
76
+ ]
77
+ }
78
+ }
79
+ }