deepspider 0.2.11 → 0.3.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.
Files changed (146) hide show
  1. package/README.md +71 -24
  2. package/bin/cli.js +45 -0
  3. package/package.json +10 -4
  4. package/src/agent/core/PanelBridge.js +133 -0
  5. package/src/agent/core/RetryManager.js +51 -0
  6. package/src/agent/core/StreamHandler.js +263 -0
  7. package/src/agent/core/index.js +7 -0
  8. package/src/agent/errors/ErrorClassifier.js +43 -0
  9. package/src/agent/errors/SpiderError.js +68 -0
  10. package/src/agent/errors/index.js +19 -0
  11. package/src/agent/run.js +67 -460
  12. package/src/agent/setup.js +14 -14
  13. package/src/agent/subagents/factory.js +60 -0
  14. package/src/agent/subagents/index.js +3 -0
  15. package/src/agent/tools/report.js +36 -4
  16. package/src/browser/client.js +47 -10
  17. package/src/cli/commands/config.js +94 -0
  18. package/src/cli/commands/help.js +34 -0
  19. package/src/cli/commands/update.js +78 -0
  20. package/src/cli/commands/version.js +9 -0
  21. package/src/cli/config.js +15 -0
  22. package/src/config/settings.js +102 -0
  23. package/.claude/agents/check.md +0 -122
  24. package/.claude/agents/debug.md +0 -106
  25. package/.claude/agents/dispatch.md +0 -214
  26. package/.claude/agents/implement.md +0 -96
  27. package/.claude/agents/plan.md +0 -396
  28. package/.claude/agents/research.md +0 -120
  29. package/.claude/commands/evolve/merge.md +0 -80
  30. package/.claude/commands/trellis/before-backend-dev.md +0 -13
  31. package/.claude/commands/trellis/before-frontend-dev.md +0 -13
  32. package/.claude/commands/trellis/break-loop.md +0 -107
  33. package/.claude/commands/trellis/check-backend.md +0 -13
  34. package/.claude/commands/trellis/check-cross-layer.md +0 -153
  35. package/.claude/commands/trellis/check-frontend.md +0 -13
  36. package/.claude/commands/trellis/create-command.md +0 -154
  37. package/.claude/commands/trellis/finish-work.md +0 -129
  38. package/.claude/commands/trellis/integrate-skill.md +0 -219
  39. package/.claude/commands/trellis/onboard.md +0 -358
  40. package/.claude/commands/trellis/parallel.md +0 -193
  41. package/.claude/commands/trellis/record-session.md +0 -62
  42. package/.claude/commands/trellis/start.md +0 -280
  43. package/.claude/commands/trellis/update-spec.md +0 -213
  44. package/.claude/hooks/inject-subagent-context.py +0 -758
  45. package/.claude/hooks/ralph-loop.py +0 -374
  46. package/.claude/hooks/session-start.py +0 -126
  47. package/.claude/settings.json +0 -41
  48. package/.claude/skills/deepagents-guide/SKILL.md +0 -428
  49. package/.cursor/commands/trellis-before-backend-dev.md +0 -13
  50. package/.cursor/commands/trellis-before-frontend-dev.md +0 -13
  51. package/.cursor/commands/trellis-break-loop.md +0 -107
  52. package/.cursor/commands/trellis-check-backend.md +0 -13
  53. package/.cursor/commands/trellis-check-cross-layer.md +0 -153
  54. package/.cursor/commands/trellis-check-frontend.md +0 -13
  55. package/.cursor/commands/trellis-create-command.md +0 -154
  56. package/.cursor/commands/trellis-finish-work.md +0 -129
  57. package/.cursor/commands/trellis-integrate-skill.md +0 -219
  58. package/.cursor/commands/trellis-onboard.md +0 -358
  59. package/.cursor/commands/trellis-record-session.md +0 -62
  60. package/.cursor/commands/trellis-start.md +0 -156
  61. package/.cursor/commands/trellis-update-spec.md +0 -213
  62. package/.github/workflows/publish.yml +0 -63
  63. package/.husky/pre-commit +0 -1
  64. package/.mcp.json +0 -8
  65. package/.trellis/.template-hashes.json +0 -65
  66. package/.trellis/.version +0 -1
  67. package/.trellis/scripts/add-session.sh +0 -384
  68. package/.trellis/scripts/common/developer.sh +0 -129
  69. package/.trellis/scripts/common/git-context.sh +0 -263
  70. package/.trellis/scripts/common/paths.sh +0 -208
  71. package/.trellis/scripts/common/phase.sh +0 -150
  72. package/.trellis/scripts/common/registry.sh +0 -247
  73. package/.trellis/scripts/common/task-queue.sh +0 -142
  74. package/.trellis/scripts/common/task-utils.sh +0 -151
  75. package/.trellis/scripts/common/worktree.sh +0 -128
  76. package/.trellis/scripts/create-bootstrap.sh +0 -299
  77. package/.trellis/scripts/get-context.sh +0 -7
  78. package/.trellis/scripts/get-developer.sh +0 -15
  79. package/.trellis/scripts/init-developer.sh +0 -34
  80. package/.trellis/scripts/multi-agent/cleanup.sh +0 -396
  81. package/.trellis/scripts/multi-agent/create-pr.sh +0 -241
  82. package/.trellis/scripts/multi-agent/plan.sh +0 -207
  83. package/.trellis/scripts/multi-agent/start.sh +0 -310
  84. package/.trellis/scripts/multi-agent/status.sh +0 -828
  85. package/.trellis/scripts/task.sh +0 -1118
  86. package/.trellis/spec/backend/ci-cd-guidelines.md +0 -73
  87. package/.trellis/spec/backend/deepagents-guide.md +0 -380
  88. package/.trellis/spec/backend/directory-structure.md +0 -126
  89. package/.trellis/spec/backend/examples/skills/deepagents-guide/README.md +0 -11
  90. package/.trellis/spec/backend/examples/skills/deepagents-guide/agent.js.template +0 -20
  91. package/.trellis/spec/backend/examples/skills/deepagents-guide/skills-config.js.template +0 -13
  92. package/.trellis/spec/backend/examples/skills/deepagents-guide/subagent.js.template +0 -19
  93. package/.trellis/spec/backend/hook-guidelines.md +0 -218
  94. package/.trellis/spec/backend/index.md +0 -37
  95. package/.trellis/spec/backend/quality-guidelines.md +0 -302
  96. package/.trellis/spec/backend/state-management.md +0 -76
  97. package/.trellis/spec/backend/tool-guidelines.md +0 -144
  98. package/.trellis/spec/backend/type-safety.md +0 -71
  99. package/.trellis/spec/guides/code-reuse-thinking-guide.md +0 -92
  100. package/.trellis/spec/guides/cross-layer-thinking-guide.md +0 -94
  101. package/.trellis/spec/guides/index.md +0 -79
  102. package/.trellis/tasks/archive/02-02-evolving-skills/prd.md +0 -61
  103. package/.trellis/tasks/archive/02-02-evolving-skills/task.json +0 -29
  104. package/.trellis/tasks/archive/2026-02/00-bootstrap-guidelines/prd.md +0 -86
  105. package/.trellis/tasks/archive/2026-02/00-bootstrap-guidelines/task.json +0 -27
  106. package/.trellis/tasks/archive/2026-02/02-02-skills-system/check.jsonl +0 -3
  107. package/.trellis/tasks/archive/2026-02/02-02-skills-system/debug.jsonl +0 -2
  108. package/.trellis/tasks/archive/2026-02/02-02-skills-system/implement.jsonl +0 -5
  109. package/.trellis/tasks/archive/2026-02/02-02-skills-system/prd.md +0 -33
  110. package/.trellis/tasks/archive/2026-02/02-02-skills-system/task.json +0 -41
  111. package/.trellis/workflow.md +0 -407
  112. package/.trellis/workspace/index.md +0 -123
  113. package/.trellis/workspace/pony/index.md +0 -42
  114. package/.trellis/workspace/pony/journal-1.md +0 -125
  115. package/.trellis/worktree.yaml +0 -47
  116. package/AGENTS.md +0 -18
  117. package/CLAUDE.md +0 -315
  118. package/agents/deepspider.md +0 -142
  119. package/docs/DEBUG.md +0 -42
  120. package/docs/GUIDE.md +0 -334
  121. package/docs/PROMPT.md +0 -60
  122. package/docs/USAGE.md +0 -226
  123. package/eslint.config.js +0 -51
  124. package/test/analyze.test.js +0 -90
  125. package/test/envdump.test.js +0 -74
  126. package/test/flow.test.js +0 -90
  127. package/test/hooks.test.js +0 -138
  128. package/test/plugin.test.js +0 -35
  129. package/test/refactor-full.test.js +0 -30
  130. package/test/refactor.test.js +0 -21
  131. package/test/samples/obfuscated.js +0 -61
  132. package/test/samples/original.js +0 -66
  133. package/test/samples/v10_eval_chain.js +0 -52
  134. package/test/samples/v11_bytecode_vm.js +0 -81
  135. package/test/samples/v12_polymorphic.js +0 -69
  136. package/test/samples/v1_ob_basic.js +0 -98
  137. package/test/samples/v2_ob_advanced.js +0 -99
  138. package/test/samples/v3_jjencode.js +0 -77
  139. package/test/samples/v4_aaencode.js +0 -73
  140. package/test/samples/v5_control_flow.js +0 -86
  141. package/test/samples/v6_string_encryption.js +0 -71
  142. package/test/samples/v7_jsvmp.js +0 -83
  143. package/test/samples/v8_anti_debug.js +0 -79
  144. package/test/samples/v9_proxy_trap.js +0 -49
  145. package/test/samples.test.js +0 -96
  146. package/test/webcrack.test.js +0 -55
@@ -1,106 +0,0 @@
1
- ---
2
- name: debug
3
- description: |
4
- Issue fixing expert. Understands issues, fixes against specs, and verifies fixes. Precise fixes only.
5
- tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
6
- model: opus
7
- ---
8
- # Debug Agent
9
-
10
- You are the Debug Agent in the Trellis workflow.
11
-
12
- ## Context
13
-
14
- Before debugging, read:
15
- - `.trellis/spec/` - Development guidelines
16
- - Error messages or issue descriptions provided
17
-
18
- ## Core Responsibilities
19
-
20
- 1. **Understand issues** - Analyze error messages or reported issues
21
- 2. **Fix against specs** - Fix issues following dev specs
22
- 3. **Verify fixes** - Run typecheck to ensure no new issues
23
- 4. **Report results** - Report fix status
24
-
25
- ---
26
-
27
- ## Workflow
28
-
29
- ### Step 1: Understand Issues
30
-
31
- Parse the issue, categorize by priority:
32
-
33
- - `[P1]` - Must fix (blocking)
34
- - `[P2]` - Should fix (important)
35
- - `[P3]` - Optional fix (nice to have)
36
-
37
- ### Step 2: Research if Needed
38
-
39
- If you need additional info:
40
-
41
- ```bash
42
- # Check knowledge base
43
- ls .trellis/big-question/
44
- ```
45
-
46
- ### Step 3: Fix One by One
47
-
48
- For each issue:
49
-
50
- 1. Locate the exact position
51
- 2. Fix following specs
52
- 3. Run typecheck to verify
53
-
54
- ### Step 4: Verify
55
-
56
- Run project's lint and typecheck commands to verify fixes.
57
-
58
- If fix introduces new issues:
59
-
60
- 1. Revert the fix
61
- 2. Use a more complete solution
62
- 3. Re-verify
63
-
64
- ---
65
-
66
- ## Report Format
67
-
68
- ```markdown
69
- ## Fix Report
70
-
71
- ### Issues Fixed
72
-
73
- 1. `[P1]` `<file>:<line>` - <what was fixed>
74
- 2. `[P2]` `<file>:<line>` - <what was fixed>
75
-
76
- ### Issues Not Fixed
77
-
78
- - `<file>:<line>` - <reason why not fixed>
79
-
80
- ### Verification
81
-
82
- - TypeCheck: Pass
83
- - Lint: Pass
84
-
85
- ### Summary
86
-
87
- Fixed X/Y issues. Z issues require discussion.
88
- ```
89
-
90
- ---
91
-
92
- ## Guidelines
93
-
94
- ### DO
95
-
96
- - Precise fixes for reported issues
97
- - Follow specs
98
- - Verify each fix
99
-
100
- ### DON'T
101
-
102
- - Don't refactor surrounding code
103
- - Don't add new features
104
- - Don't modify unrelated files
105
- - Don't use non-null assertion (`x!` operator)
106
- - Don't execute git commit
@@ -1,214 +0,0 @@
1
- ---
2
- name: dispatch
3
- description: |
4
- Multi-Agent Pipeline main dispatcher. Pure dispatcher. Only responsible for calling subagents and scripts in phase order.
5
- tools: Read, Bash, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
6
- model: opus
7
- ---
8
- # Dispatch Agent
9
-
10
- You are the Dispatch Agent in the Multi-Agent Pipeline (pure dispatcher).
11
-
12
- ## Working Directory Convention
13
-
14
- Current Task is specified by `.trellis/.current-task` file, content is the relative path to task directory.
15
-
16
- Task directory path format: `.trellis/workspace/{developer}/tasks/{MM}-{DD}-{name}/`
17
-
18
- This directory contains all context files for the current task:
19
-
20
- - `task.json` - Task configuration
21
- - `prd.md` - Requirements document
22
- - `info.md` - Technical design (optional)
23
- - `implement.jsonl` - Implement context
24
- - `check.jsonl` - Check context
25
- - `debug.jsonl` - Debug context
26
-
27
- ## Core Principles
28
-
29
- 1. **You are a pure dispatcher** - Only responsible for calling subagents and scripts in order
30
- 2. **You don't read specs/requirements** - Hook will auto-inject all context to subagents
31
- 3. **You don't need resume** - Hook injects complete context on each subagent call
32
- 4. **You only need simple commands** - Tell subagent "start working" is enough
33
-
34
- ---
35
-
36
- ## Startup Flow
37
-
38
- ### Step 1: Determine Current Task Directory
39
-
40
- Read `.trellis/.current-task` to get current task directory path:
41
-
42
- ```bash
43
- TASK_DIR=$(cat .trellis/.current-task)
44
- # e.g.: .trellis/workspace/taosu/tasks/12-my-feature
45
- ```
46
-
47
- ### Step 2: Read Task Configuration
48
-
49
- ```bash
50
- cat ${TASK_DIR}/task.json
51
- ```
52
-
53
- Get the `next_action` array, which defines the list of phases to execute.
54
-
55
- ### Step 3: Execute in Phase Order
56
-
57
- Execute each step in `phase` order.
58
-
59
- > **Note**: You do NOT need to manually update `current_phase`. The Hook automatically updates it when you call Task with a subagent.
60
-
61
- ---
62
-
63
- ## Phase Handling
64
-
65
- > Hook will auto-inject all specs, requirements, and technical design to subagent context.
66
- > Dispatch only needs to issue simple call commands.
67
-
68
- ### action: "implement"
69
-
70
- ```
71
- Task(
72
- subagent_type: "implement",
73
- prompt: "Implement the feature described in prd.md in the task directory",
74
- model: "opus",
75
- run_in_background: true
76
- )
77
- ```
78
-
79
- Hook will auto-inject:
80
-
81
- - All spec files from implement.jsonl
82
- - Requirements document (prd.md)
83
- - Technical design (info.md)
84
-
85
- Implement receives complete context and autonomously: read → understand → implement.
86
-
87
- ### action: "check"
88
-
89
- ```
90
- Task(
91
- subagent_type: "check",
92
- prompt: "Check code changes, fix issues yourself",
93
- model: "opus",
94
- run_in_background: true
95
- )
96
- ```
97
-
98
- Hook will auto-inject:
99
-
100
- - finish-work.md
101
- - check-cross-layer.md
102
- - check-backend.md
103
- - check-frontend.md
104
- - All spec files from check.jsonl
105
-
106
- ### action: "debug"
107
-
108
- ```
109
- Task(
110
- subagent_type: "debug",
111
- prompt: "Fix the issues described in the task context",
112
- model: "opus",
113
- run_in_background: true
114
- )
115
- ```
116
-
117
- Hook will auto-inject:
118
-
119
- - All spec files from debug.jsonl
120
- - Error context if available
121
-
122
- ### action: "finish"
123
-
124
- ```
125
- Task(
126
- subagent_type: "check",
127
- prompt: "[finish] Execute final completion check before PR",
128
- model: "opus",
129
- run_in_background: true
130
- )
131
- ```
132
-
133
- **Important**: The `[finish]` marker in prompt triggers different context injection:
134
- - Lighter context focused on final verification
135
- - finish-work.md checklist
136
- - prd.md for verifying requirements are met
137
-
138
- This is different from regular "check" which has full specs for self-fix loop.
139
-
140
- ### action: "create-pr"
141
-
142
- This action creates a Pull Request from the feature branch. Run it via Bash:
143
-
144
- ```bash
145
- ./.trellis/scripts/multi-agent/create-pr.sh
146
- ```
147
-
148
- This will:
149
- 1. Stage and commit all changes (excluding workspace)
150
- 2. Push to origin
151
- 3. Create a Draft PR using `gh pr create`
152
- 4. Update task.json with status="review", pr_url, and current_phase
153
-
154
- **Note**: This is the only action that performs git commit, as it's the final step after all implementation and checks are complete.
155
-
156
- ---
157
-
158
- ## Calling Subagents
159
-
160
- ### Basic Pattern
161
-
162
- ```
163
- task_id = Task(
164
- subagent_type: "implement", // or "check", "debug"
165
- prompt: "Simple task description",
166
- model: "opus",
167
- run_in_background: true
168
- )
169
-
170
- // Poll for completion
171
- for i in 1..N:
172
- result = TaskOutput(task_id, block=true, timeout=300000)
173
- if result.status == "completed":
174
- break
175
- ```
176
-
177
- ### Timeout Settings
178
-
179
- | Phase | Max Time | Poll Count |
180
- |-------|----------|------------|
181
- | implement | 30 min | 6 times |
182
- | check | 15 min | 3 times |
183
- | debug | 20 min | 4 times |
184
-
185
- ---
186
-
187
- ## Error Handling
188
-
189
- ### Timeout
190
-
191
- If a subagent times out, notify the user and ask for guidance:
192
-
193
- ```
194
- "Subagent {phase} timed out after {time}. Options:
195
- 1. Retry the same phase
196
- 2. Skip to next phase
197
- 3. Abort the pipeline"
198
- ```
199
-
200
- ### Subagent Failure
201
-
202
- If a subagent reports failure, read the output and decide:
203
-
204
- - If recoverable: call debug agent to fix
205
- - If not recoverable: notify user and ask for guidance
206
-
207
- ---
208
-
209
- ## Key Constraints
210
-
211
- 1. **Do not read spec/requirement files directly** - Let Hook inject to subagents
212
- 2. **Only commit via create-pr action** - Use `multi-agent/create-pr.sh` at the end of pipeline
213
- 3. **All subagents should use opus model for complex tasks**
214
- 4. **Keep dispatch logic simple** - Complex logic belongs in subagents
@@ -1,96 +0,0 @@
1
- ---
2
- name: implement
3
- description: |
4
- Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.
5
- tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
6
- model: opus
7
- ---
8
- # Implement Agent
9
-
10
- You are the Implement Agent in the Trellis workflow.
11
-
12
- ## Context
13
-
14
- Before implementing, read:
15
- - `.trellis/workflow.md` - Project workflow
16
- - `.trellis/spec/` - Development guidelines
17
- - Task `prd.md` - Requirements document
18
- - Task `info.md` - Technical design (if exists)
19
-
20
- ## Core Responsibilities
21
-
22
- 1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
23
- 2. **Understand requirements** - Read prd.md and info.md
24
- 3. **Implement features** - Write code following specs and design
25
- 4. **Self-check** - Ensure code quality
26
- 5. **Report results** - Report completion status
27
-
28
- ## Forbidden Operations
29
-
30
- **Do NOT execute these git commands:**
31
-
32
- - `git commit`
33
- - `git push`
34
- - `git merge`
35
-
36
- ---
37
-
38
- ## Workflow
39
-
40
- ### 1. Understand Specs
41
-
42
- Read relevant specs based on task type:
43
-
44
- - Backend: `.trellis/spec/backend/`
45
- - Frontend: `.trellis/spec/frontend/`
46
- - Shared: `.trellis/spec/shared/`
47
-
48
- ### 2. Understand Requirements
49
-
50
- Read the task's prd.md and info.md:
51
-
52
- - What are the core requirements
53
- - Key points of technical design
54
- - Which files to modify/create
55
-
56
- ### 3. Implement Features
57
-
58
- - Write code following specs and technical design
59
- - Follow existing code patterns
60
- - Only do what's required, no over-engineering
61
-
62
- ### 4. Verify
63
-
64
- Run project's lint and typecheck commands to verify changes.
65
-
66
- ---
67
-
68
- ## Report Format
69
-
70
- ```markdown
71
- ## Implementation Complete
72
-
73
- ### Files Modified
74
-
75
- - `src/components/Feature.tsx` - New component
76
- - `src/hooks/useFeature.ts` - New hook
77
-
78
- ### Implementation Summary
79
-
80
- 1. Created Feature component...
81
- 2. Added useFeature hook...
82
-
83
- ### Verification Results
84
-
85
- - Lint: Passed
86
- - TypeCheck: Passed
87
- ```
88
-
89
- ---
90
-
91
- ## Code Standards
92
-
93
- - Follow existing code patterns
94
- - Don't add unnecessary abstractions
95
- - Only do what's required, no over-engineering
96
- - Keep code readable