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.
- package/README.md +71 -24
- package/bin/cli.js +45 -0
- package/package.json +10 -4
- package/src/agent/core/PanelBridge.js +133 -0
- package/src/agent/core/RetryManager.js +51 -0
- package/src/agent/core/StreamHandler.js +263 -0
- package/src/agent/core/index.js +7 -0
- package/src/agent/errors/ErrorClassifier.js +43 -0
- package/src/agent/errors/SpiderError.js +68 -0
- package/src/agent/errors/index.js +19 -0
- package/src/agent/run.js +67 -460
- package/src/agent/setup.js +14 -14
- package/src/agent/subagents/factory.js +60 -0
- package/src/agent/subagents/index.js +3 -0
- package/src/agent/tools/report.js +36 -4
- package/src/browser/client.js +47 -10
- package/src/cli/commands/config.js +94 -0
- package/src/cli/commands/help.js +34 -0
- package/src/cli/commands/update.js +78 -0
- package/src/cli/commands/version.js +9 -0
- package/src/cli/config.js +15 -0
- package/src/config/settings.js +102 -0
- package/.claude/agents/check.md +0 -122
- package/.claude/agents/debug.md +0 -106
- package/.claude/agents/dispatch.md +0 -214
- package/.claude/agents/implement.md +0 -96
- package/.claude/agents/plan.md +0 -396
- package/.claude/agents/research.md +0 -120
- package/.claude/commands/evolve/merge.md +0 -80
- package/.claude/commands/trellis/before-backend-dev.md +0 -13
- package/.claude/commands/trellis/before-frontend-dev.md +0 -13
- package/.claude/commands/trellis/break-loop.md +0 -107
- package/.claude/commands/trellis/check-backend.md +0 -13
- package/.claude/commands/trellis/check-cross-layer.md +0 -153
- package/.claude/commands/trellis/check-frontend.md +0 -13
- package/.claude/commands/trellis/create-command.md +0 -154
- package/.claude/commands/trellis/finish-work.md +0 -129
- package/.claude/commands/trellis/integrate-skill.md +0 -219
- package/.claude/commands/trellis/onboard.md +0 -358
- package/.claude/commands/trellis/parallel.md +0 -193
- package/.claude/commands/trellis/record-session.md +0 -62
- package/.claude/commands/trellis/start.md +0 -280
- package/.claude/commands/trellis/update-spec.md +0 -213
- package/.claude/hooks/inject-subagent-context.py +0 -758
- package/.claude/hooks/ralph-loop.py +0 -374
- package/.claude/hooks/session-start.py +0 -126
- package/.claude/settings.json +0 -41
- package/.claude/skills/deepagents-guide/SKILL.md +0 -428
- package/.cursor/commands/trellis-before-backend-dev.md +0 -13
- package/.cursor/commands/trellis-before-frontend-dev.md +0 -13
- package/.cursor/commands/trellis-break-loop.md +0 -107
- package/.cursor/commands/trellis-check-backend.md +0 -13
- package/.cursor/commands/trellis-check-cross-layer.md +0 -153
- package/.cursor/commands/trellis-check-frontend.md +0 -13
- package/.cursor/commands/trellis-create-command.md +0 -154
- package/.cursor/commands/trellis-finish-work.md +0 -129
- package/.cursor/commands/trellis-integrate-skill.md +0 -219
- package/.cursor/commands/trellis-onboard.md +0 -358
- package/.cursor/commands/trellis-record-session.md +0 -62
- package/.cursor/commands/trellis-start.md +0 -156
- package/.cursor/commands/trellis-update-spec.md +0 -213
- package/.github/workflows/publish.yml +0 -63
- package/.husky/pre-commit +0 -1
- package/.mcp.json +0 -8
- package/.trellis/.template-hashes.json +0 -65
- package/.trellis/.version +0 -1
- package/.trellis/scripts/add-session.sh +0 -384
- package/.trellis/scripts/common/developer.sh +0 -129
- package/.trellis/scripts/common/git-context.sh +0 -263
- package/.trellis/scripts/common/paths.sh +0 -208
- package/.trellis/scripts/common/phase.sh +0 -150
- package/.trellis/scripts/common/registry.sh +0 -247
- package/.trellis/scripts/common/task-queue.sh +0 -142
- package/.trellis/scripts/common/task-utils.sh +0 -151
- package/.trellis/scripts/common/worktree.sh +0 -128
- package/.trellis/scripts/create-bootstrap.sh +0 -299
- package/.trellis/scripts/get-context.sh +0 -7
- package/.trellis/scripts/get-developer.sh +0 -15
- package/.trellis/scripts/init-developer.sh +0 -34
- package/.trellis/scripts/multi-agent/cleanup.sh +0 -396
- package/.trellis/scripts/multi-agent/create-pr.sh +0 -241
- package/.trellis/scripts/multi-agent/plan.sh +0 -207
- package/.trellis/scripts/multi-agent/start.sh +0 -310
- package/.trellis/scripts/multi-agent/status.sh +0 -828
- package/.trellis/scripts/task.sh +0 -1118
- package/.trellis/spec/backend/ci-cd-guidelines.md +0 -73
- package/.trellis/spec/backend/deepagents-guide.md +0 -380
- package/.trellis/spec/backend/directory-structure.md +0 -126
- package/.trellis/spec/backend/examples/skills/deepagents-guide/README.md +0 -11
- package/.trellis/spec/backend/examples/skills/deepagents-guide/agent.js.template +0 -20
- package/.trellis/spec/backend/examples/skills/deepagents-guide/skills-config.js.template +0 -13
- package/.trellis/spec/backend/examples/skills/deepagents-guide/subagent.js.template +0 -19
- package/.trellis/spec/backend/hook-guidelines.md +0 -218
- package/.trellis/spec/backend/index.md +0 -37
- package/.trellis/spec/backend/quality-guidelines.md +0 -302
- package/.trellis/spec/backend/state-management.md +0 -76
- package/.trellis/spec/backend/tool-guidelines.md +0 -144
- package/.trellis/spec/backend/type-safety.md +0 -71
- package/.trellis/spec/guides/code-reuse-thinking-guide.md +0 -92
- package/.trellis/spec/guides/cross-layer-thinking-guide.md +0 -94
- package/.trellis/spec/guides/index.md +0 -79
- package/.trellis/tasks/archive/02-02-evolving-skills/prd.md +0 -61
- package/.trellis/tasks/archive/02-02-evolving-skills/task.json +0 -29
- package/.trellis/tasks/archive/2026-02/00-bootstrap-guidelines/prd.md +0 -86
- package/.trellis/tasks/archive/2026-02/00-bootstrap-guidelines/task.json +0 -27
- package/.trellis/tasks/archive/2026-02/02-02-skills-system/check.jsonl +0 -3
- package/.trellis/tasks/archive/2026-02/02-02-skills-system/debug.jsonl +0 -2
- package/.trellis/tasks/archive/2026-02/02-02-skills-system/implement.jsonl +0 -5
- package/.trellis/tasks/archive/2026-02/02-02-skills-system/prd.md +0 -33
- package/.trellis/tasks/archive/2026-02/02-02-skills-system/task.json +0 -41
- package/.trellis/workflow.md +0 -407
- package/.trellis/workspace/index.md +0 -123
- package/.trellis/workspace/pony/index.md +0 -42
- package/.trellis/workspace/pony/journal-1.md +0 -125
- package/.trellis/worktree.yaml +0 -47
- package/AGENTS.md +0 -18
- package/CLAUDE.md +0 -315
- package/agents/deepspider.md +0 -142
- package/docs/DEBUG.md +0 -42
- package/docs/GUIDE.md +0 -334
- package/docs/PROMPT.md +0 -60
- package/docs/USAGE.md +0 -226
- package/eslint.config.js +0 -51
- package/test/analyze.test.js +0 -90
- package/test/envdump.test.js +0 -74
- package/test/flow.test.js +0 -90
- package/test/hooks.test.js +0 -138
- package/test/plugin.test.js +0 -35
- package/test/refactor-full.test.js +0 -30
- package/test/refactor.test.js +0 -21
- package/test/samples/obfuscated.js +0 -61
- package/test/samples/original.js +0 -66
- package/test/samples/v10_eval_chain.js +0 -52
- package/test/samples/v11_bytecode_vm.js +0 -81
- package/test/samples/v12_polymorphic.js +0 -69
- package/test/samples/v1_ob_basic.js +0 -98
- package/test/samples/v2_ob_advanced.js +0 -99
- package/test/samples/v3_jjencode.js +0 -77
- package/test/samples/v4_aaencode.js +0 -73
- package/test/samples/v5_control_flow.js +0 -86
- package/test/samples/v6_string_encryption.js +0 -71
- package/test/samples/v7_jsvmp.js +0 -83
- package/test/samples/v8_anti_debug.js +0 -79
- package/test/samples/v9_proxy_trap.js +0 -49
- package/test/samples.test.js +0 -96
- package/test/webcrack.test.js +0 -55
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeepSpider - 错误分类器
|
|
3
|
+
* 判断错误类型,决定重试策略
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 判断是否为工具参数错误(需要 LLM 修正)
|
|
8
|
+
*/
|
|
9
|
+
export function isToolSchemaError(errMsg) {
|
|
10
|
+
return /did not match expected schema|Invalid input|tool input/i.test(errMsg);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 判断是否为 API 服务错误(可直接重试)
|
|
15
|
+
*/
|
|
16
|
+
export function isApiServiceError(errMsg) {
|
|
17
|
+
return /503|502|429|rate limit|无可用渠道|timeout|ECONNRESET|ETIMEDOUT/i.test(errMsg);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 判断是否为浏览器错误
|
|
22
|
+
*/
|
|
23
|
+
export function isBrowserError(errMsg) {
|
|
24
|
+
return /Target closed|page closed|context closed|browser disconnected/i.test(errMsg);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 判断是否为网络错误
|
|
29
|
+
*/
|
|
30
|
+
export function isNetworkError(errMsg) {
|
|
31
|
+
return /ENOTFOUND|ECONNREFUSED|network|fetch failed/i.test(errMsg);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 获取错误类型
|
|
36
|
+
*/
|
|
37
|
+
export function classifyError(errMsg) {
|
|
38
|
+
if (isToolSchemaError(errMsg)) return 'tool_schema';
|
|
39
|
+
if (isApiServiceError(errMsg)) return 'api_service';
|
|
40
|
+
if (isBrowserError(errMsg)) return 'browser';
|
|
41
|
+
if (isNetworkError(errMsg)) return 'network';
|
|
42
|
+
return 'unknown';
|
|
43
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeepSpider - 结构化错误类型
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 基础错误类
|
|
7
|
+
*/
|
|
8
|
+
export class SpiderError extends Error {
|
|
9
|
+
constructor(message, code, details = {}) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = 'SpiderError';
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.details = details;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
toJSON() {
|
|
17
|
+
return {
|
|
18
|
+
name: this.name,
|
|
19
|
+
code: this.code,
|
|
20
|
+
message: this.message,
|
|
21
|
+
details: this.details,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* API 服务错误 - 503/502/429 等
|
|
28
|
+
*/
|
|
29
|
+
export class ApiServiceError extends SpiderError {
|
|
30
|
+
constructor(message, details = {}) {
|
|
31
|
+
super(message, 'API_SERVICE_ERROR', details);
|
|
32
|
+
this.name = 'ApiServiceError';
|
|
33
|
+
this.retryable = true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 工具参数错误 - 工具调用参数不匹配
|
|
39
|
+
*/
|
|
40
|
+
export class ToolSchemaError extends SpiderError {
|
|
41
|
+
constructor(message, details = {}) {
|
|
42
|
+
super(message, 'TOOL_SCHEMA_ERROR', details);
|
|
43
|
+
this.name = 'ToolSchemaError';
|
|
44
|
+
this.retryable = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 浏览器错误 - 页面关闭、上下文丢失等
|
|
50
|
+
*/
|
|
51
|
+
export class BrowserError extends SpiderError {
|
|
52
|
+
constructor(message, details = {}) {
|
|
53
|
+
super(message, 'BROWSER_ERROR', details);
|
|
54
|
+
this.name = 'BrowserError';
|
|
55
|
+
this.retryable = false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 网络错误 - 连接失败、DNS 解析等
|
|
61
|
+
*/
|
|
62
|
+
export class NetworkError extends SpiderError {
|
|
63
|
+
constructor(message, details = {}) {
|
|
64
|
+
super(message, 'NETWORK_ERROR', details);
|
|
65
|
+
this.name = 'NetworkError';
|
|
66
|
+
this.retryable = true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeepSpider - Errors 模块索引
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
isToolSchemaError,
|
|
7
|
+
isApiServiceError,
|
|
8
|
+
isBrowserError,
|
|
9
|
+
isNetworkError,
|
|
10
|
+
classifyError,
|
|
11
|
+
} from './ErrorClassifier.js';
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
SpiderError,
|
|
15
|
+
ApiServiceError,
|
|
16
|
+
ToolSchemaError,
|
|
17
|
+
BrowserError,
|
|
18
|
+
NetworkError,
|
|
19
|
+
} from './SpiderError.js';
|