dsh-reverse-engine 0.1.2 → 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/CHANGELOG.md +19 -0
- package/PARAMETERS.md +6773 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +11 -11
- package/client.js +107 -4
- package/docs/VERIFICATION.md +2 -2
- package/lib/catalog.js +26 -0
- package/lib/engine.js +2 -1
- package/lib/param-descriptions.json +1815 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-reverse-engine
|
|
2
2
|
|
|
3
|
-
[Usage guide](USAGE.md) · [
|
|
3
|
+
[Usage guide](USAGE.md) · [Parameter reference](PARAMETERS.md) · [中文使用指南](USAGE.md#简体中文) · [Architecture](docs/ARCHITECTURE.md)
|
|
4
4
|
|
|
5
5
|
REA (**Reverse Engineer Anything**) for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness):
|
|
6
6
|
a sidebar console and an agent tool bridge for local reverse engineering.
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-reverse-engine
|
|
2
2
|
|
|
3
|
-
[使用指南](USAGE.md#简体中文) · [
|
|
3
|
+
[使用指南](USAGE.md#简体中文) · [完整参数文档](PARAMETERS.md#简体中文) · [English usage](USAGE.md#english) · [架构](docs/ARCHITECTURE.md)
|
|
4
4
|
|
|
5
5
|
把 [REA](https://github.com/morluto/rea)(Reverse Engineer Anything)接入
|
|
6
6
|
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness):
|
package/USAGE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-reverse-engine usage guide
|
|
2
2
|
|
|
3
|
-
**English** · [简体中文](#简体中文) · [README](README.md) · [中文 README](README.zh-CN.md)
|
|
3
|
+
**English** · [简体中文](#简体中文) · [Parameter reference](PARAMETERS.md) · [README](README.md) · [中文 README](README.zh-CN.md)
|
|
4
4
|
|
|
5
5
|
This guide walks through every tab of the **Reverse engineering** panel and the
|
|
6
6
|
smallest workflow that produces real evidence. Screenshots were taken on
|
|
@@ -43,9 +43,9 @@ use another provider. A guide is still available and explains the alternative.
|
|
|
43
43
|
|
|
44
44
|
### 2. Tools
|
|
45
45
|
|
|
46
|
-

|
|
47
47
|
|
|
48
|
-
This tab is the complete REA catalog: 274 operations, grouped into 19 families.
|
|
48
|
+
This tab is the complete REA catalog: 274 operations, grouped into 19 families. The full field-by-field reference for every tool is [PARAMETERS.md](PARAMETERS.md) (English and 简体中文).
|
|
49
49
|
|
|
50
50
|
1. Search by tool name or description, or narrow the list with the family
|
|
51
51
|
selector. The counter under the selector shows how many tools match.
|
|
@@ -69,7 +69,7 @@ open a target and move to `inspect_artifact`, `analyze_function`, or
|
|
|
69
69
|
|
|
70
70
|
### 3. Clients
|
|
71
71
|
|
|
72
|
-

|
|
73
73
|
|
|
74
74
|
This tab registers the same local REA engine with agents from other vendors.
|
|
75
75
|
|
|
@@ -92,9 +92,9 @@ process, and REA sessions are stateful.
|
|
|
92
92
|
|
|
93
93
|
### 4. Workflows
|
|
94
94
|
|
|
95
|
-

|
|
96
96
|
|
|
97
|
-
REA ships six guided investigation recipes
|
|
97
|
+
REA ships six guided investigation recipes. Every argument is listed in [PARAMETERS.md](PARAMETERS.md#guided-workflows) with type, required flag, and description. The recipes are `investigate_feature`,
|
|
98
98
|
`compare_application_versions`, `verify_reconstruction`, `trace_crash`,
|
|
99
99
|
`audit_residual_unknowns`, and `prepare_bounded_process_capture`.
|
|
100
100
|
|
|
@@ -205,9 +205,9 @@ Hopper),不是插件故障,请改用其他引擎;安装教程里也给
|
|
|
205
205
|
|
|
206
206
|
### 2. 工具
|
|
207
207
|
|
|
208
|
-

|
|
209
209
|
|
|
210
|
-
此页是完整的 REA 工具目录:274 个操作、19
|
|
210
|
+
此页是完整的 REA 工具目录:274 个操作、19 个工具族。每个工具的全部字段见 [PARAMETERS.md](PARAMETERS.md)(中英文切换)。
|
|
211
211
|
|
|
212
212
|
1. 按工具名或描述搜索,或用工具族下拉框过滤;下方计数显示匹配数量。
|
|
213
213
|
2. 选择工具。右侧显示描述、风险提示、可展开的输入 schema,以及按 schema
|
|
@@ -226,7 +226,7 @@ Hopper),不是插件故障,请改用其他引擎;安装教程里也给
|
|
|
226
226
|
|
|
227
227
|
### 3. 客户端
|
|
228
228
|
|
|
229
|
-

|
|
230
230
|
|
|
231
231
|
此页把同一个本地 REA 引擎注册到其他厂商的 Agent。
|
|
232
232
|
|
|
@@ -248,9 +248,9 @@ Hopper),不是插件故障,请改用其他引擎;安装教程里也给
|
|
|
248
248
|
|
|
249
249
|
### 4. 工作流
|
|
250
250
|
|
|
251
|
-

|
|
252
252
|
|
|
253
|
-
REA 内置 6
|
|
253
|
+
REA 内置 6 个引导式调查流程;每个参数的类型、是否必填和说明见 [PARAMETERS.md](PARAMETERS.md#引导式工作流)。流程包括 `investigate_feature`、
|
|
254
254
|
`compare_application_versions`、`verify_reconstruction`、`trace_crash`、
|
|
255
255
|
`audit_residual_unknowns`、`prepare_bounded_process_capture`。
|
|
256
256
|
|
package/client.js
CHANGED
|
@@ -11,6 +11,7 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
const API = '/api/rea'
|
|
12
12
|
const POLL_MS = 5000
|
|
13
13
|
const TOAST_MS = 4200
|
|
14
|
+
const PARAMETER_DOC_URL = 'https://github.com/Zmang-Tech/dsh-reverse-engine/blob/dev/PARAMETERS.md'
|
|
14
15
|
|
|
15
16
|
const ZH = {
|
|
16
17
|
'sidebar.label': '逆向工程',
|
|
@@ -96,7 +97,17 @@ window.__ModuleLoader__.load({
|
|
|
96
97
|
'tools.allFamilies': '全部工具族',
|
|
97
98
|
'tools.empty': '没有匹配的工具。换一个关键词,或选择其他工具族。',
|
|
98
99
|
'tools.noSelection': '从左侧选择一个工具,查看参数并执行。',
|
|
99
|
-
'tools.schema': '输入参数',
|
|
100
|
+
'tools.schema': '输入参数 schema',
|
|
101
|
+
'tools.parameters': '参数列表',
|
|
102
|
+
'tools.fullParameterDoc': '完整参数文档',
|
|
103
|
+
'tools.paramName': '参数',
|
|
104
|
+
'tools.paramType': '类型',
|
|
105
|
+
'tools.paramRequired': '必填',
|
|
106
|
+
'tools.paramDescription': '说明',
|
|
107
|
+
'tools.paramExample': '示例',
|
|
108
|
+
'tools.requiredYes': '是',
|
|
109
|
+
'tools.requiredNo': '否',
|
|
110
|
+
'tools.noParameters': '该工具没有参数,传 {} 即可。',
|
|
100
111
|
'tools.args': '参数(JSON)',
|
|
101
112
|
'tools.argsError': '参数必须是有效的 JSON 对象',
|
|
102
113
|
'tools.result': '执行结果',
|
|
@@ -264,6 +275,16 @@ window.__ModuleLoader__.load({
|
|
|
264
275
|
'tools.empty': 'No tool matched. Try another word or family.',
|
|
265
276
|
'tools.noSelection': 'Select a tool on the left to inspect its arguments and run it.',
|
|
266
277
|
'tools.schema': 'Input schema',
|
|
278
|
+
'tools.parameters': 'Parameters',
|
|
279
|
+
'tools.fullParameterDoc': 'Full parameter reference',
|
|
280
|
+
'tools.paramName': 'Parameter',
|
|
281
|
+
'tools.paramType': 'Type',
|
|
282
|
+
'tools.paramRequired': 'Required',
|
|
283
|
+
'tools.paramDescription': 'Description',
|
|
284
|
+
'tools.paramExample': 'Example',
|
|
285
|
+
'tools.requiredYes': 'yes',
|
|
286
|
+
'tools.requiredNo': 'no',
|
|
287
|
+
'tools.noParameters': 'This tool takes no parameters; pass {}.',
|
|
267
288
|
'tools.args': 'Arguments (JSON)',
|
|
268
289
|
'tools.argsError': 'Arguments must be a valid JSON object',
|
|
269
290
|
'tools.result': 'Result',
|
|
@@ -488,6 +509,14 @@ window.__ModuleLoader__.load({
|
|
|
488
509
|
.re-provider-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
489
510
|
.re-provider-status { font-size: 11px; font-weight: 400; color: var(--dsw-alias-label-tertiary); }
|
|
490
511
|
.re-provider-actions { flex: none; }
|
|
512
|
+
.re-param-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
|
|
513
|
+
.re-param-wrap { overflow-x: auto; border: 0.5px solid var(--dsw-alias-border-l1); border-radius: 8px; }
|
|
514
|
+
.re-param-table { width: 100%; border-collapse: collapse; font-size: 11.5px; line-height: 16px; }
|
|
515
|
+
.re-param-table th { text-align: left; padding: 6px 8px; color: var(--dsw-alias-label-tertiary); font-weight: 500; background: var(--dsw-alias-bg-layer-2); white-space: nowrap; }
|
|
516
|
+
.re-param-table td { padding: 6px 8px; border-top: 0.5px solid var(--dsw-alias-border-l1); color: var(--dsw-alias-label-secondary); vertical-align: top; }
|
|
517
|
+
.re-param-name { color: var(--dsw-alias-label-primary); font-size: 11px; }
|
|
518
|
+
.re-param-allowed { margin-top: 2px; color: var(--dsw-alias-label-tertiary); font-size: 10.5px; overflow-wrap: anywhere; }
|
|
519
|
+
.re-param-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; }
|
|
491
520
|
.re-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--dsw-alias-label-caption); font-size: 11px; line-height: 16px; flex-wrap: wrap; }
|
|
492
521
|
.re-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
493
522
|
.re-skeleton { height: 180px; border-radius: 12px; background: var(--dsw-alias-bg-layer-2); animation: re-pulse 1.4s ease-in-out infinite; }
|
|
@@ -721,6 +750,64 @@ window.__ModuleLoader__.load({
|
|
|
721
750
|
h('span', { className: 're-row-desc' }, props.tool.title || props.tool.description))
|
|
722
751
|
}
|
|
723
752
|
|
|
753
|
+
function schemaTypeLabel(schema) {
|
|
754
|
+
if (!schema || typeof schema !== 'object') return 'any'
|
|
755
|
+
if (Array.isArray(schema.enum)) return 'string'
|
|
756
|
+
if (Array.isArray(schema.anyOf)) return [...new Set(schema.anyOf.map(item => schemaTypeLabel(item)))].join(' | ')
|
|
757
|
+
if (Array.isArray(schema.oneOf)) return [...new Set(schema.oneOf.map(item => schemaTypeLabel(item)))].join(' | ')
|
|
758
|
+
if (schema.type === 'array') return 'array'
|
|
759
|
+
if (schema.type === 'object' || schema.properties) return 'object'
|
|
760
|
+
return schema.type ?? 'any'
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
function schemaAllowed(schema) {
|
|
764
|
+
const parts = []
|
|
765
|
+
if (Array.isArray(schema?.enum)) parts.push('enum: ' + schema.enum.join(', '))
|
|
766
|
+
if (schema?.const !== undefined) parts.push('const: ' + JSON.stringify(schema.const))
|
|
767
|
+
if (schema?.default !== undefined) parts.push('default: ' + JSON.stringify(schema.default))
|
|
768
|
+
if (typeof schema?.minimum === 'number' || typeof schema?.maximum === 'number') parts.push('range: ' + (schema.minimum ?? '-∞') + '..' + (schema.maximum ?? '∞'))
|
|
769
|
+
if (typeof schema?.pattern === 'string') parts.push('pattern: ' + schema.pattern)
|
|
770
|
+
return parts.join('; ')
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
function schemaRows(schema, required = new Set(), prefix = '', depth = 0) {
|
|
774
|
+
const rows = []
|
|
775
|
+
for (const [name, property] of Object.entries(schema?.properties ?? {})) {
|
|
776
|
+
const fullName = prefix ? prefix + '.' + name : name
|
|
777
|
+
rows.push({
|
|
778
|
+
name: fullName,
|
|
779
|
+
type: schemaTypeLabel(property),
|
|
780
|
+
required: required.has(name),
|
|
781
|
+
allowed: schemaAllowed(property),
|
|
782
|
+
example: JSON.stringify(sampleValue(property, 0)),
|
|
783
|
+
description: property?.description ?? '',
|
|
784
|
+
})
|
|
785
|
+
if (depth < 1 && property?.type === 'object' && property.properties) {
|
|
786
|
+
rows.push(...schemaRows(property, new Set(property.required ?? []), fullName, depth + 1))
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return rows
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function ParameterTable(props) {
|
|
793
|
+
const { t, rows } = props
|
|
794
|
+
if (!rows?.length) return h('p', { className: 're-hint' }, t('tools.noParameters'))
|
|
795
|
+
return h('div', { className: 're-param-wrap' },
|
|
796
|
+
h('table', { className: 're-param-table' },
|
|
797
|
+
h('thead', null, h('tr', null,
|
|
798
|
+
h('th', null, t('tools.paramName')),
|
|
799
|
+
h('th', null, t('tools.paramType')),
|
|
800
|
+
h('th', null, t('tools.paramRequired')),
|
|
801
|
+
h('th', null, t('tools.paramDescription')),
|
|
802
|
+
h('th', null, t('tools.paramExample')))),
|
|
803
|
+
h('tbody', null, rows.map(row => h('tr', { key: row.name },
|
|
804
|
+
h('td', null, h('code', { className: 're-param-name' }, row.name)),
|
|
805
|
+
h('td', null, row.type, row.allowed ? h('div', { className: 're-param-allowed' }, row.allowed) : null),
|
|
806
|
+
h('td', null, row.required ? t('tools.requiredYes') : t('tools.requiredNo')),
|
|
807
|
+
h('td', null, row.description || '—'),
|
|
808
|
+
h('td', null, h('code', null, row.example)))))))
|
|
809
|
+
}
|
|
810
|
+
|
|
724
811
|
function ProviderGuide(props) {
|
|
725
812
|
const { t, toast, guide, platform, onPlatform } = props
|
|
726
813
|
const platforms = guide?.platforms ?? []
|
|
@@ -1037,7 +1124,11 @@ window.__ModuleLoader__.load({
|
|
|
1037
1124
|
h('div', { className: 're-checks', style: { marginBottom: '12px' } },
|
|
1038
1125
|
tool.annotations?.readOnlyHint ? h(Chip, { tone: 'success', dot: false }, t('tools.readOnly')) : null,
|
|
1039
1126
|
tool.annotations?.destructiveHint ? h(Chip, { tone: 'warn', dot: false }, t('tools.destructive')) : null),
|
|
1040
|
-
h('
|
|
1127
|
+
h('div', { className: 're-param-head' },
|
|
1128
|
+
h('p', { className: 're-guide-label' }, t('tools.parameters')),
|
|
1129
|
+
h('a', { className: 're-link', href: PARAMETER_DOC_URL, target: '_blank', rel: 'noreferrer' }, t('tools.fullParameterDoc'))),
|
|
1130
|
+
h(ParameterTable, { t, rows: schemaRows(tool.inputSchema, new Set(tool.inputSchema?.required ?? [])) }),
|
|
1131
|
+
h('details', { className: 're-details', style: { marginTop: '10px' } },
|
|
1041
1132
|
h('summary', null, t('tools.schema')),
|
|
1042
1133
|
h('pre', { className: 're-pre re-pre-short', style: { marginTop: '8px' } }, JSON.stringify(tool.inputSchema, null, 2))),
|
|
1043
1134
|
h('div', { style: { height: '12px' } }),
|
|
@@ -1278,8 +1369,20 @@ window.__ModuleLoader__.load({
|
|
|
1278
1369
|
: h(Card, { title: current.title || current.name, subtitle: current.description },
|
|
1279
1370
|
current.arguments?.length
|
|
1280
1371
|
? h('div', { style: { marginBottom: '12px' } },
|
|
1281
|
-
h('
|
|
1282
|
-
|
|
1372
|
+
h('div', { className: 're-param-head' },
|
|
1373
|
+
h('p', { className: 're-label' }, t('workflows.argumentsTitle')),
|
|
1374
|
+
h('a', { className: 're-link', href: PARAMETER_DOC_URL, target: '_blank', rel: 'noreferrer' }, t('tools.fullParameterDoc'))),
|
|
1375
|
+
h(ParameterTable, {
|
|
1376
|
+
t,
|
|
1377
|
+
rows: current.arguments.map(argument => ({
|
|
1378
|
+
name: argument.name,
|
|
1379
|
+
type: 'string',
|
|
1380
|
+
required: argument.required === true,
|
|
1381
|
+
allowed: '',
|
|
1382
|
+
example: '""',
|
|
1383
|
+
description: argument.description ?? '',
|
|
1384
|
+
})),
|
|
1385
|
+
}))
|
|
1283
1386
|
: null,
|
|
1284
1387
|
h(Field, { label: t('workflows.args') },
|
|
1285
1388
|
h('textarea', { className: 're-textarea', value: args, onChange: event => setArgs(event.target.value), spellCheck: false })),
|
package/docs/VERIFICATION.md
CHANGED
|
@@ -7,8 +7,8 @@ This release was exercised on Windows 11 with DeepSeek Harness Desktop
|
|
|
7
7
|
|
|
8
8
|
| Check | Result |
|
|
9
9
|
|---|---|
|
|
10
|
-
| `node --test tests/` |
|
|
11
|
-
| `node scripts/validate.mjs` | Package manifest, exports, locales, icon, catalog metadata, client list, provider guides, and patch validated |
|
|
10
|
+
| `node --test tests/` | 36 passing tests: engine handshake/catalog/call/timeout/cancel, settings, catalog search and exposure, JSON routes, Host registration, client module and dictionaries, provider-guide structure and rendering, parameter descriptions and the generated reference |
|
|
11
|
+
| `node scripts/validate.mjs` | Package manifest, exports, locales, icon, catalog metadata, client list, provider guides, parameter descriptions, `PARAMETERS.md` coverage, usage images, and patch validated |
|
|
12
12
|
| `npm pack` | 27 files, about 70 kB tarball, no tests or scratch files |
|
|
13
13
|
| Packaged install | `npm install ./dsh-reverse-engine-0.1.0.tgz` in a clean consumer project installed 34 packages and resolved `rea-agents` 7.0.0 through the plugin's dependency |
|
|
14
14
|
| React + jsdom harness | Mounted the real client module with real React: Overview, Tools, Clients, Workflows, Settings, and Logs tabs render; a tool runs and shows its structured result |
|
package/lib/catalog.js
CHANGED
|
@@ -7,9 +7,35 @@ import { readJsonFileSync } from './util.js'
|
|
|
7
7
|
import { CORE_TOOLS } from './settings.js'
|
|
8
8
|
|
|
9
9
|
const META = readJsonFileSync(new URL('./rea-catalog.json', import.meta.url), { families: [], toolFamily: {} })
|
|
10
|
+
const PARAM_DESCRIPTIONS = readJsonFileSync(new URL('./param-descriptions.json', import.meta.url), { tools: {}, global: {} })
|
|
10
11
|
|
|
11
12
|
export const CATALOG_META = META
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Fill missing parameter descriptions from the CLI manifest generated from the
|
|
16
|
+
* pinned release. The compact MCP schema omits most property descriptions, and
|
|
17
|
+
* the UI and generated reference should still explain what to type. The
|
|
18
|
+
* per-tool map wins over the global name map to avoid cross-command collisions.
|
|
19
|
+
*/
|
|
20
|
+
export function enrichToolSchema(schema, toolName = '', depth = 0) {
|
|
21
|
+
if (!schema || typeof schema !== 'object' || depth > 8) return schema
|
|
22
|
+
for (const [name, property] of Object.entries(schema.properties ?? {})) {
|
|
23
|
+
if (!property || typeof property !== 'object') continue
|
|
24
|
+
if (!property.description) {
|
|
25
|
+
const description = PARAM_DESCRIPTIONS.tools?.[toolName]?.[name]
|
|
26
|
+
?? PARAM_DESCRIPTIONS.global?.[name]
|
|
27
|
+
?? PARAM_DESCRIPTIONS.global?.[name.replace(/\./g, '_')]
|
|
28
|
+
if (description) property.description = description
|
|
29
|
+
}
|
|
30
|
+
enrichToolSchema(property, toolName, depth + 1)
|
|
31
|
+
}
|
|
32
|
+
if (schema.items) enrichToolSchema(schema.items, toolName, depth + 1)
|
|
33
|
+
for (const key of ['anyOf', 'oneOf', 'allOf']) {
|
|
34
|
+
if (Array.isArray(schema[key])) schema[key].forEach(item => enrichToolSchema(item, toolName, depth + 1))
|
|
35
|
+
}
|
|
36
|
+
return schema
|
|
37
|
+
}
|
|
38
|
+
|
|
13
39
|
/** Family id for one live tool name. */
|
|
14
40
|
export function familyOf(name) {
|
|
15
41
|
return META.toolFamily?.[name] ?? 'other'
|
package/lib/engine.js
CHANGED
|
@@ -10,6 +10,7 @@ import { EventEmitter } from 'node:events'
|
|
|
10
10
|
import path from 'node:path'
|
|
11
11
|
import { findReaPackage, findNodeRuntime } from './runtime.js'
|
|
12
12
|
import { engineEnvironment } from './settings.js'
|
|
13
|
+
import { enrichToolSchema } from './catalog.js'
|
|
13
14
|
import { ReaError, shortError } from './util.js'
|
|
14
15
|
|
|
15
16
|
const PROTOCOL_VERSION = '2025-06-18'
|
|
@@ -220,7 +221,7 @@ export class ReaEngine extends EventEmitter {
|
|
|
220
221
|
name: tool.name,
|
|
221
222
|
title: typeof tool.title === 'string' ? tool.title : null,
|
|
222
223
|
description: typeof tool.description === 'string' ? tool.description : '',
|
|
223
|
-
inputSchema: tool.inputSchema ?? { type: 'object', properties: {} },
|
|
224
|
+
inputSchema: enrichToolSchema(tool.inputSchema ?? { type: 'object', properties: {} }, tool.name),
|
|
224
225
|
annotations: tool.annotations ?? {},
|
|
225
226
|
}))
|
|
226
227
|
this.#prompts = prompts.map(prompt => ({
|