dsh-js-reverse-plugin 0.1.0 → 0.2.1

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/index.js CHANGED
@@ -1,7 +1,5 @@
1
- // dsh-js-reverse-plugin — one DeepSeek Harness bundle that mounts the
2
- // js-reverse skills (AST deobfuscation / iv8 / JSVMP) as runtime skills.
3
- // The js-reverse-mcp server is mounted by the cordis.patch.yml layer, so a
4
- // single `dsh plugin add` installs skills + MCP tools together.
1
+ // Bundled reverse-engineering skills. The bundle patches register the
2
+ // reverse agent preset and the js-reverse MCP server declaratively.
5
3
  import { readdirSync, readFileSync, statSync } from 'node:fs'
6
4
  import { join } from 'node:path'
7
5
  import { fileURLToPath } from 'node:url'
@@ -53,7 +51,7 @@ export function collectSkills() {
53
51
  return registrations
54
52
  }
55
53
 
56
- /** Register every bundled skill; each registration is a disposable effect. */
54
+ /** Register bundled skills; Cordis owns and reverses each registration. */
57
55
  export function apply(ctx) {
58
56
  for (const skill of collectSkills()) {
59
57
  ctx.skills.register(skill)
package/package.json CHANGED
@@ -1,20 +1,31 @@
1
1
  {
2
2
  "name": "dsh-js-reverse-plugin",
3
- "version": "0.1.0",
4
- "description": "JavaScript reverse-engineering bundle for DeepSeek Harness: AST deobfuscation / iv8 / JSVMP skills plus the js-reverse-mcp server tools.",
3
+ "version": "0.2.1",
4
+ "description": "JavaScript reverse-engineering bundle for DeepSeek Harness: AST deobfuscation / iv8 / JSVMP skills, the js-reverse-mcp server tools, and the reverse agent preset.",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "files": [
8
8
  "index.js",
9
9
  "cordis.patch.yml",
10
- "skills"
10
+ "skills",
11
+ "preset"
11
12
  ],
12
13
  "dependencies": {
13
14
  "yaml": "^2.4.0"
14
15
  },
15
16
  "dsh": {
16
17
  "bundle": {
17
- "patch": "./cordis.patch.yml"
18
+ "patch": [
19
+ "./cordis.patch.yml",
20
+ "./preset/reverse.patch.yml"
21
+ ]
18
22
  }
23
+ },
24
+ "engines": {
25
+ "node": ">=24.9.0",
26
+ "dsh": "^0.2.1-rc.3"
27
+ },
28
+ "scripts": {
29
+ "test": "node --test tests/*.test.mjs"
19
30
  }
20
31
  }
@@ -0,0 +1,166 @@
1
+ # Reverse agent composition for the declarative DSH preset registry.
2
+ - insert:
3
+ - id: preset-reverse
4
+ name: '@deepseek-ai/dsh-agent-preset'
5
+ config:
6
+ id: reverse
7
+ name: 逆向模式
8
+ description: JS 逆向工程 Agent:证据驱动、逐步决策,配备 iv8 受控执行与 js-reverse 浏览器取证。
9
+ order: 2
10
+ plugins:
11
+ - id: persona
12
+ name: '@deepseek-ai/dsh-persona'
13
+ config:
14
+ prefix: >-
15
+ You are a JS reverse-engineering agent powered by the {{model}} model.
16
+
17
+ 工作准则:
18
+ - 证据驱动:每个结论必须可溯源——静态证据(源码、字节码、AST)或动态证据(受控执行、浏览器观测)。区分"事实"与"推断",不无证猜测。
19
+ - 逐步决策:关键选择先说明依据与代价,等用户决定——解混淆路线、是否补环境、静态还是动态、继续还是交接。
20
+ - 保护原始输入:目标文件一律只读;分析前先做格式化派生副本,一切修改只落在副本。
21
+ - 解混淆服务于分析:产出是方便阅读、搜索、定位、动态观测的派生视图;不以"清理干净"或还原作者原名、原始工程为目标。
22
+ - 受控执行:动态证据通过 iv8(C++ V8 + 浏览器环境)或 js-reverse MCP 取得;Node.js 仅作静态工程工具。
23
+ - 等价验收:恢复的算法、签名、映射以与原始实现精确等价为验收标准;"服务器恰好接受"不是证明。
24
+ - 长线任务用 todo 和 goal 跟踪;多路独立分析(静态/动态/资料)可用 subagent 并行;关键证据和推导过程记录在案,保持可审计。
25
+
26
+ - id: agent-instructions
27
+ name: '@deepseek-ai/dsh-agent-instructions'
28
+ config:
29
+ maxBytes: 65536
30
+
31
+ - id: tool-bash
32
+ name: '@deepseek-ai/dsh-tool-bash'
33
+ disabled: !!js process.platform === 'win32'
34
+
35
+ - id: tool-pwsh
36
+ name: '@deepseek-ai/dsh-tool-pwsh'
37
+ disabled: !!js process.platform !== 'win32'
38
+
39
+ - id: tool-fs
40
+ name: '@deepseek-ai/dsh-tool-fs'
41
+
42
+ - id: tool-fs-search
43
+ name: '@deepseek-ai/dsh-tool-fs-search'
44
+ config:
45
+ sampleOverCapGlobResults: false
46
+
47
+ - id: tool-jobs
48
+ name: '@deepseek-ai/dsh-tool-jobs'
49
+
50
+ - id: skill-filesystem
51
+ name: '@deepseek-ai/dsh-skill-filesystem'
52
+
53
+ - id: tool-skill
54
+ name: '@deepseek-ai/dsh-tool-skill'
55
+
56
+ - id: tool-goal
57
+ name: '@deepseek-ai/dsh-tool-goal'
58
+
59
+ - id: planning
60
+ name: cordis:group
61
+ group: true
62
+ isolate:
63
+ planMode: true
64
+ config:
65
+ - id: plan-mode
66
+ name: '@deepseek-ai/dsh-plan-mode'
67
+ config:
68
+ section: |
69
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
70
+
71
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
72
+
73
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
74
+
75
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
76
+
77
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
78
+
79
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
80
+
81
+ - id: compaction
82
+ name: cordis:group
83
+ group: true
84
+ isolate:
85
+ compaction: true
86
+ toolResultPruner: true
87
+ config:
88
+ - id: compaction-basic
89
+ name: '@deepseek-ai/dsh-compaction-basic'
90
+
91
+ - id: command-compact
92
+ name: '@deepseek-ai/dsh-command-compact'
93
+
94
+ - id: tool-result-pruner
95
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
96
+ config:
97
+ thresholdChars: 8192
98
+ headChars: 4096
99
+ tailChars: 1024
100
+
101
+ - id: delegation
102
+ name: cordis:group
103
+ group: true
104
+ isolate:
105
+ workflowEngine: true
106
+ config:
107
+ - id: tool-subagent-control
108
+ name: '@deepseek-ai/dsh-tool-subagent-control'
109
+
110
+ - id: tool-subagent
111
+ name: '@deepseek-ai/dsh-tool-subagent'
112
+ config:
113
+ provider: spawn
114
+ toolName: subagent
115
+
116
+ - id: tool-subagent-fork
117
+ name: '@deepseek-ai/dsh-tool-subagent'
118
+ config:
119
+ provider: fork
120
+ toolName: subagent_fork
121
+
122
+ - id: tool-subagent-codex
123
+ name: '@deepseek-ai/dsh-tool-subagent'
124
+ disabled: true
125
+ config:
126
+ provider: codex
127
+ toolName: subagent_codex
128
+ enableRunInBackground: false
129
+ maxDepth: provider-managed
130
+
131
+ - id: tool-subagent-claude-code
132
+ name: '@deepseek-ai/dsh-tool-subagent'
133
+ disabled: true
134
+ config:
135
+ provider: claude-code
136
+ toolName: subagent_claude_code
137
+ enableRunInBackground: false
138
+ maxDepth: provider-managed
139
+
140
+ - id: workflow-ptc
141
+ name: '@deepseek-ai/dsh-workflow-ptc'
142
+ config:
143
+ provider: spawn
144
+
145
+ - id: tool-workflow
146
+ name: '@deepseek-ai/dsh-tool-workflow'
147
+
148
+ - id: tool-ralph
149
+ name: '@deepseek-ai/dsh-tool-ralph'
150
+ config:
151
+ subagentProvider: spawn
152
+ maxRounds: 64
153
+
154
+ - id: tool-ask-user
155
+ name: '@deepseek-ai/dsh-tool-ask-user'
156
+
157
+ - id: tool-todo
158
+ name: '@deepseek-ai/dsh-tool-todo'
159
+ config:
160
+ allowParallelInProgress: true
161
+
162
+ - id: tool-web
163
+ name: '@deepseek-ai/dsh-tool-web'
164
+ config:
165
+ fetch: false
166
+ searchTimeoutMs: 60000