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,299 +0,0 @@
1
- #!/bin/bash
2
- # Create Bootstrap Task for First-Time Setup
3
- #
4
- # Creates a guided task to help users fill in project guidelines
5
- # after initializing Trellis for the first time.
6
- #
7
- # Usage:
8
- # ./.trellis/scripts/create-bootstrap.sh [project-type]
9
- #
10
- # Arguments:
11
- # project-type: frontend | backend | fullstack (default: fullstack)
12
- #
13
- # Prerequisites:
14
- # - .trellis/.developer must exist (run init-developer.sh first)
15
- #
16
- # Creates:
17
- # .trellis/tasks/00-bootstrap-guidelines/
18
- # ├── task.json # Task metadata
19
- # └── prd.md # Task description and guidance
20
-
21
- set -e
22
-
23
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
24
- source "$SCRIPT_DIR/common/paths.sh"
25
- source "$SCRIPT_DIR/common/developer.sh"
26
-
27
- # Colors
28
- RED='\033[0;31m'
29
- GREEN='\033[0;32m'
30
- YELLOW='\033[1;33m'
31
- BLUE='\033[0;34m'
32
- NC='\033[0m'
33
-
34
- TASK_NAME="00-bootstrap-guidelines"
35
-
36
- # Project type (default: fullstack)
37
- PROJECT_TYPE="${1:-fullstack}"
38
-
39
- # Validate project type
40
- case "$PROJECT_TYPE" in
41
- frontend|backend|fullstack)
42
- ;;
43
- *)
44
- echo -e "${YELLOW}Unknown project type: $PROJECT_TYPE, defaulting to fullstack${NC}"
45
- PROJECT_TYPE="fullstack"
46
- ;;
47
- esac
48
-
49
- # =============================================================================
50
- # PRD Content
51
- # =============================================================================
52
-
53
- write_prd_header() {
54
- cat << 'EOF'
55
- # Bootstrap: Fill Project Development Guidelines
56
-
57
- ## Purpose
58
-
59
- Welcome to Trellis! This is your first task.
60
-
61
- AI agents use `.trellis/spec/` to understand YOUR project's coding conventions.
62
- **Empty templates = AI writes generic code that doesn't match your project style.**
63
-
64
- Filling these guidelines is a one-time setup that pays off for every future AI session.
65
-
66
- ---
67
-
68
- ## Your Task
69
-
70
- Fill in the guideline files based on your **existing codebase**.
71
- EOF
72
- }
73
-
74
- write_prd_backend_section() {
75
- cat << 'EOF'
76
-
77
- ### Backend Guidelines
78
-
79
- | File | What to Document |
80
- |------|------------------|
81
- | `.trellis/spec/backend/directory-structure.md` | Where different file types go (routes, services, utils) |
82
- | `.trellis/spec/backend/database-guidelines.md` | ORM, migrations, query patterns, naming conventions |
83
- | `.trellis/spec/backend/error-handling.md` | How errors are caught, logged, and returned |
84
- | `.trellis/spec/backend/logging-guidelines.md` | Log levels, format, what to log |
85
- | `.trellis/spec/backend/quality-guidelines.md` | Code review standards, testing requirements |
86
- EOF
87
- }
88
-
89
- write_prd_frontend_section() {
90
- cat << 'EOF'
91
-
92
- ### Frontend Guidelines
93
-
94
- | File | What to Document |
95
- |------|------------------|
96
- | `.trellis/spec/frontend/directory-structure.md` | Component/page/hook organization |
97
- | `.trellis/spec/frontend/component-guidelines.md` | Component patterns, props conventions |
98
- | `.trellis/spec/frontend/hook-guidelines.md` | Custom hook naming, patterns |
99
- | `.trellis/spec/frontend/state-management.md` | State library, patterns, what goes where |
100
- | `.trellis/spec/frontend/type-safety.md` | TypeScript conventions, type organization |
101
- | `.trellis/spec/frontend/quality-guidelines.md` | Linting, testing, accessibility |
102
- EOF
103
- }
104
-
105
- write_prd_footer() {
106
- cat << 'EOF'
107
-
108
- ### Thinking Guides (Optional)
109
-
110
- The `.trellis/spec/guides/` directory contains thinking guides that are already
111
- filled with general best practices. You can customize them for your project if needed.
112
-
113
- ---
114
-
115
- ## How to Fill Guidelines
116
-
117
- ### Principle: Document Reality, Not Ideals
118
-
119
- Write what your codebase **actually does**, not what you wish it did.
120
- AI needs to match existing patterns, not introduce new ones.
121
-
122
- ### Steps
123
-
124
- 1. **Look at existing code** - Find 2-3 examples of each pattern
125
- 2. **Document the pattern** - Describe what you see
126
- 3. **Include file paths** - Reference real files as examples
127
- 4. **List anti-patterns** - What does your team avoid?
128
-
129
- ---
130
-
131
- ## Tips for Using AI
132
-
133
- Ask AI to help analyze your codebase:
134
-
135
- - "Look at my codebase and document the patterns you see"
136
- - "Analyze my code structure and summarize the conventions"
137
- - "Find error handling patterns and document them"
138
-
139
- The AI will read your code and help you document it.
140
-
141
- ---
142
-
143
- ## Completion Checklist
144
-
145
- - [ ] Guidelines filled for your project type
146
- - [ ] At least 2-3 real code examples in each guideline
147
- - [ ] Anti-patterns documented
148
-
149
- When done:
150
-
151
- ```bash
152
- ./.trellis/scripts/task.sh finish
153
- ./.trellis/scripts/task.sh archive 00-bootstrap-guidelines
154
- ```
155
-
156
- ---
157
-
158
- ## Why This Matters
159
-
160
- After completing this task:
161
-
162
- 1. AI will write code that matches your project style
163
- 2. Relevant `/trellis:before-*-dev` commands will inject real context
164
- 3. `/trellis:check-*` commands will validate against your actual standards
165
- 4. Future developers (human or AI) will onboard faster
166
- EOF
167
- }
168
-
169
- write_prd() {
170
- local dir="$1"
171
- local project_type="$2"
172
-
173
- {
174
- write_prd_header
175
-
176
- case "$project_type" in
177
- frontend)
178
- write_prd_frontend_section
179
- ;;
180
- backend)
181
- write_prd_backend_section
182
- ;;
183
- fullstack)
184
- write_prd_backend_section
185
- write_prd_frontend_section
186
- ;;
187
- esac
188
-
189
- write_prd_footer
190
- } > "$dir/prd.md"
191
- }
192
-
193
- # =============================================================================
194
- # Task JSON
195
- # =============================================================================
196
-
197
- write_task_json() {
198
- local dir="$1"
199
- local developer="$2"
200
- local project_type="$3"
201
- local today=$(date +%Y-%m-%d)
202
-
203
- # Generate subtasks based on project type
204
- local subtasks
205
- local related_files
206
-
207
- case "$project_type" in
208
- frontend)
209
- subtasks='[
210
- {"name": "Fill frontend guidelines", "status": "pending"},
211
- {"name": "Add code examples", "status": "pending"}
212
- ]'
213
- related_files='[
214
- ".trellis/spec/frontend/"
215
- ]'
216
- ;;
217
- backend)
218
- subtasks='[
219
- {"name": "Fill backend guidelines", "status": "pending"},
220
- {"name": "Add code examples", "status": "pending"}
221
- ]'
222
- related_files='[
223
- ".trellis/spec/backend/"
224
- ]'
225
- ;;
226
- fullstack)
227
- subtasks='[
228
- {"name": "Fill backend guidelines", "status": "pending"},
229
- {"name": "Fill frontend guidelines", "status": "pending"},
230
- {"name": "Add code examples", "status": "pending"}
231
- ]'
232
- related_files='[
233
- ".trellis/spec/backend/",
234
- ".trellis/spec/frontend/"
235
- ]'
236
- ;;
237
- esac
238
-
239
- cat > "$dir/task.json" << EOF
240
- {
241
- "id": "$TASK_NAME",
242
- "name": "Bootstrap Guidelines",
243
- "description": "Fill in project development guidelines for AI agents",
244
- "status": "in_progress",
245
- "dev_type": "docs",
246
- "priority": "P1",
247
- "creator": "$developer",
248
- "assignee": "$developer",
249
- "createdAt": "$today",
250
- "completedAt": null,
251
- "commit": null,
252
- "subtasks": $subtasks,
253
- "relatedFiles": $related_files,
254
- "notes": "First-time setup task created by trellis init ($project_type project)"
255
- }
256
- EOF
257
- }
258
-
259
- # =============================================================================
260
- # Main
261
- # =============================================================================
262
-
263
- main() {
264
- local repo_root=$(get_repo_root)
265
- local developer=$(get_developer "$repo_root")
266
-
267
- # Check developer initialized
268
- if [[ -z "$developer" ]]; then
269
- echo -e "${RED}Error: Developer not initialized${NC}"
270
- echo "Run: ./$DIR_WORKFLOW/$DIR_SCRIPTS/init-developer.sh <your-name>"
271
- exit 1
272
- fi
273
-
274
- local tasks_dir=$(get_tasks_dir "$repo_root")
275
- local task_dir="$tasks_dir/$TASK_NAME"
276
- local relative_path="$DIR_WORKFLOW/$DIR_TASKS/$TASK_NAME"
277
-
278
- # Check if already exists
279
- if [[ -d "$task_dir" ]]; then
280
- echo -e "${YELLOW}Bootstrap task already exists: $relative_path${NC}"
281
- exit 0
282
- fi
283
-
284
- # Create task directory
285
- mkdir -p "$task_dir"
286
-
287
- # Write files
288
- write_task_json "$task_dir" "$developer" "$PROJECT_TYPE"
289
- write_prd "$task_dir" "$PROJECT_TYPE"
290
-
291
- # Set as current task
292
- set_current_task "$relative_path" "$repo_root"
293
-
294
- # Silent output - init command handles user-facing messages
295
- # Only output the task path for programmatic use
296
- echo "$relative_path"
297
- }
298
-
299
- main "$@"
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- # Get Session Context for AI Agent
3
- #
4
- # This is a wrapper that calls the actual implementation in common/git-context.sh
5
-
6
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
- exec "$SCRIPT_DIR/common/git-context.sh" "$@"
@@ -1,15 +0,0 @@
1
- #!/bin/bash
2
- # Get current developer name
3
- #
4
- # This is a wrapper that uses common/paths.sh
5
-
6
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
- source "$SCRIPT_DIR/common/paths.sh"
8
-
9
- developer=$(get_developer)
10
- if [[ -n "$developer" ]]; then
11
- echo "$developer"
12
- else
13
- echo "Developer not initialized" >&2
14
- exit 1
15
- fi
@@ -1,34 +0,0 @@
1
- #!/bin/bash
2
- # Initialize developer for workflow
3
- #
4
- # Usage:
5
- # ./.trellis/scripts/init-developer.sh <developer-name>
6
- #
7
- # This creates:
8
- # - .trellis/.developer file with developer info
9
- # - .trellis/workspace/<name>/ directory structure
10
-
11
- set -e
12
-
13
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
- source "$SCRIPT_DIR/common/paths.sh"
15
- source "$SCRIPT_DIR/common/developer.sh"
16
-
17
- if [[ -z "$1" ]]; then
18
- echo "Usage: $0 <developer-name>"
19
- echo ""
20
- echo "Example:"
21
- echo " $0 john"
22
- exit 1
23
- fi
24
-
25
- # Check if already initialized
26
- existing=$(get_developer)
27
- if [[ -n "$existing" ]]; then
28
- echo "Developer already initialized: $existing"
29
- echo ""
30
- echo "To reinitialize, remove $DIR_WORKFLOW/$FILE_DEVELOPER first"
31
- exit 0
32
- fi
33
-
34
- init_developer "$1"